fceu-0.98.12/0002755000175000000620000000000010112240346012505 5ustar joestaff00000000000000fceu-0.98.12/AUTHORS0000644000175000000620000000151010052171655013561 0ustar joestaff00000000000000A list of people who have contributed code to FCE Ultra, or have had their code placed in FCE Ultra by others. Please note that the "Contributions" field may not be all inclusive; the coder may have done more than what is listed. Name/Alias Contributions Contact Information ------------------------------------------------------------------------------ Aaron Oneal Many changes to compile http://www.morphgear.com with MSVC and first frame skipping code. BERO Base FCE code. bero at geocities.co.jp CaH4e3 Some mapper code. CaH4e3 at mail dot ru Joe Nahmias man pages. Mitsutaka YM2413 emulator. Okazaki Paul Various code for the official kuliniew at purdue.edu Kuliniewicz SDL port. Quietust VRC7 "translation" code. quietust at ircN dot org Xodnizel Most of the FCE Ultra code. http://xodnizel.net/ fceu-0.98.12/COPYING0000644000175000000620000004313207757447436013577 0ustar joestaff00000000000000 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) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 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. fceu-0.98.12/README0000644000175000000620000000000007770744017013375 0ustar joestaff00000000000000fceu-0.98.12/ChangeLog0000644000175000000620000024206110114011737014264 0ustar joestaff000000000000000.98.12: Win32: Fixed the behavior of the sound logging function. Fixed a bug that was causing 2xscale/3xscale to be broken when clipping the leftmost and rightmost 8 columns. Added an iNES header correction entry for JustBreed. Modified the MMC5 "ELROM" board emulation to not emulate WRAM. Corrected various pieces of code that were causing compiler warnings. Win32: Scaling settings(x, y, stretch to fill screen) are now respected while using a special scaler in full screen mode, though if x or y scale is less than what is needed for a particular scaler, it will be adjusted. Win32: The window will be reblitted when it becomes invalidated while a game is loaded(such as when you're resizing the window). When the PPU is in a "dead" state after starting up, the graphics buffer is now cleared. Previously, particularly in the Windows port, when a game was closed, and a new game was loaded, the last image from the previous game would be displayed for a short time. Win32: Blit skipping will now occur when sound is disabled and FCE Ultra is running behind the desired frame rate. Win32: Blit-skipping behavior can now be configured to some extent in the "Timing" configuration window. Win32: Added a "Recent Directories" submenu to the "File" menu. Removed some debugging code that shouldn't have been enabled in 0.98.11. 0.98.11: Win32: Special scalers are now also supported in windowed mode. For Scale2x/Scale3x, the fastest "desktop" bit depth is 16bpp. For hq2x/hq3x, it is 32bpp. The shared video blitting code(drivers/common/vidblit.c) can now blit using Scale2x and Scale3x to any target bit depth(8bpp, 16bpp, 24bpp, and 32bpp) instead of just 8bpp, as it was before. HQ2x and HQ3x can now blit to 16bpp, 24bpp(untested), and 32bpp. The 16bpp and 24bpp targets are done doing post-processing conversion, after HQ2x/HQ3x, which really does hurt speed. Changed a few names in the credits section of the documentation to their aliases. Names you didn't get to pick to have are so troublesome. :b I also made various fixes/updates to the documentation. Updated the FAQ with some information regard video mode bit depths and speed. SDL: Disabled the fast-forward-key speed-limiting code. I thought I had done this before... Fixed a major bug in the movie recording code, and added some code to automatically detect and fix playback of broken movies from earlier versions. Did a little swapping thing with mapper 90 and 209. I moved back Mortal Kombat 3 to mapper 90, and moved Shin Samurai Spirits 2 to mapper 209. Sorry for any confusion. Mapper 90 should be considered as having the fancy nametable select mode disabled, with mapper 209 having it enabled. Added support for mapper 160, which turns out to be the same hardware as mapper 90. Joy. Improved mapper 90 emulation. This mapper really needs low-level emulation for IRQs to work right, though. :/ Win32: Fixed the "hide left/right 8 video columns" feature. Since FCE Ultra is ending(or has already exceeded? :b) its actively-updated life, I've gone ahead and added per-game hacks for "Kick Master" and the PAL version of "Star Wars". See the documentation for more details. Minor optimizations to the high-quality sound emulation code. The FIR filter code is the bottleneck, though, so these changes won't have much of an effect on overall speed. Altered MMC3 IRQ emulation(and the hooks in ppu.c for it). Fixed a rather major typo in the VRC7-emulation code. 0.98.10: Reimplemented network play. It now requires a standalone network play server, which will be released as a later time. For fun, "starmen.net" is running this server, which is publicly accessible. I also made various code fixes/improvements to allow for network play, particularly with the command handling code. Reworked much of the VS Unisystem emulation code, partially based on information from MAME. The following games are now supported: Battle City Castlevania Clu Clu Land Dr. Mario Duck Hunt Excitebike Excitebike (Japanese) Freedom Force Goonies, The Gradius Gumshoe Hogan's Alley Ice Climber Ladies Golf Mach Rider Mach Rider (Japanese) Mighty Bomb Jack (Japanese) Ninja Jajamaru Kun (Japanese) Pinball Pinball (Japanese) Platoon RBI Baseball Slalom Soccer Star Luster Stroke and Match Golf Stroke and Match Golf - Ladies Stroke and Match Golf (Japanese) Super Mario Bros. Super Sky Kid Super Xevious Tetris TKO Boxing Top Gun Win32-native: Fixed a bug in the debugger's breakpoint list that appeared when one tried to delete a breakpoint(the control accidentally had auto-sort enabled, causing a discrepancy between what was displayed and what was contained in internal data structures). The current disk image XOR original disk image is now stored in save states. This should greatly increase compressability(important for network play), and make it a little more legal to distribute such save states now. Modified the save state format to allow for more precise and larger version numbers. Various minor code changes. Fixed initialization of the FCEUGameInfo structure, which previously led to problems with sound output on the SexyAL-using ports(Linux). Apparently I added support for mapper 255 a while back. Documentation updated. Added iNES header correction information for Armored Scrum Object and Alpha Mission. Merged banksw.h into ines.c, fixed some of its prototypes in ines.h. 0.98.9: Win32-native: Fixed the speed throttling used when sound is disabled. In previous 0.98.x Win32-native releases, emulation was running at 1/2 the speed it should have been when sound was disabled. Win32-native: Moved settings in the "Miscellaneous" configuration window to where they should have been in the first place, and added "GUI" and "Timing" configuration windows to accommodate some. Win32-native: Fixed the handling of the "Scroll Lock" key used to disable and enable Family BASIC Keyboard input. Updated documentation to handle some slight differences in the Win32-native port("Win32-native" is what the Win32 port using native APIs, as opposed to something like GTK+ and SDL, will be referred to in documentation now). I also made some other minor wording adjustments to the documentation. Added an iNES header correction for Dragonball. 0.98.8: Fixed a typo in sound.c that caused only part of the sound registers to be saved in save states. Win32: Switched over to the DirectDraw7 interface, from DirectDraw4's. The surface Flip() method will now block, which results in somewhat smoother animation/scrolling, especially when combined with the auto blit-skip implemented in 0.98.6 when sound is enabled. Win32: Undid a change made in the last release that limited the speed of fast-forwarding when using the tilde key. I really do need to implement some sort of unified timing/blit skip system... Win32: Added an option, disabled by default, to ask for confirmation before exiting FCE Ultra. Win32: Added an option, enabled by default, to disable the system screen saver while a game is loaded. Win32: Added a new video synchronization mode, a "lazy" wait for vblank/vertical retrace. It calls Sleep(0) in its wait loop. This still uses all available cpu cycles, but it is much more friendly to other processes than the old-style wait for vblank. Win32: Added support for joystick POV hats. 0.98.7: Fixed a bug in the debugger's disassembler when disassembling opcode 0xBC. Fixed the behavior of the right mouse button with zapper emulation, to correspond with what it is documented as doing. Win32: Added proper support for maximizing the window. Win32: Rewrote most of the input and input configuration code. Win32: Changed the configurable aspect ratio to something sensical, the current display's pixel aspect ratio, default of 1:1(square pixels). Win32: Made the default full-screen video mode the custom video mode. I should have done this a long time ago to make custom video mode configuration more straighforward for users... Added some JACK audio code to be used by the SDL build. I'll test it and complete it later. 0.98.6: Made several code modifications to work with older versions of gcc. Fixed more header file network play #ifdef-age. Fixed a typo in cart.h. Fixed some funky code in FCEU_memmove(). Fixed some source code causing compiler warnings. Fixed SexyAL's format conversion code to not rely on deprecated casting semantics. Readded the native Win32 code, and made many improvements. The major thing that needs to be done now with it is to rewrite the input handling code and input configuration code. 0.98.5: Added LL to the 64-bit integer constants in ines.c Fixed OpenGL support under Mac OS X. Added the ability to hide background and/or sprites with the F4 key. 0.98.4: Moved NETWORK #ifdef's to netplay.c to simplify things. Fixed gzip file loading code(I think). I'm still a bit unsure about the semantics of dup() and close(), though. Corrected FDS code to try loading the FDS image before loading the BIOS. Readded "native" SDL sound code, used for Mac OS X(and maybe BeOS). 0.98.3: Removed the wxWindows GUI code. GTK+ 2 code will take its place, once it is ready. Added reset and power commands to the movie format. More commands(such as insert disk, eject disk, flip dip switch, etc.) will be added simultaneously as work on network play continues. Modified SexyAL OSS code to not adjust the number of fragments to a power of 2. It works fine on my card, allowing finer-grained buffer size control, but I'm not sure it will work with all chips. Fixed parsing of the "-specialfs" command-line argument. Added the hq3x scaler. Updated to the latest Scale2x code. I also added the Scale3x scaler. Changed the keyboard assignments for toggling full screen to "Alt" + "Enter". FCEUI_SaveState() and FCEUI_LoadState() changed. Porters should read driver.h. Miscellaneous changes to accommodate new network play plan. It's not close to being finished. Altered RTI emulation. In Paris Dakar Rally's NMI handler, it does "CLI ; RTI". Previously, FCE Ultra would generate an interrupt right after RTI occured, due to the presumed latency that RTI had with the I flag. I changed it so there is no latency, so no interrupt will occur in this case(interrupts kill this game). The interrupt source is the "frame IRQ", which it never disables, if anyone cares. This change does break the "Stars SE" demo, though. Hmm. "FCEUGameInfo" is now a pointer, rather than just a statically-allocated structure. This may cause some null-dereferencing-related crashes, but it should help keep code a little cleaner(maybe?). Played around with the FDS FM code some more. It's still not right. Bah. Hacked in support for entering Datach/Barcode World barcodes without a GUI, using the F8 key and the numeric keys. Added code to save/load movies. Movie support will only record/play back the states of the four emulated gamepads. Modified the sound code to use timestamp/timestampbase differently. In addition, timestampbase is now saved in save states("timestamp" doesn't need to be saved, since it's reset to 0 at the end of each emulated frame). 0.98.2: Fixed a few problems with the SDL command-line build code for Win32. Also, SDL 1.2.7 seems to have a bug that breaks FCE Ultra's full-screen/windowed switching capabilities(at least under Win32). Stupid everything. Minor SexyAL changes. Updated documentation. 0.98.1: Increased the volume of the FME07 sound channels. Fixed a bug in the SexyAL endian conversion code. Made the SexyAL chunk conversion loop work. Replaced the old OPL2 emulator with a modified version of Mitsutaka Okazaki's YM2413 emulator for the VRC7 sound emulation. Decreased the pitch of the FME 07 expansion sound channels by one octave. Decreased volume of output of $5011 in MMC5 emulation code. 0.98.0: Some changes I made aren't listed below. Ah well. The magnitude of the changes was too great... Default sound volume is 100(%), which makes a lot more sense than 75%, but not much. It's multiplied by 3/4 internally now. Added support for the Datach barcode reader(GUI interface only). The emulation code was adapted from the VirtuaNES source code. Reassigned the Datach games to mapper 157, from 16, with CRC32 checks. Increased the maximum number of screen snapshots in the snapshots directory to 99999(from 999). Reassigned the following games to mapper 210, using CRC32 checks: Chibi Maruko Chan Dream Master Family Circuit '91 Famista '92 Famista '93 Famista '94 Heisei Tensai Bakabon Top Striker Wagyan Land 2 Wagyan Land 3 If you use a hack/translation of one or more of these games, you will of course need to manually change the mapper number in the header for it to work properly in FCE Ultra. Family Circuit '91 still may not fit in with the rest of these games, but it's definitely not a "stock" mapper 19 setup. Fixed an OpenGL palette bug when using scanlines(previously, I think it was setting the palette of the scanlines overlay texture instead of the actual image texture in some instances). The bug showed up on games that make use of the color deemphasis bits. Rewrote a lot of the PPU background rendering code to be more accurate(and obfuscated!). This eliminates the X-offset hack I made earlier. Removed some of the NSF visualization code, and altered the look of the NSF display slightly. The NSF waveform visualization code will now take into account the current volume setting. Changed the default key bindings for the standard emulated gamepad to something more compatible with window managers. I may change it back, but probably not, since it is easily configurable now. Updated the MMC5, VRC6, and FME07 low-quality sound emulation code with the compatible parts of the high-quality sound emulation code for those chips. Adjusted timing of horizontal scroll update(near the beginning of hblank. I made it occur sooner). I also added a hack to allow X-offset(fine X scroll) changes mid scanline, however, it is extremely ugly, and may not work correctly for everything (doing it correctly would probably kill speed). I mainly did it to fix games like F-1 Race and Mach Rider, and other racing games that are extremely sensitive to horizontal scrolling timing. Some FDS IRQ emulation changes to fix some screen corruption problems in "Kaettekita Mario Bros". Removed zlib(the code, not support). I also removed support for compiling without zlib(it's small, simple, provides very useful functions, and may provide critical features for fceu in the future). *undone, breaks debugger, FIXME.* Replaced some inline functions with macros in x6502.c. Increased the speed of Namco 106 sound emulation in HQ sound mode. Many many sound emulation changes and adjustments based on blargg's tests. The default sound volume is about 150% what it was before, because the sound range has changed(now -soundvol 100 is like -soundvol 200 on older builds), and the default "soundvol" setting is 75. 100 clips on some Namco games, and 200 clips on many games, so I'll probably have the configurable volume range as [0:125]. What exactly is "%" supposed to mean in this case.... 100% of what?! When using low-quality sound emulation mode, total emulation speed is about 10% less than previous builds. The change in speed for high-quality sound emulation mode is significantly less. Added beginnings of SexyAL to source code tree, removed SDL sound support, and old OSS code. Copied over some autoconf/automake stuff from phamicom. It stills needs a bit of work... Fixed DMC IRQ emulation. Fixes many CodeMasters games. Finally. ^_^ Restructured a lot of files, changed the interface between driver and emulator code slightly. * Insert stuff here * November 28, 2003 - Snapshot Removed the DOS, Linux SVGAlib, and Win32 targets. *GASP* Win32 support will return(eventually), using SDL + wxWindows. SDL can use svgalib or GGI anyway, so it shouldn't be a huge loss. DOS support will only return if someone ports SDL to DOS. ^_^ It would be nice if SDL could accept modelines. Maybe in SDL 2.0... Merged fce.c and svga.c into fceu.c, and fce.h and svga.h into fceu.h. Reassigned "Mortal Kombat 3 - Special 56 Peoples" to mapper 209. Added emulation of the "Oeka Kids" tablet. Added emulation of the Family Trainer. Added emulation of the "Ultimate Quiz King" buzzers. Added emulation of the Mahjong controller. Added emulation of HyperShot controllers. Fixed loading of NSFs with load addresses below $8000. Cleaned and simplified some of the NES APU code. Altered mapper 65 emulation. Fixes Kaiketsu Yanchamaru 3. Does it break anything? Wrote a small FAQ file. Fixed displaying of garbage and other unpleasantness on the first scanline. I need to clean up that code, though. Fixed color deemphasis emulation when all bits are set. For some reason, I had commented out the code. Bleh. NSF player now writes $C0 to $4017 if the FDS is being used(the FDS BIOS writes $C0 to $4017). $40 for all other NSFs. Added support for iNES mapper 58(nnnesterj). Added support for iNES mapper 208. Reassigned "Fudou Myouou Den" to mapper 207(CRC32 checks). Reassigned "Karnov" to mapper 206(CRC32 checks). Fixed the mapper 95 code, which was horribly broken. Differentiated between mappers 33 and 48. Added CRC checks to assign some games to mapper 48. "Flintstones 2" and "Don Doko Don 2" are the games that need to be assigned to 48. Are there others? Replaced usage of TriggerIRQ to X6502_IRQBegin/X6502_IRQEnd combos in various mapper emulation files. 67, 33/48, 40, 73, 42, 65, 6, 182 Removed function TriggerIRQ() from x6502.c Fixed the sound volume of the VRC7 emulation in high-quality sound mode. Decreased(slightly) the volume of VRC7 emulation in both high-quality sound modes. Decreased the volume of the MMC5 expansion sound channels. Decreased the volume of the FME-7/mapper 69 expansion sound channels. Added FCEU_gmalloc(), which will call exit() if memory allocation fails, otherwise it is guaranteed to return a memory block. This will be used in the mapper code mainly. It should only be used for small memory chunks. The reasoning is that if 64 some like KB of RAM or less can't be allocated, for example, it'd probably be best to exit the emulator ASAP. It also helps to simplify code logic, and help (me) with modularization. The behavior of this may change in the future. I still need to think about it. I should probably save the configuration file regularly(or much better, use the registry) on the Windows port, though. Cleaned up the save-state saving/loading code a bit, and added support for linked save state structures for better modularity and less code duplication. Merged the iNES and UNIF MMC1, MMC3, and MMC5 code more completely. I may need to sanify CHR RAM and WRAM allocation for pedanticness, though. Also worked on Tengen RAMBO-1 emulation, and mapper 90 emulation. ***THIS MAKES SAVE STATES FOR GAMES THAT USE THESE EXPANSION CHIPS INCOMPATIBLE WITH PREVIOUS VERSIONS*** I plan on doing the same thing with other mappers/boards in the future, though. Always on the quest for 1.0... November 12, 2003 - 0.97.5 Release Windows: Added limited support for arguments that change configuration to be passed to FCE Ultra. Example: fceu -pal 1 c:\streetgangs.nes It may be useful in frontends. Fixed filename generation for automatic IPS patching when a file with no extension is loaded. Before this change, FCEU would look for "game..ips" with a file named "game". Converted and updated the cheat guide in(to) HTML. Added support for iNES mappers 202,203,231 from info from cah4e3. Fixed support for mappers 60, 200. Fixed various major bugs in the breakpoint deletion code. UN*X: Added support for OSS(/dev/dsp) devices that don't support mono sound. Increased PPU startup idle time to 2 frames. Fixes that unlicensed "Earthworm Jim 3" game. Does it break anything? November 9, 2003 - 0.97.4 Release Fixed another obscure PPU emulation screen corruption bug. Added support for Game Genie cheats in the cheat interface. Windows: Reworked the cheat interface, merging the cheat search and cheat list windows into one. Windows: Greatly improved the CPU debugger. The code still needs a lot of cleaning, though. Readjusted VRC6 IRQ emulation timing. Added support for the UNIF MMC3 board TEROM. The maximum PRG/CHR sizes may not be correct in this implementation, though. November 8, 2003 - 0.97.3 Release Added a control to set the highest quality sound mode in Windows. This change requires that any users who previously set "high quality sound" to set it again. Fixed the volume of high-quality sound mode again. The changes I made earlier didn't affect all the filter coefficients. November 8, 2003 - 0.97.2 Release Made a minor optimization to writes to palette memory. Altered VRC6 IRQ emulation timing slightly. Fixed a weirdo PPU emulation bug that could cause garbage on the right side of the screen in certain situations. Thanks to FrenziedPanda for bugging me enough to make me look into the problem and fix it. I should be on the lookout to see if the fix breaks anything, though. Fixed the volume of high-quality sound mode(-soundq 1). It was at 1/4 the volume it should have been. I compensated by increasing the precision of the filter coefficients, which increased the sound quality of that mode slightly without hurting performance. November 7, 2003 - 0.97.1 Release Fixed mapper 105 emulation. I had begun merging it into the rest of the MMC1 code for 0.97, but I hadn't finished it. Changed things like RdMem(_PC++); to RdMem(_PC); _PC++; Darn evil global variables. I need to fix them. Screw speed. Expanded checks for the global variable "fceuindbg"(used in debug mode to prevent reads in the debugger from altering any registers). November 6, 2003 - 0.97 Release * Note: I still had much more I had wanted to get done for 0.97, but I lost even more interest. The Windows port still doesn't have a way to enable the "highest" sound emulation mode, nor the low pass filter code, not to mention that the lowpass filter code isn't complete(I would need to design a high-order FIR filter from an IIR filter to work properly-have the correct rolloff, among other things-at finite playback rates). Fixed a bug in the IPS patcher. The recorded size wasn't being updated after a successful realloc() was made, which could lead to corrupted patch data from some patches. Added support for mappers 200, 201 from submitted code. Rewrote mapper 15 support to make more sense(well, depending on your point of view...). Fixed 256KB CHR select support for mapper 115. Added support for mapper 12 from code from cah4e3. October 16, 2003 - Snapshot Fixed support for mapper 245(for nonencrypted/non-smynes-screwed up ROM images only. Fixes "Yong Zhe Dou E Long [...] Dragon Quest 7". Added support for mappers 60, 62, 230, 244 from submitted code. Modified mapper 90 emulation to allow game-select on reset for "Final Fight 3". Modified mapper 45 emulation to allow "Super 8-in-1" to work. Added a low-pass filter, and an option to enable it(CLI ports). 0x00 is now written to $4011 in the NSF player code instead of 0x40. Fixed some other similar sound register init problems that I had fixed in Festalon but forgot to fix in FCEU. Grrr. Removed some unnecessary 64-bit integer usage from FIR sound filtering code. Added a new sound quality mode. Higher than high, it's highest(in FCE Ultra, for now). Still need to fix the interface to allow enabling it in the Windows port. Added some code for lower-level MMC3 IRQ emulation. It isn't completed , and will not work properly as-is. I'm still playing around with it occasionally. Fixed the sprite overflow flag(I think I fixed it), that was broken in an earlier pre-0.97 release. Fixed support for iNES mapper 193. Command line arguments "-pal" and "-gg" now take extra arguments(1/0) and are remembered in the configuration file. September 27, 2003 - Snapshot Added support for iNES mapper 50. Modified the UNIF board initialization code. Hopefully, this new interface will eventually be used with the iNES code. Miscellaneous code cleanups. /dev/dsp is now set to 8(previously 9) buffers of 128 samples in length in the SDL code. Tried to make the save state code more expandable and modular. Moved a lot of the PPU code into ppu.c. Added more extensive debugging code to the 6502 emulator, to allow for memory read/write hooks(including zero page addressing modes). Readadjusted DMC timings when PAL emulation is enabled. It looks like it was correct before I had made the August 2 change. Thanks to Bananmos for the information. I think. :/ Added support for iNES mapper 193 from information from virtuanes. I think my dump of it is "bad", though. PRG and CHR pages look like they are in the wrong order(logical vs physical? Who's to say what's physical?). September 1, 2003 - Snapshot Fixed some minor initialization issues with iNES mappers 7 and 34. Added support for UNIF board NES-GNROM. Removed support for save states created with versions of FCE Ultra less than 0.56. Replaced SDL sound buffering code with a lock-free FIFO implementation written by David Olofson, with a few modifications by myself. Fixed a VRC7 NSF bug(it showed up under the reworked driver/file loading order in the cli code). The board in "Rolling Thunder" has "RAMBO 1" on it, not "RAMBO-1". August 9, 2003 - Snapshot Removed the old plain text documentation and replaced it with a new document in HTML. It is not completed yet, though. Rewrote the SDL-native audio code to be less wacky and more thread-safe(hopefully). I'm still waiting for a new SDL audio API... Altered the MMC5 IRQ timing. Fixes minor graphical glitches in Castlevania 3. Does it break anything? Removed some debugging code that got into the last snapshot. August 5, 2003 - Snapshot Added some code in the IPS patcher to allow for expanding the size of files. Fixed a double free() bug with a mapper 51 game(in ines.c). Added support for "Alien Syndrome" (US release) as iNES mapper 158. It looks like a derivative of the normal RAMBO-1 board(or is that the name of the chip?), similar to TKSROM/TLSROM(mapper 118). Improved the "native" SDL sound code. It will now call SDL_Delay(), among other nice things. The code could probably be improved more, though. Added support for decimal components in xscale/yscale in the SDL port. Set the default xscale for windowed mode to 2.40(to get a more correct aspect ratio, assuming the display is currently at a 4:3 aspect ratio). Modified args.c to handle floating-point numbers. August 2, 2003 - Snapshot. Disabled texture wrapping with OpenGL(there were problems at the edges of the screen with linear interpolation). Bah. Now the edges are too bright... Improved the accuracy of the DMC timing when PAL emulation is enabled. I still don't think it's totally correct, though. Changed the default settings for the SDL code. Full screen is now 640x480x8bpp by default, xscale and yscale are 2 for both full screen and windowed, opengl support is enabled, linear interpolation for OpenGL is enabled, and X-axis stretching is enabled(in full screen). "Scanlines" were enabled in 8bpp to 8bpp blits in drivers/common/vidblit.c when they shouldn't have been. Fixed. Fixed OpenGL code under big-endian platforms. August 1, 2003 - Snapshot. Various code clean-ups. Played around with adding a GTK+ GUI to the SDL code. Rewrote part of the hq sound rectangle wave code. Replaced the high-quality sound inline assembly filter code with slightly faster C code. Hacked around with GP32 support. I don't know if the GP32 would be fast enough, though. Skipped frames will now have D5 of $2002 set at the beginning of the frame. Fixes "Bee 52". I must see if it breaks anything. Added OpenGL support to the SDL code. Removed the PPU drawing inline assembly code, replacing it with a faster algorithm written in C. "Disabling" the 8-sprite limitation will no longer cause "Bee 52" to break. However, the "Solstice" wizard will still have the weird thing growing out of his face in the introduction, since it depends on no more sprites to be rendered. Added entry for that Black Bass game for header corrections in ines.c Strip color burst bit(D0 of $2001) is only "emulated" if bg or sprite rendering are turned on, at the end of the scanline. Doing it with pixel/tile granularity would require modifying the sprite graphics data copying routine, which I don't feel like doing. Fixes that crazy Sayoonara demo by Chris Covell. I also modified the NES RAM initialization code. Adjusted VRC7 IRQ emulation for better Lagrange Point goodness. Added support for iNES mapper 91. (VirtuaNES) 0.96: Improved RAMBO-1(mapper 64) emulation. "Skull and Crossbones" is now playable. 0.95: timestamp and timestampbase are no longer saved/loaded to/from save states. They were causing too many problems I didn't want to fix, and I never intended them to be saved in save states when I wrote the code that uses them. I think the reason they were being saved was that I wanted to make it possible to add movie support and network play save state loading (distributing the save state over the network). So if someone in the future wants to add these features, the issues(primarily with zapper emulation and sound emulation) with saving the time stamp will need to be resolved. Fixed some crashing bugs when save states are loaded when high-quality sound emulation is enabled. It is like patching holes in a swiss-cheese boat. All the holes may be patched, but it looks ugly. At least it tastes good... TODO: Look into saving more data in the save states, especially data that is based off of "timestamp" and "timestampbase". Also look into validating this data. Right now, corrupt save state data might cause memory corruption in FCE Ultra. Fixed some bugs in the NSF player. Cleaned up more code. Reduced the usage of TriggerIRQ(). Split the palette code into a new file, palette.c, from svga.c Low-G-Man(NTSC and PAL versions) are now recognized by CRC32 value, and WRAM will be disabled if they are loaded. A warning/status message will also be printed regarding this issue. Decreased the volume of the DMC/PCM channel in low-quality sound emulation. Low-quality sound emulation now uses 32-bit integers for much better speed. FCEUI_CRC32() wasn't returning anything. D'oh. Fixed. Added somewhat crude support for games that switch background CHR data mid-scanline (this is needed in games such as Mother, Pirates!, Business Wars, and Marble Madness). Altered NMI, IRQ, and BRK emulation again. Fixes some games, like Bases Loaded 2 and Dynamite Bowling, and maybe some others. I had to increase the size of the IRQlow variable for delayed NMI execution... I also had to add a delay between PPU reset and the PPU actually doing anything, to fix "Knight Rider". Fixed a mapper 90 save state bug. /dev/dsp code now searches for /dev/dsp before /dev/dspX (where X is a non-negative integer). SDL joystick axes configuration is now done from the joystick. Tweaked various Konami mappers' IRQ counter emulation. Added custom SDL throttle code that gives up time slices instead of using 100% cpu. Fixed an issue with sprite priorities on MSB-first platforms. Modified powerpad.c to avoid a symbol conflict when compiling on the Power PC architecture. 0.94r3: sound.c: Fixed a divide-by-zero bug that occurred when a virtual reset(like by pressing F10) occurred when sound emulation was disabled. 0.94r2: drivers/common/vidblit.c: Fixed code for 32bpp blur effect. drivers/cli/sdl-video.c: Added error message for unsupported bit depths. mappers/simple.c, ines.c: Used this bug fix pseudo-release as an excuse to add support for mapper 107. Information taken from virtuanes. 0.94(fixed release) --- Fixed call to InitUNIXDSPSound in svgalib.c Added man pages. 0.94 --- Added support for rapid fire A/B buttons on physical joysticks in SDL/svgalib/DOS code. Implemented "high-quality" Namco 106 emulation(used for hq sound mode). In this case, "high-quality" means sounding more like it should, not necessarily cleaner. I'm not certain that it's totally correct, but it's in the right direction. RAM cheats should no longer affect Game Genie emulation. I still need to completely verify this. There may be some sort of race condition. Removed various minor speed hacks in the name of style and correctness(and to make maintaining FCE Ultra easier for those people who are not me). :) Removed NSF cpu hacks, as I changed code to make them unnecessary. Fixed another FDS IRQ emulation bug. "Famicom Grand Prix II" works now. Fixed a memory leak and a heap corruption bug in "file.c". Added support for on-the-fly IPS patching. Place the IPS file in the same directory as the file to load, and name it filename.ips. Examples: Boat.nes - Boat.nes.ips Boat.zip - Boat.zip.ips Boat.nes.gz - Boat.nes.gz.ips Boat - Boat.ips Some operating systems and environments will hide file extensions. Keep this in mind if you are having trouble. Patching is supported for all supported formats(iNES, FDS, UNIF, and NSF), but it will probably only be useful for the iNES format. It can be used with the FDS format, but be warned that it will permanently patch your disk image, as the disk image is written back to disk when the game is unloaded(unless the disk image is in a zip file, in which case it isn't written back to disk). UNIF files can't be patched well with the IPS format because they are chunk-based with no fixed offsets. Support for a UNIF patching format may be added in the future(probably by someone else.). Added more games to the list in ines.c for having battery-backed WRAM, for header corrections. Copied over the 96KHz filter coefficients from Festalon that I forgot to do in 0.92. Oops. 0.93 --- Reduced the volume of the FDS sound channel. Fixed a bug in the FDS IRQ emulation code that caused "Lutter" to not work. Fixed a bug in unif.c that would cause a crash if a unif file were loaded without a board name being specified(as could happen with a corrupted nsf). Fixed a bug in general.c relating to relative filenames(running fce ultra like "./fceu ../big.nes" would work, but "./fceu ../big" would not work- it crashed). 0.92r2 --- Fixed dpcm irq bug that broke Cobra Triangle. .92 --- Removed NSF player background, and added some special effects goodies. Changed the NSF player to use the emulated gamepad as input instead of having special NSF-player-only keys. Added support for mapper 249(using nonencrypted games), thanks to SARO for info. SMYNES sucks. Updated video blitting library-thing(vidblit.c) with more special effects, and removed 24bpp support. SDL cleanupification. Added support for mapper 61. nnnesterj: Added support for mapper 57. Fixed mapper number for "Golden Game 150 in 1". Changed it to 235 from 43. DDraw back buffer surfaces are now created in system memory if the hardware blitter can't do stretching. Restructured file wrapping code. Added new cheat search methods. Fixed a major cheat unloading memory bug(and memory leak). Emulated that funky nonlinear DAC effect for hi-quality sound. More fixes/cleanups to FDS emulation code. Tweaked PPU timing a bit. Improved network play. Holding the enter key down will no longer do fun stuff to the nsf player. Improved NSF player. It should support streaming pcm nsfs now... Changed FDS keyboard keys around a bit. F6 is the disk select key, and F8 is the disk insert/eject key. F8 to insert VS Unisystem coin, F6 to view/toggle dip switches. Hopefully people won't complain after blindly hitting the save state buttons. :) Many fixes and improvements to the Windows port. No more cpu-consuming wait loops(specifically, sound). Added a message window. FDS sound emulation improvements. FDS disks are now auto-inserted on power on(or was it loading a new game...). Changed the default last rendered scanline to 231. ines header corrections are now printed as status messages, not errors. Rearranged input updating code. Fixed a sprite transfer bug. Fixes PAL version of Rainbow Islands. Debugger hooks added. Small optimizations in Refreshline and FetchSpriteData to hopefully offset the slight slowdown in the cpu core. MapperHBIRQHook is now called differently(depending on hi/low bg/spr addresses). Added support for unif board UNL-8237. Added support for mapper 144(death race). Added partial support for mapper 74. Fixed a cpu emulation bug in GETIYWR. It would sometimes set "target" to 0x10000, which was a BAD THING(overflow; now it wraps). Tried to add support for mapper 241. Needs special keyboard emulation. I think. Internal RAM is now initialized to something other than 0. Fixes Minna no Taabou no Nakayoshi Dai Sakusen. Reassigned "The Money Game" to mapper 155. It doesn't seem to respect the WRAM enable/disable bits. Silly game. And Tatakae!! Rahmen Man. Added support for mapper 115(still needs 256KB CHR select), 241, 114,88. Attempted to add support for mappers 91, 187. Modified frame IRQ to not break so many damn games. Fixed sprite hit detection loop. Improved support for mappers 80, 90,117,154, 189. nnnester and virtuanes. Reassigned "Devil Man" to mapper 154. Removed bogus Trojan header fix in ines.c. .81-post: ---- Fixed/Worked around(?) compilation problems on gcc 3.2.x. .81: ---- More SDL goodies. Renamed "Makefile.olinuxsdl" to "Makefile.unixsdl" More SDL fixes and cleanups. BeOS port is now compiled with the "-no-fpic" flag, which allows me to use my inline assembly. The executable work fine as far as I can tell. Added "Makefile.beos". gcc doesn't like my inline assembly used in RefreshLine(),so this port will likely be slightly slower than other x86 ports. Added a check to make sure SIGBUS is not equal to SIGSEGV in drivers/cli/main.c. Needed for compiling under BeOS. Renamed the "PI" member of the X6502 structure due to conflicts with a defined symbol with some math header files. Merged fcelineasm.h into fceline.h Fixed(possibly) a possible problem in fcelineasm.h with input register clobbering. More SDL changes. Added speed throttling code to the CLI code, and added a command line switch "-nothrottle". Lots of restructuring/rewriting/merging of the MMC3 code. Updated DOS code to use the generic CLI wrapper. Reads from $4090 and $4092 now return the current envelope setting in FDS sound emulation. I'm not sure if this is correct... Affects "Ai Senshi Nicole" and "Bio Miracle Bokutte Upa". Added native SDL sound support to the SDL code. the "olinuxsdl" now uses this code by default instead of the unixdsp sound code. Modified MMC3 IRQ counter emulation. I'll need to watch out to see if it breaks any games. Fixes: MegaMan 3, Gun Nac, Klax(Japanese). Changed a few memory reads in x6502.c to use RdRAM instead of RdMem, resulting in a slight speed increase. Cleaned up mapper 250 emulation code. Added support for iNES mapper 51(thanks to Kevin Horton for the information). Merged some iNES mappers corresponding to bootleg multicarts based on MMC3s with mbshare/mmc3.c. Added support for iNES mapper 52(thanks to Kevin Horton for the information). Made some hacks to the MMC3 emulation code so that I can add support for pirate MMC3 multicarts more easily. I should clean it up later. Moved mapper 44 emulation code to mbshare/mmc3.c. Saving screen snapshots will no longer corrupt the frame buffer for one frame(unless memory couldn't be allocated). Fixed screen snapshot saving(it was sort of broken due to the changes made to the driver<->emulator interface code; status messages were being saved to the image). FCEUI_SaveSnapshot() no longer returns a value(the request to save a screen snapshot is serviced before status information would be written in the next frame). nosprites is now set to 0 before RefreshSprite() returns, to prevent problems if a game turns off the bg and sprites when FetchSpriteData() for the next scanline is called but then turns on sprites when the actual scanline is drawn. PPU_hook() is now called more often if PPU_hook is non-null. Made changes to mappers 118, 95, 9, and 10 to compensate. No games seem to be broken, and I added support for mapper 96 (though the games aren't very playable because the special controller isn't emulated). Romance of the 3 Kingdoms is now recognized to use 16KB ex-WRAM. Added support for mapper 185...sort of. I think this is another instance of incompatible hardware being lumped onto one mapper number. Sigh. Added support for "Famicom Jump 2" as iNES mapper 153. If a good(as far as I can tell) dump is loaded, FCE Ultra will automatically fix the mapper number. I also made some changes to the mapper 16 IRQ emulation code. BRK now sets the I flag. Reads from $4015 no longer reset DPCM IRQ. Changed emulation of RTI instruction slightly. X.IRQlow is now set to 0 in PowerNES(). The VS Unisystem bit in the iNES header is no longer looked at( I was having too many problems with this bit being set when it shouldn't have been). Now, VS Unisystem emulation is enabled when a known VS Unisystem game is loaded. I also rewrote the VS Unisystem detection function. iNES mapper 1 now supports pageable CHR RAM if no CHR ROM is present. Fixes "Family School". Mapper 70 no longer has a mirroring control emulated, and I extended the number of 8KB CHR pages supported to 16. Cleaned up iNES MMC5 save RAM loading/saving code and added support for MMC1 games with 16KB of RAM(the second 8KB are saved), via CRC32s(currently only Genghis Khan(USA) and Nobunaga's Ambition( USA and Japan) are recognized). Added support for the MMC5 Koei game "Ishin no Arashi", in the iNES format(I added an entry with its CRC32 value and the number of 8KB WRAM banks it needs). Better iNES mapper 33/48 IRQ counter emulation. Added the game "Uchuusen - Cosmo Carrier" to this list. I'm beginning to hate the iNES format more and more...or maybe just Fanwen. :) Added the mapper 32 game "Major League" to the list of games that usually need iNES header correction...but in this case, the iNES header cannot specify that this game needs to have one-screen mirroring. iNES header information is now printed before any header corrections are made based on a database. Fixed a bug in mapper 32 emulation. "Ai Sensei no Oshiete" works now. Tried to add support for iNES mappers 245 and 249. Fixed the MMC5 read handler to return the data last on the data bus instead of 0xFF when a read was made to an unmapped address. This seems to fix the lockup problems in "Bandit Kings of Ancient China". Reversed "Modified the time at which the "y scroll" register is updated during hblank." The changes broke Klax. Added an unsigned 64-bit base timestamp variable "timestampbase". Adding this to the 32-bit variable "timestamp" will return the number of cycles executed since emulation started(in the future I'll probably change it to since reset or power toggle). This allowed me to replace "lastn" hack in the MMC1 code with something better. Changed my mind and undid the removal of support for old save states. Removed support for old save states and in general I won't try to support save states made with previous versions. MMC1: Writes to $8000-$FFFF with D7 set will now cause the first MMC1 register to be OR'ed with 0x0C. I'm not sure if this is correct, but it doesn't seem to break anything and it fixes Robocop 3. I'll see if anyone reports games not working in .81 that worked in .80. Worked on a generic driver interface wrapper very similar to the driver interface FCE Ultra used to use(I'm getting tired of all of the duplicated driver code). Eventually, the DOS, SVGAlib, and SDL ports will use this wrapper. Similar change to the argument parsing code. Changed configuration file saving-loading routines and the configuration structure to allow for linking config structures to each other). Small fix to the emulation of the MMC5 split screen mode. Made Linux SDL code compilable again. Changes to MMC5 EXRAM emulation(read/write). Fixes to the emulation of the MMC5's split screen mode, based on observations while using CastleVania 3 and a Game Genie(on a real NES). Fixed a bug in ines.c that caused any calls to AddExState() from a mapper initialization function to be effectively "erased"(ResetExState() was called after the mapper was initialized). Fixes the VRC7 sound state saving/loading stuff. Finished adding support for the MMC5's split screen mode(this does not mean that the support is complete, but at least the intro in "Uchuu Keibitai SDF" works correctly now). Worked on adding support for the MMC5's split screen mode. Not completed. Reverted to .80's FDS sound code. Modified the time at which the "y scroll" register is updated during hblank. NSF playing code will now disable FDS sound output on song init (fixes some problems with the Zelda no Densetsu NSF rip). Increased the emulated clock speed of the FDS sound emulation code to give better quality output. Modified NMI to occur a few cycles later. Fixes BattleToads...but it may have broken other games. Also modified the way NMI's are handled in x6502.c. Modified ines.c to memset() GameMemBlock to 0 on virtual power toggle. Also, trainers are now loaded into their own buffer instead of directly into emulated WRAM and copied into emulated WRAM on power toggle; I've been meaning to do this for quite some time. Changes to the way the zapper cursor is drawn on the screen. FCEUD_WriteSoundData(), FCEUD_BlitScreen(), and FCEUD_UpdateInput() have been combined into one function: FCEUD_Update(). More fixes to the network play code, and a fix to the Windows network play driver code that fixes(hopefully) a rather evil bug that caused lockups when the remote stopped network play. Added code to set the battery-backed bit in RAM if a game needs it, based on CRC32. Added more games to the list of games that commonly have bad iNES headers, in ines.c Updated docs and usage.h for DOS and Linux regarding the new video mode and the new refresh rates. Linux: Fixed a bug with video mode 6(a few upper scanlines were being cut off). Increased the refresh rate of video mode 3 to 120hz. Increased the refresh rate of video mode 2 to 65 hz in the Linux port. Screen snapshots can now be taken while playing an NSF. Added a new sexy tweaked vga mode that I created to the Linux svgalib port. It's 256x224 at a refresh rate of 103hz. Hopefully it won't blow up anyone's monitor. ;) DOS port will follow eventually. Modified Makefile.base to produce an executable named "fceu" instead of "fce". The plans(cycle-accurate ppu emulation) for .90 were a bit ambitious, and I still need to make other fixes before then. Fixed some minor(usually) bugs with setting 256x240 tweaked VGA mode in DOS and Linux ports. .80: ---- Cleaned/fixed a few things in the mapper 19 emulation code. Family Circuit '91 still doesn't work quite right... I wonder if it's a bad dump. Added input override code to Windows port. Added code to fix iNES header information in RAM and suggest changes to the user. Added support for iNES mapper 152(to be used with games set to mapper 70, that use one-screen mirroring instead of h/v mirroring). Blits using the DirectX blitting function(method?) to the primary surface are now done with the asynchronous flag set(if that fails, a "normal" blit is tried). The DirectX blit buffer(secondary surface that FCE Ultra writes to directly and then uses the DirectDraw blit function on to blit to the primary buffer) is now created without specifying it should be in system memory or video memory, except in the case when no hardware blitting is available, and then DDraw is explicitly told to create the surface in system memory. Added Family Keyboard support to the DOS port. Cleaned up the VRC7 sound emulation code. I need to find a way to save the current sound state in a save state. Found out the real name of the "Space Shadow" gun; it's called the "Hyper Shot". I'm still not sure who made it, though. Possibly Bandai did. The interesting thing is that Konami also made a Famicom accessory(dual square boxy things with two buttons on each) with the same name(though there might not be a space in the name). Only the upper two bits read from $4016/$4017 are undefined. Bit5 is always 0, though. Fixed the bug in "input.c". Silly kevtris' old documents. New kevtris' brain is always good. Family Keyboard support for the Windows port. Added support for the Family Basic Keyboard to the Linux port, other ports todo. Might want to add support for the tape recorder at some time. Also mapped the "Scroll Lock" key to disable/enable command keys so that the FBK is more useable. It doesn't disable CTRL C, though... Changed a lot of inlined functions in x6502.c to macros so that I could test out some optimization ideas. DOS code updates for game input override support. Small optimzation to opcode $4c, and relative jumps. Added some code to ines.c to set controller information in FCEUGameInfo(returned by FCEUI_LoadGame()) based on crc32 values. Updated user documentation and usage.h for DOS and SVGAlib input command-line changes. Added an option to disable the four-score(to Windows and Linux ports so far). Updated Windows interface to support the new Famicom expansion devices. (Re)Added support for the Famicom 4-player device. Improved Zapper emulation...sort of. It still needs a lot of work. :/ Added *partial* support for the "Space Shadow" gun. Added support for the Arkanoid controller(both NES and Famicom style). Added code to support the extension Famicom input devices. Added PAL scanline start/end drawing settings to Windows port. Added pause emulation key(F2) to Windows port. In the process of rewriting/fixing up input code stuff. Minor bug fix to Power Pad emulation code. VS Hogan's Alley and VS Duck Hunt automatically select the zapper now(though it only works on the SVGAlib port). Undid some FDS sound code changes introduced in 0.76 that totally screwed up sound. Oops. Added code to allow different settings for first/last scanline drawn while in PAL emulation mode, to the Linux and DOS ports. Added convenience(it's not necessary, but it reduces redundant and confusing code in the driver code) function FCEUI_GetCurrentVidSystem(int *slstart, int *slend). Updated file "TODO". Changed #include to #include "zlib/unzip.h" in file.c. NSF 6502 player now initialized the stack pointer on reset. Worked on de-emphasis emulation code quite a bit. The deemphasized palette calculated at the end of the frame is now based on what deemphasis bits were set for the longest during the screen(sampling interval is a scanline) update loop. Added a "static" deemphasized palette at $40-$7F in the palette table. This corresponds to the colors when all of the deemphasis bits are set. I did this to fix the PAL game "Noah's Ark", without breaking anything else. The only downside is a slight speed loss(~2% on my system when sound is disabled), but this is acceptable to me, at least. Maybe it's time to write hi/true-color ppu drawing code... Fixed an out of bounds array access in svga.c in SetNESDeemph(). The variable "lastd" in svga.c was being initialized to the wrong value. Thanks to "Jarod CANAL" for pointing this out. Removed FCEUI_SetFirstRenderedLine or whatever it was called and the function to set the last line. Replaced with: void FCEUI_SetRenderedLines(int ntscf, int ntscl, int palf, int pall); Changed SetVidSys(int w) to ResetVidSys() in fce.c. Reenabled PAL/NTSC emulation overrides based on game loaded(really only useful for NSFs and UNIFs now). UNIF loading code now recognizes the chunk "CTRL" and tries to use it. Only the svgalib code supports overriding of input settings based on game loaded, now, though... The user is still going to have to configure powerpad settings on his/her own. Fixed return values of FCEU_fseek() and fixed a problem in unif.c related to it. Changed mechanism for how FCE Ultra tells the driver code what type of system is being emulated. A structure of type "FCEUGI" is returned from FCEUI_LoadGame(). Fixed a major mapper 64 emulation bug introduced in 0.76. Modified BlitVidHi() in drivers/win/video.c to speed it up. Added support for loading the iNES-format Game Genie ROM image. Removed ggrom.h and added code to load the Game Genie ROM image from a file. Added Windows netplay.c. (new: the user exiting the emulator while stuck in a blocking recv() or send() loop now works.) Fixed a vram address register bug in fce.c that I created when I got rid of the pair/dpair data types. Added new mappers/92.c Removed mappers/92.c until I can contact LULU or rewrite it. drivers/win changes. Removed netplay.c until I can rewrite it. Got rid of pair/dpair data types. Got rid of silly "TempArray" thing. Began adding GPL headers to files. FCE Ultra is going to be in a state of legal limbo for the next few days... Replaced crc32.c and crc32.h, and added some #ifdef's and #defines to use the crc32 code in zlib instead if zlib is linked with FCE Ultra. More fixes to sb.c. Cleaned up drawing.h and ggrom.h(even though ggrom.h will *probably* be removed before the next release). Redid frameskip code. Rewrote necessary pieces of sb.c and sb.h and fixed quite a few bugs. I still need to test it on various other sound cards, though. Rewrote(more like "recreated in my own image") DOS keyboard driver. Removed unused "keyscan.h" from drivers/svgalib Rewrote part of(the parts that Marat wrote - the connection and closing parts) the Linux TCP/IP network play code. I guess it works, but I haven't tested it very much. In any case, it's still dangerous to use network play in FCE Ultra with SVGAlib, since recv() or send() might block and since the keyboard is in raw mode, you have a problem. Maybe a future SVGAlib will fix the general problem of lockups if keyboard_update() isn't called, though it is only partly SVGAlib's problem... Fixed FCEU_fseek() when used with a compressed file in the PKZIP format that has been loaded. Fixes a UNIF loading problem. Also added a check to the return value of FCEU_fseek() in unif.c. Replaced Marat's 6502 emulation core with my own. It should be fully functional, but as always, I don't know if I implemented the undocumented instructions correctly. Several things are correct in this new core that were not in Marat's(D flag is no longer cleared by interrupts, for example). Altered mapper 16 irq counter emulation slightly. Fixed the behavior of the SXA, SYA, and XAS opcodes based on the documentation I have. I'm not sure what happens when page crossing occurs with those instructions on a real NES, though. Also CHANGED(not fixed) emulation of opcode $8B("XAA"). Changed some of the M* functions(absolute indexed and maybe some others) to perform dummy reads. Changed some of the macros in m6502.c to inlined functions so that I can modify and examine them more easily. .77: ---- Fixed a silly network play bug(in the global network play code) that caused excessive lag. Added a "niceness" setting to the sound configuration dialog. Removed obsolete information from the dialog. Fixed speed throttling code in Windows port when PAL emulation is disabled/enabled and a new game hasn't been loaded yet. Commented out a printf() to debug stuff in fds.c(oops). Applied PK's joystick patch to the osdl code. It allows the user to map axes and it fixes a joystick button mapping configuration saving bug. Added two command line options new to Linux port to DOS port. Just need to test them... Added some stuff to unif.c to allow for boards that can support CHR RAM instead of CHR ROM(darn Sachen boards...). Fixes UNIF version of "Q-Boy". Added command line option "-snapname" to Linux port. I'll add it to the Windows port as well, but probably not to the DOS port. Added clip option to Linux port. Fixed sound logging(in Windows port) so that multiple recording sessions now work. Added an option to clip the leftmost and rightmost 8 columns of graphics in the Windows port. Added a submenu that lists recently opened files, in the Windows port. .76: ---- Updated porting.txt. Added speed throttling code to Windows port that's used when sound is disabled(and an option in the "Miscellaneous" configuration window to disable it). Added cheat interface to DOS build. A few tweaks to the text cheat interface code in the cheat listing code. Added a command to quickly toggle the status of the cheat(though a cheat can still be disabled/enabled by (M)odifying the cheat). Support for UNIF UNL-TC-U01-1.5M board added. Same credits as below. Rewrote mapper 228 code just for the heck of it(actually, I couldn't figure out why some(about two) of the games in the Action 52 cart weren't working in .75(and .76). I traced it back to .71, where an apparent bug in the undocumented 6502 opcode emulation allowed it to work, which was later fixed for the .72 release(opcode 0x7C)). I'm thinking that the dump is bad... Added a few crc32 checks to ines.c to check for and report when a known(by me) bad(hacked or bad dump) game is loaded. Added support for the following UNIF boards. Thanks to Quietust and Kevin Horton for the information. Some problems still exist with a few games that use these boards, though... UNL-Sachen-8259B UNL-Sachen-8259A UNL-Sachen-74LS374N UNL-SA-016-1M UNL-SA-72007 UNL-SA-72008 UNL-SA-0036 UNL-SA-0037 Fixes to some stuff in cart.c(for example, calling setprg32() when only 16kb of prg data is present now works). Added support for iNES mapper 189. Tried to add support for the UNIF board "UNL-H2288". Failed. Updated "cheat.txt" to fix a few typos and added an example of finding and adding a cheat using the Linux port's text interface. The actual section on the Linux cheat interface still needs to be written, however. Changed network play code in the Windows port and fixed a bug. Fixed a similar bug in the Linux netplay code....sort of. A few cosmetic changes to the dialogs in the Windows port. Fixed sound initialization on the Windows port(it was being initialized when FCE Ultra started even if it was disabled by the user. Oops.). Joystick button configuration code in Windows port changed slightly to be more useable. Changed reference to video mode 5 in the linux port to "1 per 4". It may not be very meaningful, but it is certainly better than "TV Emulation". I'll change the Windows port reference later. Documented video mode 7(320x240) for the Linux port. Also added a check for the FBDev driver in order to use this mode instead of a tweaked vga mode if that driver is being used. Added/Fixed cheat interface for Linux port. It's still not perfect, though. The code is ugly... Callback function for FCEUI_ListCheats() now receives status information(enabled/disabled). Callback functions for cheat functions now must return 0 to stop listing cheats or 1 to continue. Fixed a problem(the cheat code was reading in cheats for address $0000 from cheat files if any blank lines were present). SDL port zlib changes(linked dynamically to zlib now). More changes to envelope decay + looping on code. No longer depends on value @ $4017. It now sounds correct based on some tests I did with SMB3 and a GG, but Goonies 2 doesn't sound right( based on a sound file sent to me by another person). Added support for iNES mapper 140. Thanks to Quietust for the information. I need to figure out how to deal with the problem of so many bad NSFs that most people consider good... Changed envelope decays a bit. Their behavior now depends on bit 7 of $4017. I don't know if this is right... Addition of debug.c for some debugging stuff. Updated zlib to 1.1.4. Modified code in various files to allow UNIF games to override current selected video system emulation(NTSC or PAL). Need to make sure this really works. Changed sound.c to prevent desynchronization during network play. This might slow down sound emulation slightly, especially when sound emulation is disabled. I really don't care... Updating network play code. More info later... Moved the sound/video/etc output code in EmLoop() to the top of the for(;;) loop so that initialization prior to calling EmLoop() will be the same as initialization done during a call to a FCEUD_* function. A few very small changes to sound emulation in fds.c. Changed unlink() to remove() in cheat.c and removed the including of the header file unistd.h. Split up the cc=... statement in RefreshLine() to make it easier to read and not ambiguous(to Borland's C compiler). Changed a lot of the function declarations in cheat.c. I'll need to verify that cheat searching still works ok and that cheats still work ok. I'll also need to update the Windows(and Linux console) cheat code to prevent compiler warnings. Fixed various minor code problems(not minor if you want to use a compiler besides gcc). This is an ongoing process... Removed bit fields after reading about and thinking about possible portability problems, though I kept some optimizations in fceline.h Minor code simplification in drivers/win/joystick.c(replaced "case 200 ... 207" and "case 208 ... 215". Modified some code to use bit-fields in the graphics rendering code in fce.c and fceline.h. gcc seems to be able to optimize the new code to run faster. Fixed m6502.c and fce.c to initialize variables on virtual power toggle. This should fix network play on the Windows port. I'm also in the process of cleaning up fce.c. .75: ---- Fixed directories configuration stuff in Windows port(corresponds to .75r2). More changes to square wave channel envelope/volume emulation... Changes described in the large paragraph some lines down have been abandoned. Added a command line switch to set the volume in the dos port. Changed Windows sound configuration dialog. Now buffer length is specified in time, not samples. I also added a volume control. Reduced the volume on 8-bit sound output on all ports by 1/2. Added a function FCEUI_SetSoundVolume(). Added support for setting the volume via the command line in the Linux port, other ports coming soon. Changed FCEUD_WriteSoundData() again. No longer has a "Check" argument. All clipping(ugh) is done internally now. Added a directories configuration dialog to the Windows port. I worked on it too long and I became a zombie, so it might have a few bugs. That's what guine...err...users are for. ;) Don't expect me to do anything like this for any other port, though. I don't feel like doing it on the DOS port, and the Linux and other UNIXy ports shouldn't really need it. Made some changes to the rectangle/square wave channel emulation to fix the pops in SMB. I have no idea if what I did is correct. To be honest, I'm not sure I know EXACTLY what I did, but it's something like this: Writes to $4003/$4007 now reset the duty cycle count and reload the cycle counter with the current wavelength. Writes to $4003/$4007 now do not update the amplitude output of the channels; they will be updated after the cycle counter hits 0(or below). More information in iNES informational output. Minor changes to mappers/16.c. Increased the volume of the VRC6's sawtooth wave channel. Added more information to the RAM cheat guide. Changed the triangle wave generation code slightly. I decided to remove support for the higher-frequency triangle waves, as they are too cpu-costly to create and are probably not very audible on a real NES anyway. Major changes to how sound is mixed. This necessitated a high pass DC-offset removing filter, and a low-pass filter just to make things sound better. ^_^ Note: FCEUD_WriteSoundData() no longer needs to clear the waveform data referenced by the passed pointer; it's done internally now. Fixed JMP ($xxxx) - now handles wrapping like it occurs on a real 6502 (hopefully; I'm assuming that the same holds true for the NES' cpu). Added the ability to load a custom global palette in the DOS port. Fixed bug in drivers/common/unixdsp.c(wrong return value if sample rate was out of range). Many sound fixes... - Frequency sweeps, length counter stuff,... Changed Windows port to use IDirectInput7 and IDirectInputDevice7 interfaces. Fixed a Game Genie bug in the core emulation code. It only appeared in the Windows port, though. (Enabling gg emulation, loading a game, and then disabling gg emulation and loading a new game while in the gg code entry screen would cause the new loaded game to not work correctly). Modified windows port to use the config saving/loading stuff in drivers/common/config.c Mapper 45 cleanups/fixes. Added the ability to load a custom global palette in the Linux port. Yay. Fixed a large number of overcomplicated code and silly bugs in drivers/common/config.c. This changes the format of the configuration structure, too. Also added support for saving/loading strings with automatic memory allocation when strings are loaded. Minor change in InitNetplay(). Fixed bad type conversions for pointers to functions and fixed some bad declarations of functions. Reenabled zlib support for the sdl build. I need to pay attention to patches that modify lines than don't fit on my screen. Fixed vidblit.c to not emit so many warnings when compiling. .74: ---- Stop sound in Windows port when user clicks l/m/r mouse buttons in the non-client area of the window. Added "Drag and drop" file open support to Windows port. Various code cleanups. mappers/33.c optimization. Rewrote the function "FCEU_MakeFName()". Removed crc32.h from mappers directory. Modified some of the window resizing code in the Windows port. Added support for waiting for vblank/double buffering to the Windows port. Added/Fixed support for iNES mapper 248. After an NSF file is loaded, information about its header is now displayed. Fixed a typo in the Namco 106 extra ram handling code. Improved the quality of the Namco 106's extra sound channels. - Thank Mamiya and Applepie(real name?) for info. When an NSF file is being played, FCE Ultra will no longer go through its scanline rendering loop. This speeds up NSF playback considerably. Updated "porting.txt". Moved some stuff from DriverInterface() to their own functions. Fixed some iNES mapper 18 IRQ counter emulation bugs. "Ninja Jajamaru - Ginga Dai Sakusen" now works. Rewrote large pieces of the mapper 64 code. "Skull and Crossbones" still doesn't work, though. Changed format of iNES header information output, added "ROM CRC32" info. Modified the way cycle timing is done slightly. No change for NTSC emulation, but PAL emulation is a little more accurate. Changed the behavior of indirect indexed(I hope I got that right ;)) instructions to behave more like a real 6502(junk reads are now performed). A few optimizations/cleanups in m6502.c. 0.73 ---- * Fixed several bugs with sprite emulation. Several games(such as "Trojan" and "VS Duck Hunt") that were broken in .71 and .72 now work ok. * Added support for iNES mapper 82. Thanks to those who work on "unofficial nester". * Added support for iNES mapper 250(used by "Time Diver Avenger"). * Fixed the documentation to show that iNES mappers 48, 83, and 232 are supported. * Removed various pieces of stale code and fixed a few minor bugs. * Fixed a triangle wave channel bug(the channel was sometimes enabled when it shouldn't have been). * Writing to $4010 with the upper bit clear now acknowledges the DPCM IRQ. This appears to fix "Stunt Buggies". * Rewrote pieces of the Zapper emulation code to be cleaner and more accurate. * Rewrote the VS Unisystem dip switch drawing code. * Simplified the setting of VS Unisystem dip switches. The "V" key now toggles viewing AND editing of dip switches. 0.72 ---- * Various minor bug fixes. * Various code cleanups and size and speed optimizations. * Removed some (apparently) unused MMC5 sound emulation code. * Changed the behavior of $2003 and $4014 to better simulate what occurs in a real NES. * Fixed a few bugs in the undocumented 6502 opcode emulation code. The Game Genie code "NUTANT" for SMB 3 works correctly now, at least(previously it caused the game to lock up at the end of levels). * Rewrote large pieces of the 6502 memory fetching code, resulting in a slight slowdown in the speed of emulation. Benefits include: Game Genie emulation now works(again) and 6502 emulation is more accurate. * Added support for iNES mapper 72. Thanks to rinao for the information. * Fixed support for iNES mapper 77(used by Napoleon Senki). * Fixed/Added support for iNES mapper 226. Apparently I made a mistake in the documentation. Thanks to Mark K. for the information. * Added support for iNES mapper 227. Thanks to Mark K. for the information. * Added support for iNES mapper 234(used by the Maxi-15). Thanks to Mark K. for the information. Note that many of the Maxi-15 ROM images on the Internet have corrupt CHR data(graphics), or the mapper number is set incorrectly(usually to 11). Use a utility to fix the mapper number. * Added support for the following UNIF boards(prefixes omitted): - EKROM (and fixed the reference to "Gemfire" in the documentation). - HKROM * Added the ability to enable and disable individual RAM cheats. * Fixed some problems with the cheat search code(the NES' internal RAM was being searched differently than any external RAM, which was being search incorrectly). 0.71 ---- * Fixed a 6502 emulation bug that was causing some Koei games (ex: Nobunaga's Ambition, Genghis Khan) to not work. * Extensive PPU/CPU timing adjustments. * Fixed support for iNES mapper 40. * Added support for the following UNIF boards(prefixes omitted): - ETROM - ELROM - EWROM * Fixed a few bugs in the UNIF code. * Added support for loading and saving cheat files and an interface to search for/add/delete/list cheats(no interface yet on Linux/DOS). * Fixed a few minor bugs in the Windows DX code. * Command line options to control the number of sound fragments and the fragment size have been added(Linux). 0.70 ---- * Adjusted PPU/CPU timing. * Removed(until I understand the problem) a hack to get one of the games in the Caltron 6-in-1 to work. * Fixed an MMC3 IRQ emulation bug("Project Q" works better now). * Fixed a problem/misunderstanding regarding the upper scanline. It can now be displayed again. * More accurate sprite hit emulation(fixes the title screen of "Ultimate Stuntman"). * VRAM bank switching for iNES mapper 4 is now possible(and enabled for all mapper 4 games without CHR ROM). Fixes "Tenchi o Kurau 2". * Added support for the Famicom's four-player adapter and the ability to enable it(it is disabled by default to prevent compatibility problems). * Added an option(under miscellaneous configuration) to automatically open the "File Open" dialog box when FCE Ultra is started. * Sound sampling rate is now configurable. * Fixed some bugs in the DirectSound code. * Joystick button configuration is a little more user friendly(and stable, hopefully) (Linux). 0.62 ---- * Added support for the Famicom Disk System's extra sound channel. * Updated the version of Tatsuyuki Satoh's OPL2 emulator used in FCE Ultra from .36f to .37a. The sound quality in "Lagrange Point" seems to have improved. * Added support for iNES mapper 242(used by "Wai Xing Zhan Shi"). * Fixed a network play bug that could cause desynchronizations if more than one network play session occured since FCE Ultra was started. This bug only showed up on the Windows port, though. * Increased the volume of the noise and triangle sound channels. * Fixed a save state loading bug. * Fixed a small memory leak that was being caused by the VRC7 state loading code. * Fixed a bug that could cause FCE Ultra to crash if a virtual disk was being read and the user ejected the virtual disk. * Various minor bug fixes/code cleanups. * NTSC color "emulation" can now be enabled again(the code to enable it was broken in the last version). (Linux) 0.61 ---- * Speed optimizations in sprite rendering code. * Screen snapshots are now saved in the PNG format instead of the PCX format. * Fixed Game Genie emulation(it wasn't working in the last release). Also added support for Game Genie emulation to the UNIF code. * Rewrote command line option parsing code. * Fixed a problem(if FCE Ultra was configured to connect to a remote host and the remote host was given as an IP address, and the IP address couldn't be reverse resolved, which is commonly the case on home LANs, the connection attempt would fail) in the network play code. I had misinterpreted the Winsock API documentation when I wrote the code. (Windows) 0.60 ---- * Various speed optimizations. * Sound is no longer messed up when a JAM/KIL opcode is emulated. * Fixed an overflow bug that occured when $4014 was written to during certain(rare) conditions. * Fixed a few save state bugs. * Fixed a MMC1 CHR bank switching bug. * Added emulation of the MMC5's WRAM write-enable/disable registers. * Fixed a sound frame IRQ emulation bug. "Qix" works now. * Added UNIF support. Some of the board emulation is still a bit buggy, though. Look at the documentation for a list of supported boards. * Updated the "Palette Notes" section of the documentation. Also fixed a few other problems with the documentation. * Added support for loading files in the PKZIP and gzip compressed file formats via zlib. * Added the ability to configure the first scanline and the last scanline to draw to the screen. Enabling PAL emulation no longer will cause all 239 scanlines to be displayed, though an option to override these settings for when PAL emulation is enabled may be in the next version. * Fixed a bug that would cause the emulated D-pad of virtual gamepads emulated through the keyboard to be duplicated through "higher" virtual gamepads(gamepad 1 would affect 2,3,4; gamepad 2 would affect 3,4; etc.). (Windows) 0.55 ---- * Rewrote window resizing code. The window will now resize itself to a multiple of the NES' screen dimensions nearest to the user selected dimensions. (Windows) * Added an option to use buttons instead of axes on physical joysticks for the emulated D-Pad. This is useful for some digital joysticks. (Windows) * Fixed a bug that would cause FCE Ultra to crash if sound were disabled during emulation. (Windows) * Added the ability to "fast forward" emulation. * Added an option to allow more than 8 sprites per scanline to be displayed. * Added an option to save all extra non-volatile game data (such as battery-backed RAM) in a directory under FCE Ultra's base directory(as opposed to the directory the game is located in). * Added an option to allow the emulator to change to a full screen video mode once a new game is loaded. (Windows) * Rewrote pieces of DirectInput joystick handling code. Hopefully it should increase compatibility. (Windows) * Added the ability to automatically obtain button numbers when configuring joysticks, by pressing buttons on the joystick. * Added the ability to close the current game(decreases CPU usage). (windows) * Increased the speed of various function calls by passing arguments to functions through registers instead of through the stack. * Added emulation of the MMC5's raw PCM register. * Added the ability to save/load save states while network play is occuring. * Having PAL emulation enabled will no longer override the NTSC/PAL settings in NSF headers. * Fixed a bug that got into the .54 release. Extraneous data was being returned on reads from $2002, which caused problems with some games(such as "Choujin Sentai Jetman"). 0.54 ---- * Fixed a bug that would cause a wrong battery-backed WRAM file name to be produced if FCE Ultra was passed a file name without any directory component(such as "fceu SuperBlah.nes"). * Fixed an iNES mapper 118 emulation bug that got into the code in a recent code cleanup. "Armadillo" is playable again. * Fixed a typo(and bug) in the MMC5 emulation code. * Data returned from emulated reads to "unmapped" areas or memory locations where bits are undefined should now be correct. * Fixed emulation of the sprite memory transfer register $4014. It now takes into account the last value written to $2003 and starts the transfer to that location in sprite memory(like on a real NES). * Added a video configuration dialog box. (Windows) * Added the ability to configure a custom video mode. Aspects that are configurable include width, height, bits per pixel, and size transforming(stretching and scaling). (Windows) 0.53 ---- * Fixed a bug with joysticks that occured on systems with multiple joysticks. (Windows) * Added support for iNES mappers 77 and 92(thanks to LULU for the code for both). * Added partial(timer is non-configurable) support for iNES mapper 105. * Changed save state format again. Save states made with previous versions should still be compatible, though this may change in future versions. * Small optimization to sprite emulation code. * Rewrote color-deemphasis code to use integer math instead of floating-point math. * Rewrote and restructured input code. (Linux) * Added command line option "-f8bit" to force 8-bit sound. (Linux) * Rewrote and restructured input code. Among other new features, keyboard keys are now somewhat configurable. (Windows) * Writes to $4003/$4007 will now reset the emulated square wave duty cycle generator. * Added emulation of the Power Pad. * Rewrote joystick device reading code to use the event-driven interface. This should fix various problems regarding support for joysticks with many buttons. (linux) 0.52 ---- * Fixed a PCM emulation bug(digitized voices in "Ikari Warriors 2" and "The Immortal", among others, work now). * Fixed noise channel's LSFR update frequencies(hopefully). * Various minor bug fixes. 0.51 ---- * Added support for iNES mappers 86 and 89. * Reduced byte size of the NSF player's background. * Adjusted CPU/PPU timing. * Fixed sound channel frequency calculations for when PAL emulation is enabled. * Rewrote large pieces of the sound code and got rid of the sound queue. Sound quality should be slightly better now. * Various minor bug fixes. Windows: * Fixed an FDS side reset bug when a new game is loaded. * Screen width/depth/height changes while FCE Ultra is in windowed mode are handled now. * Changed the configuration file format. * Added a palette configuration dialog. * Added the ability to load a custom NES palette. * Added an option to double 16-bit sound volume. * Added an option to force 8-bit sound. * Added an option to use a secondary sound buffer(versus the primary). * Added an option to wait for vertical blank if sound is disabled. * Added an option to run while focus is lost. 0.50 ---- * Many bug fixes. * Sound code partially rewritten to improve quality(near-perfect raw PCM now) and eliminate the need for a separate thread. This created a small problem with network play, though, so read the network play notes section. Also, synchronizing to vertical blank has been removed. * Rewrote other pieces of sound code. No more "buzzing" in MegaMan 2, Codemasters games' intros, etc. * Added support for the NES Zapper and the VS Unisystem's light gun. Be sure to read "Light Gun Notes". * Changed save state format. Save states should now be much smaller for most games. Most(not all) save states created with an older version should work. * Added support for VS Duck Hunt and VS Hogan's Alley. fceu-0.98.12/INSTALL0000644000175000000620000000141310042363771013545 0ustar joestaff00000000000000To compile and install FCE Ultra, follow these steps: 1. Run "./configure". If you want OpenGL support(which you probably do), and you have the OpenGL headers installed, run configure with "--with-opengl". To see all possible compilation options, run "./configure --help". If you're compiling under Mac OS X, you should probably run configure with "--disable-sdltest". If you are compiling for MS Windows, and you want a GUI, try something like: ./configure --with-nativewin32 windres -o src/res.o src/drivers/win/res.res make The "windres" command is necessary because I can't get automake to recognize the resource object correctly. 2. Optionally, run "make install". This is not well-tested, so it may do EVIL THINGS. fceu-0.98.12/NEWS0000644000175000000620000000000007766752644013226 0ustar joestaff00000000000000fceu-0.98.12/Documentation/0002755000175000000620000000000010041626223015321 5ustar joestaff00000000000000fceu-0.98.12/Documentation/tech/0002755000175000000620000000000010041626223016244 5ustar joestaff00000000000000fceu-0.98.12/Documentation/tech/cpu/0002755000175000000620000000000010041626223017033 5ustar joestaff00000000000000fceu-0.98.12/Documentation/tech/cpu/4017.txt0000644000175000000620000000665507757447436020234 0ustar joestaff00000000000000This is an email posted to nesdev by Ki a while back. I have removed one line at the end regarding the B flag of the cpu(the information was incorrect, which Ki noted in a later email). -------------------------------------------------------------------------------- By reading Brad's NESSOUND document, we know that there is a "frame counter" in the NES/FC APU. I would like to post some more on this. The frame counter is reset upon any write to $4017. It is reset at system power-on as well, but is NOT reset upon system reset. Thanks to Samus Aran, we now know the exact period of the PPU's single frame. In another words, we are now sure that the NMI occurs on every 29780 2/3 CPU cycles. However, the APU's single frame is NOT 29780 2/3 CPU cycles. What I mean by "APU's single frame" here is that it is the number of CPU cycles taken between the frame IRQs. The APU's single frame seems to be: 1789772.727... / 60 = 29829 6/11 [CPU CYCLE] Below is a simple diagram which shows the difference in periods of the PPU's single frame and the APU's. RESET 29780 2/3 CPU CYCLES NMI PPU |------------------------------------------| | 29829 6/11 CPU CYCLES IRQ APU |----------|----------|----------|----------| Note that if you write $00 to $4017 on every NMI, the frame IRQ would NEVER go off even if it is enabled. This is because the the period of NMI is slightly shorter than the period of the frame IRQ. This causes the frame counter to be reset before the frame IRQ goes off. When you write zero to bit 7 of $4017, the frame counter will be reset, and the first sound update will be done after 7457 CPU cycles (i.e. 29829/4). 2nd update will be done 7457 after that, same goes for 3rd update and 4th update, but the frame IRQ occurs on 4th update, resetting the frame counter as well. When you write 1 to bit 7 of $4017, the frame counter will be reset, but the first sound update will occur at the same time. 2nd, 3rd, and 4th update will be done after 7457, 14914, 22371 CPU cycles after the first update respectively, but the 5th update will be 14914 cycles after the 4th update. This causes sound output to last 1.25 times longer than that of bit 7 = 0. $4017W: o when the MSB of $4017 is 0: bit7=0 |---------|---------|---------|---------|---------|---------|---- 1st 2nd 3rd 4th 5th(1st) 6th(2nd) o when the MSB of $4017 is 1: bit7=1 |---------|---------|---------|-------------------|---------|---- 1st 2nd 3rd 4th 5th(1st) 6th(2nd) On 1st, 3rd, 5th, ... updates, the envelope decay and the linear counter are updated. On 2nd, 4th, 6th, ... updates, the envelope decay, the linear counter, the length counter, and the frequency sweep are updated. ---- The original info was provided by goroh, and verified by me. However, it could still be wrong. Please tell me if you find anything wrong. ---- (Correction from my last posting) I have checked once again and it turned out that the frame IRQ was NOT disabled upon system reset. What actually prevented the frame IRQ to occur after system reset was, in fact, the I flag. I checked this flag shortly after system reset (right after stack pointer was initialized), and the flag was 1, although I never executed "sei" after reset. Therefore the I flag of the PR2A03G is 1 on system reset. Thanks Matthew Conte and Samus Aran for pointing out the inaccuracy. fceu-0.98.12/Documentation/tech/cpu/6502_cpu.txt0000644000175000000620000020247607757447436021103 0ustar joestaff00000000000000# # $Id: 6502_cpu.txt,v 1.1 2002/05/21 00:42:27 xodnizel Exp $ # # This file is part of Commodore 64 emulator # and Program Development System. # # See README for copyright notice # # This file contains documentation for 6502/6510/8500/8502 instruction set. # # # Written by # John West (john@ucc.gu.uwa.edu.au) # Marko MŠkelŠ (msmakela@kruuna.helsinki.fi) # # # $Log: 6502_cpu.txt,v $ # Revision 1.1 2002/05/21 00:42:27 xodnizel # updates # # Revision 1.8 1994/06/03 19:50:04 jopi # Patchlevel 2 # # Revision 1.7 1994/04/15 13:07:04 jopi # 65xx Register descriptions added # # Revision 1.6 1994/02/18 16:09:36 jopi # # Revision 1.5 1994/01/26 16:08:37 jopi # X64 version 0.2 PL 1 # # Revision 1.4 1993/11/10 01:55:34 jopi # # Revision 1.3 93/06/21 13:37:18 jopi # X64 version 0.2 PL 0 # # Revision 1.2 93/06/21 13:07:15 jopi # *** empty log message *** # # Note: To extract the uuencoded ML programs in this article most easily you may use e.g. "uud" by Edwin Kremer , which extracts them all at once. Documentation for the NMOS 65xx/85xx Instruction Set 6510 Instructions by Addressing Modes 6502 Registers 6510/8502 Undocumented Commands Register selection for load and store Decimal mode in NMOS 6500 series 6510 features Different CPU types 6510 Instruction Timing How Real Programmers Acknowledge Interrupts Memory Management Autostart Code Notes References 6510 Instructions by Addressing Modes off- ++++++++++ Positive ++++++++++ ---------- Negative ---------- set 00 20 40 60 80 a0 c0 e0 mode +00 BRK JSR RTI RTS NOP* LDY CPY CPX Impl/immed +01 ORA AND EOR ADC STA LDA CMP SBC (indir,x) +02 t t t t NOP*t LDX NOP*t NOP*t ? /immed +03 SLO* RLA* SRE* RRA* SAX* LAX* DCP* ISB* (indir,x) +04 NOP* BIT NOP* NOP* STY LDY CPY CPX Zeropage +05 ORA AND EOR ADC STA LDA CMP SBC Zeropage +06 ASL ROL LSR ROR STX LDX DEC INC Zeropage +07 SLO* RLA* SRE* RRA* SAX* LAX* DCP* ISB* Zeropage +08 PHP PLP PHA PLA DEY TAY INY INX Implied +09 ORA AND EOR ADC NOP* LDA CMP SBC Immediate +0a ASL ROL LSR ROR TXA TAX DEX NOP Accu/impl +0b ANC** ANC** ASR** ARR** ANE** LXA** SBX** SBC* Immediate +0c NOP* BIT JMP JMP () STY LDY CPY CPX Absolute +0d ORA AND EOR ADC STA LDA CMP SBC Absolute +0e ASL ROL LSR ROR STX LDX DEC INC Absolute +0f SLO* RLA* SRE* RRA* SAX* LAX* DCP* ISB* Absolute +10 BPL BMI BVC BVS BCC BCS BNE BEQ Relative +11 ORA AND EOR ADC STA LDA CMP SBC (indir),y +12 t t t t t t t t ? +13 SLO* RLA* SRE* RRA* SHA** LAX* DCP* ISB* (indir),y +14 NOP* NOP* NOP* NOP* STY LDY NOP* NOP* Zeropage,x +15 ORA AND EOR ADC STA LDA CMP SBC Zeropage,x +16 ASL ROL LSR ROR STX y) LDX y) DEC INC Zeropage,x +17 SLO* RLA* SRE* RRA* SAX* y) LAX* y) DCP* ISB* Zeropage,x +18 CLC SEC CLI SEI TYA CLV CLD SED Implied +19 ORA AND EOR ADC STA LDA CMP SBC Absolute,y +1a NOP* NOP* NOP* NOP* TXS TSX NOP* NOP* Implied +1b SLO* RLA* SRE* RRA* SHS** LAS** DCP* ISB* Absolute,y +1c NOP* NOP* NOP* NOP* SHY** LDY NOP* NOP* Absolute,x +1d ORA AND EOR ADC STA LDA CMP SBC Absolute,x +1e ASL ROL LSR ROR SHX**y) LDX y) DEC INC Absolute,x +1f SLO* RLA* SRE* RRA* SHA**y) LAX* y) DCP* ISB* Absolute,x ROR intruction is available on MC650x microprocessors after June, 1976. Legend: t Jams the machine *t Jams very rarely * Undocumented command ** Unusual operation y) indexed using Y instead of X () indirect instead of absolute Note that the NOP instructions do have other addressing modes than the implied addressing. The NOP instruction is just like any other load instruction, except it does not store the result anywhere nor affects the flags. 6502 Registers The NMOS 65xx processors are not ruined with too many registers. In addition to that, the registers are mostly 8-bit. Here is a brief description of each register: PC Program Counter This register points the address from which the next instruction byte (opcode or parameter) will be fetched. Unlike other registers, this one is 16 bits in length. The low and high 8-bit halves of the register are called PCL and PCH, respectively. The Program Counter may be read by pushing its value on the stack. This can be done either by jumping to a subroutine or by causing an interrupt. S Stack pointer The NMOS 65xx processors have 256 bytes of stack memory, ranging from $0100 to $01FF. The S register is a 8-bit offset to the stack page. In other words, whenever anything is being pushed on the stack, it will be stored to the address $0100+S. The Stack pointer can be read and written by transfering its value to or from the index register X (see below) with the TSX and TXS instructions. P Processor status This 8-bit register stores the state of the processor. The bits in this register are called flags. Most of the flags have something to do with arithmetic operations. The P register can be read by pushing it on the stack (with PHP or by causing an interrupt). If you only need to read one flag, you can use the branch instructions. Setting the flags is possible by pulling the P register from stack or by using the flag set or clear instructions. Following is a list of the flags, starting from the 8th bit of the P register (bit 7, value $80): N Negative flag This flag will be set after any arithmetic operations (when any of the registers A, X or Y is being loaded with a value). Generally, the N flag will be copied from the topmost bit of the register being loaded. Note that TXS (Transfer X to S) is not an arithmetic operation. Also note that the BIT instruction affects the Negative flag just like arithmetic operations. Finally, the Negative flag behaves differently in Decimal operations (see description below). V oVerflow flag Like the Negative flag, this flag is intended to be used with 8-bit signed integer numbers. The flag will be affected by addition and subtraction, the instructions PLP, CLV and BIT, and the hardware signal -SO. Note that there is no SEV instruction, even though the MOS engineers loved to use East European abbreviations, like DDR (Deutsche Demokratische Republik vs. Data Direction Register). (The Russian abbreviation for their former trade association COMECON is SEV.) The -SO (Set Overflow) signal is available on some processors, at least the 6502, to set the V flag. This enables response to an I/O activity in equal or less than three clock cycles when using a BVC instruction branching to itself ($50 $FE). The CLV instruction clears the V flag, and the PLP and BIT instructions copy the flag value from the bit 6 of the topmost stack entry or from memory. After a binary addition or subtraction, the V flag will be set on a sign overflow, cleared otherwise. What is a sign overflow? For instance, if you are trying to add 123 and 45 together, the result (168) does not fit in a 8-bit signed integer (upper limit 127 and lower limit -128). Similarly, adding -123 to -45 causes the overflow, just like subtracting -45 from 123 or 123 from -45 would do. Like the N flag, the V flag will not be set as expected in the Decimal mode. Later in this document is a precise operation description. A common misbelief is that the V flag could only be set by arithmetic operations, not cleared. 1 unused flag To the current knowledge, this flag is always 1. B Break flag This flag is used to distinguish software (BRK) interrupts from hardware interrupts (IRQ or NMI). The B flag is always set except when the P register is being pushed on stack when jumping to an interrupt routine to process only a hardware interrupt. The official NMOS 65xx documentation claims that the BRK instruction could only cause a jump to the IRQ vector ($FFFE). However, if an NMI interrupt occurs while executing a BRK instruction, the processor will jump to the NMI vector ($FFFA), and the P register will be pushed on the stack with the B flag set. D Decimal mode flag This flag is used to select the (Binary Coded) Decimal mode for addition and subtraction. In most applications, the flag is zero. The Decimal mode has many oddities, and it operates differently on CMOS processors. See the description of the ADC, SBC and ARR instructions below. I Interrupt disable flag This flag can be used to prevent the processor from jumping to the IRQ handler vector ($FFFE) whenever the hardware line -IRQ is active. The flag will be automatically set after taking an interrupt, so that the processor would not keep jumping to the interrupt routine if the -IRQ signal remains low for several clock cycles. Z Zero flag The Zero flag will be affected in the same cases than the Negative flag. Generally, it will be set if an arithmetic register is being loaded with the value zero, and cleared otherwise. The flag will behave differently in Decimal operations. C Carry flag This flag is used in additions, subtractions, comparisons and bit rotations. In additions and subtractions, it acts as a 9th bit and lets you to chain operations to calculate with bigger than 8-bit numbers. When subtracting, the Carry flag is the negative of Borrow: if an overflow occurs, the flag will be clear, otherwise set. Comparisons are a special case of subtraction: they assume Carry flag set and Decimal flag clear, and do not store the result of the subtraction anywhere. There are four kinds of bit rotations. All of them store the bit that is being rotated off to the Carry flag. The left shifting instructions are ROL and ASL. ROL copies the initial Carry flag to the lowmost bit of the byte; ASL always clears it. Similarly, the ROR and LSR instructions shift to the right. A Accumulator The accumulator is the main register for arithmetic and logic operations. Unlike the index registers X and Y, it has a direct connection to the Arithmetic and Logic Unit (ALU). This is why many operations are only available for the accumulator, not the index registers. X Index register X This is the main register for addressing data with indices. It has a special addressing mode, indexed indirect, which lets you to have a vector table on the zero page. Y Index register Y The Y register has the least operations available. On the other hand, only it has the indirect indexed addressing mode that enables access to any memory place without having to use self-modifying code. 6510/8502 Undocumented Commands -- A brief explanation about what may happen while using don't care states. ANE $8B A = (A | #$EE) & X & #byte same as A = ((A & #$11 & X) | ( #$EE & X)) & #byte In real 6510/8502 the internal parameter #$11 may occasionally be #$10, #$01 or even #$00. This occurs when the video chip starts DMA between the opcode fetch and the parameter fetch of the instruction. The value probably depends on the data that was left on the bus by the VIC-II. LXA $AB C=Lehti: A = X = ANE Alternate: A = X = (A & #byte) TXA and TAX have to be responsible for these. SHA $93,$9F Store (A & X & (ADDR_HI + 1)) SHX $9E Store (X & (ADDR_HI + 1)) SHY $9C Store (Y & (ADDR_HI + 1)) SHS $9B SHA and TXS, where X is replaced by (A & X). Note: The value to be stored is copied also to ADDR_HI if page boundary is crossed. SBX $CB Carry and Decimal flags are ignored but the Carry flag will be set in substraction. This is due to the CMP command, which is executed instead of the real SBC. ARR $6B This instruction first performs an AND between the accumulator and the immediate parameter, then it shifts the accumulator to the right. However, this is not the whole truth. See the description below. Many undocumented commands do not use AND between registers, the CPU just throws the bytes to a bus simultaneously and lets the open-collector drivers perform the AND. I.e. the command called 'SAX', which is in the STORE section (opcodes $A0...$BF), stores the result of (A & X) by this way. More fortunate is its opposite, 'LAX' which just loads a byte simultaneously into both A and X. $6B ARR This instruction seems to be a harmless combination of AND and ROR at first sight, but it turns out that it affects the V flag and also has a special kind of decimal mode. This is because the instruction has inherited some properties of the ADC instruction ($69) in addition to the ROR ($6A). In Binary mode (D flag clear), the instruction effectively does an AND between the accumulator and the immediate parameter, and then shifts the accumulator to the right, copying the C flag to the 8th bit. It sets the Negative and Zero flags just like the ROR would. The ADC code shows up in the Carry and oVerflow flags. The C flag will be copied from the bit 6 of the result (which doesn't seem too logical), and the V flag is the result of an Exclusive OR operation between the bit 6 and the bit 5 of the result. This makes sense, since the V flag will be normally set by an Exclusive OR, too. In Decimal mode (D flag set), the ARR instruction first performs the AND and ROR, just like in Binary mode. The N flag will be copied from the initial C flag, and the Z flag will be set according to the ROR result, as expected. The V flag will be set if the bit 6 of the accumulator changed its state between the AND and the ROR, cleared otherwise. Now comes the funny part. If the low nybble of the AND result, incremented by its lowmost bit, is greater than 5, the low nybble in the ROR result will be incremented by 6. The low nybble may overflow as a consequence of this BCD fixup, but the high nybble won't be adjusted. The high nybble will be BCD fixed in a similar way. If the high nybble of the AND result, incremented by its lowmost bit, is greater than 5, the high nybble in the ROR result will be incremented by 6, and the Carry flag will be set. Otherwise the C flag will be cleared. To help you understand this description, here is a C routine that illustrates the ARR operation in Decimal mode: unsigned A, /* Accumulator */ AL, /* low nybble of accumulator */ AH, /* high nybble of accumulator */ C, /* Carry flag */ Z, /* Zero flag */ V, /* oVerflow flag */ N, /* Negative flag */ t, /* temporary value */ s; /* value to be ARRed with Accumulator */ t = A & s; /* Perform the AND. */ AH = t >> 4; /* Separate the high */ AL = t & 15; /* and low nybbles. */ N = C; /* Set the N and */ Z = !(A = (t >> 1) | (C << 7)); /* Z flags traditionally */ V = (t ^ A) & 64; /* and V flag in a weird way. */ if (AL + (AL & 1) > 5) /* BCD "fixup" for low nybble. */ A = (A & 0xF0) | ((A + 6) & 0xF); if (C = AH + (AH & 1) > 5) /* Set the Carry flag. */ A = (A + 0x60) & 0xFF; /* BCD "fixup" for high nybble. */ $CB SBX X <- (A & X) - Immediate The 'SBX' ($CB) may seem to be very complex operation, even though it is a combination of the subtraction of accumulator and parameter, as in the 'CMP' instruction, and the command 'DEX'. As a result, both A and X are connected to ALU but only the subtraction takes place. Since the comparison logic was used, the result of subtraction should be normally ignored, but the 'DEX' now happily stores to X the value of (A & X) - Immediate. That is why this instruction does not have any decimal mode, and it does not affect the V flag. Also Carry flag will be ignored in the subtraction but set according to the result. Proof: begin 644 vsbx M`0@9$,D'GL(H-#,IJC(U-JS"*#0T*:HR-@```*D`H#V1*Z`_D2N@09$KJ0>% M^QBE^VEZJ+$KH#F1*ZD`2"BI`*(`RP`(:-B@.5$K*4#P`E@`H#VQ*SAI`)$K JD-Z@/[$K:0"1*Y#4J2X@TO\XH$&Q*VD`D2N0Q,;[$+188/_^]_:_OK>V ` end and begin 644 sbx M`0@9$,D'GL(H-#,IJC(U-JS"*#0T*:HR-@```'BI`*!-D2N@3Y$KH%&1*ZD# MA?L8I?M*2)`#J1@LJ3B@29$K:$J0`ZGX+*G8R)$K&/BXJ?2B8\L)AOP(:(7] MV#B@3;$KH$\Q*Z!1\2L(1?SP`0!H1?TIM]#XH$VQ*SAI`)$KD,N@3[$K:0"1 9*Y#!J2X@TO\XH%&Q*VD`D2N0L<;[$))88-#X ` end These test programs show if your machine is compatible with ours regarding the opcode $CB. The first test, vsbx, proves that SBX does not affect the V flag. The latter one, sbx, proves the rest of our theory. The vsbx test tests 33554432 SBX combinations (16777216 different A, X and Immediate combinations, and two different V flag states), and the sbx test doubles that amount (16777216*4 D and C flag combinations). Both tests have run successfully on a C64 and a Vic20. They ought to run on C16, +4 and the PET series as well. The tests stop with BRK, if the opcode $CB does not work as expected. Successful operation ends in RTS. As the tests are very slow, they print dots on the screen while running so that you know that the machine has not jammed. On computers running at 1 MHz, the first test prints approximately one dot every four seconds and a total of 2048 dots, whereas the second one prints half that amount, one dot every seven seconds. If the tests fail on your machine, please let us know your processor's part number and revision. If possible, save the executable (after it has stopped with BRK) under another name and send it to us so that we know at which stage the program stopped. The following program is a Commodore 64 executable that Marko M"akel"a developed when trying to find out how the V flag is affected by SBX. (It was believed that the SBX affects the flag in a weird way, and this program shows how SBX sets the flag differently from SBC.) You may find the subroutine at $C150 useful when researching other undocumented instructions' flags. Run the program in a machine language monitor, as it makes use of the BRK instruction. The result tables will be written on pages $C2 and $C3. begin 644 sbx-c100 M`,%XH`",#L&,$,&,$L&XJ8*B@LL7AOL(:(7\N#BM#L$M$,'M$L$(Q?OP`B@` M:$7\\`,@4,'N#L'0U.X0P=#/SB#0[A+!T,<``````````````)BJ\!>M#L$M L$,'=_\'0":T2P=W_PM`!8,K0Z:T.P2T0P9D`PID`!*T2P9D`PYD`! Other undocumented instructions usually cause two preceding opcodes being executed. However 'NOP' seems to completely disappear from 'SBC' code $EB. The most difficult to comprehend are the rest of the instructions located on the '$0B' line. All the instructions located at the positive (left) side of this line should rotate either memory or the accumulator, but the addressing mode turns out to be immediate! No problem. Just read the operand, let it be ANDed with the accumulator and finally use accumulator addressing mode for the instructions above them. RELIGION_MODE_ON /* This part of the document is not accurate. You can read it as a fairy tale, but do not count on it when performing your own measurements. */ The rest two instructions on the same line, called 'ANE' and 'LXA' ($8B and $AB respectively) often give quite unpredictable results. However, the most usual operation is to store ((A | #$ee) & X & #$nn) to accumulator. Note that this does not work reliably in a real 64! In the Commodore 128 the opcode $8B uses values 8C, CC, EE, and occasionally 0C and 8E for the OR instead of EE,EF,FE and FF used in the C64. With a C128 running at 2 MHz #$EE is always used. Opcode $AB does not cause this OR taking place on 8502 while 6510 always performs it. Note that this behaviour depends on processor and/or video chip revision. Let's take a closer look at $8B (6510). A <- X & D & (A | VAL) where VAL comes from this table: X high D high D low VAL even even --- $EE (1) even odd --- $EE odd even --- $EE odd odd 0 $EE odd odd not 0 $FE (2) (1) If the bottom 2 bits of A are both 1, then the LSB of the result may be 0. The values of X and D are different every time I run the test. This appears to be very rare. (2) VAL is $FE most of the time. Sometimes it is $EE - it seems to be random, not related to any of the data. This is much more common than (1). In decimal mode, VAL is usually $FE. Two different functions have been discovered for LAX, opcode $AB. One is A = X = ANE (see above) and the other, encountered with 6510 and 8502, is less complicated A = X = (A & #byte). However, according to what is reported, the version altering only the lowest bits of each nybble seems to be more common. What happens, is that $AB loads a value into both A and X, ANDing the low bit of each nybble with the corresponding bit of the old A. However, there are exceptions. Sometimes the low bit is cleared even when A contains a '1', and sometimes other bits are cleared. The exceptions seem random (they change every time I run the test). Oops - that was in decimal mode. Much the same with D=0. What causes the randomness? Probably it is that it is marginal logic levels - when too much wired-anding goes on, some of the signals get very close to the threshold. Perhaps we're seeing some of them step over it. The low bit of each nybble is special, since it has to cope with carry differently (remember decimal mode). We never see a '0' turn into a '1'. Since these instructions are unpredictable, they should not be used. There is still very strange instruction left, the one named SHA/X/Y, which is the only one with only indexed addressing modes. Actually, the commands 'SHA', 'SHX' and 'SHY' are generated by the indexing algorithm. While using indexed addressing, effective address for page boundary crossing is calculated as soon as possible so it does not slow down operation. As a result, in the case of SHA/X/Y, the address and data are processed at the same time making AND between them to take place. Thus, the value to be stored by SAX, for example, is in fact (A & X & (ADDR_HI + 1)). On page boundary crossing the same value is copied also to high byte of the effective address. RELIGION_MODE_OFF Register selection for load and store bit1 bit0 A X Y 0 0 x 0 1 x 1 0 x 1 1 x x So, A and X are selected by bits 1 and 0 respectively, while ~(bit1|bit0) enables Y. Indexing is determined by bit4, even in relative addressing mode, which is one kind of indexing. Lines containing opcodes xxx000x1 (01 and 03) are treated as absolute after the effective address has been loaded into CPU. Zeropage,y and Absolute,y (codes 10x1 x11x) are distinquished by bit5. Decimal mode in NMOS 6500 series Most sources claim that the NMOS 6500 series sets the N, V and Z flags unpredictably when performing addition or subtraction in decimal mode. Of course, this is not true. While testing how the flags are set, I also wanted to see what happens if you use illegal BCD values. ADC works in Decimal mode in a quite complicated way. It is amazing how it can do that all in a single cycle. Here's a C code version of the instruction: unsigned A, /* Accumulator */ AL, /* low nybble of accumulator */ AH, /* high nybble of accumulator */ C, /* Carry flag */ Z, /* Zero flag */ V, /* oVerflow flag */ N, /* Negative flag */ s; /* value to be added to Accumulator */ AL = (A & 15) + (s & 15) + C; /* Calculate the lower nybble. */ AH = (A >> 4) + (s >> 4) + (AL > 15); /* Calculate the upper nybble. */ if (AL > 9) AL += 6; /* BCD fixup for lower nybble. */ Z = ((A + s + C) & 255 != 0); /* Zero flag is set just like in Binary mode. */ /* Negative and Overflow flags are set with the same logic than in Binary mode, but after fixing the lower nybble. */ N = (AH & 8 != 0); V = ((AH << 4) ^ A) & 128 && !((A ^ s) & 128); if (AH > 9) AH += 6; /* BCD fixup for upper nybble. */ /* Carry is the only flag set after fixing the result. */ C = (AH > 15); A = ((AH << 4) | (AL & 15)) & 255; The C flag is set as the quiche eaters expect, but the N and V flags are set after fixing the lower nybble but before fixing the upper one. They use the same logic than binary mode ADC. The Z flag is set before any BCD fixup, so the D flag does not have any influence on it. Proof: The following test program tests all 131072 ADC combinations in Decimal mode, and aborts with BRK if anything breaks this theory. If everything goes well, it ends in RTS. begin 600 dadc M 0@9",D'GL(H-#,IJC(U-JS"*#0T*:HR-@ 'BI&* A/N$_$B@+)$KH(V1 M*Q@(I?PI#X7]I?LI#V7]R0J0 FD%J"D/A?VE^RGP9?PI\ C $) ":0^JL @H ML ?)H) &""@X:5\X!?V%_0AH*3W@ ! ""8"HBD7[$ JE^T7\, 28"4"H**7[ M9?S0!)@) J@8N/BE^V7\V A%_= G:(3]1?W0(.;[T(?F_-"#:$D8\ )88*D= 0&&4KA?NI &4LA?RI.&S[ A% end All programs in this chapter have been successfully tested on a Vic20 and a Commodore 64 and a Commodore 128D in C64 mode. They should run on C16, +4 and on the PET series as well. If not, please report the problem to Marko M"akel"a. Each test in this chapter should run in less than a minute at 1 MHz. SBC is much easier. Just like CMP, its flags are not affected by the D flag. Proof: begin 600 dsbc-cmp-flags M 0@9",D'GL(H-#,IJC(U-JS"*#0T*:HR-@ 'B@ (3[A/RB XH8:66HL2N@ M09$KH$R1*XII::BQ*Z!%D2N@4)$K^#BXI?OE_-@(:(7].+BE^^7\"&A%_? ! 5 .;[T./F_-#?RA"_8!@X&#CEY<7% end The only difference in SBC's operation in decimal mode from binary mode is the result-fixup: unsigned A, /* Accumulator */ AL, /* low nybble of accumulator */ AH, /* high nybble of accumulator */ C, /* Carry flag */ Z, /* Zero flag */ V, /* oVerflow flag */ N, /* Negative flag */ s; /* value to be added to Accumulator */ AL = (A & 15) - (s & 15) - !C; /* Calculate the lower nybble. */ if (AL & 16) AL -= 6; /* BCD fixup for lower nybble. */ AH = (A >> 4) - (s >> 4) - (AL & 16); /* Calculate the upper nybble. */ if (AH & 16) AH -= 6; /* BCD fixup for upper nybble. */ /* The flags are set just like in Binary mode. */ C = (A - s - !C) & 256 != 0; Z = (A - s - !C) & 255 != 0; V = ((A - s - !C) ^ s) & 128 && (A ^ s) & 128; N = (A - s - !C) & 128 != 0; A = ((AH << 4) | (AL & 15)) & 255; Again Z flag is set before any BCD fixup. The N and V flags are set at any time before fixing the high nybble. The C flag may be set in any phase. Decimal subtraction is easier than decimal addition, as you have to make the BCD fixup only when a nybble overflows. In decimal addition, you had to verify if the nybble was greater than 9. The processor has an internal "half carry" flag for the lower nybble, used to trigger the BCD fixup. When calculating with legal BCD values, the lower nybble cannot overflow again when fixing it. So, the processor does not handle overflows while performing the fixup. Similarly, the BCD fixup occurs in the high nybble only if the value overflows, i.e. when the C flag will be cleared. Because SBC's flags are not affected by the Decimal mode flag, you could guess that CMP uses the SBC logic, only setting the C flag first. But the SBX instruction shows that CMP also temporarily clears the D flag, although it is totally unnecessary. The following program, which tests SBC's result and flags, contains the 6502 version of the pseudo code example above. begin 600 dsbc M 0@9",D'GL(H-#,IJC(U-JS"*#0T*:HR-@ 'BI&* A/N$_$B@+)$KH':1 M*S@(I?PI#X7]I?LI#^7]L /I!1@I#ZBE_"GPA?VE^RGP"#CE_2GPL KI7RBP M#ND/.+ )*+ &Z0^P NE?A/T%_87]*+BE^^7\"&BH.+CXI?OE_-@(1?W0FVB$ 8_47]T)3F^]">YOS0FFA)&- $J3C0B%A@ end Obviously the undocumented instructions RRA (ROR+ADC) and ISB (INC+SBC) have inherited also the decimal operation from the official instructions ADC and SBC. The program droradc proves this statement for ROR, and the dincsbc test proves this for ISB. Finally, dincsbc-deccmp proves that ISB's and DCP's (DEC+CMP) flags are not affected by the D flag. begin 644 droradc M`0@9",D'GL(H-#,IJC(U-JS"*#0T*:HR-@```'BI&*``A/N$_$B@+)$KH(V1 M*S@(I?PI#X7]I?LI#V7]R0J0`FD%J"D/A?VE^RGP9?PI\`C`$)`":0^JL`@H ML`?)H)`&""@X:5\X!?V%_0AH*3W@`!`""8"HBD7[$`JE^T7\,`28"4"H**7[ M9?S0!)@)`J@XN/BE^R;\9_S8"$7]T"=HA/U%_=`@YOO0A>;\T(%H21CP`EA@ 2J1T892N%^ZD`92R%_*DX;/L` ` end begin 644 dincsbc M`0@9",D'GL(H-#,IJC(U-JS"*#0T*:HR-@```'BI&*``A/N$_$B@+)$KH':1 M*S@(I?PI#X7]I?LI#^7]L`/I!1@I#ZBE_"GPA?VE^RGP"#CE_2GPL`KI7RBP M#ND/.+`)*+`&Z0^P`NE?A/T%_87]*+BE^^7\"&BH.+CXI?O&_.?\V`A%_="9 ::(3]1?W0DN;[T)SF_-"8:$D8T`2I.-"&6&#\ ` end begin 644 dincsbc-deccmp M`0@9",D'GL(H-#,IJC(U-JS"*#0T*:HR-@```'B@`(3[A/RB`XH8:7>HL2N@ M3Y$KH%R1*XII>ZBQ*Z!3D2N@8)$KBFE_J+$KH%61*Z!BD2OX.+BE^^;\Q_S8 L"&B%_3BXI?OF_,?\"&A%_?`!`.;[T-_F_-#;RA"M8!@X&#CFYL;&Q\?GYP#8 ` end 6510 features o PHP always pushes the Break (B) flag as a `1' to the stack. Jukka Tapanim"aki claimed in C=lehti issue 3/89, on page 27 that the processor makes a logical OR between the status register's bit 4 and the bit 8 of the stack pointer register (which is always 1). He did not give any reasons for this argument, and has refused to clarify it afterwards. Well, this was not the only error in his article... o Indirect addressing modes do not handle page boundary crossing at all. When the parameter's low byte is $FF, the effective address wraps around and the CPU fetches high byte from $xx00 instead of $xx00+$0100. E.g. JMP ($01FF) fetches PCL from $01FF and PCH from $0100, and LDA ($FF),Y fetches the base address from $FF and $00. o Indexed zero page addressing modes never fix the page address on crossing the zero page boundary. E.g. LDX #$01 : LDA ($FF,X) loads the effective address from $00 and $01. o The processor always fetches the byte following a relative branch instruction. If the branch is taken, the processor reads then the opcode from the destination address. If page boundary is crossed, it first reads a byte from the old page from a location that is bigger or smaller than the correct address by one page. o If you cross a page boundary in any other indexed mode, the processor reads an incorrect location first, a location that is smaller by one page. o Read-Modify-Write instructions write unmodified data, then modified (so INC effectively does LDX loc;STX loc;INX;STX loc) o -RDY is ignored during writes (This is why you must wait 3 cycles before doing any DMA -- the maximum number of consecutive writes is 3, which occurs during interrupts except -RESET.) o Some undefined opcodes may give really unpredictable results. o All registers except the Program Counter remain unmodified after -RESET. (This is why you must preset D and I flags in the RESET handler.) Different CPU types The Rockwell data booklet 29651N52 (technical information about R65C00 microprocessors, dated October 1984), lists the following differences between NMOS R6502 microprocessor and CMOS R65C00 family: 1. Indexed addressing across page boundary. NMOS: Extra read of invalid address. CMOS: Extra read of last instruction byte. 2. Execution of invalid op codes. NMOS: Some terminate only by reset. Results are undefined. CMOS: All are NOPs (reserved for future use). 3. Jump indirect, operand = XXFF. NMOS: Page address does not increment. CMOS: Page address increments and adds one additional cycle. 4. Read/modify/write instructions at effective address. NMOS: One read and two write cycles. CMOS: Two read and one write cycle. 5. Decimal flag. NMOS: Indeterminate after reset. CMOS: Initialized to binary mode (D=0) after reset and interrupts. 6. Flags after decimal operation. NMOS: Invalid N, V and Z flags. CMOS: Valid flag adds one additional cycle. 7. Interrupt after fetch of BRK instruction. NMOS: Interrupt vector is loaded, BRK vector is ignored. CMOS: BRK is executed, then interrupt is executed. 6510 Instruction Timing The NMOS 6500 series processors always perform at least two reads for each instruction. In addition to the operation code (opcode), they fetch the next byte. This is quite efficient, as most instructions are two or three bytes long. The processors also use a sort of pipelining. If an instruction does not store data in memory on its last cycle, the processor can fetch the opcode of the next instruction while executing the last cycle. For instance, the instruction EOR #$FF truly takes three cycles. On the first cycle, the opcode $49 will be fetched. During the second cycle the processor decodes the opcode and fetches the parameter #$FF. On the third cycle, the processor will perform the operation and store the result to accumulator, but simultaneously it fetches the opcode for the next instruction. This is why the instruction effectively takes only two cycles. The following tables show what happens on the bus while executing different kinds of instructions. Interrupts NMI and IRQ both take 7 cycles. Their timing diagram is much like BRK's (see below). IRQ will be executed only when the I flag is clear. IRQ and BRK both set the I flag, whereas the NMI does not affect its state. The processor will usually wait for the current instruction to complete before executing the interrupt sequence. To process the interrupt before the next instruction, the interrupt must occur before the last cycle of the current instruction. There is one exception to this rule: the BRK instruction. If a hardware interrupt (NMI or IRQ) occurs before the fourth (flags saving) cycle of BRK, the BRK instruction will be skipped, and the processor will jump to the hardware interrupt vector. This sequence will always take 7 cycles. You do not completely lose the BRK interrupt, the B flag will be set in the pushed status register if a BRK instruction gets interrupted. When BRK and IRQ occur at the same time, this does not cause any problems, as your program will consider it as a BRK, and the IRQ would occur again after the processor returned from your BRK routine, unless you cleared the interrupt source in your BRK handler. But the simultaneous occurrence of NMI and BRK is far more fatal. If you do not check the B flag in the NMI routine and subtract two from the return address when needed, the BRK instruction will be skipped. If the NMI and IRQ interrupts overlap each other (one interrupt occurs before fetching the interrupt vector for the other interrupt), the processor will most probably jump to the NMI vector in every case, and then jump to the IRQ vector after processing the first instruction of the NMI handler. This has not been measured yet, but the IRQ is very similar to BRK, and many sources state that the NMI has higher priority than IRQ. However, it might be that the processor takes the interrupt that comes later, i.e. you could lose an NMI interrupt if an IRQ occurred in four cycles after it. After finishing the interrupt sequence, the processor will start to execute the first instruction of the interrupt routine. This proves that the processor uses a sort of pipelining: it finishes the current instruction (or interrupt sequence) while reading the opcode of the next instruction. RESET does not push program counter on stack, and it lasts probably 6 cycles after deactivating the signal. Like NMI, RESET preserves all registers except PC. Instructions accessing the stack BRK # address R/W description --- ------- --- ----------------------------------------------- 1 PC R fetch opcode, increment PC 2 PC R read next instruction byte (and throw it away), increment PC 3 $0100,S W push PCH on stack (with B flag set), decrement S 4 $0100,S W push PCL on stack, decrement S 5 $0100,S W push P on stack, decrement S 6 $FFFE R fetch PCL 7 $FFFF R fetch PCH RTI # address R/W description --- ------- --- ----------------------------------------------- 1 PC R fetch opcode, increment PC 2 PC R read next instruction byte (and throw it away) 3 $0100,S R increment S 4 $0100,S R pull P from stack, increment S 5 $0100,S R pull PCL from stack, increment S 6 $0100,S R pull PCH from stack RTS # address R/W description --- ------- --- ----------------------------------------------- 1 PC R fetch opcode, increment PC 2 PC R read next instruction byte (and throw it away) 3 $0100,S R increment S 4 $0100,S R pull PCL from stack, increment S 5 $0100,S R pull PCH from stack 6 PC R increment PC PHA, PHP # address R/W description --- ------- --- ----------------------------------------------- 1 PC R fetch opcode, increment PC 2 PC R read next instruction byte (and throw it away) 3 $0100,S W push register on stack, decrement S PLA, PLP # address R/W description --- ------- --- ----------------------------------------------- 1 PC R fetch opcode, increment PC 2 PC R read next instruction byte (and throw it away) 3 $0100,S R increment S 4 $0100,S R pull register from stack JSR # address R/W description --- ------- --- ------------------------------------------------- 1 PC R fetch opcode, increment PC 2 PC R fetch low address byte, increment PC 3 $0100,S R internal operation (predecrement S?) 4 $0100,S W push PCH on stack, decrement S 5 $0100,S W push PCL on stack, decrement S 6 PC R copy low address byte to PCL, fetch high address byte to PCH Accumulator or implied addressing # address R/W description --- ------- --- ----------------------------------------------- 1 PC R fetch opcode, increment PC 2 PC R read next instruction byte (and throw it away) Immediate addressing # address R/W description --- ------- --- ------------------------------------------ 1 PC R fetch opcode, increment PC 2 PC R fetch value, increment PC Absolute addressing JMP # address R/W description --- ------- --- ------------------------------------------------- 1 PC R fetch opcode, increment PC 2 PC R fetch low address byte, increment PC 3 PC R copy low address byte to PCL, fetch high address byte to PCH Read instructions (LDA, LDX, LDY, EOR, AND, ORA, ADC, SBC, CMP, BIT, LAX, NOP) # address R/W description --- ------- --- ------------------------------------------ 1 PC R fetch opcode, increment PC 2 PC R fetch low byte of address, increment PC 3 PC R fetch high byte of address, increment PC 4 address R read from effective address Read-Modify-Write instructions (ASL, LSR, ROL, ROR, INC, DEC, SLO, SRE, RLA, RRA, ISB, DCP) # address R/W description --- ------- --- ------------------------------------------ 1 PC R fetch opcode, increment PC 2 PC R fetch low byte of address, increment PC 3 PC R fetch high byte of address, increment PC 4 address R read from effective address 5 address W write the value back to effective address, and do the operation on it 6 address W write the new value to effective address Write instructions (STA, STX, STY, SAX) # address R/W description --- ------- --- ------------------------------------------ 1 PC R fetch opcode, increment PC 2 PC R fetch low byte of address, increment PC 3 PC R fetch high byte of address, increment PC 4 address W write register to effective address Zero page addressing Read instructions (LDA, LDX, LDY, EOR, AND, ORA, ADC, SBC, CMP, BIT, LAX, NOP) # address R/W description --- ------- --- ------------------------------------------ 1 PC R fetch opcode, increment PC 2 PC R fetch address, increment PC 3 address R read from effective address Read-Modify-Write instructions (ASL, LSR, ROL, ROR, INC, DEC, SLO, SRE, RLA, RRA, ISB, DCP) # address R/W description --- ------- --- ------------------------------------------ 1 PC R fetch opcode, increment PC 2 PC R fetch address, increment PC 3 address R read from effective address 4 address W write the value back to effective address, and do the operation on it 5 address W write the new value to effective address Write instructions (STA, STX, STY, SAX) # address R/W description --- ------- --- ------------------------------------------ 1 PC R fetch opcode, increment PC 2 PC R fetch address, increment PC 3 address W write register to effective address Zero page indexed addressing Read instructions (LDA, LDX, LDY, EOR, AND, ORA, ADC, SBC, CMP, BIT, LAX, NOP) # address R/W description --- --------- --- ------------------------------------------ 1 PC R fetch opcode, increment PC 2 PC R fetch address, increment PC 3 address R read from address, add index register to it 4 address+I* R read from effective address Notes: I denotes either index register (X or Y). * The high byte of the effective address is always zero, i.e. page boundary crossings are not handled. Read-Modify-Write instructions (ASL, LSR, ROL, ROR, INC, DEC, SLO, SRE, RLA, RRA, ISB, DCP) # address R/W description --- --------- --- --------------------------------------------- 1 PC R fetch opcode, increment PC 2 PC R fetch address, increment PC 3 address R read from address, add index register X to it 4 address+X* R read from effective address 5 address+X* W write the value back to effective address, and do the operation on it 6 address+X* W write the new value to effective address Note: * The high byte of the effective address is always zero, i.e. page boundary crossings are not handled. Write instructions (STA, STX, STY, SAX) # address R/W description --- --------- --- ------------------------------------------- 1 PC R fetch opcode, increment PC 2 PC R fetch address, increment PC 3 address R read from address, add index register to it 4 address+I* W write to effective address Notes: I denotes either index register (X or Y). * The high byte of the effective address is always zero, i.e. page boundary crossings are not handled. Absolute indexed addressing Read instructions (LDA, LDX, LDY, EOR, AND, ORA, ADC, SBC, CMP, BIT, LAX, LAE, SHS, NOP) # address R/W description --- --------- --- ------------------------------------------ 1 PC R fetch opcode, increment PC 2 PC R fetch low byte of address, increment PC 3 PC R fetch high byte of address, add index register to low address byte, increment PC 4 address+I* R read from effective address, fix the high byte of effective address 5+ address+I R re-read from effective address Notes: I denotes either index register (X or Y). * The high byte of the effective address may be invalid at this time, i.e. it may be smaller by $100. + This cycle will be executed only if the effective address was invalid during cycle #4, i.e. page boundary was crossed. Read-Modify-Write instructions (ASL, LSR, ROL, ROR, INC, DEC, SLO, SRE, RLA, RRA, ISB, DCP) # address R/W description --- --------- --- ------------------------------------------ 1 PC R fetch opcode, increment PC 2 PC R fetch low byte of address, increment PC 3 PC R fetch high byte of address, add index register X to low address byte, increment PC 4 address+X* R read from effective address, fix the high byte of effective address 5 address+X R re-read from effective address 6 address+X W write the value back to effective address, and do the operation on it 7 address+X W write the new value to effective address Notes: * The high byte of the effective address may be invalid at this time, i.e. it may be smaller by $100. Write instructions (STA, STX, STY, SHA, SHX, SHY) # address R/W description --- --------- --- ------------------------------------------ 1 PC R fetch opcode, increment PC 2 PC R fetch low byte of address, increment PC 3 PC R fetch high byte of address, add index register to low address byte, increment PC 4 address+I* R read from effective address, fix the high byte of effective address 5 address+I W write to effective address Notes: I denotes either index register (X or Y). * The high byte of the effective address may be invalid at this time, i.e. it may be smaller by $100. Because the processor cannot undo a write to an invalid address, it always reads from the address first. Relative addressing (BCC, BCS, BNE, BEQ, BPL, BMI, BVC, BVS) # address R/W description --- --------- --- --------------------------------------------- 1 PC R fetch opcode, increment PC 2 PC R fetch operand, increment PC 3 PC R Fetch opcode of next instruction, If branch is taken, add operand to PCL. Otherwise increment PC. 4+ PC* R Fetch opcode of next instruction. Fix PCH. If it did not change, increment PC. 5! PC R Fetch opcode of next instruction, increment PC. Notes: The opcode fetch of the next instruction is included to this diagram for illustration purposes. When determining real execution times, remember to subtract the last cycle. * The high byte of Program Counter (PCH) may be invalid at this time, i.e. it may be smaller or bigger by $100. + If branch is taken, this cycle will be executed. ! If branch occurs to different page, this cycle will be executed. Indexed indirect addressing Read instructions (LDA, ORA, EOR, AND, ADC, CMP, SBC, LAX) # address R/W description --- ----------- --- ------------------------------------------ 1 PC R fetch opcode, increment PC 2 PC R fetch pointer address, increment PC 3 pointer R read from the address, add X to it 4 pointer+X R fetch effective address low 5 pointer+X+1 R fetch effective address high 6 address R read from effective address Note: The effective address is always fetched from zero page, i.e. the zero page boundary crossing is not handled. Read-Modify-Write instructions (SLO, SRE, RLA, RRA, ISB, DCP) # address R/W description --- ----------- --- ------------------------------------------ 1 PC R fetch opcode, increment PC 2 PC R fetch pointer address, increment PC 3 pointer R read from the address, add X to it 4 pointer+X R fetch effective address low 5 pointer+X+1 R fetch effective address high 6 address R read from effective address 7 address W write the value back to effective address, and do the operation on it 8 address W write the new value to effective address Note: The effective address is always fetched from zero page, i.e. the zero page boundary crossing is not handled. Write instructions (STA, SAX) # address R/W description --- ----------- --- ------------------------------------------ 1 PC R fetch opcode, increment PC 2 PC R fetch pointer address, increment PC 3 pointer R read from the address, add X to it 4 pointer+X R fetch effective address low 5 pointer+X+1 R fetch effective address high 6 address W write to effective address Note: The effective address is always fetched from zero page, i.e. the zero page boundary crossing is not handled. Indirect indexed addressing Read instructions (LDA, EOR, AND, ORA, ADC, SBC, CMP) # address R/W description --- ----------- --- ------------------------------------------ 1 PC R fetch opcode, increment PC 2 PC R fetch pointer address, increment PC 3 pointer R fetch effective address low 4 pointer+1 R fetch effective address high, add Y to low byte of effective address 5 address+Y* R read from effective address, fix high byte of effective address 6+ address+Y R read from effective address Notes: The effective address is always fetched from zero page, i.e. the zero page boundary crossing is not handled. * The high byte of the effective address may be invalid at this time, i.e. it may be smaller by $100. + This cycle will be executed only if the effective address was invalid during cycle #5, i.e. page boundary was crossed. Read-Modify-Write instructions (SLO, SRE, RLA, RRA, ISB, DCP) # address R/W description --- ----------- --- ------------------------------------------ 1 PC R fetch opcode, increment PC 2 PC R fetch pointer address, increment PC 3 pointer R fetch effective address low 4 pointer+1 R fetch effective address high, add Y to low byte of effective address 5 address+Y* R read from effective address, fix high byte of effective address 6 address+Y R read from effective address 7 address+Y W write the value back to effective address, and do the operation on it 8 address+Y W write the new value to effective address Notes: The effective address is always fetched from zero page, i.e. the zero page boundary crossing is not handled. * The high byte of the effective address may be invalid at this time, i.e. it may be smaller by $100. Write instructions (STA, SHA) # address R/W description --- ----------- --- ------------------------------------------ 1 PC R fetch opcode, increment PC 2 PC R fetch pointer address, increment PC 3 pointer R fetch effective address low 4 pointer+1 R fetch effective address high, add Y to low byte of effective address 5 address+Y* R read from effective address, fix high byte of effective address 6 address+Y W write to effective address Notes: The effective address is always fetched from zero page, i.e. the zero page boundary crossing is not handled. * The high byte of the effective address may be invalid at this time, i.e. it may be smaller by $100. Absolute indirect addressing (JMP) # address R/W description --- --------- --- ------------------------------------------ 1 PC R fetch opcode, increment PC 2 PC R fetch pointer address low, increment PC 3 PC R fetch pointer address high, increment PC 4 pointer R fetch low address to latch 5 pointer+1* R fetch PCH, copy latch to PCL Note: * The PCH will always be fetched from the same page than PCL, i.e. page boundary crossing is not handled. How Real Programmers Acknowledge Interrupts With RMW instructions: ; beginning of combined raster/timer interrupt routine LSR $D019 ; clear VIC interrupts, read raster interrupt flag to C BCS raster ; jump if VIC caused an interrupt ... ; timer interrupt routine Operational diagram of LSR $D019: # data address R/W --- ---- ------- --- --------------------------------- 1 4E PC R fetch opcode 2 19 PC+1 R fetch address low 3 D0 PC+2 R fetch address high 4 xx $D019 R read memory 5 xx $D019 W write the value back, rotate right 6 xx/2 $D019 W write the new value back The 5th cycle acknowledges the interrupt by writing the same value back. If only raster interrupts are used, the 6th cycle has no effect on the VIC. (It might acknowledge also some other interrupts.) With indexed addressing: ; acknowledge interrupts to both CIAs LDX #$10 LDA $DCFD,X Operational diagram of LDA $DCFD,X: # data address R/W description --- ---- ------- --- --------------------------------- 1 BD PC R fetch opcode 2 FD PC+1 R fetch address low 3 DC PC+2 R fetch address high, add X to address low 4 xx $DC0D R read from address, fix high byte of address 5 yy $DD0D R read from right address ; acknowledge interrupts to CIA 2 LDX #$10 STA $DDFD,X Operational diagram of STA $DDFD,X: # data address R/W description --- ---- ------- --- --------------------------------- 1 9D PC R fetch opcode 2 FD PC+1 R fetch address low 3 DC PC+2 R fetch address high, add X to address low 4 xx $DD0D R read from address, fix high byte of address 5 ac $DE0D W write to right address With branch instructions: ; acknowledge interrupts to CIA 2 LDA #$00 ; clear N flag JMP $DD0A DD0A BPL $DC9D ; branch DC9D BRK ; return You need the following preparations to initialize the CIA registers: LDA #$91 ; argument of BPL STA $DD0B LDA #$10 ; BPL STA $DD0A STA $DD08 ; load the ToD values from the latches LDA $DD0B ; freeze the ToD display LDA #$7F STA $DC0D ; assure that $DC0D is $00 Operational diagram of BPL $DC9D: # data address R/W description --- ---- ------- --- --------------------------------- 1 10 $DD0A R fetch opcode 2 91 $DD0B R fetch argument 3 xx $DD0C R fetch opcode, add argument to PCL 4 yy $DD9D R fetch opcode, fix PCH ( 5 00 $DC9D R fetch opcode ) ; acknowledge interrupts to CIA 1 LSR ; clear N flag JMP $DCFA DCFA BPL $DD0D DD0D BRK ; Again you need to set the ToD registers of CIA 1 and the ; Interrupt Control Register of CIA 2 first. Operational diagram of BPL $DD0D: # data address R/W description --- ---- ------- --- --------------------------------- 1 10 $DCFA R fetch opcode 2 11 $DCFB R fetch argument 3 xx $DCFC R fetch opcode, add argument to PCL 4 yy $DC0D R fetch opcode, fix PCH ( 5 00 $DD0D R fetch opcode ) ; acknowledge interrupts to CIA 2 automagically ; preparations LDA #$7F STA $DD0D ; disable all interrupt sources of CIA2 LDA $DD0E AND #$BE ; ensure that $DD0C remains constant STA $DD0E ; and stop the timer LDA #$FD STA $DD0C ; parameter of BPL LDA #$10 STA $DD0B ; BPL LDA #$40 STA $DD0A ; RTI/parameter of LSR LDA #$46 STA $DD09 ; LSR STA $DD08 ; load the ToD values from the latches LDA $DD0B ; freeze the ToD display LDA #$09 STA $0318 LDA #$DD STA $0319 ; change NMI vector to $DD09 LDA #$FF ; Try changing this instruction's operand STA $DD05 ; (see comment below). LDA #$FF STA $DD04 ; set interrupt frequency to 1/65536 cycles LDA $DD0E AND #$80 ORA #$11 LDX #$81 STX $DD0D ; enable timer interrupt STA $DD0E ; start timer LDA #$00 ; To see that the interrupts really occur, STA $D011 ; use something like this and see how LOOP DEC $D020 ; changing the byte loaded to $DD05 from BNE LOOP ; #$FF to #$0F changes the image. When an NMI occurs, the processor jumps to Kernal code, which jumps to ($0318), which points to the following routine: DD09 LSR $40 ; clear N flag BPL $DD0A ; Note: $DD0A contains RTI. Operational diagram of BPL $DD0A: # data address R/W description --- ---- ------- --- --------------------------------- 1 10 $DD0B R fetch opcode 2 11 $DD0C R fetch argument 3 xx $DD0D R fetch opcode, add argument to PCL 4 40 $DD0A R fetch opcode, (fix PCH) With RTI: ; the fastest possible interrupt handler in the 6500 family ; preparations SEI LDA $01 ; disable ROM and enable I/O AND #$FD ORA #$05 STA $01 LDA #$7F STA $DD0D ; disable CIA 2's all interrupt sources LDA $DD0E AND #$BE ; ensure that $DD0C remains constant STA $DD0E ; and stop the timer LDA #$40 STA $DD0C ; store RTI to $DD0C LDA #$0C STA $FFFA LDA #$DD STA $FFFB ; change NMI vector to $DD0C LDA #$FF ; Try changing this instruction's operand STA $DD05 ; (see comment below). LDA #$FF STA $DD04 ; set interrupt frequency to 1/65536 cycles LDA $DD0E AND #$80 ORA #$11 LDX #$81 STX $DD0D ; enable timer interrupt STA $DD0E ; start timer LDA #$00 ; To see that the interrupts really occur, STA $D011 ; use something like this and see how LOOP DEC $D020 ; changing the byte loaded to $DD05 from BNE LOOP ; #$FF to #$0F changes the image. When an NMI occurs, the processor jumps to Kernal code, which jumps to ($0318), which points to the following routine: DD0C RTI How on earth can this clear the interrupts? Remember, the processor always fetches two successive bytes for each instruction. A little more practical version of this is redirecting the NMI (or IRQ) to your own routine, whose last instruction is JMP $DD0C or JMP $DC0C. If you want to confuse more, change the 0 in the address to a hexadecimal digit different from the one you used when writing the RTI. Or you can combine the latter two methods: DD09 LSR $xx ; xx is any appropriate BCD value 00-59. BPL $DCFC DCFC RTI This example acknowledges interrupts to both CIAs. If you want to confuse the examiners of your code, you can use any of these techniques. Although these examples use no undefined opcodes, they do not necessarily run correctly on CMOS processors. However, the RTI example should run on 65C02 and 65C816, and the latter branch instruction example might work as well. The RMW instruction method has been used in some demos, others were developed by Marko M"akel"a. His favourite is the automagical RTI method, although it does not have any practical applications, except for some time dependent data decryption routines for very complicated copy protections. fceu-0.98.12/Documentation/tech/cpu/NESSOUND.txt0000644000175000000620000006034007757447436021066 0ustar joestaff00000000000000The NES sound channel guide 1.8 Written by Brad Taylor. btmine@hotmail.com Last updated: July 27th, 2000. All results were obtained by studying prior information available (from nestech 1.00, and postings on NESDev from miscellanious people), and through a series of experiments conducted by me. Results acquired by individuals prior to my reverse-engineering have been double checked, and final results have been confirmed. Credit is due to those individual(s) who contributed any information in regards to the the miscellanious sound channels wihtin the NES. A special thanks goes out to Matthew Conte, for his expertise on pseudo-random number generation (amoung other things), which allowed for the full reverse engineering of the NES's noise channel to take place. Without his help, I would still be trying to find a needle in a haystack, as far as the noise's method of pseudo-random number generation goes. Additionally, his previous findings / reverse engineering work on the NES's sound hardware really got the ball of NES sound emulation rolling. If it weren't for Matt's original work, this document wouldn't exist. Thanks to Kentaro Ishihara, for his excellent work on finding the difference in upward frequency sweep between the 2 square wave channels. **************** * Introduction * **************** The 2A03 (NES's integrated CPU) has 4 internal channels to it that have the ability to generate semi-analog sound, for musical playback purposes. These channels are 2 square wave channels, one triangle wave channel, and a noise generation channel. This document will go into full detail on every aspect of the operation and timing of the mentioned sound channels. ******************* * Channel details * ******************* Each channel has different characteristics to it that make up it's operation. The square channel(s) have the ability to generate a square wave frequency in the range of 54.6 Hz to 12.4 KHz. It's key features are frequency sweep abilities, and output duty cycle adjustment. The triangle wave channel has the ability to generate an output triangle wave with a resolution of 4-bits (16 steps), in the range of 27.3 Hz to 55.9 KHz. The key features this channel has is it's analog triangle wave output, and it's linear counter, which can be set to automatically disable the channel's sound after a certain period of time has gone by. The noise channel is used for producing random frequencys, which results in a "noisey" sounding output. Output frequencys can range anywhere from 29.3 Hz to 447 KHz. It's key feature is it's pseudo- random number generator, which generates the random output frequencys heard by the channel. ***************** * Frame counter * ***************** The 2A03 has an internal frame counter. It has the ability to generate 60 Hz (1/1 framerate), 120 Hz (1/2 framerate), and 240 Hz (1/4 framerate) signals, used by some of the sound hardware. The 1/4 framerate is calculated by taking twice the CPU clock speed (3579545.454545 Hz), and dividing it by 14915 (i.e., the divide-by-14915 counter is decremented on the rising AND falling edge of the CPU's clock signal). ************************ * Sound hardware delay * ************************ After resetting the 2A03, the first time any sound channel(s) length counter contains a non-zero value (channel is enabled), there will be a 2048 CPU clock cycle delay before any of the sound hardware is clocked. After the 2K clock cycles go by, the NES sound hardware will be clocked normally. This phenomenon only occurs prior to a system reset, and only occurs during the first 2048 CPU clocks for any sound channel prior to a sound channel being enabled. The information in regards to this delay is only provided to keep this entire document persistently accurate on the 2A03's sound hardware, but may not be 100% accurate in itself. I haven't done much tests on the behaviour of this delay (mainly because I don't care, as I view it as a inconvenience anyway), so that's why I believe there could be some inaccuracies. ************************ * Register Assignments * ************************ The sound hardware internal to the 2A03 has been designated these special memory addresses in the CPU's memory map. $4000-$4003 Square wave 1 $4004-$4007 Square wave 2 (identical to the first, except for upward frequency sweeps (see "sweep unit" section)) $4008-$400B Triangle $400C-$400F Noise $4015 Channel enable / length counter status Note that $4015 is the only R/W register. All others are write only (attempt to read them will most likely result in a returned 040H, due to heavy capacitance on the NES's data bus). Reading a "write only" register, will have no effect on the specific register, or channel. Every sound channel has 4 registers affiliated with it. The description of the register sets are as follows: +----------------+ | Register set 1 | +----------------+ $4000(sq1)/$4004(sq2)/$400C(noise) bits --------------------------------------- 0-3 volume / envelope decay rate 4 envelope decay disable 5 length counter clock disable / envelope decay looping enable 6-7 duty cycle type (unused on noise channel) $4008(tri) bits --------------- 0-6 linear counter load register 7 length counter clock disable / linear counter start +----------------+ | Register set 2 | +----------------+ $4001(sq1)/$4005(sq2) bits -------------------------- 0-2 right shift amount 3 decrease / increase (1/0) wavelength 4-6 sweep update rate 7 sweep enable $4009(tri)/$400D(noise) bits ---------------------------- 0-7 unused +----------------+ | Register set 3 | +----------------+ $4002(sq1)/$4006(sq2)/$400A(Tri) bits ------------------------------------- 0-7 8 LSB of wavelength $400E(noise) bits ----------------- 0-3 playback sample rate 4-6 unused 7 random number type generation +----------------+ | Register set 4 | +----------------+ $4003(sq1)/$4007(sq2)/$400B(tri)/$400F(noise) bits -------------------------------------------------- 0-2 3 MS bits of wavelength (unused on noise channel) 3-7 length counter load register +--------------------------------+ | length counter status register | +--------------------------------+ $4015(read) ----------- 0 square wave channel 1 1 square wave channel 2 2 triangle wave channel 3 noise channel 4 DMC (see "DMC.TXT" for details) 5-6 unused 7 IRQ status of DMC (see "DMC.TXT" for details) +-------------------------+ | channel enable register | +-------------------------+ $4015(write) ------------ 0 square wave channel 1 1 square wave channel 2 2 triangle wave channel 3 noise channel 4 DMC channel (see "DMC.TXT" for details) 5-7 unused ************************ * Channel architecture * ************************ This section will describe the internal components making up each individual channel. Each component will then be described in full detail. Device Triangle Noise Square ------ -------- ------ ------ triangle step generator X linear counter X programmable timer X X X length counter X X X 4-bit DAC X X X volume/envelope decay unit X X sweep unit X duty cycle generator X wavelength converter X random number generator X +-------------------------+ | Triangle step generator | +-------------------------+ This is a 5-bit, single direction counter, and it is only used in the triangle channel. Each of the 4 LSB outputs of the counter lead to one input on a corresponding mutually exclusive XNOR gate. The 4 XNOR gates have been strobed together, which results in the inverted representation of the 4 LSB of the counter appearing on the outputs of the gates when the strobe is 0, and a non-inverting action taking place when the strobe is 1. The strobe is naturally connected to the MSB of the counter, which effectively produces on the output of the XNOR gates a count sequence which reflects the scenario of a near- ideal triangle step generator (D,E,F,F,E,D,...,2,1,0,0,1,2,...). At this point, the outputs of the XNOR gates will be fed into the input of a 4-bit DAC. This 5-bit counter will be halted whenever the Triangle channel's length or linear counter contains a count of 0. This results in a "latching" behaviour; the counter will NOT be reset to any definite state. On system reset, this counter is loaded with 0. The counter's clock input is connected directly to the terminal count output pin of the 11-bit programmable timer in the triangle channel. As a result of the 5-bit triangle step generator, the output triangle wave frequency will be 32 times less than the frequency of the triangle channel's programmable timer is set to generate. +----------------+ | Linear counter | +----------------+ The linear counter is only found in the triangle channel. It is a 7-bit presettable down counter, with a decoded output condition of 0 available (not exactly the same as terminal count). Here's the bit assignments: $4008 bits ---------- 0-6 bits 0-6 of the linear counter load register (NOT the linear counter itself) 7 linear counter start The counter is clocked at 240 Hz (1/4 framerate), and the calculated length in frames is 0.25*N, where N is the 7-bit loaded value. The counter is always being clocked, except when 0 appears on the output of the counter. At this point, the linear counter & triangle step counter clocks signals are disabled, which results in both counters latching their current state (the linear counter will stay at 0, and the triangle step counter will stop, and the channel will be silenced due to this). The linear counter has 2 modes: load, and count. When the linear counter is in load mode, it essentially becomes transparent (i.e. whatever value is currently in, or being written to $4008, will appear on the output of the counter). Because of this, no count action can occur in load mode. When the mode changes from load to count, the counter will now latch the value currently in it, and start counting down from there. In the count mode, the current value of $4008 is ignored by the counter (but still retained in $4008). Described below is how the mode of the linear counter is set: Writes to $400B --------------- cur mode --- ---- 1 load 0 load (during the write cycle), count Cur is the current state of the MSB of $4008. Writes to $4008 --------------- old new mode --- --- ---- 0 X count 1 0 no change (during the write cycle), count 1 1 no change Old and new represent the state(s) of the MSB of $4008. Old is the value being replaced in the MSB of $4008 on the write, and new is the value replacing the old one. "no change" indicates that the mode of the linear counter will not change from the last. +--------------------+ | Programmable timer | +--------------------+ The programmable timer is a 11-bit presettable down counter, and is found in the square, triangle, and noise channel(s). The bit assignments are as follows: $4002(sq1)/$4006(sq2)/$400A(Tri) bits ------------------------------------- 0-7 represent bits 0-7 of the 11-bit wavelength $4003(sq1)/$4007(sq2)/$400B(Tri) bits ------------------------------------- 0-2 represent bits 8-A of the 11-bit wavelength Note that on the noise channel, the 11 bits are not available directly. See the wavelength converter section, for more details. The counter has automatic syncronous reloading upon terminal count (count=0), therefore the counter will count for N+1 (N is the 11-bit loaded value) clock cycles before arriving at terminal count, and reloading. This counter will typically be clocked at the 2A03's internal 6502 speed (1.79 MHz), and produces an output frequency of 1.79 MHz/(N+1). The terminal count's output spike length is typically no longer than half a CPU clock. The TC signal will then be fed to the appropriate device for the particular sound channel (for square, this terminal count spike will lead to the duty cycle generator. For the triangle, the spike will be fed to the triangle step generator. For noise, this signal will go to the random number generator unit). +----------------+ | Length counter | +----------------+ The length counter is found in all sound channels. It is essentially a 7-bit down counter, and is conditionally clocked at a frequency of 60 Hz. When the length counter arrives at a count of 0, the counter will be stopped (stay on 0), and the appropriate channel will be silenced. The length counter clock disable bit, found in all the channels, can also be used to halt the count sequence of the length counter for the appropriate channel, by writing a 1 out to it. A 0 condition will permit counting (unless of course, the counter's current count = 0). Location(s) of the length counter clock disable bit: $4000(sq1)/$4004(sq2)/$400C(noise) bits --------------------------------------- 5 length counter clock disable $4008(tri) bits --------------- 7 length counter clock disable To load the length counter with a specified count, a write must be made out to the length register. Location(s) of the length register: $4003(sq1)/$4007(sq2)/$400B(tri)/$400F(noise) bits -------------------------------------------------- 3-7 length The 5-bit length value written, determines what 7-bit value the length counter will start counting from. A conversion table here will show how the values are translated. +-----------------------+ | bit3=0 | +-------+---------------+ | |frames | |bits +-------+-------+ |4-6 |bit7=0 |bit7=1 | +-------+-------+-------+ |0 |05 |06 | |1 |0A |0C | |2 |14 |18 | |3 |28 |30 | |4 |50 |60 | |5 |1E |24 | |6 |07 |08 | |7 |0E |10 | +-------+-------+-------+ +---------------+ | bit3=1 | +-------+-------+ |bits | | |4-7 |frames | +-------+-------+ |0 |7F | |1 |01 | |2 |02 | |3 |03 | |4 |04 | |5 |05 | |6 |06 | |7 |07 | |8 |08 | |9 |09 | |A |0A | |B |0B | |C |0C | |D |0D | |E |0E | |F |0F | +-------+-------+ The length counter's real-time status for each channel can be attained. A 0 is returned for a zero count status in the length counter (channel's sound is disabled), and 1 for a non-zero status. Here's the bit description of the length counter status register: $4015(read) ----------- 0 length counter status of square wave channel 1 1 length counter status of square wave channel 2 2 length counter status of triangle wave channel 3 length counter status of noise channel 4 length counter status of DMC (see "DMC.TXT" for details) 5-6 unused 7 IRQ status of DMC (see "DMC.TXT" for details) Writing a 0 to the channel enable register will force the length counters to always contain a count equal to 0, which renders that specific channel disabled (as if it doesn't exist). Writing a 1 to the channel enable register disables the forced length counter value of 0, but will not change the count itself (it will still be whatever it was prior to the writing of 1). Bit description of the channel enable register: $4015(write) ------------ 0 enable square wave channel 1 1 enable square wave channel 2 2 enable triangle wave channel 3 enable noise channel 4 enable DMC channel (see "DMC.TXT" for details) 5-7 unused Note that all 5 used bits in this register will be set to 0 upon system reset. +-----------+ | 4-bit DAC | +-----------+ This is just a standard 4-bit DAC with 16 steps of output voltage resolution, and is used by all 4 sound channels. On the 2A03, square wave 1 & 2 are mixed together, and are available via pin 1. Triangle & noise are available on pin 2. These analog outputs require a negative current source, to attain linear symmetry on the various output voltage levels generated by the channel(s) (moreover, to get the sound to be audible). Since the NES just uses external 100 ohm pull-down resistors, this results in the output waveforms being of very small amplitude, but with minimal linearity asymmetry. +------------------------------+ | Volume / envelope decay unit | +------------------------------+ The volume / envelope decay hardware is found only in the square wave and noise channels. $4000(sq1)/$4004(sq2)/$400C(noise) ---------------------------------- 0-3 volume / envelope decay rate 4 envelope decay disable 5 envelope decay looping enable When the envelope decay disable bit (bit 4) is set (1), the current volume value (bits 0-3) is sent directly to the channel's DAC. However, depending on certain conditions, this 4-bit volume value will be ignored, and a value of 0 will be sent to the DAC instead. This means that while the channel is enabled (producing sound), the output of the channel (what you'll hear from the DAC) will either be the 4-bit volume value, or 0. This also means that a 4-bit volume value of 0 will result in no audible sound. These conditions are as follows: - When hardware in the channel wants to disable it's sound output (like the length counter, or sweep unit (square channels only)). - On the negative portion of the output frequency signal coming from the duty cycle / random number generator hardware (square wave channel / noise channel). When the envelope decay disable bit is cleared, bits 0-3 now control the envelope decay rate, and an internal 4-bit down counter (hereon the envelope decay counter) now controls the channel's volume level. "Envelope decay" is used to describe the action of the channel's audio output volume starting from a certain value, and decreasing by 1 at a fixed (linear) rate (which produces a "fade-out" sounding effect). This fixed decrement rate is controlled by the envelope decay rate (bits 0-3). The calculated decrement rate is 240Hz/(N+1), where N is any value between $0-$F. When the channel's envelope decay counter reaches a value of 0, depending on the status of the envelope decay looping enable bit (bit 5, which is shared with the length counter's clock disable bit), 2 different things will happen: bit 5 action ----- ------ 0 The envelope decay count will stay at 0 (channel silenced). 1 The envelope decay count will wrap-around to $F (upon the next clock cycle). The envelope decay counter will then continue to count down normally. Only a write out to $4003/$4007/$400F will reset the current envelope decay counter to a known state (to $F, the maximum volume level) for the appropriate channel's envelope decay hardware. Otherwise, the envelope decay counter is always counting down (by 1) at the frequency currently contained in the volume / envelope decay rate bits (even when envelope decays are disabled (setting bit 4)), except when the envelope decay counter contains a value of 0, and envelope decay looping (bit 5) is disabled (0). +------------+ | Sweep unit | +------------+ The sweep unit is only found in the square wave channels. The controls for the sweep unit have been mapped in at $4001 for square 1, and $4005 for square 2. The controls ------------ Bit 7 when this bit is set (1), sweeping is active. This results in real-time increasing or decreasing of the the current wavelength value (the audible frequency will decrease or increase, respectively). The wavelength value in $4002/3 ($4006/7) is constantly read & updated by the sweep. Modifying the contents of $4002/3 will be immediately audible, and will result in the sweep now starting from this new wavelength value. Bits 6-4 These 3 bits represent the sweep refresh rate, or the frequency at which $4002/3 is updated with the new calculated wavelength. The refresh rate frequency is 120Hz/(N+1), where N is the value written, between 0 and 7. Bit 3 This bit controls the sweep mode. When this bit is set (1), sweeps will decrease the current wavelength value, as a 0 will increase the current wavelength. Bits 2-0 These bits control the right shift amount of the new calculated sweep update wavelength. Code that shows how the sweep unit calculates a new sweep wavelength is as follows: bit 3 ----- 0 New = Wavelength + (Wavelength >> N) 1 New = Wavelength - (Wavelength >> N) (minus an additional 1, if using square wave channel 1) where N is the the shift right value, between 0-7. Note that in decrease mode, for subtracting the 2 values: 1's compliment (NOT) is being used for square wave channel 1 2's compliment (NEG) is being used for square wave channel 2 This information is currently the only known difference between the 2 square wave channels. On each sweep refresh clock, the Wavelength register will be updated with the New value, but only if all 3 of these conditions are met: - bit 7 is set (sweeping enabled) - the shift value (which is N in the formula) does not equal to 0 - the channel's length counter contains a non-zero value Notes ----- There are certain conditions that will cause the sweep unit to silence the channel, and halt the sweep refresh clock (which effectively stops sweep action, if any). Note that these conditions pertain regardless of any sweep refresh rate values, or if sweeping is enabled/disabled (via bit 7). - an 11-bit wavelength value less than $008 will cause this condition - if the sweep unit is currently set to increase mode, the New calculated wavelength value will always be tested to see if a carry (bit $B) was generated or not (if sweeping is enabled, this carry will be examined before the Wavelength register is updated) from the shift addition calculation. If carry equals 1, the channel is silenced, and sweep action is halted. +----------------------+ | Duty cycle generator | +----------------------+ The duty cycle generator takes the fequency produced from the 11-bit programmable timer, and uses a 4 bit counter to produce 4 types of duty cycles. The output frequency is then 1/16 that of the programmable timer. The duty cycle hardware is only found in the square wave channels. The bit assignments are as follows: $4000(sq1)/$4004(sq2) --------------------- 6-7 Duty cycle type duty (positive/negative) val in clock cycles --- --------------- 00 2/14 01 4/12 10 8/ 8 11 12/ 4 Where val represents bits 6-7 of $4000/$4004. The output frequency at this point will now be fed to the volume/envelope decay hardware. +----------------------+ | Wavelength converter | +----------------------+ The wavelength converter is only used in the noise channel. It is used to convert a given 4-bit value to an 11-bit wavelength, which then is sent to the noise's own programmable timer. Here is the bit descriptions: $400E bits ---------- 0-3 The 4-bit value to be converted Below is a conversion chart that shows what 4-bit value will represent the 11-bit wavelength to be fed to the channel's programmable timer: value octave scale CPU clock cycles (11-bit wavelength+1) ----- ------ ----- -------------------------------------- 0 15 A 002 1 14 A 004 2 13 A 008 3 12 A 010 4 11 A 020 5 11 D 030 6 10 A 040 7 10 F 050 8 10 C 065 9 9 A 07F A 9 D 0BE B 8 A 0FE C 8 D 17D D 7 A 1FC E 6 A 3F9 F 5 A 7F2 Octave and scale information is provided for the music enthusiast programmer who is more familiar with notes than clock cycles. +-------------------------+ | Random number generator | +-------------------------+ The noise channel has a 1-bit pseudo-random number generator. It's based on a 15-bit shift register, and an exclusive or gate. The generator can produce two types of random number sequences: long, and short. The long sequence generates 32,767-bit long number patterns. The short sequence generates 93-bit long number patterns. The 93-bit mode will generally produce higher sounding playback frequencys on the channel. Here is the bit that controls the mode: $400E bits ---------- 7 mode If mode=0, then 32,767-bit long number sequences will be produced (32K mode), otherwise 93-bit long number sequences will be produced (93-bit mode). The following diagram shows where the XOR taps are taken off the shift register to produce the 1-bit pseudo-random number sequences for each mode. mode <----- ---- EDCBA9876543210 32K ** 93-bit * * The current result of the XOR will be transferred into bit position 0 of the SR, upon the next shift cycle. The 1-bit random number output is taken from pin E, is inverted, then is sent to the volume/envelope decay hardware for the noise channel. The shift register is shifted upon recieving 2 clock pulses from the programmable timer (the shift frequency will be half that of the frequency from the programmable timer (one octave lower)). On system reset, this shift register is loaded with a value of 1. fceu-0.98.12/Documentation/tech/cpu/dmc.txt0000644000175000000620000002360307757447436020374 0ustar joestaff00000000000000Delta modulation channel tutorial 1.0 Written by Brad Taylor Last updated: August 20th, 2000. All results were obtained by studying prior information available (from nestech 1.00, and postings on NESDev from miscellanious people), and through a series of experiments conducted by me. Results aquired by individuals prior to my reverse-engineering have been double checked, and final results have been confirmed. Credit is due to those individual(s) who contributed any information in regards to the DMC. Description ----------- The delta modulation channel (DMC) is a complex digital network of counters and registers used to produce analog sound. It's primary function is to play "samples" from memory, and have an internal counter connected to a digital to analog converter (DAC) updated accordingly. The channel is able to be assigned a pointer to a chunk of memory to be played. At timed intervals, the DMC will halt the 2A03 (NES's CPU) for 1 clock cycle to retrieve the sample to pe played. This method of playback will be refered to here on as direct memory access (DMA). Another method of playback known as pulse code modulation (PCM) is available by the channel, which requires the constant updating of one of the DMC's memory-mapped registers. Registers --------- The DMC has 5 registers assigned to it. They are as follows: $4010: play mode and DMA frequency $4011: delta counter $4012: play code's starting address $4013: length of play code $4015: DMC/IRQ status Note that $4015 is the only R/W register. All others are write only (attempt to read them will most likely result in a returned 040H, due to heavy capacitance on the NES's data bus). $4010 - Play mode and DMA frequency ----------------------------------- This register is used to control the frequency of the DMA fetches, and to control the playback mode. Bits ---- 6-7 this is the playback mode. 00 - play DMC sample until length counter reaches 0 (see $4013) x1 - loop the DMC sample (x = immaterial) 10 - play DMC sample until length counter reaches 0, then generate a CPU IRQ Looping (playback mode "x1") will have the chunk of memory played over and over, until the channel is disabled (via $4015). In this case, after the length counter reaches 0, it will be reloaded with the calculated length value of $4013. If playback mode "10" is chosen, an interrupt will be dispached when the length counter reaches 0 (after the sample is done playing). There are 2 ways to acknowledge the DMC's interrupt request upon recieving it. The first is a write to this register ($4010), with the MSB (bit 7) cleared (0). The second is any write to $4015 (see the $4015 register description for more details). If playback mode "00" is chosen, the sample plays until the length counter reaches 0. No interrupt is generated. 5-4 appear to be unused 3-0 this is the DMC frequency control. Valid values are from 0 - F. The value of this register determines how many CPU clocks to wait before the DMA will fetch another byte from memory. The # of clocks to wait -1 is initially loaded into an internal 12-bit down counter. The down counter is then decremented at the frequency of the CPU (1.79MHz). The channel fetches the next DMC sample byte when the count reaches 0, and then reloads the count. This process repeats until the channel is disabled by $4015, or when the length counter has reached 0 (if not in the looping playback mode). The exact number of CPU clock cycles is as follows: value CPU written clocks octave scale ------- ------ ------ ----- F 1B0 8 C E 240 7 G D 2A0 7 E C 350 7 C B 400 6 A A 470 6 G 9 500 6 F 8 5F0 6 D 7 6B0 6 C 6 710 5 B 5 7F0 5 A 4 8F0 5 G 3 A00 5 F 2 AA0 5 E 1 BE0 5 D 0 D60 5 C The octave and scale values shown represent the DMC DMA clock cycle rate equivelant. These values are merely shown for the music enthusiast programmer, who is more familiar with notes than clock cycles. Every fetched byte is loaded into a internal 8-bit shift register. The shift register is then clocked at 8x the DMA frequency (which means that the CPU clock count would be 1/8th that of the DMA clock count), or shifted at +3 the octave of the DMA (same scale). The data shifted out of the register is in serial form, and the least significant bit (LSB, or bit 0) of the fetched byte is the first one to be shifted out (then bit 1, bit 2, etc.). The bits shifted out are then fed to the UP/DOWN control pin of the internal delta counter, which will effectively have the counter increment it's retained value by one on "1" bit samples, and decrement it's value by one on "0" bit samples. This counter is clocked at the same frequency of the shift register's. The counter is only 6 bits in size, and has it's 6 outputs tied to the 6 MSB inputs of a 7 bit DAC. The analog output of the DAC is then what you hear being played by the DMC. Wrap around counting is not allowed on this counter. Instead, a "clipping" behaviour is exhibited. If the internal value of the counter has reached 0, and the next bit sample is a 0 (instructing a decrement), the counter will take no action. Likewise, if the counter's value is currently at -1 (111111B, or 03FH), and the bit sample to be played is a 1, the counter will not increment. $4011 - Delta counter load register ----------------------------------- bits ---- 7 appears to be unused 1-6 the load inputs of the internal delta counter 0 LSB of the DAC A write to this register effectively loads the internal delta counter with a 6 bit value, but can be used for 7 bit PCM playback. Bit 0 is connected directly to the LSB (bit 0) of the DAC, and has no effect on the internal delta counter. Bit 7 appears to be unused. This register can be used to output direct 7-bit digital PCM data to the DMC's audio output. To use this register for PCM playback, the programmer would be responsible for making sure that this register is updated at a constant rate. The rate is completely user-definable. For the regular CD quality 44100 Hz playback sample rate, this register would have to be written to approximately every 40 CPU cycles (assuming the 2A03 is running @ 1.79 MHz). $4012 - DMA address load register ---------------------------- This register contains the initial address where the DMC is to fetch samples from memory for playback. The effective address value is $4012 shl 6 or 0C000H. This register is connected to the load pins of the internal DMA address pointer register (counter). The counter is incremented after every DMA byte fetch. The counter is 15 bits in size, and has addresses wrap around from $FFFF to $8000 (not $C000, as you might have guessed). The DMA address pointer register is reloaded with the initial calculated address, when the DMC is activated from an inactive state, or when the length counter has arrived at terminal count (count=0), if in the looping playback mode. $4013 - DMA length register --------------------------- This register contains the length of the chunk of memory to be played by the DMC, and it's size is measured in bytes. The value of $4013 shl 4 is loaded into a 12 bit internal down counter, dubbed the length counter. The length counter is decremented after every DMA fetch, and when it arrives at 0, the DMC will take action(s) based on the 2 MSB of $4010. This counter will be loaded with the current calculated address value of $4013 when the DMC is activated from an inactive state. Because the value that is loaded by the length counter is $4013 shl 4, this effectively produces a calculated byte sample length of $4013 shl 4 + 1 (i.e. if $4013=0, sample length is 1 byte long; if $4013=FF, sample length is $FF1 bytes long). $4015 - DMC status ------------------ This contains the current status of the DMC channel. There are 2 read bits, and 1 write bit. bits ---- 7(R) DMC's IRQ status (1=CPU IRQ being caused by DMC) 4(R) DMC is currently enabled (playing a stream of samples) 4(W) enable/disable DMC (1=start/continue playing a sample;0=stop playing) When an IRQ goes off inside the 2A03, Bit 7 of $4015 can tell the interrupt handler if it was caused by the DMC hardware or not. This bit will be set (1) if the DMC is responsible for the IRQ. Of course, if your program has no other IRQ-generating hardware going while it's using the DMC, then reading this register is not neccessary upon IRQ generation. Note that reading this register will NOT clear bit 7 (meaning that the DMC's IRQ will still NOT be acknowledged). Also note that if the 2 MSB of $4010 were set to 10, no IRQ will be generated, and bit 7 will always be 0. Upon generation of a IRQ, to let the DMC know that the software has acknowledged the /IRQ (and to reset the DMC's internal IRQ flag), any write out to $4015 will reset the flag, or a write out to $4010 with the MSB set to 0 will do. These practices should be performed inside the IRQ handler routine. To replay the same sample that just finished, all you need to do is just write a 1 out to bit 4 of $4015. Bit 4 of $4015 reports the real-time status of the DMC. A returned value of 1 denotes that the channel is currently playing a stream of samples. A returned value of 0 indicates that the channel is inactive. If the programmer needed to know when a stream of samples was finished playing, but didn't want to use the IRQ generation feature of the DMC, then polling this bit would be a valid option. Writing a value to $4015's 4th bit has the effect of enabling the channel (start, or continue playing a stream of samples), or disabling the channel (stop all DMC activity). Note that writing a 1 to this bit while the channel is currently enabled, will have no effect on counters or registers internal to the DMC. The conditions that control the time the DMC will stay enabled are determined by the 2 MSB of $4010, and register $4013 (if applicable). System Reset ------------ On system reset, all 7 used bits of $4011 are reset to 0, the IRQ flag is cleared (disabled), and the channel is disabled. All other registers will remain unmodified. fceu-0.98.12/Documentation/tech/cpu/NESSOUND-4th.txt0000644000175000000620000007223607757447436021572 0ustar joestaff00000000000000******************************************* *2A03 sound channel hardware documentation* ******************************************* Brad Taylor (big_time_software@hotmail.com) 4th release: February 19th, 2K3 All results were obtained by studying prior information available (from nestech 1.00, and postings on NESDev from miscellanious people), and through a series of experiments conducted by me. Results acquired by individuals prior to my reverse-engineering have been double checked, and final results have been confirmed. Credit is due to those individual(s) who contributed miscellanious information in regards to NES sound channel hardware. Such individuals are: Goroh Memblers FluBBa Izumi Chibi-Tech Quietust SnowBro Kentaro Ishihara (Ki) is responsible for posting (on the NESdev mailing list) differrences in the 2 square wave channels, including the operation of 2A03 hardware publically undocumented (until now) such as the frame IRQ counter, and it's ties with sound hardware. Goroh had originally discovered some of this information, and Ki confirmed it. A special thanks goes out to Matthew Conte, for his expertise on pseudo-random number generation (amoung other things), which allowed for the full reverse engineering of the NES's noise channel to take place. Without his help, I would still be trying to find a needle in a haystack, as far as the noise's method of pseudo-random number generation goes. Additionally, his previous findings / reverse engineering work on the NES's sound hardware really got the ball of NES sound emulation rolling. If it weren't for Matt's original work, this document wouldn't exist. **************** * Introduction * **************** The 2A03 (NES's integrated CPU) has 4 internal channels to it that have the ability to generate semi-analog sound, for musical playback purposes. These channels are 2 square wave channels, one triangle wave channel, and a noise generation channel. This document will go into full detail on every aspect of the operation and timing of the mentioned sound channels. ******************* * Channel details * ******************* Each channel has different characteristics to it that make up it's operation. The square channel(s) have the ability to generate a square wave frequency in the range of 54.6 Hz to 12.4 KHz. It's key features are frequency sweep abilities, and output duty cycle adjustment. The triangle wave channel has the ability to generate an output triangle wave with a resolution of 4-bits (16 steps), in the range of 27.3 Hz to 55.9 KHz. The key features this channel has is it's analog triangle wave output, and it's linear counter, which can be set to automatically disable the channel's sound after a certain period of time has gone by. The noise channel is used for producing random frequencys, which results in a "noisey" sounding output. Output frequencys can range anywhere from 29.3 Hz to 447 KHz. It's key feature is it's pseudo- random number generator, which generates the random output frequencys heard by the channel. ***************** * Frame counter * ***************** The 2A03 has an internal frame counter. The purpose of it is to generate the various low frequency signals (60, 120, 240 Hz, and 48, 96, 192 Hz) required to clock several of the sound hardware's counters. It also has the ability to generate IRQ's. The smallest unit of timing the frame counter operates around is 240Hz; all other frequencies are generated by multiples of this base frequency. A clock divider of 14915 (clocked at twice the CPU speed) is used to get 240Hz (this was the actual measured ratio). +---------------+ |$4017 operation| +---------------+ Writes to register $4017 control operation of both the clock divider, and the frame counter. - Any write to $4017 resets both the frame counter, and the clock divider. Sometimes, games will write to this register in order to synchronize the sound hardware's internal timing, to the sound routine's timing (usually tied into the NMI code). The frame IRQ is slightly longer than the PPU's, so you can see why games would desire this syncronization. - bit 7 of $4017 controls the frame counter's divide rate. Every time the counter cycles (reaches terminal count (0)), a frame IRQ will be generated, if enabled by clearing bit 6 of $4017. $4015.6 holds the status of the frame counter IRQ; it will be set if the frame counter is responsible for the interrupt. $4017.7 divider frame IRQ freq. ------- ------- --------------- 0 4 60 1 5 48 On 2A03 reset, both bits of $4017 (6 & 7) will be cleared, enabling frame IRQ's off the hop. The reason why the existence of frame IRQ's are generally unknown is because the 6502's maskable interrupt is disabled on reset, and this blocks out the frame IRQ's. Most games don't use any IRQ-generating hardware in general, therefore they don't bother enabling maskable interrupts. Note that the IRQ line will be held down by the frame counter until it is acknowledged (by reading $4015). Before this, the 6502 will generate an IRQ *every* time interrupts are enabled (either by CLI or RTI), since the IRQ design on the 6502 is level-triggered, and not edge. If you've written a program that does not read $4015 in the IRQ handler, and you execute CLI, the processor will immediately go into a infinite IRQ call-return loop. +-----------------------+ |Frame counter operation| +-----------------------+ Depending on the status of $4017.7, the frame counter will follow 2 different count sequences. These sequences determine when sound hardware counters will be clocked. The sequences are initialized immediately following any write to $4017. $4017.7 sequence ------- -------- 0 4, 0,1,2,3, 0,1,2,3,..., etc. 1 0,1,2,3,4, 0,1,2,3,4,..., etc. During count sequences 0..3, the linear (triangle) and envelope decay (square & noise) counters recieve a clock for each count. This means that both these counters are clocked once immediately after $4017.7 is written with a value of 1. Count sequences 1 & 3 clock (update) the frequency sweep (square), and length (all channels) counters. Even though the length counter's smallest unit of time counting is a frame, it seems that it is actually being clocked twice per frame. That said, you can consider the length counters to contain an extra stage to divide this clock signal by 2. No aforementioned sound hardware counters are clocked on count sequence #4. You should now see how this causes the 96, and 192 Hz signals to be generated when $4017.7=1. The rest of the document will describe the operation of the sound channels using the $4017.7=0 frequencies (60, 120, and 240 Hz). For $4017.7=1 operation, replace those frequencies with 48, 96, and 192 Hz (respectively). ************************ * Sound hardware delay * ************************ After resetting the 2A03, the first time any sound channel(s) length counter contains a non-zero value (channel is enabled), there will be a 2048 CPU clock cycle delay before any of the sound hardware is clocked. After the 2K clock cycles go by, the NES sound hardware will be clocked normally. This phenomenon only occurs prior to a system reset, and only occurs during the first 2048 CPU clocks after the activation of any of the 4 basic sound channels. The information in regards to this delay is only provided to keep this document accurate with all information that is currently known about the 2A03's sound hardware. I haven't done much tests on the behaviour of this delay (mainly because I don't care, as I view it as a inconvenience anyway), so this information should be taken with a grain of salt. ************************ * Register Assignments * ************************ The sound hardware internal to the 2A03 has been designated these special memory addresses in the CPU's memory map. $4000-$4003 Square wave 1 $4004-$4007 Square wave 2 (identical to the first, except for upward frequency sweeps (see "sweep unit" section)) $4008-$400B Triangle $400C-$400F Noise $4015 Channel enable / length/frame counter status $4017 frame counter control Note that $4015 (and $4017, but is unrelated to sound hardware) are the only R/W registers. All others are write only (attempt to read them will most likely return the last byte on the bus (usually 040H), due to heavy capacitance on the NES's data bus). Reading a "write only" register, will have no effect on the specific register, or channel. Every sound channel has 4 registers affiliated with it. The description of the register sets are as follows: +----------------+ | Register set 1 | +----------------+ $4000(sq1)/$4004(sq2)/$400C(noise) bits --------------------------------------- 0-3 volume / envelope decay rate 4 envelope decay disable 5 length counter clock disable / envelope decay looping enable 6-7 duty cycle type (unused on noise channel) $4008(tri) bits --------------- 0-6 linear counter load register 7 length counter clock disable / linear counter start +----------------+ | Register set 2 | +----------------+ $4001(sq1)/$4005(sq2) bits -------------------------- 0-2 right shift amount 3 decrease / increase (1/0) wavelength 4-6 sweep update rate 7 sweep enable $4009(tri)/$400D(noise) bits ---------------------------- 0-7 unused +----------------+ | Register set 3 | +----------------+ $4002(sq1)/$4006(sq2)/$400A(Tri) bits ------------------------------------- 0-7 8 LSB of wavelength $400E(noise) bits ----------------- 0-3 playback sample rate 4-6 unused 7 random number type generation +----------------+ | Register set 4 | +----------------+ $4003(sq1)/$4007(sq2)/$400B(tri)/$400F(noise) bits -------------------------------------------------- 0-2 3 MS bits of wavelength (unused on noise channel) 3-7 length counter load register +--------------------------------+ | length counter status register | +--------------------------------+ $4015(read) ----------- 0 square wave channel 1 1 square wave channel 2 2 triangle wave channel 3 noise channel 4 DMC (see "DMC.TXT" for details) 5-6 unused 7 IRQ status of DMC (see "DMC.TXT" for details) +-------------------------+ | channel enable register | +-------------------------+ $4015(write) ------------ 0 square wave channel 1 1 square wave channel 2 2 triangle wave channel 3 noise channel 4 DMC channel (see "DMC.TXT" for details) 5-7 unused ************************ * Channel architecture * ************************ This section will describe the internal components making up each individual channel. Each component will then be described in full detail. Device Triangle Noise Square ------ -------- ------ ------ triangle step generator X linear counter X programmable timer X X X length counter X X X 4-bit DAC X X X volume/envelope decay unit X X sweep unit X duty cycle generator X wavelength converter X random number generator X +-------------------------+ | Triangle step generator | +-------------------------+ This is a 5-bit, single direction counter, and it is only used in the triangle channel. Each of the 4 LSB outputs of the counter lead to one input on a corresponding mutually exclusive XNOR gate. The 4 XNOR gates have been strobed together, which results in the inverted representation of the 4 LSB of the counter appearing on the outputs of the gates when the strobe is 0, and a non-inverting action taking place when the strobe is 1. The strobe is naturally connected to the MSB of the counter, which effectively produces on the output of the XNOR gates a count sequence which reflects the scenario of a near- ideal triangle step generator (D,E,F,F,E,D,...,2,1,0,0,1,2,...). At this point, the outputs of the XNOR gates will be fed into the input of a 4-bit DAC. This 5-bit counter will be halted whenever the Triangle channel's length or linear counter contains a count of 0. This results in a "latching" behaviour; the counter will NOT be reset to any definite state. On system reset, this counter is loaded with 0. The counter's clock input is connected directly to the terminal count output pin of the 11-bit programmable timer in the triangle channel. As a result of the 5-bit triangle step generator, the output triangle wave frequency will be 32 times less than the frequency of the triangle channel's programmable timer is set to generate. +----------------+ | Linear counter | +----------------+ The linear counter is only found in the triangle channel. It is a 7-bit presettable down counter, with a decoded output condition of 0 available (not exactly the same as terminal count). Here's the bit assignments: $4008 bits ---------- 0-6 bits 0-6 of the linear counter load register (NOT the linear counter itself) 7 linear counter start The counter is clocked at 240 Hz (1/4 framerate), and the calculated length in frames is 0.25*N, where N is the 7-bit loaded value. The counter is always being clocked, except when 0 appears on the output of the counter. At this point, the linear counter & triangle step counter clocks signals are disabled, which results in both counters latching their current state (the linear counter will stay at 0, and the triangle step counter will stop, and the channel will be silenced due to this). The linear counter has 2 modes: load, and count. When the linear counter is in load mode, it essentially becomes transparent (i.e. whatever value is currently in, or being written to $4008, will appear on the output of the counter). Because of this, no count action can occur in load mode. When the mode changes from load to count, the counter will now latch the value currently in it, and start counting down from there. In the count mode, the current value of $4008 is ignored by the counter (but still retained in $4008). Described below is how the mode of the linear counter is set: Writes to $400B --------------- cur mode --- ---- 1 load 0 load (on next linear counter clock), count Cur is the current state of the MSB of $4008. Writes to $4008 --------------- old new mode --- --- ---- 0 X count 1 0 no change (during the CPU write cycle), count 1 1 no change Old and new represent the state(s) of the MSB of $4008. Old is the value being replaced in the MSB of $4008 on the write, and new is the value replacing the old one. "no change" indicates that the mode of the linear counter will not change from the last. Note that writes to $400B when $4008.7=0 only loads the linear counter with the value in $4008 on the next *linear* counter clock (and NOT at the end of the CPU write cycle). This is a correction from older versions of this doc. +--------------------+ | Programmable timer | +--------------------+ The programmable timer is a 11-bit presettable down counter, and is found in the square, triangle, and noise channel(s). The bit assignments are as follows: $4002(sq1)/$4006(sq2)/$400A(Tri) bits ------------------------------------- 0-7 represent bits 0-7 of the 11-bit wavelength $4003(sq1)/$4007(sq2)/$400B(Tri) bits ------------------------------------- 0-2 represent bits 8-A of the 11-bit wavelength Note that on the noise channel, the 11 bits are not available directly. See the wavelength converter section, for more details. The counter has automatic syncronous reloading upon terminal count (count=0), therefore the counter will count for N+1 (N is the 11-bit loaded value) clock cycles before arriving at terminal count, and reloading. This counter will typically be clocked at the 2A03's internal 6502 speed (1.79 MHz), and produces an output frequency of 1.79 MHz/(N+1). The terminal count's output spike length is typically no longer than half a CPU clock. The TC signal will then be fed to the appropriate device for the particular sound channel (for square, this terminal count spike will lead to the duty cycle generator. For the triangle, the spike will be fed to the triangle step generator. For noise, this signal will go to the random number generator unit). +----------------+ | Length counter | +----------------+ The length counter is found in all sound channels. It is essentially a 7-bit down counter, and is conditionally clocked at a frequency of 60 Hz. When the length counter arrives at a count of 0, the counter will be stopped (stay on 0), and the appropriate channel will be silenced. The length counter clock disable bit, found in all the channels, can also be used to halt the count sequence of the length counter for the appropriate channel, by writing a 1 out to it. A 0 condition will permit counting (unless of course, the counter's current count = 0). Location(s) of the length counter clock disable bit: $4000(sq1)/$4004(sq2)/$400C(noise) bits --------------------------------------- 5 length counter clock disable $4008(tri) bits --------------- 7 length counter clock disable To load the length counter with a specified count, a write must be made out to the length register. Location(s) of the length register: $4003(sq1)/$4007(sq2)/$400B(tri)/$400F(noise) bits -------------------------------------------------- 3-7 length The 5-bit length value written, determines what 7-bit value the length counter will start counting from. A conversion table here will show how the values are translated. +-----------------------+ | bit3=0 | +-------+---------------+ | |frames | |bits +-------+-------+ |4-6 |bit7=0 |bit7=1 | +-------+-------+-------+ |0 |05 |06 | |1 |0A |0C | |2 |14 |18 | |3 |28 |30 | |4 |50 |60 | |5 |1E |24 | |6 |07 |08 | |7 |0D |10 | +-------+-------+-------+ +---------------+ | bit3=1 | +-------+-------+ |bits | | |4-7 |frames | +-------+-------+ |0 |7F | |1 |01 | |2 |02 | |3 |03 | |4 |04 | |5 |05 | |6 |06 | |7 |07 | |8 |08 | |9 |09 | |A |0A | |B |0B | |C |0C | |D |0D | |E |0E | |F |0F | +-------+-------+ The length counter's real-time status for each channel can be attained. A 0 is returned for a zero count status in the length counter (channel's sound is disabled), and 1 for a non-zero status. Here's the bit description of the length counter status register: $4015(read) ----------- 0 length counter status of square wave channel 1 1 length counter status of square wave channel 2 2 length counter status of triangle wave channel 3 length counter status of noise channel 4 length counter status of DMC (see "DMC.TXT" for details) 5 unknown 6 frame IRQ status 7 IRQ status of DMC (see "DMC.TXT" for details) Writing a 0 to the channel enable register will force the length counters to always contain a count equal to 0, which renders that specific channel disabled (as if it doesn't exist). Writing a 1 to the channel enable register disables the forced length counter value of 0, but will not change the count itself (it will still be whatever it was prior to the writing of 1). Bit description of the channel enable register: $4015(write) ------------ 0 enable square wave channel 1 1 enable square wave channel 2 2 enable triangle wave channel 3 enable noise channel 4 enable DMC channel (see "DMC.TXT" for details) 5-7 unknown Note that all 5 used bits in this register will be set to 0 upon system reset. +-----------+ | 4-bit DAC | +-----------+ This is just a standard 4-bit DAC with 16 steps of output voltage resolution, and is used by all 4 sound channels. On the 2A03, square wave 1 & 2 are mixed together, and are available via pin 1. Triangle & noise are available on pin 2. These analog outputs require a negative current source, to attain linear symmetry on the various output voltage levels generated by the channel(s) (moreover, to get the sound to be audible). Instead of current sources, the NES uses external 100 ohm pull-down resistors. This results in the output waveforms having some linear asymmetry (i.e., as the desired output voltage increases on a linear scale, the actual outputted voltage increases less and less each step). The side effect of this is that the DMC's 7-bit DAC port ($4011) is able to indirectly control the volume (somewhat) of both triangle & noise channels. While I have not measured the voltage asymmetery, others on the NESdev messageboards have posted their findings. The conclusion is that when $4011 is 0, triangle & noise volume outputs are at maximum. When $4011 = 7F, the triangle & noise channel outputs operate at only 57% total volume. The odd thing is that a few games actually take advantage of this "volume" feature, and write values to $4011 in order to regulate the amplitude of the triangle wave channel's output. +------------------------------+ | Volume / envelope decay unit | +------------------------------+ The volume / envelope decay hardware is found only in the square wave and noise channels. $4000(sq1)/$4004(sq2)/$400C(noise) ---------------------------------- 0-3 volume / envelope decay rate 4 envelope decay disable 5 envelope decay looping enable When the envelope decay disable bit (bit 4) is set (1), the current volume value (bits 0-3) is sent directly to the channel's DAC. However, depending on certain conditions, this 4-bit volume value will be ignored, and a value of 0 will be sent to the DAC instead. This means that while the channel is enabled (producing sound), the output of the channel (what you'll hear from the DAC) will either be the 4-bit volume value, or 0. This also means that a 4-bit volume value of 0 will result in no audible sound. These conditions are as follows: - When hardware in the channel wants to disable it's sound output (like the length counter, or sweep unit (square channels only)). - On the negative portion of the output frequency signal coming from the duty cycle / random number generator hardware (square wave channel / noise channel). When the envelope decay disable bit is cleared, bits 0-3 now control the envelope decay rate, and an internal 4-bit down counter (hereon the envelope decay counter) now controls the channel's volume level. "Envelope decay" is used to describe the action of the channel's audio output volume starting from a certain value, and decreasing by 1 at a fixed (linear) rate (which produces a "fade-out" sounding effect). This fixed decrement rate is controlled by the envelope decay rate (bits 0-3). The calculated decrement rate is 240Hz/(N+1), where N is any value between $0-$F. When the channel's envelope decay counter reaches a value of 0, depending on the status of the envelope decay looping enable bit (bit 5, which is shared with the length counter's clock disable bit), 2 different things will happen: bit 5 action ----- ------ 0 The envelope decay count will stay at 0 (channel silenced). 1 The envelope decay count will wrap-around to $F (upon the next clock cycle). The envelope decay counter will then continue to count down normally. Only a write out to $4003/$4007/$400F will reset the current envelope decay counter to a known state (to $F, the maximum volume level) for the appropriate channel's envelope decay hardware. Otherwise, the envelope decay counter is always counting down (by 1) at the frequency currently contained in the volume / envelope decay rate bits (even when envelope decays are disabled (setting bit 4)), except when the envelope decay counter contains a value of 0, and envelope decay looping (bit 5) is disabled (0). +------------+ | Sweep unit | +------------+ The sweep unit is only found in the square wave channels. The controls for the sweep unit have been mapped in at $4001 for square 1, and $4005 for square 2. The controls ------------ Bit 7 when this bit is set (1), sweeping is active. This results in real-time increasing or decreasing of the the current wavelength value (the audible frequency will decrease or increase, respectively). The wavelength value in $4002/3 ($4006/7) is constantly read & updated by the sweep. Modifying the contents of $4002/3 will be immediately audible, and will result in the sweep now starting from this new wavelength value. Bits 6-4 These 3 bits represent the sweep refresh rate, or the frequency at which $4002/3 is updated with the new calculated wavelength. The refresh rate frequency is 120Hz/(N+1), where N is the value written, between 0 and 7. Bit 3 This bit controls the sweep mode. When this bit is set (1), sweeps will decrease the current wavelength value, as a 0 will increase the current wavelength. Bits 2-0 These bits control the right shift amount of the new calculated sweep update wavelength. Code that shows how the sweep unit calculates a new sweep wavelength is as follows: bit 3 ----- 0 New = Wavelength + (Wavelength >> N) 1 New = Wavelength - (Wavelength >> N) (minus an additional 1, if using square wave channel 1) where N is the the shift right value, between 0-7. Note that in decrease mode, for subtracting the 2 values: 1's compliment (NOT) is being used for square wave channel 1 2's compliment (NEG) is being used for square wave channel 2 This information is currently the only known difference between the 2 square wave channels. On each sweep refresh clock, the Wavelength register will be updated with the New value, but only if all 3 of these conditions are met: - bit 7 is set (sweeping enabled) - the shift value (which is N in the formula) does not equal to 0 - the channel's length counter contains a non-zero value Notes ----- There are certain conditions that will cause the sweep unit to silence the channel, and halt the sweep refresh clock (which effectively stops sweep action, if any). Note that these conditions pertain regardless of any sweep refresh rate values, or if sweeping is enabled/disabled (via bit 7). - an 11-bit wavelength value less than $008 will cause this condition - if the sweep unit is currently set to increase mode, the New calculated wavelength value will always be tested to see if a carry (bit $B) was generated or not (if sweeping is enabled, this carry will be examined before the Wavelength register is updated) from the shift addition calculation. If carry equals 1, the channel is silenced, and sweep action is halted. +----------------------+ | Duty cycle generator | +----------------------+ The duty cycle generator takes the fequency produced from the 11-bit programmable timer, and uses a 4 bit counter to produce 4 types of duty cycles. The output frequency is then 1/16 that of the programmable timer. The duty cycle hardware is only found in the square wave channels. The bit assignments are as follows: $4000(sq1)/$4004(sq2) --------------------- 6-7 Duty cycle type duty (positive/negative) val in clock cycles --- --------------- 00 2/14 01 4/12 10 8/ 8 11 12/ 4 Where val represents bits 6-7 of $4000/$4004. This counter is reset when the length counter of the same channel is written to (via $4003/$4007). The output frequency at this point will now be fed to the volume/envelope decay hardware. +----------------------+ | Wavelength converter | +----------------------+ The wavelength converter is only used in the noise channel. It is used to convert a given 4-bit value to an 11-bit wavelength, which then is sent to the noise's own programmable timer. Here is the bit descriptions: $400E bits ---------- 0-3 The 4-bit value to be converted Below is a conversion chart that shows what 4-bit value will represent the 11-bit wavelength to be fed to the channel's programmable timer: value octave scale CPU clock cycles (11-bit wavelength+1) ----- ------ ----- -------------------------------------- 0 15 A 002 1 14 A 004 2 13 A 008 3 12 A 010 4 11 A 020 5 11 D 030 6 10 A 040 7 10 F 050 8 10 C 065 9 9 A 07F A 9 D 0BE B 8 A 0FE C 8 D 17D D 7 A 1FC E 6 A 3F9 F 5 A 7F2 Octave and scale information is provided for the music enthusiast programmer who is more familiar with notes than clock cycles. +-------------------------+ | Random number generator | +-------------------------+ The noise channel has a 1-bit pseudo-random number generator. It's based on a 15-bit shift register, and an exclusive or gate. The generator can produce two types of random number sequences: long, and short. The long sequence generates 32,767-bit long number patterns. The short sequence generates 93-bit long number patterns. The 93-bit mode will generally produce higher sounding playback frequencys on the channel. Here is the bit that controls the mode: $400E bits ---------- 7 mode If mode=0, then 32,767-bit long number sequences will be produced (32K mode), otherwise 93-bit long number sequences will be produced (93-bit mode). The following diagram shows where the XOR taps are taken off the shift register to produce the 1-bit pseudo-random number sequences for each mode. mode <----- ---- EDCBA9876543210 32K ** 93-bit * * The current result of the XOR will be transferred into bit position 0 of the SR, upon the next shift cycle. The 1-bit random number output is taken from pin E, is inverted, then is sent to the volume/envelope decay hardware for the noise channel. The shift register is shifted upon recieving 2 clock pulses from the programmable timer (the shift frequency will be half that of the frequency from the programmable timer (one octave lower)). On system reset, this shift register is loaded with a value of 1. RP2A03E quirk ------------- I have been informed that revisions of the 2A03 before "F" actually lacked support for the 93-bit looped noise playback mode. While the Famicom's 2A03 went through 4 revisions (E..H), I think that only one was ever used for the front loading NES: "G". Other differences between 2A03 revisions are unknown. EOFfceu-0.98.12/Documentation/tech/exp/0002755000175000000620000000000010041626223017040 5ustar joestaff00000000000000fceu-0.98.12/Documentation/tech/exp/mmc5-e.txt0000755000175000000620000001501407757447436020721 0ustar joestaff00000000000000========= mmc5 infomation ========== date 1998/05/31 by goroh translated May 31, 1998 by Sgt. Bowhack mail goroh_kun@geocities.co.jp 5000,5004 ch1,ch2 Pulse Control bit CCwevvvv CC Duty Cycle (Positive vs. Negative) #0:87.5% #1:75.0% #2:50.0% #3:25.0% w Waveform Hold (e.g. Looping) 0: Off 1: On e Envelope Select 0: Varied 1: Fixed < e=0 > vvvv Playback Rate #0<-fast<--->-slow--> #15 < e=1 > vvvv Output Volume 5002,5006 ch1,ch2 frequency L bit ffffffff 5003,5007 ch1,ch2 frequency H bit tttttfff ttttt sound occurence time Objective is to remove the continuous changing of frequency for square wave setup and do the same to the main part of the square wave of studying the main part of the famicom. (?- Sgt. Bowhack) 5010 ch3 synthetic voice business channel bit -------O O wave output 0:Off 1:On 5011 ch4 synthetic voice business channel 2 bit vvvvvvvv vvvvvvvv wave size 5015 sound output channel bit ------BA A: ch1 output 1:enable 0:disable B: ch2 output 1:enable 0:disable 5100 PRG-page size Setting bit ------SS SS PRG-page size 0: 32k 1:16k 2,3:8k * Reset is misled the first times for about 8k (?- SB) 5101 CHR-page size Setting bit ------SS SS CHR-page size 0:8k 1:4k 2:2k 3:1k 5102 W BBR-RAM Write Protect 1 bit ------AA 5103 W BBR-RAM Write Protect 2 bit ------BB (AA,BB) = (2,1) permitted to write to BBR-RAM only when crowded *Reset write around becomes prohibited when crowded 5104 Grafix Mode Setting $5c00-$5fff decides how it should be used bit ------MM #00:Enable only Split Mode #01:Enable Split Mode & ExGrafix Mode #02:ExRAM Mode #03:ExRAM Mode & Write Protect Consideration MMC5 has 2 graphic mode extensions that allow more than 256 characters on one standard game screen. It uses Split Mode so it can display the specified CHR-page and scroll position seperate from ExGrafix Mode to be able to choose a palette, and the other divides it vertically. 5105 W NameTable Setting bit ddccbbaa aa: Select VRAM at 0x2000-0x23ff bb: Select VRAM at 0x2400-0x27ff cc: Select VRAM at 0x2800-0x2bff dd: Select VRAM at 0x2c00-0x2fff #0:use VRAM 0x000-0x3ff #1:use VRAM 0x400-0x7ff #2:use ExVRAM 0x000-0x3ff #3:use ExNameTable(Fill Mode) Consideration The name table can designate 4 kinds of this resister and be a useful special quality for this because painting and smashing it with a character that there is 1 sheet for the remaining sheets can generally be used. (?-SB) 5106 W Fill Mode Setting 1 bit vvvvvvvv Fill chr-table For whether it paints or smashes it at any non-designated character 5107 W Fill Mode Setting 2 bit ------pp Whether or not it uses any non-designated palettes 5113 RAM-page for $6000-$7FFF bit -----p-- 5114-5117 Program Bank switch < page_size=32k > $5117 [8]-[F] bit pppppp-- < page_size=16k > $5115 [8]-[B] bit ppppppp- $5117 [C]-[F] bit ppppppp- < page_size=8k > $5114 [8][9] bit pppppppp $5115 [A][B] bit pppppppp $5116 [C][D] bit pppppppp $5117* [E][F] bit pppppppp *Reset is around early, Last Page misled 5120-512b Charactor Bank switch < page_size=8k > $5120-$5127 switch to mode A $5128-$512b switch to mode B $5127 [0]-[7] modeA $512b [0]-[7] modeB < page_size=4k > $5120-$5127 switch to mode A $5128-$512b switch to mode B $5123 [0]-[3] modeA $5127 [4]-[7] modeA $512b [0]-[3],[4]-[7] modeB < page_size=2k > $5120-$5127 switch to mode A $5128-$512b switch to mode B $5121 [0]-[1] modeA $5123 [2]-[3] modeA $5125 [4]-[5] modeA $5127 [6]-[7] modeA $5129 [0]-[1],[4]-[5] modeB $512b [2]-[3],[6]-[7] modeB < page_size=1k > $5120-$5127 switch to mode A $5128-$512b switch to mode B $5120 [0] modeA $5121 [1] modeA $5122 [2] modeA $5123 [3] modeA $5124 [4] modeA $5125 [5] modeA $5126 [6] modeA $5127 [7] modeA $5128 [0],[4] modeB $5129 [1],[5] modeB $512a [2],[6] modeB $512b [3],[7] modeB Consideration MMC5 has mode A ,mode B and 2 kinds of CHR-page memory resistors. They can be used for refreshing it. (?-SB) 5130 ??? analyzing it... 5200 W Split Mode Control 1 bit Ec-vvvvv For the E function 0:don't use 1:use c boundary's side is for using Split Mode extension of graphics 0: left side 1: right side vvvvv left boundary is designated with the char. # to count places Sample. 5200 <- #00 (not?) used yet 5200 <- #82 Used for SplitMode GFX extension from left 1-2 character 5200 <- #c2 Used for SplitMode GFX extension from the right side 3 chars. 5200 <- #c0 Used for SplitMode GFX extension on the whole screen 5200 <- #d0 Used for SplitMode GFX extension on the right side of the screen 5200 <- #90 Used for SplitMode GFX extension on the left side of the screen 5201 W SplitMode setup for SplitMode Ext. GFX use 1 $2005 determines the vertical movement; it can also delay ext. gfx's vert. movement if necessary. It's written 2 times in bulk in the same way as it would slip off a grade in $2005 (??-SB) 5202 W SplitMode setup for SplitMode Ext. GFX use 2 bit --pppppp uses vertical division of ext. gfx CHR-page designation index_size=4k(0x1000byte) In case it uses a character 0x4000-0x4fff for the ext. gfx in question $5202 <- 4 5203 W scanline break point For scanline # that it splits and wants to make it designate it in bulk 5204 WR IRQ enable/disable W bit I------- I 1:IRQ Enable 0:IRQ Disable R bit I------- I 1:Scanline Hit 0:Scanline not Hit $5203 is designated as scanline when arrived. 5205 WR mult input/output 5206 WR mult input/output ($5205in)*($5206in) = $5205,$5206out 5c00-5fbf ext. gfx business VRAM shows an attribute of every position character bit PPpppppp PP: use character palette number pppppp: use background CHR-PAGE number index=4k #0-#3F are designations, $0000-$3FFF is CHR-data's range Use for extension gfx SplitMode uses a Name Table for extension gfx use. bit pppppppp pppppppp: use for background char. number designation Used for Extension RAM 5fc0-5fff (not?) used yet SplitMode uses gfx's Attribute Table extension. PPU uses $23c0-$23ff in the same way as the Attribute Table Used for Extension RAM Consideration 5c00-5fff has 3 uses. Split Mode and ExGrafix Mode's VBlank is written so as to become crowded, it writes a 0 and becomes crowded. Every mode tries to go around ExRAM mode including reading but it writes it, is effective in bulk and #5c-#5f is the output at times where it is effective.fceu-0.98.12/Documentation/tech/exp/mmc5_bank_switch.txt0000755000175000000620000000762407757447436023063 0ustar joestaff00000000000000MMC5 Bankswitching by Kevin Horton -------------------- 5100: Controls paging of RAM and ROM Bits: ???? ??xx For xx: 00: 32K bankswitching. Only 5117 can be used to control banks. 5114 thru 5116 have no effect. 01: 16K bankswitching. Only 5115 and 5117 can be used to control banks. 5114 and 5116 have no effect. 10: 8K/16K bankswitching. 5115-5117 are used. 5114 has no effect. 11: 8K bankswitching. 5114-5117 are used. (See below for detailed description) -- 5113: RAM page 6000-7FFF bank. Lower 3 bits are used, for a possible 64K of WRAM. (Note more bits *may* be possible for more RAM. This has not been confirmed yet). Bits: ???? ?xxx WRAM follows a certain convention, based on the style of MMC5 board used. 8K and 32K carts are usually implemented with a single chip, while 16K carts use two 8K'ers. This is important since enabling changes, and hence valid banks. for xxx: 8K 16K 32K 40K 64K 0: bank 0 bank 0 bank 0 bank 0 bank 0 1: bank 0 bank 0 bank 1 bank 1 bank 1 2: bank 0 bank 0 bank 2 bank 2 bank 2 3: bank 0 bank 0 bank 3 bank 3 bank 3 4: open bus bank 1 open bus bank 4 bank 4 5: open bus bank 1 open bus bank 4 bank 5 6: open bus bank 1 open bus bank 4 bank 6 7: open bus bank 1 open bus bank 4 bank 7 Note that the 40K and 64K examples are hypothetical. The first three, however *are* real and is what you find inside a real MMC5 cart. Also note, that 5114-5116 follow this identical convention, if set up to switch in RAM banks. -- Bankswitching is a bit complicated. This table should make things clearer. The numbers at the top are what you write to 5100 to select mode. Legend: - = this has no effect --- = this register is not used, and writes to it are ignored R = PRG ROM/WRAM select. 0=WRAM, 1=PRG ROM b = bank bits 5100: 00 01 10 11 5114 --- --- --- Rbbb bbbb 5115 --- Rbbb bbb- Rbbb bbb- Rbbb bbbb 5116 --- --- Rbbb bbbb Rbbb bbbb 5117 -bbb bb-- -bbb bbb- -bbb bbbb -bbb bbbb Mode 00 ------- Only one 32K page can be selected. The lower 2 bits of the desired bank are ANDed out. writing 084h, 085h, 086h, and 087h to 5117 in this mode all result in selection of the same 32K. No RAM is available in this mode. Mode 01 ------- There are two selectable 16K pages. Similar to above, the lowest bit written is not used to select banks. In this mode, writing to 5115 selects 16K at 8000-BFFF, and 5117 selects 16K at C000-FFFF. RAM can be enabled in this mode for 8000-BFFF. If RAM is enabled for 8000-BFFF, remember that the lowest bank select bit is not used. Mode 10 ------- This is the oddest one. There is one 16K selectable page, and two 8K selectable pages. 5115 selects the 16K page at 8000-BFFF, 5116 selects an 8K page at C000-DFFF, and 5117 selects an 8K page at E000-FFFF. RAM can be enabled for 8000-DFFF. (16K of RAM at 8000-BFFF via bit 7 of D115, and 8K of RAM at C000-DFFF via bit 7 of d116). Note that RAM banking works the same as mode 01, above for the 16K bank. Mode 11 ------- There are 4 8K selectable pages. 5114 controls 8000-9FFF, etc. all the way up to 5117 that controls E000-FFFF. The first 3 pages can use RAM, while the last page cannot. -- WRAM write enable. 5102, 5103 To enable writing to RAM, 5102 must have 02h written to it, and 5103 must have 01h written to it. If this is not the case, you can still *read* the RAM, but writes to it have no effect. Supposidly only the lower two bits of 5102 and 5103 are checked, but I didn't verify this. I *did* however verify that setting the two registers to the above values allows writing. If voltage goes out of tolerance (Read: you turn the power on/off) the RAM writing is disabled. (To prevent corruption of saved-games during power cycling) fceu-0.98.12/Documentation/tech/exp/tengen.txt0000644000175000000620000000053407757447436021114 0ustar joestaff00000000000000Unknown: Alien Syndrome 128KiB/128KiB Super Sprint MIMIC 1: Fantasy Zone 64KiB/64KiB Toobin' 128KiB/64KiB Vindicators 64KiB/32KiB RAMBO 1(board looks like it can take 256KiB PRG/256KiB CHR max): Klax 64KiB PRG/64KiB CHR Road Runner 64KiB PRG/128KiB CHR Rolling Thunder 128KiB PRG/128KiB CHR Skull and Crossbones 128KiB PRG/64KiB CHR fceu-0.98.12/Documentation/tech/exp/SMB2j.txt0000644000175000000620000000617307757447436020516 0ustar joestaff00000000000000 SMB2j Revision "A". Mapper #50 Info ----------------------------------- 12.09.2000 V2.00 Mapper info by The Mad Dumper --- This mapper has been assigned the number 50. (that's 50 decimal) Wow, another SMB2j cart! This one is alot different than the last one I worked on. It has a single 128K PRG ROM and VRAM. The other SMB2j had 64K PRG and 8K CHR. Not much more to say other than this has one very fucked up mapper circuit on it! --- The hardware: It consists of 6 TTL chips (74163, 74157, 74139, 7400, 7474, and a 4020), 1 8K RAM chip for the VRAM, and 1 128K 28 pin ROM. There is some "M^2L" logic on the board (Mickey-Mouse Logic). It is a 3 input OR gate made out of 3 diodes and a resistor. Also, they swapped D3 and D6, as well as A1 and A3. Why this was done, I have no idea. It sure mussed up my REing efforts! I desoldered and read the ROM out through the EPROM programmer as a check and was not happy to find the data seemingly corrupt! After converting the ROM image over via some QBasic, it matched up great. You do not have to swap the addresses or data bytes; I have done this already in the released .NES ROM. --- There are two registers on this cartridge. They are located in the 4000h- 5FFFh block. Funny addresses are decoded for the register selection; presumably so they did not interfere with the FDS or NES registers. A15 ... A0 ------------------- 010x xxxQ x01x xxxx x = Don't Care 0 = must be 0 1 = must be 1 Q = register selection bit. 0 = ROM Page; 1 = IRQ Timer Enable - ROM Page Register: ------------------ Accessed when the address lines are in the above state. An example address would be 4020h. 4021h, 4022h, ... 403Fh, 40A0h, 40A1h, ... are all mirrors of this register. Writing here stores the desired bank #. 7 bit 0 --------- xxxx DCBA These 4 bits are shown below in the ROM memory map. Note that they are somewhat "scrambled". The value of this register is unknown at powerup. - IRQ Timer. 7 bit 0 --------- xxxx xxxI The IRQ Timer register controls the state of the IRQ timer. Writing here will turn it on or off. Turning the IRQ timer off resets it to 0. Writing a 1 here will turn the timer on, while writing a 0 will turn it off. The timer is composed of a binary ripple counter. After 4096 M2 cycles, /IRQ is pulled low. This is about 36 scanlines. The idea behind the timer is to split the screen for the score bar at the top. You start it at the beginning of the VBI routine, and then after 36 scanlines, it sends the IRQ which clears the timer, and resets the scroll registers. The value of this register is unknown at powerup. --- ROM Memory Map: Address Range | Bank bits: 3210 ------------------------------- 6000h-7FFFh 1111 8000h-9FFFh 1000 A000h-BFFFh 1001 C000h-DFFFh DACB -- Selectable page E000h-FFFFh 1011 The ROM is composed of 16 8K banks. The 4 bank bits are shown above. Bit 3 is the MSB while bit 0 is the LSB. 6000h-7FFFh is set to 1111b, or bank 0fh. All banks are FIXED except the bank at C000h-DFFFh. Only it can be changed. fceu-0.98.12/Documentation/tech/exp/vrcvi.txt0000644000175000000620000003167107757447436020773 0ustar joestaff00000000000000 VRCVI CHIP INFO ----- ---- ---- By: Kevin Horton khorton@iquest.net The RENES Project: Reverse-engineering the world. V1.01 08/31/99 teeny fix V1.00 08/31/99 Complete Version VRCVI (VRC6) (48 pin standard 600mil wide DIP) ------------ This chip is used in such games as Konami's CV3j and Madara. It's unique because it has some extra sound channels on it that get piped through the Famicom (note this is a fami-only chip and you will not find one in any NES game). "VI" of "VRCVI" is "6" for the roman numeral challenged. This chip generates its audio via a 6 bit R2R ladder. This is contained inside a 9 pin resistor network like so: 3K 3K 3K 3K 3K 2K /------*-\/\/-*-\/\/-*-\/\/-*-\/\/-*-\/\/-*------*-\/\/-\ | | | | | | | | | \ \ \ \ \ \ \ | | / / / / / / / | | \ 6K \ 6K \ 6K \ 6K \ 6K \ 6K \ 6K | | / / / / / / / | | | | | | | | | | | O O O O O O O O O GND D0 D1 D2 D3 D4 D5 Aud In Aud Out Legend: ------- (s) means this pin connects to the System (r) this only connects to the ROM (w) this is a SRAM/WRAM connection only AUD : these pass to the resistor network CHR : these connect to the CHR ROM and/or fami's CHR pins PRG : these connect to the PRG ROM and/or fami's PRG pins WRAM : this hooks to the WRAM CIRAM : the RAM chip which is on the fami board .----\/----. GND - |01 48| - +5V AUD D1 - |02 47| - AUD D0 AUD D3 - |03 46| - AUD D2 AUD D5 - |04 45| - AUD D4 (s) PRG A12 - |05 44| - PRG A16 (r) (s) PRG A14 - |06 43| - PRG A13 (s) (s) M2 - |07 42| - PRG A17 (r) (r) PRG A14 - |08 41| - PRG A15 (r) *1 (s) PRG A1 - |09 40| - PRG A13 (r) *1 (s) PRG A0 - |10 39| - PRG D7 (s) (s) PRG D0 - |11 38| - PRG D6 (s) (s) PRG D1 - |12 37| - PRG D5 (s) (s) PRG D2 - |13 36| - PRG D4 (s) (r) PRG /CE - |14 35| - PRG D3 (s) (s) R/W - |15 34| - PRG /CE (s) *2 (w) WRAM /CE - |16 33| - /IRQ (s) (r) CHR /CE - |17 32| - CIRAM /CE (s) (s) CHR /RD - |18 31| - CHR A10 (s) (s) CHR /A13 - |19 30| - CHR A11 (s) (r) CHR A16 - |20 29| - CHR A12 (s) (r) CHR A15 - |21 28| - CHR A17 (r) (r) CHR A12 - |22 27| - CHR A14 (r) (r) CHR A11 - |23 26| - CHR A13 (r) GND - |24 25| - CHR A10 (r) | | `----------' VRCVI *1: On some VRCVI carts, these are reversed. This affects some registers. *2: This passes through a small pulse shaping network consisting of a resistor, diode, and cap. Registers: (sound related only) ---------- regs 9000-9002 are for pulse channel #1 regs a000-a002 are for pulse channel #2 regs b000-b002 are for the phase accumulator channel (sawtooth) (bits listed 7 through 0) 9000h: GDDDVVVV D - Duty Cycle bits: 000 - 1/16th ( 6.25%) 001 - 2/16ths (12.50%) 010 - 3/16ths (18.75%) 011 - 4/16ths (25.00%) 100 - 5/16ths (31.25%) 101 - 6/16ths (37.50%) 110 - 7/16ths (43.75%) 111 - 8/16ths (50.00%) V - Volume bits. 0000b is silence, 1111b is loudest. Volume is linear. When in "normal" mode (see G bit), this acts as a general volume control register. When in "digitized" mode, these act as a 4 bit sample input. G - Gate bit. 0=normal operation, 1=digitized. In digi operation, registers 9001h and 9002h are totally disabled. Only bits 0-3 of 9000h are used. Whatever binary word is present here is passed on as a 4 bit digitized output. 9002h: FFFFFFFF F - Lower 8 bits of frequency data 9003h: X---FFFF X - Channel disable. 0=channel disabled, 1=channel enabled. F - Upper 4 bits of frequency data A000h-A002h are identical in operation to 9000h-9002h. One note: this chip will mix both digitized outputs (if the G bits are both set) into one added output. (see in-depth chip operation below) B000h: --PPPPPP P - Phase accumulator input bits B001h: FFFFFFFF F - Lower 8 bits of frequency data B002h: X---FFFF X - Channel disable. 0=channel disabled, 1=channel enabled. F - Upper 4 bits of frequency data How the sounds are formed: -------------------------- This chip is pretty cool. It outputs a 6 bit binary word for the sound which is passed through a DAC and finally to the NES/Fami. Because of this, the sound can be emulated *very* close to the original. I used my scope to figure all this out as well as my meter and logic probe so it should be 100% accurate. Block diagrams of the VRCVI: (as reverse engineered by me) ---------------------------- | F bits | | D bits| | V bits | | (12) | | (3) | | (4) | \___________/ \_______/ \________/ +-----+ +----------------+ +-----------+ +------------+ | | | | | | | |--\ | OSC |-->|Divider (12 bit)|-->| Duty Cycle|-->| AND array |(4)> chan out |(M2) | | | | Generator | | |--/ +-----+ +----------------+ +-----------+ +------------+ ^ ^ | | | | G X One Pulse channel (both are identical) -------------------------------------- How it works: The oscillator (in the NES, the clock arrives on the M2 line and is about 1.78Mhz) generates our starting frequency. This is passed first into a divide by 1 to 4096 divider to generate a base frequency. This is then passed to the duty cycle generator. The duty cycle generator generates the desired duty cycle for the output waveform. The "D" input controls the duty cycle generator's duty cycle. If the "G" bit is a "1", it forces the output of the duty cycle generator to a "1" also. If the "X" bit is "0", it forces the output of the duty cycle generator to "0", which effectively disables the channel. Note that this input has precidence over the "G" bit. The AND array is just that- an array of 4 AND gates. If the output of the duty cycle generator is a "0", then the "chan out" outputs will all be forced to "0". If the output of the duty cycle generator is a "1", then the chan out outputs will follow the V bit inputs. Note that the output of this generator is a 4 bit binary word. --- | F bits | | P bits| | (12) | | (6) | \___________/ \_______/ +-----+ +----------------+ +-----------+ | | | | | |--\ | OSC |-->|Divider (12 bit)|-->| Phase |(5)> chan out |(M2) | | | |Accumulator|--/ +-----+ +----------------+ +-----------+ ^ | | X The Sawtooth (ramp) channel --------------------------- This one is pretty similar to the above when it comes to frequency selection. The output frequency will be the same relative to the square wave channels. OK, the tough part will be explaining the phase accumulator. :-) What it is is just an adder tied to a latch. Every clock it adds a constant to the latch. In the case of the VRCVI, what you do is this: The ramp is generated over the course of 7 evenly spaced cycles, generated from the divider. Every clock from the divider causes the phase accumulator to add once. So... let's say we have 03h in the P bits. Every 7 cycles the phase accumulator (which is 8 bits) is reset to 00h. cycle: accumulator: chan out: notes: ----------------------------------------- 0 00h 00h On the first cycle, the acc. is reset to 0 1 03h 00h We add 3 to 0 to get 3 2 06h 00h We add 3 to 3 to get 6 3 09h 01h 4 0ch 01h 5 0fh 01h 6 12h 02h 7 00h 00h Reset the acc. back to 0 and do it again This will look like so: (as viewed on an oscilloscope) - - - 2 --- --- --- 1 --- --- --- 0 | 012345601234560123456-+ Note: if you enter a value that is too large (i.e. 30h) the accumulator *WILL WRAP*. Yes, this doesn't sound very good at all and you no longer have a sawtooth. ;-) The upper 5 bits of said accumulator are run to the "chan out" outputs. The lower 3 bits are not run anywhere. "X" disables the phase accumulator and forces all outputs to "0". Note that the output of this generator is a 5 bit word. --- Now that the actual sound generation is out of the way, here's how the channels are combined into the final 6 bit binary output: +---------+ | Pulse | |Generator| | #1 | Final 6 Bit +---------+ Output | (4) | / \ \ / | (6) | +---------+ +---------+ +---------+ | 4 Bit |--\ | 5 Bit | /--|Sawtooth | | Binary |(5)>| Binary |<(5)|Generator| | Adder |--/ | Adder | \--| | +---------+ +---------+ +---------+ / \ | (4) | +---------+ | Pulse | |Generator| | #2 | +---------+ Channel Combining ----------------- The three channels are finally added together through a series of adders to produce the final output word. The two pulse chans are most likely added first since they are 4 bit words, and that 5 bit result is most likely added to the sawtooth's output. (The actual adding order is not known, but I can make a *very* good guess. The above illustrated way uses the least amount of transistors). In the end it does not matter the order in which the words are added; the final word will always be the same. The final 6 bit output word is run through an "R2R" resistor ladder which turns the digital bits into a 64 level analog representation. The ladder is binarally weighted and works like the DAC on your soundcard. :-) (so take heart emulator authours: just run the finished 6 bit word to your soundcard and it will sound right ;-). Frequency Generation: --------------------- The chip generates all its output frequencies based on M2, which is colourburst divided by two (1789772.7272Hz). This signal is passed directly into the programmable dividers (the 12 bit frequency regs). Squares: -------- These take the output of the programmable divider and then run it through the duty cycle generator, which in the process of generating the duty cycle, divides the frequency by 16. To calculate output frequency: 1789772.7272 Fout = ---------------- (freq_in+1) * 16 This will tell you the exact frequency in Hz. (note that the * 16 is to compensate for the divide by 16 duty cycle generator.) Saw: ---- This is similar to the above, however the duty cycle generator is replaced with a phase accumulator which divides the output frequency by 14. To calculate output frequency: 1789772.7272 Fout = ---------------- (freq_in+1) * 14 This will tell you the exact frequency in Hz. (note that the * 14 is to compensate for the phase accumulator.) So how accurate is this info, anyways? -------------------------------------- I believe the info to be 100% accurate. I have extensively tested the output of the actual VRCVI chip to this spec and everything fits perfectly. I did this by using a register dump and a QBASIC program I wrote which takes the register dump and produces a WAV file. All frequency and duty cycle measurements were taken with a Fluke 83 multimeter, and all waveform data was culled from my oscilloscope measuring the real chip. ---EOF--- fceu-0.98.12/Documentation/tech/exp/vrcvii.txt0000644000175000000620000002342207757447436021137 0ustar joestaff00000000000000 VRCVII CHIP INFO ------ ---- ---- By: Kevin Horton khorton@iquest.net The RENES Project: Reverse-engineering the world. V0.10 11/05/99 Document started, pinned out chip and audio thingy V0.20 11/10/99 Added very, very, very preliminary register findings v1.00 11/14/99 First release version of this doc VRCVII (VRC7) (48 pin standard 600mil wide DIP) ------------- This chip is used in only one Konami game that I know of- Lagrange Point. I heard rumours it was used in another game, so if someone could provide info and/or a ROM image, that would help immensely. It handles ROM bankswitching as well as sound generation. The sound generation is done using FM synthesis, so the music sounds like "Adlib" OPL2 music. Due to extra sound, this is a Famicom-only chip like its cousin the VRCVI. (See the VRCVI doc for more info) "VII" of "VRCVII" is "7" for the roman numeral challenged. This chip appears to generate all of its audio internally, which is then fed to a small hybrid (aka "black blob") that does the audio interfacing to the Famicom proper. It is physically a small ceramic substrate with an 8 pin SMD chip on it (probably an op-amp), and what appears to be three 0805 sized SMD chip parts (capacitors most likely, since resistors can be formed on the substrate). The whole works is then coated with a black dipped epoxy coating, and the smooth side (opposite the parts) is then marked with an identifying part number and the pin 1 dot. Here's the pinout for it: Front Side (parts facing away) +-----------------+ 1- Audio in from Famicom | 054002 | 2- Audio out to Famicom |@ | 3,7 - Ground +-----------------+ 4-6 - NC | | | | | | | | | 8- Audio from VRCVII 1 2 3 4 5 6 7 8 9 9- +5V Legend: ------- (s) means this pin connects to the System (r) this only connects to the ROM (w) this is a SRAM/WRAM connection only PRG : these connect to the PRG ROM and/or fami's PRG pins WRAM : this hooks to the WRAM Note: There is a 3.58Mhz ceramic resonator connected to the "X1" and "X2" pins. it is the three-pin style with internal caps tied to the third pin which is grounded. Chip is physically marked: "VRV VII 053982" .----\/----. *1 (RAM&s) CHR /OE - |01 48| - NC *1 (RAM&s) CHR /CE - |02 47| - M2 (s) GND - |03 46| - /CE WRAM (w) (s) R/W - |04 45| - PRG /A15 (s) (aka /CE) (s) /IRQ - |05 44| - PRG ROM /CE (r) (s) CIRAM A11 - |06 43| - Audio Out (s) PD0 - |07 42| - +5V (s) PD1 - |08 41| - NC (s) PD2 - |09 40| - NC (s) PD3 - |10 39| - NC (s) PD4 - |11 38| - NC (s) PD5 - |12 37| - NC (s) PD6 - |13 36| - CHR RAM A12 (s) PD7 - |14 35| - CHR RAM A11 +5V - |15 34| - CHR RAM A10 (s) PRG A5 - |16 33| - CHR A12 (s) Crystal X2 - |17 32| - CHR A11 (s) Crystal X1 - |18 31| - CHR A10 (s) (s) PRG A4 - |19 30| - +5V (r) PRG ROM A13 - |20 29| - PRG A14 (s) (r) PRG ROM A14 - |21 28| - PRG A13 (s) (r) PRG ROM A15 - |22 27| - PRG A12 (s) (r) PRG ROM A16 - |23 26| - PRG ROM A18 (r) GND - |24 25| - PRG ROM A17 (r) | | `----------' VRCVII *1: these connect to both the CHR RAM's pins and the card edge. Note: the NC pins 37-41 most likely for CHR ROM bankswitching. Since this cart uses CHR RAM these obviously weren't used ;-) Registers: (sound related only) ---------- All sound registers are accessed through only two physical registers. 9010: ----- This is the index register. You write the desired register number here. 9030: ----- This is the data register. Data written here is stored in the register pointed to by the above index register. There are 6 channels, each containing three registers, and 8 custom instrument control registers. Sound Registers: ---------------- 00h - 07h : Custom instrument registers. See below for info. --- 10h - 15h : ffffffff f: Lower 8 bits of frequency --- 20h - 25h : ???tooof f: Upper bit of frequency o: Octave Select t: Channel trigger. ?: Dunno what these do yet (No audible effect) --- 30h - 35h : iiiivvvv i: Instrument number v: Volume Instrument numbers 01h-0fh are fixed and cannot be changed. Instrument number 00h is the "programmable" one. To program the custom instrument, you load registers 00h-07h with the desired parameters for it. All channels set to instrument 00h will then use this instrument. Note that you can only program one custom instrument at a time. How do the frequency registers work? ------------------------------------ To generate a tone, you must select an octave and a frequency value. The frequency values stay the same for say, the note "C", while the octave bits determine which octave "C" lies in. This makes your note lookup table quite small. o = 000 is octave 0 o = 001 is octave 1 . . . o = 111 is octave 7 49722*freqval F = ------------- 2^(19-octave) Where: F = output frequency in Hz freqval = frequency register value octave = desired octave (starting at 0) Custom Instrument Registers (00-07) ----------------------------------- Note: I will not provide too extensive documentation of the instrument registers since their functions are identical to those of the OPL2 chip, commonly found on Adlib/Soundblaster/compatible cards, and there is alot of information out on how to program these. I will use terminology similar to that found in said documents. My VRC7 "emulator" test program I wrote simply re-arranged and tweaked the register writes to correspond with the OPL2 registers. Here's a link to a good document about this chip: http://www.ccms.net/~aomit/oplx/ The tremolo depth is set to 4.3db and the vibrato depth is set to 14 cent (in reguards to OPL2 settings; to achieve this you would write 0C0h to OPL register 0BDh). All operator connections are fixed in FM mode. (Where Modulator modulates the Carrier). --- 00 (Modulator) - tvskmmmm 01 (Carrier) t: Tremolo Enable v: Vibrato Enable s: Sustain Enable k: KSR m: Multiplier --- 02 - kkoooooo k: Key Scale Level o: Output Level --- 03 - ---qweee -: Not used: Write 0's q: Carrier Waveform w: Modulator Waveform Note: There are only two waveforms available. Sine and rectified sine (only the positive cycle of the sine; negative cycle "chopped off".) e: Feedback Control --- 04 (Modulator) - aaaadddd 05 (Carrier) a: Attack d: Decay --- 06 (Modulator) - ssssrrrr 07 (Carrier) s: Sustain r: Release Register Settings for the 15 fixed instruments. ----------------------------------------------- *CAUTION*CAUTION*CAUTION*CAUTION*CAUTION*CAUTION*CAUTION*CAUTION*CAUTION* C C A These instruments are not 100% correct! There is no way to extract A U the register settings from the chip short of an electron microscope. U T I have "tuned" these instruments best I could, though I know a couple T I are not exactly right. Use them at your own perl! If someone wants I O to waste all day tuning a new set, please let me know what you get. O N N *CAUTION*CAUTION*CAUTION*CAUTION*CAUTION*CAUTION*CAUTION*CAUTION*CAUTION* Register -------- 00 01 02 03 04 05 06 07 ----------------------- 0 | -- -- -- -- -- -- -- -- 1 | 05 03 10 06 74 A1 13 F4 2 | 05 01 16 00 F9 A2 15 F5 3 | 01 41 11 00 A0 A0 83 95 4 | 01 41 17 00 60 F0 83 95 5 | 24 41 1F 00 50 B0 94 94 6 | 05 01 0B 04 65 A0 54 95 7 | 11 41 0E 04 70 C7 13 10 Instrument 8 | 02 44 16 06 E0 E0 31 35 ---------- 9 | 48 22 22 07 50 A1 A5 F4 A | 05 A1 18 00 A2 A2 F5 F5 B | 07 81 2B 05 A5 A5 03 03 C | 01 41 08 08 A0 A0 83 95 D | 21 61 12 00 93 92 74 75 E | 21 62 21 00 84 85 34 15 F | 21 62 0E 00 A1 A0 34 15 So how accurate is this info, anyways? -------------------------------------- I believe the info to be 100% accurate. The pinout was generated with the help of a multimeter and my Super-8 with both an NES cart and the Fami cart plugged in. (this allows me to measure between my known "control" board with the unknown "experimental" board to generate the connections). Register info was gleaned via writing test code and listening and capturing the resultant audio stream for analysis. ---EOF--- fceu-0.98.12/Documentation/tech/exp/taito.txt0000644000175000000620000000012007757447436020743 0ustar joestaff00000000000000Hmm. Old Mirroring: Akira -?? Don Doko Don New Mirroring: Don Doko Don 2 fceu-0.98.12/Documentation/tech/exp/namco.txt0000644000175000000620000000225607774426602020723 0ustar joestaff00000000000000"Namco 106" games: FM = Fancy mirroring AM = Alternate/hardwired mirroring Battle Fleet - 128 RAM Chibi Maruko Chan - Uki Uki Shopping - AM, No IRQ DDS 2 - 128 RAM, exp sound, 8KB WRAM Dokuganryuu Masamune - 128 RAM Dragon Ninja - FM, IRQ Dream Master - AM Erika to Satoru - 128 RAM, exp sound Family Circuit 91 - AM?, No IRQ, 8KB WRAM Famista '90 - NM, IRQ, 128 RAM Famista '91 - Game writes like NM and IRQ at init, but it doesn't seem to use either in the game. Probably for compatibility with the more featured chip. I'll go with: AM, No IRQ Famista '92 - AM, No IRQ Famista '93 - AM, No IRQ Famista '94 - AM, No IRQ Final Lap - 128 RAM, exp sound Heisei Tensai Bakabon - AM, No IRQ Hydlide 3 - 128 RAM Juvei Quest - FM, IRQ, 8KB WRAM Kaijuu Monogatari 128 RAM? Mappy Kids - 128 RAM, exp sound Mind Seeker - 128 RAM Namco Classic - FM, IRQ Namco Classic 2 - 128 RAM, exp sound Rolling Thunder - 128 RAM, exp sound Sangokushi - Chuugen no Hasha - FM, IRQ, 8KB WRAM(?) Sangokushi 2 - 128 RAM, exp sound Splatter House - FM, No IRQ Star Wars - FM, IRQ Top Striker - AM, No IRQ Wagyan Land 2 - AM, No IRQ Wagyan Land 3 - AM, No IRQ Youkai Douchuuki - 128 RAM, exp sound fceu-0.98.12/Documentation/tech/README.now0000644000175000000620000000054007757447436017756 0ustar joestaff00000000000000Many(possibly all) of these documents contain flaws or are incomplete, so don't pull out your hair if there are inconsistencies between the documents, what's in FCE Ultra, and what you observe. That's not to say that FCE Ultra doesn't have its share of (emulation) flaws, though... For many more NES-related documents, try http://nesdev.parodius.com fceu-0.98.12/Documentation/tech/README.sound0000644000175000000620000000017207757447436020304 0ustar joestaff00000000000000Sound information is in the "cpu" subdirectory, due to the intimate relationship between the sound circuitry and the cpu. fceu-0.98.12/Documentation/tech/UNIF_current.txt0000644000175000000620000002603607757447436021350 0ustar joestaff00000000000000**************************************************************************** UNIF file format specifications (Universal NES Image) file format Created by Tennessee Carmel-Veilleux (veilleux@ameth.org) REV 7b, November 28th, 2000 ***********THIS IS AN OPEN STANDARD. IT IS OPEN TO SUGGESTIONS************** Overview -------- The UNIF format is a portable, flexible REPLACEMENT of the NES standard (Designed by Marat Fayzullin). It is a chunked file format in the lines of the Amiga IFF (LBM), Microsoft RIFF (WAV) and Autodesk 3D studio mesh files (3DS). The goal of having a chunked definition is to provide flexibility and ease of implementation, as data is described in blocks with type IDs referring to them and header information to provide a selective data reading. The format uses symetric data conversion for numerical compatibility between the different platforms' byte ordering. The ordering used is the 6502 Byte order (Intel), so that no more bickering arrises from people who do not appreciate Network Byte Ordering (Motorola). *** The extension suggested for use with this format is .UNF (.UNIF under Operating systems which support longer extensions). *** Byte ordering ------------- Byte ordering used throughout the file for DWORDs and WORDs is 6502 Byte order. The 6502 byte order is LSB, least significant byte first (Little-endian): 3 2 1 0 <- Byte order for MSB (Network Byte order, m68k, PowerPC) 0 1 2 3 <- Byte order for LSB (80x86, 6502, Z80) Care must be taken to convert the WORDs and DWORDs if you are using a non-LSB platform (Mac, Amiga, some others). File format ----------- 00h-1Fh : Header 20h-EOF : Chunks I can not think of an easier format to describe :) Header ------ The 4-byte header contains the string "UNIF" , NON null-terminated, case as written. This is for identification purposes, a little like .NES' "NES^Z" It is followed by Revision number and reserved bytes. Format: 00h-03h: "UNIF" tag identifier 04h-07h: DWORD -> Revision number, currently 4 08h-1Fh: Reserved for future usage Sample structure: structure UNIF_header [ char identification[4]; /* MUST be "UNIF" */ dword revision; /* Revision number */ byte expansion[24]; ]; Chunks ------ Each chunks is composed of 3 distinct elements: 00h-03h: Chunk ID string 04h-07h: DWORD -> Block Length of Data 08h-?? : Data All the chunks are written sequentially in the file. If you do not understand a chunk by its ID, simply jump over it using the data length information. *** ALL THE CHUNKS ARE OPTIONAL *** That means that there are NO mandatory chunks, and you support only the ONES YOU WISH, passing over the others while you are interpreting the file. Sample structure: structure UNIF_chunk [ char chunk_ID[4]; /* Chunk identification string. Can also be considered a number. ASCII format */ dword length; /* Data length, in little-endian format */ ]; The different chunks: --------------------- ******************************************************************************* How chunks are described: ID field: Contains the 4-characters string identifier for the chunk Length: Length of the block. If it is "??", then the block may have variable data size depending on the cartridge. Revision: First revision in which the chunk appeared. If your reader supports a lower revision, you might be unable to read the chunk, simply pass over it. The Revision used by the cart is written in the header. The number represents the Revision Number of the most recent chunk contained in the file. Example : If you have 5 chunks of revision 1 and 2 chunks of revision 4 in the file, the Revision number in the header will be 4. Description: Complete description of the contents and encoding of the chunk ******************************************************************************* ID: [MAPR] Length: ?? (Suggested max: 32 chars) Revision: 1 Description: This is supplemental information about the mapper. DO NOT USE A MAPPER NUMBER HERE ! Rather use the BOARD NAME. There is already a list in progress describing each NES cart and the board it uses. The string is NULL-TERMINATED. examples: N,R,O,M,,0 -> This "No mapper" U,N,R,O,M,0 -> This is (LS161+LS32) NOTA: This mapper organization suggests that emulators must be rewritten to emulate the ACTUAL CARTRIDGE HARDWARE, and not solely a case of another mapper number. That means you have to make for UNROM: 1- Mapper handler (74LS161+74LS32) 2- CHR-RAM Handler Those components can be reused, since many boards only have a slight difference in them compared to similar ones. **IT SHOULD BE NOTED THAT**: A board name tells you EVERYTHING there is to know about a board. You do not need other chunks to tell you how much RAM there is, or if it is VRAM. It is all implied by the board name. A list will soon be distributed containing board name information. Address of board table for North American Games and Board Names description: http://www.parodius.com/~veilleux/boardtable.txt http://www.parodius.com/~veilleux/boardnames ID: [READ] Length: ?? Revision: 1 Description: Commentaries for the user of the ROM image. In the case of a homebrew game, this can be very useful to store credit and maker information. *** This could be "Incitation to littering". Please do not put garbage in there. It is meant for either mapper information or licensing information for homebrew games.*** ID: [NAME] Length: ?? Revision: 1 Description: NULL-terminated string containing the name of the game. If not present, use the filename as the name. ID: [TVCI] Length: BYTE Revision: 6 Description: Television Standards Compatability Information set to: 0- Originally NTSC cartridge 1- Originally PAL cartridge 2- Does not matter NOTE: ALL North American carts that are dumps of the North American Version are NTSC. All licensed famicom games are NTSC. ID: [DINF] Length: 204 Revision: 2 Description: Dumper information block: structure dumper_info [ char dumper_name[100]; /* NULL-terminated string containing the name of the person who dumped the cart. */ byte day; /* Day of the month when cartridge was dumped */ byte month; /* Month of the year when cartridge was dumped */ word year; /* Year during which the cartridge was dumped */ char dumper_agent[100]; /* NULL-terminated string containing the name of the ROM-dumping means used */ ] ID: [CTRL] Length: BYTE Revision: 7 Description: Bitfield containing information about the controllers used by the cartridge. Bit 0: Regular Joypad Bit 1: Zapper Bit 2: R.O.B Bit 3: Arkanoid Controller Bit 4: Power Pad Bit 5: Four-Score adapter Bit 6: Expansion (Do not touch) Bit 7: Expansion (Do not touch) ID: [PCK0] through [PCKF] Length: DWORD Reivision: 5 Description: This block contains a 32-bit CRC which can be used to make sure that the ROM content matches a checksum when burning on EPROM. This block provides a checksum for [PRG0] through [PRGF] inclusively ID: [CCK0] through [CCKF] Length: DWORD Reivision: 5 Description: This block contains a 32-bit CRC which can be used to make sure that the ROM content matches a checksum when burning on EPROM. This block provides a checksum for [CHR0] through [CHRF] inclusively ID: [PRG0] through [PRGF] Length: ?? Revision: 4 Description: Chunks containing the Binary data of the PRG ROM. If there are more than 1 PRG chips on the PRG bus, use PRG1, PRG2, PRG4, etc. The way PRGs are handled depends on the mapper and emulator. Most generaly (99%), only use PRG0. (Some carts have been witnessed with 8 PRG ROMs). ID: [CHR0] through [CHRF] Length: ?? Revision: 4 Description: Chunks containing the binary data of the CHR ROM. If there are more than 1 CHR chips on the CHR bus, use CHR1, CHR2, CHR4, etc. The way CHRs are handled depends on the mapper and emulator. Most generaly (99%), only CHR0 is used. ID: [BATR] Length: BYTE Revision: 5 Description: The presence of this block indicates that the board indeed contains a battery. This is necessary because many boards have the capability of a battery (the traces and holes are there), but they only use RAM and don't add the battery at manufacturing time. Examples: * SAROM: MMC1B, PRG ROM, CHR ROM, optional 8k of RAM (battery) * SKROM: MMC1B, PRG ROM, CHR ROM, 8k optional RAM (battery) Both these boards (SAROM and SKROM) can have a battery, but usually they don't have it. ID: [VROR] Length: BYTE Revision: 5 Description: This is a VRAM Override. If this chunk is present, then the CHR-ROM area will be considered as RAM even if ROM is present. This overrides board identification. This is present so that homemade carts which use NROM or others and replace the CHR-ROM with CHR-RAM can still be interpreted (since NROM is always CHR-ROM in commercial games). ID: [MIRR] Length: BYTE Revision: 5 Description: This chunk tells you how the hardwired mirroring is setup on the board. The board name CANNOT tell you (in most cases) what the mirroring is, since the all have solder pads to select the mirroring at manufacturing time. The following values are legal: * $00 - Horizontal Mirroring (Hard Wired) * $01 - Vertical Mirroring (Hard Wired) * $02 - Mirror All Pages From $2000 (Hard Wired) * $03 - Mirror All Pages From $2400 (Hard Wired) * $04 - Four Screens of VRAM (Hard Wired) * $05 - Mirroring Controlled By Mapper Hardware Conclusion ---------- This ends the specification for Revision 6 of UNIF. If you have ANY suggestions to make regarding the UNIF file format, such as chunk ideas or modifications, or would like to collaborate to the elaboration and design process, e-mail me at veilleux@ameth.org. A multi-platform C Code Library for UNIF support was made by Evan Teran. It is available at http://www.pretendo.org/~proxy/. [References] {.NES file format specifications} by Marat Fayzullin (fms@cs.umd.edu) {NESDEV mailing list} by Various authors {NES technical documentation} by Jeremy Chadwick (yoshi@parodius.com) [Credits] Neal Tew for his neat emulator and great contribution to the NESdev community. Jeremy Chadwick (yoshi@parodius.com) for his contribution to the NESdev community and great advice over the time. Mark Knibbs (mark_k@iname.com) for his excellent web site as well as his more than honorable contribution to the NES world Matthew Conte (itsbroke@classicgaming.com) for his CajoNES and Nofrendo programs Michael Iwaniec (mrbananmos@yahoo.com) for his interest in UNIF and constructive criticism. Kevin Horton (khorton@iquest.net) for his proposals and support of UNIF. He's also been a fantastic help to me in my learning curve of the NES's hardware aspects. /Firebug/ (firebug@cfl.rr.com) for the ideas brought with NIFF T. Alex Reed {W1k} (rizen@netzero.net) for suggestions of additions to UNIF. He also pointed out some mistakes in the original specifications. Evan Teran {PrOxY} (emt3734@rit.edu) for making suggestions as well as writing a .NES->UNIF converter and the LIB_UNIF library. fceu-0.98.12/Documentation/tech/nsfspec.txt0000644000175000000620000003124507757447436020504 0ustar joestaff00000000000000 NES Music Format Spec --------------------- By: Kevin Horton khorton@iquest.net NOTE: ----- Remember that I am very willing to add stuff and update this spec. If you find a new sound chip or other change let me know and I will get back with you. E-mail to the above address. V1.61 - 06/27/2000 Updated spec a bit V1.60 - 06/01/2000 Updated Sunsoft, MMC5, and Namco chip information V1.50 - 05/28/2000 Updated FDS, added Sunsoft and Namco chips V1.32 - 11/27/1999 Added MMC5 register locations V1.30 - 11/14/1999 Added MMC5 audio bit, added some register info V1.20 - 09/12/1999 VRC and FDS prelim sound info added V1.00 - 05/11/1999 First official NSF specification file This file encompasses a way to transfer NES music data in a small, easy to use format. The basic idea is one rips the music/sound code from an NES game and prepends a small header to the data. A program of some form (6502/sound emulator) then takes the data and loads it into the proper place into the 6502's address space, then inits and plays the tune. Here's an overview of the header: offset # of bytes Function ---------------------------- 0000 5 STRING "NESM",01Ah ; denotes an NES sound format file 0005 1 BYTE Version number (currently 01h) 0006 1 BYTE Total songs (1=1 song, 2=2 songs, etc) 0007 1 BYTE Starting song (1= 1st song, 2=2nd song, etc) 0008 2 WORD (lo/hi) load address of data (8000-FFFF) 000a 2 WORD (lo/hi) init address of data (8000-FFFF) 000c 2 WORD (lo/hi) play address of data (8000-FFFF) 000e 32 STRING The name of the song, null terminated 002e 32 STRING The artist, if known, null terminated 004e 32 STRING The Copyright holder, null terminated 006e 2 WORD (lo/hi) speed, in 1/1000000th sec ticks, NTSC (see text) 0070 8 BYTE Bankswitch Init Values (see text, and FDS section) 0078 2 WORD (lo/hi) speed, in 1/1000000th sec ticks, PAL (see text) 007a 1 BYTE PAL/NTSC bits: bit 0: if clear, this is an NTSC tune bit 0: if set, this is a PAL tune bit 1: if set, this is a dual PAL/NTSC tune bits 2-7: not used. they *must* be 0 007b 1 BYTE Extra Sound Chip Support bit 0: if set, this song uses VRCVI bit 1: if set, this song uses VRCVII bit 2: if set, this song uses FDS Sound bit 3: if set, this song uses MMC5 audio bit 4: if set, this song uses Namco 106 bit 5: if set, this song uses Sunsoft FME-07 bits 6,7: future expansion: they *must* be 0 007c 4 ---- 4 extra bytes for expansion (must be 00h) 0080 nnn ---- The music program/data follows This may look somewhat familiar; if so that's because this is somewhat sorta of based on the PSID file format for C64 music/sound. Loading a tune into RAM ----------------------- If offsets 0070h to 0077h have 00h in them, then bankswitching is *not* used. If one or more bytes are something other than 00h then bankswitching is used. If bankswitching is used then the load address is still used, but you now use (ADDRESS AND 0FFFh) to determine where on the first bank to load the data. Each bank is 4K in size, and that means there are 8 of them for the entire 08000h-0ffffh range in the 6502's address space. You determine where in memory the data goes by setting bytes 070h thru 077h in the file. These determine the inital bank values that will be used, and hence where the data will be loaded into the address space. Here's an example: METROID.NSF will be used for the following explaination. The file is set up like so: (starting at 070h in the file) 0070: 05 05 05 05 05 05 05 05 - 00 00 00 00 00 00 00 00 0080: ... music data goes here... Since 0070h-0077h are something other than 00h, then we know that this tune uses bankswitching. The load address for the data is specified as 08000h. We take this AND 0fffh and get 0000h, so we will load data in at byte 0 of bank 0, since data is loaded into the banks sequentially starting from bank 0 up until the music data is fully loaded. Metroid has 6 4K banks in it, numbered 0 through 5. The 6502's address space has 8 4K bankswitchable blocks on it, starting at 08000h-08fffh, 09000h-09fffh, 0a000h-0afffh ... 0f000h-0ffffh. Each one of these is 4K in size, and the current bank is controlled by writes to 05ff8h thru 05fffh, one byte per bank. So, 05ff8h controls the 08000h-08fffh range, 05ff9h controls the 09000h-09fffh range, etc. up to 05fffh which controls the 0f000h-0ffffh range. When the song is loaded into RAM, it is loaded into the banks and not the 6502's address space. Once this is done, then the bank control registers are written to set up the inital bank values. To do this, the value at 0070h in the file is written to 05ff8h, 0071h is written to 05ff9h, etc. all the way to 0077h is written to 05fffh. This is should be done before every call to the init routine. If the tune was not bankswitched, then it is simply loaded in at the specified load address, until EOF Initalizing a tune ------------------ This is pretty simple. Load the desired song # into the accumulator, minus 1 and set the X register to specify PAL (X=1) or NTSC (X=0). If this is a single standard tune (i.e. PAL *or* NTSC but not both) then the X register contents should not matter. Once the song # and optional PAL/NTSC standard are loaded, simply call the INIT address. Once init is done, it should perform an RTS. Playing a tune -------------- Once the tune has been initalized, it can now be played. To do this, simply call the play address several times a second. How many times per second is determined by offsets 006eh and 006fh in the file. These bytes denote the speed of playback in 1/1000000ths of a second. For the "usual" 60Hz playback rate, set this to 411ah. To generate a differing playback rate, use this formula: 1000000 PBRATE= --------- speed Where PBRATE is the value you stick into 006e/006fh in the file, and speed is the desired speed in hertz. "Proper" way to load the tune ----------------------------- 1) If the tune is bankswitched, go to #3. 2) Load the data into the 6502's address space starting at the specified load address. Go to #4. 3) Load the data into a RAM area, starting at (start_address AND 0fffh). 4) Tune load is done. "Proper" way to init a tune --------------------------- 1) Clear all RAM at 0000h-07ffh. 2) Clear all RAM at 6000h-7fffh. 3) Init the sound registers by writing 00h to 04000-0400Fh, 10h to 4010h, and 00h to 4011h-4013h. 4) Set volume register 04015h to 00fh. 5) If this is a banked tune, load the bank values from the header into 5ff8-5fffh. 6) Set the accumulator and X registers for the desired song. 7) Call the music init routine. "Proper" way to play a tune --------------------------- 1) Call the play address of the music at periodic intervals determined by the speed words. Which word to use is determined by which mode you are in- PAL or NTSC. Sound Chip Support ------------------ Byte 007bh of the file stores the sound chip flags. If a particular flag is set, those sound registers should be enabled. If the flag is clear, then those registers should be disabled. * VRCVI Uses registers 9000-9002, A000-A002, and B000-B002, write only. Caveats: 1) The above registers are *write only* and must not disrupt music code that happens to be stored there. 2) Major caveat: The A0 and A1 lines are flipped on a few games!! If you rip the music and it sounds all funny, flip around the xxx1 and xxx2 register pairs. (i.e. 9001 and 9002) 9000 and 9003 can be left untouched. I decided to do this since it would make things easier all around, and this means you only will have to change the music code in a very few places (6). Esper2 and Madara will need this change, while Castlevania 3j will not for instance. 3) See my VRCVI.TXT doc for a complete register description. * VRCVII Uses registers 9010 and 9030, write only. Caveats: 1) Same caveat as #1, above. 2) See my VRCVII.TXT doc for a complete register description. * FDS Sound uses registers from 4040 through 4092. Caveats: 1) 6000-DFFF is assumed to be RAM, since 6000-DFFF is RAM on the FDS. E000-FFFF is usually not included in FDS games because it is the BIOS ROM. However, it can be used on FDS rips to help the ripper (for modified play/init addresses). 2) Bankswitching operates slightly different on FDS tunes. 5FF6 and 5FF7 control the banks 6000-6FFF and 7000-7FFF respectively. NSF header offsets 76h and 77h correspond to *both* 6000-7FFF *AND* E000-FFFF. Keep this in mind! * MMC5 Sound Uses registers 5000-5015, write only as well as 5205 and 5206, and 5C00-5FF5 Caveats: 1) Generating a proper doc file. Be patient. 2) 5205 and 5206 are a hardware 8*8 multiplier. The idea being you write your two bytes to be multiplied into 5205 and 5206 and after doing so, you read the result back out. Still working on what exactly triggers it (I think a write to either 5205 or 5206 triggers the multiply). 3) 5C00-5FF5 should be RAM to emulate EXRAM while in MMC5 mode. Note: Thanks to Mamiya for the EXRAM info. * Namco 106 Sound Uses registers 4800 and F800. This works similar to VRC7. 4800 is the "data" port which is readable and writable, while F800 is the "address" port and is writable only. The address is 7 bits plus a "mode" bit. Bit 7 controls address auto-incrementing. If bit 7 is set, the address will auto-increment after a byte of data is read or written from/to 4800. $40 ffffffff f:frequency L $42 ffffffff f:frequency M $44 ---sssff f:frequency H s:tone length (8-s)*4 in 4bit-samples $46 tttttttt t:tone address(4bit-address,$41 means high-4bits of $20) $47 -cccvvvv v:linear volume 1+c:number of channels in use($7F only) $40-47:ch1 $48-4F:ch2 ... $78-7F:ch8 ch2-ch8 same to ch1 $00-3F(8ch)...77(1ch) hhhhllll tone data h:odd address data(signed 4bit) l:even address data(signed 4bit) real frequency = (f * NES_BASECYCLES) / (40000h * (c+1) * (8-s)*4 * 45) NES_BASECYCLES 21477270(Hz) Note: Very Special thanks to Mamiya for this information! * Sunsoft FME-07 Sound uses registers C000 and E000 This is similar to the common AY 3-8910 sound chip that is used on tons of arcade machines, and in the Intellivision. C000 is the address port E000 is the data port Both are write-only, and behave like the AY 3-8910. Note: Special thanks to Mamiya for this information as well Caveats ------- 1) The starting song number and maximum song numbers start counting at 1, while the init address of the tune starts counting at 0. To "fix", simply pass the desired song number minus 1 to the init routine. 2) The NTSC speed word is used *only* for NTSC tunes, or dual PAL/NTSC tunes. The PAL speed word is used *only* for PAL tunes, or dual PAL/NTSC tunes. 3) The length of the text in the name, artist, and copyright fields must be 31 characters or less! There has to be at least a single NULL byte (00h) after the text, between fields. 4) If a field is not known (name, artist, copyright) then the field must contain the string "" (without quotes). 5) There should be 8K of RAM present at 6000-7FFFh. MMC5 tunes need RAM at 5C00-5FF7 to emulate its EXRAM. 8000-FFFF Should be read-only (not writable) after a tune has loaded. The only time this area should be writable is if an FDS tune is being played. 6) Do not assume the state of *anything* on entry to the init routine except A and X. Y can be anything, as can the flags. 7) Do not assume the state of *anything* on entry to the play routine either. Flags, X, A, and Y could be at any state. I've fixed about 10 tunes because of this problem and the problem, above. 8) The stack sits at 1FFh and grows down. Make sure the tune does not attempt to use 1F0h-1FFh for variables. (Armed Dragon Villigust did and I had to relocate its RAM usage to 2xx) 9) Variables should sit in the 0000h-07FFh area *only*. If the tune writes outside this range, say 1400h this is bad and should be relocated. (Terminator 3 did this and I relocated it to 04xx). That's it! fceu-0.98.12/Documentation/tech/ppu/0002755000175000000620000000000010041626223017050 5ustar joestaff00000000000000fceu-0.98.12/Documentation/tech/ppu/loopy1.txt0000644000175000000620000000443107757447436021067 0ustar joestaff00000000000000Subject: [nesdev] the skinny on nes scrolling Date: Tue, 13 Apr 1999 16:42:00 -0600 From: loopy Reply-To: nesdev@onelist.com To: nesdev@onelist.com From: loopy --------- the current information on background scrolling is sufficient for most games; however, there are a few that require a more complete understanding. here are the related registers: (v) vram address, a.k.a. 2006 which we all know and love. (16 bits) (t) another temp vram address (16 bits) (you can really call them 15 bits, the last isn't used) (x) tile X offset (3 bits) the ppu uses the vram address for both reading/writing to vram thru 2007, and for fetching nametable data to draw the background. as it's drawing the background, it updates the address to point to the nametable data currently being drawn. bits 0-11 hold the nametable address (-$2000). bits 12-14 are the tile Y offset. --------- stuff that affects register contents: (sorry for the shorthand logic but i think it's easier to see this way) 2000 write: t:0000110000000000=d:00000011 2005 first write: t:0000000000011111=d:11111000 x=d:00000111 2005 second write: t:0000001111100000=d:11111000 t:0111000000000000=d:00000111 2006 first write: t:0011111100000000=d:00111111 t:1100000000000000=0 2006 second write: t:0000000011111111=d:11111111 v=t scanline start (if background and sprites are enabled): v:0000010000011111=t:0000010000011111 frame start (line 0) (if background and sprites are enabled): v=t note! 2005 and 2006 share the toggle that selects between first/second writes. reading 2002 will clear it. note! all of this info agrees with the tests i've run on a real nes. BUT if there's something you don't agree with, please let me know so i can verify it. ________________________________________________________ NetZero - We believe in a FREE Internet. Shouldn't you? Get your FREE Internet Access and Email at http://www.netzero.net/download.html ------------------------------------------------------------------------ New hobbies? New curiosities? New enthusiasms? http://www.ONElist.com Sign up for a new e-mail list today! fceu-0.98.12/Documentation/tech/ppu/loopy2.txt0000644000175000000620000000270207757447436021067 0ustar joestaff00000000000000Subject: [nesdev] Re: the skinny on nes scrolling Date: Tue, 13 Apr 1999 17:48:54 -0600 From: loopy Reply-To: nesdev@onelist.com To: nesdev@onelist.com From: loopy (more notes on ppu logic) you can think of bits 0,1,2,3,4 of the vram address as the "x scroll"(*8) that the ppu increments as it draws. as it wraps from 31 to 0, bit 10 is switched. you should see how this causes horizontal wrapping between name tables (0,1) and (2,3). you can think of bits 5,6,7,8,9 as the "y scroll"(*8). this functions slightly different from the X. it wraps to 0 and bit 11 is switched when it's incremented from _29_ instead of 31. there are some odd side effects from this.. if you manually set the value above 29 (from either 2005 or 2006), the wrapping from 29 obviously won't happen, and attrib data will be used as name table data. the "y scroll" still wraps to 0 from 31, but without switching bit 11. this explains why writing 240+ to 'Y' in 2005 appeared as a negative scroll value. ________________________________________________________ NetZero - We believe in a FREE Internet. Shouldn't you? Get your FREE Internet Access and Email at http://www.netzero.net/download.html ------------------------------------------------------------------------ Looking for a new hobby? Want to make a new friend? http://www.ONElist.com Come join one of the 115,000 e-mail communities at ONElist! fceu-0.98.12/Documentation/tech/ppu/2C02 technical operation.TXT0000644000175000000620000007566407757447436024026 0ustar joestaff00000000000000******************************* *NTSC 2C02 technical operation* ******************************* Brad Taylor (big_time_software@hotmail.com) 1st release: Sept 25th, Y2K 2nd release: Jan 27th, 2K3 3rd release: Feb 4th, 2K3 4th release: Feb 19th, 2K3 This document describes the low-level operation and technical details of the 2C02, the NES's PPU. In general, it contains important information in regards to PPU timing, which no NES coder/emulator author should be without. This document assumes that you already understand the basics of how the PPU works, like how the playfield/object images are generated, and the behaviour of scroll/address counters during playfield rendering. Alot of the concepts behind how the PPU works described here have been extracted from Nintendo's patent documentation (U.S.#4,824,106). With block diagrams of the PPU's architecture (and even some schematics), these papers will definetely aid in the comprehension of this complex device. Since the first release, this document has been given a major overhaul. Most sections of the document have been reworked, and new information has been added just about everywhere. If you've read the old version of this document before, I recommend that you read this new one in it's entirity; there's new information even in sections which may look like they haven't changed much. Topics discussed hereon are as follows. - Video signal generation - PPU base timing - Miscellanious PPU info - PPU memory access cycles - Frame rendering details - Scanline rendering details - In-range object evaluation - Details of playfield render pipeline - Details of object pattern fetch & render - Extra cycle frames - The MMC3's scanline counter - PPU pixel priority quirk - Graphical enhancements +-------+ |History| +-------+ On the weekend of Sept. 25th, Y2K, I setup an experiment with my NTSC NES MB & my PC so's I could RE the PPU's timing. What I did was (using a PC interface) analyse the changes that occur on the PPU's address and data pins on every rising & falling edge of the PPU's clock. I was not planning on removing the PPU from the motherboard (yet), so basically I just kept everything intact (minus the stuff I added onto the MB so I could monitor the PPU's signals), and popped in a game, so that it would initialize the PPU for me (I used DK classics, since it was only taking somthing like 4 frames before it was turning on the background/sprites). The only change I made was taking out the 21 MHz clock generator circuitry. To replace the clock signal, I connected a port controlled latch to the NES's main clock line instead. Now, by writing a 0 or a 1 out to an PC ISA port of my choice (I was using $104), I was able to control the 21 MHz clockline of the NES. After I would create a rise or a fall on the NES's clock line, I would then read in the data that appeared on the PPU's address and data pins, which included monitoring what PPU registers the game read/wrote to (& the data that was read/written). +-----------------------+ |Video signal generation| +-----------------------+ A 21.48 MHz clock signal is fed into the PPU. This is the NES's main clock line, which is shared by the CPU. Inside the PPU, the 21.48 MHz signal is used to clock a three-stage Johnson counter. The complimentery outputs of both master and slave portions of each stage are used to form 12 mutually exclusive output phases- all 3.58 MHz each (the NTSC colorburst). These 12 different phases form the basis of all color generation for the PPU's composite video output. Naturally, when the user programs the lower 4-bits of a palette register, they are essentially selecting any 1 of 12 phases to be routed to the PPU's video out pin (this corresponds to chrominance (tint/hue) video information) when the appropriate pixel indexes it. Other chrominance combinations (0 & 13) are simply hardwired to a 1 or 0 to generate grayscale pixels. Bits 4 & 5 of a palette entry selects 1 of 4 linear DC voltage offsets to apply to the selected chrominance signal (this corresponds to luminance (brightness) video information) for a pixel. Chrominance values 14 & 15 yield a black pixel color, regardless of any luminance value setting. Luminance value 0, mixed with chrominance value 13 yield a "blacker than black" pixel color. This super black pixel has an output voltage level close to the vertical/horizontal syncronization pulses. Because of this, some video monitors will display warped/distorted screens for games which use this color for black (Game Genie is the best example of this). Essentially what is happening is the video monitor's horizontal timing is compromised by what it thinks are extra syncronization pulses in the scanline. This is not damaging to the monitors which are effected by it, but use of the super black color should be avoided, due to the graphical distortion it causes. The amplitude of the selected chrominance signal (via the 4 lower bits of a palette register) remain constant regardless of bits 4 or 5. Thus it is not possible to adjust the saturation level of a particular color. +---------------+ |PPU base timing| +---------------+ Other than the 3-stage Johnson counter, the 21.48 MHz signal is not used directly by any other PPU hardware. Instead, the signal is divided by 4 to get 5.37 MHz, and is used as the smallest unit of timing in the PPU. All following references to PPU clock cycle (abbr. "cc") timing in this document will be in respect to this timing base, unless otherwise indicated. - Pixels are rendered at the same rate as the base PPU clock. In other words, 1 clock cycle= 1 pixel. - 341 PPU cc's make up the time of a typical scanline (or 341/3 CPU cc's). - One frame consists of 262 scanlines. This equals 341*262 PPU cc's per frame (divide by 3 for # of CPU cc's). +------------------------+ |PPU memory access cycles| +------------------------+ All PPU memory access cycles are 2 clocks long, and can be made back-to-back (typically done during rendering). Here's how the access breaks down: At the beginning of the access cycle, PPU address lines 8..13 are updated with the target address. This data remains here until the next time an access cycle occurs. The lower 8-bits of the PPU address lines are multiplexed with the data bus, to reduce the PPU's pin count. On the first clock cycle of the access, A0..A7 are put on the PPU's data bus, and the ALE (address latch enable) line is activated for the first half of the cycle. This loads the lower 8-bit address into an external 8-bit transparent latch strobed by ALE (74LS373 is used). On the second clock cycle, the /RD (or /WR) line is activated, and stays active for the entire cycle. Appropriate data is driven onto the bus during this time. +----------------------+ |Miscellanious PPU info| +----------------------+ - Sprite DMA is 1536 clock cycles long (512 CPU cc's). 256 individual transfers are made from CPU memory to a temp register inside the CPU, then from the CPU's temp reg, to $2004. - The PPU makes NO external access to the PPU bus, unless the playfield or objects are enabled during a scanline outside vblank. This means that the PPU's address and data busses are dead while in this state. - palette RAM is accessed internally during playfield rendering (i.e., the palette address/data is never put on the PPU bus during this time). Additionally, when the programmer accesses palette RAM via $2006/7, the palette address accessed actually does show up on the PPU address bus, but the PPU's /RD & /WR flags are not activated. This is required; to prevent writing over name table data falling under the approprite mirrored area (since the name table RAM's address decoder simply consists of an inverter connected to the A13 line- effectively decoding all addresses in $2000-$3FFF). - the VINT impulse (NMI) and bit $2002.7 are set simultaniously. Reading $2002 will reset bit 7, but it seems that the VINT flag goes down on it's own. Because of this, when the PPU generates a VINT, it doesn't require any acknowledgement whatsoever; it will continue firing off VINTs, regardless of inservice to $2002. The only way to stop VINTs is to clear $2000.7. - Because the PPU cannot make a read from PPU memory immediately upon request (via $2007), there is an internal buffer, which acts as a 1-stage data pipeline. As a read is requested, the contents of the read buffer are returned to the NES's CPU. After this, at the PPU's earliest convience (according to PPU read cycle timings), the PPU will fetch the requested data from the PPU memory, and throw it in the read buffer. Writes to PPU mem via $2007 are pipelined as well, but it is unknown to me if the PPU uses this same buffer (this could be easily tested by writing somthing to $2007, and seeing if the same value is returned immediately after reading). +-----------------------+ |Frame rendering details| +-----------------------+ The following describes the PPU's status during all 262 scanlines of a frame. Any scanlines where work is done (like image rendering), consists of the steps which will be described in the next section. 0..19: Starting at the instant the VINT flag is pulled down (when a NMI is generated), 20 scanlines make up the period of time on the PPU which I like to call the VINT period. During this time, the PPU makes no access to it's external memory (i.e. name / pattern tables, etc.). 20: After 20 scanlines worth of time go by (since the VINT flag was set), the PPU starts to render scanlines. This first scanline is a dummy one; although it will access it's external memory in the same sequence it would for drawing a valid scanline, no on-screen pixels are rendered during this time, making the fetched background data immaterial. Both horizontal *and* vertical scroll counters are updated (presumably) at cc offset 256 in this scanline. Other than that, the operation of this scanline is identical to any other. The primary reason this scanline exists is to start the object render pipeline, since it takes 256 cc's worth of time to determine which objects are in range or not for any particular scanline. 21..260: after rendering 1 dummy scanline, the PPU starts to render the actual data to be displayed on the screen. This is done for 240 scanlines, of course. 261: after the very last rendered scanline finishes, the PPU does nothing for 1 scanline (i.e. the programmer gets screwed out of perfectly good VINT time). When this scanline finishes, the VINT flag is set, and the process of drawing lines starts all over again. +--------------------------+ |Scanline rendering details| +--------------------------+ Naturally, the PPU will fetch data from name, attribute, and pattern tables during a scanline to produce an image on the screen. This section details the PPU's doings during this time. As explained before, external PPU memory can be accessed every 2 cc's. With 341 cc's per scanline, this gives the PPU enough time to make 170 memory accesses per scanline (and it uses all of them!). After the 170th fetch, the PPU does nothing for 1 clock cycle. Remember that a single pixel is rendered every clock cycle. Memory fetch phase 1 thru 128 ----------------------------- 1. Name table byte 2. Attribute table byte 3. Pattern table bitmap #0 4. Pattern table bitmap #1 This process is repeated 32 times (32 tiles in a scanline). This is when the PPU retrieves the appropriate data from PPU memory for rendering the playfield. The first playfield tile fetched here is actually the 3rd to be drawn on the screen (the playfield data for the first 2 tiles to be rendered on this scanline are fetched at the end of the scanline prior to this one). All valid on-screen pixel data arrives at the PPU's video out pin during this time (256 clocks). For determining the precise delay between when a tile's bitmap fetch phase starts (the whole 4 memory fetches), and when the first pixel of that tile's bitmap data hits the video out pin, the formula is (16-n) clock cycles, where n is the fine horizontal scroll offset (0..7 pixels). This information is relivant for understanding the exact timing operation of the "object 0 collision" flag. Note that the PPU fetches an attribute table byte for every 8 sequential horizontal pixels it draws. This essentially limits the PPU's color area (the area of pixels which are forced to use the same 3-color palette) to only 8 horizontally sequential pixels. It is also during this time that the PPU evaluates the "Y coordinate" entries of all 64 objects in object attribute RAM (OAM), to see if the objects are within range (to be drawn on the screen) for the *next* scanline (this is why Y-coordinate entries in the OAM must be programmed to a value 1 less than the scanline the object is to appear on). Each evaluation (presumably) takes 4 clock cycles, for a total of 256 (which is why it's done during on-screen pixel rendering). In-range object evaluation -------------------------- An 8-bit comparator is used to calculate the 9-bit difference between the current scanline (minus 21), and each Y-coordinate (plus 1) of every object entry in the OAM. Objects are considered in range if the comparator produces a difference in the range of 0..7 (if $2000.5 currently = 0), or 0..15 (if $2000.5 currently = 1). (Note that a 9-bit comparison result is generated. This means that setting object scanline coordinates for ranges -1..-15 are actually interpreted as ranges 241..255. For this reason, objects with these ranges will never be considered to be part of any on-screen scanline range, and will not allow smooth object scrolling off the top of the screen.) Tile index (8 bits), X-coordinate (8 bits), & attribute information (4 bits; vertical inversion is excluded) from the in-range OAM element, plus the associated 4-bit result of the range comparison accumulate in a part of the PPU called the "sprite temporary memory". Logical inversion is applied to the loaded 4-bit range comparison result, if the object's vertical inversion attribute bit is set. Since object range evaluations occur sequentially through the OAM (starting from entry 0 to 63), the sprite temporary memory always fills in order from the highest priority in-range object, to lower ones. A 4-bit "in-range" counter is used to determine the number of found objects on the scanline (from 0 up to 8), and serves as an index pointer for placement of found object data into the 8-element sprite temporary memory. The counter is reset at the beginning of the object evaluation phase, and is post-incremented everytime an object is found in-range. This occurs until the counter equals 8, when found object data after this is discarded, and a flag (bit 5 of $2002) is raised, indicating that it is going to be dropping objects for the next scanline. An additional memory bit associated with the sprite temporary memory is used to indicate that the primary object (#0) was found to be in range. This will be used later on to detect primary object-to-playfield pixel collisions. Playfield render pipeline details --------------------------------- As pattern table & palette select data is fetched, it is loaded into internal latches (the palette select data is selected from the fetched byte via a 2-bit 1-of-4 selector). At the start of a new tile fetch phase (every 8 cc's), both latched pattern table bitmaps are loaded into the upper 8-bits of 2- 16-bit shift registers (which both shift right every clock cycle). The palette select data is also transfered into another latch during this time (which feeds the serial inputs of 2 8-bit right shift registers shifted every clock). The pixel data is fed into these extra shift registers in order to implement fine horizontal scrolling, since the periods when the PPU fetch tile data is fixed. A single bit from each shift register is selected, to form the valid 4-bit playfield pixel for the current clock cycle. The bit selection offset is based on the fine horizontal scroll value (this selects bit positions 0..7 for all 4 shift registers). The selected 4-bit pixel data will then be fed into the multiplexer (described later) to be mixed with object data. Memory fetch phase 129 thru 160 ------------------------------- 1. Garbage name table byte 2. Garbage name table byte 3. Pattern table bitmap #0 for applicable object (for next scanline) 4. Pattern table bitmap #1 for applicable object (for next scanline) This process is repeated 8 times. This is the period of time when the PPU retrieves the appropriate pattern table data for the objects to be drawn on the *next* scanline. When less than 8 objects exist on the next scanline (as the in-range object evaluation counter indicates), dummy pattern table fetches take place for the remaining fetches. Internally, the fetched dummy-data is discarded, and replaced with completely transparent bitmap patterns). Although the fetched name table data is thrown away, and the name table address is somewhat unpredictable, the address does seem to relate to the first name table tile to be fetched for the next scanline. This would seem to imply that PPU cc #256 is when the PPU's scroll/address counters have their horizontal scroll values automatically updated. It should also be noted that because this fetch is required for objects on the next scanline, it is neccessary for a garbage scanline to exist prior to the very first scanline to be actually rendered, so that object attribute RAM entries can be evaluated, and the appropriate bitmap data retrieved. As far as the wasted fetch phases here, well, what can I say. Either Nintendo's engineers were VERY lazy, and didn't want to add the small amount of extra circuitry to the PPU so that 16 object fetches could take place per scanline, or Nintendo couldn't spot the extra memory required to implement 16 object scanlines. Thing is though- between the object attribute mem, sprite temporary & buffer mem, and palette mem, that's already 2406 bits of RAM; I don't think it would've killed them to just add the 408 bits it would've took for an extra 8 objects, which would've made games with horrible OAM cycling (Double Dragon 2 w/ 2 players) look half-decent (hell, with 16 object scanlines, games would hardly even need OAM cycling). Details of object pattern fetch & render ---------------------------------------- Where the PPU fetches pattern table data for an individual object is conditioned on the contents of the sprite temporary memory element, and $2000.5. If $2000.5 = 0, the tile index data is used as usual, and $2000.3 selects the pattern table to use. If $2000.5 = 1, the MSB of the range result value become the LSB of the indexed tile, and the LSB of the tile index value determines pattern table selection. The lower 3 bits of the range result value are always used as the fine vertical offset into the selected pattern. Horizontal inversion (bit order reversing) is applied to fetched bitmaps, if indicated in the sprite temporary memory element. The fetched pattern table data (which is 2 bytes), plus the associated 3 attribute bits (palette select & priority), and the x coordinate byte in sprite temporary memory are then loaded into a part of the PPU called the "sprite buffer memory" (the primary object present bit is also copied). This memory area again, is large enough to hold the contents for 8 sprites. The composition of one sprite buffer element here is: 2 8-bit shift registers (the fetched pattern table data is loaded in here, where it will be serialized at the appropriate time), a 3-bit latch (which holds the color & priority data for an object), and an 8-bit down counter (this is where the x coordinate is loaded). The counter is decremented every time the PPU renders a pixel (the first 256 cc's of a scanline; see "Memory fetch phase 1 thru 128" above). When the counter equals 0, the pattern table data in the shift registers will start to serialize (1 shift per clock). Before this time, or 8 clocks after, consider the outputs of the serializers for each stage to be 0 (transparency). The streams of all 8 object serializers are prioritized, and ultimately only one stream (with palette select & priority information) is selected for output to the multiplexer (where object & playfield pixels are prioritized). The data for the first sprite buffer entry (including the primary object present flag) has the first chance to enter the multiplexer, if it's output pixel is non-transparent (non-zero). Otherwise, priority is passed to the next serializer in the sprite buffer memory, and the test for non-transparency is made again (the primary object present status will always be passed to the multiplexer as false in this case). This is done until the last (8th) stage is reached, when the object data is passed through unconditionally. Keep in mind that this whole process occurs every clock cycle (hardware is used to determine priority instantly). The multiplexer does 2 things: determines primary object collisions, and decides which pixel data to pass through to index the palette RAM- either the playfield's or the object's. Primary object collisions occur when a non-transparent playfield pixel coincides with a non-transparent object pixel, while the primary object present status entering the multiplexer for the current clock cycle is true. This causes a flip-flop ($2002.6) to be set, and remains set (presumably) some time after the VINT occurence (prehaps up until scanline 20?). The decision for selecting the data to pass through to the palette index is made rather easilly. The condition to use object (opposed to playfield) data is: (OBJpri=foreground OR PFpixel=xparent) AND OBJpixel<>xparent Since the PPU has 2 palettes; one for objects, and one for playfield, the appropriate palette will be selected depending on which pixel data is passed through. After the palette look-up, the operation of events follows the aforementioned steps in the "video signal generation" section. Memory fetch phase 161 thru 168 ------------------------------- 1. Name table byte 2. Attribute table byte 3. Pattern table bitmap #0 (for next scanline) 4. Pattern table bitmap #1 (for next scanline) This process is repeated 2 times. It is during this time that the PPU fetches the appliciable playfield data for the first and second tiles to be rendered on the screen for the *next* scanline. These fetches initialize the internal playfield pixel pipelines (2- 16-bit shift registers) with valid bitmap data. The rest of tiles (3..32) are fetched at the beginning of the following scanline. Memory fetch phase 169 thru 170 ------------------------------- 1. Name table byte 2. Name table byte I'm unclear of the reason why this particular access to memory is made. The name table address that is accessed 2 times in a row here, is also the same nametable address that points to the 3rd tile to be rendered on the screen (or basically, the first name table address that will be accessed when the PPU is fetching playfield data on the next scanline). After memory access 170 ----------------------- The PPU simply rests for 1 cycle here (or the equivelant of half a memory access cycle) before repeating the whole pixel/scanline rendering process. +------------------+ |Extra cycle frames| +------------------+ Scanline 20 is the only scanline that has variable length. On every odd frame, this scanline is only 340 cycles (the dead cycle at the end is removed). This is done to cause a shift in the NTSC colorburst phase. You see, a 3.58 MHz signal, the NTSC colorburst, is required to be modulated into a luminance carrying signal in order for color to be generated on an NTSC monitor. Since the PPU's video out consists of basically square waves (as opposed to sine waves, which would be preferred), it takes an entire colorburst cycle (1/3.58 MHz) for an NTSC monitor to identify the color of a PPU pixel accurately. But now you remember that the PPU renders pixels at 5.37 MHz- 1.5x the rate of the colorburst. This means that if a single pixel resides on a scanline with a color different to those surrounding it, the pixel will probably be misrepresented on the screen, sometimes appearing faintly. Well, to somewhat fix this problem, they added this extra pixel into every odd frame (shifting the colorburst phase over a bit), and changing the way the monitor interprets isolated colored pixels each frame. This is why when you play games with detailed background graphics, the background seems to flicker a bit. Once you start scrolling the screen however, it seems as if some pixels become invisible; this is how stationary PPU images would look without this cycle removed from odd frames. Certain scroll rates expose this NTSC PPU color caveat regardless of the toggling phase shift. Some of Zelda 2's dungeon backgrounds are a good place to see this effect. +---------------------------+ |The MMC3's scanline counter| +---------------------------+ As most people know, the MMC3 bases it's scanline counter on PPU address line A13 (which is why IRQ's can be fired off manually by toggling A13 a bunch of times via $2006). What's not common knowledge is the number of times A13 is expected to toggle in a scanline (although if you've been paying close attention to the doc here, you should already know ;) A13 was probably used for the IRQ counter (as opposed to using the PPU's /READ line) because this address line already needed to be connected to the MMC for bankswitching purposes (so in other words, to reduce the MMC3's pin count by 1). They also probably used this method of counting (as opposed to a CPU cycle counter) since A13 cycles (0 -> 1) exactly 42 times per scanline, whereas the CPU count of cycles per scanline is not an exact integer (113.67). Having said that, I guess Nintendo wanted to provide an "easy-to-use" method of generating special image effects, without making programmers have to figure out how many clock cycles to program an IRQ counter with (a pretty lame excuse for not providing an IRQ counter with CPU clock cycle precision (which would have been more useful and versatile)). Regardless of any values PPU registers are programmed with, A13 will operate in a predictable fashion during image rendering (and if you understand how PPU addressing works, you should understand that A13 is the *only* address line with fixed behaviour during image rendering). +------------------------+ |PPU pixel priority quirk| +------------------------+ Object data is prioritized between itself, then prioritized between the playfield. There are some odd side effects to this scheme of rendering, however. For instance, imagine a low priority object pixel with foreground priority, a high priority object pixel with background priority, and a playfield pixel all coinciding (all non-transparent). Ideally, the playfield is considered to be the middle layer between background and foreground priority objects. This means that the playfield pixel should hide the background priority object pixel (regardless of object priority), and the foreground priority object should appear atop the PF pixel. However, because of the way the PPU renders (as just described), OBJ priority is evaluated first, and therefore the background object pixel wins, which means that you'll only be seeing the PF pixel after this mess. A good game to demonstrate this behaviour is Megaman 2. Go into airman's stage. First, jump into the energy bar, just to confirm that megaman's sprite is of a higher priority than the energy bar's. Now, get to the second half of the stage, where the clouds cover the energy bar. The energy bar will be ontop of the clouds, but megaman will be behind them. Now, look what happens when you jump into the energy bar here... you see the clouds where megaman underlaps the energy bar. +----------------------+ |Graphical enhancements| +----------------------+ Since an NES cartridge has access to the PPU bus, any number of on-cart hardware schemes can be used to enhance the graphic capabilities of the NES. After all, the PPU's playfield pipeline is very simple: it fetches 272 playfield pixels per scanline (as 34*2 byte fetches, in real-time), and outputs 256 of them to the screen (with the 0..7 pixel offset determined by the fine X scroll register), along with object data combined with it. Essentially, you can bypass the PPU's simple scrolling system, implement a custom one on your cart (fetching bitmap data in your own fashion), and feed the PPU bitmap data in your own order. The possibilities of this are endless (like sporting multiple playfields, or even playfield rotation/scaling), but of course what it comes down to is the amount of cartridge hardware required. Generally, playfield rotation/scaling can be done quite easily- it only requires a few sets of 16-bit registers and adders (the 16 bits are broken up into 8.8 fixed point values). But this kind of implementation is more suited for an integrated circuit, since this would require dozens of discrete logic chips. Multiple playfields are another thing which could be easily done. The caveat here is that pixel pipelines (i.e., shift registers) and a multiplexer would have to be implemented on the cart (not to mention exclusive name table RAM) in order to process the playfield bitmaps from multiple sources. The access to the CHR-ROM/RAM would also have to increased- but as it stands, the CHR-ROM/RAM bandwidth is 1.34 MHz, a rather low frequency. With a memory device capable of a 10.74 MHz bandwith, you could have 8 playfields to work with. Generally, this would be very useful for displaying multiple huge objects on the screen- without ever having to worry about annoying flicker. The only restriction to doing any of this is that: - every 8 sequential horizontal pixels sent to the PPU must share the same palette select value. Because of this, hardware would have to be implemented to decide which palette select value to feed the PPU between 8 horizontally sequential pixels, if they do not all share the same palette select value. The on-screen results of this may not be too flattering sometimes, but this is a small price to pay to do some neat graphical tricks on the NES. -only the playfield palette can be used. As usual, this pretty much limits your randomly accessable colors to about 12+1. It's a damn shame that Nintendo never created a MMC which would enhance graphics on the NES in useful ways as mentioned above. The MMC5 was the only device that came close, and it's only selling features were the single-tile color area, and the vertical split screen mode (which I don't think any game ever used). Considering the amount of pins (100) the MMC5 had, and number of gates they put in it just for the EXRAM (which was 1K bytes), they could've put some really useful graphics hardware inside there instead. Prehaps the infamous Color Dreams "Hellraiser" cart was the closest the NES ever came to seeing such sophisticated graphics. The cart was never released, but from what I've read, it was going to use some sort of frame buffer, and a Z80 CPU to do the graphical rendering. It had been rumored that the game had 3D graphics (or at least 2.5D) in it. If so (and the game was actually good), prehaps it would have raised a few eyebrows in the industry, and inspired Nintendo to develop a new MMC chip with similar capabilities, in order to keep the NES in it's profit margin for another few years (and allow it to compete somewhat with the more advanced systems of the time). EOFfceu-0.98.12/Documentation/fcs.txt0000644000175000000620000001200210051213713016623 0ustar joestaff00000000000000FCE Ultra Save State Format Updated: Mar 9, 2003 --------------------------------------- FCE Ultra's save state format is now designed to be as forward and backwards compatible as possible. This is achieved through the (over)use of chunks. All multiple-byte variables are stored LSB(least significant byte)-first. Data types: (u)int8 - (un)signed 8 bit variable(also referred to as "byte") (u)int16 - (un)signed 16 bit variable (u)int32 - (un)signed 32 bit variable -- Main File Header: The main file header is 16-bytes in length. The first three bytes contain the string "FCS". The next byte contains the version of FCE Ultra that saved this save state. This document only applies to version "53"(.53) and higher. After the version byte, the size of the entire file in bytes(minus the 16 byte main file header) is stored. If oldversion is set to 255, the 32-bit version field will be used. In this field, a version such as 0.98.10 is stored as "9810"(decimal). The rest of the header is currently unused and should be nulled out. Example of relevant parts: FCS -- Section Chunks: Sections chunk headers are 5-bytes in length. The first byte defines what section it is, the next four bytes define the total size of the section (including the section chunk header). Section definitions: 1 - "CPU" 2 - "CPUC" 3 - "PPU" 4 - "CTLR" 5 - "SND" 16 - "EXTRA" -- Subsection Chunks Subsection chunks are stored within section chunks. They contain the actual state data. Each subsection chunk is composed of an 8-byte header and the data. The header contains a description(a name) and the size of the data contained in the chunk: The name is a four-byte string. It does not need to be null-terminated. If the string is less than four bytes in length, the remaining unused bytes must be null. -- Subsection Chunk Description Definitions Note that not all subsection chunk description definitions listed below are guaranteed to be in the section chunk. It's just a list of what CAN be in a section chunk. This especially applies to the "EXTRA" subsection. ---- Section "CPU" Name: Type: Description: PC uint16 Program Counter A uint8 Accumulator P uint8 Processor status register X uint8 X register Y uint8 Y register S uint8 Stack pointer RAM uint8[0x800] 2KB work RAM ---- Section "CPUC" (emulator specific) Name: Type: Description: JAMM uint8 Non-zero value if CPU in a "jammed" state IRQL uint8 Non-zero value if IRQs are to be generated constantly ICoa int32 Temporary cycle counter ICou int32 Cycle counter ---- Section "PPU" Name: Type: Description: NTAR uint8[0x800] 2 KB of name/attribute table RAM PRAM uint8[32] 32 bytes of palette index RAM SPRA uint8[0x100] 256 bytes of sprite RAM PPU uint8[4] Last values written to $2000 and $2001, the PPU status register, and the last value written to $2003. XOFF uint8 Tile X-offset. VTOG uint8 Toggle used by $2005 and $2006. RADD uint16 PPU Address Register(address written to/read from when $2007 is accessed). TADD uint16 PPU Address Register VBUF uint8 VRAM Read Buffer PGEN uint8 PPU "general" latch. See Ki's document. ---- Section "CTLR" (somewhat emulator specific) Name: Type: Description: J1RB uint8 Bit to be returned when first joystick is read. J2RB uint8 Bit to be returned when second joystick is read. ---- Section "SND" (somewhat emulator specific) NREG uint16 Noise LFSR. P17 uint8 Last byte written to $4017. PBIN uint8 DMC bit index. PAIN uint32 DMC address index(from $8000). PSIN uint32 DMC length counter(how many bytes left to fetch). ---- Section "EXTRA" (varying emulator specificness) For iNES-format games(incomplete, and doesn't apply to every game): Name: Type: Description: WRAM uint8[0x2000] 8KB of WRAM at $6000-$7fff MEXR uint8[0x8000] (very emulator specific) CHRR uint8[0x2000] 8KB of CHR RAM at $0000-$1fff(in PPU address space). EXNR uint8[0x800] Extra 2KB of name/attribute table RAM. MPBY uint8[32] (very emulator specific) MIRR uint8 Current mirroring: 0 = "Horizontal" 1 = "Vertical" $10 = Mirror from $2000 $11 = Mirror from $2400 IRQC uint32 Generic IRQ counter IQL1 uint32 Generic IRQ latch IQL2 uint32 Generic IRQ latch IRQA uint8 Generic IRQ on/off register. PBL uint8[4] List of 4 8KB ROM banks paged in at $8000-$FFFF CBL uint8[8] List of 8 1KB VROM banks page in at $0000-$1FFF(PPU). For FDS games(incomplete): Name: Type: Description: DDT uint8[65500] Disk data for side x(0-3). FDSR uint8[0x8000] 32 KB of work RAM CHRR uint8[0x2000] 8 KB of CHR RAM IRQC uint32 IRQ counter IQL1 uint32 IRQ latch IRQA uint8 IRQ on/off. WAVE uint8[64] Carrier waveform data. MWAV uint8[32] Modulator waveform data. AMPL uint8[2] Amplitude data. fceu-0.98.12/Documentation/fceu-sdl.60000644000175000000620000000651307757447436017150 0ustar joestaff00000000000000.\" t Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH FCEU-SDL 6 "March 27, 2003" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME fceu-sdl \- An emulator for the original (8-bit) Nintendo game console. .SH SYNOPSIS .B fceu-sdl .RI [ options ] "filename" .SH DESCRIPTION .B FCE Ultra is an emulator for the original (8-bit) Nintendo Entertainment System (NES). It has a robust color palette rendering engine that is fully customizable, along with excellent sound and joystick support, and even includes TCP/IP based network playing for head-to-head gaming with your friends! .PP The emulator is available in two versions for Linux (there are also versions for DOS and Windows): an SDL-based version, and one based on SVGALIB. The two versions are essentially the same \-\- use the SVGALIB version for the Linux console, and the SDL version for playing in X. .SH OPTIONS These are some of the more frequently used options in FCE Ultra SDL. Run fceu-sdl without any options for a larger list, or see the README for the full list. .TP .B \-fs {0|1} Toggle full-screen mode. .TP .B \-xres Set the Horizontal resolution for full-screen mode. .TP .B \-yres Set the Vertical resolution for full-screen mode. .TP .B \-gg Enable Game Genie emulation support. .TP .B \-cpalette Use the custom palette in . .TP .B \-soundvol Sets the sound volume to the given percentage. .TP .B \-sound Set the sound playback sample rate (0 == off). .TP .B \-connect Connect as a client (player 2) to for TCP/IP network play. .TP .B \-server Be a host server (player 1) for a TCP/IP network game. .TP .B \-netport Use for TCP/IP network play. Default is 4046. .SH KEYBOARD COMMANDS .B FCE Ultra has a number of commands available within the emulator. It also includes default keyboard bindings when emulating game pads or power pads. .SS Gamepad Keyboard Bindings .TS center box; cb | cb, c | ci. NES Gamepad Keyboard = Arrows Cursor Arrows A Left ALT B Left CTRL Select TAB Start ENTER .TE .SS Other Commands .PP .TP 15 .BI Activate cheat interface. .TP 15 .BI Toggle full-screen mode. .TP 15 .BI Save game state into current slot (set using number keys). .TP 15 .BI Restore game state from current slot (set using number keys). .TP 15 .BI Save screen snapshot. .TP 15 .BI Reset NES. .TP 15 .BI Toggle power to NES. .TP 15 .BR ", " Quit .B FCE Ultra. .SH SEE ALSO .BR fceu-svga (6) .TP .I /usr/share/doc/fceu-doc/readme-linux.txt.gz The .B FCE Ultra README for linux, available from the .I fceu-doc Debian package. .TP .I http://fceultra.sourceforge.net/ The .B FCE Ultra project homepage. .SH AUTHOR This manual page was written by Joe Nahmias , for the Debian GNU/Linux system (but may be used by others). fceu-0.98.12/Documentation/protocol.txt0000644000175000000620000000617507757447436017765 0ustar joestaff00000000000000FCE Ultra 0.91+ network play protocol. Description v 0.0.1 -------------------------------------- In FCE Ultra, all data is sent to the server, and then the server distributes, every emulated frame(60hz on NTSC), the collated data to the clients. The server should not block when it is receiving UDP data from the clients. If no UDP data is available, then just go on. The clients MUST block until the input data packet comes on every emulated frame. Packets from the server to the client are sent out over both TCP and UDP. Duplicate packets should be discarded. Out-of-order packets can either be cached, or discarded(what I recommend, as caching code gets a little complex and wouldn't yield any benefit from what I've observed). In the case of client->server UDP communications, the server should just use the data from the UDP packet that has the highest packet number count, and the server should then set its internal incoming packet counter to that number(to prevent out-of-order packets from totally screwing up user input). The "magic number"(used with UDP packets) is meant to reduce the chance of a hostile remote host from disrupting the network play, without resorting to using extreme amounts of network bandwidth. The server generates the magic number, and it is best if the magic number is as random as possible. UDP packets received with an incorrect magic number should be discarded, of course. Initialization, server->client: uint32 Local UDP port(what the server is listening on). uint32 Player number(0-3) for client. uint32 Magic number(for UDP). Initialization, client->server uint32 Local UDP port(that the client is listening on). Structure of UDP packet data: uint32 CRC32 - Includes magic number, packet counter, and data. For reference, CRC32 is calculated with the zlib function crc32(). uint32 Magic number uint32 Packet counter(linear, starts at 0). uint8[variable] Data. Structure of tcp packet data: uint32 Packet counter(" "). uint8[variable] Data. Data format of server->client communications: uint8[4] Controller data uint8 Command byte. 0 if no command. Otherwise(in decimal): 1 Select FDS disk side. 2 Insert/eject FDS disk. 10 Toggle VS Unisystem dip switch editing. 11 ... 18 Toggle VS Unisystem dip switches. 19 Insert VS Unisystem coin. 30 Reset NES. 31 Power toggle NES. 40 Save state(not implemented correctly). 41 Load state(not implemented correctly). 42 ... 50 Select save state slot(minus 42). Special message communications occurs if the "Packet counter" is 0xFFFFFFFF(only with TCP): uint32 Length of text data, minus the null character(the null character is sent, though). uint8[variable] Text data. Convert all characters <32 to space, and then display the text message(it's one line) as is. Structure of client->server communication: uint8 Controller data(for this client). Over tcp channel, a text message can be sent. It is one line, null terminated(remember the data and parse it and display it and distribute it to the clients once the null byte is received). Maximum size of message(including the null byte) should be 256 bytes. fceu-0.98.12/Documentation/fceultra.html0000644000175000000620000012147310106530471020023 0ustar joestaff00000000000000 FCE Ultra General Documentation

FCE Ultra General Documentation

Last updated August 11, 2004
Valid as of FCE Ultra 0.98.11

Table of Contents:


Introduction

FCE Ultra is an NTSC and PAL Famicom/NES emulator for various platforms. It is based upon Bero's original FCE source code. Current features include good PPU, CPU, pAPU, expansion chip, and joystick emulation. Also a feature unique to this emulator(at the current time) is authentic Game Genie emulation. Save states and snapshot features also have been implemented.

This document has been arranged to keep user interface details and emulation details as separate as possible, though this has not been accomplished entirely.

In several places references are made to the "base directory". If you are running a port on a UN*X-like system(Linux/*BSD/Mac OSX/SunOS/etc.), the base directory is "~/.fceultra", or in other words, "your home directory plus .fceultra". For all other ports(including DOS and MS Windows), the base directory is the directory that the executable is in.

History of FCE Ultra

This section is a work-in-progress. Some details may be incorrect.
Bero originally wrote a NES emulator that was referred to as FCE. This name was apparently meant only to serve as a temporary name, but its usage remained. Xodnizel originally ported it to Linux SVGAlib, and made a few improvements. This code base was abandoned, and work began anew, under DOS, with the original FCE source code. At the end of November, 1998, FCE Ultra Beta 1 was released.

FCE Ultra remained DOS-only until version 0.18, when it was ported to Linux SVGAlib, and released as a staticly-linked executable. The first MS Windows port was released as version 0.25.

The source code of 0.40 was released on November 12, 2000. It retained the simple license of FCE for a long time, which stated that " This software is freeware.you can use it non-commercially." Almost two years later, in June 2002, 0.80 was released, and FCE Ultra was relicensed under the GNU GPL.


Core Features

CPU

All official instructions of the NES' CPU, the 2A03, which is compatible(mostly) with the 6502, are emulated. "Unofficial" instructions are also emulated, though probably not as accurately as the more well-defined official instructions.


PPU

  • 8x8 and 8x16 sprites.
  • Sprite hit emulation(including checking the bg color).
  • 8 sprite limit(and flag emulation).
  • Screen/Sprite disabling, with correct color replacement.
  • Color deemphasis(probably not 100% correct, more research is needed).
  • Strip colorburst bit emulated.
  • CPU-instruction granularity for special mid-scanline effects(mostly CHR switching, such as used in "Pirates!", "Marble Madness", and "Mother").

Palettes

FCE Ultra has many palette features, including loading a custom palette to replace the default NES palette. The palette from an NTSC NES can also be generated on-the-fly.

First, a note on on the format of external palettes; Palette files are expected to contain 64 8-bit RGB triplets(each in that order; red comes first in the triplet in the file, then green, then blue). Each 8-bit value represents brightness for that particular color. 0 is minimum, 255 is maximum.

Palettes can be set on a per-game basis. To do this, put a palette file in the "gameinfo" directory with the same base filename as the game you wish to associate with and add the extension "pal". Examples:

        
                File name:              Palette file name:
                 BigBad.nes              BigBad.pal
                 BigBad.zip              BigBad.pal
                 BigBad.Better.nes       BigBad.Better.pal
	

With so many ways to choose a palette, figuring out which one will be active may be difficult. Here's a list of what palettes will be used, in order from highest priority to least priority(if a condition doesn't exist for a higher priority palette, the emulator will continue down its list of palettes).

  • NSF Palette(for NSFs only)
  • Palette loaded from the "gameinfo" directory.
  • NTSC Color Emulation(only for NTSC NES games).
  • VS Unisystem palette(if the game is a VS Unisystem game and a palette is available).
  • Custom global palette.
  • Default NES palette.


Sound

All 5 internal sound channels are supported(2x rectangle, triangle, noise, and DMC/PCM). Sound channels are emulated with CPU instruction granularity. There are two sound quality options. Low-quality sound, the default sound quality option, generates sound data at 16x the playback rate and averages those samples together to 1 sample. This method works fairly well and is reasonably fast, but there is still some aliasing and sound distortion. All sample rates between 8192Hz and 96000Hz are supported.

The high-quality sound emulation is much more CPU intensive, but the quality is worth it, if your machine is fast enough. Sound data is generated at the NES' CPU clock rate(about 1.8MHz for the NTSC NES), and then resampled to the output sample rate. Custom-designed 483rd order Parks-McClellan algorithm filter coefficients are used. Supported playback rates are 44100Hz, 48000Hz, and 96000Hz. The following filter statistics apply for NTSC emulation.

Rate:Passband Upper Bound(Hz):Passband ripple(dB):Transition bandwidth(Hz):Stopband attenuation(dB):
4410011982.50.2010067.566.4
4800013932.50.1010067.560.0
9600030000.00.0118000.0103.0

The "highest" sound quality mode is similar to the normal high-quality mode, but the filters are of a higher order(1024 coefficients). Ripple is reduced, the upper bound of the passband is higher, and the stopband attenuation is slightly higher. The highest-quality mode filter coefficients were created using "gmeteor". The parameters used to create these filters can be found in the source code distribution.

Besides the 5 internal NES sound channels, FCE Ultra emulates the extra sound capabilities of the Konami VRCVI, Konami VRCVII, Namco 106, Nintendo MMC5, and the Sunsoft FME-07 chips. The extra sound channel in the Famicom Disk System is also emulated, but the support for its FM capabilities is limited.


Input

FCE Ultra emulates the standard NES gamepad, the Four-Score multiplayer adapter, the Zapper, the Power Pad, and the Arkanoid controller. The Famicom version of the Arkanoid controller, the "Space Shadow" gun, the Famicom 4-player adapter, the Family Keyboard, the HyperShot controller, the Mahjong controller, the Oeka Kids tablet, the Quiz King buzzers, the Family Trainer, and the Barcode World barcode reader are also emulated.

Zapper

Most Zapper NES games expect the Zapper to be plugged into port 2. and most VS Unisystem games expect the Zapper to be plugged into port 1.

The left mouse button is the emulated trigger button for the Zapper. The right mouse button is also emulated as the trigger, but as long as you have the right mouse button held down, no color detection will take place, which is effectively like pulling the trigger while the Zapper is pointed away from the television screen. Note that you must hold the right button down for a short time to have the desired effect.


File Formats/Expansion Hardware

FCE Ultra supports the iNES, FDS(raw and with a header), UNIF, and NSF file formats. FDS ROM images in the iNES format are not supported; it would be silly to do so and storing them in that format is nonsensical.

FCE Ultra supports loading ROM/disk images from some types of compressed files. FCE Ultra can load data from both PKZIP-format files and gzip-format files. Only the "deflate" algorithm is supported, but this is the most widely used algorithm for these formats.

All files in a PKZIP format archive will be scanned for the followings extensions: .nes, .fds, .nsf, .unf, .nez, .unif The first archived file to have one of these extensions will be loaded. If no archived file has one of these extensions, the first archived file will be loaded.

iNES Format

The battery-backed RAM, vertical/horizontal mirroring, four-screen name table layout, and 8-bit mapper number capabilities of the iNES format are supported. The 512-byte trainer capability is also supported, but it is deprecated. Common header corruption conditions are cleaned(let's go on a DiskDude hunt), though not all conditions can be automatically detected and fixed. In addition, a few common header inaccuracies for games are also corrected(detected by CRC32 value). Note that these fixes are not written back to the storage medium.

Support for the recent VS System bit and "number of 8kB RAM banks" is not implemented. Too many iNES headers are corrupt where this new data is stored, causing problems for those games.

The following table lists iNES-format "mappers" supported well in FCE Ultra.

Number:Description:Game Examples:
0No bankswitchingDonkey Kong, Mario Bros
1Nintendo MMC1MegaMan 2, Final Fantasy
2Simple 16KB PROM Switch(UNROM)MegaMan, Archon, 1944
3Simple 8KB VROM Switch(CNROM)Spy Hunter, Gradius
4Nintendo MMC3Super Mario Bros. 3, Recca, Final Fantasy 3
5Nintendo MMC5Castlevania 3, Just Breed, Bandit Kings of Ancient China
6FFE F4 Series(hacked, bootleg)
7AOROMBattle Toads, Time Lord
8FFE F3 Series(hacked, bootleg)
9Nintendo MMC2Punchout!
10Nintendo MMC4Fire Emblem, Fire Emblem Gaiden
11Color DreamsCrystal Mines, Bible Adventures
12??Dragon Ball Z 5 ("bootleg" original)
13CPROMVideomation
15Multi-cart(bootleg)100-in-1: Contra Function 16
16Bandai ??Dragon Ball Z, SD Gundam Gaiden **EEPROM NOT SUPPORTED
17FFE F8 Series(hacked, bootleg)
18Jaleco SS806Pizza Pop, Plasma Ball
19Namco 106Splatter House, Mappy Kids
21Konami VRC4 2AWaiWai World 2, Ganbare Goemon Gaiden 2
22Konami VRC4 1BTwinbee 3
23Konami VRC2BWaiWai World, Crisis Force
24Konami VRC6Akumajou Densetsu
25Konami VRC4Gradius 2, Bio Miracle:Boku tte Upa
26Konami VRC6 A0-A1 SwapEsper Dream 2, Madara
32IREM G-101Image Fight 2, Perman
33Taito TC0190/TC0350Don Doko Don
34NINA-001 and BNROMImpossible Mission 2, Deadly Towers, Bug Honey
40(bootleg)Super Mario Bros. 2
41Caltron 6-in-1Caltron 6-in-1
42(bootleg)Mario Baby
44Multi-cart(bootleg)Super HiK 7 in 1
45Multi-cart(bootleg)Super 1000000 in 1
46Game StationRumble Station
47NES-QJNintendo World Cup/Super Spike V-Ball
48Taito TC190VFlintstones
49Multi-cart(bootleg)Super HiK 4 in 1
50(bootleg)Super Mario Bros. 2
51Multi-cart(bootleg)11 in 1 Ball Games
52Multi-cart(bootleg)Mario Party 7 in 1
57Multi-cart(bootleg)Game Star GK-54
58Multi-cart(bootleg)68-in-1 Game Star HKX5268
60Multi-cart(bootleg)4 in 1(Reset-selected)
61Multi-cart(bootleg)20 in 1
62Multi-cart(bootleg)Super 700 in 1
64Tengen RAMBO 1Klax, Rolling Thunder, Skull and Crossbones
65IREM H-3001Daiku no Gensan 2
66GNROMSMB/Duck Hunt
67Sunsoft ??Fantasy Zone 2
68Sunsoft ??After Burner 2, Nantetta Baseball
69Sunsoft FME-7Batman: Return of the Joker, Hebereke
70??Kamen Rider Club
71CamericaFire Hawk, Linus Spacehead
72Jaleco ??Pinball Quest
73Konami VRC3Salamander
74Taiwanese MMC3 CHR ROM w/ VRAMSuper Robot Wars 2
75Jaleco SS8805/Konami VRC1Tetsuwan Atom, King Kong 2
76Namco 109Megami Tensei
77IREM ??Napoleon Senki
78Irem 74HC161/32Holy Diver
79NINA-06/NINA-03F15 City War, Krazy Kreatures, Tiles of Fate
80Taito X-005Minelvation Saga
82Taito ??Kyuukyoku Harikiri Stadium - Heisei Gannen Ban
85Konami VRC7Lagrange Point
86Jaleco JF-13More Pro Baseball
87??Argus
88Namco 118Dragon Spirit
89Sunsoft ??Mito Koumon
90??Super Mario World, Mortal Kombat 3, Tekken 2
91??Mari Street Fighter 3 Turbo
92Jaleco ??MOERO Pro Soccer
93??Fantasy Zone
94??Senjou no Ookami
95Namco 118Dragon Buster
96Bandai ??Oeka Kids
97??Kaiketsu Yanchamaru
99VS System 8KB VROM SwitchVS SMB, VS Excite Bike
105NES-EVENTNintendo World Championships
107??Magic Dragon
112AsderSango Fighter, Hwang Di
113MB-91Deathbots
114??The Lion King
115??Yuu Yuu Hakusho Final
117??San Guo Zhi 4
118MMC3-TLSROM/TKSROM BoardYs 3, Goal! 2, NES Play Action Football
119MMC3-TQROM BoardHigh Speed, Pin*Bot
140Jaleco ??Bio Senshi Dan
144??Death Race
151Konami VS System ExpansionVS The Goonies, VS Gradius
152??Arkanoid 2, Saint Seiya Ougon Densetsu
153Bandai ??Famicom Jump 2
154Namco ??Devil Man
155MMC1 w/o normal WRAM disableThe Money Game, Tatakae!! Rahmen Man
156??Buzz and Waldog
157Bandai Datach ??Datach DBZ, Datach SD Gundam Wars, **EEPROM NOT SUPPORTED
158RAMBO 1 DerivativeAlien Syndrome
160(same as mapper 90)(same as mapper 90)
180??Crazy Climber
182??Super Donkey Kong
184??Wing of Madoola, The
189??Thunder Warrior, Street Fighter 2 (Yoko)
193Mega SoftFighting Hero
200Multi-cart(bootleg)1200-in-1
201Multi-cart(bootleg)21-in-1
202Multi-cart(bootleg)150 in 1
203Multi-cart(bootleg)35 in 1
206DEIROMKarnov
207Taito ??Fudou Myouou Den
208??Street Fighter IV (by Gouder)
209(mapper 90 w/ name-table control mode enabled)Shin Samurai Spirits 2, Power Rangers III
210Namco ??Famista '92, Famista '93, Wagyan Land 2
225Multi-cart(bootleg)58-in-1/110-in-1/52 Games
226Multi-cart(bootleg)76-in-1
227Multi-cart(bootleg)1200-in-1
228Action 52Action 52, Cheetahmen 2
229Multi-cart(bootleg)31-in-1
230Multi-cart(bootleg)22 Games
231Multi-cart(bootleg)20-in-1
232BIC-48Quattro Arcade, Quattro Sports
234Multi-cart ??Maxi-15
235Multi-cart(bootleg)Golden Game 150 in 1
240??Gen Ke Le Zhuan, Shen Huo Le Zhuan
242??Wai Xing Zhan Shi
244??Decathalon
246??Fong Shen Ban
248??Bao Qing Tian
249Waixing ????
250??Time Diver Avenger
255Multi-cart(bootleg)115 in 1

UNIF

FCE Ultra supports the following UNIF boards. The prefixes HVC-, NES-, BTL-, and BMC- are omitted, since they are currently ignored in FCE Ultra's UNIF loader.

Group:
Name:Game Examples:
Bootleg:
MARIO1-MALEE2Super Mario Bros. Malee 2
NovelDiamond9999999in1Novel Diamond 999999 in 1
Super24in1SC03Super 24 in 1
Supervision16in1Supervision 16-in-1
Unlicensed:
Sachen-8259ASuper Cartridge Version 1
Sachen-8259BSilver Eagle
Sachen-74LS374NAuto Upturn
SA-016-1MMaster Chu and the Drunkard Hu
SA-72007Sidewinder
SA-72008Jovial Race
SA-0036Mahjong 16
SA-0037Mahjong Trap
TC-U01-1.5MChallenge of the Dragon
8237Pocahontas Part 2
MMC1:
SAROMDragon Warrior
SBROMDance Aerobics
SCROMOrb 3D
SEROMBoulderdash
SGROMDefender of the Crown
SKROMDungeon Magic
SLROMCastlevania 2
SL1ROMSky Shark
SNROMShingen the Ruler
SOROMNobunaga's Ambition
MMC3:
TFROMLegacy of the Wizard
TGROMMegaman 4
TKROMKirby's Adventure
TKSROMYs 3
TLROMSuper Spike V'Ball
TLSROMGoal! 2
TR1ROMGauntlet
TQROMPinbot
TSROMSuper Mario Bros. 3
TVROMRad Racer 2
MMC5:
EKROMGemfire
ELROMCastlevania 3
ETROMNobunaga's Ambition 2
EWROMRomance of the Three Kingdoms 2
MMC6:
HKROMStar Tropics
Nintendo Discrete Logic:
CNROMGotcha
CPROMVideomation
GNROMSuper Mario Bros./Duck Hunt
MHROM
NROM-128Mario Bros.
NROM-256Super Mario Bros.
RROM-128
UNROMMegaman

Famicom Disk System

You will need the FDS BIOS ROM image in the base FCE Ultra directory. It must be named "disksys.rom". FCE Ultra will not load FDS games without this file.

Two types of FDS disk images are supported: disk images with the FWNES-style header, and disk images with no header. The number of sides on headerless disk images is calculated by the total file size, so don't put extraneous data at the end of the file.

If a loaded disk image is written to during emulation, FCE Ultra will store the modified disk image in the save games directory, which is by default "sav" under the base directory.

Game Genie

The Game Genie ROM image is loaded from the file "gg.rom" in the base directory the first time Game Genie emulation is enabled and a ROM image is loaded since the time FCE Ultra has run.

The ROM image may either be the 24592 byte iNES-format image, or the 4352 byte raw ROM image.

Remember that enabling/disabling Game Genie emulation will not take effect until a new game is loaded(this statement shouldn't concern any of the "run once" command-line driven builds).

VS Unisystem

FCE Ultra currently only supports VS Unisystem ROM images in the iNES format. DIP switches and coin insertion are both emulated. The following games are supported, and have palettes provided(though not necessarily 100% accurate or complete):

  • Battle City
  • Castlevania
  • Clu Clu Land
  • Dr. Mario
  • Duck Hunt
  • Excitebike
  • Excitebike (Japanese)
  • Freedom Force
  • Goonies, The
  • Gradius
  • Gumshoe
  • Hogan's Alley
  • Ice Climber
  • Ladies Golf
  • Mach Rider
  • Mach Rider (Japanese)
  • Mighty Bomb Jack (Japanese)
  • Ninja Jajamaru Kun (Japanese)
  • Pinball
  • Pinball (Japanese)
  • Platoon
  • RBI Baseball
  • Slalom
  • Soccer
  • Star Luster
  • Stroke and Match Golf
  • Stroke and Match Golf - Ladies
  • Stroke and Match Golf (Japanese)
  • Super Mario Bros.
  • Super Sky Kid
  • Super Xevious
  • Tetris
  • TKO Boxing
  • Top Gun

Automatic IPS Patching

Place the IPS file in the same directory as the file to load, and name it filename.ips.

        Examples:       Boat.nes - Boat.nes.ips
                        Boat.zip - Boat.zip.ips
                        Boat.nes.gz - Boat.nes.gz.ips
                        Boat     - Boat.ips
        

Some operating systems and environments will hide file extensions. Keep this in mind if you are having trouble.

Patching is supported for all supported formats(iNES, FDS, UNIF, and NSF), but it will probably only be useful for the iNES and FDS formats. UNIF files can't be patched well with the IPS format because they are chunk-based with no fixed offsets.


Using FCE Ultra

Key Assignments

Key(s):Action:
F5Save state.
F7Load state.
0-9Select save state slot.
Shift + F5Record movie.
Shift + F7Play movie.
Shift + 0-9Select movie slot.
F9Save screen snapshot.
F4Hide sprites(toggle).
Shift + F4Hide background data with overscan color(toggle).
Alt + EnterToggle fullscreen mode.
~Temporarily disable speed throttling.
F10Reset.
F11Hard reset(toggle power switch).
F12Exit.

VS Unisystem

Key:Action:
F8Insert coin.
F6Show/Hide dip switches.
1-8Toggle dip switches(when dip switches are shown).

Famicom Disk System

Key:Action:
F6Select disk and disk side.
F8Eject or Insert disk.

Barcode Readers

Key:Action:
0-9Barcode digits(after activating barcode input).
F8Activate barcode input/scan barcode.

Game Pad

These default Game Pad key assignments do not apply to the Win32-native port. See the table below this for the Win32-native port's default game pad mappings.
Key:Button on Emulated Gamepad:
Keypad 2B
Keypad 3A
Enter/ReturnStart
TabSelect
ZDown
WUp
ALeft
SRight

Win32-native Port
Key:Button on Emulated Gamepad:
Left ControlB
Left AltA
Enter/ReturnStart
TabSelect
Cursor DownDown
Cursor UpUp
Cursor LeftLeft
Cursor RightRight

Power Pad

Side B
OP []
KL;'
M,./

Side A
P [
KL;'
,.

Family Keyboard

All emulated keys are mapped to the closest open key on the PC keyboard, with a few exceptions. The emulated "@" key is mapped to the "`"(grave) key, and the emulated "kana" key is mapped to the "Insert" key(in the 3x2 key block above the cursor keys).

To enable or disable Family Keyboard input, press the "Scroll Lock" key. When Family Keyboard input is enabled, FCE Ultra will also attempt to prevent any key presses from being passed to the GUI or system.

HyperShot Controller

RunJump
Controller IQW
Controller IIER

Mahjong Controller

Emulated Mahjong Controller:ABCDEFGHIJKLMN
PC Keyboard:QWERTASDFGHJKL

Emulated Mahjong Controller:SELST?????
PC Keyboard:ZXCVBNM

Quiz King Controller

Emulated Buzzer:123456
PC Keyboard:QWERTY

Command-line

FCE Ultra supports arguments passed on the command line. Arguments are taken in the form of "-parameter value". Some arguments are valueless. Arguments that have both a parameter and a value will be saved in the configuration file, with the exception being the network-play arguments. Please note that most of these arguments are currently not recognized on the Win32-native port.

Argument:Value Type:Default value:Description:
-cpalette xstring0Load a custom global palette from file "x". Specifying "0" will cause FCE Ultra to stop using the custom global palette.
-ntsccol xboolean0If value is true, enable automatic generation and use of an NTSC NES' colors.
-pal xboolean0If value is true, emulate a PAL NES. Otherwise emulate an NTSC NES.
-sound xboolean1If value is true, enable sound emulation and output.
-soundrate xinteger48000Specifies the sound playback rate, in frames per second("Hz").
-soundvol xinteger100Sound volume.
-soundq xboolean0If value is true, enable high-quality sound emulation.
-soundbufsize xinteger24(52 for Win32)Specifies the desired size of the sound buffer, in milliseconds.
-inputcfg xstringConfigure mapping of physical device inputs to a virtual device. Valid values are "gamepad1", "gamepad2", "gamepad3", "gamepad4", "powerpad1", "powerpad2".
-input1 x
and
-input2 x
stringgamepadSelect input device for input port 1 or 2. Valid strings are "none", "gamepad", "zapper", "powerpada", and "powerpadb".
-fcexp xstringnoneSelect Famicom expansion port device. Valid strings are "none", "shadow", "arkanoid", "4player", and "fkb".
-nofs xboolean0If value is true, disable four-score emulation.
-gg xboolean0Enable Game Genie emulation.
-snapname xboolean0If value is true, use an alternate naming scheme(file base and numeric) for screen snapshots.
-frameskip xinteger0Specifies the number of frames to skip(emulation and drawing) for each frame emulated and drawn. The frameskipping code will not work properly with light-gun games, and it may break other games as well, so use it with this knowledge in mind!
-nothrottle xboolean0If value is true, disable the speed throttling that is used when sound emulation is disabled.
-clipsides xboolean0If value is true, clip leftmost and rightmost 8 columns of pixels of the video output.
-slstart xinteger8 First scanline to be rendered in NTSC emulation mode(when PAL emulation is disabled).
-slend xinteger231 Last scanline to be rendered in NTSC emulation mode.
-slstartp xinteger0 First scanline to be rendered in PAL emulation mode.
-slendp xinteger239 Last scanline to be rendered in PAL emulation mode.
Argument:Value Type:Default value:Description:
-opengl xboolean1Enable OpenGL support(if the support has been compiled in).
-openglip xboolean1Use bilinear interpolation when using OpenGL.
-special(-specialfs) xinteger0(0)Use special video scaling filters.
  • 1 = hq2x
  • 2 = Scale2x
  • 3 = hq3x
  • 4 = Scale3x
-stretchx/-stretchy xboolean1/0Stretch to fill surface on x or y axis(fullscreen, only with OpenGL).
-doublebuf xboolean0Request double buffering(note that double buffering or sync-to-vblank may be forcibly enabled by your video drivers).
-xscale(-xscalefs)/
-yscale(-yscalefs)
real2.50(2)/2(2)Specify the scaling factor for each axis. Factors will be truncated to integers when not using OpenGL.
-xres x/-yres yinteger640/480Set the desired horizontal/vertical resolution when in fullscreen mode.
-efx(fs) xinteger0Specify simple special effects, represented by logically ORing constants. 1=scanlines, 2=TV Blur
-fsboolean0Full screen mode.


Game-specific Emulation Hacks

Title:Description:Source code files affected:
KickMaster KickMaster relies on the low-level behavior of the MMC3(PPU A12 low->high transition) to work properly in certain parts. If an IRQ begins at the "normal" time on the last visible scanline(239), the game will crash after beating the second boss and retrieving the item. The hack is simple, to clock the IRQ counter twice on scanline 238. mbshare/mmc3.c
Star Wars (PAL/European Version) This game probably has the same(or similar) problem on FCE Ultra as KickMaster. The hack is to clock the IRQ counter twice on the "dummy" scanline(scanline before the first visible scanline).mbshare/mmc3.c


Credits

Name:Contribution(s):
\Firebug\High-level mapper information.
Andrea MazzoleniScale2x/Scale3x scalers included in FCE Ultra.
BeroOriginal FCE source code.
Brad TaylorNES sound information.
EFXDC PasoFami NES packs, testing.
Fredrik OlsonNES four-player adapter information.
Gilles VollantPKZIP file loading functions.
gorohVarious documents.
Info-ZIPZLIB
Jeremy ChadwickGeneral NES information.
Justin SmithGood stuff.
kevtrisLow-level NES information and sound information.
KiVarious technical information.
Mark KnibbsVarious NES information.
Marat FayzullinGeneral NES information.
Matthew ConteSound information.
Maxim Stepinhq2x and hq3x scalers included in FCE Ultra.
MindRapeDC PasoFami NES packs.
MitsutakaYM2413 emulator.
noriFDS sound information.
QuietustVRC7 sound translation code by The Quietust (quietust at ircN dort org).
rahgaFamicom four-player adapter information.
Sean WhalenNode 99
TheRedEyeROM images, testing.
TyphoonZArchaic Ruins.
...and everyone whose name my mind has misplaced.

fceu-0.98.12/Documentation/cheat.html0000644000175000000620000002740307757447436017332 0ustar joestaff00000000000000 FCE Ultra Cheat Guide

FCE Ultra Cheat Guide

Last updated November 12, 2003
Valid as of FCE Ultra 0.97.4

Table of Contents:


Introduction

FCE Ultra allows cheating by the periodic "patching" of arbitrary addresses in the 6502's memory space with arbitrary values, as well as read substitution. "Read substitution" is the method that would be used on a real NES/Famicom, such as done by the Game Genie and Pro Action Replay. It is required to support GG and PAR codes, but since it is relatively slow when done in emulation, it is not the preferred method when a RAM patch will suffice. Also, in FCE Ultra, read substitution will not work properly with zero-page addressing modes(instructions that operate on RAM at $0000 through $00FF).

The RAM patches are all applied a short time before the emulated vertical blanking period. This detail shouldn't concern most people, though. However, this does mean that cheating with games that use bank-switched RAM may be problematic. Fortunately, such games are not very common(in relation to the total number of NES and Famicom games).

Cheat Files

Cheats are stored in the "cheats" subdirectory under the base FCE Ultra directory. The files are in a simple plain-text format. Each line represents a one-byte memory patch. The format is as follows(text in brackets [] represents optional parameters):

[S][C][:]Address(hex):Value(hex):[Compare value:]Description
Example:
040e:05:Infinite super power.

A colon(:) near the beginning of the line is used to disable the cheat. "S" denotes a cheat that is a read-substitute-style cheat(such as with Game Genie cheats), and a "C" denotes that the cheat has a compare value.


The Windows Interface

All addresses listed in the cheats window are in unsigned 16-bit hexadecimal format and all values in these windows are in an unsigned 8-bit decimal format(the range for values is 0 through 255).

The cheats window contains the list of cheats for the currently loaded game on the right side. Existing cheats can be selected, edited, and updated using the "Update" button.

Cheat Search Interface

The cheat search interface consists of several components: a list of addresses and associated data for a search, several command buttons, and the search parameters.

Each entry in the list is in the format of:

Address:Original Value:Current Value

The address is the location in the 6502's address space, the original value is the value that was stored at this address when the search was reset, and the current value is the value that is currently stored at that address. Selecting an item in this list will automatically cause the "Address" field in the cheat information box on the right side of the window to be updated with the selected address.

The "Reset Search" button resets the search process; all valid addresses are displayed in the cheat list and the data values at those addresses noted.

The "Do Search" buttons performs a search based on the search parameters and removes any non-matching addresses from the address list.

The "Set Original to Current" button sets the remembered original values to the current values. It is like the "Reset Search" button, but it does not affect which addresses are shown in the address list. This command is especially useful when used in conjunction with the "O!=C" search filter.

The "Unhide Excluded" button shows all addresses that are excluded as a result of any previous searches. It is like the "Reset Search" button except that it does not affect the remembered original values.

The numbers assigned the names "V1" and "V2" have different meanings based on which filter is selected. A list of the names of the filters and detailed information on what they do follows("original value" corresponds to the value remembered for a given addres and "current value" is the value currently at that address. Also, if a value is not explicitly said to be shown under a certain condition, then it is obviously excluded.):

"O==V1 && C==V2":

Show the address if the original value is equal to "V1" AND the current value is equal to "V2".

"O==V1 && |O-C|==V2":

Show the address if the original value is equal to "V1" AND the difference between the current value and the original value is equal to "V2".

"|O-C|==V2":

Show the address if the difference between the current value and the original value is equal to "V2".

"O!=C":

Show the address if the original value does not equal the current value.

The following cheat methods/filters automatically perform the function of the "Set Original to Current" button after "Do Search" is pressed.

"Value decreased."

Show the address if the value has decreased.

"Value increased."

Show the address if the value has increased.


Examples

"Mega Man 3" Windows Example

This example will give Mega Man unlimited energy. Immediately after entering the Top Man stage, make your way to the "Add Cheat" window. Push "Reset Search". Go back to playing and move right until the first enemy appears. Allow yourself to be hit twice. Each hit does "2" damage, so you've lost 4 energy bars. Go to the "Add Cheat" window again and select the third filter ("|O-C|==V2") and enter the value 4 next to "V2". Then push "Do Search".

Several addresses will appear in the address list. You can try to find the address you want through trial and error, or you can narrow the results down further. We will do the latter.

Go back to playing MM3 and get hit one more time and make your way back to the "Add Cheat" window. Your damage is now "6". You can probably see which address that contains your life(it is 00A2). If not, change V2 to 6 and push "Do Search" again. This should leave only 00A2.

Select that entry in the address list. Shift your attention to the "Add Cheat" box to the right. Type in a meaningful name and the desired value(156; it was the value when you had no damage, so it's safe to assume it's the maximum value you can use). Push the "Add" button and a new entry will appear in the cheats list. The cheat has been added.

"Over Horizon" Text Interface Example

This example will give you infinite lives in the NTSC(Japanese) version of "Over Horizon".

Start a new game. Notice that when you press "Start" during gameplay, the number of lives you have left is indicated. With no cheating, you start with 3 lives(2 lives left).

Activate the cheat interface immediately after starting a new game. Select the "New Cheats" menu and "Reset Search".

I'll assume that the number of lives left shown in the game is the same number that's stored in RAM. Now, "Do Search". You're going to use the first search filter. For V1, enter the value 2. For V2, enter the same value. This, coupled with the fact that you just reset the search, will allow you to search for a value "absolutely"(as opposed to changes in the value).

Now, "Show Results". When I did it, I received 11 results:

	 1) $0000:002:002
	 2) $001c:002:002
	 3) $001e:002:002
	 4) $009d:002:002
	 5) $00b9:002:002
	 6) $00e3:002:002
	 7) $0405:002:002
	 8) $0406:002:002
	 9) $0695:002:002
	10) $07d5:002:002	
	11) $07f8:002:002

You really can't do much yet(unless you want to spend time doing trial and error cheat additions). Return to the game.

After losing a life, go back to the cheat interface, to the "New Cheats" menu, and "Show Results". Here are my results:

	 1) $0000:002:002
	 2) $001c:002:002
	 3) $001e:002:002
	 4) $009d:002:002
	 5) $00b9:002:041
	 6) $00e3:002:002
	 7) $0405:002:001
	 8) $0406:002:002
	 9) $0695:002:002
	10) $07d5:002:001
	11) $07f8:002:002

Notice that two addresses seem to hold the number of lives($0405 and $07d5). You can lose another life and go "Show Results" again, and you should see that $07d5 is the address that holds the number of lives.

Now that you know the address that holds the number of lives, you can add a cheat. You can either type in the number from the cheat results list corresponding to the address you want to add a cheat for, or you can remember the address and select "Add Cheat" from the "New Cheats" menu. Do the former.

Now you will need to enter a name for the cheat. I suggest something short, but descriptive. "Infinite lives" will work fine. Next, a prompt for the address will show up. Since you selected an item from the list, you can press enter to use the associated address($07d5). Next, you will need to enter a value. It doesn't need to be large(in fact, it probably shouldn't be; abnormally high numbers can cause some games to misbehave). I suggest a value of 2. After this, you should get a prompt that looks like this:

   Add cheat "Infinite lives" for address $07d5 with value 002?(Y/N)[N]:

Answer "Y". You now have infinite lives.


Tips

Games store player information in many different ways. For example, if you have "3" lives in Super Wacky Dodgeball 1989, the game might store it in memory as 2, 3, or 4, or perhaps a different number all together. Also, say that you have 69 life points out of 200 in Mole Mashers. The game might store how many life points you have, or how much damage you have taken. Relative value searches are very valuable because you probably don't know the way that the game stores its player data.

Some games, especially RPGs, deal with individual numbers greater than 8-bits in size. Most that I've seen seem to store the multiple-byte data least significant byte(lower byte of number) first in memory, though conceivably, it could be stored most significant byte first, or the component bytes of the number could be non-contiguous, though the latter is very unlikely. For example, say I have 5304 experience points in Boring Quest for the Overused Plot Device. To split the number into two eight bit decimal numbers, take 5304 %(modulus) 256. This will give a number that is the lower 8 bits. Next, take 5304 / 256. The integral component of your answer will be the upper 8 bits(or the next 8 bits, if the number is or can be larger than 16 bits) of 5304. Now you will need to search for these numbers. Fortunately, most(all?) RPGs seem to store large numbers exactly as they are shown in the game.

fceu-0.98.12/Documentation/faq.html0000644000175000000620000001336110106526312016760 0ustar joestaff00000000000000 FCE Ultra FAQ

FCE Ultra FAQ

Last updated August 11, 2004
Valid as of FCE Ultra 0.98.11

Table of Contents:


General

Why is FCE Ultra so slow?
FCE Ultra is much slower than emulators like LoopyNES and NESA. These emulators are written in assembly, which gives them a definite advantage over FCE Ultra, which is written in C. FCE Ultra is also more accurate that these emulators, and some accuracy can only be achieved by taking more CPU time.

FCE Ultra could be faster than what it is now. However, this is not a high priority. FCE Ultra should run full speed, with sound disabled, on a Pentium 2 300MHz machine, or an "equivalent" processor. I have run *older* versions on Pentium MMX 200MHz machines. Recent versions of gcc produce executables that seem to perform poorly on AMD Athlon processors, so it may be beneficial to download the source code and compile a version of FCE Ultra with CPU-specific optimization flags.

FCE Ultra will perform fastest on older systems(or systems with limited video acceleration) when using an 8BPP video mode. 16BPP video modes come next in terms of speed, followed by 32BPP, and lastly 24BPP. Avoid 24BPP video modes if at all possible.

In MS Windows, while FCE Ultra is in windowed mode, it will perform best with a "desktop" bit-depth setting of 16BPP, as expected.

Emulation

Why do some games make a popping sound(Rad Racer 2, Final Fantasy 3)?
These games do a very crude drum imitation by causing a large jump in the output level for a short period of time via the register at $4011. The analog filters on a real Famicom make it sound decent(better).

I have not completely emulated these filters.

Why don't some NSF rips work correctly on FCE Ultra?
Some NSF rips are bad. Some read from addresses that are not specified in the NSF specifications, expecting certain values to be returned. Others execute undocumented instructions that have no effect on less-accurate software NSF players, but will cause problems on NSF players that emulate these instructions. Also, the playback rate specified in the NSF header is currently ignored, as it is inherently inaccurate.

Some NSF rips neglect to write to $4017, which can cause notes to terminate too quickly and other similar effects. Many Konami NSF rips are affected by this.

Why don't some games work correctly on FCE Ultra?
Many factors can make a game not work on FCE Ultra:
  • If the ROM image is in the iNES format(typically files that have the extension "nes"), its header may be incorrect. This incorrectness may also be because of garbage in the header. Certain utilities used to put text in the reserved bytes of the iNES header, then those reserved bytes were later assigned functions. FCE Ultra recognizes and automatically removes(from the ROM image in RAM, not on the storage medium) SOME header junk. If the game has graphical errors while scrolling, chances are the mirroring is set incorrectly in the header. You can try to edit the header with a utility(such as uCON64) or a hex editor.
  • The on-cart hardware the game uses may not be emulated correctly.
  • Limitations of the ROM image format may prevent a game from being emulated correctly without special code to recognize that game. This occurs quite often with many Koei MMC5(iNES mapper 5) and MMC1(iNES mapper 1) games in the iNES format. FCE Ultra identifies and emulates some of these games based on the ROM CRC32 value.
  • The ROM image may be encrypted. The author of SMYNES seems to have done this intentionally to block other emulators from playing "SMYNES only" games.
Why does Super Mario Bros. start off on level 0?
This happens if you're using a hacked copy of the Super Mario Bros. ROM image. The hacked version is reading from uninitialized RAM, apparently to get the starting level number. This bad copy of SMB was likely extracted from a bootleg multicart, which would have had a menu run before the game started, initializing RAM and setting the starting level.
Why does my hack/translation not work correctly?
If a hack or translation that you made does not work on FCE Ultra, when the original game does, FCE Ultra may be applying header correction based on CRC32 value. These changes are only made to the copy of the game loaded in RAM.

To see what changes have been made, go to "Help->Message Log" on GUI ports. On command-line ports, the information is printed to stdout when the game is loaded. You can then update your hack/translation with the corrected header information. fceu-0.98.12/Documentation/fcm.txt0000644000175000000620000000175710032111720016626 0ustar joestaff00000000000000FCE Ultra Movie File Format - Updated March 22, 2004 The FCM file format is a somewhat "joined" file format. The first part of a FCM file will contain an FCS-format state save. After this data, the FCM-specific data begins, which is being referred to from this point. Currently, the only supported input scheme for a FCM is four joysticks. The FCM data consists of a stream of joystick commands: dLLjjbbb d = Dummy update, if set. Used to reset frame timestamp. LL = timestamp length, in bytes(maximum of 3 bytes). jj = Which joystick(0-3). bbb = Which button(0-7). If the dummy update bit is set, a command can also have occurred. Look at the lower 5 bits: 0 = Just a dummy update. 1 = Reset 2 = Power The timestamp is stored after the joystick command, in LSB-first format. It is the number of frames since the last event. A timestamp length of "0" is valid, to be used when several different buttons need to change state at the same time(same frame, at least). fceu-0.98.12/TODO0000644000175000000620000000416710106031534013203 0ustar joestaff00000000000000The following games are broken to some extent: Crystalis: Mostly working, but the screen jumps around during dialogue. It apparently resets the MMC3 IRQ counter mid-scanline. It'll require low-level PPU and MMC3 IRQ counter emulation to function properly. Kickmaster: IRQ occurs a few CPU cycles too late, interferes with NMI routine, and causes the game to lock up after the second boss. Luckily, there are passwords, at least. *"FIXED" BY HACK* Kyoro Chan Land: Expects a sprite hit to happen, but it has sprite 0 over transparent background. Star Wars(PAL Beam Software version): MMC3 IRQ occurs when it shouldn't, similar to the problem in Kickmaster. *"FIXED" BY HACK* *** General Features: Modify the video blitting/filtering code to run in a separate thread. This should make SMP system owners happy, and it would reduce sound problems due to excessive video processing times(such as what occurs in double buffering). So, after this is implemented, we run a loop that writes sound data to the sound device's buffer. When we run out of data to write, and the video thread isn't finished with the last frame, the current frame's data will be thrown away. Something similar is achieved now by increasing the sound buffer size, and seeing how full it is before even trying to process that frame's video data. Obviously, this increases sound latency. This new method would probably only work well on systems that have small time slices. MS Windows has an API call to achieve that, and Linux 2.6 has small time slices, doesn't it? In any case, I don't think SDL in its current state likes multi-threaded access to video. Bah. Remappable command keys(to multiple keys on the keyboard and a joystick). Fix possible UNIF crashes(if no PRGx or CHRx chunks exist, it may crash, due to changes made in 0.92). *** Emulation: Separate mapper 32 into two separate mappers. Marat was being silly. Figure out what mapper 113 really is. Sound frame count stuff on PAL games(is it correct?). Fix FDS FM sound emulation. Fix Zapper emulation(one version of Chiller still doesn't always work correctly). fceu-0.98.12/Makefile.in0000644000175000000620000003101710112240346014552 0ustar joestaff00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AWK = @AWK@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ PACKAGE = @PACKAGE@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ SUBDIRS = src subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = DIST_SOURCES = RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ Makefile.in NEWS TODO acinclude.m4 aclocal.m4 compile \ config.guess config.sub configure configure.ac depcomp \ install-sh missing mkinstalldirs DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): configure.ac acinclude.m4 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = . distdir = $(PACKAGE)-$(VERSION) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } GZIP_ENV = --best distcleancheck_listfiles = find . -type f -print distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist dist-all: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist $(am__remove_distdir) GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/=build mkdir $(distdir)/=inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ && cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ find $$dc_install_base -type f -print ; \ exit 1; } >&2 ) \ && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ && rm -f $(distdir).tar.gz \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @echo "$(distdir).tar.gz is ready for distribution" | \ sed 'h;s/./=/g;p;x;p;x' distcleancheck: distclean if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf autom4te.cache maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-generic clean-recursive dist dist-all dist-gzip distcheck \ distclean distclean-generic distclean-recursive distclean-tags \ distcleancheck distdir dvi dvi-am dvi-recursive info info-am \ info-recursive install install-am install-data install-data-am \ install-data-recursive install-exec install-exec-am \ install-exec-recursive install-info install-info-am \ install-info-recursive install-man install-recursive \ install-strip installcheck installcheck-am installdirs \ installdirs-am installdirs-recursive maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive mostlyclean \ mostlyclean-generic mostlyclean-recursive tags tags-recursive \ uninstall uninstall-am uninstall-info-am \ uninstall-info-recursive uninstall-recursive # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fceu-0.98.12/configure.ac0000644000175000000620000000561410110503271014774 0ustar joestaff00000000000000AC_INIT([src/fceu.c]) FCEU_VERSION='0.98.12' FCEU_VERSION_NUMERIC=9812 AC_CANONICAL_HOST AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([fceu], $FCEU_VERSION) AC_PROG_CC AC_PROG_CPP AM_PROG_CC_C_O AC_PROG_CXX AC_PROG_CXXCPP AC_PROG_INSTALL AC_DEFINE(_GNU_SOURCE) AC_CHECK_FUNC(asprintf, AC_DEFINE([HAVE_ASPRINTF]), []) dnl Check for zlib AC_CHECK_LIB([z], [zlibVersion],[], AC_MSG_ERROR([*** zlib not found!])) LIBS="$LIBS -lz" AC_ARG_WITH(nativewin32, [AC_HELP_STRING([--with-nativewin32], [use nativewin32])], use_nativewin32=$withval, use_nativewin32="no") AM_CONDITIONAL(WIN32, false) AM_CONDITIONAL(UNIX, false) AM_CONDITIONAL(USE_SEXYAL, false) AM_CONDITIONAL(NATIVEWIN32,false) AM_CONDITIONAL(OPENGL, false) AM_CONDITIONAL(HAVE_GTK, false) AC_DEFINE([NETWORK],[1]) if expr x"$target" : 'x.*beos' > /dev/null; then CFLAGS="-no-fpic $CFLAGS" CPPFLAGS="-no-fpic $CPPFLAGS" AC_DEFINE([PSS_STYLE],[1]) elif expr x"$target" : 'x.*mingw' > /dev/null; then AC_DEFINE([PSS_STYLE],[2]) AC_DEFINE([WIN32]) AM_CONDITIONAL(WIN32, true) if test x$use_nativewin32 = xyes; then LIBS="$LIBS -mwindows -lddraw -ldinput -ldsound -lgdi32 -ldxguid -lwinmm -lshell32 -lwsock32 -lcomdlg32 -lole32" AM_CONDITIONAL(NATIVEWIN32,true) else AM_CONDITIONAL(USE_SEXYAL, true) AC_DEFINE([USE_SEXYAL]) LIBS="$LIBS -ldsound -lwinmm" fi else AM_CONDITIONAL(UNIX, true) AC_DEFINE([UNIX]) AC_DEFINE([PSS_STYLE],[1]) AC_DEFINE([NETWORK],[1]) AC_CHECK_HEADER([sys/soundcard.h], AM_CONDITIONAL(USE_SEXYAL, true) AC_DEFINE([USE_SEXYAL]),[]) fi dnl if expr x"$target" : 'x.*darwin' > /dev/null; then dnl AC_DEFINE([MACOSX]) dnl fi if test x$use_nativewin32 = xno; then dnl Check for SDL SDL_VERSION=1.2.0 AM_PATH_SDL($SDL_VERSION, [:], AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])) LIBS="$LIBS $SDL_LIBS" CFLAGS="-Wall -fomit-frame-pointer $CFLAGS $SDL_CFLAGS" CPPFLAGS="-Wall -fomit-frame-pointer $CPPFLAGS $SDL_CFLAGS" dnl Check for SDL_net for net play HAS_SDL_NET=no dnl AC_CHECK_LIB([SDL_net], [SDLNet_Init],[HAS_SDL_NET=yes]) dnl if test x$HAS_SDL_NET = xyes; then dnl AC_DEFINE([NETWORK]) dnl LIBS="$LIBS -lSDL_net" dnl fi AC_ARG_WITH(opengl, [AC_HELP_STRING([--with-opengl], [use OpenGL])], use_opengl=$withval, use_opengl="no") if [[ "$use_opengl" = "yes" ]] ; then dnl Check for OpenGL AC_CHECK_HEADER([GL/gl.h],[AC_DEFINE([OPENGL]) AM_CONDITIONAL(OPENGL, true)], [ AC_CHECK_HEADER([OpenGL/gl.h],[AC_DEFINE([OPENGL]) AM_CONDITIONAL(OPENGL, true)],[]) AC_DEFINE([APPLEOPENGL]) ]) fi AC_DEFINE([SDL]) fi if expr match "$target_cpu" 'i.86' > /dev/null; then AC_DEFINE([C80x86]) fi AC_C_BIGENDIAN([], [AC_DEFINE([LSB_FIRST])]) AC_DEFINE_UNQUOTED([FCEU_VERSION],"$FCEU_VERSION") AC_DEFINE_UNQUOTED([FCEU_VERSION_NUMERIC],$FCEU_VERSION_NUMERIC) AC_DEFINE(FRAMESKIP) dnl Output Makefiles AC_OUTPUT([Makefile src/Makefile]) fceu-0.98.12/Makefile.am0000644000175000000620000000001607766755010014560 0ustar joestaff00000000000000SUBDIRS = src fceu-0.98.12/configure0000755000175000000620000057240510112240345014426 0ustar joestaff00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="src/fceu.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE CXXCPP WIN32_TRUE WIN32_FALSE UNIX_TRUE UNIX_FALSE USE_SEXYAL_TRUE USE_SEXYAL_FALSE NATIVEWIN32_TRUE NATIVEWIN32_FALSE OPENGL_TRUE OPENGL_FALSE HAVE_GTK_TRUE HAVE_GTK_FALSE EGREP SDL_CONFIG SDL_CFLAGS SDL_LIBS LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} ac_cv_env_CXXCPP_value=$CXXCPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors --disable-sdltest Do not try to compile and run a test SDL program Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-nativewin32 use nativewin32 --with-sdl-prefix=PFX Prefix where SDL is installed (optional) --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional) --with-opengl use OpenGL Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.57. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core core.* *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu FCEU_VERSION='0.98.12' FCEU_VERSION_NUMERIC=9812 ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_target_alias=$target_alias test "x$ac_cv_target_alias" = "x" && ac_cv_target_alias=$ac_cv_host_alias ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- am__api_version="1.6" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # Define the identity of the package. PACKAGE=fceu VERSION=$FCEU_VERSION cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} AMTAR=${AMTAR-"${am_missing_run}tar"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CC_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "x$CC" != xcc; then echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6 fi set dummy $CC; ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest.$ac_objext >&5' if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&5' if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 cat >>confdefs.h <<\_ACEOF #define NO_MINUS_C_MINUS_O 1 _ACEOF fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CXX_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' cat >>confdefs.h <<\_ACEOF #define _GNU_SOURCE 1 _ACEOF echo "$as_me:$LINENO: checking for asprintf" >&5 echo $ECHO_N "checking for asprintf... $ECHO_C" >&6 if test "${ac_cv_func_asprintf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char asprintf (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char asprintf (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_asprintf) || defined (__stub___asprintf) choke me #else char (*f) () = asprintf; #endif #ifdef __cplusplus } #endif int main () { return f != asprintf; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_asprintf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_asprintf=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_asprintf" >&5 echo "${ECHO_T}$ac_cv_func_asprintf" >&6 if test $ac_cv_func_asprintf = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ASPRINTF 1 _ACEOF fi echo "$as_me:$LINENO: checking for zlibVersion in -lz" >&5 echo $ECHO_N "checking for zlibVersion in -lz... $ECHO_C" >&6 if test "${ac_cv_lib_z_zlibVersion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char zlibVersion (); int main () { zlibVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_z_zlibVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_zlibVersion=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_z_zlibVersion" >&5 echo "${ECHO_T}$ac_cv_lib_z_zlibVersion" >&6 if test $ac_cv_lib_z_zlibVersion = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" else { { echo "$as_me:$LINENO: error: *** zlib not found!" >&5 echo "$as_me: error: *** zlib not found!" >&2;} { (exit 1); exit 1; }; } fi LIBS="$LIBS -lz" # Check whether --with-nativewin32 or --without-nativewin32 was given. if test "${with_nativewin32+set}" = set; then withval="$with_nativewin32" use_nativewin32=$withval else use_nativewin32="no" fi; if false; then WIN32_TRUE= WIN32_FALSE='#' else WIN32_TRUE='#' WIN32_FALSE= fi if false; then UNIX_TRUE= UNIX_FALSE='#' else UNIX_TRUE='#' UNIX_FALSE= fi if false; then USE_SEXYAL_TRUE= USE_SEXYAL_FALSE='#' else USE_SEXYAL_TRUE='#' USE_SEXYAL_FALSE= fi if false; then NATIVEWIN32_TRUE= NATIVEWIN32_FALSE='#' else NATIVEWIN32_TRUE='#' NATIVEWIN32_FALSE= fi if false; then OPENGL_TRUE= OPENGL_FALSE='#' else OPENGL_TRUE='#' OPENGL_FALSE= fi if false; then HAVE_GTK_TRUE= HAVE_GTK_FALSE='#' else HAVE_GTK_TRUE='#' HAVE_GTK_FALSE= fi cat >>confdefs.h <<\_ACEOF #define NETWORK 1 _ACEOF if expr x"$target" : 'x.*beos' > /dev/null; then CFLAGS="-no-fpic $CFLAGS" CPPFLAGS="-no-fpic $CPPFLAGS" cat >>confdefs.h <<\_ACEOF #define PSS_STYLE 1 _ACEOF elif expr x"$target" : 'x.*mingw' > /dev/null; then cat >>confdefs.h <<\_ACEOF #define PSS_STYLE 2 _ACEOF cat >>confdefs.h <<\_ACEOF #define WIN32 1 _ACEOF if true; then WIN32_TRUE= WIN32_FALSE='#' else WIN32_TRUE='#' WIN32_FALSE= fi if test x$use_nativewin32 = xyes; then LIBS="$LIBS -mwindows -lddraw -ldinput -ldsound -lgdi32 -ldxguid -lwinmm -lshell32 -lwsock32 -lcomdlg32 -lole32" if true; then NATIVEWIN32_TRUE= NATIVEWIN32_FALSE='#' else NATIVEWIN32_TRUE='#' NATIVEWIN32_FALSE= fi else if true; then USE_SEXYAL_TRUE= USE_SEXYAL_FALSE='#' else USE_SEXYAL_TRUE='#' USE_SEXYAL_FALSE= fi cat >>confdefs.h <<\_ACEOF #define USE_SEXYAL 1 _ACEOF LIBS="$LIBS -ldsound -lwinmm" fi else if true; then UNIX_TRUE= UNIX_FALSE='#' else UNIX_TRUE='#' UNIX_FALSE= fi cat >>confdefs.h <<\_ACEOF #define UNIX 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define PSS_STYLE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define NETWORK 1 _ACEOF echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "${ac_cv_header_sys_soundcard_h+set}" = set; then echo "$as_me:$LINENO: checking for sys/soundcard.h" >&5 echo $ECHO_N "checking for sys/soundcard.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_soundcard_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_soundcard_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_soundcard_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking sys/soundcard.h usability" >&5 echo $ECHO_N "checking sys/soundcard.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking sys/soundcard.h presence" >&5 echo $ECHO_N "checking sys/soundcard.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/soundcard.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for sys/soundcard.h" >&5 echo $ECHO_N "checking for sys/soundcard.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_soundcard_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_soundcard_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_soundcard_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_soundcard_h" >&6 fi if test $ac_cv_header_sys_soundcard_h = yes; then if true; then USE_SEXYAL_TRUE= USE_SEXYAL_FALSE='#' else USE_SEXYAL_TRUE='#' USE_SEXYAL_FALSE= fi cat >>confdefs.h <<\_ACEOF #define USE_SEXYAL 1 _ACEOF fi fi if test x$use_nativewin32 = xno; then SDL_VERSION=1.2.0 # Check whether --with-sdl-prefix or --without-sdl-prefix was given. if test "${with_sdl_prefix+set}" = set; then withval="$with_sdl_prefix" sdl_prefix="$withval" else sdl_prefix="" fi; # Check whether --with-sdl-exec-prefix or --without-sdl-exec-prefix was given. if test "${with_sdl_exec_prefix+set}" = set; then withval="$with_sdl_exec_prefix" sdl_exec_prefix="$withval" else sdl_exec_prefix="" fi; # Check whether --enable-sdltest or --disable-sdltest was given. if test "${enable_sdltest+set}" = set; then enableval="$enable_sdltest" else enable_sdltest=yes fi; if test x$sdl_exec_prefix != x ; then sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix" if test x${SDL_CONFIG+set} != xset ; then SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config fi fi if test x$sdl_prefix != x ; then sdl_args="$sdl_args --prefix=$sdl_prefix" if test x${SDL_CONFIG+set} != xset ; then SDL_CONFIG=$sdl_prefix/bin/sdl-config fi fi # Extract the first word of "sdl-config", so it can be a program name with args. set dummy sdl-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_SDL_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SDL_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_SDL_CONFIG="$SDL_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SDL_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_SDL_CONFIG" && ac_cv_path_SDL_CONFIG="no" ;; esac fi SDL_CONFIG=$ac_cv_path_SDL_CONFIG if test -n "$SDL_CONFIG"; then echo "$as_me:$LINENO: result: $SDL_CONFIG" >&5 echo "${ECHO_T}$SDL_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi min_sdl_version=$SDL_VERSION echo "$as_me:$LINENO: checking for SDL - version >= $min_sdl_version" >&5 echo $ECHO_N "checking for SDL - version >= $min_sdl_version... $ECHO_C" >&6 no_sdl="" if test "$SDL_CONFIG" = "no" ; then no_sdl=yes else SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags` SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs` sdl_major_version=`$SDL_CONFIG $sdl_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_sdltest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" rm -f conf.sdltest if test "$cross_compiling" = yes; then echo $ac_n "cross compiling; assumed OK... $ac_c" else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include char* my_strdup (char *str) { char *new_str; if (str) { new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main (int argc, char *argv[]) { int major, minor, micro; char *tmp_version; /* This hangs on some systems (?) system ("touch conf.sdltest"); */ { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_sdl_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_sdl_version"); exit(1); } if (($sdl_major_version > major) || (($sdl_major_version == major) && ($sdl_minor_version > minor)) || (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) { return 0; } else { printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n"); printf("*** to point to the correct copy of sdl-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) no_sdl=yes fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_sdl" = x ; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 : else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 if test "$SDL_CONFIG" = "no" ; then echo "*** The sdl-config script installed by SDL could not be found" echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the SDL_CONFIG environment variable to the" echo "*** full path to sdl-config." else if test -f conf.sdltest ; then : else echo "*** Could not run SDL test program, checking why..." CFLAGS="$CFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding SDL or finding the wrong" echo "*** version of SDL. If it is not finding SDL, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means SDL was incorrectly installed" echo "*** or that you have moved SDL since it was installed. In the latter case, you" echo "*** may want to edit the sdl-config script: $SDL_CONFIG" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi SDL_CFLAGS="" SDL_LIBS="" { { echo "$as_me:$LINENO: error: *** SDL version $SDL_VERSION not found!" >&5 echo "$as_me: error: *** SDL version $SDL_VERSION not found!" >&2;} { (exit 1); exit 1; }; } fi rm -f conf.sdltest LIBS="$LIBS $SDL_LIBS" CFLAGS="-Wall -fomit-frame-pointer $CFLAGS $SDL_CFLAGS" CPPFLAGS="-Wall -fomit-frame-pointer $CPPFLAGS $SDL_CFLAGS" HAS_SDL_NET=no # Check whether --with-opengl or --without-opengl was given. if test "${with_opengl+set}" = set; then withval="$with_opengl" use_opengl=$withval else use_opengl="no" fi; if [ "$use_opengl" = "yes" ] ; then if test "${ac_cv_header_GL_gl_h+set}" = set; then echo "$as_me:$LINENO: checking for GL/gl.h" >&5 echo $ECHO_N "checking for GL/gl.h... $ECHO_C" >&6 if test "${ac_cv_header_GL_gl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_GL_gl_h" >&5 echo "${ECHO_T}$ac_cv_header_GL_gl_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking GL/gl.h usability" >&5 echo $ECHO_N "checking GL/gl.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking GL/gl.h presence" >&5 echo $ECHO_N "checking GL/gl.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: GL/gl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: GL/gl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: GL/gl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: GL/gl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: GL/gl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: GL/gl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for GL/gl.h" >&5 echo $ECHO_N "checking for GL/gl.h... $ECHO_C" >&6 if test "${ac_cv_header_GL_gl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_GL_gl_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_GL_gl_h" >&5 echo "${ECHO_T}$ac_cv_header_GL_gl_h" >&6 fi if test $ac_cv_header_GL_gl_h = yes; then cat >>confdefs.h <<\_ACEOF #define OPENGL 1 _ACEOF if true; then OPENGL_TRUE= OPENGL_FALSE='#' else OPENGL_TRUE='#' OPENGL_FALSE= fi else if test "${ac_cv_header_OpenGL_gl_h+set}" = set; then echo "$as_me:$LINENO: checking for OpenGL/gl.h" >&5 echo $ECHO_N "checking for OpenGL/gl.h... $ECHO_C" >&6 if test "${ac_cv_header_OpenGL_gl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_OpenGL_gl_h" >&5 echo "${ECHO_T}$ac_cv_header_OpenGL_gl_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking OpenGL/gl.h usability" >&5 echo $ECHO_N "checking OpenGL/gl.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking OpenGL/gl.h presence" >&5 echo $ECHO_N "checking OpenGL/gl.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: OpenGL/gl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: OpenGL/gl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: OpenGL/gl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: OpenGL/gl.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: OpenGL/gl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: OpenGL/gl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: OpenGL/gl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: OpenGL/gl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: OpenGL/gl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: OpenGL/gl.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for OpenGL/gl.h" >&5 echo $ECHO_N "checking for OpenGL/gl.h... $ECHO_C" >&6 if test "${ac_cv_header_OpenGL_gl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_OpenGL_gl_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_OpenGL_gl_h" >&5 echo "${ECHO_T}$ac_cv_header_OpenGL_gl_h" >&6 fi if test $ac_cv_header_OpenGL_gl_h = yes; then cat >>confdefs.h <<\_ACEOF #define OPENGL 1 _ACEOF if true; then OPENGL_TRUE= OPENGL_FALSE='#' else OPENGL_TRUE='#' OPENGL_FALSE= fi fi cat >>confdefs.h <<\_ACEOF #define APPLEOPENGL 1 _ACEOF fi fi cat >>confdefs.h <<\_ACEOF #define SDL 1 _ACEOF fi if expr match "$target_cpu" 'i.86' > /dev/null; then cat >>confdefs.h <<\_ACEOF #define C80x86 1 _ACEOF fi echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 case $ac_cv_c_bigendian in yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; no) cat >>confdefs.h <<\_ACEOF #define LSB_FIRST 1 _ACEOF ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac cat >>confdefs.h <<_ACEOF #define FCEU_VERSION "$FCEU_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define FCEU_VERSION_NUMERIC $FCEU_VERSION_NUMERIC _ACEOF cat >>confdefs.h <<\_ACEOF #define FRAMESKIP 1 _ACEOF ac_config_files="$ac_config_files Makefile src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WIN32_TRUE}" && test -z "${WIN32_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"WIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${UNIX_TRUE}" && test -z "${UNIX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"UNIX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"UNIX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_SEXYAL_TRUE}" && test -z "${USE_SEXYAL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_SEXYAL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_SEXYAL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${NATIVEWIN32_TRUE}" && test -z "${NATIVEWIN32_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"NATIVEWIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"NATIVEWIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${OPENGL_TRUE}" && test -z "${OPENGL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"OPENGL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"OPENGL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_GTK_TRUE}" && test -z "${HAVE_GTK_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_GTK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_GTK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WIN32_TRUE}" && test -z "${WIN32_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"WIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${NATIVEWIN32_TRUE}" && test -z "${NATIVEWIN32_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"NATIVEWIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"NATIVEWIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_SEXYAL_TRUE}" && test -z "${USE_SEXYAL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_SEXYAL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_SEXYAL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${UNIX_TRUE}" && test -z "${UNIX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"UNIX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"UNIX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_SEXYAL_TRUE}" && test -z "${USE_SEXYAL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_SEXYAL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_SEXYAL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${OPENGL_TRUE}" && test -z "${OPENGL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"OPENGL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"OPENGL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${OPENGL_TRUE}" && test -z "${OPENGL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"OPENGL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"OPENGL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.57. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.57, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@target@,$target,;t t s,@target_cpu@,$target_cpu,;t t s,@target_vendor@,$target_vendor,;t t s,@target_os@,$target_os,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@AMTAR@,$AMTAR,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@CPP@,$CPP,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@CXXCPP@,$CXXCPP,;t t s,@WIN32_TRUE@,$WIN32_TRUE,;t t s,@WIN32_FALSE@,$WIN32_FALSE,;t t s,@UNIX_TRUE@,$UNIX_TRUE,;t t s,@UNIX_FALSE@,$UNIX_FALSE,;t t s,@USE_SEXYAL_TRUE@,$USE_SEXYAL_TRUE,;t t s,@USE_SEXYAL_FALSE@,$USE_SEXYAL_FALSE,;t t s,@NATIVEWIN32_TRUE@,$NATIVEWIN32_TRUE,;t t s,@NATIVEWIN32_FALSE@,$NATIVEWIN32_FALSE,;t t s,@OPENGL_TRUE@,$OPENGL_TRUE,;t t s,@OPENGL_FALSE@,$OPENGL_FALSE,;t t s,@HAVE_GTK_TRUE@,$HAVE_GTK_TRUE,;t t s,@HAVE_GTK_FALSE@,$HAVE_GTK_FALSE,;t t s,@EGREP@,$EGREP,;t t s,@SDL_CONFIG@,$SDL_CONFIG,;t t s,@SDL_CFLAGS@,$SDL_CFLAGS,;t t s,@SDL_LIBS@,$SDL_LIBS,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi fceu-0.98.12/acinclude.m40000644000175000000620000003157110032731360014705 0ustar joestaff00000000000000# Configure paths for SDL # Sam Lantinga 9/21/99 # stolen from Manish Singh # stolen back from Frank Belew # stolen from Manish Singh # Shamelessly stolen from Owen Taylor dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS dnl AC_DEFUN(AM_PATH_SDL, [dnl dnl Get the cflags and libraries from the sdl-config script dnl AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], sdl_prefix="$withval", sdl_prefix="") AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)], sdl_exec_prefix="$withval", sdl_exec_prefix="") AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program], , enable_sdltest=yes) if test x$sdl_exec_prefix != x ; then sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix" if test x${SDL_CONFIG+set} != xset ; then SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config fi fi if test x$sdl_prefix != x ; then sdl_args="$sdl_args --prefix=$sdl_prefix" if test x${SDL_CONFIG+set} != xset ; then SDL_CONFIG=$sdl_prefix/bin/sdl-config fi fi AC_PATH_PROG(SDL_CONFIG, sdl-config, no) min_sdl_version=ifelse([$1], ,0.11.0,$1) AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) no_sdl="" if test "$SDL_CONFIG" = "no" ; then no_sdl=yes else SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags` SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs` sdl_major_version=`$SDL_CONFIG $sdl_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_sdltest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" dnl dnl Now check if the installed SDL is sufficiently new. (Also sanity dnl checks the results of sdl-config to some extent dnl rm -f conf.sdltest AC_TRY_RUN([ #include #include #include #include char* my_strdup (char *str) { char *new_str; if (str) { new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main (int argc, char *argv[]) { int major, minor, micro; char *tmp_version; /* This hangs on some systems (?) system ("touch conf.sdltest"); */ { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_sdl_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_sdl_version"); exit(1); } if (($sdl_major_version > major) || (($sdl_major_version == major) && ($sdl_minor_version > minor)) || (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) { return 0; } else { printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n"); printf("*** to point to the correct copy of sdl-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } } ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_sdl" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$SDL_CONFIG" = "no" ; then echo "*** The sdl-config script installed by SDL could not be found" echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the SDL_CONFIG environment variable to the" echo "*** full path to sdl-config." else if test -f conf.sdltest ; then : else echo "*** Could not run SDL test program, checking why..." CFLAGS="$CFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" AC_TRY_LINK([ #include #include ], [ return 0; ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding SDL or finding the wrong" echo "*** version of SDL. If it is not finding SDL, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means SDL was incorrectly installed" echo "*** or that you have moved SDL since it was installed. In the latter case, you" echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi SDL_CFLAGS="" SDL_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(SDL_CFLAGS) AC_SUBST(SDL_LIBS) rm -f conf.sdltest ]) /* Steven G. Johnson and Alejandro Forero Cuervo */ AC_DEFUN([ACX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_SAVE AC_LANG_C acx_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) AC_MSG_RESULT($acx_pthread_ok) if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all. acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # pthread: Linux, etcetera # --thread-safe: KAI C++ case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthread or # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do case $flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; -*) AC_MSG_CHECKING([whether pthreads work with $flag]) PTHREAD_CFLAGS="$flag" ;; *) AC_MSG_CHECKING([for the pthreads library -l$flag]) PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_TRY_LINK([#include ], [pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], [acx_pthread_ok=yes]) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" AC_MSG_RESULT($acx_pthread_ok) if test "x$acx_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$acx_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: threads are created detached by default # and the JOINABLE attribute has a nonstandard name (UNDETACHED). AC_MSG_CHECKING([for joinable pthread attribute]) AC_TRY_LINK([#include ], [int attr=PTHREAD_CREATE_JOINABLE;], ok=PTHREAD_CREATE_JOINABLE, ok=unknown) if test x"$ok" = xunknown; then AC_TRY_LINK([#include ], [int attr=PTHREAD_CREATE_UNDETACHED;], ok=PTHREAD_CREATE_UNDETACHED, ok=unknown) fi if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok, [Define to the necessary symbol if this constant uses a non-standard name on your system.]) fi AC_MSG_RESULT(${ok}) if test x"$ok" = xunknown; then AC_MSG_WARN([we do not know how to create joinable pthreads]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with cc_r AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC}) else PTHREAD_CC="$CC" fi AC_SUBST(PTHREAD_LIBS) AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_CC) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) : else acx_pthread_ok=no $2 fi AC_LANG_RESTORE ])dnl ACX_PTHREAD fceu-0.98.12/autom4te.cache/0002755000175000000620000000000010112240344015307 5ustar joestaff00000000000000fceu-0.98.12/autom4te.cache/requests0000644000175000000620000002265510112240345017116 0ustar joestaff00000000000000# This file was created by autom4te. # It contains the lists of macros which have been traced. # It can be safely removed. @request = ( bless( [ '0', 0, [ '/usr/share/autoconf' ], [ '/usr/share/autoconf/autoconf/autoconf.m4f', 'configure.ac' ], { 'm4_pattern_forbid' => 1, 'AC_C_VOLATILE' => 1, 'AC_TYPE_OFF_T' => 1, 'AC_FUNC_CLOSEDIR_VOID' => 1, 'AC_REPLACE_FNMATCH' => 1, 'AC_PROG_LIBTOOL' => 1, 'AC_FUNC_STAT' => 1, 'AC_FUNC_WAIT3' => 1, 'AC_HEADER_TIME' => 1, 'AC_STRUCT_TM' => 1, 'AM_AUTOMAKE_VERSION' => 1, 'AC_FUNC_LSTAT' => 1, 'AC_FUNC_GETMNTENT' => 1, 'AC_TYPE_MODE_T' => 1, 'AC_CHECK_HEADERS' => 1, 'AC_FUNC_STRTOD' => 1, 'AC_FUNC_STRNLEN' => 1, 'AC_PROG_CXX' => 1, 'AC_PATH_X' => 1, 'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1, 'AC_PROG_AWK' => 1, 'AC_HEADER_STDC' => 1, 'AC_HEADER_MAJOR' => 1, 'AC_FUNC_ERROR_AT_LINE' => 1, 'AC_PROG_GCC_TRADITIONAL' => 1, 'AC_LIBSOURCE' => 1, 'AC_FUNC_MBRTOWC' => 1, 'AC_STRUCT_ST_BLOCKS' => 1, 'AC_TYPE_SIGNAL' => 1, 'AC_TYPE_UID_T' => 1, 'AC_CONFIG_AUX_DIR' => 1, 'AC_PROG_MAKE_SET' => 1, 'm4_pattern_allow' => 1, 'AC_DEFINE_TRACE_LITERAL' => 1, 'AC_FUNC_STRERROR_R' => 1, 'AC_PROG_CC' => 1, 'AC_DECL_SYS_SIGLIST' => 1, 'AC_FUNC_FORK' => 1, 'AC_FUNC_VPRINTF' => 1, 'AC_FUNC_STRCOLL' => 1, 'AC_PROG_YACC' => 1, 'AC_STRUCT_TIMEZONE' => 1, 'AC_INIT' => 1, 'AC_FUNC_CHOWN' => 1, 'AC_FUNC_ALLOCA' => 1, 'AC_SUBST' => 1, 'AC_FUNC_GETPGRP' => 1, 'AC_CANONICAL_HOST' => 1, 'AC_PROG_RANLIB' => 1, 'AC_FUNC_SETPGRP' => 1, 'AM_INIT_AUTOMAKE' => 1, 'AC_CONFIG_SUBDIRS' => 1, 'AC_FUNC_MMAP' => 1, 'AC_FUNC_REALLOC' => 1, 'AC_TYPE_SIZE_T' => 1, 'AC_CHECK_TYPES' => 1, 'AC_CHECK_MEMBERS' => 1, 'AM_MAINTAINER_MODE' => 1, 'AC_FUNC_UTIME_NULL' => 1, 'AC_FUNC_SELECT_ARGTYPES' => 1, 'AC_HEADER_STAT' => 1, 'AC_FUNC_STRFTIME' => 1, 'AC_PROG_CPP' => 1, 'AC_C_INLINE' => 1, 'AC_PROG_LEX' => 1, 'AC_C_CONST' => 1, 'AC_TYPE_PID_T' => 1, 'AC_CONFIG_FILES' => 1, 'include' => 1, 'AC_FUNC_SETVBUF_REVERSED' => 1, 'AC_PROG_INSTALL' => 1, 'AM_GNU_GETTEXT' => 1, 'AC_FUNC_OBSTACK' => 1, 'AC_CHECK_LIB' => 1, 'AC_FUNC_MALLOC' => 1, 'AC_FUNC_GETGROUPS' => 1, 'AC_FUNC_GETLOADAVG' => 1, 'AH_OUTPUT' => 1, 'AC_FUNC_FSEEKO' => 1, 'AM_PROG_CC_C_O' => 1, 'AM_CONDITIONAL' => 1, 'AC_CANONICAL_SYSTEM' => 1, 'AC_FUNC_MKTIME' => 1, 'AC_CONFIG_HEADERS' => 1, 'AC_HEADER_SYS_WAIT' => 1, 'AC_PROG_LN_S' => 1, 'AC_FUNC_MEMCMP' => 1, 'm4_include' => 1, 'AC_HEADER_DIRENT' => 1, 'AC_CHECK_FUNCS' => 1 } ], 'Request' ), bless( [ '1', 1, [ '/usr/share/autoconf' ], [ '/usr/share/autoconf/autoconf/autoconf.m4f', 'aclocal.m4', 'configure.ac' ], { 'm4_pattern_forbid' => 1, 'AC_C_VOLATILE' => 1, 'AC_TYPE_OFF_T' => 1, 'AC_FUNC_CLOSEDIR_VOID' => 1, 'AC_REPLACE_FNMATCH' => 1, 'AC_PROG_LIBTOOL' => 1, 'AC_FUNC_STAT' => 1, 'AC_FUNC_WAIT3' => 1, 'AC_HEADER_TIME' => 1, 'AC_STRUCT_TM' => 1, 'AM_AUTOMAKE_VERSION' => 1, 'AC_FUNC_LSTAT' => 1, 'AC_FUNC_GETMNTENT' => 1, 'AC_TYPE_MODE_T' => 1, 'AC_CHECK_HEADERS' => 1, 'AC_FUNC_STRTOD' => 1, 'AC_FUNC_STRNLEN' => 1, 'AC_PROG_CXX' => 1, 'AC_PATH_X' => 1, 'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1, 'AC_PROG_AWK' => 1, 'AC_HEADER_STDC' => 1, 'AC_HEADER_MAJOR' => 1, 'AC_FUNC_ERROR_AT_LINE' => 1, 'AC_PROG_GCC_TRADITIONAL' => 1, 'AC_LIBSOURCE' => 1, 'AC_FUNC_MBRTOWC' => 1, 'AC_STRUCT_ST_BLOCKS' => 1, 'AC_TYPE_SIGNAL' => 1, 'AC_TYPE_UID_T' => 1, 'AC_CONFIG_AUX_DIR' => 1, 'AC_PROG_MAKE_SET' => 1, 'm4_pattern_allow' => 1, 'AC_DEFINE_TRACE_LITERAL' => 1, 'AC_FUNC_STRERROR_R' => 1, 'AC_PROG_CC' => 1, 'AC_DECL_SYS_SIGLIST' => 1, 'AC_FUNC_FORK' => 1, 'AC_FUNC_VPRINTF' => 1, 'AC_FUNC_STRCOLL' => 1, 'AC_PROG_YACC' => 1, 'AC_STRUCT_TIMEZONE' => 1, 'AC_INIT' => 1, 'AC_FUNC_CHOWN' => 1, 'AC_FUNC_ALLOCA' => 1, 'AC_SUBST' => 1, 'AC_FUNC_GETPGRP' => 1, 'AC_CANONICAL_HOST' => 1, 'AC_PROG_RANLIB' => 1, 'AC_FUNC_SETPGRP' => 1, 'AM_INIT_AUTOMAKE' => 1, 'AC_CONFIG_SUBDIRS' => 1, 'AC_FUNC_MMAP' => 1, 'AC_FUNC_REALLOC' => 1, 'AC_TYPE_SIZE_T' => 1, 'AC_CHECK_TYPES' => 1, 'AC_CHECK_MEMBERS' => 1, 'AM_MAINTAINER_MODE' => 1, 'AC_FUNC_UTIME_NULL' => 1, 'AC_FUNC_SELECT_ARGTYPES' => 1, 'AC_HEADER_STAT' => 1, 'AC_FUNC_STRFTIME' => 1, 'AC_PROG_CPP' => 1, 'AC_C_INLINE' => 1, 'AC_PROG_LEX' => 1, 'AC_C_CONST' => 1, 'AC_TYPE_PID_T' => 1, 'AC_CONFIG_FILES' => 1, 'include' => 1, 'AC_FUNC_SETVBUF_REVERSED' => 1, 'AC_PROG_INSTALL' => 1, 'AM_GNU_GETTEXT' => 1, 'AC_FUNC_OBSTACK' => 1, 'AC_CHECK_LIB' => 1, 'AC_FUNC_MALLOC' => 1, 'AC_FUNC_GETGROUPS' => 1, 'AC_FUNC_GETLOADAVG' => 1, 'AH_OUTPUT' => 1, 'AC_FUNC_FSEEKO' => 1, 'AM_PROG_CC_C_O' => 1, 'AM_CONDITIONAL' => 1, 'AC_CANONICAL_SYSTEM' => 1, 'AC_FUNC_MKTIME' => 1, 'AC_CONFIG_HEADERS' => 1, 'AC_HEADER_SYS_WAIT' => 1, 'AC_PROG_LN_S' => 1, 'AC_FUNC_MEMCMP' => 1, 'm4_include' => 1, 'AC_HEADER_DIRENT' => 1, 'AC_CHECK_FUNCS' => 1 } ], 'Request' ) ); fceu-0.98.12/autom4te.cache/output.00000644000175000000620000037336207766756303017000 0ustar joestaff00000000000000@%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. @%:@ Generated by GNU Autoconf 2.57. @%:@ @%:@ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 @%:@ Free Software Foundation, Inc. @%:@ This configure script is free software; the Free Software Foundation @%:@ gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="fce.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP CXX CXXFLAGS ac_ct_CXX CXXCPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LIB@&t@OBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} ac_cv_env_CXXCPP_value=$CXXCPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.57. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME @%:@@%:@ --------- @%:@@%:@ @%:@@%:@ Platform. @%:@@%:@ @%:@@%:@ --------- @%:@@%:@ hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF @%:@@%:@ ----------- @%:@@%:@ @%:@@%:@ Core tests. @%:@@%:@ @%:@@%:@ ----------- @%:@@%:@ _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX @%:@@%:@ ---------------- @%:@@%:@ @%:@@%:@ Cache variables. @%:@@%:@ @%:@@%:@ ---------------- @%:@@%:@ _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX @%:@@%:@ ----------------- @%:@@%:@ @%:@@%:@ Output variables. @%:@@%:@ @%:@@%:@ ----------------- @%:@@%:@ _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX @%:@@%:@ ------------- @%:@@%:@ @%:@@%:@ Output files. @%:@@%:@ @%:@@%:@ ------------- @%:@@%:@ _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX @%:@@%:@ ----------- @%:@@%:@ @%:@@%:@ confdefs.h. @%:@@%:@ @%:@@%:@ ----------- @%:@@%:@ _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core core.* *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF @%:@define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu PH_VERSION='0.1-pre' PH_VERSION_NUMERIC=1 ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_target_alias=$target_alias test "x$ac_cv_target_alias" = "x" && ac_cv_target_alias=$ac_cv_host_alias ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- AM_INIT_AUTOMAKE(phamicom, $PH_VERSION) ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $@%:@ != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF @%:@ifndef __cplusplus choke me @%:@endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@ifdef __STDC__ @%:@ include @%:@else @%:@ include @%:@endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@ifdef __STDC__ @%:@ include @%:@else @%:@ include @%:@endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu AM_PROG_CC_C_O ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@ifdef __STDC__ @%:@ include @%:@else @%:@ include @%:@endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@ifdef __STDC__ @%:@ include @%:@else @%:@ include @%:@endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' SDL_VERSION=1.2.0 AM_PATH_SDL($SDL_VERSION, :, { { echo "$as_me:$LINENO: error: *** SDL version $SDL_VERSION not found!" >&5 echo "$as_me: error: *** SDL version $SDL_VERSION not found!" >&2;} { (exit 1); exit 1; }; }) LIBS="$LIBS $SDL_LIBS" HAS_SDL_NET=no echo "$as_me:$LINENO: checking for SDLNet_Init in -lSDL_net" >&5 echo $ECHO_N "checking for SDLNet_Init in -lSDL_net... $ECHO_C" >&6 if test "${ac_cv_lib_SDL_net_SDLNet_Init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lSDL_net $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char SDLNet_Init (); int main () { SDLNet_Init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_SDL_net_SDLNet_Init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_SDL_net_SDLNet_Init=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_net_SDLNet_Init" >&5 echo "${ECHO_T}$ac_cv_lib_SDL_net_SDLNet_Init" >&6 if test $ac_cv_lib_SDL_net_SDLNet_Init = yes; then HAS_SDL_NET=yes fi if test x$HAS_SDL_NET = xyes; then cat >>confdefs.h <<\_ACEOF @%:@define NETWORK 1 _ACEOF LIBS="$LIBS -lSDL_net" fi echo "$as_me:$LINENO: checking for zlibVersion in -lz" >&5 echo $ECHO_N "checking for zlibVersion in -lz... $ECHO_C" >&6 if test "${ac_cv_lib_z_zlibVersion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char zlibVersion (); int main () { zlibVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_z_zlibVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_zlibVersion=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_z_zlibVersion" >&5 echo "${ECHO_T}$ac_cv_lib_z_zlibVersion" >&6 if test $ac_cv_lib_z_zlibVersion = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" else { { echo "$as_me:$LINENO: error: *** zlib not found!" >&5 echo "$as_me: error: *** zlib not found!" >&2;} { (exit 1); exit 1; }; } fi LIBS="$LIBS -lz" if expr match "$target_cpu" 'i.86' > /dev/null; then cat >>confdefs.h <<\_ACEOF @%:@define C80x86 1 _ACEOF fi echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 case $ac_cv_c_bigendian in yes) cat >>confdefs.h <<\_ACEOF @%:@define WORDS_BIGENDIAN 1 _ACEOF ;; no) cat >>confdefs.h <<\_ACEOF @%:@define LSB_FIRST 1 _ACEOF ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac cat >>confdefs.h <<\_ACEOF @%:@define SDL 1 _ACEOF cat >>confdefs.h <<\_ACEOF @%:@define ZLIB 1 _ACEOF cat >>confdefs.h <<\_ACEOF @%:@define PS '/' _ACEOF cat >>confdefs.h <<\_ACEOF @%:@define PSS "/" _ACEOF cat >>confdefs.h <<\_ACEOF @%:@define UNIX 1 _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PH_VERSION "$PH_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PH_VERSION_NUMERIC $PH_VERSION_NUMERIC _ACEOF ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIB@&t@OBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX @%:@@%:@ Running $as_me. @%:@@%:@ _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.57. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.57, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@target@,$target,;t t s,@target_cpu@,$target_cpu,;t t s,@target_vendor@,$target_vendor,;t t s,@target_os@,$target_os,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CPP@,$CPP,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@CXXCPP@,$CXXCPP,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@LIB@&t@OBJS@,$LIB@&t@OBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi fceu-0.98.12/autom4te.cache/traces.00000644000175000000620000002000707766756303016702 0ustar joestaff00000000000000m4trace:configure.ac:1: -1- AC_INIT([fce.c]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?A[CHUM]_]) m4trace:configure.ac:1: -1- m4_pattern_forbid([_AC_]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) m4trace:configure.ac:1: -1- m4_pattern_allow([^AS_FLAGS$]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?m4_]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^dnl$]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?AS_]) m4trace:configure.ac:1: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}]) m4trace:configure.ac:1: -1- AC_SUBST([PATH_SEPARATOR]) m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) m4trace:configure.ac:1: -1- AC_SUBST([exec_prefix], [NONE]) m4trace:configure.ac:1: -1- AC_SUBST([prefix], [NONE]) m4trace:configure.ac:1: -1- AC_SUBST([program_transform_name], [s,x,x,]) m4trace:configure.ac:1: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) m4trace:configure.ac:1: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) m4trace:configure.ac:1: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) m4trace:configure.ac:1: -1- AC_SUBST([datadir], ['${prefix}/share']) m4trace:configure.ac:1: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) m4trace:configure.ac:1: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) m4trace:configure.ac:1: -1- AC_SUBST([localstatedir], ['${prefix}/var']) m4trace:configure.ac:1: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) m4trace:configure.ac:1: -1- AC_SUBST([includedir], ['${prefix}/include']) m4trace:configure.ac:1: -1- AC_SUBST([oldincludedir], ['/usr/include']) m4trace:configure.ac:1: -1- AC_SUBST([infodir], ['${prefix}/info']) m4trace:configure.ac:1: -1- AC_SUBST([mandir], ['${prefix}/man']) m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ #undef PACKAGE_NAME]) m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME]) m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ #undef PACKAGE_VERSION]) m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ #undef PACKAGE_STRING]) m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT]) m4trace:configure.ac:1: -1- AC_SUBST([build_alias]) m4trace:configure.ac:1: -1- AC_SUBST([host_alias]) m4trace:configure.ac:1: -1- AC_SUBST([target_alias]) m4trace:configure.ac:1: -1- AC_SUBST([DEFS]) m4trace:configure.ac:1: -1- AC_SUBST([ECHO_C]) m4trace:configure.ac:1: -1- AC_SUBST([ECHO_N]) m4trace:configure.ac:1: -1- AC_SUBST([ECHO_T]) m4trace:configure.ac:1: -1- AC_SUBST([LIBS]) m4trace:configure.ac:6: -1- AC_CANONICAL_HOST m4trace:configure.ac:6: -1- AC_SUBST([build], [$ac_cv_build]) m4trace:configure.ac:6: -1- AC_SUBST([build_cpu], [`echo $ac_cv_build | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`]) m4trace:configure.ac:6: -1- AC_SUBST([build_vendor], [`echo $ac_cv_build | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`]) m4trace:configure.ac:6: -1- AC_SUBST([build_os], [`echo $ac_cv_build | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`]) m4trace:configure.ac:6: -1- AC_SUBST([host], [$ac_cv_host]) m4trace:configure.ac:6: -1- AC_SUBST([host_cpu], [`echo $ac_cv_host | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`]) m4trace:configure.ac:6: -1- AC_SUBST([host_vendor], [`echo $ac_cv_host | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`]) m4trace:configure.ac:6: -1- AC_SUBST([host_os], [`echo $ac_cv_host | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`]) m4trace:configure.ac:7: -1- AC_SUBST([target], [$ac_cv_target]) m4trace:configure.ac:7: -1- AC_SUBST([target_cpu], [`echo $ac_cv_target | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`]) m4trace:configure.ac:7: -1- AC_SUBST([target_vendor], [`echo $ac_cv_target | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`]) m4trace:configure.ac:7: -1- AC_SUBST([target_os], [`echo $ac_cv_target | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`]) m4trace:configure.ac:10: -1- AC_PROG_CC m4trace:configure.ac:10: -1- AC_SUBST([CC]) m4trace:configure.ac:10: -1- AC_SUBST([CFLAGS]) m4trace:configure.ac:10: -1- AC_SUBST([LDFLAGS]) m4trace:configure.ac:10: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.ac:10: -1- AC_SUBST([CC]) m4trace:configure.ac:10: -1- AC_SUBST([ac_ct_CC]) m4trace:configure.ac:10: -1- AC_SUBST([CC]) m4trace:configure.ac:10: -1- AC_SUBST([ac_ct_CC]) m4trace:configure.ac:10: -1- AC_SUBST([CC]) m4trace:configure.ac:10: -1- AC_SUBST([CC]) m4trace:configure.ac:10: -1- AC_SUBST([ac_ct_CC]) m4trace:configure.ac:10: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) m4trace:configure.ac:10: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) m4trace:configure.ac:11: -1- AC_PROG_CPP m4trace:configure.ac:11: -1- AC_SUBST([CPP]) m4trace:configure.ac:11: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.ac:11: -1- AC_SUBST([CPP]) m4trace:configure.ac:13: -1- AC_PROG_CXX m4trace:configure.ac:13: -1- AC_SUBST([CXX]) m4trace:configure.ac:13: -1- AC_SUBST([CXXFLAGS]) m4trace:configure.ac:13: -1- AC_SUBST([LDFLAGS]) m4trace:configure.ac:13: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.ac:13: -1- AC_SUBST([CXX]) m4trace:configure.ac:13: -1- AC_SUBST([ac_ct_CXX]) m4trace:configure.ac:14: -1- AC_SUBST([CXXCPP]) m4trace:configure.ac:14: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.ac:14: -1- AC_SUBST([CXXCPP]) m4trace:configure.ac:15: -1- AC_PROG_INSTALL m4trace:configure.ac:15: -1- AC_SUBST([INSTALL_PROGRAM]) m4trace:configure.ac:15: -1- AC_SUBST([INSTALL_SCRIPT]) m4trace:configure.ac:15: -1- AC_SUBST([INSTALL_DATA]) m4trace:configure.ac:25: -1- AC_CHECK_LIB([SDL_net], [SDLNet_Init], [HAS_SDL_NET=yes]) m4trace:configure.ac:27: -1- AC_DEFINE_TRACE_LITERAL([NETWORK]) m4trace:configure.ac:32: -1- AC_CHECK_LIB([z], [zlibVersion], [], [{ { echo "$as_me:$LINENO: error: *** zlib not found!" >&5 echo "$as_me: error: *** zlib not found!" >&2;} { (exit 1); exit 1; }; }]) m4trace:configure.ac:32: -1- AH_OUTPUT([HAVE_LIBZ], [/* Define to 1 if you have the `z\' library (-lz). */ #undef HAVE_LIBZ]) m4trace:configure.ac:32: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBZ]) m4trace:configure.ac:36: -1- AC_DEFINE_TRACE_LITERAL([C80x86]) m4trace:configure.ac:38: -1- AC_DEFINE_TRACE_LITERAL([WORDS_BIGENDIAN]) m4trace:configure.ac:38: -1- AH_OUTPUT([WORDS_BIGENDIAN], [/* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN]) m4trace:configure.ac:38: -1- AC_DEFINE_TRACE_LITERAL([LSB_FIRST]) m4trace:configure.ac:39: -1- AC_DEFINE_TRACE_LITERAL([SDL]) m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([ZLIB]) m4trace:configure.ac:41: -1- AC_DEFINE_TRACE_LITERAL([PS]) m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([PSS]) m4trace:configure.ac:43: -1- AC_DEFINE_TRACE_LITERAL([UNIX]) m4trace:configure.ac:44: -1- AC_DEFINE_TRACE_LITERAL([PH_VERSION]) m4trace:configure.ac:45: -1- AC_DEFINE_TRACE_LITERAL([PH_VERSION_NUMERIC]) m4trace:configure.ac:48: -1- AC_CONFIG_FILES([Makefile]) m4trace:configure.ac:48: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) m4trace:configure.ac:48: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) fceu-0.98.12/autom4te.cache/output.10000644000175000000620000057401110112240344016737 0ustar joestaff00000000000000@%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. @%:@ Generated by GNU Autoconf 2.57. @%:@ @%:@ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 @%:@ Free Software Foundation, Inc. @%:@ This configure script is free software; the Free Software Foundation @%:@ gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="src/fceu.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE CXXCPP WIN32_TRUE WIN32_FALSE UNIX_TRUE UNIX_FALSE USE_SEXYAL_TRUE USE_SEXYAL_FALSE NATIVEWIN32_TRUE NATIVEWIN32_FALSE OPENGL_TRUE OPENGL_FALSE HAVE_GTK_TRUE HAVE_GTK_FALSE EGREP SDL_CONFIG SDL_CFLAGS SDL_LIBS LIB@&t@OBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} ac_cv_env_CXXCPP_value=$CXXCPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors --disable-sdltest Do not try to compile and run a test SDL program Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-nativewin32 use nativewin32 --with-sdl-prefix=PFX Prefix where SDL is installed (optional) --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional) --with-opengl use OpenGL Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.57. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME @%:@@%:@ --------- @%:@@%:@ @%:@@%:@ Platform. @%:@@%:@ @%:@@%:@ --------- @%:@@%:@ hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF @%:@@%:@ ----------- @%:@@%:@ @%:@@%:@ Core tests. @%:@@%:@ @%:@@%:@ ----------- @%:@@%:@ _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX @%:@@%:@ ---------------- @%:@@%:@ @%:@@%:@ Cache variables. @%:@@%:@ @%:@@%:@ ---------------- @%:@@%:@ _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX @%:@@%:@ ----------------- @%:@@%:@ @%:@@%:@ Output variables. @%:@@%:@ @%:@@%:@ ----------------- @%:@@%:@ _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX @%:@@%:@ ------------- @%:@@%:@ @%:@@%:@ Output files. @%:@@%:@ @%:@@%:@ ------------- @%:@@%:@ _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX @%:@@%:@ ----------- @%:@@%:@ @%:@@%:@ confdefs.h. @%:@@%:@ @%:@@%:@ ----------- @%:@@%:@ _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core core.* *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF @%:@define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu FCEU_VERSION='0.98.12' FCEU_VERSION_NUMERIC=9812 ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_target_alias=$target_alias test "x$ac_cv_target_alias" = "x" && ac_cv_target_alias=$ac_cv_host_alias ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- am__api_version="1.6" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # Define the identity of the package. PACKAGE=fceu VERSION=$FCEU_VERSION cat >>confdefs.h <<_ACEOF @%:@define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} AMTAR=${AMTAR-"${am_missing_run}tar"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $@%:@ != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF @%:@ifndef __cplusplus choke me @%:@endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CC_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@ifdef __STDC__ @%:@ include @%:@else @%:@ include @%:@endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@ifdef __STDC__ @%:@ include @%:@else @%:@ include @%:@endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "x$CC" != xcc; then echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6 fi set dummy $CC; ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest.$ac_objext >&5' if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&5' if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 cat >>confdefs.h <<\_ACEOF @%:@define NO_MINUS_C_MINUS_O 1 _ACEOF fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CXX_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@ifdef __STDC__ @%:@ include @%:@else @%:@ include @%:@endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@ifdef __STDC__ @%:@ include @%:@else @%:@ include @%:@endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' cat >>confdefs.h <<\_ACEOF @%:@define _GNU_SOURCE 1 _ACEOF echo "$as_me:$LINENO: checking for asprintf" >&5 echo $ECHO_N "checking for asprintf... $ECHO_C" >&6 if test "${ac_cv_func_asprintf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char asprintf (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char asprintf (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_asprintf) || defined (__stub___asprintf) choke me #else char (*f) () = asprintf; #endif #ifdef __cplusplus } #endif int main () { return f != asprintf; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_asprintf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_asprintf=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_asprintf" >&5 echo "${ECHO_T}$ac_cv_func_asprintf" >&6 if test $ac_cv_func_asprintf = yes; then cat >>confdefs.h <<\_ACEOF @%:@define HAVE_ASPRINTF 1 _ACEOF fi echo "$as_me:$LINENO: checking for zlibVersion in -lz" >&5 echo $ECHO_N "checking for zlibVersion in -lz... $ECHO_C" >&6 if test "${ac_cv_lib_z_zlibVersion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char zlibVersion (); int main () { zlibVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_z_zlibVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_zlibVersion=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_z_zlibVersion" >&5 echo "${ECHO_T}$ac_cv_lib_z_zlibVersion" >&6 if test $ac_cv_lib_z_zlibVersion = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" else { { echo "$as_me:$LINENO: error: *** zlib not found!" >&5 echo "$as_me: error: *** zlib not found!" >&2;} { (exit 1); exit 1; }; } fi LIBS="$LIBS -lz" # Check whether --with-nativewin32 or --without-nativewin32 was given. if test "${with_nativewin32+set}" = set; then withval="$with_nativewin32" use_nativewin32=$withval else use_nativewin32="no" fi; if false; then WIN32_TRUE= WIN32_FALSE='#' else WIN32_TRUE='#' WIN32_FALSE= fi if false; then UNIX_TRUE= UNIX_FALSE='#' else UNIX_TRUE='#' UNIX_FALSE= fi if false; then USE_SEXYAL_TRUE= USE_SEXYAL_FALSE='#' else USE_SEXYAL_TRUE='#' USE_SEXYAL_FALSE= fi if false; then NATIVEWIN32_TRUE= NATIVEWIN32_FALSE='#' else NATIVEWIN32_TRUE='#' NATIVEWIN32_FALSE= fi if false; then OPENGL_TRUE= OPENGL_FALSE='#' else OPENGL_TRUE='#' OPENGL_FALSE= fi if false; then HAVE_GTK_TRUE= HAVE_GTK_FALSE='#' else HAVE_GTK_TRUE='#' HAVE_GTK_FALSE= fi cat >>confdefs.h <<\_ACEOF @%:@define NETWORK 1 _ACEOF if expr x"$target" : 'x.*beos' > /dev/null; then CFLAGS="-no-fpic $CFLAGS" CPPFLAGS="-no-fpic $CPPFLAGS" cat >>confdefs.h <<\_ACEOF @%:@define PSS_STYLE 1 _ACEOF elif expr x"$target" : 'x.*mingw' > /dev/null; then cat >>confdefs.h <<\_ACEOF @%:@define PSS_STYLE 2 _ACEOF cat >>confdefs.h <<\_ACEOF @%:@define WIN32 1 _ACEOF if true; then WIN32_TRUE= WIN32_FALSE='#' else WIN32_TRUE='#' WIN32_FALSE= fi if test x$use_nativewin32 = xyes; then LIBS="$LIBS -mwindows -lddraw -ldinput -ldsound -lgdi32 -ldxguid -lwinmm -lshell32 -lwsock32 -lcomdlg32 -lole32" if true; then NATIVEWIN32_TRUE= NATIVEWIN32_FALSE='#' else NATIVEWIN32_TRUE='#' NATIVEWIN32_FALSE= fi else if true; then USE_SEXYAL_TRUE= USE_SEXYAL_FALSE='#' else USE_SEXYAL_TRUE='#' USE_SEXYAL_FALSE= fi cat >>confdefs.h <<\_ACEOF @%:@define USE_SEXYAL 1 _ACEOF LIBS="$LIBS -ldsound -lwinmm" fi else if true; then UNIX_TRUE= UNIX_FALSE='#' else UNIX_TRUE='#' UNIX_FALSE= fi cat >>confdefs.h <<\_ACEOF @%:@define UNIX 1 _ACEOF cat >>confdefs.h <<\_ACEOF @%:@define PSS_STYLE 1 _ACEOF cat >>confdefs.h <<\_ACEOF @%:@define NETWORK 1 _ACEOF echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @%:@define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default @%:@include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "${ac_cv_header_sys_soundcard_h+set}" = set; then echo "$as_me:$LINENO: checking for sys/soundcard.h" >&5 echo $ECHO_N "checking for sys/soundcard.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_soundcard_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_soundcard_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_soundcard_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking sys/soundcard.h usability" >&5 echo $ECHO_N "checking sys/soundcard.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default @%:@include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking sys/soundcard.h presence" >&5 echo $ECHO_N "checking sys/soundcard.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX @%:@@%:@ ------------------------------------ @%:@@%:@ @%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@ @%:@@%:@ ------------------------------------ @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/soundcard.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX @%:@@%:@ ------------------------------------ @%:@@%:@ @%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@ @%:@@%:@ ------------------------------------ @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for sys/soundcard.h" >&5 echo $ECHO_N "checking for sys/soundcard.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_soundcard_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_soundcard_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_soundcard_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_soundcard_h" >&6 fi if test $ac_cv_header_sys_soundcard_h = yes; then if true; then USE_SEXYAL_TRUE= USE_SEXYAL_FALSE='#' else USE_SEXYAL_TRUE='#' USE_SEXYAL_FALSE= fi cat >>confdefs.h <<\_ACEOF @%:@define USE_SEXYAL 1 _ACEOF fi fi if test x$use_nativewin32 = xno; then SDL_VERSION=1.2.0 # Check whether --with-sdl-prefix or --without-sdl-prefix was given. if test "${with_sdl_prefix+set}" = set; then withval="$with_sdl_prefix" sdl_prefix="$withval" else sdl_prefix="" fi; # Check whether --with-sdl-exec-prefix or --without-sdl-exec-prefix was given. if test "${with_sdl_exec_prefix+set}" = set; then withval="$with_sdl_exec_prefix" sdl_exec_prefix="$withval" else sdl_exec_prefix="" fi; # Check whether --enable-sdltest or --disable-sdltest was given. if test "${enable_sdltest+set}" = set; then enableval="$enable_sdltest" else enable_sdltest=yes fi; if test x$sdl_exec_prefix != x ; then sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix" if test x${SDL_CONFIG+set} != xset ; then SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config fi fi if test x$sdl_prefix != x ; then sdl_args="$sdl_args --prefix=$sdl_prefix" if test x${SDL_CONFIG+set} != xset ; then SDL_CONFIG=$sdl_prefix/bin/sdl-config fi fi # Extract the first word of "sdl-config", so it can be a program name with args. set dummy sdl-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_SDL_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SDL_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_SDL_CONFIG="$SDL_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SDL_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_SDL_CONFIG" && ac_cv_path_SDL_CONFIG="no" ;; esac fi SDL_CONFIG=$ac_cv_path_SDL_CONFIG if test -n "$SDL_CONFIG"; then echo "$as_me:$LINENO: result: $SDL_CONFIG" >&5 echo "${ECHO_T}$SDL_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi min_sdl_version=$SDL_VERSION echo "$as_me:$LINENO: checking for SDL - version >= $min_sdl_version" >&5 echo $ECHO_N "checking for SDL - version >= $min_sdl_version... $ECHO_C" >&6 no_sdl="" if test "$SDL_CONFIG" = "no" ; then no_sdl=yes else SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags` SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs` sdl_major_version=`$SDL_CONFIG $sdl_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_sdltest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" rm -f conf.sdltest if test "$cross_compiling" = yes; then echo $ac_n "cross compiling; assumed OK... $ac_c" else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include char* my_strdup (char *str) { char *new_str; if (str) { new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main (int argc, char *argv[]) { int major, minor, micro; char *tmp_version; /* This hangs on some systems (?) system ("touch conf.sdltest"); */ { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_sdl_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_sdl_version"); exit(1); } if (($sdl_major_version > major) || (($sdl_major_version == major) && ($sdl_minor_version > minor)) || (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) { return 0; } else { printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n"); printf("*** to point to the correct copy of sdl-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) no_sdl=yes fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_sdl" = x ; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 : else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 if test "$SDL_CONFIG" = "no" ; then echo "*** The sdl-config script installed by SDL could not be found" echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the SDL_CONFIG environment variable to the" echo "*** full path to sdl-config." else if test -f conf.sdltest ; then : else echo "*** Could not run SDL test program, checking why..." CFLAGS="$CFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding SDL or finding the wrong" echo "*** version of SDL. If it is not finding SDL, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means SDL was incorrectly installed" echo "*** or that you have moved SDL since it was installed. In the latter case, you" echo "*** may want to edit the sdl-config script: $SDL_CONFIG" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi SDL_CFLAGS="" SDL_LIBS="" { { echo "$as_me:$LINENO: error: *** SDL version $SDL_VERSION not found!" >&5 echo "$as_me: error: *** SDL version $SDL_VERSION not found!" >&2;} { (exit 1); exit 1; }; } fi rm -f conf.sdltest LIBS="$LIBS $SDL_LIBS" CFLAGS="-Wall -fomit-frame-pointer $CFLAGS $SDL_CFLAGS" CPPFLAGS="-Wall -fomit-frame-pointer $CPPFLAGS $SDL_CFLAGS" HAS_SDL_NET=no # Check whether --with-opengl or --without-opengl was given. if test "${with_opengl+set}" = set; then withval="$with_opengl" use_opengl=$withval else use_opengl="no" fi; if [ "$use_opengl" = "yes" ] ; then if test "${ac_cv_header_GL_gl_h+set}" = set; then echo "$as_me:$LINENO: checking for GL/gl.h" >&5 echo $ECHO_N "checking for GL/gl.h... $ECHO_C" >&6 if test "${ac_cv_header_GL_gl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_GL_gl_h" >&5 echo "${ECHO_T}$ac_cv_header_GL_gl_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking GL/gl.h usability" >&5 echo $ECHO_N "checking GL/gl.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default @%:@include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking GL/gl.h presence" >&5 echo $ECHO_N "checking GL/gl.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: GL/gl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: GL/gl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX @%:@@%:@ ------------------------------------ @%:@@%:@ @%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@ @%:@@%:@ ------------------------------------ @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: GL/gl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: GL/gl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: GL/gl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: GL/gl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX @%:@@%:@ ------------------------------------ @%:@@%:@ @%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@ @%:@@%:@ ------------------------------------ @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for GL/gl.h" >&5 echo $ECHO_N "checking for GL/gl.h... $ECHO_C" >&6 if test "${ac_cv_header_GL_gl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_GL_gl_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_GL_gl_h" >&5 echo "${ECHO_T}$ac_cv_header_GL_gl_h" >&6 fi if test $ac_cv_header_GL_gl_h = yes; then cat >>confdefs.h <<\_ACEOF @%:@define OPENGL 1 _ACEOF if true; then OPENGL_TRUE= OPENGL_FALSE='#' else OPENGL_TRUE='#' OPENGL_FALSE= fi else if test "${ac_cv_header_OpenGL_gl_h+set}" = set; then echo "$as_me:$LINENO: checking for OpenGL/gl.h" >&5 echo $ECHO_N "checking for OpenGL/gl.h... $ECHO_C" >&6 if test "${ac_cv_header_OpenGL_gl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_OpenGL_gl_h" >&5 echo "${ECHO_T}$ac_cv_header_OpenGL_gl_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking OpenGL/gl.h usability" >&5 echo $ECHO_N "checking OpenGL/gl.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default @%:@include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking OpenGL/gl.h presence" >&5 echo $ECHO_N "checking OpenGL/gl.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: OpenGL/gl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: OpenGL/gl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: OpenGL/gl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: OpenGL/gl.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX @%:@@%:@ ------------------------------------ @%:@@%:@ @%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@ @%:@@%:@ ------------------------------------ @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: OpenGL/gl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: OpenGL/gl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: OpenGL/gl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: OpenGL/gl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: OpenGL/gl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: OpenGL/gl.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX @%:@@%:@ ------------------------------------ @%:@@%:@ @%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@ @%:@@%:@ ------------------------------------ @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for OpenGL/gl.h" >&5 echo $ECHO_N "checking for OpenGL/gl.h... $ECHO_C" >&6 if test "${ac_cv_header_OpenGL_gl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_OpenGL_gl_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_OpenGL_gl_h" >&5 echo "${ECHO_T}$ac_cv_header_OpenGL_gl_h" >&6 fi if test $ac_cv_header_OpenGL_gl_h = yes; then cat >>confdefs.h <<\_ACEOF @%:@define OPENGL 1 _ACEOF if true; then OPENGL_TRUE= OPENGL_FALSE='#' else OPENGL_TRUE='#' OPENGL_FALSE= fi fi cat >>confdefs.h <<\_ACEOF @%:@define APPLEOPENGL 1 _ACEOF fi fi cat >>confdefs.h <<\_ACEOF @%:@define SDL 1 _ACEOF fi if expr match "$target_cpu" 'i.86' > /dev/null; then cat >>confdefs.h <<\_ACEOF @%:@define C80x86 1 _ACEOF fi echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 case $ac_cv_c_bigendian in yes) cat >>confdefs.h <<\_ACEOF @%:@define WORDS_BIGENDIAN 1 _ACEOF ;; no) cat >>confdefs.h <<\_ACEOF @%:@define LSB_FIRST 1 _ACEOF ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac cat >>confdefs.h <<_ACEOF @%:@define FCEU_VERSION "$FCEU_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define FCEU_VERSION_NUMERIC $FCEU_VERSION_NUMERIC _ACEOF cat >>confdefs.h <<\_ACEOF @%:@define FRAMESKIP 1 _ACEOF ac_config_files="$ac_config_files Makefile src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIB@&t@OBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WIN32_TRUE}" && test -z "${WIN32_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"WIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${UNIX_TRUE}" && test -z "${UNIX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"UNIX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"UNIX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_SEXYAL_TRUE}" && test -z "${USE_SEXYAL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_SEXYAL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_SEXYAL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${NATIVEWIN32_TRUE}" && test -z "${NATIVEWIN32_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"NATIVEWIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"NATIVEWIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${OPENGL_TRUE}" && test -z "${OPENGL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"OPENGL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"OPENGL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_GTK_TRUE}" && test -z "${HAVE_GTK_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_GTK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_GTK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WIN32_TRUE}" && test -z "${WIN32_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"WIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${NATIVEWIN32_TRUE}" && test -z "${NATIVEWIN32_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"NATIVEWIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"NATIVEWIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_SEXYAL_TRUE}" && test -z "${USE_SEXYAL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_SEXYAL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_SEXYAL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${UNIX_TRUE}" && test -z "${UNIX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"UNIX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"UNIX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_SEXYAL_TRUE}" && test -z "${USE_SEXYAL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_SEXYAL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_SEXYAL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${OPENGL_TRUE}" && test -z "${OPENGL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"OPENGL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"OPENGL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${OPENGL_TRUE}" && test -z "${OPENGL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"OPENGL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"OPENGL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX @%:@@%:@ Running $as_me. @%:@@%:@ _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.57. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.57, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@target@,$target,;t t s,@target_cpu@,$target_cpu,;t t s,@target_vendor@,$target_vendor,;t t s,@target_os@,$target_os,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@AMTAR@,$AMTAR,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@CPP@,$CPP,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@CXXCPP@,$CXXCPP,;t t s,@WIN32_TRUE@,$WIN32_TRUE,;t t s,@WIN32_FALSE@,$WIN32_FALSE,;t t s,@UNIX_TRUE@,$UNIX_TRUE,;t t s,@UNIX_FALSE@,$UNIX_FALSE,;t t s,@USE_SEXYAL_TRUE@,$USE_SEXYAL_TRUE,;t t s,@USE_SEXYAL_FALSE@,$USE_SEXYAL_FALSE,;t t s,@NATIVEWIN32_TRUE@,$NATIVEWIN32_TRUE,;t t s,@NATIVEWIN32_FALSE@,$NATIVEWIN32_FALSE,;t t s,@OPENGL_TRUE@,$OPENGL_TRUE,;t t s,@OPENGL_FALSE@,$OPENGL_FALSE,;t t s,@HAVE_GTK_TRUE@,$HAVE_GTK_TRUE,;t t s,@HAVE_GTK_FALSE@,$HAVE_GTK_FALSE,;t t s,@EGREP@,$EGREP,;t t s,@SDL_CONFIG@,$SDL_CONFIG,;t t s,@SDL_CFLAGS@,$SDL_CFLAGS,;t t s,@SDL_LIBS@,$SDL_LIBS,;t t s,@LIB@&t@OBJS@,$LIB@&t@OBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi grep '^DEP_FILES *= *[^ @%:@]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi fceu-0.98.12/autom4te.cache/traces.10000644000175000000620000003610210112240344016652 0ustar joestaff00000000000000m4trace:aclocal.m4:408: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) m4trace:configure.ac:1: -1- AC_INIT([src/fceu.c]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?A[CHUM]_]) m4trace:configure.ac:1: -1- m4_pattern_forbid([_AC_]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) m4trace:configure.ac:1: -1- m4_pattern_allow([^AS_FLAGS$]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?m4_]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^dnl$]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?AS_]) m4trace:configure.ac:1: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}]) m4trace:configure.ac:1: -1- AC_SUBST([PATH_SEPARATOR]) m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) m4trace:configure.ac:1: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) m4trace:configure.ac:1: -1- AC_SUBST([exec_prefix], [NONE]) m4trace:configure.ac:1: -1- AC_SUBST([prefix], [NONE]) m4trace:configure.ac:1: -1- AC_SUBST([program_transform_name], [s,x,x,]) m4trace:configure.ac:1: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) m4trace:configure.ac:1: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) m4trace:configure.ac:1: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) m4trace:configure.ac:1: -1- AC_SUBST([datadir], ['${prefix}/share']) m4trace:configure.ac:1: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) m4trace:configure.ac:1: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) m4trace:configure.ac:1: -1- AC_SUBST([localstatedir], ['${prefix}/var']) m4trace:configure.ac:1: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) m4trace:configure.ac:1: -1- AC_SUBST([includedir], ['${prefix}/include']) m4trace:configure.ac:1: -1- AC_SUBST([oldincludedir], ['/usr/include']) m4trace:configure.ac:1: -1- AC_SUBST([infodir], ['${prefix}/info']) m4trace:configure.ac:1: -1- AC_SUBST([mandir], ['${prefix}/man']) m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ #undef PACKAGE_NAME]) m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME]) m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ #undef PACKAGE_VERSION]) m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ #undef PACKAGE_STRING]) m4trace:configure.ac:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) m4trace:configure.ac:1: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT]) m4trace:configure.ac:1: -1- AC_SUBST([build_alias]) m4trace:configure.ac:1: -1- AC_SUBST([host_alias]) m4trace:configure.ac:1: -1- AC_SUBST([target_alias]) m4trace:configure.ac:1: -1- AC_SUBST([DEFS]) m4trace:configure.ac:1: -1- AC_SUBST([ECHO_C]) m4trace:configure.ac:1: -1- AC_SUBST([ECHO_N]) m4trace:configure.ac:1: -1- AC_SUBST([ECHO_T]) m4trace:configure.ac:1: -1- AC_SUBST([LIBS]) m4trace:configure.ac:6: -1- AC_CANONICAL_HOST m4trace:configure.ac:6: -1- AC_SUBST([build], [$ac_cv_build]) m4trace:configure.ac:6: -1- AC_SUBST([build_cpu], [`echo $ac_cv_build | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`]) m4trace:configure.ac:6: -1- AC_SUBST([build_vendor], [`echo $ac_cv_build | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`]) m4trace:configure.ac:6: -1- AC_SUBST([build_os], [`echo $ac_cv_build | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`]) m4trace:configure.ac:6: -1- AC_SUBST([host], [$ac_cv_host]) m4trace:configure.ac:6: -1- AC_SUBST([host_cpu], [`echo $ac_cv_host | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`]) m4trace:configure.ac:6: -1- AC_SUBST([host_vendor], [`echo $ac_cv_host | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`]) m4trace:configure.ac:6: -1- AC_SUBST([host_os], [`echo $ac_cv_host | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`]) m4trace:configure.ac:7: -1- AC_SUBST([target], [$ac_cv_target]) m4trace:configure.ac:7: -1- AC_SUBST([target_cpu], [`echo $ac_cv_target | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`]) m4trace:configure.ac:7: -1- AC_SUBST([target_vendor], [`echo $ac_cv_target | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`]) m4trace:configure.ac:7: -1- AC_SUBST([target_os], [`echo $ac_cv_target | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`]) m4trace:configure.ac:8: -1- AM_INIT_AUTOMAKE([fceu], [$FCEU_VERSION]) m4trace:configure.ac:8: -1- AM_AUTOMAKE_VERSION([1.6.3]) m4trace:configure.ac:8: -1- AC_PROG_INSTALL m4trace:configure.ac:8: -1- AC_SUBST([INSTALL_PROGRAM]) m4trace:configure.ac:8: -1- AC_SUBST([INSTALL_SCRIPT]) m4trace:configure.ac:8: -1- AC_SUBST([INSTALL_DATA]) m4trace:configure.ac:8: -1- AC_SUBST([PACKAGE], [fceu]) m4trace:configure.ac:8: -1- AC_SUBST([VERSION], [$FCEU_VERSION]) m4trace:configure.ac:8: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) m4trace:configure.ac:8: -1- AH_OUTPUT([PACKAGE], [/* Name of package */ #undef PACKAGE]) m4trace:configure.ac:8: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) m4trace:configure.ac:8: -1- AH_OUTPUT([VERSION], [/* Version number of package */ #undef VERSION]) m4trace:configure.ac:8: -1- AC_SUBST([ACLOCAL]) m4trace:configure.ac:8: -1- AC_SUBST([AUTOCONF]) m4trace:configure.ac:8: -1- AC_SUBST([AUTOMAKE]) m4trace:configure.ac:8: -1- AC_SUBST([AUTOHEADER]) m4trace:configure.ac:8: -1- AC_SUBST([MAKEINFO]) m4trace:configure.ac:8: -1- AC_SUBST([AMTAR]) m4trace:configure.ac:8: -1- AC_SUBST([install_sh]) m4trace:configure.ac:8: -1- AC_SUBST([STRIP]) m4trace:configure.ac:8: -1- AC_SUBST([ac_ct_STRIP]) m4trace:configure.ac:8: -1- AC_SUBST([INSTALL_STRIP_PROGRAM]) m4trace:configure.ac:8: -1- AC_PROG_AWK m4trace:configure.ac:8: -1- AC_SUBST([AWK]) m4trace:configure.ac:8: -1- AC_PROG_MAKE_SET m4trace:configure.ac:8: -1- AC_SUBST([SET_MAKE]) m4trace:configure.ac:10: -1- AC_PROG_CC m4trace:configure.ac:10: -1- AC_SUBST([CC]) m4trace:configure.ac:10: -1- AC_SUBST([CFLAGS]) m4trace:configure.ac:10: -1- AC_SUBST([LDFLAGS]) m4trace:configure.ac:10: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.ac:10: -1- AC_SUBST([CC]) m4trace:configure.ac:10: -1- AC_SUBST([ac_ct_CC]) m4trace:configure.ac:10: -1- AC_SUBST([CC]) m4trace:configure.ac:10: -1- AC_SUBST([ac_ct_CC]) m4trace:configure.ac:10: -1- AC_SUBST([CC]) m4trace:configure.ac:10: -1- AC_SUBST([CC]) m4trace:configure.ac:10: -1- AC_SUBST([ac_ct_CC]) m4trace:configure.ac:10: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) m4trace:configure.ac:10: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) m4trace:configure.ac:10: -1- AC_SUBST([DEPDIR]) m4trace:configure.ac:10: -1- AC_SUBST([am__include]) m4trace:configure.ac:10: -1- AC_SUBST([am__quote]) m4trace:configure.ac:10: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) m4trace:configure.ac:10: -1- AC_SUBST([AMDEP_TRUE]) m4trace:configure.ac:10: -1- AC_SUBST([AMDEP_FALSE]) m4trace:configure.ac:10: -1- AC_SUBST([AMDEPBACKSLASH]) m4trace:configure.ac:10: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) m4trace:configure.ac:11: -1- AC_PROG_CPP m4trace:configure.ac:11: -1- AC_SUBST([CPP]) m4trace:configure.ac:11: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.ac:11: -1- AC_SUBST([CPP]) m4trace:configure.ac:12: -1- AM_PROG_CC_C_O m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([NO_MINUS_C_MINUS_O]) m4trace:configure.ac:12: -1- AH_OUTPUT([NO_MINUS_C_MINUS_O], [/* Define to 1 if your C compiler doesn\'t accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O]) m4trace:configure.ac:13: -1- AC_PROG_CXX m4trace:configure.ac:13: -1- AC_SUBST([CXX]) m4trace:configure.ac:13: -1- AC_SUBST([CXXFLAGS]) m4trace:configure.ac:13: -1- AC_SUBST([LDFLAGS]) m4trace:configure.ac:13: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.ac:13: -1- AC_SUBST([CXX]) m4trace:configure.ac:13: -1- AC_SUBST([ac_ct_CXX]) m4trace:configure.ac:13: -1- AC_SUBST([CXXDEPMODE], [depmode=$am_cv_CXX_dependencies_compiler_type]) m4trace:configure.ac:14: -1- AC_SUBST([CXXCPP]) m4trace:configure.ac:14: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.ac:14: -1- AC_SUBST([CXXCPP]) m4trace:configure.ac:15: -1- AC_PROG_INSTALL m4trace:configure.ac:15: -1- AC_SUBST([INSTALL_PROGRAM]) m4trace:configure.ac:15: -1- AC_SUBST([INSTALL_SCRIPT]) m4trace:configure.ac:15: -1- AC_SUBST([INSTALL_DATA]) m4trace:configure.ac:17: -1- AC_DEFINE_TRACE_LITERAL([_GNU_SOURCE]) m4trace:configure.ac:18: -2- AC_DEFINE_TRACE_LITERAL([HAVE_ASPRINTF]) m4trace:configure.ac:21: -1- AC_CHECK_LIB([z], [zlibVersion], [], [{ { echo "$as_me:$LINENO: error: *** zlib not found!" >&5 echo "$as_me: error: *** zlib not found!" >&2;} { (exit 1); exit 1; }; }]) m4trace:configure.ac:21: -1- AH_OUTPUT([HAVE_LIBZ], [/* Define to 1 if you have the `z\' library (-lz). */ #undef HAVE_LIBZ]) m4trace:configure.ac:21: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBZ]) m4trace:configure.ac:31: -1- AM_CONDITIONAL([WIN32], [false]) m4trace:configure.ac:31: -1- AC_SUBST([WIN32_TRUE]) m4trace:configure.ac:31: -1- AC_SUBST([WIN32_FALSE]) m4trace:configure.ac:32: -1- AM_CONDITIONAL([UNIX], [false]) m4trace:configure.ac:32: -1- AC_SUBST([UNIX_TRUE]) m4trace:configure.ac:32: -1- AC_SUBST([UNIX_FALSE]) m4trace:configure.ac:33: -1- AM_CONDITIONAL([USE_SEXYAL], [false]) m4trace:configure.ac:33: -1- AC_SUBST([USE_SEXYAL_TRUE]) m4trace:configure.ac:33: -1- AC_SUBST([USE_SEXYAL_FALSE]) m4trace:configure.ac:34: -1- AM_CONDITIONAL([NATIVEWIN32], [false]) m4trace:configure.ac:34: -1- AC_SUBST([NATIVEWIN32_TRUE]) m4trace:configure.ac:34: -1- AC_SUBST([NATIVEWIN32_FALSE]) m4trace:configure.ac:35: -1- AM_CONDITIONAL([OPENGL], [false]) m4trace:configure.ac:35: -1- AC_SUBST([OPENGL_TRUE]) m4trace:configure.ac:35: -1- AC_SUBST([OPENGL_FALSE]) m4trace:configure.ac:36: -1- AM_CONDITIONAL([HAVE_GTK], [false]) m4trace:configure.ac:36: -1- AC_SUBST([HAVE_GTK_TRUE]) m4trace:configure.ac:36: -1- AC_SUBST([HAVE_GTK_FALSE]) m4trace:configure.ac:37: -1- AC_DEFINE_TRACE_LITERAL([NETWORK]) m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([PSS_STYLE]) m4trace:configure.ac:44: -1- AC_DEFINE_TRACE_LITERAL([PSS_STYLE]) m4trace:configure.ac:45: -1- AC_DEFINE_TRACE_LITERAL([WIN32]) m4trace:configure.ac:46: -1- AM_CONDITIONAL([WIN32], [true]) m4trace:configure.ac:46: -1- AC_SUBST([WIN32_TRUE]) m4trace:configure.ac:46: -1- AC_SUBST([WIN32_FALSE]) m4trace:configure.ac:50: -1- AM_CONDITIONAL([NATIVEWIN32], [true]) m4trace:configure.ac:50: -1- AC_SUBST([NATIVEWIN32_TRUE]) m4trace:configure.ac:50: -1- AC_SUBST([NATIVEWIN32_FALSE]) m4trace:configure.ac:52: -1- AM_CONDITIONAL([USE_SEXYAL], [true]) m4trace:configure.ac:52: -1- AC_SUBST([USE_SEXYAL_TRUE]) m4trace:configure.ac:52: -1- AC_SUBST([USE_SEXYAL_FALSE]) m4trace:configure.ac:53: -1- AC_DEFINE_TRACE_LITERAL([USE_SEXYAL]) m4trace:configure.ac:59: -1- AM_CONDITIONAL([UNIX], [true]) m4trace:configure.ac:59: -1- AC_SUBST([UNIX_TRUE]) m4trace:configure.ac:59: -1- AC_SUBST([UNIX_FALSE]) m4trace:configure.ac:60: -1- AC_DEFINE_TRACE_LITERAL([UNIX]) m4trace:configure.ac:61: -1- AC_DEFINE_TRACE_LITERAL([PSS_STYLE]) m4trace:configure.ac:62: -1- AC_DEFINE_TRACE_LITERAL([NETWORK]) m4trace:configure.ac:65: -2- AM_CONDITIONAL([USE_SEXYAL], [true]) m4trace:configure.ac:65: -2- AC_SUBST([USE_SEXYAL_TRUE]) m4trace:configure.ac:65: -2- AC_SUBST([USE_SEXYAL_FALSE]) m4trace:configure.ac:66: -2- AC_DEFINE_TRACE_LITERAL([USE_SEXYAL]) m4trace:configure.ac:66: -1- AC_HEADER_STDC m4trace:configure.ac:66: -1- AC_SUBST([EGREP]) m4trace:configure.ac:66: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) m4trace:configure.ac:66: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS]) m4trace:configure.ac:66: -1- AC_CHECK_HEADERS([sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h], [], [], [$ac_includes_default]) m4trace:configure.ac:66: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H]) m4trace:configure.ac:66: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H]) m4trace:configure.ac:66: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H]) m4trace:configure.ac:66: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STRING_H]) m4trace:configure.ac:66: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H]) m4trace:configure.ac:66: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H]) m4trace:configure.ac:66: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H]) m4trace:configure.ac:66: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H]) m4trace:configure.ac:66: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H]) m4trace:configure.ac:77: -1- AC_SUBST([SDL_CONFIG], [$ac_cv_path_SDL_CONFIG]) m4trace:configure.ac:77: -1- AC_SUBST([SDL_CFLAGS]) m4trace:configure.ac:77: -1- AC_SUBST([SDL_LIBS]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([OPENGL]) m4trace:configure.ac:104: -1- AM_CONDITIONAL([OPENGL], [true]) m4trace:configure.ac:104: -1- AC_SUBST([OPENGL_TRUE]) m4trace:configure.ac:104: -1- AC_SUBST([OPENGL_FALSE]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([OPENGL]) m4trace:configure.ac:104: -1- AM_CONDITIONAL([OPENGL], [true]) m4trace:configure.ac:104: -1- AC_SUBST([OPENGL_TRUE]) m4trace:configure.ac:104: -1- AC_SUBST([OPENGL_FALSE]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([APPLEOPENGL]) m4trace:configure.ac:106: -1- AC_DEFINE_TRACE_LITERAL([SDL]) m4trace:configure.ac:111: -1- AC_DEFINE_TRACE_LITERAL([C80x86]) m4trace:configure.ac:114: -1- AC_DEFINE_TRACE_LITERAL([WORDS_BIGENDIAN]) m4trace:configure.ac:114: -1- AH_OUTPUT([WORDS_BIGENDIAN], [/* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN]) m4trace:configure.ac:114: -1- AC_DEFINE_TRACE_LITERAL([LSB_FIRST]) m4trace:configure.ac:115: -1- AC_DEFINE_TRACE_LITERAL([FCEU_VERSION]) m4trace:configure.ac:116: -1- AC_DEFINE_TRACE_LITERAL([FCEU_VERSION_NUMERIC]) m4trace:configure.ac:118: -1- AC_DEFINE_TRACE_LITERAL([FRAMESKIP]) m4trace:configure.ac:121: -1- AC_CONFIG_FILES([Makefile src/Makefile]) m4trace:configure.ac:121: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) m4trace:configure.ac:121: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) fceu-0.98.12/aclocal.m40000644000175000000620000012335010112240342014343 0ustar joestaff00000000000000# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*- # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # Configure paths for SDL # Sam Lantinga 9/21/99 # stolen from Manish Singh # stolen back from Frank Belew # stolen from Manish Singh # Shamelessly stolen from Owen Taylor dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS dnl AC_DEFUN(AM_PATH_SDL, [dnl dnl Get the cflags and libraries from the sdl-config script dnl AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], sdl_prefix="$withval", sdl_prefix="") AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)], sdl_exec_prefix="$withval", sdl_exec_prefix="") AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program], , enable_sdltest=yes) if test x$sdl_exec_prefix != x ; then sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix" if test x${SDL_CONFIG+set} != xset ; then SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config fi fi if test x$sdl_prefix != x ; then sdl_args="$sdl_args --prefix=$sdl_prefix" if test x${SDL_CONFIG+set} != xset ; then SDL_CONFIG=$sdl_prefix/bin/sdl-config fi fi AC_PATH_PROG(SDL_CONFIG, sdl-config, no) min_sdl_version=ifelse([$1], ,0.11.0,$1) AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) no_sdl="" if test "$SDL_CONFIG" = "no" ; then no_sdl=yes else SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags` SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs` sdl_major_version=`$SDL_CONFIG $sdl_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_sdltest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" dnl dnl Now check if the installed SDL is sufficiently new. (Also sanity dnl checks the results of sdl-config to some extent dnl rm -f conf.sdltest AC_TRY_RUN([ #include #include #include #include char* my_strdup (char *str) { char *new_str; if (str) { new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main (int argc, char *argv[]) { int major, minor, micro; char *tmp_version; /* This hangs on some systems (?) system ("touch conf.sdltest"); */ { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_sdl_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_sdl_version"); exit(1); } if (($sdl_major_version > major) || (($sdl_major_version == major) && ($sdl_minor_version > minor)) || (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) { return 0; } else { printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n"); printf("*** to point to the correct copy of sdl-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } } ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_sdl" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$SDL_CONFIG" = "no" ; then echo "*** The sdl-config script installed by SDL could not be found" echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the SDL_CONFIG environment variable to the" echo "*** full path to sdl-config." else if test -f conf.sdltest ; then : else echo "*** Could not run SDL test program, checking why..." CFLAGS="$CFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" AC_TRY_LINK([ #include #include ], [ return 0; ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding SDL or finding the wrong" echo "*** version of SDL. If it is not finding SDL, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means SDL was incorrectly installed" echo "*** or that you have moved SDL since it was installed. In the latter case, you" echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi SDL_CFLAGS="" SDL_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(SDL_CFLAGS) AC_SUBST(SDL_LIBS) rm -f conf.sdltest ]) /* Steven G. Johnson and Alejandro Forero Cuervo */ AC_DEFUN([ACX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_SAVE AC_LANG_C acx_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) AC_MSG_RESULT($acx_pthread_ok) if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all. acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # pthread: Linux, etcetera # --thread-safe: KAI C++ case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthread or # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do case $flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; -*) AC_MSG_CHECKING([whether pthreads work with $flag]) PTHREAD_CFLAGS="$flag" ;; *) AC_MSG_CHECKING([for the pthreads library -l$flag]) PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_TRY_LINK([#include ], [pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], [acx_pthread_ok=yes]) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" AC_MSG_RESULT($acx_pthread_ok) if test "x$acx_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$acx_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: threads are created detached by default # and the JOINABLE attribute has a nonstandard name (UNDETACHED). AC_MSG_CHECKING([for joinable pthread attribute]) AC_TRY_LINK([#include ], [int attr=PTHREAD_CREATE_JOINABLE;], ok=PTHREAD_CREATE_JOINABLE, ok=unknown) if test x"$ok" = xunknown; then AC_TRY_LINK([#include ], [int attr=PTHREAD_CREATE_UNDETACHED;], ok=PTHREAD_CREATE_UNDETACHED, ok=unknown) fi if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok, [Define to the necessary symbol if this constant uses a non-standard name on your system.]) fi AC_MSG_RESULT(${ok}) if test x"$ok" = xunknown; then AC_MSG_WARN([we do not know how to create joinable pthreads]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with cc_r AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC}) else PTHREAD_CC="$CC" fi AC_SUBST(PTHREAD_LIBS) AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_CC) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) : else acx_pthread_ok=no $2 fi AC_LANG_RESTORE ])dnl ACX_PTHREAD # Do all the work for Automake. -*- Autoconf -*- # This macro actually does too much some checks are only needed if # your package does certain things. But this isn't really a big deal. # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You 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. # serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... AC_PREREQ([2.52]) # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow # the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_MISSING_PROG(AMTAR, tar) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_][CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_][CC], defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_][CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_][CXX], defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # Copyright 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You 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 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.6.3])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright 2001, 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You 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. # serial 2 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # # Check to make sure that the build environment is sane. # # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You 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. # serial 3 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # -*- Autoconf -*- # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You 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. # serial 3 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # AM_AUX_DIR_EXPAND # Copyright 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You 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. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. # Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50]) AC_DEFUN([AM_AUX_DIR_EXPAND], [ # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. # Copyright 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You 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. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # AM_PROG_INSTALL_STRIP # Copyright 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You 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. # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # serial 4 -*- Autoconf -*- # Copyright 1999, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You 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. # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_$1_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null AC_SUBST([DEPDIR]) ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You 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. #serial 2 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*- # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You 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. # serial 2 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST(am__include) AC_SUBST(am__quote) AC_MSG_RESULT($_am_result) rm -f confinc confmf ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright 1997, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You 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. # serial 5 AC_PREREQ(2.52) # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([conditional \"$1\" was never defined. Usually this means the macro was only invoked conditionally.]) fi])]) # serial 2 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. # Copyright 1999, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You 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. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ]) fceu-0.98.12/config.guess0000755000175000000620000011315007766757131015056 0ustar joestaff00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. timestamp='2001-09-04' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You 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. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Written by Per Bothner . # Please send patches to . # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi dummy=dummy-$$ trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int dummy(){}" > $dummy.c ; for c in cc gcc c89 ; do ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; if test $? = 0 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; rm -f $dummy.c $dummy.o $dummy.rel ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # Netbsd (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # Determine the machine/vendor (is the vendor relevant). case "${UNAME_MACHINE}" in amiga) machine=m68k-unknown ;; arm32) machine=arm-unknown ;; atari*) machine=m68k-atari ;; sun3*) machine=m68k-sun ;; mac68k) machine=m68k-apple ;; macppc) machine=powerpc-apple ;; hp3[0-9][05]) machine=m68k-hp ;; ibmrt|romp-ibm) machine=romp-ibm ;; *) machine=${UNAME_MACHINE}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE}" in i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. cat <$dummy.s .data \$Lformat: .byte 37,100,45,37,120,10,0 # "%d-%x\n" .text .globl main .align 4 .ent main main: .frame \$30,16,\$26,0 ldgp \$29,0(\$27) .prologue 1 .long 0x47e03d80 # implver \$0 lda \$2,-1 .long 0x47e20c21 # amask \$2,\$1 lda \$16,\$Lformat mov \$0,\$17 not \$1,\$18 jsr \$26,printf ldgp \$29,0(\$26) mov 0,\$16 jsr \$26,exit .end main EOF eval $set_cc_for_build $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `./$dummy` in 0-0) UNAME_MACHINE="alpha" ;; 1-0) UNAME_MACHINE="alphaev5" ;; 1-1) UNAME_MACHINE="alphaev56" ;; 1-101) UNAME_MACHINE="alphapca56" ;; 2-303) UNAME_MACHINE="alphaev6" ;; 2-307) UNAME_MACHINE="alphaev67" ;; 2-1307) UNAME_MACHINE="alphaev68" ;; esac fi rm -f $dummy.s $dummy echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; arc64:OpenBSD:*:*) echo mips64el-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hkmips:OpenBSD:*:*) echo mips-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; sparc*:NetBSD:*) echo `uname -p`-unknown-netbsd${UNAME_RELEASE} exit 0 ;; atari*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; sun3*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy \ && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) case "${HPUX_REV}" in 11.[0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; esac ;; esac fi ;; esac if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi rm -f $dummy.c $dummy fi ;; esac echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; hppa*:OpenBSD:*:*) echo hppa-unknown-openbsd exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*X-MP:*:*:*) echo xmp-cray-unicos exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3D:*:*:*) echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i386-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in big) echo mips-unknown-linux-gnu && exit 0 ;; little) echo mipsel-unknown-linux-gnu && exit 0 ;; esac ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. ld_supported_targets=`cd /; ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build cat >$dummy.c < #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 printf ("%s-pc-linux-gnu\n", argv[1]); # else printf ("%s-pc-linux-gnulibc1\n", argv[1]); # endif # else printf ("%s-pc-linux-gnulibc1\n", argv[1]); # endif #else printf ("%s-pc-linux-gnuaout\n", argv[1]); #endif return 0; } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) if test "${UNAME_MACHINE}" = "x86pc"; then UNAME_MACHINE=pc fi echo `uname -p`-${UNAME_MACHINE}-nto-qnx exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[KW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: fceu-0.98.12/autogen.sh0000755000175000000620000000005307766756447014545 0ustar joestaff00000000000000#!/bin/sh aclocal autoconf automake -a -c fceu-0.98.12/install-sh0000755000175000000620000001270107766756454014551 0ustar joestaff00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f "$src" ] || [ -d "$src" ] then : else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else : fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else : fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else : fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else : fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 fceu-0.98.12/mkinstalldirs0000755000175000000620000000341107766756454015351 0ustar joestaff00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." # process command line arguments while test $# -gt 0 ; do case "${1}" in -h | --help | --h* ) # -h for help echo "${usage}" 1>&2; exit 0 ;; -m ) # -m PERM arg shift test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } dirmode="${1}" shift ;; -- ) shift; break ;; # stop option processing -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option * ) break ;; # first non-opt arg esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 3 # End: # mkinstalldirs ends here fceu-0.98.12/missing0000755000175000000620000002403607766756454014150 0ustar joestaff00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You 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. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing 0.4 - GNU automake" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. You can get \`$1Help2man' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 fceu-0.98.12/config.sub0000755000175000000620000006710007766757131014524 0ustar joestaff00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. timestamp='2001-09-07' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You 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. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dsp16xx \ | fr30 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | m32r | m68000 | m68k | m88k | mcore \ | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el | mips64vr4300 \ | mips64vr4300el | mips64vr5000 | mips64vr5000el \ | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ | mipsisa32 \ | mn10200 | mn10300 \ | ns16k | ns32k \ | openrisc \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | s390 | s390x \ | sh | sh[34] | sh[34]eb | shbe | shle \ | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ | stormy16 | strongarm \ | tahoe | thumb | tic80 | tron \ | v850 \ | we32k \ | x86 | xscale \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alphapca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armv*-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c54x-* \ | clipper-* | cray2-* | cydra-* \ | d10v-* | d30v-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | m32r-* \ | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | s390-* | s390x-* \ | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ | sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \ | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ | v850-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | ymp) basic_machine=ymp-cray os=-unicos ;; cray2) basic_machine=cray2-cray os=-unicos ;; [cjt]90) basic_machine=${basic_machine}-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mipsel*-linux*) basic_machine=mipsel-unknown os=-linux-gnu ;; mips*-linux*) basic_machine=mips-unknown os=-linux-gnu ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i686-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sparclite-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=t3e-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; windows32) basic_machine=i386-pc os=-windows32-msvcrt ;; xmp) basic_machine=xmp-cray os=-unicos ;; xps | xps100) basic_machine=xps100-honeywell ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; mips) if [ x$os = x-linux-gnu ]; then basic_machine=mips-unknown else basic_machine=mips-mips fi ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh3eb | sh4eb) basic_machine=sh-unknown ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; c4x*) basic_machine=c4x-none os=-coff ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto*) os=-nto-qnx ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: fceu-0.98.12/depcomp0000755000175000000620000002753307766757207014130 0ustar joestaff00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects # Copyright 1999, 2000 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You 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. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # `libtool' can also be set to `yes' or `no'. if test -z "$depfile"; then base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` dir=`echo "$object" | sed 's,/.*$,/,'` if test "$dir" = "$object"; then dir= fi # FIXME: should be _deps on DOS. depfile="$dir.deps/$base" fi tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. This file always lives in the current directory. # Also, the AIX compiler puts `$object:' at the start of each line; # $object doesn't have directory information. stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" outname="$stripped.o" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" else tmpdepfile="$tmpdepfile2" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a space and a tab in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. We will use -o /dev/null later, # however we can't do the remplacement now because # `-o $object' might simply not be used IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M "$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; -*) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 fceu-0.98.12/compile0000755000175000000620000000532607766766664014134 0ustar joestaff00000000000000#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. # Copyright 1999, 2000 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You 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. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Usage: # compile PROGRAM [ARGS]... # `-o FOO.o' is removed from the args passed to the actual compile. prog=$1 shift ofile= cfile= args= while test $# -gt 0; do case "$1" in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we do something ugly here. ofile=$2 shift case "$ofile" in *.o | *.obj) ;; *) args="$args -o $ofile" ofile= ;; esac ;; *.c) cfile=$1 args="$args $1" ;; *) args="$args $1" ;; esac shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$prog" $args fi # Name of file we expect compiler to create. cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir $lockdir > /dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir $lockdir; exit 1" 1 2 15 # Run the compile. "$prog" $args status=$? if test -f "$cofile"; then mv "$cofile" "$ofile" fi rmdir $lockdir exit $status fceu-0.98.12/src/0002755000175000000620000000000010112240350013267 5ustar joestaff00000000000000fceu-0.98.12/src/boards/0002755000175000000620000000000010111545623014553 5ustar joestaff00000000000000fceu-0.98.12/src/boards/h2288.c0000644000175000000620000000454110003562761015476 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ /* Not finished. Darn evil game... *Mumble*... */ #include "mapinc.h" static uint8 cmd; static uint8 regs[8]; static void DoPRG(void) { if(cmd&0x40) { setprg8(0xC000,regs[4]); setprg8(0xA000,regs[5]); setprg8(0x8000,~1); setprg8(0xE000,~0); } else { setprg8(0x8000,regs[4]); setprg8(0xA000,regs[5]); setprg8(0xC000,~1); setprg8(0xE000,~0); } } static void DoCHR(void) { uint32 base=(cmd&0x80)<<5; setchr2(0x0000^base,regs[0]); setchr2(0x0800^base,regs[2]); setchr1(0x1000^base,regs[6]); setchr1(0x1400^base,regs[1]); setchr1(0x1800^base,regs[7]); setchr1(0x1c00^base,regs[3]); } static DECLFW(PWrite) { //printf("$%04x:$%02x\n",A,V); } static DECLFW(H2288Write) { //printf("$%04x:$%02x, $%04x\n",A,V,X.PC); //FCEUI_DumpMem("dmp",0xc000,0xffff); switch(A&0xE001) { case 0xa000:setmirror((V&1)^1);break; case 0x8000: cmd=V;DoPRG();DoCHR();break; case 0x8001:regs[cmd&7]=V; if((cmd&7)==4 || (cmd&7)==5) DoPRG(); else DoCHR(); break; } } static DECLFR(H2288Read) { int bit; //printf("Read: $%04x, $%04x\n",A,X.PC); //DumpMem("out",0x8000,0xFFFF); bit=(A&1)^1; bit&=((A>>8)&1); bit^=1; return((X.DB&0xFE)|bit); } static void H2288Reset(void) { int x; SetReadHandler(0x5000,0x5FFF,H2288Read); SetReadHandler(0x8000,0xFFFF,CartBR); SetWriteHandler(0x5000,0x5FFF,PWrite); SetWriteHandler(0x8000,0xFFFF,H2288Write); for(x=0;x<8;x++) regs[x]=0; regs[4]=0; regs[5]=1; cmd=0; DoPRG(); DoCHR(); } void H2288_Init(CartInfo *info) { info->Power=H2288Reset; } fceu-0.98.12/src/boards/malee.c0000644000175000000620000000246510003562761016011 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" DECLFW(MWrite) { (GameMemBlock-0x7000)[A]=V; } static void MALEEReset(void) { setprg2r(0x10,0x7000,0); SetReadHandler(0x8000,0xFFFF,CartBR); SetReadHandler(0x6000,0x67ff,CartBR); SetReadHandler(0x7000,0x77FF,CartBR); SetWriteHandler(0x7000,0x77FF,MWrite); setprg2r(1,0x6000,0); setprg32(0x8000,0); setchr8(0); } void MALEE_Init(CartInfo *info) { AddExState(GameMemBlock, 2048, 0,"RAM"); SetupCartPRGMapping(0x10,GameMemBlock,2048,1); info->Power=MALEEReset; } fceu-0.98.12/src/boards/mapinc.h0000644000175000000620000000033610004315517016171 0ustar joestaff00000000000000#include "../types.h" #include "../x6502.h" #include "../fceu.h" #include "../ppu.h" #include "../memory.h" #include "../sound.h" #include "../state.h" #include "../cart.h" #include "../unif.h" fceu-0.98.12/src/boards/novel.c0000644000175000000620000000252310003562761016044 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static void DoNovel(void) { setprg32(0x8000,GameMemBlock[0]&3); setchr8(GameMemBlock[0]&7); } static DECLFW(NovelWrite) { GameMemBlock[0]=A&0xFF; DoNovel(); } static void NovelReset(void) { SetWriteHandler(0x8000,0xFFFF,NovelWrite); SetReadHandler(0x8000,0xFFFF,CartBR); setprg32(0x8000,0); setchr8(0); } static void NovelRestore(int version) { DoNovel(); } void Novel_Init(CartInfo *info) { AddExState(&GameMemBlock[0], 1, 0,"L1"); info->Power=NovelReset; GameStateRestore=NovelRestore; } fceu-0.98.12/src/boards/sachen.c0000644000175000000620000001270310003562761016163 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static uint8 cmd; static uint8 latch[8]; #define CHRRAM (GameMemBlock) static void S74LS374NSynco(void) { setprg32(0x8000,latch[0]); setchr8(latch[1]); setmirror(latch[2]&1); // setchr8(6); } static DECLFW(S74LS374NWrite) { //printf("$%04x:$%02x\n",A,V); A&=0x4101; if(A==0x4100) cmd=V&7; else { switch(cmd) { case 0:latch[0]=0;latch[1]=3;break; case 4:latch[1]&=3;latch[1]|=(V<<2);break; case 5:latch[0]=V&0x7;break; case 6:latch[1]&=0x1C;latch[1]|=V&3;break; case 7:latch[2]=V&1;break; } S74LS374NSynco(); } } static void S74LS374NReset(void) { latch[0]=latch[2]=0; latch[1]=3; S74LS374NSynco(); SetReadHandler(0x8000,0xFFFF,CartBR); SetWriteHandler(0x4100,0x7FFF,S74LS374NWrite); } static void S74LS374NRestore(int version) { S74LS374NSynco(); } void S74LS374N_Init(CartInfo *info) { info->Power=S74LS374NReset; GameStateRestore=S74LS374NRestore; AddExState(latch, 3, 0, "LATC"); AddExState(&cmd, 1, 0, "CMD"); } static int type; static void S8259Synco(void) { int x; setprg32(0x8000,latch[5]&7); if(!UNIFchrrama) // No CHR RAM? Then BS'ing is ok. { if(!type) { for(x=0;x<4;x++) setchr2(0x800*x,(x&1)|((latch[x]&7)<<1)|((latch[4]&7)<<4)); } else { for(x=0;x<4;x++) setchr2(0x800*x,(latch[x]&0x7)|((latch[4]&7)<<3)); } } switch((latch[7]>>1)&3) { case 0:setmirrorw(0,0,0,1);break; case 1:setmirror(MI_H);break; case 2:setmirror(MI_V);break; case 3:setmirror(MI_0);break; } } static DECLFW(S8259Write) { A&=0x4101; if(A==0x4100) cmd=V; else { latch[cmd&7]=V; S8259Synco(); } } static void S8259Reset(void) { int x; cmd=0; for(x=0;x<8;x++) latch[x]=0; if(UNIFchrrama) setchr8(0); S8259Synco(); SetReadHandler(0x8000,0xFFFF,CartBR); SetWriteHandler(0x4100,0x7FFF,S8259Write); } static void S8259Restore(int version) { S8259Synco(); } void S8259A_Init(CartInfo *info) { info->Power=S8259Reset; GameStateRestore=S8259Restore; AddExState(latch, 8, 0, "LATC"); AddExState(&cmd, 1, 0, "CMD"); type=0; //if(!CHRsize[0]) //{ // SetupCartCHRMapping(0,CHRRAM,8192,1); // AddExState(CHRRAM, 8192, 0, "CHRR"); //} } void S8259B_Init(CartInfo *info) { info->Power=S8259Reset; GameStateRestore=S8259Restore; AddExState(latch, 8, 0, "LATC"); AddExState(&cmd, 1, 0, "CMD"); type=1; } static void(*WSync)(void); static void SA0161MSynco() { setprg32(0x8000,(latch[0]>>3)&1); setchr8(latch[0]&7); } static DECLFW(SAWrite) { if(A&0x100) { latch[0]=V; WSync(); } } static void SAReset(void) { latch[0]=0; WSync(); SetReadHandler(0x8000,0xFFFF,CartBR); SetWriteHandler(0x4100,0x5FFF,SAWrite); } static void SA0161MRestore(int version) { SA0161MSynco(); } void SA0161M_Init(CartInfo *info) { WSync=SA0161MSynco; GameStateRestore=SA0161MRestore; info->Power=SAReset; AddExState(&latch[0], 1, 0, "LATC"); } static void SA72007Synco() { setprg32(0x8000,0); setchr8(latch[0]>>7); } static void SA72007Restore(int version) { SA72007Synco(); } void SA72007_Init(CartInfo *info) { WSync=SA72007Synco; GameStateRestore=SA72007Restore; info->Power=SAReset; AddExState(&latch[0], 1, 0, "LATC"); } static void SA72008Synco() { setprg32(0x8000,(latch[0]>>2)&1); setchr8(latch[0]&3); } static void SA72008Restore(int version) { SA72008Synco(); } void SA72008_Init(CartInfo *info) { WSync=SA72008Synco; GameStateRestore=SA72008Restore; info->Power=SAReset; AddExState(&latch[0], 1, 0, "LATC"); } static DECLFW(SADWrite) { latch[0]=V; WSync(); } static void SADReset(void) { latch[0]=0; WSync(); SetReadHandler(0x8000,0xFFFF,CartBR); SetWriteHandler(0x8000,0xFFFF,SADWrite); } static void SA0036Synco() { setprg32(0x8000,0); setchr8(latch[0]>>7); } static void SA0036Restore(int version) { SA0036Synco(); } static void SA0037Synco() { setprg32(0x8000,(latch[0]>>3)&1); setchr8(latch[0]&7); } static void SA0037Restore(int version) { SA0037Synco(); } void SA0036_Init(CartInfo *info) { WSync=SA0036Synco; GameStateRestore=SA0036Restore; info->Power=SADReset; AddExState(&latch[0], 1, 0, "LATC"); } void SA0037_Init(CartInfo *info) { WSync=SA0037Synco; GameStateRestore=SA0037Restore; info->Power=SADReset; AddExState(&latch[0], 1, 0, "LATC"); } static void TCU01Synco() { setprg32(0x8000,(latch[0]>>2)&1); setchr8((latch[0]>>3)&0xF); } static DECLFW(TCWrite) { if((A&0x103)==0x102) latch[0]=V; TCU01Synco(); } static void TCU01Reset(void) { latch[0]=0; SetReadHandler(0x8000,0xFFFF,CartBR); SetWriteHandler(0x4100,0xFFFF,TCWrite); TCU01Synco(); } static void TCU01Restore(int version) { TCU01Synco(); } void TCU01_Init(CartInfo *info) { GameStateRestore=TCU01Restore; info->Power=TCU01Reset; AddExState(&latch[0], 1, 0, "LATC"); } fceu-0.98.12/src/boards/simple.c0000644000175000000620000000706010003562761016213 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define CHRRAM (GameMemBlock) static uint8 latche; DECLFW(CPROMWrite) { latche=V&3; setvram4(0x1000,CHRRAM+((V&3)<<12)); } static void CPROMReset(void) { setprg32(0x8000,0); setvram8(0); SetReadHandler(0x8000,0xFFFF,CartBR); SetWriteHandler(0x8000,0xffff,CPROMWrite); } static void CPROMRestore(int version) { setvram4(0x1000,CHRRAM+((latche)<<12)); } void CPROM_Init(CartInfo *info) { info->Power=CPROMReset; GameStateRestore=CPROMRestore; AddExState(&latche, 1, 0, "LATC"); } DECLFW(CNROMWrite) { latche=V&3; setchr8(V&3); } static void CNROMReset(void) { setprg16(0x8000,0); setprg16(0xC000,1); SetReadHandler(0x8000,0xFFFF,CartBR); SetWriteHandler(0x8000,0xffff,CNROMWrite); } static void CNROMRestore(int version) { setchr8(latche); } void CNROM_Init(CartInfo *info) { info->Power=CNROMReset; GameStateRestore=CNROMRestore; AddExState(&latche, 1, 0, "LATC"); } static void NROM128Reset(void) { setprg16(0x8000,0); setprg16(0xC000,0); setchr8(0); SetReadHandler(0x8000,0xFFFF,CartBR); } static void NROM256Reset(void) { setprg16(0x8000,0); setprg16(0xC000,1); setchr8(0); SetReadHandler(0x8000,0xFFFF,CartBR); } void NROM128_Init(CartInfo *info) { info->Power=NROM128Reset; } void NROM256_Init(CartInfo *info) { info->Power=NROM256Reset; } static DECLFW(MHROMWrite) { setprg32(0x8000,V>>4); setchr8(V); latche=V; } static void MHROMReset(void) { setprg32(0x8000,0); setchr8(0); latche=0; SetReadHandler(0x8000,0xFFFF,CartBR); } static void MHROMRestore(int version) { setprg32(0x8000,latche); setchr8(latche); SetWriteHandler(0x8000,0xffff,MHROMWrite); } void MHROM_Init(CartInfo *info) { info->Power=MHROMReset; AddExState(&latche, 1, 0,"LATC"); PRGmask32[0]&=1; CHRmask8[0]&=1; GameStateRestore=MHROMRestore; } static void UNROMRestore(int version) { setprg16(0x8000,latche); } static DECLFW(UNROMWrite) { setprg16(0x8000,V); latche=V; } static void UNROMReset(void) { setprg16(0x8000,0); setprg16(0xc000,~0); setvram8(CHRRAM); SetWriteHandler(0x8000,0xffff,UNROMWrite); SetReadHandler(0x8000,0xFFFF,CartBR); latche=0; } void UNROM_Init(CartInfo *info) { info->Power=UNROMReset; PRGmask16[0]&=7; AddExState(&latche, 1, 0, "LATC"); AddExState(CHRRAM, 8192, 0, "CHRR"); GameStateRestore=UNROMRestore; } static void GNROMSync() { setchr8(latche&3); setprg32(0x8000,(latche>>4)&3); } static DECLFW(GNROMWrite) { latche=V&0x33; GNROMSync(); } static void GNROMStateRestore(int version) { GNROMSync(); } static void GNROMReset(void) { latche=0; GNROMSync(); SetWriteHandler(0x8000,0xffff,GNROMWrite); SetReadHandler(0x8000,0xFFFF,CartBR); } void GNROM_Init(CartInfo *info) { info->Power=GNROMReset; AddExState(&latche, 1, 0, "LATC"); GameStateRestore=GNROMStateRestore; } fceu-0.98.12/src/boards/super24.c0000644000175000000620000001325410003562761016230 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static int32 IRQCount,IRQLatch; static uint8 IRQa,resetmode,mbia; static uint8 sizer,bigbank,bigbank2; static uint8 DRegBuf[8],MMC3_cmd; static int masko8[8]={63,31,15,1,3,0,0,0}; //static int masko1[8]={511,255,127,7,7,0,0,0}; static void swsetprg8(uint32 A, uint32 V) { V&=masko8[sizer&7]; V|=(bigbank*2); setprg8r((V/64)&15,A,V); } static void swsetchr1(uint32 A, uint32 V) { if(sizer&0x20) setchr1r(0x10,A,V); else { // V&=masko1[sizer&7]; V|=bigbank2*8; setchr1r((V/512)&15,A,V); } } static void swsetchr2(uint32 A, uint32 V) { if(sizer&0x20) setchr2r(0x10,A,V); else { //V&=masko1[sizer&7]>>1; V|=bigbank2*4; setchr2r((V/256)&15,A,V); } } static void Sup24_hb(void) { resetmode=0; if(scanline==238) X6502_IRQBegin(FCEU_IQEXT); if(IRQCount>=0) { IRQCount--; if(IRQCount<0) { if(IRQa) { resetmode = 1; X6502_IRQBegin(FCEU_IQEXT); //printf("IRQ: %d,%d\n",scanline,timestamp); } } } } static DECLFW(Sup24IRQWrite) { //printf("%04x, $%02x, %d, %d\n",A,V,scanline,timestamp); switch(A&0xE001) { case 0xc000:IRQLatch=V; if(resetmode==1) IRQCount=IRQLatch; break; case 0xc001:resetmode=1; IRQCount=IRQLatch; break; case 0xE000:IRQa=0;X6502_IRQEnd(FCEU_IQEXT); if(resetmode==1) {IRQCount=IRQLatch;} break; case 0xE001:IRQa=1; if(resetmode==1) {IRQCount=IRQLatch;} break; } } static INLINE void FixMMC3PRG(int V) { swsetprg8(0xA000,DRegBuf[7]); swsetprg8(0xE000,~0); if(V&0x40) { swsetprg8(0xC000,DRegBuf[6]); swsetprg8(0x8000,~1); } else { swsetprg8(0x8000,DRegBuf[6]); swsetprg8(0xC000,~1); } } static INLINE void FixMMC3CHR(int V) { int cbase=(V&0x80)<<5; swsetchr2((cbase^0x000),DRegBuf[0]>>1); swsetchr2((cbase^0x800),DRegBuf[1]>>1); swsetchr1(cbase^0x1000,DRegBuf[2]); swsetchr1(cbase^0x1400,DRegBuf[3]); swsetchr1(cbase^0x1800,DRegBuf[4]); swsetchr1(cbase^0x1c00,DRegBuf[5]); } static DECLFW(Super24hiwrite) { //printf("$%04x:$%02x, %d\n",A,V,scanline); switch(A&0xE001) { case 0x8000: if((V&0x40) != (MMC3_cmd&0x40)) FixMMC3PRG(V); if((V&0x80) != (MMC3_cmd&0x80)) FixMMC3CHR(V); MMC3_cmd = V; break; case 0x8001: { int cbase=(MMC3_cmd&0x80)<<5; DRegBuf[MMC3_cmd&0x7]=V; switch(MMC3_cmd&0x07) { case 0: V>>=1;swsetchr2((cbase^0x000),V);break; case 1: V>>=1;swsetchr2((cbase^0x800),V);break; case 2: swsetchr1(cbase^0x1000,V); break; case 3: swsetchr1(cbase^0x1400,V); break; case 4: swsetchr1(cbase^0x1800,V); break; case 5: swsetchr1(cbase^0x1C00,V); break; case 6: if (MMC3_cmd&0x40) swsetprg8(0xC000,V); else swsetprg8(0x8000,V); break; case 7: swsetprg8(0xA000,V); break; } } break; case 0xA000: mbia=V; setmirror((V&1)^1); break; } } static DECLFW(Super24Write) { //printf("$%04x:$%02x\n",A,V); switch(A) { case 0x5ff0:sizer=V; FixMMC3PRG(MMC3_cmd); FixMMC3CHR(MMC3_cmd); break; case 0x5FF1: bigbank=V; FixMMC3PRG(MMC3_cmd); break; case 0x5FF2: bigbank2=V; FixMMC3CHR(MMC3_cmd); break; } } static void Super24Reset(void) { SetWriteHandler(0x8000,0xBFFF,Super24hiwrite); SetWriteHandler(0x5000,0x7FFF,Super24Write); SetWriteHandler(0xC000,0xFFFF,Sup24IRQWrite); SetReadHandler(0x8000,0xFFFF,CartBR); GameHBIRQHook=Sup24_hb; IRQCount=IRQLatch=IRQa=resetmode=0; sizer=0x24; bigbank=159; bigbank2=0; MMC3_cmd=0; DRegBuf[6]=0; DRegBuf[7]=1; FixMMC3PRG(0); FixMMC3CHR(0); } static void MrRestore(int version) { FixMMC3PRG(MMC3_cmd); FixMMC3CHR(MMC3_cmd); setmirror((mbia&1)^1); } void Super24_Init(CartInfo *info) { info->Power=Super24Reset; SetupCartCHRMapping(0x10, GameMemBlock, 8192, 1); GameStateRestore=MrRestore; AddExState(GameMemBlock, 8192, 0, "CHRR"); AddExState(DRegBuf, 8, 0, "DREG"); AddExState(&IRQCount, 4, 1, "IRQC"); AddExState(&IRQLatch, 4, 1, "IQL1"); AddExState(&IRQa, 1, 0, "IRQA"); AddExState(&sizer, 1, 0, "SIZA"); AddExState(&bigbank, 1, 0, "BIG1"); AddExState(&bigbank2, 1, 0, "BIG2"); } fceu-0.98.12/src/boards/supervision.c0000644000175000000620000000370010003562761017305 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define CHRRAM (GameMemBlock+16) static void DoSuper(void) { setprg8r((GameMemBlock[0]&0xC)>>2,0x6000,((GameMemBlock[0]&0x3)<<4)|0xF); if(GameMemBlock[0]&0x10) { setprg16r((GameMemBlock[0]&0xC)>>2,0x8000,((GameMemBlock[0]&0x3)<<3)|(GameMemBlock[1]&7)); setprg16r((GameMemBlock[0]&0xC)>>2,0xc000,((GameMemBlock[0]&0x3)<<3)|7); } else setprg32r(4,0x8000,0); setmirror(((GameMemBlock[0]&0x20)>>5)^1); } static DECLFW(SuperWrite) { if(!(GameMemBlock[0]&0x10)) { GameMemBlock[0]=V; DoSuper(); } } static DECLFW(SuperHi) { GameMemBlock[1]=V; DoSuper(); } static void SuperReset(void) { SetWriteHandler(0x6000,0x7FFF,SuperWrite); SetWriteHandler(0x8000,0xFFFF,SuperHi); SetReadHandler(0x6000,0xFFFF,CartBR); GameMemBlock[0]=GameMemBlock[1]=0; setprg32r(4,0x8000,0); setvram8(CHRRAM); FCEU_dwmemset(CHRRAM,0,8192); } static void SuperRestore(int version) { DoSuper(); } void Supervision16_Init(CartInfo *info) { AddExState(&GameMemBlock[0], 1, 0,"L1"); AddExState(&GameMemBlock[1], 1, 0,"L2"); AddExState(CHRRAM, 8192, 0, "CHRR"); info->Power=SuperReset; GameStateRestore=SuperRestore; } fceu-0.98.12/src/boards/8237.c0000644000175000000620000000570610003562761015332 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static uint8 cmdin; static uint8 cmd; static uint8 regs[8]; static uint8 master,chrm; static int32 IRQCount,IRQa; static void DoPRG(void) { if(master&0x80) { if(master&0x20) { setprg32(0x8000,(master&0xF)>>1); } else { setprg16(0x8000,master&0xF); setprg16(0xC000,master&0xF); } } else { setprg8(0xA000,regs[4]); setprg8(0xE000,~0); if(cmd&0x40) { setprg8(0xC000,regs[2]); setprg8(0x8000,~1); } else { setprg8(0x8000,regs[2]); setprg8(0xC000,~1); } } } static void DoCHR(void) { uint32 base=(cmd&0x80)<<5; int orie=(chrm&0x4)<<6; setchr2(0x0000^base,(orie|regs[0])>>1); //K setchr2(0x0800^base,(orie|regs[3])>>1); //43 setchr1(0x1000,orie|regs[1]); setchr1(0x1400,orie|regs[5]); setchr1(0x1800,orie|regs[6]); setchr1(0x1c00,orie|regs[7]); } static DECLFW(UNL8237Write) { switch(A&0xF000) { case 0xf000:IRQCount=V;break; case 0xE000:X6502_IRQEnd(FCEU_IQEXT);break; } // if(A<0x8000) // printf("$%04x:$%02x, %d\n",A&0xFFFF,V,scanline); if(A==0x5000) { master=V; DoPRG(); DoCHR(); } else if(A==0x5001) { chrm=V; DoCHR(); } else switch(A&0xE000) { case 0x8000:setmirror(((V|(V>>7))&1)^1);break; case 0xa000:cmd=V;cmdin=1;DoPRG();DoCHR();break; case 0xC000:if(!cmdin) break; regs[cmd&7]=V; DoPRG(); DoCHR(); cmdin=0; break; } } static void UNL8237Reset(void) { int x; for(x=0;x<8;x++) regs[x]=0; master=chrm=cmd=cmdin=IRQCount=IRQa=0; SetReadHandler(0x8000,0xFFFF,CartBR); SetWriteHandler(0x5000,0xFFFF,UNL8237Write); DoPRG(); DoCHR(); } static void hooko(void) { if(IRQCount) { IRQCount--; if(!IRQCount) { X6502_IRQBegin(FCEU_IQEXT); //printf("IRQ: %d\n",scanline); } } } static void restoreo(int version) { DoPRG(); DoCHR(); } void UNL8237_Init(CartInfo *info) { GameStateRestore=restoreo; GameHBIRQHook=hooko; info->Power=UNL8237Reset; AddExState(regs, 8, 0, "REGS"); AddExState(&IRQCount, 4, 1, "IRQC"); AddExState(&IRQa, 1, 0, "IRQA"); AddExState(&master, 1, 0, "MAST"); AddExState(&chrm,1,0,"CHRM"); AddExState(&cmd,1,0,"CMD"); AddExState(&cmdin,1,0,"CMDI"); } fceu-0.98.12/src/boards/Makefile.am.inc0000755000175000000620000000023110003562761017356 0ustar joestaff00000000000000fceu_SOURCES += boards/8237.c boards/h2288.c boards/malee.c boards/novel.c boards/sachen.c boards/simple.c boards/super24.c boards/supervision.c fceu-0.98.12/src/cart.c0000644000175000000620000003032310110502040014356 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 #include "types.h" #include "fceu.h" #include "ppu.h" #include "cart.h" #include "memory.h" #include "x6502.h" #include "general.h" /* This file contains all code for coordinating the mapping in of the address space external to the NES. It's also (ab)used by the NSF code. */ uint8 *Page[32],*VPage[8]; uint8 **VPageR=VPage; uint8 *VPageG[8]; uint8 *MMC5SPRVPage[8]; uint8 *MMC5BGVPage[8]; static uint8 PRGIsRAM[32]; /* This page is/is not PRG RAM. */ /* 16 are (sort of) reserved for UNIF/iNES and 16 to map other stuff. */ static int CHRram[32]; static int PRGram[32]; uint8 *PRGptr[32]; uint8 *CHRptr[32]; uint32 PRGsize[32]; uint32 CHRsize[32]; uint32 PRGmask2[32]; uint32 PRGmask4[32]; uint32 PRGmask8[32]; uint32 PRGmask16[32]; uint32 PRGmask32[32]; uint32 CHRmask1[32]; uint32 CHRmask2[32]; uint32 CHRmask4[32]; uint32 CHRmask8[32]; int geniestage=0; int modcon; uint8 genieval[3]; uint8 geniech[3]; uint32 genieaddr[3]; static INLINE void setpageptr(int s, uint32 A, uint8 *p, int ram) { uint32 AB=A>>11; int x; if(p) for(x=(s>>1)-1;x>=0;x--) { PRGIsRAM[AB+x]=ram; Page[AB+x]=p-A; } else for(x=(s>>1)-1;x>=0;x--) { PRGIsRAM[AB+x]=0; Page[AB+x]=0; } } static uint8 nothing[8192]; void ResetCartMapping(void) { int x; for(x=0;x<32;x++) { Page[x]=nothing-x*2048; PRGptr[x]=CHRptr[x]=0; PRGsize[x]=CHRsize[x]=0; } for(x=0;x<8;x++) { MMC5SPRVPage[x]=MMC5BGVPage[x]=VPageR[x]=nothing-0x400*x; } } void SetupCartPRGMapping(int chip, uint8 *p, uint32 size, int ram) { PRGptr[chip]=p; PRGsize[chip]=size; PRGmask2[chip]=(size>>11)-1; PRGmask4[chip]=(size>>12)-1; PRGmask8[chip]=(size>>13)-1; PRGmask16[chip]=(size>>14)-1; PRGmask32[chip]=(size>>15)-1; PRGram[chip]=ram?1:0; } void SetupCartCHRMapping(int chip, uint8 *p, uint32 size, int ram) { CHRptr[chip]=p; CHRsize[chip]=size; CHRmask1[chip]=(size>>10)-1; CHRmask2[chip]=(size>>11)-1; CHRmask4[chip]=(size>>12)-1; CHRmask8[chip]=(size>>13)-1; CHRram[chip]=ram; } DECLFR(CartBR) { return Page[A>>11][A]; } DECLFW(CartBW) { //printf("Ok: %04x:%02x, %d\n",A,V,PRGIsRAM[A>>11]); if(PRGIsRAM[A>>11] && Page[A>>11]) Page[A>>11][A]=V; } DECLFR(CartBROB) { if(!Page[A>>11]) return(X.DB); return Page[A>>11][A]; } void FASTAPASS(3) setprg2r(int r, unsigned int A, unsigned int V) { V&=PRGmask2[r]; setpageptr(2,A,PRGptr[r]?(&PRGptr[r][V<<11]):0,PRGram[r]); } void FASTAPASS(2) setprg2(uint32 A, uint32 V) { setprg2r(0,A,V); } void FASTAPASS(3) setprg4r(int r, unsigned int A, unsigned int V) { V&=PRGmask4[r]; setpageptr(4,A,PRGptr[r]?(&PRGptr[r][V<<12]):0,PRGram[r]); } void FASTAPASS(2) setprg4(uint32 A, uint32 V) { setprg4r(0,A,V); } void FASTAPASS(3) setprg8r(int r, unsigned int A, unsigned int V) { if(PRGsize[r]>=8192) { V&=PRGmask8[r]; setpageptr(8,A,PRGptr[r]?(&PRGptr[r][V<<13]):0,PRGram[r]); } else { uint32 VA=V<<2; int x; for(x=0;x<4;x++) setpageptr(2,A+(x<<11),PRGptr[r]?(&PRGptr[r][((VA+x)&PRGmask2[r])<<11]):0,PRGram[r]); } } void FASTAPASS(2) setprg8(uint32 A, uint32 V) { setprg8r(0,A,V); } void FASTAPASS(3) setprg16r(int r, unsigned int A, unsigned int V) { if(PRGsize[r]>=16384) { V&=PRGmask16[r]; setpageptr(16,A,PRGptr[r]?(&PRGptr[r][V<<14]):0,PRGram[r]); } else { uint32 VA=V<<3; int x; for(x=0;x<8;x++) setpageptr(2,A+(x<<11),PRGptr[r]?(&PRGptr[r][((VA+x)&PRGmask2[r])<<11]):0,PRGram[r]); } } void FASTAPASS(2) setprg16(uint32 A, uint32 V) { setprg16r(0,A,V); } void FASTAPASS(3) setprg32r(int r,unsigned int A, unsigned int V) { if(PRGsize[r]>=32768) { V&=PRGmask32[r]; setpageptr(32,A,PRGptr[r]?(&PRGptr[r][V<<15]):0,PRGram[r]); } else { uint32 VA=V<<4; int x; for(x=0;x<16;x++) setpageptr(2,A+(x<<11),PRGptr[r]?(&PRGptr[r][((VA+x)&PRGmask2[r])<<11]):0,PRGram[r]); } } void FASTAPASS(2) setprg32(uint32 A, uint32 V) { setprg32r(0,A,V); } void FASTAPASS(3) setchr1r(int r, unsigned int A, unsigned int V) { if(!CHRptr[r]) return; FCEUPPU_LineUpdate(); V&=CHRmask1[r]; if(CHRram[r]) PPUCHRRAM|=(1<<(A>>10)); else PPUCHRRAM&=~(1<<(A>>10)); VPageR[(A)>>10]=&CHRptr[r][(V)<<10]-(A); } void FASTAPASS(3) setchr2r(int r, unsigned int A, unsigned int V) { if(!CHRptr[r]) return; FCEUPPU_LineUpdate(); V&=CHRmask2[r]; VPageR[(A)>>10]=VPageR[((A)>>10)+1]=&CHRptr[r][(V)<<11]-(A); if(CHRram[r]) PPUCHRRAM|=(3<<(A>>10)); else PPUCHRRAM&=~(3<<(A>>10)); } void FASTAPASS(3) setchr4r(int r, unsigned int A, unsigned int V) { if(!CHRptr[r]) return; FCEUPPU_LineUpdate(); V&=CHRmask4[r]; VPageR[(A)>>10]=VPageR[((A)>>10)+1]= VPageR[((A)>>10)+2]=VPageR[((A)>>10)+3]=&CHRptr[r][(V)<<12]-(A); if(CHRram[r]) PPUCHRRAM|=(15<<(A>>10)); else PPUCHRRAM&=~(15<<(A>>10)); } void FASTAPASS(2) setchr8r(int r, unsigned int V) { int x; if(!CHRptr[r]) return; FCEUPPU_LineUpdate(); V&=CHRmask8[r]; for(x=7;x>=0;x--) VPageR[x]=&CHRptr[r][V<<13]; if(CHRram[r]) PPUCHRRAM|=(255); else PPUCHRRAM&=~(255); } void FASTAPASS(2) setchr1(unsigned int A, unsigned int V) { setchr1r(0,A,V); } void FASTAPASS(2) setchr2(unsigned int A, unsigned int V) { setchr2r(0,A,V); } void FASTAPASS(2) setchr4(unsigned int A, unsigned int V) { setchr4r(0,A,V); } void FASTAPASS(1) setchr8(unsigned int V) { setchr8r(0,V); } void FASTAPASS(1) setvram8(uint8 *p) { int x; for(x=7;x>=0;x--) VPageR[x]=p; PPUCHRRAM|=255; } void FASTAPASS(2) setvram4(uint32 A, uint8 *p) { int x; for(x=3;x>=0;x--) VPageR[(A>>10)+x]=p-A; PPUCHRRAM|=(15<<(A>>10)); } void FASTAPASS(3) setvramb1(uint8 *p, uint32 A, uint32 b) { FCEUPPU_LineUpdate(); VPageR[A>>10]=p-A+(b<<10); PPUCHRRAM|=(1<<(A>>10)); } void FASTAPASS(3) setvramb2(uint8 *p, uint32 A, uint32 b) { FCEUPPU_LineUpdate(); VPageR[(A>>10)]=VPageR[(A>>10)+1]=p-A+(b<<11); PPUCHRRAM|=(3<<(A>>10)); } void FASTAPASS(3) setvramb4(uint8 *p, uint32 A, uint32 b) { int x; FCEUPPU_LineUpdate(); for(x=3;x>=0;x--) VPageR[(A>>10)+x]=p-A+(b<<12); PPUCHRRAM|=(15<<(A>>10)); } void FASTAPASS(2) setvramb8(uint8 *p, uint32 b) { int x; FCEUPPU_LineUpdate(); for(x=7;x>=0;x--) VPageR[x]=p+(b<<13); PPUCHRRAM|=255; } /* This function can be called without calling SetupCartMirroring(). */ void FASTAPASS(3) setntamem(uint8 *p, int ram, uint32 b) { FCEUPPU_LineUpdate(); vnapage[b]=p; PPUNTARAM&=~(1<>2]=V;break; case 0x800b: case 0x8007: case 0x8003:geniech[((A-3)&0xF)>>2]=V;break; case 0x800a: case 0x8006: case 0x8002:genieaddr[((A-2)&0xF)>>2]&=0xFF00;genieaddr[((A-2)&0xF)>>2]|=V;break; case 0x8009: case 0x8005: case 0x8001:genieaddr[((A-1)&0xF)>>2]&=0xFF;genieaddr[((A-1)&0xF)>>2]|=(V|0x80)<<8;break; case 0x8000:if(!V) FixGenieMap(); else { modcon=V^0xFF; if(V==0x71) modcon=0; } break; } } static readfunc GenieBackup[3]; static DECLFR(GenieFix1) { uint8 r=GenieBackup[0](A); if((modcon>>1)&1) // No check return genieval[0]; else if(r==geniech[0]) return genieval[0]; return r; } static DECLFR(GenieFix2) { uint8 r=GenieBackup[1](A); if((modcon>>2)&1) // No check return genieval[1]; else if(r==geniech[1]) return genieval[1]; return r; } static DECLFR(GenieFix3) { uint8 r=GenieBackup[2](A); if((modcon>>3)&1) // No check return genieval[2]; else if(r==geniech[2]) return genieval[2]; return r; } void FixGenieMap(void) { int x; geniestage=2; for(x=0;x<8;x++) VPage[x]=VPageG[x]; VPageR=VPage; FlushGenieRW(); //printf("Rightyo\n"); for(x=0;x<3;x++) if((modcon>>(4+x))&1) { readfunc tmp[3]={GenieFix1,GenieFix2,GenieFix3}; GenieBackup[x]=GetReadHandler(genieaddr[x]); SetReadHandler(genieaddr[x],genieaddr[x],tmp[x]); } } void GeniePower(void) { uint32 x; if(!geniestage) return; geniestage=1; for(x=0;x<3;x++) { genieval[x]=0xFF; geniech[x]=0xFF; genieaddr[x]=0xFFFF; } modcon=0; SetWriteHandler(0x8000,0xFFFF,GenieWrite); SetReadHandler(0x8000,0xFFFF,GenieRead); for(x=0;x<8;x++) VPage[x]=GENIEROM+4096-0x400*x; if(AllocGenieRW()) VPageR=VPageG; else geniestage=2; } void FCEU_SaveGameSave(CartInfo *LocalHWInfo) { if(LocalHWInfo->battery && LocalHWInfo->SaveGame[0]) { FILE *sp; char *soot; soot=FCEU_MakeFName(FCEUMKF_SAV,0,"sav"); if((sp=FCEUD_UTF8fopen(soot,"wb"))==NULL) { FCEU_PrintError("WRAM file \"%s\" cannot be written to.\n",soot); } else { int x; for(x=0;x<4;x++) if(LocalHWInfo->SaveGame[x]) { fwrite(LocalHWInfo->SaveGame[x],1, LocalHWInfo->SaveGameLen[x],sp); } } free(soot); } } void FCEU_LoadGameSave(CartInfo *LocalHWInfo) { if(LocalHWInfo->battery && LocalHWInfo->SaveGame[0]) { FILE *sp; char *soot; soot=FCEU_MakeFName(FCEUMKF_SAV,0,"sav"); sp=FCEUD_UTF8fopen(soot,"rb"); if(sp!=NULL) { int x; for(x=0;x<4;x++) if(LocalHWInfo->SaveGame[x]) fread(LocalHWInfo->SaveGame[x],1,LocalHWInfo->SaveGameLen[x],sp); } free(soot); } } fceu-0.98.12/src/cart.h0000644000175000000620000000643310036600002014374 0ustar joestaff00000000000000typedef struct { /* Set by mapper/board code: */ void (*Power)(void); void (*Reset)(void); void (*Close)(void); uint8 *SaveGame[4]; /* Pointers to memory to save/load. */ uint32 SaveGameLen[4]; /* How much memory to save/load. */ /* Set by iNES/UNIF loading code. */ int mirror; /* As set in the header or chunk. iNES/UNIF specific. Intended to help support games like "Karnov" that are not really MMC3 but are set to mapper 4. */ int battery; /* Presence of an actual battery. */ uint8 MD5[16]; uint32 CRC32; /* Should be set by the iNES/UNIF loading code, used by mapper/board code, maybe other code in the future. */ } CartInfo; void FCEU_SaveGameSave(CartInfo *LocalHWInfo); void FCEU_LoadGameSave(CartInfo *LocalHWInfo); extern uint8 *Page[32],*VPage[8],*MMC5SPRVPage[8],*MMC5BGVPage[8]; void ResetCartMapping(void); void SetupCartPRGMapping(int chip, uint8 *p, uint32 size, int ram); void SetupCartCHRMapping(int chip, uint8 *p, uint32 size, int ram); void SetupCartMirroring(int m, int hard, uint8 *extra); DECLFR(CartBROB); DECLFR(CartBR); DECLFW(CartBW); extern uint8 *PRGptr[32]; extern uint8 *CHRptr[32]; extern uint32 PRGsize[32]; extern uint32 CHRsize[32]; extern uint32 PRGmask2[32]; extern uint32 PRGmask4[32]; extern uint32 PRGmask8[32]; extern uint32 PRGmask16[32]; extern uint32 PRGmask32[32]; extern uint32 CHRmask1[32]; extern uint32 CHRmask2[32]; extern uint32 CHRmask4[32]; extern uint32 CHRmask8[32]; void FASTAPASS(2) setprg2(uint32 A, uint32 V); void FASTAPASS(2) setprg4(uint32 A, uint32 V); void FASTAPASS(2) setprg8(uint32 A, uint32 V); void FASTAPASS(2) setprg16(uint32 A, uint32 V); void FASTAPASS(2) setprg32(uint32 A, uint32 V); void FASTAPASS(3) setprg2r(int r, unsigned int A, unsigned int V); void FASTAPASS(3) setprg4r(int r, unsigned int A, unsigned int V); void FASTAPASS(3) setprg8r(int r, unsigned int A, unsigned int V); void FASTAPASS(3) setprg16r(int r, unsigned int A, unsigned int V); void FASTAPASS(3) setprg32r(int r, unsigned int A, unsigned int V); void FASTAPASS(3) setchr1r(int r, unsigned int A, unsigned int V); void FASTAPASS(3) setchr2r(int r, unsigned int A, unsigned int V); void FASTAPASS(3) setchr4r(int r, unsigned int A, unsigned int V); void FASTAPASS(2) setchr8r(int r, unsigned int V); void FASTAPASS(2) setchr1(unsigned int A, unsigned int V); void FASTAPASS(2) setchr2(unsigned int A, unsigned int V); void FASTAPASS(2) setchr4(unsigned int A, unsigned int V); void FASTAPASS(1) setchr8(unsigned int V); void FASTAPASS(2) setvram4(uint32 A, uint8 *p); void FASTAPASS(1) setvram8(uint8 *p); void FASTAPASS(3) setvramb1(uint8 *p, uint32 A, uint32 b); void FASTAPASS(3) setvramb2(uint8 *p, uint32 A, uint32 b); void FASTAPASS(3) setvramb4(uint8 *p, uint32 A, uint32 b); void FASTAPASS(2) setvramb8(uint8 *p, uint32 b); void FASTAPASS(1) setmirror(int t); void setmirrorw(int a, int b, int c, int d); void FASTAPASS(3) setntamem(uint8 *p, int ram, uint32 b); #define MI_H 0 #define MI_V 1 #define MI_0 2 #define MI_1 3 extern int geniestage; void GeniePower(void); void OpenGenie(void); void CloseGenie(void); void FCEU_KillGenie(void); fceu-0.98.12/src/cheat.c0000644000175000000620000003522710052032506014533 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 #include #include "types.h" #include "x6502.h" #include "cheat.h" #include "fceu.h" #include "general.h" #include "cart.h" #include "memory.h" static uint8 *CheatRPtrs[64]; void FCEU_CheatResetRAM(void) { int x; for(x=0;x<64;x++) CheatRPtrs[x]=0; } void FCEU_CheatAddRAM(int s, uint32 A, uint8 *p) { uint32 AB=A>>10; int x; for(x=s-1;x>=0;x--) CheatRPtrs[AB+x]=p-A; } struct CHEATF { struct CHEATF *next; char *name; uint16 addr; uint8 val; int compare; /* -1 for no compare. */ int type; /* 0 for replace, 1 for substitute(GG). */ int status; }; typedef struct { uint16 addr; uint8 val; int compare; readfunc PrevRead; } CHEATF_SUBFAST; static CHEATF_SUBFAST SubCheats[256]; static int numsubcheats=0; struct CHEATF *cheats=0,*cheatsl=0; #define CHEATC_NONE 0x8000 #define CHEATC_EXCLUDED 0x4000 #define CHEATC_NOSHOW 0xC000 static uint16 *CheatComp=0; static int savecheats; static DECLFR(SubCheatsRead) { CHEATF_SUBFAST *s=SubCheats; int x=numsubcheats; do { if(s->addr==A) { if(s->compare>=0) { uint8 pv=s->PrevRead(A); if(pv==s->compare) return(s->val); else return(pv); } else return(s->val); } s++; } while(--x); return(0); /* We should never get here. */ } void RebuildSubCheats(void) { int x; struct CHEATF *c=cheats; for(x=0;xtype==1 && c->status) { if(GetReadHandler(c->addr)==SubCheatsRead) { /* Prevent a catastrophe by this check. */ //FCEU_DispMessage("oops"); } else { SubCheats[numsubcheats].PrevRead=GetReadHandler(c->addr); SubCheats[numsubcheats].addr=c->addr; SubCheats[numsubcheats].val=c->val; SubCheats[numsubcheats].compare=c->compare; SetReadHandler(c->addr,c->addr,SubCheatsRead); numsubcheats++; } } c=c->next; } } void FCEU_PowerCheats() { numsubcheats=0; /* Quick hack to prevent setting of ancient read addresses. */ RebuildSubCheats(); } static int AddCheatEntry(char *name, uint32 addr, uint8 val, int compare, int status, int type); static void CheatMemErr(void) { FCEUD_PrintError("Error allocating memory for cheat data."); } /* This function doesn't allocate any memory for "name" */ static int AddCheatEntry(char *name, uint32 addr, uint8 val, int compare, int status, int type) { struct CHEATF *temp; if(!(temp=(struct CHEATF *)malloc(sizeof(struct CHEATF)))) { CheatMemErr(); return(0); } temp->name=name; temp->addr=addr; temp->val=val; temp->status=status; temp->compare=compare; temp->type=type; temp->next=0; if(cheats) { cheatsl->next=temp; cheatsl=temp; } else cheats=cheatsl=temp; return(1); } void FCEU_LoadGameCheats(FILE *override) { FILE *fp; unsigned int addr; unsigned int val; unsigned int status; unsigned int type; unsigned int compare; int x; char linebuf[2048]; char *namebuf; int tc=0; char *fn; numsubcheats=savecheats=0; if(override) fp = override; else { fn=FCEU_MakeFName(FCEUMKF_CHEAT,0,0); fp=FCEUD_UTF8fopen(fn,"rb"); free(fn); if(!fp) return; } while(fgets(linebuf,2048,fp)>0) { char *tbuf=linebuf; int doc=0; addr=val=compare=status=type=0; if(tbuf[0]=='S') { tbuf++; type=1; } else type=0; if(tbuf[0]=='C') { tbuf++; doc=1; } if(tbuf[0]==':') { tbuf++; status=0; } else status=1; if(doc) { char *neo=&tbuf[4+2+2+1+1+1]; if(sscanf(tbuf,"%04x%*[:]%02x%*[:]%02x",&addr,&val,&compare)!=3) continue; namebuf=malloc(strlen(neo)+1); strcpy(namebuf,neo); } else { char *neo=&tbuf[4+2+1+1]; if(sscanf(tbuf,"%04x%*[:]%02x",&addr,&val)!=2) continue; namebuf=malloc(strlen(neo)+1); strcpy(namebuf,neo); } for(x=0;xnext; free(last->name); free(last); if(!next) break; } cheats=cheatsl=0; } } else { char *fn = 0; if(!override) fn = FCEU_MakeFName(FCEUMKF_CHEAT,0,0); if(cheats) { struct CHEATF *next=cheats; FILE *fp; if(override) fp = override; else fp=FCEUD_UTF8fopen(fn,"wb"); if(fp) { for(;;) { struct CHEATF *t; if(next->type) fputc('S',fp); if(next->compare>=0) fputc('C',fp); if(!next->status) fputc(':',fp); if(next->compare>=0) fprintf(fp,"%04x:%02x:%02x:%s\n",next->addr,next->val,next->compare,next->name); else fprintf(fp,"%04x:%02x:%s\n",next->addr,next->val,next->name); free(next->name); t=next; next=next->next; free(t); if(!next) break; } if(!override) fclose(fp); } else FCEUD_PrintError("Error saving cheats."); cheats=cheatsl=0; } else if(!override) remove(fn); if(!override) free(fn); } RebuildSubCheats(); /* Remove memory handlers. */ } int FCEUI_AddCheat(const char *name, uint32 addr, uint8 val, int compare, int type) { char *t; if(!(t=(char *)malloc(strlen(name)+1))) { CheatMemErr(); return(0); } strcpy(t,name); if(!AddCheatEntry(t,addr,val,compare,1,type)) { free(t); return(0); } savecheats=1; RebuildSubCheats(); return(1); } int FCEUI_DelCheat(uint32 which) { struct CHEATF *prev; struct CHEATF *cur; uint32 x=0; for(prev=0,cur=cheats;;) { if(x==which) // Remove this cheat. { if(prev) // Update pointer to this cheat. { if(cur->next) // More cheats. prev->next=cur->next; else // No more. { prev->next=0; cheatsl=prev; // Set the previous cheat as the last cheat. } } else // This is the first cheat. { if(cur->next) // More cheats cheats=cur->next; else cheats=cheatsl=0; // No (more) cheats. } free(cur->name); // Now that all references to this cheat are removed, free(cur); // free the memory. break; } // *END REMOVE THIS CHEAT* if(!cur->next) // No more cheats to go through(this shouldn't ever happen...) return(0); prev=cur; cur=prev->next; x++; } savecheats=1; RebuildSubCheats(); return(1); } void FCEU_ApplyPeriodicCheats(void) { struct CHEATF *cur=cheats; if(!cur) return; for(;;) { if(cur->status && !(cur->type)) if(CheatRPtrs[cur->addr>>10]) CheatRPtrs[cur->addr>>10][cur->addr]=cur->val; if(cur->next) cur=cur->next; else break; } } void FCEUI_ListCheats(int (*callb)(char *name, uint32 a, uint8 v, int compare, int s, int type, void *data), void *data) { struct CHEATF *next=cheats; while(next) { if(!callb(next->name,next->addr,next->val,next->compare,next->status,next->type,data)) break; next=next->next; } } int FCEUI_GetCheat(uint32 which, char **name, uint32 *a, uint8 *v, int *compare, int *s, int *type) { struct CHEATF *next=cheats; uint32 x=0; while(next) { if(x==which) { if(name) *name=next->name; if(a) *a=next->addr; if(v) *v=next->val; if(s) *s=next->status; if(compare) *compare=next->compare; if(type) *type=next->type; return(1); } next=next->next; x++; } return(0); } static int GGtobin(char c) { static char lets[16]={'A','P','Z','L','G','I','T','Y','E','O','X','U','K','S','V','N'}; int x; for(x=0;x<16;x++) if(lets[x] == toupper(c)) return(x); return(0); } /* Returns 1 on success, 0 on failure. Sets *a,*v,*c. */ int FCEUI_DecodeGG(const char *str, uint16 *a, uint8 *v, int *c) { uint16 A; uint8 V,C; uint8 t; int s; A=0x8000; V=0; C=0; s=strlen(str); if(s!=6 && s!=8) return(0); t=GGtobin(*str++); V|=(t&0x07); V|=(t&0x08)<<4; t=GGtobin(*str++); V|=(t&0x07)<<4; A|=(t&0x08)<<4; t=GGtobin(*str++); A|=(t&0x07)<<4; //if(t&0x08) return(0); /* 8-character code?! */ t=GGtobin(*str++); A|=(t&0x07)<<12; A|=(t&0x08); t=GGtobin(*str++); A|=(t&0x07); A|=(t&0x08)<<8; if(s==6) { t=GGtobin(*str++); A|=(t&0x07)<<8; V|=(t&0x08); *a=A; *v=V; *c=-1; return(1); } else { t=GGtobin(*str++); A|=(t&0x07)<<8; C|=(t&0x08); t=GGtobin(*str++); C|=(t&0x07); C|=(t&0x08)<<4; t=GGtobin(*str++); C|=(t&0x07)<<4; V|=(t&0x08); *a=A; *v=V; *c=C; return(1); } return(0); } int FCEUI_DecodePAR(const char *str, uint16 *a, uint8 *v, int *c, int *type) { int boo[4]; if(strlen(str)!=8) return(0); sscanf(str,"%02x%02x%02x%02x",boo,boo+1,boo+2,boo+3); *c=-1; if(1) { *a=(boo[3]<<8)|(boo[2]+0x7F); *v=0; } else { *v=boo[3]; *a=boo[2]|(boo[1]<<8); } /* Zero-page addressing modes don't go through the normal read/write handlers in FCEU, so we must do the old hacky method of RAM cheats. */ if(*a<0x0100) *type=0; else *type=1; return(1); } /* name can be NULL if the name isn't going to be changed. */ /* same goes for a, v, and s(except the values of each one must be <0) */ int FCEUI_SetCheat(uint32 which, const char *name, int32 a, int32 v, int compare,int s, int type) { struct CHEATF *next=cheats; uint32 x=0; while(next) { if(x==which) { if(name) { char *t; if((t=(char *)realloc(next->name,strlen(name+1)))) { next->name=t; strcpy(next->name,name); } else return(0); } if(a>=0) next->addr=a; if(v>=0) next->val=v; if(s>=0) next->status=s; next->compare=compare; next->type=type; savecheats=1; RebuildSubCheats(); return(1); } next=next->next; x++; } return(0); } /* Convenience function. */ int FCEUI_ToggleCheat(uint32 which) { struct CHEATF *next=cheats; uint32 x=0; while(next) { if(x==which) { next->status=!next->status; savecheats=1; RebuildSubCheats(); return(next->status); } next=next->next; x++; } return(-1); } static int InitCheatComp(void) { uint32 x; CheatComp=(uint16*)malloc(65536*sizeof(uint16)); if(!CheatComp) { CheatMemErr(); return(0); } for(x=0;x<65536;x++) CheatComp[x]=CHEATC_NONE; return(1); } void FCEUI_CheatSearchSetCurrentAsOriginal(void) { uint32 x; for(x=0x000;x<0x10000;x++) if(!(CheatComp[x]&CHEATC_NOSHOW)) { if(CheatRPtrs[x>>10]) CheatComp[x]=CheatRPtrs[x>>10][x]; else CheatComp[x]|=CHEATC_NONE; } } void FCEUI_CheatSearchShowExcluded(void) { uint32 x; for(x=0x000;x<0x10000;x++) CheatComp[x]&=~CHEATC_EXCLUDED; } int32 FCEUI_CheatSearchGetCount(void) { uint32 x,c=0; if(CheatComp) { for(x=0x0000;x<0x10000;x++) if(!(CheatComp[x]&CHEATC_NOSHOW) && CheatRPtrs[x>>10]) c++; } return c; } /* This function will give the initial value of the search and the current value at a location. */ void FCEUI_CheatSearchGet(int (*callb)(uint32 a, uint8 last, uint8 current, void *data),void *data) { uint32 x; if(!CheatComp) { if(!InitCheatComp()) CheatMemErr(); return; } for(x=0;x<0x10000;x++) if(!(CheatComp[x]&CHEATC_NOSHOW) && CheatRPtrs[x>>10]) if(!callb(x,CheatComp[x],CheatRPtrs[x>>10][x],data)) break; } void FCEUI_CheatSearchGetRange(uint32 first, uint32 last, int (*callb)(uint32 a, uint8 last, uint8 current)) { uint32 x; uint32 in=0; if(!CheatComp) { if(!InitCheatComp()) CheatMemErr(); return; } for(x=0;x<0x10000;x++) if(!(CheatComp[x]&CHEATC_NOSHOW) && CheatRPtrs[x>>10]) { if(in>=first) if(!callb(x,CheatComp[x],CheatRPtrs[x>>10][x])) break; in++; if(in>last) return; } } void FCEUI_CheatSearchBegin(void) { uint32 x; if(!CheatComp) { if(!InitCheatComp()) { CheatMemErr(); return; } } for(x=0;x<0x10000;x++) { if(CheatRPtrs[x>>10]) CheatComp[x]=CheatRPtrs[x>>10][x]; else CheatComp[x]=CHEATC_NONE; } } static int INLINE CAbs(int x) { if(x<0) return(0-x); return x; } void FCEUI_CheatSearchEnd(int type, uint8 v1, uint8 v2) { uint32 x; if(!CheatComp) { if(!InitCheatComp()) { CheatMemErr(); return; } } if(!type) // Change to a specific value. { for(x=0;x<0x10000;x++) if(!(CheatComp[x]&CHEATC_NOSHOW)) { if(CheatComp[x]==v1 && CheatRPtrs[x>>10][x]==v2) { } else CheatComp[x]|=CHEATC_EXCLUDED; } } else if(type==1) // Search for relative change(between values). { for(x=0;x<0x10000;x++) if(!(CheatComp[x]&CHEATC_NOSHOW)) { if(CheatComp[x]==v1 && CAbs(CheatComp[x]-CheatRPtrs[x>>10][x])==v2) { } else CheatComp[x]|=CHEATC_EXCLUDED; } } else if(type==2) // Purely relative change. { for(x=0x000;x<0x10000;x++) if(!(CheatComp[x]&CHEATC_NOSHOW)) { if(CAbs(CheatComp[x]-CheatRPtrs[x>>10][x])==v2) { } else CheatComp[x]|=CHEATC_EXCLUDED; } } else if(type==3) // Any change. { for(x=0;x<0x10000;x++) if(!(CheatComp[x]&CHEATC_NOSHOW)) { if(CheatComp[x]!=CheatRPtrs[x>>10][x]) { } else CheatComp[x]|=CHEATC_EXCLUDED; } } else if(type==4) // Value decreased. { for(x=0;x<0x10000;x++) if(!(CheatComp[x]&CHEATC_NOSHOW)) { if(!(CheatRPtrs[x>>10][x]>10][x]>CheatComp[x])) CheatComp[x]|=CHEATC_EXCLUDED; } } if(type>4) FCEUI_CheatSearchSetCurrentAsOriginal(); } fceu-0.98.12/src/cheat.h0000644000175000000620000000036510050051071014527 0ustar joestaff00000000000000void FCEU_CheatResetRAM(void); void FCEU_CheatAddRAM(int s, uint32 A, uint8 *p); void FCEU_LoadGameCheats(FILE *override); void FCEU_FlushGameCheats(FILE *override, int nosave); void FCEU_ApplyPeriodicCheats(void); void FCEU_PowerCheats(void); fceu-0.98.12/src/crc32.c0000644000175000000620000000204710030421131014345 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "types.h" #include "crc32.h" #include uint32 CalcCRC32(uint32 crc, uint8 *buf, uint32 len) { return(crc32(crc,buf,len)); } uint32 FCEUI_CRC32(uint32 crc, uint8 *buf, uint32 len) { return(CalcCRC32(crc,buf,len)); } fceu-0.98.12/src/crc32.h0000644000175000000620000000006610003562761014370 0ustar joestaff00000000000000uint32 CalcCRC32(uint32 crc, uint8 *buf, uint32 len); fceu-0.98.12/src/debug.c0000644000175000000620000003125510041621542014534 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 #include "types.h" #include "x6502.h" #include "fceu.h" #include "debug.h" void FCEUI_DumpMem(const char *fname, uint32 start, uint32 end) { FILE *fp=FCEUD_UTF8fopen(fname,"wb"); fceuindbg=1; for(;start<=end;start++) fputc(ARead[start](start),fp); fclose(fp); fceuindbg=0; } void FCEUI_LoadMem(const char *fname, uint32 start, int hl) { int t; FILE *fp=FCEUD_UTF8fopen(fname,"rb"); while((t=fgetc(fp))>=0) { if(start>0xFFFF) break; if(hl) { extern uint8 *Page[32]; if(Page[start/2048]) Page[start/2048][start]=t; } else BWrite[start](start,t); start++; } fclose(fp); } static char *fstrings[12]= { "#$%02X", // immediate "$%04X", // RELATIVE(jump) "$%02X", // Z "$%02X,X", // Z,x "$%02X,Y", // Z,y "$%04X", //ABS "$%04X,X", // ABS,x "$%04X,Y", // ABS,y "($%04X)", // IND "($%02X,X)", // INX "($%02X),Y", // INY "" }; static int flengths[12]={1,1,1,1,1,2,2,2,2,1,1,0}; #define IMD(x) ((0<<16)|x) #define REL(x) ((1<<16)|x) #define ZP(x) ((2<<16)|x) #define ZPX(x) ((3<<16)|x) #define ZPY(x) ((4<<16)|x) #define ABS(x) ((5<<16)|x) #define ABX(x) ((6<<16)|x) #define ABY(x) ((7<<16)|x) #define IND(x) ((8<<16)|x) #define INX(x) ((9<<16)|x) #define INY(x) ((10<<16)|x) #define IMP(x) ((11<<16)|x) typedef struct { char *name; int type; /* 1 for read, 2 for write, 3 for r then write. */ int32 modes[10]; } OPS; #define NUMOPS 56 static OPS optable[NUMOPS]= { {"BRK",0,{IMP(0x00),-1}}, {"RTI",0,{IMP(0x40),-1}}, {"RTS",0,{IMP(0x60),-1}}, {"PHA",2,{IMP(0x48),-1}}, {"PHP",2,{IMP(0x08),-1}}, {"PLA",1,{IMP(0x68),-1}}, {"PLP",1,{IMP(0x28),-1}}, {"JMP",0,{ABS(0x4C),IND(0x6C),-1}}, {"JSR",0,{ABS(0x20),-1}}, {"TAX",0,{IMP(0xAA),-1}}, {"TXA",0,{IMP(0x8A),-1}}, {"TAY",0,{IMP(0xA8),-1}}, {"TYA",0,{IMP(0x98),-1}}, {"TSX",0,{IMP(0xBA),-1}}, {"TXS",0,{IMP(0x9A),-1}}, {"DEX",0,{IMP(0xCA),-1}}, {"DEY",0,{IMP(0x88),-1}}, {"INX",0,{IMP(0xE8),-1}}, {"INY",0,{IMP(0xC8),-1}}, {"CLC",0,{IMP(0x18),-1}}, {"CLD",0,{IMP(0xD8),-1}}, {"CLI",0,{IMP(0x58),-1}}, {"CLV",0,{IMP(0xB8),-1}}, {"SEC",0,{IMP(0x38),-1}}, {"SED",0,{IMP(0xF8),-1}}, {"SEI",0,{IMP(0x78),-1}}, {"NOP",0,{IMP(0xEA),-1}}, {"ASL",1,{IMP(0x0a),ZP(0x06),ZPX(0x16),ABS(0x0E),ABX(0x1E),-1}}, {"DEC",3,{ZP(0xc6),ZPX(0xd6),ABS(0xcE),ABX(0xdE),-1}}, {"INC",3,{ZP(0xe6),ZPX(0xf6),ABS(0xeE),ABX(0xfE),-1}}, {"LSR",3,{IMP(0x4a),ZP(0x46),ZPX(0x56),ABS(0x4E),ABX(0x5E),-1}}, {"ROL",3,{IMP(0x2a),ZP(0x26),ZPX(0x36),ABS(0x2E),ABX(0x3E),-1}}, {"ROR",3,{IMP(0x6a),ZP(0x66),ZPX(0x76),ABS(0x6E),ABX(0x7E),-1}}, {"ADC",1,{IMD(0x69),ZP(0x65),ZPX(0x75),ABS(0x6D),ABX(0x7d),ABY(0x79), INX(0x61),INY(0x71),-1}}, {"AND",1,{IMD(0x29),ZP(0x25),ZPX(0x35),ABS(0x2D),ABX(0x3d),ABY(0x39), INX(0x21),INY(0x31),-1}}, {"BIT",1,{ZP(0x24),ABS(0x2c),-1}}, {"CMP",1,{IMD(0xc9),ZP(0xc5),ZPX(0xd5),ABS(0xcD),ABX(0xdd),ABY(0xd9), INX(0xc1),INY(0xd1),-1}}, {"CPX",1,{IMD(0xe0),ZP(0xe4),ABS(0xec),-1}}, {"CPY",1,{IMD(0xc0),ZP(0xc4),ABS(0xcc),-1}}, {"EOR",1,{IMD(0x49),ZP(0x45),ZPX(0x55),ABS(0x4D),ABX(0x5d),ABY(0x59), INX(0x41),INY(0x51),-1}}, {"LDA",1,{IMD(0xa9),ZP(0xa5),ZPX(0xb5),ABS(0xaD),ABX(0xbd),ABY(0xb9), INX(0xa1),INY(0xb1),-1}}, {"LDX",1,{IMD(0xa2),ZP(0xa6),ZPY(0xB6),ABS(0xae),ABY(0xbe),-1}}, {"LDY",1,{IMD(0xa0),ZP(0xa4),ZPX(0xB4),ABS(0xac),ABX(0xbc),-1}}, {"ORA",1,{IMD(0x09),ZP(0x05),ZPX(0x15),ABS(0x0D),ABX(0x1d),ABY(0x19), INX(0x01),INY(0x11),-1}}, {"SBC",1,{IMD(0xEB),IMD(0xe9),ZP(0xe5),ZPX(0xf5),ABS(0xeD),ABX(0xfd),ABY(0xf9), INX(0xe1),INY(0xf1),-1}}, {"STA",2,{ZP(0x85),ZPX(0x95),ABS(0x8D),ABX(0x9d),ABY(0x99), INX(0x81),INY(0x91),-1}}, {"STX",2,{ZP(0x86),ZPY(0x96),ABS(0x8E),-1}}, {"STY",2,{ZP(0x84),ZPX(0x94),ABS(0x8C),-1}}, {"BCC",1,{REL(0x90),-1}}, {"BCS",1,{REL(0xb0),-1}}, {"BEQ",1,{REL(0xf0),-1}}, {"BNE",1,{REL(0xd0),-1}}, {"BMI",1,{REL(0x30),-1}}, {"BPL",1,{REL(0x10),-1}}, {"BVC",1,{REL(0x50),-1}}, {"BVS",1,{REL(0x70),-1}}, }; uint16 FCEUI_Disassemble(void *XA, uint16 a, char *stringo) { X6502 *X=XA; uint8 buf; unsigned int arg; int32 info; int x; int y; info=-1; fceuindbg=1; buf=ARead[a](a); a++; for(x=0;x=0) { if((optable[x].modes[y]&0xFF)==buf) { info=optable[x].modes[y]; goto endy; } y++; } } endy: sprintf(stringo,"%02X ",buf); if(info>=0) { int z=flengths[(info>>16)]; if(z) { arg=ARead[a](a); sprintf(stringo+strlen(stringo),"%02X ",arg); a++; if(z==2) {arg|=ARead[a](a)<<8;sprintf(stringo+strlen(stringo),"%02X ",arg>>8);a++;} else strcat(stringo," "); if((info>>16)==1) /* Relative branch */ arg=a+(char)arg; sprintf(stringo+strlen(stringo),"%s ",optable[x].name); sprintf(stringo+strlen(stringo),fstrings[info>>16],arg); /* 0 "#$%02X", // immediate 1 "$%04X", // RELATIVE(jump) 2 "$%02X", // Z 3 "$%02X,X", // Z,x 4 "$%02X,Y", // Z,y 5 "$%04X", //ABS 6 "$%04X,X", // ABS,x 7 "$%04X,Y", // ABS,y 8 "($%04X)", // IND 9 "($%02X,X)", // INX 10 "($%02X),Y", // INY 11 #define IMP(x) ((11<<16)|x) */ { unsigned int tmp; switch(info>>16) { case 2:tmp=arg; if(optable[x].type&1) { sprintf(stringo+strlen(stringo)," @ $%04X",tmp); sprintf(stringo+strlen(stringo)," = $%02X",ARead[tmp](tmp)); } break; case 3:tmp=(arg+X->X)&0xff; sprintf(stringo+strlen(stringo)," @ $%04X",tmp); if(optable[x].type&1) sprintf(stringo+strlen(stringo)," = $%02X",ARead[tmp](tmp)); break; case 4:tmp=(arg+X->Y)&0xff; sprintf(stringo+strlen(stringo)," @ $%04X",tmp); if(optable[x].type&1) sprintf(stringo+strlen(stringo)," = $%02X",ARead[tmp](tmp)); break; case 5:tmp=arg; if(optable[x].type&1) { sprintf(stringo+strlen(stringo)," @ $%04X",tmp); sprintf(stringo+strlen(stringo)," = $%02X",ARead[tmp](tmp)); } break; case 6:tmp=(arg+X->X)&0xffff; sprintf(stringo+strlen(stringo)," @ $%04X",tmp); if(optable[x].type&1) sprintf(stringo+strlen(stringo)," = $%02X",ARead[tmp](tmp)); break; case 7:tmp=(arg+X->Y)&0xffff; sprintf(stringo+strlen(stringo)," @ $%04X",tmp); if(optable[x].type&1) sprintf(stringo+strlen(stringo)," = $%02X",ARead[tmp](tmp)); break; case 8:tmp=ARead[arg](arg)|(ARead[(arg+1)&0xffff]((arg+1)&0xffff)<<8); sprintf(stringo+strlen(stringo)," $%04X",tmp); break; case 9:tmp=(arg+X->X)&0xFF; tmp=ARead[tmp](tmp) | (ARead[(tmp+1)&0xFF]((tmp+1)&0xFF)<<8); sprintf(stringo+strlen(stringo)," @ $%04X",tmp); if(optable[x].type&1) sprintf(stringo+strlen(stringo)," = $%02X",ARead[tmp](tmp)); break; case 10:tmp=ARead[arg](arg) | (ARead[(arg+1)&0xFF]((arg+1)&0xFF)<<8); tmp=(tmp+X->Y)&0xFFFF; sprintf(stringo+strlen(stringo)," @ $%04X",tmp); if(optable[x].type&1) sprintf(stringo+strlen(stringo)," = $%02X",ARead[tmp](tmp)); break; } } } else { strcat(stringo," "); strcat(stringo,optable[x].name); } } else sprintf(stringo+strlen(stringo)," .db $%02X",buf); fceuindbg=0; return(a); } void FCEUI_MemDump(uint16 a, int32 len, void (*callb)(uint16 a, uint8 v)) { fceuindbg=1; while(len) { callb(a,ARead[a](a)); a++; len--; } fceuindbg=0; } uint8 FCEUI_MemSafePeek(uint16 A) { uint8 ret; fceuindbg=1; ret=ARead[A](A); fceuindbg=0; return(ret); } void FCEUI_MemPoke(uint16 a, uint8 v, int hl) { extern uint8 *Page[32]; if(hl) { if(Page[a/2048]) Page[a/2048][a]=v; } else BWrite[a](a,v); } typedef struct __BPOINT { struct __BPOINT *next; void (*Handler)(X6502 *X, int type, unsigned int A); unsigned int A[2]; int type; } BPOINT; static BPOINT *BreakPoints=NULL; static BPOINT *LastBP=NULL; static void (*CPUHook)(X6502 *)=NULL; static int FindBPoint(X6502 *X, int who, unsigned int A) { BPOINT *tmp; tmp=BreakPoints; while(tmp) { if(tmp->type&who) { if(tmp->type&BPOINT_PC) if(X->PC!=A) goto don; /* Doesn't match, so go on. */ if((A>=tmp->A[0]) && (A<=tmp->A[1])) /* Whee, match. */ { tmp->Handler(X,tmp->type,A); return(1); } } don: tmp=tmp->next; } return(0); } static uint8 ReadHandler(X6502 *X, unsigned int A) { extern X6502 XSave; if(X->preexec) FindBPoint(&XSave,BPOINT_READ,A); return(ARead[A](A)); } static void WriteHandler(X6502 *X, unsigned int A, uint8 V) { extern X6502 XSave; if(X->preexec) FindBPoint(&XSave,BPOINT_WRITE,A); else BWrite[A](A,V); } int FCEUI_AddBreakPoint(int type, unsigned int A1, unsigned int A2, void (*Handler)(X6502 *, int type, unsigned int A)) { BPOINT *tmp; tmp=(BPOINT *)malloc(sizeof(BPOINT)); tmp->A[0]=A1; tmp->A[1]=A2; tmp->Handler=Handler; tmp->type=type; tmp->next=0; if(BreakPoints==NULL) BreakPoints=tmp; else LastBP->next=tmp; LastBP=tmp; X6502_Debug(CPUHook,ReadHandler,WriteHandler); return(1); } int FCEUI_SetBreakPoint(uint32 w, int type, unsigned int A1, unsigned int A2, void (*Handler)(X6502 *, int type, unsigned int A)) { uint32 x=0; BPOINT *tmp; tmp=BreakPoints; while(tmp) { if(w==x) { tmp->type=type; tmp->A[0]=A1; tmp->A[1]=A2; tmp->Handler=Handler; return(1); } x++; tmp=tmp->next; } return(0); } int FCEUI_GetBreakPoint(uint32 w, int *type, unsigned int *A1, unsigned int *A2, void (**Handler)(X6502 *, int type, unsigned int A)) { uint32 x=0; BPOINT *tmp; tmp=BreakPoints; while(tmp) { if(w==x) { *type=tmp->type; *A1=tmp->A[0]; *A2=tmp->A[1]; *Handler=tmp->Handler; return(1); } x++; tmp=tmp->next; } return(0); } int FCEUI_ListBreakPoints(int (*callb)(int type, unsigned int A1, unsigned int A2, void (*Handler)(X6502 *, int type, unsigned int A) )) { BPOINT *tmp; tmp=BreakPoints; while(tmp) { callb(tmp->type,tmp->A[0],tmp->A[1],tmp->Handler); tmp=tmp->next; } return(1); } int FCEUI_DeleteBreakPoint(uint32 w) { BPOINT *tmp,*prev=NULL; uint32 x=0; tmp=BreakPoints; while(tmp) { if(w==x) { if(prev) /* Not the first breakpoint. */ { if(tmp->next) /* More breakpoints. */ prev->next=tmp->next; else /* This is the last breakpoint. */ { prev->next=0; LastBP=prev; } } else /* The first breakpoint. */ { if(tmp->next) /* More breakpoints. */ BreakPoints=tmp->next; else { BreakPoints=LastBP=0; /* No more breakpoints. */ /* Update the CPU hooks. */ X6502_Debug(CPUHook,BreakPoints?ReadHandler:0,BreakPoints?WriteHandler:0); } } free(tmp); return(1); } prev=tmp; tmp=tmp->next; x++; } return(0); } void FCEUI_SetCPUCallback(void (*callb)(X6502 *X)) { CPUHook=callb; X6502_Debug(CPUHook,BreakPoints?ReadHandler:0,BreakPoints?WriteHandler:0); } fceu-0.98.12/src/debug.h0000644000175000000620000000166710003562761014552 0ustar joestaff00000000000000 /* Type attributes, you can OR them together. */ #define BPOINT_READ 1 #define BPOINT_WRITE 2 #define BPOINT_PC 4 #include "x6502struct.h" void FCEUI_DumpMem(const char *fname, uint32 start, uint32 end); void FCEUI_LoadMem(const char *fname, uint32 start, int hl); void FCEUI_SetCPUCallback(void (*callb)(X6502 *X)); int FCEUI_DeleteBreakPoint(uint32 w); int FCEUI_ListBreakPoints(int (*callb)(int type, unsigned int A1, unsigned int A2, void (*Handler)(X6502 *, int type, unsigned int A) )); int FCEUI_GetBreakPoint(uint32 w, int *type, unsigned int *A1, unsigned int *A2, void (**Handler)(X6502 *, int type, unsigned int A)); int FCEUI_SetBreakPoint(uint32 w, int type, unsigned int A1, unsigned int A2, void (*Handler)(X6502 *, int type, unsigned int A)); int FCEUI_AddBreakPoint(int type, unsigned int A1, unsigned int A2, void (*Handler)(X6502 *, int type, unsigned int A)); fceu-0.98.12/src/Makefile.am0000644000175000000620000000136510040103307015326 0ustar joestaff00000000000000AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = fceu fceu_SOURCES = fceustr.c cart.c cheat.c crc32.c debug.c endian.c fceu.c fds.c file.c filter.c general.c ines.c input.c md5.c memory.c netplay.c nsf.c palette.c ppu.c sound.c state.c unif.c video.c vsuni.c wave.c x6502.c movie.c # soundexp.c fceu_SOURCES += unzip.c include boards/Makefile.am.inc include input/Makefile.am.inc include mappers/Makefile.am.inc include mbshare/Makefile.am.inc include drivers/common/Makefile.am.inc if USE_SEXYAL include drivers/sexyal/Makefile.am.inc endif fceu_SOURCES += $(sexyal_SOURCES) if NATIVEWIN32 include drivers/win/Makefile.am.inc else include drivers/pc/Makefile.am.inc endif fceu_SOURCES += $(fceud_SOURCES) DEFAULT_INCLUDES = fceu-0.98.12/src/drawing.h0000644000175000000620000006027310027744537015126 0ustar joestaff00000000000000void DrawTextLineBG(uint8 *dest) { int x,y; static int otable[7]={81,49,30,17,8,3,0}; //100,40,15,10,7,5,2}; for(y=0;y<14;y++) { int offs; if(y>=7) offs=otable[13-y]; else offs=otable[y]; for(x=offs;x<(256-offs);x++) dest[y*256+x]=(dest[y*256+x]&0x0f)|0xC0;//&=0xe0; //0x80; } } static void DrawMessage(void) { if(howlong) { uint8 *t; howlong--; t=XBuf+(FSettings.LastSLine-16)*256; if(t>=XBuf) { DrawTextLineBG(t); DrawTextTrans(t+256*3+(128-strlen(errmsg)*4),256,(uint8 *)errmsg,4); } } } uint8 fontdata2[2048] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x81,0xa5,0x81,0xbd,0x99,0x81,0x7e,0x7e,0xff,0xdb,0xff,0xc3,0xe7,0xff,0x7e,0x36,0x7f,0x7f,0x7f,0x3e,0x1c,0x08,0x00,0x08,0x1c,0x3e,0x7f,0x3e,0x1c,0x08,0x00,0x1c,0x3e,0x1c,0x7f,0x7f,0x3e,0x1c,0x3e,0x08,0x08,0x1c,0x3e,0x7f,0x3e,0x1c,0x3e,0x00,0x00,0x18,0x3c,0x3c,0x18,0x00,0x00,0xff,0xff,0xe7,0xc3,0xc3,0xe7,0xff,0xff,0x00,0x3c,0x66,0x42,0x42,0x66,0x3c,0x00,0xff,0xc3,0x99,0xbd,0xbd,0x99,0xc3,0xff,0xf0,0xe0,0xf0,0xbe,0x33,0x33,0x33,0x1e,0x3c,0x66,0x66,0x66,0x3c,0x18,0x7e,0x18,0xfc,0xcc,0xfc,0x0c,0x0c,0x0e,0x0f,0x07,0xfe,0xc6,0xfe,0xc6,0xc6,0xe6,0x67,0x03,0x99,0x5a,0x3c,0xe7,0xe7,0x3c,0x5a,0x99,0x01,0x07,0x1f,0x7f,0x1f,0x07,0x01,0x00,0x40,0x70,0x7c,0x7f,0x7c,0x70,0x40,0x00,0x18,0x3c,0x7e,0x18,0x18,0x7e,0x3c,0x18,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x00,0xfe,0xdb,0xdb,0xde,0xd8,0xd8,0xd8,0x00,0x7c,0xc6,0x1c,0x36,0x36,0x1c,0x33,0x1e,0x00,0x00,0x00,0x00,0x7e,0x7e,0x7e,0x00,0x18,0x3c,0x7e,0x18,0x7e,0x3c,0x18,0xff,0x18,0x3c,0x7e,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,0x00,0x18,0x30,0x7f,0x30,0x18,0x00,0x00,0x00,0x0c,0x06,0x7f,0x06,0x0c,0x00,0x00,0x00,0x00,0x03,0x03,0x03,0x7f,0x00,0x00,0x00,0x24,0x66,0xff,0x66,0x24,0x00,0x00,0x00,0x18,0x3c,0x7e,0xff,0xff,0x00,0x00,0x00,0xff,0xff,0x7e,0x3c,0x18,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x1e,0x1e,0x0c,0x0c,0x00,0x0c,0x00,0x36,0x36,0x36,0x00,0x00,0x00,0x00,0x00,0x36,0x36,0x7f,0x36,0x7f,0x36,0x36,0x00,0x0c,0x3e,0x03,0x1e,0x30,0x1f,0x0c,0x00,0x00,0x63,0x33,0x18,0x0c,0x66,0x63,0x00,0x1c,0x36,0x1c,0x6e,0x3b,0x33,0x6e,0x00,0x06,0x06,0x03,0x00,0x00,0x00,0x00,0x00,0x18,0x0c,0x06,0x06,0x06,0x0c,0x18,0x00,0x06,0x0c,0x18,0x18,0x18,0x0c,0x06,0x00,0x00,0x66,0x3c,0xff,0x3c,0x66,0x00,0x00,0x00,0x0c,0x0c,0x3f,0x0c,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x0c,0x06,0x00,0x00,0x00,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x0c,0x00,0x60,0x30,0x18,0x0c,0x06,0x03,0x01,0x00,0x3e,0x63,0x73,0x7b,0x6f,0x67,0x3e,0x00,0x0c,0x0e,0x0c,0x0c,0x0c,0x0c,0x3f,0x00,0x1e,0x33,0x30,0x1c,0x06,0x33,0x3f,0x00,0x1e,0x33,0x30,0x1c,0x30,0x33,0x1e,0x00,0x38,0x3c,0x36,0x33,0x7f,0x30,0x78,0x00,0x3f,0x03,0x1f,0x30,0x30,0x33,0x1e,0x00,0x1c,0x06,0x03,0x1f,0x33,0x33,0x1e,0x00,0x3f,0x33,0x30,0x18,0x0c,0x0c,0x0c,0x00,0x1e,0x33,0x33,0x1e,0x33,0x33,0x1e,0x00,0x1e,0x33,0x33,0x3e,0x30,0x18,0x0e,0x00,0x00,0x0c,0x0c,0x00,0x00,0x0c,0x0c,0x00,0x00,0x0c,0x0c,0x00,0x00,0x0c,0x0c,0x06,0x18,0x0c,0x06,0x03,0x06,0x0c,0x18,0x00,0x00,0x00,0x3f,0x00,0x00,0x3f,0x00,0x00,0x06,0x0c,0x18,0x30,0x18,0x0c,0x06,0x00,0x1e,0x33,0x30,0x18,0x0c,0x00,0x0c,0x00, 0x3e,0x63,0x7b,0x7b,0x7b,0x03,0x1e,0x00,0x0c,0x1e,0x33,0x33,0x3f,0x33,0x33,0x00,0x3f,0x66,0x66,0x3e,0x66,0x66,0x3f,0x00,0x3c,0x66,0x03,0x03,0x03,0x66,0x3c,0x00,0x1f,0x36,0x66,0x66,0x66,0x36,0x1f,0x00,0x7f,0x46,0x16,0x1e,0x16,0x46,0x7f,0x00,0x7f,0x46,0x16,0x1e,0x16,0x06,0x0f,0x00,0x3c,0x66,0x03,0x03,0x73,0x66,0x7c,0x00,0x33,0x33,0x33,0x3f,0x33,0x33,0x33,0x00,0x1e,0x0c,0x0c,0x0c,0x0c,0x0c,0x1e,0x00,0x78,0x30,0x30,0x30,0x33,0x33,0x1e,0x00,0x67,0x66,0x36,0x1e,0x36,0x66,0x67,0x00,0x0f,0x06,0x06,0x06,0x46,0x66,0x7f,0x00,0x63,0x77,0x7f,0x7f,0x6b,0x63,0x63,0x00,0x63,0x67,0x6f,0x7b,0x73,0x63,0x63,0x00,0x1c,0x36,0x63,0x63,0x63,0x36,0x1c,0x00,0x3f,0x66,0x66,0x3e,0x06,0x06,0x0f,0x00,0x1e,0x33,0x33,0x33,0x3b,0x1e,0x38,0x00,0x3f,0x66,0x66,0x3e,0x36,0x66,0x67,0x00,0x1e,0x33,0x07,0x0e,0x38,0x33,0x1e,0x00,0x3f,0x2d,0x0c,0x0c,0x0c,0x0c,0x1e,0x00,0x33,0x33,0x33,0x33,0x33,0x33,0x3f,0x00,0x33,0x33,0x33,0x33,0x33,0x1e,0x0c,0x00,0x63,0x63,0x63,0x6b,0x7f,0x77,0x63,0x00,0x63,0x63,0x36,0x1c,0x1c,0x36,0x63,0x00,0x33,0x33,0x33,0x1e,0x0c,0x0c,0x1e,0x00,0x7f,0x63,0x31,0x18,0x4c,0x66,0x7f,0x00,0x1e,0x06,0x06,0x06,0x06,0x06,0x1e,0x00,0x03,0x06,0x0c,0x18,0x30,0x60,0x40,0x00,0x1e,0x18,0x18,0x18,0x18,0x18,0x1e,0x00,0x08,0x1c,0x36,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff, 0x0c,0x0c,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0x30,0x3e,0x33,0x6e,0x00,0x07,0x06,0x06,0x3e,0x66,0x66,0x3b,0x00,0x00,0x00,0x1e,0x33,0x03,0x33,0x1e,0x00,0x38,0x30,0x30,0x3e,0x33,0x33,0x6e,0x00,0x00,0x00,0x1e,0x33,0x3f,0x03,0x1e,0x00,0x1c,0x36,0x06,0x0f,0x06,0x06,0x0f,0x00,0x00,0x00,0x6e,0x33,0x33,0x3e,0x30,0x1f,0x07,0x06,0x36,0x6e,0x66,0x66,0x67,0x00,0x0c,0x00,0x0e,0x0c,0x0c,0x0c,0x1e,0x00,0x30,0x00,0x30,0x30,0x30,0x33,0x33,0x1e,0x07,0x06,0x66,0x36,0x1e,0x36,0x67,0x00,0x0e,0x0c,0x0c,0x0c,0x0c,0x0c,0x1e,0x00,0x00,0x00,0x33,0x7f,0x7f,0x6b,0x63,0x00,0x00,0x00,0x1f,0x33,0x33,0x33,0x33,0x00,0x00,0x00,0x1e,0x33,0x33,0x33,0x1e,0x00,0x00,0x00,0x3b,0x66,0x66,0x3e,0x06,0x0f,0x00,0x00,0x6e,0x33,0x33,0x3e,0x30,0x78,0x00,0x00,0x3b,0x6e,0x66,0x06,0x0f,0x00,0x00,0x00,0x3e,0x03,0x1e,0x30,0x1f,0x00,0x08,0x0c,0x3e,0x0c,0x0c,0x2c,0x18,0x00,0x00,0x00,0x33,0x33,0x33,0x33,0x6e,0x00,0x00,0x00,0x33,0x33,0x33,0x1e,0x0c,0x00,0x00,0x00,0x63,0x6b,0x7f,0x7f,0x36,0x00,0x00,0x00,0x63,0x36,0x1c,0x36,0x63,0x00,0x00,0x00,0x33,0x33,0x33,0x3e,0x30,0x1f,0x00,0x00,0x3f,0x19,0x0c,0x26,0x3f,0x00,0x38,0x0c,0x0c,0x07,0x0c,0x0c,0x38,0x00,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x00,0x07,0x0c,0x0c,0x38,0x0c,0x0c,0x07,0x00,0x6e,0x3b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x1c,0x36,0x63,0x63,0x7f,0x00, 0x1e,0x33,0x03,0x33,0x1e,0x18,0x30,0x1e,0x00,0x33,0x00,0x33,0x33,0x33,0x7e,0x00,0x38,0x00,0x1e,0x33,0x3f,0x03,0x1e,0x00,0x7e,0xc3,0x3c,0x60,0x7c,0x66,0xfc,0x00,0x33,0x00,0x1e,0x30,0x3e,0x33,0x7e,0x00,0x07,0x00,0x1e,0x30,0x3e,0x33,0x7e,0x00,0x0c,0x0c,0x1e,0x30,0x3e,0x33,0x7e,0x00,0x00,0x00,0x1e,0x03,0x03,0x1e,0x30,0x1c,0x7e,0xc3,0x3c,0x66,0x7e,0x06,0x3c,0x00,0x33,0x00,0x1e,0x33,0x3f,0x03,0x1e,0x00,0x07,0x00,0x1e,0x33,0x3f,0x03,0x1e,0x00,0x33,0x00,0x0e,0x0c,0x0c,0x0c,0x1e,0x00,0x3e,0x63,0x1c,0x18,0x18,0x18,0x3c,0x00,0x07,0x00,0x0e,0x0c,0x0c,0x0c,0x1e,0x00,0x63,0x1c,0x36,0x63,0x7f,0x63,0x63,0x00,0x0c,0x0c,0x00,0x1e,0x33,0x3f,0x33,0x00,0x38,0x00,0x3f,0x06,0x1e,0x06,0x3f,0x00,0x00,0x00,0xfe,0x30,0xfe,0x33,0xfe,0x00,0x7c,0x36,0x33,0x7f,0x33,0x33,0x73,0x00,0x1e,0x33,0x00,0x1e,0x33,0x33,0x1e,0x00,0x00,0x33,0x00,0x1e,0x33,0x33,0x1e,0x00,0x00,0x07,0x00,0x1e,0x33,0x33,0x1e,0x00,0x1e,0x33,0x00,0x33,0x33,0x33,0x7e,0x00,0x00,0x07,0x00,0x33,0x33,0x33,0x7e,0x00,0x00,0x33,0x00,0x33,0x33,0x3e,0x30,0x1f,0xc3,0x18,0x3c,0x66,0x66,0x3c,0x18,0x00,0x33,0x00,0x33,0x33,0x33,0x33,0x1e,0x00,0x18,0x18,0x7e,0x03,0x03,0x7e,0x18,0x18,0x1c,0x36,0x26,0x0f,0x06,0x67,0x3f,0x00,0x33,0x33,0x1e,0x3f,0x0c,0x3f,0x0c,0x0c,0x1f,0x33,0x33,0x5f,0x63,0xf3,0x63,0xe3,0x70,0xd8,0x18,0x3c,0x18,0x18,0x1b,0x0e, 0x38,0x00,0x1e,0x30,0x3e,0x33,0x7e,0x00,0x1c,0x00,0x0e,0x0c,0x0c,0x0c,0x1e,0x00,0x00,0x38,0x00,0x1e,0x33,0x33,0x1e,0x00,0x00,0x38,0x00,0x33,0x33,0x33,0x7e,0x00,0x00,0x1f,0x00,0x1f,0x33,0x33,0x33,0x00,0x3f,0x00,0x33,0x37,0x3f,0x3b,0x33,0x00,0x3c,0x36,0x36,0x7c,0x00,0x7e,0x00,0x00,0x1c,0x36,0x36,0x1c,0x00,0x3e,0x00,0x00,0x0c,0x00,0x0c,0x06,0x03,0x33,0x1e,0x00,0x00,0x00,0x00,0x3f,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x3f,0x30,0x30,0x00,0x00,0xc3,0x63,0x33,0x7b,0xcc,0x66,0x33,0xf0,0xc3,0x63,0x33,0xdb,0xec,0xf6,0xf3,0xc0,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x00,0x00,0xcc,0x66,0x33,0x66,0xcc,0x00,0x00,0x00,0x33,0x66,0xcc,0x66,0x33,0x00,0x00,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xdb,0xee,0xdb,0x77,0xdb,0xee,0xdb,0x77,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x1f,0x18,0x18,0x18,0x6c,0x6c,0x6c,0x6c,0x6f,0x6c,0x6c,0x6c,0x00,0x00,0x00,0x00,0x7f,0x6c,0x6c,0x6c,0x00,0x00,0x1f,0x18,0x1f,0x18,0x18,0x18,0x6c,0x6c,0x6f,0x60,0x6f,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x00,0x00,0x7f,0x60,0x6f,0x6c,0x6c,0x6c,0x6c,0x6c,0x6f,0x60,0x7f,0x00,0x00,0x00,0x6c,0x6c,0x6c,0x6c,0x7f,0x00,0x00,0x00,0x18,0x18,0x1f,0x18,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x18,0x18,0x18, 0x18,0x18,0x18,0x18,0xf8,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0xff,0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0xf8,0x18,0x18,0x18,0x6c,0x6c,0x6c,0x6c,0xec,0x6c,0x6c,0x6c,0x6c,0x6c,0xec,0x0c,0xfc,0x00,0x00,0x00,0x00,0x00,0xfc,0x0c,0xec,0x6c,0x6c,0x6c,0x6c,0x6c,0xef,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xef,0x6c,0x6c,0x6c,0x6c,0x6c,0xec,0x0c,0xec,0x6c,0x6c,0x6c,0x00,0x00,0xff,0x00,0xff,0x00,0x00,0x00,0x6c,0x6c,0xef,0x00,0xef,0x6c,0x6c,0x6c,0x18,0x18,0xff,0x00,0xff,0x00,0x00,0x00,0x6c,0x6c,0x6c,0x6c,0xff,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0xff,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0xfc,0x00,0x00,0x00,0x18,0x18,0xf8,0x18,0xf8,0x00,0x00,0x00,0x00,0x00,0xf8,0x18,0xf8,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0xfc,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0xff,0x6c,0x6c,0x6c,0x18,0x18,0xff,0x18,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x18,0x18,0x18,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00, 0x00,0x00,0x6e,0x3b,0x13,0x3b,0x6e,0x00,0x00,0x1e,0x33,0x1f,0x33,0x1f,0x03,0x03,0x00,0x3f,0x33,0x03,0x03,0x03,0x03,0x00,0x00,0x7f,0x36,0x36,0x36,0x36,0x36,0x00,0x3f,0x33,0x06,0x0c,0x06,0x33,0x3f,0x00,0x00,0x00,0x7e,0x1b,0x1b,0x1b,0x0e,0x00,0x00,0x66,0x66,0x66,0x66,0x3e,0x06,0x03,0x00,0x6e,0x3b,0x18,0x18,0x18,0x18,0x00,0x3f,0x0c,0x1e,0x33,0x33,0x1e,0x0c,0x3f,0x1c,0x36,0x63,0x7f,0x63,0x36,0x1c,0x00,0x1c,0x36,0x63,0x63,0x36,0x36,0x77,0x00,0x38,0x0c,0x18,0x3e,0x33,0x33,0x1e,0x00,0x00,0x00,0x7e,0xdb,0xdb,0x7e,0x00,0x00,0x60,0x30,0x7e,0xdb,0xdb,0x7e,0x06,0x03,0x1c,0x06,0x03,0x1f,0x03,0x06,0x1c,0x00,0x1e,0x33,0x33,0x33,0x33,0x33,0x33,0x00,0x00,0x3f,0x00,0x3f,0x00,0x3f,0x00,0x00,0x0c,0x0c,0x3f,0x0c,0x0c,0x00,0x3f,0x00,0x06,0x0c,0x18,0x0c,0x06,0x00,0x3f,0x00,0x18,0x0c,0x06,0x0c,0x18,0x00,0x3f,0x00,0x70,0xd8,0xd8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1b,0x1b,0x0e,0x0c,0x0c,0x00,0x3f,0x00,0x0c,0x0c,0x00,0x00,0x6e,0x3b,0x00,0x6e,0x3b,0x00,0x00,0x1c,0x36,0x36,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0xf0,0x30,0x30,0x30,0x37,0x36,0x3c,0x38,0x1e,0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x0e,0x18,0x0c,0x06,0x1e,0x00,0x00,0x00,0x00,0x00,0x3c,0x3c,0x3c,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; void DrawTextTrans(uint8 *dest, uint32 width, uint8 *textmsg, uint8 fgcolor) { uint8 length=strlen((char *)textmsg); uint8 x; uint8 y; uint8 z; for(x=0;x>z)&1) dest[y*width+(x<<3)+z]=fgcolor; } static uint8 sstat[2541] = { 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83, 0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x83,0x83,0x83, 0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x80,0x83, 0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81, 0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x80,0x80,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x81,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x80,0x80,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x80,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x81,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x81,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x81,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x80,0x80,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x80,0x80,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x83,0x83, 0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x81,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83, 0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x80,0x80,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x80,0x80,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83, 0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x80,0x80,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83, 0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x83,0x80,0x80,0x81,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x80,0x83,0x83,0x81,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x81,0x81,0x81,0x83,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 }; void FCEU_DrawNumberRow(uint8 *XBuf, int *nstatus, int cur) { uint8 *XBaf; int z,x,y; XBaf=XBuf - 4 + (FSettings.LastSLine-34)*256; if(XBaf>=XBuf) for(z=1;z<11;z++) { if(nstatus[z%10]) { for(y=0;y<13;y++) for(x=0;x<21;x++) XBaf[y*256+x+z*21+z]=sstat[y*21+x+(z-1)*21*12]^0x80; } else { for(y=0;y<13;y++) for(x=0;x<21;x++) if(sstat[y*21+x+(z-1)*21*12]!=0x83) XBaf[y*256+x+z*21+z]=sstat[y*21+x+(z-1)*21*12]^0x80; else XBaf[y*256+x+z*21+z]=(XBaf[y*256+x+z*21+z]&0xF)|0xC0; } if(cur==z%10) { for(x=0;x<21;x++) XBaf[x+z*21+z*1]=4; for(x=1;x<12;x++) { XBaf[256*x+z*21+z*1]= XBaf[256*x+z*21+z*1+20]=4; } for(x=0;x<21;x++) XBaf[12*256+x+z*21+z*1]=4; } } } fceu-0.98.12/src/driver.h0000644000175000000620000001611510110500365014740 0ustar joestaff00000000000000#include #ifdef __cplusplus extern "C" { #endif #include "types.h" #include "git.h" #include "debug.h" FILE *FCEUD_UTF8fopen(const char *fn, const char *mode); /* This makes me feel dirty for some reason. */ void FCEU_printf(char *format, ...); #define FCEUI_printf FCEU_printf /* Video interface */ void FCEUD_SetPalette(uint8 index, uint8 r, uint8 g, uint8 b); void FCEUD_GetPalette(uint8 i,uint8 *r, uint8 *g, uint8 *b); /* Displays an error. Can block or not. */ void FCEUD_PrintError(char *s); void FCEUD_Message(char *s); #ifdef NETWORK /* Network interface */ /* Call only when a game is loaded. */ int FCEUI_NetplayStart(int nlocal, int divisor); /* Call when network play needs to stop. */ void FCEUI_NetplayStop(void); /* Note: YOU MUST NOT CALL ANY FCEUI_* FUNCTIONS WHILE IN FCEUD_SendData() or FCEUD_RecvData(). */ /* Return 0 on failure, 1 on success. */ int FCEUD_SendData(void *data, uint32 len); int FCEUD_RecvData(void *data, uint32 len); /* Display text received over the network. */ void FCEUD_NetplayText(uint8 *text); /* Encode and send text over the network. */ void FCEUI_NetplayText(uint8 *text); /* Called when a fatal error occurred and network play can't continue. This function should call FCEUI_NetplayStop() after it has deinitialized the network on the driver side. */ void FCEUD_NetworkClose(void); #endif int FCEUI_BeginWaveRecord(char *fn); int FCEUI_EndWaveRecord(void); void FCEUI_ResetNES(void); void FCEUI_PowerNES(void); void FCEUI_NTSCSELHUE(void); void FCEUI_NTSCSELTINT(void); void FCEUI_NTSCDEC(void); void FCEUI_NTSCINC(void); void FCEUI_GetNTSCTH(int *tint, int *hue); void FCEUI_SetNTSCTH(int n, int tint, int hue); void FCEUI_SetInput(int port, int type, void *ptr, int attrib); void FCEUI_SetInputFC(int type, void *ptr, int attrib); void FCEUI_DisableFourScore(int s); #define SI_NONE 0 #define SI_GAMEPAD 1 #define SI_ZAPPER 2 #define SI_POWERPADA 3 #define SI_POWERPADB 4 #define SI_ARKANOID 5 #define SIFC_NONE 0 #define SIFC_ARKANOID 1 #define SIFC_SHADOW 2 #define SIFC_4PLAYER 3 #define SIFC_FKB 4 #define SIFC_HYPERSHOT 5 #define SIFC_MAHJONG 6 #define SIFC_QUIZKING 7 #define SIFC_FTRAINERA 8 #define SIFC_FTRAINERB 9 #define SIFC_OEKAKIDS 10 #define SIFC_BWORLD 11 #define SIFC_TOPRIDER 12 #define SIS_NONE 0 #define SIS_DATACH 1 #define SIS_NWC 2 #define SIS_VSUNISYSTEM 3 #define SIS_NSF 4 /* New interface functions */ /* 0 to order screen snapshots numerically(0.png), 1 to order them file base-numerically(smb3-0.png). */ void FCEUI_SetSnapName(int a); /* 0 to keep 8-sprites limitation, 1 to remove it */ void FCEUI_DisableSpriteLimitation(int a); /* -1 = no change, 0 = show, 1 = hide, 2 = internal toggle */ void FCEUI_SetRenderDisable(int sprites, int bg); /* name=path and file to load. returns 0 on failure, 1 on success */ FCEUGI *FCEUI_LoadGame(const char *name); /* allocates memory. 0 on failure, 1 on success. */ int FCEUI_Initialize(void); /* Emulates a frame. */ void FCEUI_Emulate(uint8 **, int32 **, int32 *, int); /* Closes currently loaded game */ void FCEUI_CloseGame(void); /* Deallocates all allocated memory. Call after FCEUI_Emulate() returns. */ void FCEUI_Kill(void); /* Enable/Disable game genie. a=0 disable, a=1 enable */ void FCEUI_SetGameGenie(int a); /* Set video system a=0 NTSC, a=1 PAL */ void FCEUI_SetVidSystem(int a); /* Convenience function; returns currently emulated video system(0=NTSC, 1=PAL). */ int FCEUI_GetCurrentVidSystem(int *slstart, int *slend); #ifdef FRAMESKIP /* Should be called from FCEUD_BlitScreen(). Specifies how many frames to skip until FCEUD_BlitScreen() is called. FCEUD_BlitScreenDummy() will be called instead of FCEUD_BlitScreen() when when a frame is skipped. */ void FCEUI_FrameSkip(int x); #endif /* First and last scanlines to render, for ntsc and pal emulation. */ void FCEUI_SetRenderedLines(int ntscf, int ntscl, int palf, int pall); /* Sets the base directory(save states, snapshots, etc. are saved in directories below this directory. */ void FCEUI_SetBaseDirectory(char *dir); /* Tells FCE Ultra to copy the palette data pointed to by pal and use it. Data pointed to by pal needs to be 64*3 bytes in length. */ void FCEUI_SetPaletteArray(uint8 *pal); /* Sets up sound code to render sound at the specified rate, in samples per second. Only sample rates of 44100, 48000, and 96000 are currently supported. If "Rate" equals 0, sound is disabled. */ void FCEUI_Sound(int Rate); void FCEUI_SetSoundVolume(uint32 volume); void FCEUI_SetSoundQuality(int quality); void FCEUI_SelectState(int); /* "fname" overrides the default save state filename code if non-NULL. */ void FCEUI_SaveState(char *fname); void FCEUI_LoadState(char *fname); void FCEUI_SelectMovie(int); void FCEUI_SaveMovie(char *fname); void FCEUI_LoadMovie(char *fname); int32 FCEUI_GetDesiredFPS(void); void FCEUI_SaveSnapshot(void); void FCEU_DispMessage(char *format, ...); #define FCEUI_DispMessage FCEU_DispMessage int FCEUI_DecodePAR(const char *code, uint16 *a, uint8 *v, int *c, int *type); int FCEUI_DecodeGG(const char *str, uint16 *a, uint8 *v, int *c); int FCEUI_AddCheat(const char *name, uint32 addr, uint8 val, int compare, int type); int FCEUI_DelCheat(uint32 which); int FCEUI_ToggleCheat(uint32 which); int32 FCEUI_CheatSearchGetCount(void); void FCEUI_CheatSearchGetRange(uint32 first, uint32 last, int (*callb)(uint32 a, uint8 last, uint8 current)); void FCEUI_CheatSearchGet(int (*callb)(uint32 a, uint8 last, uint8 current, void *data), void *data); void FCEUI_CheatSearchBegin(void); void FCEUI_CheatSearchEnd(int type, uint8 v1, uint8 v2); void FCEUI_ListCheats(int (*callb)(char *name, uint32 a, uint8 v, int compare, int s, int type, void *data), void *data); int FCEUI_GetCheat(uint32 which, char **name, uint32 *a, uint8 *v, int *compare, int *s, int *type); int FCEUI_SetCheat(uint32 which, const char *name, int32 a, int32 v, int compare,int s, int type); void FCEUI_CheatSearchShowExcluded(void); void FCEUI_CheatSearchSetCurrentAsOriginal(void); #define FCEUIOD_STATE 0 #define FCEUIOD_SNAPS 1 #define FCEUIOD_NV 2 #define FCEUIOD_CHEATS 3 #define FCEUIOD_MISC 4 #define FCEUIOD_MOVIE 5 #define FCEUIOD__COUNT 6 void FCEUI_SetDirOverride(int which, char *n); void FCEUI_MemDump(uint16 a, int32 len, void (*callb)(uint16 a, uint8 v)); uint8 FCEUI_MemSafePeek(uint16 A); void FCEUI_MemPoke(uint16 a, uint8 v, int hl); void FCEUI_NMI(void); void FCEUI_IRQ(void); uint16 FCEUI_Disassemble(void *XA, uint16 a, char *stringo); void FCEUI_GetIVectors(uint16 *reset, uint16 *irq, uint16 *nmi); uint32 FCEUI_CRC32(uint32 crc, uint8 *buf, uint32 len); void FCEUI_ToggleTileView(void); void FCEUI_SetLowPass(int q); void FCEUI_NSFSetVis(int mode); int FCEUI_NSFChange(int amount); int FCEUI_NSFGetInfo(uint8 *name, uint8 *artist, uint8 *copyright, int maxlen); void FCEUI_VSUniToggleDIPView(void); void FCEUI_VSUniToggleDIP(int w); uint8 FCEUI_VSUniGetDIPs(void); void FCEUI_VSUniSetDIP(int w, int state); void FCEUI_VSUniCoin(void); int FCEUI_FDSInsert(int oride); int FCEUI_FDSEject(void); void FCEUI_FDSSelect(void); int FCEUI_DatachSet(const uint8 *rcode); #ifdef __cplusplus } #endif fceu-0.98.12/src/drivers/0002755000175000000620000000000010040073575014762 5ustar joestaff00000000000000fceu-0.98.12/src/drivers/common/0002755000175000000620000000000010111545623016247 5ustar joestaff00000000000000fceu-0.98.12/src/drivers/common/config.c0000644000175000000620000000665510003562761017674 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ /****************************************************************/ /* FCE Ultra */ /* */ /* This file contains routines for reading/writing the */ /* configuration file. */ /* */ /****************************************************************/ #include #include #include #include "../../types.h" #include "config.h" static int FReadString(FILE *fp, char *str, int n) { int x=0,z; for(;;) { z=fgetc(fp); str[x]=z; x++; if(z<=0) break; if(x>=n) return 0; } if(z<0) return 0; return 1; } static void GetValueR(FILE *fp, char *str, void *v, int c) { char buf[256]; int s; while(FReadString(fp,buf,256)) { fread(&s,1,4,fp); if(!strcmp(str, buf)) { if(!c) // String, allocate some memory. { if(!(*(char **)v=(char*)malloc(s))) goto gogl; fread(*(char **)v,1,s,fp); continue; } else if(s>c || s #include #include #include "../../types.h" #include "args.h" void ParseEA(int x, int argc, char *argv[], ARGPSTRUCT *argsps) { int y=0; do { if(!argsps[y].name) { ParseEA(x,argc,argv,(ARGPSTRUCT*)argsps[y].var); y++; continue; } if(!strcmp(argv[x],argsps[y].name)) // A match. { if(argsps[y].subs) { if((x+1)>=argc) break; if(argsps[y].substype&0x2000) { ((void (*)(char *))argsps[y].subs)(argv[x+1]); } else if(argsps[y].substype&0x8000) { *(int *)argsps[y].subs&=~(argsps[y].substype&(~0x8000)); *(int *)argsps[y].subs|=atoi(argv[x+1])?(argsps[y].substype&(~0x8000)):0; } else switch(argsps[y].substype&(~0x4000)) { case 0: // Integer *(int *)argsps[y].subs=atoi(argv[x+1]); break; case 2: // Double float *(double *)argsps[y].subs=atof(argv[x+1]); break; case 1: // String if(argsps[y].substype&0x4000) { if(*(char **)argsps[y].subs) free(*(char **)argsps[y].subs); if(!( *(char **)argsps[y].subs=(char*)malloc(strlen(argv[x+1])+1) )) break; } strcpy(*(char **)argsps[y].subs,argv[x+1]); break; } } if(argsps[y].var) *argsps[y].var=1; } y++; } while(argsps[y].var || argsps[y].subs); } void ParseArguments(int argc, char *argv[], ARGPSTRUCT *argsps) { int x; for(x=0;x #include #include "../../driver.h" static void GetString(char *s, int max) { int x; fgets(s,max,stdin); for(x=0;x "); fgets(buf,32,stdin); if(buf[0]=='s' || buf[0]=='S') return(-1); if(buf[0]=='\n') return(0); if(!sscanf(buf,"%d",&num)) return(0); if(num<1) goto tryagain; return(num); } else { int num=0; tryagain2: printf(" <'Enter' to make no selection or enter a number.> "); fgets(buf,32,stdin); if(buf[0]=='\n') return(0); if(!sscanf(buf,"%d",&num)) return(0); if(num<1) goto tryagain2; return(num); } } int EndListShow(void) { if(mordoe) { int r=ListChoice(1); if(r>0 && r<=listcount) listsel=listids[r-1]; } return(listsel); } /* Returns 0 to stop listing, 1 to continue. */ int AddToList(char *text, uint32 id) { if(listcount==16) { int t=ListChoice(0); mordoe=0; if(t==-1) return(0); // Stop listing. else if(t>0 && t<17) { listsel=listids[t-1]; return(0); } listcount=0; } mordoe=1; listids[listcount]=id; printf("%2d) %s\n",listcount+1,text); listcount++; return(1); } /* ** ** End list code. **/ typedef struct MENU { char *text; void *action; int type; // 0 for menu, 1 for function. } MENU; static void SetOC(void) { FCEUI_CheatSearchSetCurrentAsOriginal(); } static void UnhideEx(void) { FCEUI_CheatSearchShowExcluded(); } static void ToggleCheat(int num) { printf("Cheat %d %sabled.\n",1+num, FCEUI_ToggleCheat(num)?"en":"dis"); } static void ModifyCheat(int num) { char *name; char buf[256]; uint32 A; uint8 V; int compare; int type; int s; int t; FCEUI_GetCheat(num, &name, &A, &V, &compare, &s, &type); printf("Name [%s]: ",name); GetString(buf,256); /* This obviously doesn't allow for cheats with no names. Bah. Who wants nameless cheats anyway... */ if(buf[0]) name=buf; // Change name when FCEUI_SetCheat() is called. else name=0; // Don't change name when FCEUI_SetCheat() is called. printf("Address [$%04x]: ",(unsigned int)A); A=GetH16(A); printf("Value [%03d]: ",(unsigned int)V); V=Get8(V); printf("Compare [%3d]: ",compare); compare=GetI(compare); printf("Type(0=Old Style, 1=Read Substitute) [%1d]: ",type); type=GetI(type)?1:0; printf("Enable [%s]: ",s?"Y":"N"); t=getchar(); if(t=='Y' || t=='y') s=1; else if(t=='N' || t=='n') s=0; FCEUI_SetCheat(num,name,A,V,compare,s,type); } static void AddCheatGGPAR(int which) { uint16 A; uint8 V; int C; int type; char name[256],code[256]; printf("Name: "); GetString(name,256); printf("Code: "); GetString(code,256); printf("Add cheat \"%s\" for code \"%s\"?",name,code); if(GetYN(0)) { if(which) { if(!FCEUI_DecodePAR(code,&A,&V,&C,&type)) { puts("Invalid Game Genie code."); return; } } else { if(!FCEUI_DecodeGG(code,&A,&V,&C)) { puts("Invalid Game Genie code."); return; } type=1; } if(FCEUI_AddCheat(name,A,V,C,type)) puts("Cheat added."); else puts("Error adding cheat."); } } static void AddCheatGG(void) { AddCheatGGPAR(0); } static void AddCheatPAR(void) { AddCheatGGPAR(1); } static void AddCheatParam(uint32 A, uint8 V) { char name[256]; printf("Name: "); GetString(name,256); printf("Address [$%04x]: ",(unsigned int)A); A=GetH16(A); printf("Value [%03d]: ",(unsigned int)V); V=Get8(V); printf("Add cheat \"%s\" for address $%04x with value %03d?",name,(unsigned int)A,(unsigned int)V); if(GetYN(0)) { if(FCEUI_AddCheat(name,A,V,-1,0)) puts("Cheat added."); else puts("Error adding cheat."); } } static void AddCheat(void) { AddCheatParam(0,0); } static int lid; static int clistcallb(char *name, uint32 a, uint8 v, int compare, int s, int type, void *data) { char tmp[512]; int ret; if(compare>=0) sprintf(tmp,"%s $%04x:%03d:%03d - %s",s?"*":" ",(unsigned int)a,(unsigned int)v,compare,name); else sprintf(tmp,"%s $%04x:%03d - %s",s?"*":" ",(unsigned int)a,(unsigned int)v,name); if(type==1) tmp[2]='S'; ret=AddToList(tmp,lid); lid++; return(ret); } static void ListCheats(void) { int which; lid=0; BeginListShow(); FCEUI_ListCheats(clistcallb,0); which=EndListShow(); if(which>=0) { char tmp[32]; printf(" <(T)oggle status, (M)odify, or (D)elete this cheat.> "); fgets(tmp,32,stdin); switch(tolower(tmp[0])) { case 't':ToggleCheat(which); break; case 'd':if(!FCEUI_DelCheat(which)) puts("Error deleting cheat!"); else puts("Cheat has been deleted."); break; case 'm':ModifyCheat(which); break; } } } static void ResetSearch(void) { FCEUI_CheatSearchBegin(); puts("Done."); } static int srescallb(uint32 a, uint8 last, uint8 current, void *data) { char tmp[13]; sprintf(tmp, "$%04x:%03d:%03d",(unsigned int)a,(unsigned int)last,(unsigned int)current); return(AddToList(tmp,a)); } static void ShowRes(void) { int n=FCEUI_CheatSearchGetCount(); printf(" %d results:\n",n); if(n) { int which; BeginListShow(); FCEUI_CheatSearchGet(srescallb,0); which=EndListShow(); if(which>=0) AddCheatParam(which,0); } } static int ShowShortList(char *moe[], int n, int def) { int x,c; unsigned int baa; char tmp[16]; red: for(x=0;x ",def+1); fgets(tmp,256,stdin); if(tmp[0]=='\n') return def; c=tolower(tmp[0]); baa=c-'1'; if(baa "); fgets(buf,32,stdin); c=tolower(buf[0]); if(c=='\n') goto recommand; else if(c=='d') goto redisplay; else if(c=='x') { return; } else if(sscanf(buf,"%d",&c)) { if(c>x) goto invalid; if(men[c-1].type) { void (*func)(void)=(void(*)())men[c-1].action; func(); } else DoMenu((MENU*)men[c-1].action); /* Mmm...recursivey goodness. */ goto redisplay; } else { invalid: puts("Invalid command.\n"); goto recommand; } } } void DoConsoleCheatConfig(void) { MENU *curmenu=MainMenu; DoMenu(curmenu); } fceu-0.98.12/src/drivers/common/Makefile.am.inc0000644000175000000620000000034610032151556021054 0ustar joestaff00000000000000fceu_SOURCES += drivers/common/args.c drivers/common/cheat.c drivers/common/config.c drivers/common/vidblit.c drivers/common/hq2x.c drivers/common/hq3x.c drivers/common/scale2x.c drivers/common/scale3x.c drivers/common/scalebit.c fceu-0.98.12/src/drivers/common/hq2x.c0000644000175000000620000015531610037024104017277 0ustar joestaff00000000000000//hq2x filter demo program //---------------------------------------------------------- //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 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 program is distributed in the hope that 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 program; if not, write to the Free Software //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA /* Modified for usage in FCE Ultra */ #include #include #include "hq2x.h" static int *LUT16to32=NULL; static int *RGBtoYUV=NULL; static const int Ymask = 0x00FF0000; static const int Umask = 0x0000FF00; static const int Vmask = 0x000000FF; static const int trY = 0x00300000; static const int trU = 0x00000700; static const int trV = 0x00000006; static inline void Interp1(unsigned char * pc, int c1, int c2) { *((int*)pc) = (c1*3+c2) >> 2; } static inline void Interp2(unsigned char * pc, int c1, int c2, int c3) { *((int*)pc) = (c1*2+c2+c3) >> 2; } static inline void Interp5(unsigned char * pc, int c1, int c2) { *((int*)pc) = (c1+c2) >> 1; } static inline void Interp6(unsigned char * pc, int c1, int c2, int c3) { //*((int*)pc) = (c1*5+c2*2+c3)/8; *((int*)pc) = ((((c1 & 0x00FF00)*5 + (c2 & 0x00FF00)*2 + (c3 & 0x00FF00) ) & 0x0007F800) + (((c1 & 0xFF00FF)*5 + (c2 & 0xFF00FF)*2 + (c3 & 0xFF00FF) ) & 0x07F807F8)) >> 3; } static inline void Interp7(unsigned char * pc, int c1, int c2, int c3) { //*((int*)pc) = (c1*6+c2+c3)/8; *((int*)pc) = ((((c1 & 0x00FF00)*6 + (c2 & 0x00FF00) + (c3 & 0x00FF00) ) & 0x0007F800) + (((c1 & 0xFF00FF)*6 + (c2 & 0xFF00FF) + (c3 & 0xFF00FF) ) & 0x07F807F8)) >> 3; } static inline void Interp9(unsigned char * pc, int c1, int c2, int c3) { //*((int*)pc) = (c1*2+(c2+c3)*3)/8; *((int*)pc) = ((((c1 & 0x00FF00)*2 + ((c2 & 0x00FF00) + (c3 & 0x00FF00))*3 ) & 0x0007F800) + (((c1 & 0xFF00FF)*2 + ((c2 & 0xFF00FF) + (c3 & 0xFF00FF))*3 ) & 0x07F807F8)) >> 3; } static inline void Interp10(unsigned char * pc, int c1, int c2, int c3) { //*((int*)pc) = (c1*14+c2+c3)/16; *((int*)pc) = ((((c1 & 0x00FF00)*14 + (c2 & 0x00FF00) + (c3 & 0x00FF00) ) & 0x000FF000) + (((c1 & 0xFF00FF)*14 + (c2 & 0xFF00FF) + (c3 & 0xFF00FF) ) & 0x0FF00FF0)) >> 4; } #define PIXEL00_0 *((int*)(pOut)) = c[5]; #define PIXEL00_10 Interp1(pOut, c[5], c[1]); #define PIXEL00_11 Interp1(pOut, c[5], c[4]); #define PIXEL00_12 Interp1(pOut, c[5], c[2]); #define PIXEL00_20 Interp2(pOut, c[5], c[4], c[2]); #define PIXEL00_21 Interp2(pOut, c[5], c[1], c[2]); #define PIXEL00_22 Interp2(pOut, c[5], c[1], c[4]); #define PIXEL00_60 Interp6(pOut, c[5], c[2], c[4]); #define PIXEL00_61 Interp6(pOut, c[5], c[4], c[2]); #define PIXEL00_70 Interp7(pOut, c[5], c[4], c[2]); #define PIXEL00_90 Interp9(pOut, c[5], c[4], c[2]); #define PIXEL00_100 Interp10(pOut, c[5], c[4], c[2]); #define PIXEL01_0 *((int*)(pOut+4)) = c[5]; #define PIXEL01_10 Interp1(pOut+4, c[5], c[3]); #define PIXEL01_11 Interp1(pOut+4, c[5], c[2]); #define PIXEL01_12 Interp1(pOut+4, c[5], c[6]); #define PIXEL01_20 Interp2(pOut+4, c[5], c[2], c[6]); #define PIXEL01_21 Interp2(pOut+4, c[5], c[3], c[6]); #define PIXEL01_22 Interp2(pOut+4, c[5], c[3], c[2]); #define PIXEL01_60 Interp6(pOut+4, c[5], c[6], c[2]); #define PIXEL01_61 Interp6(pOut+4, c[5], c[2], c[6]); #define PIXEL01_70 Interp7(pOut+4, c[5], c[2], c[6]); #define PIXEL01_90 Interp9(pOut+4, c[5], c[2], c[6]); #define PIXEL01_100 Interp10(pOut+4, c[5], c[2], c[6]); #define PIXEL10_0 *((int*)(pOut+BpL)) = c[5]; #define PIXEL10_10 Interp1(pOut+BpL, c[5], c[7]); #define PIXEL10_11 Interp1(pOut+BpL, c[5], c[8]); #define PIXEL10_12 Interp1(pOut+BpL, c[5], c[4]); #define PIXEL10_20 Interp2(pOut+BpL, c[5], c[8], c[4]); #define PIXEL10_21 Interp2(pOut+BpL, c[5], c[7], c[4]); #define PIXEL10_22 Interp2(pOut+BpL, c[5], c[7], c[8]); #define PIXEL10_60 Interp6(pOut+BpL, c[5], c[4], c[8]); #define PIXEL10_61 Interp6(pOut+BpL, c[5], c[8], c[4]); #define PIXEL10_70 Interp7(pOut+BpL, c[5], c[8], c[4]); #define PIXEL10_90 Interp9(pOut+BpL, c[5], c[8], c[4]); #define PIXEL10_100 Interp10(pOut+BpL, c[5], c[8], c[4]); #define PIXEL11_0 *((int*)(pOut+BpL+4)) = c[5]; #define PIXEL11_10 Interp1(pOut+BpL+4, c[5], c[9]); #define PIXEL11_11 Interp1(pOut+BpL+4, c[5], c[6]); #define PIXEL11_12 Interp1(pOut+BpL+4, c[5], c[8]); #define PIXEL11_20 Interp2(pOut+BpL+4, c[5], c[6], c[8]); #define PIXEL11_21 Interp2(pOut+BpL+4, c[5], c[9], c[8]); #define PIXEL11_22 Interp2(pOut+BpL+4, c[5], c[9], c[6]); #define PIXEL11_60 Interp6(pOut+BpL+4, c[5], c[8], c[6]); #define PIXEL11_61 Interp6(pOut+BpL+4, c[5], c[6], c[8]); #define PIXEL11_70 Interp7(pOut+BpL+4, c[5], c[6], c[8]); #define PIXEL11_90 Interp9(pOut+BpL+4, c[5], c[6], c[8]); #define PIXEL11_100 Interp10(pOut+BpL+4, c[5], c[6], c[8]); static inline int Diff(unsigned int w1, unsigned int w2) { int YUV1; int YUV2; YUV1 = RGBtoYUV[w1]; YUV2 = RGBtoYUV[w2]; return ( ( abs((YUV1 & Ymask) - (YUV2 & Ymask)) > trY ) || ( abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ) || ( abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ) ); // return( //((0-abs((YUV1 & Ymask) - (YUV2 & Ymask)))>>31) | //((0-abs((YUV1 & Umask) - (YUV2 & Umask)))>>31) | //((0-abs((YUV1 & Vmask) - (YUV2 & Vmask)))>>31) // ); } void hq2x_32( unsigned char * pIn, unsigned char * pOut, int Xres, int Yres, int BpL ) { int i, j, k; int prevline, nextline; int w[10]; int c[10]; // +----+----+----+ // | | | | // | w1 | w2 | w3 | // +----+----+----+ // | | | | // | w4 | w5 | w6 | // +----+----+----+ // | | | | // | w7 | w8 | w9 | // +----+----+----+ for (j=0; j0) prevline = -Xres*2; else prevline = 0; if (j0) { w[1] = *((unsigned short*)(pIn + prevline - 2)); w[4] = *((unsigned short*)(pIn - 2)); w[7] = *((unsigned short*)(pIn + nextline - 2)); } else { w[1] = w[2]; w[4] = w[5]; w[7] = w[8]; } if (i>31) | //((unsigned int)(0-abs(YUV1U - (YUV2 & Umask)))>>31) | //((unsigned int)(0-abs(YUV1V - (YUV2 & Vmask)))>>31); //pattern|=tmp*flag; if ( ( abs(YUV1Y - (YUV2 & Ymask)) > trY ) || ( abs(YUV1U - (YUV2 & Umask)) > trU ) || ( abs(YUV1V - (YUV2 & Vmask)) > trV ) ) pattern |= flag; } flag <<= 1; } for (k=1; k<=9; k++) c[k] = LUT16to32[w[k]]; 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_20 PIXEL10_20 PIXEL11_20 break; } case 2: case 34: case 130: case 162: { PIXEL00_22 PIXEL01_21 PIXEL10_20 PIXEL11_20 break; } case 16: case 17: case 48: case 49: { PIXEL00_20 PIXEL01_22 PIXEL10_20 PIXEL11_21 break; } case 64: case 65: case 68: case 69: { PIXEL00_20 PIXEL01_20 PIXEL10_21 PIXEL11_22 break; } case 8: case 12: case 136: case 140: { PIXEL00_21 PIXEL01_20 PIXEL10_22 PIXEL11_20 break; } case 3: case 35: case 131: case 163: { PIXEL00_11 PIXEL01_21 PIXEL10_20 PIXEL11_20 break; } case 6: case 38: case 134: case 166: { PIXEL00_22 PIXEL01_12 PIXEL10_20 PIXEL11_20 break; } case 20: case 21: case 52: case 53: { PIXEL00_20 PIXEL01_11 PIXEL10_20 PIXEL11_21 break; } case 144: case 145: case 176: case 177: { PIXEL00_20 PIXEL01_22 PIXEL10_20 PIXEL11_12 break; } case 192: case 193: case 196: case 197: { PIXEL00_20 PIXEL01_20 PIXEL10_21 PIXEL11_11 break; } case 96: case 97: case 100: case 101: { PIXEL00_20 PIXEL01_20 PIXEL10_12 PIXEL11_22 break; } case 40: case 44: case 168: case 172: { PIXEL00_21 PIXEL01_20 PIXEL10_11 PIXEL11_20 break; } case 9: case 13: case 137: case 141: { PIXEL00_12 PIXEL01_20 PIXEL10_22 PIXEL11_20 break; } case 18: case 50: { PIXEL00_22 if (Diff(w[2], w[6])) { PIXEL01_10 } else { PIXEL01_20 } PIXEL10_20 PIXEL11_21 break; } case 80: case 81: { PIXEL00_20 PIXEL01_22 PIXEL10_21 if (Diff(w[6], w[8])) { PIXEL11_10 } else { PIXEL11_20 } break; } case 72: case 76: { PIXEL00_21 PIXEL01_20 if (Diff(w[8], w[4])) { PIXEL10_10 } else { PIXEL10_20 } PIXEL11_22 break; } case 10: case 138: { if (Diff(w[4], w[2])) { PIXEL00_10 } else { PIXEL00_20 } PIXEL01_21 PIXEL10_22 PIXEL11_20 break; } case 66: { PIXEL00_22 PIXEL01_21 PIXEL10_21 PIXEL11_22 break; } case 24: { PIXEL00_21 PIXEL01_22 PIXEL10_22 PIXEL11_21 break; } case 7: case 39: case 135: { PIXEL00_11 PIXEL01_12 PIXEL10_20 PIXEL11_20 break; } case 148: case 149: case 180: { PIXEL00_20 PIXEL01_11 PIXEL10_20 PIXEL11_12 break; } case 224: case 228: case 225: { PIXEL00_20 PIXEL01_20 PIXEL10_12 PIXEL11_11 break; } case 41: case 169: case 45: { PIXEL00_12 PIXEL01_20 PIXEL10_11 PIXEL11_20 break; } case 22: case 54: { PIXEL00_22 if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_20 } PIXEL10_20 PIXEL11_21 break; } case 208: case 209: { PIXEL00_20 PIXEL01_22 PIXEL10_21 if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_20 } break; } case 104: case 108: { PIXEL00_21 PIXEL01_20 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_20 } PIXEL11_22 break; } case 11: case 139: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_20 } PIXEL01_21 PIXEL10_22 PIXEL11_20 break; } case 19: case 51: { if (Diff(w[2], w[6])) { PIXEL00_11 PIXEL01_10 } else { PIXEL00_60 PIXEL01_90 } PIXEL10_20 PIXEL11_21 break; } case 146: case 178: { PIXEL00_22 if (Diff(w[2], w[6])) { PIXEL01_10 PIXEL11_12 } else { PIXEL01_90 PIXEL11_61 } PIXEL10_20 break; } case 84: case 85: { PIXEL00_20 if (Diff(w[6], w[8])) { PIXEL01_11 PIXEL11_10 } else { PIXEL01_60 PIXEL11_90 } PIXEL10_21 break; } case 112: case 113: { PIXEL00_20 PIXEL01_22 if (Diff(w[6], w[8])) { PIXEL10_12 PIXEL11_10 } else { PIXEL10_61 PIXEL11_90 } break; } case 200: case 204: { PIXEL00_21 PIXEL01_20 if (Diff(w[8], w[4])) { PIXEL10_10 PIXEL11_11 } else { PIXEL10_90 PIXEL11_60 } break; } case 73: case 77: { if (Diff(w[8], w[4])) { PIXEL00_12 PIXEL10_10 } else { PIXEL00_61 PIXEL10_90 } PIXEL01_20 PIXEL11_22 break; } case 42: case 170: { if (Diff(w[4], w[2])) { PIXEL00_10 PIXEL10_11 } else { PIXEL00_90 PIXEL10_60 } PIXEL01_21 PIXEL11_20 break; } case 14: case 142: { if (Diff(w[4], w[2])) { PIXEL00_10 PIXEL01_12 } else { PIXEL00_90 PIXEL01_61 } PIXEL10_22 PIXEL11_20 break; } case 67: { PIXEL00_11 PIXEL01_21 PIXEL10_21 PIXEL11_22 break; } case 70: { PIXEL00_22 PIXEL01_12 PIXEL10_21 PIXEL11_22 break; } case 28: { PIXEL00_21 PIXEL01_11 PIXEL10_22 PIXEL11_21 break; } case 152: { PIXEL00_21 PIXEL01_22 PIXEL10_22 PIXEL11_12 break; } case 194: { PIXEL00_22 PIXEL01_21 PIXEL10_21 PIXEL11_11 break; } case 98: { PIXEL00_22 PIXEL01_21 PIXEL10_12 PIXEL11_22 break; } case 56: { PIXEL00_21 PIXEL01_22 PIXEL10_11 PIXEL11_21 break; } case 25: { PIXEL00_12 PIXEL01_22 PIXEL10_22 PIXEL11_21 break; } case 26: case 31: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_20 } if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_20 } PIXEL10_22 PIXEL11_21 break; } case 82: case 214: { PIXEL00_22 if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_20 } PIXEL10_21 if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_20 } break; } case 88: case 248: { PIXEL00_21 PIXEL01_22 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_20 } if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_20 } break; } case 74: case 107: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_20 } PIXEL01_21 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_20 } PIXEL11_22 break; } case 27: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_20 } PIXEL01_10 PIXEL10_22 PIXEL11_21 break; } case 86: { PIXEL00_22 if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_20 } PIXEL10_21 PIXEL11_10 break; } case 216: { PIXEL00_21 PIXEL01_22 PIXEL10_10 if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_20 } break; } case 106: { PIXEL00_10 PIXEL01_21 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_20 } PIXEL11_22 break; } case 30: { PIXEL00_10 if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_20 } PIXEL10_22 PIXEL11_21 break; } case 210: { PIXEL00_22 PIXEL01_10 PIXEL10_21 if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_20 } break; } case 120: { PIXEL00_21 PIXEL01_22 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_20 } PIXEL11_10 break; } case 75: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_20 } PIXEL01_21 PIXEL10_10 PIXEL11_22 break; } case 29: { PIXEL00_12 PIXEL01_11 PIXEL10_22 PIXEL11_21 break; } case 198: { PIXEL00_22 PIXEL01_12 PIXEL10_21 PIXEL11_11 break; } case 184: { PIXEL00_21 PIXEL01_22 PIXEL10_11 PIXEL11_12 break; } case 99: { PIXEL00_11 PIXEL01_21 PIXEL10_12 PIXEL11_22 break; } case 57: { PIXEL00_12 PIXEL01_22 PIXEL10_11 PIXEL11_21 break; } case 71: { PIXEL00_11 PIXEL01_12 PIXEL10_21 PIXEL11_22 break; } case 156: { PIXEL00_21 PIXEL01_11 PIXEL10_22 PIXEL11_12 break; } case 226: { PIXEL00_22 PIXEL01_21 PIXEL10_12 PIXEL11_11 break; } case 60: { PIXEL00_21 PIXEL01_11 PIXEL10_11 PIXEL11_21 break; } case 195: { PIXEL00_11 PIXEL01_21 PIXEL10_21 PIXEL11_11 break; } case 102: { PIXEL00_22 PIXEL01_12 PIXEL10_12 PIXEL11_22 break; } case 153: { PIXEL00_12 PIXEL01_22 PIXEL10_22 PIXEL11_12 break; } case 58: { if (Diff(w[4], w[2])) { PIXEL00_10 } else { PIXEL00_70 } if (Diff(w[2], w[6])) { PIXEL01_10 } else { PIXEL01_70 } PIXEL10_11 PIXEL11_21 break; } case 83: { PIXEL00_11 if (Diff(w[2], w[6])) { PIXEL01_10 } else { PIXEL01_70 } PIXEL10_21 if (Diff(w[6], w[8])) { PIXEL11_10 } else { PIXEL11_70 } break; } case 92: { PIXEL00_21 PIXEL01_11 if (Diff(w[8], w[4])) { PIXEL10_10 } else { PIXEL10_70 } if (Diff(w[6], w[8])) { PIXEL11_10 } else { PIXEL11_70 } break; } case 202: { if (Diff(w[4], w[2])) { PIXEL00_10 } else { PIXEL00_70 } PIXEL01_21 if (Diff(w[8], w[4])) { PIXEL10_10 } else { PIXEL10_70 } PIXEL11_11 break; } case 78: { if (Diff(w[4], w[2])) { PIXEL00_10 } else { PIXEL00_70 } PIXEL01_12 if (Diff(w[8], w[4])) { PIXEL10_10 } else { PIXEL10_70 } PIXEL11_22 break; } case 154: { if (Diff(w[4], w[2])) { PIXEL00_10 } else { PIXEL00_70 } if (Diff(w[2], w[6])) { PIXEL01_10 } else { PIXEL01_70 } PIXEL10_22 PIXEL11_12 break; } case 114: { PIXEL00_22 if (Diff(w[2], w[6])) { PIXEL01_10 } else { PIXEL01_70 } PIXEL10_12 if (Diff(w[6], w[8])) { PIXEL11_10 } else { PIXEL11_70 } break; } case 89: { PIXEL00_12 PIXEL01_22 if (Diff(w[8], w[4])) { PIXEL10_10 } else { PIXEL10_70 } if (Diff(w[6], w[8])) { PIXEL11_10 } else { PIXEL11_70 } break; } case 90: { if (Diff(w[4], w[2])) { PIXEL00_10 } else { PIXEL00_70 } if (Diff(w[2], w[6])) { PIXEL01_10 } else { PIXEL01_70 } if (Diff(w[8], w[4])) { PIXEL10_10 } else { PIXEL10_70 } if (Diff(w[6], w[8])) { PIXEL11_10 } else { PIXEL11_70 } break; } case 55: case 23: { if (Diff(w[2], w[6])) { PIXEL00_11 PIXEL01_0 } else { PIXEL00_60 PIXEL01_90 } PIXEL10_20 PIXEL11_21 break; } case 182: case 150: { PIXEL00_22 if (Diff(w[2], w[6])) { PIXEL01_0 PIXEL11_12 } else { PIXEL01_90 PIXEL11_61 } PIXEL10_20 break; } case 213: case 212: { PIXEL00_20 if (Diff(w[6], w[8])) { PIXEL01_11 PIXEL11_0 } else { PIXEL01_60 PIXEL11_90 } PIXEL10_21 break; } case 241: case 240: { PIXEL00_20 PIXEL01_22 if (Diff(w[6], w[8])) { PIXEL10_12 PIXEL11_0 } else { PIXEL10_61 PIXEL11_90 } break; } case 236: case 232: { PIXEL00_21 PIXEL01_20 if (Diff(w[8], w[4])) { PIXEL10_0 PIXEL11_11 } else { PIXEL10_90 PIXEL11_60 } break; } case 109: case 105: { if (Diff(w[8], w[4])) { PIXEL00_12 PIXEL10_0 } else { PIXEL00_61 PIXEL10_90 } PIXEL01_20 PIXEL11_22 break; } case 171: case 43: { if (Diff(w[4], w[2])) { PIXEL00_0 PIXEL10_11 } else { PIXEL00_90 PIXEL10_60 } PIXEL01_21 PIXEL11_20 break; } case 143: case 15: { if (Diff(w[4], w[2])) { PIXEL00_0 PIXEL01_12 } else { PIXEL00_90 PIXEL01_61 } PIXEL10_22 PIXEL11_20 break; } case 124: { PIXEL00_21 PIXEL01_11 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_20 } PIXEL11_10 break; } case 203: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_20 } PIXEL01_21 PIXEL10_10 PIXEL11_11 break; } case 62: { PIXEL00_10 if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_20 } PIXEL10_11 PIXEL11_21 break; } case 211: { PIXEL00_11 PIXEL01_10 PIXEL10_21 if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_20 } break; } case 118: { PIXEL00_22 if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_20 } PIXEL10_12 PIXEL11_10 break; } case 217: { PIXEL00_12 PIXEL01_22 PIXEL10_10 if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_20 } break; } case 110: { PIXEL00_10 PIXEL01_12 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_20 } PIXEL11_22 break; } case 155: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_20 } PIXEL01_10 PIXEL10_22 PIXEL11_12 break; } case 188: { PIXEL00_21 PIXEL01_11 PIXEL10_11 PIXEL11_12 break; } case 185: { PIXEL00_12 PIXEL01_22 PIXEL10_11 PIXEL11_12 break; } case 61: { PIXEL00_12 PIXEL01_11 PIXEL10_11 PIXEL11_21 break; } case 157: { PIXEL00_12 PIXEL01_11 PIXEL10_22 PIXEL11_12 break; } case 103: { PIXEL00_11 PIXEL01_12 PIXEL10_12 PIXEL11_22 break; } case 227: { PIXEL00_11 PIXEL01_21 PIXEL10_12 PIXEL11_11 break; } case 230: { PIXEL00_22 PIXEL01_12 PIXEL10_12 PIXEL11_11 break; } case 199: { PIXEL00_11 PIXEL01_12 PIXEL10_21 PIXEL11_11 break; } case 220: { PIXEL00_21 PIXEL01_11 if (Diff(w[8], w[4])) { PIXEL10_10 } else { PIXEL10_70 } if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_20 } break; } case 158: { if (Diff(w[4], w[2])) { PIXEL00_10 } else { PIXEL00_70 } if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_20 } PIXEL10_22 PIXEL11_12 break; } case 234: { if (Diff(w[4], w[2])) { PIXEL00_10 } else { PIXEL00_70 } PIXEL01_21 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_20 } PIXEL11_11 break; } case 242: { PIXEL00_22 if (Diff(w[2], w[6])) { PIXEL01_10 } else { PIXEL01_70 } PIXEL10_12 if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_20 } break; } case 59: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_20 } if (Diff(w[2], w[6])) { PIXEL01_10 } else { PIXEL01_70 } PIXEL10_11 PIXEL11_21 break; } case 121: { PIXEL00_12 PIXEL01_22 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_20 } if (Diff(w[6], w[8])) { PIXEL11_10 } else { PIXEL11_70 } break; } case 87: { PIXEL00_11 if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_20 } PIXEL10_21 if (Diff(w[6], w[8])) { PIXEL11_10 } else { PIXEL11_70 } break; } case 79: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_20 } PIXEL01_12 if (Diff(w[8], w[4])) { PIXEL10_10 } else { PIXEL10_70 } PIXEL11_22 break; } case 122: { if (Diff(w[4], w[2])) { PIXEL00_10 } else { PIXEL00_70 } if (Diff(w[2], w[6])) { PIXEL01_10 } else { PIXEL01_70 } if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_20 } if (Diff(w[6], w[8])) { PIXEL11_10 } else { PIXEL11_70 } break; } case 94: { if (Diff(w[4], w[2])) { PIXEL00_10 } else { PIXEL00_70 } if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_20 } if (Diff(w[8], w[4])) { PIXEL10_10 } else { PIXEL10_70 } if (Diff(w[6], w[8])) { PIXEL11_10 } else { PIXEL11_70 } break; } case 218: { if (Diff(w[4], w[2])) { PIXEL00_10 } else { PIXEL00_70 } if (Diff(w[2], w[6])) { PIXEL01_10 } else { PIXEL01_70 } if (Diff(w[8], w[4])) { PIXEL10_10 } else { PIXEL10_70 } if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_20 } break; } case 91: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_20 } if (Diff(w[2], w[6])) { PIXEL01_10 } else { PIXEL01_70 } if (Diff(w[8], w[4])) { PIXEL10_10 } else { PIXEL10_70 } if (Diff(w[6], w[8])) { PIXEL11_10 } else { PIXEL11_70 } break; } case 229: { PIXEL00_20 PIXEL01_20 PIXEL10_12 PIXEL11_11 break; } case 167: { PIXEL00_11 PIXEL01_12 PIXEL10_20 PIXEL11_20 break; } case 173: { PIXEL00_12 PIXEL01_20 PIXEL10_11 PIXEL11_20 break; } case 181: { PIXEL00_20 PIXEL01_11 PIXEL10_20 PIXEL11_12 break; } case 186: { if (Diff(w[4], w[2])) { PIXEL00_10 } else { PIXEL00_70 } if (Diff(w[2], w[6])) { PIXEL01_10 } else { PIXEL01_70 } PIXEL10_11 PIXEL11_12 break; } case 115: { PIXEL00_11 if (Diff(w[2], w[6])) { PIXEL01_10 } else { PIXEL01_70 } PIXEL10_12 if (Diff(w[6], w[8])) { PIXEL11_10 } else { PIXEL11_70 } break; } case 93: { PIXEL00_12 PIXEL01_11 if (Diff(w[8], w[4])) { PIXEL10_10 } else { PIXEL10_70 } if (Diff(w[6], w[8])) { PIXEL11_10 } else { PIXEL11_70 } break; } case 206: { if (Diff(w[4], w[2])) { PIXEL00_10 } else { PIXEL00_70 } PIXEL01_12 if (Diff(w[8], w[4])) { PIXEL10_10 } else { PIXEL10_70 } PIXEL11_11 break; } case 205: case 201: { PIXEL00_12 PIXEL01_20 if (Diff(w[8], w[4])) { PIXEL10_10 } else { PIXEL10_70 } PIXEL11_11 break; } case 174: case 46: { if (Diff(w[4], w[2])) { PIXEL00_10 } else { PIXEL00_70 } PIXEL01_12 PIXEL10_11 PIXEL11_20 break; } case 179: case 147: { PIXEL00_11 if (Diff(w[2], w[6])) { PIXEL01_10 } else { PIXEL01_70 } PIXEL10_20 PIXEL11_12 break; } case 117: case 116: { PIXEL00_20 PIXEL01_11 PIXEL10_12 if (Diff(w[6], w[8])) { PIXEL11_10 } else { PIXEL11_70 } break; } case 189: { PIXEL00_12 PIXEL01_11 PIXEL10_11 PIXEL11_12 break; } case 231: { PIXEL00_11 PIXEL01_12 PIXEL10_12 PIXEL11_11 break; } case 126: { PIXEL00_10 if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_20 } if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_20 } PIXEL11_10 break; } case 219: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_20 } PIXEL01_10 PIXEL10_10 if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_20 } break; } case 125: { if (Diff(w[8], w[4])) { PIXEL00_12 PIXEL10_0 } else { PIXEL00_61 PIXEL10_90 } PIXEL01_11 PIXEL11_10 break; } case 221: { PIXEL00_12 if (Diff(w[6], w[8])) { PIXEL01_11 PIXEL11_0 } else { PIXEL01_60 PIXEL11_90 } PIXEL10_10 break; } case 207: { if (Diff(w[4], w[2])) { PIXEL00_0 PIXEL01_12 } else { PIXEL00_90 PIXEL01_61 } PIXEL10_10 PIXEL11_11 break; } case 238: { PIXEL00_10 PIXEL01_12 if (Diff(w[8], w[4])) { PIXEL10_0 PIXEL11_11 } else { PIXEL10_90 PIXEL11_60 } break; } case 190: { PIXEL00_10 if (Diff(w[2], w[6])) { PIXEL01_0 PIXEL11_12 } else { PIXEL01_90 PIXEL11_61 } PIXEL10_11 break; } case 187: { if (Diff(w[4], w[2])) { PIXEL00_0 PIXEL10_11 } else { PIXEL00_90 PIXEL10_60 } PIXEL01_10 PIXEL11_12 break; } case 243: { PIXEL00_11 PIXEL01_10 if (Diff(w[6], w[8])) { PIXEL10_12 PIXEL11_0 } else { PIXEL10_61 PIXEL11_90 } break; } case 119: { if (Diff(w[2], w[6])) { PIXEL00_11 PIXEL01_0 } else { PIXEL00_60 PIXEL01_90 } PIXEL10_12 PIXEL11_10 break; } case 237: case 233: { PIXEL00_12 PIXEL01_20 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_100 } PIXEL11_11 break; } case 175: case 47: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_100 } PIXEL01_12 PIXEL10_11 PIXEL11_20 break; } case 183: case 151: { PIXEL00_11 if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_100 } PIXEL10_20 PIXEL11_12 break; } case 245: case 244: { PIXEL00_20 PIXEL01_11 PIXEL10_12 if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_100 } break; } case 250: { PIXEL00_10 PIXEL01_10 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_20 } if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_20 } break; } case 123: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_20 } PIXEL01_10 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_20 } PIXEL11_10 break; } case 95: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_20 } if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_20 } PIXEL10_10 PIXEL11_10 break; } case 222: { PIXEL00_10 if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_20 } PIXEL10_10 if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_20 } break; } case 252: { PIXEL00_21 PIXEL01_11 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_20 } if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_100 } break; } case 249: { PIXEL00_12 PIXEL01_22 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_100 } if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_20 } break; } case 235: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_20 } PIXEL01_21 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_100 } PIXEL11_11 break; } case 111: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_100 } PIXEL01_12 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_20 } PIXEL11_22 break; } case 63: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_100 } if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_20 } PIXEL10_11 PIXEL11_21 break; } case 159: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_20 } if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_100 } PIXEL10_22 PIXEL11_12 break; } case 215: { PIXEL00_11 if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_100 } PIXEL10_21 if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_20 } break; } case 246: { PIXEL00_22 if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_20 } PIXEL10_12 if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_100 } break; } case 254: { PIXEL00_10 if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_20 } if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_20 } if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_100 } break; } case 253: { PIXEL00_12 PIXEL01_11 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_100 } if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_100 } break; } case 251: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_20 } PIXEL01_10 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_100 } if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_20 } break; } case 239: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_100 } PIXEL01_12 if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_100 } PIXEL11_11 break; } case 127: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_100 } if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_20 } if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_20 } PIXEL11_10 break; } case 191: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_100 } if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_100 } PIXEL10_11 PIXEL11_12 break; } case 223: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_20 } if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_100 } PIXEL10_10 if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_20 } break; } case 247: { PIXEL00_11 if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_100 } PIXEL10_12 if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_100 } break; } case 255: { if (Diff(w[4], w[2])) { PIXEL00_0 } else { PIXEL00_100 } if (Diff(w[2], w[6])) { PIXEL01_0 } else { PIXEL01_100 } if (Diff(w[8], w[4])) { PIXEL10_0 } else { PIXEL10_100 } if (Diff(w[6], w[8])) { PIXEL11_0 } else { PIXEL11_100 } break; } } pIn+=2; pOut+=8; } pOut+=BpL+(BpL-Xres*2*4); } } int hq2x_InitLUTs(void) { int i, j, k, r, g, b, Y, u, v; if(!(LUT16to32 = malloc(65536*sizeof(int)))) return(0); if(!(RGBtoYUV = malloc(65536*sizeof(int)))) { free(LUT16to32); return(0); } for (i=0; i<65536; i++) LUT16to32[i] = ((i & 0xF800) << 8) + ((i & 0x07E0) << 5) + ((i & 0x001F) << 3); for (i=0; i<32; i++) for (j=0; j<64; j++) for (k=0; k<32; k++) { r = i << 3; g = j << 2; b = k << 3; Y = (r + g + b) >> 2; u = 128 + ((r - b) >> 2); v = 128 + ((-r + 2*g -b)>>3); RGBtoYUV[ (i << 11) + (j << 5) + k ] = (Y<<16) + (u<<8) + v; } return(1); } void hq2x_Kill(void) { free(LUT16to32); free(RGBtoYUV); // LUT16to32=RGBtoYUV=NULL; } #ifdef FIFINONO int main(int argc, char* argv[]) { int nRes; CImage ImageIn; CImage ImageOut; char * szFilenameIn; char * szFilenameOut; if (argc <= 2) { printf("\nUsage: hq2x.exe input.bmp output.bmp\n"); printf("supports .bmp and .tga formats\n"); return 1; } szFilenameIn = argv[1]; szFilenameOut = argv[2]; if ( GetFileAttributes( szFilenameIn ) == -1 ) { printf( "ERROR: file '%s'\n not found", szFilenameIn ); return 1; } if ( ImageIn.Load( szFilenameIn ) != 0 ) { printf( "ERROR: can't load '%s'\n", szFilenameIn ); return 1; } if ( ImageIn.m_BitPerPixel != 16 ) { if ( ImageIn.ConvertTo16() != 0 ) { printf( "ERROR: '%s' conversion to 16 bit failed\n", szFilenameIn ); return 1; } } printf( "\n%s is %ix%ix%i\n", szFilenameIn, ImageIn.m_Xres, ImageIn.m_Yres, ImageIn.m_BitPerPixel ); if ( ImageOut.Init( ImageIn.m_Xres*2, ImageIn.m_Yres*2, 32 ) != 0 ) { printf( "ERROR: ImageOut.Init()\n" ); return 1; }; InitLUTs(); hq2x_32( ImageIn.m_pBitmap, ImageOut.m_pBitmap, ImageIn.m_Xres, ImageIn.m_Yres, ImageOut.m_Xres*4 ); nRes = ImageOut.Save( szFilenameOut ); if ( nRes != 0 ) { printf( "ERROR %i: ImageOut.Save(\"%s\")\n", nRes, szFilenameOut ); return nRes; } printf( "%s is %ix%ix%i\n", szFilenameOut, ImageOut.m_Xres, ImageOut.m_Yres, ImageOut.m_BitPerPixel ); printf( "\nOK\n" ); return 0; } #endif fceu-0.98.12/src/drivers/common/scale2x.h0000644000175000000620000000424410031746335017767 0ustar joestaff00000000000000/* * This file is part of the Scale2x project. * * Copyright (C) 2001, 2002, 2003, 2004 Andrea Mazzoleni * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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. */ #ifndef __SCALE2X_H #define __SCALE2X_H typedef unsigned char scale2x_uint8; typedef unsigned short scale2x_uint16; typedef unsigned scale2x_uint32; void scale2x_8_def(scale2x_uint8* dst0, scale2x_uint8* dst1, const scale2x_uint8* src0, const scale2x_uint8* src1, const scale2x_uint8* src2, unsigned count); void scale2x_16_def(scale2x_uint16* dst0, scale2x_uint16* dst1, const scale2x_uint16* src0, const scale2x_uint16* src1, const scale2x_uint16* src2, unsigned count); void scale2x_32_def(scale2x_uint32* dst0, scale2x_uint32* dst1, const scale2x_uint32* src0, const scale2x_uint32* src1, const scale2x_uint32* src2, unsigned count); #if defined(__GNUC__) && defined(__i386__) void scale2x_8_mmx(scale2x_uint8* dst0, scale2x_uint8* dst1, const scale2x_uint8* src0, const scale2x_uint8* src1, const scale2x_uint8* src2, unsigned count); void scale2x_16_mmx(scale2x_uint16* dst0, scale2x_uint16* dst1, const scale2x_uint16* src0, const scale2x_uint16* src1, const scale2x_uint16* src2, unsigned count); void scale2x_32_mmx(scale2x_uint32* dst0, scale2x_uint32* dst1, const scale2x_uint32* src0, const scale2x_uint32* src1, const scale2x_uint32* src2, unsigned count); /** * End the use of the MMX instructions. * This function must be called before using any floating-point operations. */ static inline void scale2x_mmx_emms(void) { __asm__ __volatile__ ( "emms" ); } #endif #endif fceu-0.98.12/src/drivers/common/scale3x.h0000644000175000000620000000276710031746343017777 0ustar joestaff00000000000000/* * This file is part of the Scale2x project. * * Copyright (C) 2001, 2002, 2003, 2004 Andrea Mazzoleni * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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. */ #ifndef __SCALE3X_H #define __SCALE3X_H typedef unsigned char scale3x_uint8; typedef unsigned short scale3x_uint16; typedef unsigned scale3x_uint32; void scale3x_8_def(scale3x_uint8* dst0, scale3x_uint8* dst1, scale3x_uint8* dst2, const scale3x_uint8* src0, const scale3x_uint8* src1, const scale3x_uint8* src2, unsigned count); void scale3x_16_def(scale3x_uint16* dst0, scale3x_uint16* dst1, scale3x_uint16* dst2, const scale3x_uint16* src0, const scale3x_uint16* src1, const scale3x_uint16* src2, unsigned count); void scale3x_32_def(scale3x_uint32* dst0, scale3x_uint32* dst1, scale3x_uint32* dst2, const scale3x_uint32* src0, const scale3x_uint32* src1, const scale3x_uint32* src2, unsigned count); #endif fceu-0.98.12/src/drivers/common/scalebit.c0000644000175000000620000003206010031746347020207 0ustar joestaff00000000000000/* * This file is part of the Scale2x project. * * Copyright (C) 2003 Andrea Mazzoleni * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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. */ /* * This file contains an example implementation of the Scale effect * applyed to a generic bitmap. * * You can find an high level description of the effect at : * * http://scale2x.sourceforge.net/ * * Alternatively at the previous license terms, you are allowed to use this * code in your program with these conditions: * - the program is not used in commercial activities. * - the whole source code of the program is released with the binary. * - derivative works of the program are allowed. */ #if HAVE_CONFIG_H #include #endif #include "scale2x.h" #include "scale3x.h" #if HAVE_ALLOCA_H #include #endif #include #include /** * Apply the Scale2x effect on a group of rows. Used internally. */ static inline void stage_scale2x(void* dst0, void* dst1, const void* src0, const void* src1, const void* src2, unsigned pixel, unsigned pixel_per_row) { switch (pixel) { #if defined(__GNUC__) && defined(__i386__) case 1 : scale2x_8_mmx(dst0, dst1, src0, src1, src2, pixel_per_row); break; case 2 : scale2x_16_mmx(dst0, dst1, src0, src1, src2, pixel_per_row); break; case 4 : scale2x_32_mmx(dst0, dst1, src0, src1, src2, pixel_per_row); break; #else case 1 : scale2x_8_def(dst0, dst1, src0, src1, src2, pixel_per_row); break; case 2 : scale2x_16_def(dst0, dst1, src0, src1, src2, pixel_per_row); break; case 4 : scale2x_32_def(dst0, dst1, src0, src1, src2, pixel_per_row); break; #endif } } /** * Apply the Scale3x effect on a group of rows. Used internally. */ static inline void stage_scale3x(void* dst0, void* dst1, void* dst2, const void* src0, const void* src1, const void* src2, unsigned pixel, unsigned pixel_per_row) { switch (pixel) { case 1 : scale3x_8_def(dst0, dst1, dst2, src0, src1, src2, pixel_per_row); break; case 2 : scale3x_16_def(dst0, dst1, dst2, src0, src1, src2, pixel_per_row); break; case 4 : scale3x_32_def(dst0, dst1, dst2, src0, src1, src2, pixel_per_row); break; } } /** * Apply the Scale4x effect on a group of rows. Used internally. */ static inline void stage_scale4x(void* dst0, void* dst1, void* dst2, void* dst3, const void* src0, const void* src1, const void* src2, const void* src3, unsigned pixel, unsigned pixel_per_row) { stage_scale2x(dst0, dst1, src0, src1, src2, pixel, 2 * pixel_per_row); stage_scale2x(dst2, dst3, src1, src2, src3, pixel, 2 * pixel_per_row); } #define SCDST(i) (dst+(i)*dst_slice) #define SCSRC(i) (src+(i)*src_slice) #define SCMID(i) (mid[(i)]) /** * Apply the Scale2x effect on a bitmap. * The destination bitmap is filled with the scaled version of the source bitmap. * The source bitmap isn't modified. * The destination bitmap must be manually allocated before calling the function, * note that the resulting size is exactly 2x2 times the size of the source bitmap. * \param void_dst Pointer at the first pixel of the destination bitmap. * \param dst_slice Size in bytes of a destination bitmap row. * \param void_src Pointer at the first pixel of the source bitmap. * \param src_slice Size in bytes of a source bitmap row. * \param pixel Bytes per pixel of the source and destination bitmap. * \param width Horizontal size in pixels of the source bitmap. * \param height Vertical size in pixels of the source bitmap. */ static void scale2x(void* void_dst, unsigned dst_slice, const void* void_src, unsigned src_slice, unsigned pixel, unsigned width, unsigned height) { unsigned char* dst = (unsigned char*)void_dst; const unsigned char* src = (unsigned char*)void_src; unsigned count; assert(height >= 2); count = height; stage_scale2x(SCDST(0), SCDST(1), SCSRC(0), SCSRC(0), SCSRC(1), pixel, width); dst = SCDST(2); count -= 2; while (count) { stage_scale2x(SCDST(0), SCDST(1), SCSRC(0), SCSRC(1), SCSRC(2), pixel, width); dst = SCDST(2); src = SCSRC(1); --count; } stage_scale2x(SCDST(0), SCDST(1), SCSRC(1-1), SCSRC(2-1), SCSRC(2-1), pixel, width); #if defined(__GNUC__) && defined(__i386__) scale2x_mmx_emms(); #endif } /** * Apply the Scale32x effect on a bitmap. * The destination bitmap is filled with the scaled version of the source bitmap. * The source bitmap isn't modified. * The destination bitmap must be manually allocated before calling the function, * note that the resulting size is exactly 3x3 times the size of the source bitmap. * \param void_dst Pointer at the first pixel of the destination bitmap. * \param dst_slice Size in bytes of a destination bitmap row. * \param void_src Pointer at the first pixel of the source bitmap. * \param src_slice Size in bytes of a source bitmap row. * \param pixel Bytes per pixel of the source and destination bitmap. * \param width Horizontal size in pixels of the source bitmap. * \param height Vertical size in pixels of the source bitmap. */ static void scale3x(void* void_dst, unsigned dst_slice, const void* void_src, unsigned src_slice, unsigned pixel, unsigned width, unsigned height) { unsigned char* dst = (unsigned char*)void_dst; const unsigned char* src = (unsigned char*)void_src; unsigned count; assert(height >= 2); count = height; stage_scale3x(SCDST(0), SCDST(1), SCDST(2), SCSRC(0), SCSRC(0), SCSRC(1), pixel, width); dst = SCDST(3); count -= 2; while (count) { stage_scale3x(SCDST(0), SCDST(1), SCDST(2), SCSRC(0), SCSRC(1), SCSRC(2), pixel, width); dst = SCDST(3); src = SCSRC(1); --count; } stage_scale3x(SCDST(0), SCDST(1), SCDST(2), SCSRC(1-1), SCSRC(2-1), SCSRC(2-1), pixel, width); } /** * Apply the Scale4x effect on a bitmap. * The destination bitmap is filled with the scaled version of the source bitmap. * The source bitmap isn't modified. * The destination bitmap must be manually allocated before calling the function, * note that the resulting size is exactly 4x4 times the size of the source bitmap. * \note This function requires also a small buffer bitmap used internally to store * intermediate results. This bitmap must have at least an horizontal size in bytes of 2*width*pixel, * and a vertical size of 6 rows. The memory of this buffer must not be allocated * in video memory because it's also read and not only written. Generally * a heap (malloc) or a stack (alloca) buffer is the best choices. * \param void_dst Pointer at the first pixel of the destination bitmap. * \param dst_slice Size in bytes of a destination bitmap row. * \param void_mid Pointer at the first pixel of the buffer bitmap. * \param mid_slice Size in bytes of a buffer bitmap row. * \param void_src Pointer at the first pixel of the source bitmap. * \param src_slice Size in bytes of a source bitmap row. * \param pixel Bytes per pixel of the source and destination bitmap. * \param width Horizontal size in pixels of the source bitmap. * \param height Vertical size in pixels of the source bitmap. */ static void scale4x_buf(void* void_dst, unsigned dst_slice, void* void_mid, unsigned mid_slice, const void* void_src, unsigned src_slice, unsigned pixel, unsigned width, unsigned height) { unsigned char* dst = (unsigned char*)void_dst; const unsigned char* src = (unsigned char*)void_src; unsigned count; unsigned char* mid[6]; assert(height >= 4); count = height; /* set the 6 buffer pointers */ mid[0] = (unsigned char*)void_mid; mid[1] = mid[0] + mid_slice; mid[2] = mid[1] + mid_slice; mid[3] = mid[2] + mid_slice; mid[4] = mid[3] + mid_slice; mid[5] = mid[4] + mid_slice; stage_scale2x(SCMID(-2+6), SCMID(-1+6), SCSRC(0), SCSRC(0), SCSRC(1), pixel, width); stage_scale2x(SCMID(0), SCMID(1), SCSRC(0), SCSRC(1), SCSRC(2), pixel, width); stage_scale2x(SCMID(2), SCMID(3), SCSRC(1), SCSRC(2), SCSRC(3), pixel, width); stage_scale4x(SCDST(0), SCDST(1), SCDST(2), SCDST(3), SCMID(-2+6), SCMID(-2+6), SCMID(-1+6), SCMID(0), pixel, width); dst = SCDST(4); stage_scale4x(SCDST(0), SCDST(1), SCDST(2), SCDST(3), SCMID(-1+6), SCMID(0), SCMID(1), SCMID(2), pixel, width); dst = SCDST(4); count -= 4; while (count) { unsigned char* tmp; stage_scale2x(SCMID(4), SCMID(5), SCSRC(2), SCSRC(3), SCSRC(4), pixel, width); stage_scale4x(SCDST(0), SCDST(1), SCDST(2), SCDST(3), SCMID(1), SCMID(2), SCMID(3), SCMID(4), pixel, width); dst = SCDST(4); src = SCSRC(1); tmp = SCMID(0); /* shift by 2 position */ SCMID(0) = SCMID(2); SCMID(2) = SCMID(4); SCMID(4) = tmp; tmp = SCMID(1); SCMID(1) = SCMID(3); SCMID(3) = SCMID(5); SCMID(5) = tmp; --count; } stage_scale2x(SCMID(4), SCMID(5), SCSRC(2), SCSRC(3), SCSRC(3), pixel, width); stage_scale4x(SCDST(0), SCDST(1), SCDST(2), SCDST(3), SCMID(1), SCMID(2), SCMID(3), SCMID(4), pixel, width); dst = SCDST(4); stage_scale4x(SCDST(0), SCDST(1), SCDST(2), SCDST(3), SCMID(3), SCMID(4), SCMID(5), SCMID(5), pixel, width); #if defined(__GNUC__) && defined(__i386__) scale2x_mmx_emms(); #endif } /** * Apply the Scale4x effect on a bitmap. * The destination bitmap is filled with the scaled version of the source bitmap. * The source bitmap isn't modified. * The destination bitmap must be manually allocated before calling the function, * note that the resulting size is exactly 4x4 times the size of the source bitmap. * \note This function operates like ::scale4x_buf() but the intermediate buffer is * automatically allocated in the stack. * \param void_dst Pointer at the first pixel of the destination bitmap. * \param dst_slice Size in bytes of a destination bitmap row. * \param void_src Pointer at the first pixel of the source bitmap. * \param src_slice Size in bytes of a source bitmap row. * \param pixel Bytes per pixel of the source and destination bitmap. * \param width Horizontal size in pixels of the source bitmap. * \param height Vertical size in pixels of the source bitmap. */ static void scale4x(void* void_dst, unsigned dst_slice, const void* void_src, unsigned src_slice, unsigned pixel, unsigned width, unsigned height) { unsigned mid_slice; void* mid; mid_slice = 2 * pixel * width; /* required space for 1 row buffer */ mid_slice = (mid_slice + 0x7) & ~0x7; /* align to 8 bytes */ #if HAVE_ALLOCA mid = alloca(6 * mid_slice); /* allocate space for 6 row buffers */ assert(mid != 0); /* alloca should never fails */ #else mid = malloc(6 * mid_slice); /* allocate space for 6 row buffers */ if (!mid) return; #endif scale4x_buf(void_dst, dst_slice, mid, mid_slice, void_src, src_slice, pixel, width, height); #if !HAVE_ALLOCA free(mid); #endif } /** * Check if the scale implementation is applicable at the given arguments. * \param scale Scale factor. 2, 3 or 4. * \param pixel Bytes per pixel of the source and destination bitmap. * \param width Horizontal size in pixels of the source bitmap. * \param height Vertical size in pixels of the source bitmap. * \return * - -1 on precondition violated. * - 0 on success. */ int scale_precondition(unsigned scale, unsigned pixel, unsigned width, unsigned height) { if (scale != 2 && scale != 3 && scale != 4) return -1; if (pixel != 1 && pixel != 2 && pixel != 4) return -1; switch (scale) { case 2 : case 3 : if (height < 2) return -1; break; case 4 : if (height < 4) return -1; break; } #if defined(__GNUC__) && defined(__i386__) switch (scale) { case 2 : case 4 : if (width < (16 / pixel)) return -1; if (width % (8 / pixel) != 0) return -1; break; case 3 : if (width < 2) return -1; break; } #else if (width < 2) return -1; #endif return 0; } /** * Apply the Scale effect on a bitmap. * This function is simply a common interface for ::scale2x(), ::scale3x() and ::scale4x(). * \param scale Scale factor. 2, 3 or 4. * \param void_dst Pointer at the first pixel of the destination bitmap. * \param dst_slice Size in bytes of a destination bitmap row. * \param void_src Pointer at the first pixel of the source bitmap. * \param src_slice Size in bytes of a source bitmap row. * \param pixel Bytes per pixel of the source and destination bitmap. * \param width Horizontal size in pixels of the source bitmap. * \param height Vertical size in pixels of the source bitmap. */ void scale(unsigned scale, void* void_dst, unsigned dst_slice, const void* void_src, unsigned src_slice, unsigned pixel, unsigned width, unsigned height) { switch (scale) { case 2 : scale2x(void_dst, dst_slice, void_src, src_slice, pixel, width, height); break; case 3 : scale3x(void_dst, dst_slice, void_src, src_slice, pixel, width, height); break; case 4 : scale4x(void_dst, dst_slice, void_src, src_slice, pixel, width, height); break; } } fceu-0.98.12/src/drivers/common/scalebit.h0000644000175000000620000000310310031746352020204 0ustar joestaff00000000000000/* * This file is part of the Scale2x project. * * Copyright (C) 2003 Andrea Mazzoleni * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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. */ /* * This file contains an example implementation of the Scale effect * applyed to a generic bitmap. * * You can find an high level description of the effect at : * * http://scale2x.sourceforge.net/ * * Alternatively at the previous license terms, you are allowed to use this * code in your program with these conditions: * - the program is not used in commercial activities. * - the whole source code of the program is released with the binary. * - derivative works of the program are allowed. */ #ifndef __SCALEBIT_H #define __SCALEBIT_H int scale_precondition(unsigned scale, unsigned pixel, unsigned width, unsigned height); void scale(unsigned scale, void* void_dst, unsigned dst_slice, const void* void_src, unsigned src_slice, unsigned pixel, unsigned width, unsigned height); #endif fceu-0.98.12/src/drivers/common/vidblit.c0000644000175000000620000004255210113751004020050 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "scalebit.h" #include "hq2x.h" #include "hq3x.h" #include "../../types.h" static uint32 CBM[3]; static uint32 *palettetranslate=0; static uint16 *specbuf=NULL; // 8bpp -> 16bpp, pre hq2x/hq3x static uint32 *specbuf32bpp = NULL; // Buffer to hold output // of hq2x/hq3x when converting // to 16bpp and 24bpp static int backBpp, backshiftr[3], backshiftl[3]; //static uint32 backmask[3]; static uint8 *specbuf8bpp = NULL; // For 2xscale, 3xscale. static int silt; static int Bpp; // BYTES per pixel static int highefx; #define BLUR_RED 20 #define BLUR_GREEN 20 #define BLUR_BLUE 10 #define FVB_SCANLINES 1 /* The blur effect is only available for bpp>=16. It could be easily modified to look like what happens on the real NES and TV, but lack of decent synchronization to the vertical retrace period makes it look rather blah. */ #define FVB_BLUR 2 static void CalculateShift(uint32 *CBM, int *cshiftr, int *cshiftl) { int a,x,z,y; cshiftl[0]=cshiftl[1]=cshiftl[2]=-1; for(a=0;a<3;a++) { for(x=0,y=-1,z=0;x<32;x++) { if(CBM[a]&(1<16->(hq2x)->32-> 24 or 16. YARGH. { uint32 tmpCBM[3]; backBpp = b; tmpCBM[0]=rmask; tmpCBM[1]=gmask; tmpCBM[2]=bmask; CalculateShift(tmpCBM, backshiftr, backshiftl); if(b == 2) { // ark backshiftr[0] += 16; backshiftr[1] += 8; backshiftr[2] += 0; // Begin iffy code(requires 16bpp and 32bpp to have same RGB order) //backmask[0] = (rmask>>backshiftl[0]) << (backshiftr[0]); //backmask[1] = (gmask>>backshiftl[1]) << (backshiftr[1]); //backmask[2] = (bmask>>backshiftl[2]) << (backshiftr[2]); //int x; //for(x=0;x<3;x++) // backshiftr[x] -= backshiftl[x]; // End iffy code } if(specfilt == 1) specbuf32bpp = malloc(256*240*4*sizeof(uint32)); else if(specfilt == 3) specbuf32bpp = malloc(256*240*9*sizeof(uint32)); } efx=0; b=2; rmask=0x1F<<11; gmask=0x3F<<5; bmask=0x1F; if(specfilt == 3) hq3x_InitLUTs(); else hq2x_InitLUTs(); specbuf=malloc(256*240*sizeof(uint16)); } silt = specfilt; Bpp=b; highefx=efx; if(Bpp<=1 || Bpp>4) return(0); if(efx&FVB_BLUR) { if(Bpp==2) palettetranslate=(uint32 *)malloc(65536*4); else if(Bpp>=3) palettetranslate=(uint32 *)malloc(65536*4); } else { if(Bpp==2) palettetranslate=(uint32*)malloc(65536*4); else if(Bpp>=3) palettetranslate=(uint32*)malloc(256*4); } if(!palettetranslate) return(0); CBM[0]=rmask; CBM[1]=gmask; CBM[2]=bmask; return(1); } void KillBlitToHigh(void) { if(palettetranslate) { free(palettetranslate); palettetranslate=NULL; } if(specbuf8bpp) { free(specbuf8bpp); specbuf8bpp = NULL; } if(specbuf32bpp) { free(specbuf32bpp); specbuf32bpp = NULL; } if(specbuf) { if(silt == 3) hq3x_Kill(); else hq2x_Kill(); specbuf=NULL; } } void SetPaletteBlitToHigh(uint8 *src) { int cshiftr[3]; int cshiftl[3]; int x,y; CalculateShift(CBM, cshiftr, cshiftl); switch(Bpp) { case 2: if(highefx&FVB_BLUR) { for(x=0;x<256;x++) { uint32 r,g,b; for(y=0;y<256;y++) { r=src[x<<2]*(100-BLUR_RED); g=src[(x<<2)+1]*(100-BLUR_GREEN); b=src[(x<<2)+2]*(100-BLUR_BLUE); r+=src[y<<2]*BLUR_RED; g+=src[(y<<2)+1]*BLUR_GREEN; b+=src[(y<<2)+2]*BLUR_BLUE; r/=100; g/=100; b/=100; if(r>255) r=255; if(g>255) g=255; if(b>255) b=255; palettetranslate[x|(y<<8)]=((r>>cshiftr[0])<>cshiftr[1])<>cshiftr[2])<>cshiftr[0])<>cshiftr[1])<>cshiftr[2])<>8)<<2)]>>cshiftr[0])<>8)<<2)+1]>>cshiftr[1])<>8)<<2)+2]>>cshiftr[2])<255) r=255; if(g>255) g=255; if(b>255) b=255; palettetranslate[x|(y<<8)]=(r<>8; dest++; *dest = tmp>>16; dest++; src++; } dest += dpitch / 3 - xr; } } static void Blit32to16(uint32 *src, uint16 *dest, int xr, int yr, int dpitch, int shiftr[3], int shiftl[3]) { int x,y; //printf("%d\n",shiftl[1]); for(y=yr;y;y--) { for(x=xr;x;x--) { uint32 tmp = *src; uint16 dtmp; // Begin iffy code //dtmp = (tmp & backmask[2]) >> shiftr[2]; //dtmp |= (tmp & backmask[1]) >> shiftr[1]; //dtmp |= (tmp & backmask[0]) >> shiftr[0]; // End iffy code // Begin non-iffy code dtmp = ((tmp&0x0000FF) >> shiftr[2]) << shiftl[2]; dtmp |= ((tmp&0x00FF00) >> shiftr[1]) << shiftl[1]; dtmp |= ((tmp&0xFF0000) >> shiftr[0]) << shiftl[0]; // End non-iffy code //dtmp = ((tmp&0x0000FF) >> 3); //dtmp |= ((tmp&0x00FC00) >>5); //dtmp |= ((tmp&0xF80000) >>8); *dest = dtmp; src++; dest++; } dest += dpitch / 2 - xr; } } void Blit8To8(uint8 *src, uint8 *dest, int xr, int yr, int pitch, int xscale, int yscale, int efx, int special) { int x,y; int pinc; if(special==2) { if(xscale!=2 || yscale!=2) return; scale(2,dest,pitch,src,256,1,xr,yr); return; } if(special==4) { if(xscale!=3 || yscale!=3) return; scale(3,dest,pitch,src,256,1,xr,yr); return; } pinc=pitch-(xr*xscale); if(xscale!=1 || yscale!=1) { if(efx&FVB_SCANLINES) { for(y=yr;y;y--,src+=256-xr) { int doo=yscale-(yscale>>1); do { for(x=xr;x;x--,src++) { int too=xscale; do { *(uint8 *)dest=*(uint8 *)src; dest++; } while(--too); } src-=xr; dest+=pinc; } while(--doo); //src-=xr*(yscale-(yscale>>1)); dest+=pitch*(yscale>>1); src+=xr; } } else { for(y=yr;y;y--,src+=256-xr) { int doo=yscale; do { for(x=xr;x;x--,src++) { int too=xscale; do { *(uint8 *)dest=*(uint8 *)src; dest++; } while(--too); } src-=xr; dest+=pinc; } while(--doo); src+=xr; } } } else { for(y=yr;y;y--,dest+=pinc,src+=256-xr) for(x=xr;x;x-=4,dest+=4,src+=4) *(uint32 *)dest=*(uint32 *)src; } } /* Todo: Make sure 24bpp code works right with big-endian cpus */ void Blit8ToHigh(uint8 *src, uint8 *dest, int xr, int yr, int pitch, int xscale, int yscale) { int x,y; int pinc; uint8 *destbackup = NULL; /* For hq2x */ int pitchbackup = 0; //static int google=0; //google^=1; if(specbuf8bpp) // 2xscale/3xscale { int mult; int base; if(silt == 2) mult = 2; else mult = 3; Blit8To8(src, specbuf8bpp, xr, yr, 256*mult, xscale, yscale, 0, silt); xr *= mult; yr *= mult; xscale=yscale=1; src = specbuf8bpp; base = 256*mult; switch(Bpp) { case 4: pinc=pitch-(xr<<2); for(y=yr;y;y--,src+=base-xr) { for(x=xr;x;x--) { *(uint32 *)dest=palettetranslate[(uint32)*src]; dest+=4; src++; } dest+=pinc; } break; case 3: pinc=pitch-(xr+xr+xr); for(y=yr;y;y--,src+=base-xr) { for(x=xr;x;x--) { uint32 tmp=palettetranslate[(uint32)*src]; *(uint8 *)dest=tmp; *((uint8 *)dest+1)=tmp>>8; *((uint8 *)dest+2)=tmp>>16; dest+=3; src++; src++; } dest+=pinc; } break; case 2: pinc=pitch-(xr<<1); for(y=yr;y;y--,src+=base-xr) { for(x=xr>>1;x;x--) { *(uint32 *)dest=palettetranslate[*(uint16 *)src]; dest+=4; src+=2; } dest+=pinc; } break; } return; } else if(specbuf) { destbackup=dest; dest=(uint8 *)specbuf; pitchbackup=pitch; pitch=xr*sizeof(uint16); xscale=1; yscale=1; } if(highefx&FVB_BLUR) // DONE { if(xscale!=1 || yscale!=1 || (highefx&FVB_SCANLINES)) // DONE { switch(Bpp) { case 4: pinc=pitch-((xr*xscale)<<2); for(y=yr;y;y--,src+=256-xr) { int doo=yscale; if(highefx&FVB_SCANLINES) doo-=yscale>>1; do { uint8 last=0x00; //if(doo == 1 && google) dest+=4; for(x=xr;x;x--,src++) { int too=xscale; do { *(uint32 *)dest=palettetranslate[*src|(last<<8)]; dest+=4; } while(--too); last=*src; } //if(doo == 1 && google) dest-=4; src-=xr; dest+=pinc; } while(--doo); src+=xr; if(highefx&FVB_SCANLINES) dest+=pitch*(yscale>>1); } break; case 3: pinc=pitch-((xr*xscale)*3); for(y=yr;y;y--,src+=256-xr) { int doo=yscale; if(highefx&FVB_SCANLINES) doo-=yscale>>1; do { uint8 last=0x00; for(x=xr;x;x--,src++) { int too=xscale; do { *(uint32 *)dest=palettetranslate[*src|(last<<8)]; dest+=3; } while(--too); last=*src; } src-=xr; dest+=pinc; } while(--doo); src+=xr; if(highefx&FVB_SCANLINES) dest+=pitch*(yscale>>1); } break; case 2: pinc=pitch-((xr*xscale)<<1); for(y=yr;y;y--,src+=256-xr) { int doo=yscale; if(highefx& FVB_SCANLINES) doo-=yscale>>1; do { uint8 last=0x00; for(x=xr;x;x--,src++) { int too=xscale; do { *(uint16 *)dest=palettetranslate[*src|(last<<8)]; dest+=2; } while(--too); last=*src; } src-=xr; dest+=pinc; } while(--doo); src+=xr; if(highefx&FVB_SCANLINES) dest+=pitch*(yscale>>1); } break; } } else // No scaling, no scanlines, just blurring. - DONE switch(Bpp) { case 4: pinc=pitch-(xr<<2); for(y=yr;y;y--,src+=256-xr) { uint8 last=0x00; for(x=xr;x;x--) { *(uint32 *)dest=palettetranslate[*src|(last<<8)]; last=*src; dest+=4; src++; } dest+=pinc; } break; case 3: pinc=pitch-(xr+xr+xr); for(y=yr;y;y--,src+=256-xr) { uint8 last=0x00; for(x=xr;x;x--) { uint32 tmp=palettetranslate[*src|(last<<8)]; last=*src; *(uint8 *)dest=tmp; *((uint8 *)dest+1)=tmp>>8; *((uint8 *)dest+2)=tmp>>16; dest+=3; src++; } dest+=pinc; } break; case 2: pinc=pitch-(xr<<1); for(y=yr;y;y--,src+=256-xr) { uint8 last=0x00; for(x=xr;x;x--) { *(uint16 *)dest=palettetranslate[*src|(last<<8)]; last=*src; dest+=2; src++; } dest+=pinc; } break; } } else // No blur effects. { if(xscale!=1 || yscale!=1 || (highefx&FVB_SCANLINES)) { switch(Bpp) { case 4: pinc=pitch-((xr*xscale)<<2); for(y=yr;y;y--,src+=256-xr) { int doo=yscale; if(highefx& FVB_SCANLINES) doo-=yscale>>1; do { for(x=xr;x;x--,src++) { int too=xscale; do { *(uint32 *)dest=palettetranslate[*src]; dest+=4; } while(--too); } src-=xr; dest+=pinc; } while(--doo); src+=xr; if(highefx&FVB_SCANLINES) dest+=pitch*(yscale>>1); } break; case 3: pinc=pitch-((xr*xscale)*3); for(y=yr;y;y--,src+=256-xr) { int doo=yscale; if(highefx& FVB_SCANLINES) doo-=yscale>>1; do { for(x=xr;x;x--,src++) { int too=xscale; do { uint32 tmp=palettetranslate[(uint32)*src]; *(uint8 *)dest=tmp; *((uint8 *)dest+1)=tmp>>8; *((uint8 *)dest+2)=tmp>>16; dest+=3; //*(uint32 *)dest=palettetranslate[*src]; //dest+=4; } while(--too); } src-=xr; dest+=pinc; } while(--doo); src+=xr; if(highefx&FVB_SCANLINES) dest+=pitch*(yscale>>1); } break; case 2: pinc=pitch-((xr*xscale)<<1); for(y=yr;y;y--,src+=256-xr) { int doo=yscale; if(highefx& FVB_SCANLINES) doo-=yscale>>1; do { for(x=xr;x;x--,src++) { int too=xscale; do { *(uint16 *)dest=palettetranslate[*src]; dest+=2; } while(--too); } src-=xr; dest+=pinc; } while(--doo); src+=xr; if(highefx&FVB_SCANLINES) dest+=pitch*(yscale>>1); } break; } } else switch(Bpp) { case 4: pinc=pitch-(xr<<2); for(y=yr;y;y--,src+=256-xr) { for(x=xr;x;x--) { *(uint32 *)dest=palettetranslate[(uint32)*src]; dest+=4; src++; } dest+=pinc; } break; case 3: pinc=pitch-(xr+xr+xr); for(y=yr;y;y--,src+=256-xr) { for(x=xr;x;x--) { uint32 tmp=palettetranslate[(uint32)*src]; *(uint8 *)dest=tmp; *((uint8 *)dest+1)=tmp>>8; *((uint8 *)dest+2)=tmp>>16; dest+=3; src++; } dest+=pinc; } break; case 2: pinc=pitch-(xr<<1); for(y=yr;y;y--,src+=256-xr) { for(x=xr>>1;x;x--) { *(uint32 *)dest=palettetranslate[*(uint16 *)src]; dest+=4; src+=2; } dest+=pinc; } break; } } if(specbuf) { if(specbuf32bpp) { int mult = (silt == 3)?3:2; if(silt == 3) hq3x_32((uint8 *)specbuf,(uint8*)specbuf32bpp,xr,yr,xr*3*sizeof(uint32)); else hq2x_32((uint8 *)specbuf,(uint8*)specbuf32bpp,xr,yr,xr*2*sizeof(uint32)); if(backBpp == 2) Blit32to16(specbuf32bpp, (uint16*)destbackup, xr*mult, yr*mult, pitchbackup, backshiftr,backshiftl); else // == 3 Blit32to24(specbuf32bpp, (uint8*)destbackup, xr*mult, yr*mult, pitchbackup); } else { if(silt == 3) hq3x_32((uint8 *)specbuf,destbackup,xr,yr,pitchbackup); else hq2x_32((uint8 *)specbuf,destbackup,xr,yr,pitchbackup); } } } fceu-0.98.12/src/drivers/common/hq2x.h0000644000175000000620000000020710004260025017266 0ustar joestaff00000000000000void hq2x_32( unsigned char * pIn, unsigned char * pOut, int Xres, int Yres, int BpL); int hq2x_InitLUTs(void); void hq2x_Kill(void); fceu-0.98.12/src/drivers/common/scale2x.c0000644000175000000620000005730310031746415017765 0ustar joestaff00000000000000/* * This file is part of the Scale2x project. * * Copyright (C) 2001, 2002, 2003, 2004 Andrea Mazzoleni * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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. */ /* * This file contains a C and MMX implementation of the Scale2x effect. * * You can find an high level description of the effect at : * * http://scale2x.sourceforge.net/ * * Alternatively at the previous license terms, you are allowed to use this * code in your program with these conditions: * - the program is not used in commercial activities. * - the whole source code of the program is released with the binary. * - derivative works of the program are allowed. */ #include "scale2x.h" #include /***************************************************************************/ /* Scale2x C implementation */ static inline void scale2x_8_def_single(scale2x_uint8* __restrict__ dst, const scale2x_uint8* __restrict__ src0, const scale2x_uint8* __restrict__ src1, const scale2x_uint8* __restrict__ src2, unsigned count) { assert(count >= 2); /* first pixel */ dst[0] = src1[0]; if (src1[1] == src0[0] && src2[0] != src0[0]) dst[1] = src0[0]; else dst[1] = src1[0]; ++src0; ++src1; ++src2; dst += 2; /* central pixels */ count -= 2; while (count) { if (src0[0] != src2[0] && src1[-1] != src1[1]) { dst[0] = src1[-1] == src0[0] ? src0[0] : src1[0]; dst[1] = src1[1] == src0[0] ? src0[0] : src1[0]; } else { dst[0] = src1[0]; dst[1] = src1[0]; } ++src0; ++src1; ++src2; dst += 2; --count; } /* last pixel */ if (src1[-1] == src0[0] && src2[0] != src0[0]) dst[0] = src0[0]; else dst[0] = src1[0]; dst[1] = src1[0]; } static inline void scale2x_16_def_single(scale2x_uint16* __restrict__ dst, const scale2x_uint16* __restrict__ src0, const scale2x_uint16* __restrict__ src1, const scale2x_uint16* __restrict__ src2, unsigned count) { assert(count >= 2); /* first pixel */ dst[0] = src1[0]; if (src1[1] == src0[0] && src2[0] != src0[0]) dst[1] = src0[0]; else dst[1] = src1[0]; ++src0; ++src1; ++src2; dst += 2; /* central pixels */ count -= 2; while (count) { if (src0[0] != src2[0] && src1[-1] != src1[1]) { dst[0] = src1[-1] == src0[0] ? src0[0] : src1[0]; dst[1] = src1[1] == src0[0] ? src0[0] : src1[0]; } else { dst[0] = src1[0]; dst[1] = src1[0]; } ++src0; ++src1; ++src2; dst += 2; --count; } /* last pixel */ if (src1[-1] == src0[0] && src2[0] != src0[0]) dst[0] = src0[0]; else dst[0] = src1[0]; dst[1] = src1[0]; } static inline void scale2x_32_def_single(scale2x_uint32* __restrict__ dst, const scale2x_uint32* __restrict__ src0, const scale2x_uint32* __restrict__ src1, const scale2x_uint32* __restrict__ src2, unsigned count) { assert(count >= 2); /* first pixel */ dst[0] = src1[0]; if (src1[1] == src0[0] && src2[0] != src0[0]) dst[1] = src0[0]; else dst[1] = src1[0]; ++src0; ++src1; ++src2; dst += 2; /* central pixels */ count -= 2; while (count) { if (src0[0] != src2[0] && src1[-1] != src1[1]) { dst[0] = src1[-1] == src0[0] ? src0[0] : src1[0]; dst[1] = src1[1] == src0[0] ? src0[0] : src1[0]; } else { dst[0] = src1[0]; dst[1] = src1[0]; } ++src0; ++src1; ++src2; dst += 2; --count; } /* last pixel */ if (src1[-1] == src0[0] && src2[0] != src0[0]) dst[0] = src0[0]; else dst[0] = src1[0]; dst[1] = src1[0]; } /** * Scale by a factor of 2 a row of pixels of 8 bits. * The function is implemented in C. * The pixels over the left and right borders are assumed of the same color of * the pixels on the border. * \param src0 Pointer at the first pixel of the previous row. * \param src1 Pointer at the first pixel of the current row. * \param src2 Pointer at the first pixel of the next row. * \param count Length in pixels of the src0, src1 and src2 rows. * It must be at least 2. * \param dst0 First destination row, double length in pixels. * \param dst1 Second destination row, double length in pixels. */ void scale2x_8_def(scale2x_uint8* dst0, scale2x_uint8* dst1, const scale2x_uint8* src0, const scale2x_uint8* src1, const scale2x_uint8* src2, unsigned count) { assert(count >= 2); scale2x_8_def_single(dst0, src0, src1, src2, count); scale2x_8_def_single(dst1, src2, src1, src0, count); } /** * Scale by a factor of 2 a row of pixels of 16 bits. * This function operates like scale2x_8_def() but for 16 bits pixels. * \param src0 Pointer at the first pixel of the previous row. * \param src1 Pointer at the first pixel of the current row. * \param src2 Pointer at the first pixel of the next row. * \param count Length in pixels of the src0, src1 and src2 rows. * It must be at least 2. * \param dst0 First destination row, double length in pixels. * \param dst1 Second destination row, double length in pixels. */ void scale2x_16_def(scale2x_uint16* dst0, scale2x_uint16* dst1, const scale2x_uint16* src0, const scale2x_uint16* src1, const scale2x_uint16* src2, unsigned count) { assert(count >= 2); scale2x_16_def_single(dst0, src0, src1, src2, count); scale2x_16_def_single(dst1, src2, src1, src0, count); } /** * Scale by a factor of 2 a row of pixels of 32 bits. * This function operates like scale2x_8_def() but for 32 bits pixels. * \param src0 Pointer at the first pixel of the previous row. * \param src1 Pointer at the first pixel of the current row. * \param src2 Pointer at the first pixel of the next row. * \param count Length in pixels of the src0, src1 and src2 rows. * It must be at least 2. * \param dst0 First destination row, double length in pixels. * \param dst1 Second destination row, double length in pixels. */ void scale2x_32_def(scale2x_uint32* dst0, scale2x_uint32* dst1, const scale2x_uint32* src0, const scale2x_uint32* src1, const scale2x_uint32* src2, unsigned count) { assert(count >= 2); scale2x_32_def_single(dst0, src0, src1, src2, count); scale2x_32_def_single(dst1, src2, src1, src0, count); } /***************************************************************************/ /* Scale2x MMX implementation */ #if defined(__GNUC__) && defined(__i386__) /* * Apply the Scale2x effect at a single row. * This function must be called only by the other scale2x functions. * * Considering the pixel map : * * ABC (src0) * DEF (src1) * GHI (src2) * * this functions compute 2 new pixels in substitution of the source pixel E * like this map : * * ab (dst) * * with these variables : * * ¤t -> E * ¤t_left -> D * ¤t_right -> F * ¤t_upper -> B * ¤t_lower -> H * * %0 -> current_upper * %1 -> current * %2 -> current_lower * %3 -> dst * %4 -> counter * * %mm0 -> *current_left * %mm1 -> *current_next * %mm2 -> tmp0 * %mm3 -> tmp1 * %mm4 -> tmp2 * %mm5 -> tmp3 * %mm6 -> *current_upper * %mm7 -> *current */ static inline void scale2x_8_mmx_single(scale2x_uint8* dst, const scale2x_uint8* src0, const scale2x_uint8* src1, const scale2x_uint8* src2, unsigned count) { assert(count >= 16); assert(count % 8 == 0); /* always do the first and last run */ count -= 2*8; __asm__ __volatile__( /* first run */ /* set the current, current_pre, current_next registers */ "movq 0(%1), %%mm0\n" "movq 0(%1), %%mm7\n" "movq 8(%1), %%mm1\n" "psllq $56, %%mm0\n" "psllq $56, %%mm1\n" "psrlq $56, %%mm0\n" "movq %%mm7, %%mm2\n" "movq %%mm7, %%mm3\n" "psllq $8, %%mm2\n" "psrlq $8, %%mm3\n" "por %%mm2, %%mm0\n" "por %%mm3, %%mm1\n" /* current_upper */ "movq (%0), %%mm6\n" /* compute the upper-left pixel for dst on %%mm2 */ /* compute the upper-right pixel for dst on %%mm4 */ "movq %%mm0, %%mm2\n" "movq %%mm1, %%mm4\n" "movq %%mm0, %%mm3\n" "movq %%mm1, %%mm5\n" "pcmpeqb %%mm6, %%mm2\n" "pcmpeqb %%mm6, %%mm4\n" "pcmpeqb (%2), %%mm3\n" "pcmpeqb (%2), %%mm5\n" "pandn %%mm2, %%mm3\n" "pandn %%mm4, %%mm5\n" "movq %%mm0, %%mm2\n" "movq %%mm1, %%mm4\n" "pcmpeqb %%mm1, %%mm2\n" "pcmpeqb %%mm0, %%mm4\n" "pandn %%mm3, %%mm2\n" "pandn %%mm5, %%mm4\n" "movq %%mm2, %%mm3\n" "movq %%mm4, %%mm5\n" "pand %%mm6, %%mm2\n" "pand %%mm6, %%mm4\n" "pandn %%mm7, %%mm3\n" "pandn %%mm7, %%mm5\n" "por %%mm3, %%mm2\n" "por %%mm5, %%mm4\n" /* set *dst */ "movq %%mm2, %%mm3\n" "punpcklbw %%mm4, %%mm2\n" "punpckhbw %%mm4, %%mm3\n" "movq %%mm2, (%3)\n" "movq %%mm3, 8(%3)\n" /* next */ "addl $8, %0\n" "addl $8, %1\n" "addl $8, %2\n" "addl $16, %3\n" /* central runs */ "shrl $3, %4\n" "jz 1f\n" "0:\n" /* set the current, current_pre, current_next registers */ "movq -8(%1), %%mm0\n" "movq (%1), %%mm7\n" "movq 8(%1), %%mm1\n" "psrlq $56, %%mm0\n" "psllq $56, %%mm1\n" "movq %%mm7, %%mm2\n" "movq %%mm7, %%mm3\n" "psllq $8, %%mm2\n" "psrlq $8, %%mm3\n" "por %%mm2, %%mm0\n" "por %%mm3, %%mm1\n" /* current_upper */ "movq (%0), %%mm6\n" /* compute the upper-left pixel for dst on %%mm2 */ /* compute the upper-right pixel for dst on %%mm4 */ "movq %%mm0, %%mm2\n" "movq %%mm1, %%mm4\n" "movq %%mm0, %%mm3\n" "movq %%mm1, %%mm5\n" "pcmpeqb %%mm6, %%mm2\n" "pcmpeqb %%mm6, %%mm4\n" "pcmpeqb (%2), %%mm3\n" "pcmpeqb (%2), %%mm5\n" "pandn %%mm2, %%mm3\n" "pandn %%mm4, %%mm5\n" "movq %%mm0, %%mm2\n" "movq %%mm1, %%mm4\n" "pcmpeqb %%mm1, %%mm2\n" "pcmpeqb %%mm0, %%mm4\n" "pandn %%mm3, %%mm2\n" "pandn %%mm5, %%mm4\n" "movq %%mm2, %%mm3\n" "movq %%mm4, %%mm5\n" "pand %%mm6, %%mm2\n" "pand %%mm6, %%mm4\n" "pandn %%mm7, %%mm3\n" "pandn %%mm7, %%mm5\n" "por %%mm3, %%mm2\n" "por %%mm5, %%mm4\n" /* set *dst */ "movq %%mm2, %%mm3\n" "punpcklbw %%mm4, %%mm2\n" "punpckhbw %%mm4, %%mm3\n" "movq %%mm2, (%3)\n" "movq %%mm3, 8(%3)\n" /* next */ "addl $8, %0\n" "addl $8, %1\n" "addl $8, %2\n" "addl $16, %3\n" "decl %4\n" "jnz 0b\n" "1:\n" /* final run */ /* set the current, current_pre, current_next registers */ "movq (%1), %%mm1\n" "movq (%1), %%mm7\n" "movq -8(%1), %%mm0\n" "psrlq $56, %%mm1\n" "psrlq $56, %%mm0\n" "psllq $56, %%mm1\n" "movq %%mm7, %%mm2\n" "movq %%mm7, %%mm3\n" "psllq $8, %%mm2\n" "psrlq $8, %%mm3\n" "por %%mm2, %%mm0\n" "por %%mm3, %%mm1\n" /* current_upper */ "movq (%0), %%mm6\n" /* compute the upper-left pixel for dst on %%mm2 */ /* compute the upper-right pixel for dst on %%mm4 */ "movq %%mm0, %%mm2\n" "movq %%mm1, %%mm4\n" "movq %%mm0, %%mm3\n" "movq %%mm1, %%mm5\n" "pcmpeqb %%mm6, %%mm2\n" "pcmpeqb %%mm6, %%mm4\n" "pcmpeqb (%2), %%mm3\n" "pcmpeqb (%2), %%mm5\n" "pandn %%mm2, %%mm3\n" "pandn %%mm4, %%mm5\n" "movq %%mm0, %%mm2\n" "movq %%mm1, %%mm4\n" "pcmpeqb %%mm1, %%mm2\n" "pcmpeqb %%mm0, %%mm4\n" "pandn %%mm3, %%mm2\n" "pandn %%mm5, %%mm4\n" "movq %%mm2, %%mm3\n" "movq %%mm4, %%mm5\n" "pand %%mm6, %%mm2\n" "pand %%mm6, %%mm4\n" "pandn %%mm7, %%mm3\n" "pandn %%mm7, %%mm5\n" "por %%mm3, %%mm2\n" "por %%mm5, %%mm4\n" /* set *dst */ "movq %%mm2, %%mm3\n" "punpcklbw %%mm4, %%mm2\n" "punpckhbw %%mm4, %%mm3\n" "movq %%mm2, (%3)\n" "movq %%mm3, 8(%3)\n" : "+r" (src0), "+r" (src1), "+r" (src2), "+r" (dst), "+r" (count) : : "cc" ); } static inline void scale2x_16_mmx_single(scale2x_uint16* dst, const scale2x_uint16* src0, const scale2x_uint16* src1, const scale2x_uint16* src2, unsigned count) { assert(count >= 8); assert(count % 4 == 0); /* always do the first and last run */ count -= 2*4; __asm__ __volatile__( /* first run */ /* set the current, current_pre, current_next registers */ "movq 0(%1), %%mm0\n" "movq 0(%1), %%mm7\n" "movq 8(%1), %%mm1\n" "psllq $48, %%mm0\n" "psllq $48, %%mm1\n" "psrlq $48, %%mm0\n" "movq %%mm7, %%mm2\n" "movq %%mm7, %%mm3\n" "psllq $16, %%mm2\n" "psrlq $16, %%mm3\n" "por %%mm2, %%mm0\n" "por %%mm3, %%mm1\n" /* current_upper */ "movq (%0), %%mm6\n" /* compute the upper-left pixel for dst on %%mm2 */ /* compute the upper-right pixel for dst on %%mm4 */ "movq %%mm0, %%mm2\n" "movq %%mm1, %%mm4\n" "movq %%mm0, %%mm3\n" "movq %%mm1, %%mm5\n" "pcmpeqw %%mm6, %%mm2\n" "pcmpeqw %%mm6, %%mm4\n" "pcmpeqw (%2), %%mm3\n" "pcmpeqw (%2), %%mm5\n" "pandn %%mm2, %%mm3\n" "pandn %%mm4, %%mm5\n" "movq %%mm0, %%mm2\n" "movq %%mm1, %%mm4\n" "pcmpeqw %%mm1, %%mm2\n" "pcmpeqw %%mm0, %%mm4\n" "pandn %%mm3, %%mm2\n" "pandn %%mm5, %%mm4\n" "movq %%mm2, %%mm3\n" "movq %%mm4, %%mm5\n" "pand %%mm6, %%mm2\n" "pand %%mm6, %%mm4\n" "pandn %%mm7, %%mm3\n" "pandn %%mm7, %%mm5\n" "por %%mm3, %%mm2\n" "por %%mm5, %%mm4\n" /* set *dst */ "movq %%mm2, %%mm3\n" "punpcklwd %%mm4, %%mm2\n" "punpckhwd %%mm4, %%mm3\n" "movq %%mm2, (%3)\n" "movq %%mm3, 8(%3)\n" /* next */ "addl $8, %0\n" "addl $8, %1\n" "addl $8, %2\n" "addl $16, %3\n" /* central runs */ "shrl $2, %4\n" "jz 1f\n" "0:\n" /* set the current, current_pre, current_next registers */ "movq -8(%1), %%mm0\n" "movq (%1), %%mm7\n" "movq 8(%1), %%mm1\n" "psrlq $48, %%mm0\n" "psllq $48, %%mm1\n" "movq %%mm7, %%mm2\n" "movq %%mm7, %%mm3\n" "psllq $16, %%mm2\n" "psrlq $16, %%mm3\n" "por %%mm2, %%mm0\n" "por %%mm3, %%mm1\n" /* current_upper */ "movq (%0), %%mm6\n" /* compute the upper-left pixel for dst on %%mm2 */ /* compute the upper-right pixel for dst on %%mm4 */ "movq %%mm0, %%mm2\n" "movq %%mm1, %%mm4\n" "movq %%mm0, %%mm3\n" "movq %%mm1, %%mm5\n" "pcmpeqw %%mm6, %%mm2\n" "pcmpeqw %%mm6, %%mm4\n" "pcmpeqw (%2), %%mm3\n" "pcmpeqw (%2), %%mm5\n" "pandn %%mm2, %%mm3\n" "pandn %%mm4, %%mm5\n" "movq %%mm0, %%mm2\n" "movq %%mm1, %%mm4\n" "pcmpeqw %%mm1, %%mm2\n" "pcmpeqw %%mm0, %%mm4\n" "pandn %%mm3, %%mm2\n" "pandn %%mm5, %%mm4\n" "movq %%mm2, %%mm3\n" "movq %%mm4, %%mm5\n" "pand %%mm6, %%mm2\n" "pand %%mm6, %%mm4\n" "pandn %%mm7, %%mm3\n" "pandn %%mm7, %%mm5\n" "por %%mm3, %%mm2\n" "por %%mm5, %%mm4\n" /* set *dst */ "movq %%mm2, %%mm3\n" "punpcklwd %%mm4, %%mm2\n" "punpckhwd %%mm4, %%mm3\n" "movq %%mm2, (%3)\n" "movq %%mm3, 8(%3)\n" /* next */ "addl $8, %0\n" "addl $8, %1\n" "addl $8, %2\n" "addl $16, %3\n" "decl %4\n" "jnz 0b\n" "1:\n" /* final run */ /* set the current, current_pre, current_next registers */ "movq (%1), %%mm1\n" "movq (%1), %%mm7\n" "movq -8(%1), %%mm0\n" "psrlq $48, %%mm1\n" "psrlq $48, %%mm0\n" "psllq $48, %%mm1\n" "movq %%mm7, %%mm2\n" "movq %%mm7, %%mm3\n" "psllq $16, %%mm2\n" "psrlq $16, %%mm3\n" "por %%mm2, %%mm0\n" "por %%mm3, %%mm1\n" /* current_upper */ "movq (%0), %%mm6\n" /* compute the upper-left pixel for dst on %%mm2 */ /* compute the upper-right pixel for dst on %%mm4 */ "movq %%mm0, %%mm2\n" "movq %%mm1, %%mm4\n" "movq %%mm0, %%mm3\n" "movq %%mm1, %%mm5\n" "pcmpeqw %%mm6, %%mm2\n" "pcmpeqw %%mm6, %%mm4\n" "pcmpeqw (%2), %%mm3\n" "pcmpeqw (%2), %%mm5\n" "pandn %%mm2, %%mm3\n" "pandn %%mm4, %%mm5\n" "movq %%mm0, %%mm2\n" "movq %%mm1, %%mm4\n" "pcmpeqw %%mm1, %%mm2\n" "pcmpeqw %%mm0, %%mm4\n" "pandn %%mm3, %%mm2\n" "pandn %%mm5, %%mm4\n" "movq %%mm2, %%mm3\n" "movq %%mm4, %%mm5\n" "pand %%mm6, %%mm2\n" "pand %%mm6, %%mm4\n" "pandn %%mm7, %%mm3\n" "pandn %%mm7, %%mm5\n" "por %%mm3, %%mm2\n" "por %%mm5, %%mm4\n" /* set *dst */ "movq %%mm2, %%mm3\n" "punpcklwd %%mm4, %%mm2\n" "punpckhwd %%mm4, %%mm3\n" "movq %%mm2, (%3)\n" "movq %%mm3, 8(%3)\n" : "+r" (src0), "+r" (src1), "+r" (src2), "+r" (dst), "+r" (count) : : "cc" ); } static inline void scale2x_32_mmx_single(scale2x_uint32* dst, const scale2x_uint32* src0, const scale2x_uint32* src1, const scale2x_uint32* src2, unsigned count) { assert(count >= 4); assert(count % 2 == 0); /* always do the first and last run */ count -= 2*2; __asm__ __volatile__( /* first run */ /* set the current, current_pre, current_next registers */ "movq 0(%1), %%mm0\n" "movq 0(%1), %%mm7\n" "movq 8(%1), %%mm1\n" "psllq $32, %%mm0\n" "psllq $32, %%mm1\n" "psrlq $32, %%mm0\n" "movq %%mm7, %%mm2\n" "movq %%mm7, %%mm3\n" "psllq $32, %%mm2\n" "psrlq $32, %%mm3\n" "por %%mm2, %%mm0\n" "por %%mm3, %%mm1\n" /* current_upper */ "movq (%0), %%mm6\n" /* compute the upper-left pixel for dst on %%mm2 */ /* compute the upper-right pixel for dst on %%mm4 */ "movq %%mm0, %%mm2\n" "movq %%mm1, %%mm4\n" "movq %%mm0, %%mm3\n" "movq %%mm1, %%mm5\n" "pcmpeqd %%mm6, %%mm2\n" "pcmpeqd %%mm6, %%mm4\n" "pcmpeqd (%2), %%mm3\n" "pcmpeqd (%2), %%mm5\n" "pandn %%mm2, %%mm3\n" "pandn %%mm4, %%mm5\n" "movq %%mm0, %%mm2\n" "movq %%mm1, %%mm4\n" "pcmpeqd %%mm1, %%mm2\n" "pcmpeqd %%mm0, %%mm4\n" "pandn %%mm3, %%mm2\n" "pandn %%mm5, %%mm4\n" "movq %%mm2, %%mm3\n" "movq %%mm4, %%mm5\n" "pand %%mm6, %%mm2\n" "pand %%mm6, %%mm4\n" "pandn %%mm7, %%mm3\n" "pandn %%mm7, %%mm5\n" "por %%mm3, %%mm2\n" "por %%mm5, %%mm4\n" /* set *dst */ "movq %%mm2, %%mm3\n" "punpckldq %%mm4, %%mm2\n" "punpckhdq %%mm4, %%mm3\n" "movq %%mm2, (%3)\n" "movq %%mm3, 8(%3)\n" /* next */ "addl $8, %0\n" "addl $8, %1\n" "addl $8, %2\n" "addl $16, %3\n" /* central runs */ "shrl $1, %4\n" "jz 1f\n" "0:\n" /* set the current, current_pre, current_next registers */ "movq -8(%1), %%mm0\n" "movq (%1), %%mm7\n" "movq 8(%1), %%mm1\n" "psrlq $32, %%mm0\n" "psllq $32, %%mm1\n" "movq %%mm7, %%mm2\n" "movq %%mm7, %%mm3\n" "psllq $32, %%mm2\n" "psrlq $32, %%mm3\n" "por %%mm2, %%mm0\n" "por %%mm3, %%mm1\n" /* current_upper */ "movq (%0), %%mm6\n" /* compute the upper-left pixel for dst on %%mm2 */ /* compute the upper-right pixel for dst on %%mm4 */ "movq %%mm0, %%mm2\n" "movq %%mm1, %%mm4\n" "movq %%mm0, %%mm3\n" "movq %%mm1, %%mm5\n" "pcmpeqd %%mm6, %%mm2\n" "pcmpeqd %%mm6, %%mm4\n" "pcmpeqd (%2), %%mm3\n" "pcmpeqd (%2), %%mm5\n" "pandn %%mm2, %%mm3\n" "pandn %%mm4, %%mm5\n" "movq %%mm0, %%mm2\n" "movq %%mm1, %%mm4\n" "pcmpeqd %%mm1, %%mm2\n" "pcmpeqd %%mm0, %%mm4\n" "pandn %%mm3, %%mm2\n" "pandn %%mm5, %%mm4\n" "movq %%mm2, %%mm3\n" "movq %%mm4, %%mm5\n" "pand %%mm6, %%mm2\n" "pand %%mm6, %%mm4\n" "pandn %%mm7, %%mm3\n" "pandn %%mm7, %%mm5\n" "por %%mm3, %%mm2\n" "por %%mm5, %%mm4\n" /* set *dst */ "movq %%mm2, %%mm3\n" "punpckldq %%mm4, %%mm2\n" "punpckhdq %%mm4, %%mm3\n" "movq %%mm2, (%3)\n" "movq %%mm3, 8(%3)\n" /* next */ "addl $8, %0\n" "addl $8, %1\n" "addl $8, %2\n" "addl $16, %3\n" "decl %4\n" "jnz 0b\n" "1:\n" /* final run */ /* set the current, current_pre, current_next registers */ "movq (%1), %%mm1\n" "movq (%1), %%mm7\n" "movq -8(%1), %%mm0\n" "psrlq $32, %%mm1\n" "psrlq $32, %%mm0\n" "psllq $32, %%mm1\n" "movq %%mm7, %%mm2\n" "movq %%mm7, %%mm3\n" "psllq $32, %%mm2\n" "psrlq $32, %%mm3\n" "por %%mm2, %%mm0\n" "por %%mm3, %%mm1\n" /* current_upper */ "movq (%0), %%mm6\n" /* compute the upper-left pixel for dst on %%mm2 */ /* compute the upper-right pixel for dst on %%mm4 */ "movq %%mm0, %%mm2\n" "movq %%mm1, %%mm4\n" "movq %%mm0, %%mm3\n" "movq %%mm1, %%mm5\n" "pcmpeqd %%mm6, %%mm2\n" "pcmpeqd %%mm6, %%mm4\n" "pcmpeqd (%2), %%mm3\n" "pcmpeqd (%2), %%mm5\n" "pandn %%mm2, %%mm3\n" "pandn %%mm4, %%mm5\n" "movq %%mm0, %%mm2\n" "movq %%mm1, %%mm4\n" "pcmpeqd %%mm1, %%mm2\n" "pcmpeqd %%mm0, %%mm4\n" "pandn %%mm3, %%mm2\n" "pandn %%mm5, %%mm4\n" "movq %%mm2, %%mm3\n" "movq %%mm4, %%mm5\n" "pand %%mm6, %%mm2\n" "pand %%mm6, %%mm4\n" "pandn %%mm7, %%mm3\n" "pandn %%mm7, %%mm5\n" "por %%mm3, %%mm2\n" "por %%mm5, %%mm4\n" /* set *dst */ "movq %%mm2, %%mm3\n" "punpckldq %%mm4, %%mm2\n" "punpckhdq %%mm4, %%mm3\n" "movq %%mm2, (%3)\n" "movq %%mm3, 8(%3)\n" : "+r" (src0), "+r" (src1), "+r" (src2), "+r" (dst), "+r" (count) : : "cc" ); } /** * Scale by a factor of 2 a row of pixels of 8 bits. * This is a very fast MMX implementation. * The implementation uses a combination of cmp/and/not operations to * completly remove the need of conditional jumps. This trick give the * major speed improvement. * Also, using the 8 bytes MMX registers more than one pixel are computed * at the same time. * Before calling this function you must ensure that the currenct CPU supports * the MMX instruction set. After calling it you must be sure to call the EMMS * instruction before any floating-point operation. * The pixels over the left and right borders are assumed of the same color of * the pixels on the border. * \param src0 Pointer at the first pixel of the previous row. * \param src1 Pointer at the first pixel of the current row. * \param src2 Pointer at the first pixel of the next row. * \param count Length in pixels of the src0, src1 and src2 rows. It must * be at least 16 and a multiple of 8. * \param dst0 First destination row, double length in pixels. * \param dst1 Second destination row, double length in pixels. */ void scale2x_8_mmx(scale2x_uint8* dst0, scale2x_uint8* dst1, const scale2x_uint8* src0, const scale2x_uint8* src1, const scale2x_uint8* src2, unsigned count) { if (count % 8 != 0 || count < 16) { scale2x_8_def(dst0, dst1, src0, src1, src2, count); } else { assert(count >= 16); assert(count % 8 == 0); scale2x_8_mmx_single(dst0, src0, src1, src2, count); scale2x_8_mmx_single(dst1, src2, src1, src0, count); } } /** * Scale by a factor of 2 a row of pixels of 16 bits. * This function operates like scale2x_8_mmx() but for 16 bits pixels. * \param src0 Pointer at the first pixel of the previous row. * \param src1 Pointer at the first pixel of the current row. * \param src2 Pointer at the first pixel of the next row. * \param count Length in pixels of the src0, src1 and src2 rows. It must * be at least 8 and a multiple of 4. * \param dst0 First destination row, double length in pixels. * \param dst1 Second destination row, double length in pixels. */ void scale2x_16_mmx(scale2x_uint16* dst0, scale2x_uint16* dst1, const scale2x_uint16* src0, const scale2x_uint16* src1, const scale2x_uint16* src2, unsigned count) { if (count % 4 != 0 || count < 8) { scale2x_16_def(dst0, dst1, src0, src1, src2, count); } else { assert(count >= 8); assert(count % 4 == 0); scale2x_16_mmx_single(dst0, src0, src1, src2, count); scale2x_16_mmx_single(dst1, src2, src1, src0, count); } } /** * Scale by a factor of 2 a row of pixels of 32 bits. * This function operates like scale2x_8_mmx() but for 32 bits pixels. * \param src0 Pointer at the first pixel of the previous row. * \param src1 Pointer at the first pixel of the current row. * \param src2 Pointer at the first pixel of the next row. * \param count Length in pixels of the src0, src1 and src2 rows. It must * be at least 4 and a multiple of 2. * \param dst0 First destination row, double length in pixels. * \param dst1 Second destination row, double length in pixels. */ void scale2x_32_mmx(scale2x_uint32* dst0, scale2x_uint32* dst1, const scale2x_uint32* src0, const scale2x_uint32* src1, const scale2x_uint32* src2, unsigned count) { if (count % 2 != 0 || count < 4) { scale2x_32_def(dst0, dst1, src0, src1, src2, count); } else { assert(count >= 4); assert(count % 2 == 0); scale2x_32_mmx_single(dst0, src0, src1, src2, count); scale2x_32_mmx_single(dst1, src2, src1, src0, count); } } #endif fceu-0.98.12/src/drivers/common/scale3x.c0000644000175000000620000002617410031746423017767 0ustar joestaff00000000000000/* * This file is part of the Scale2x project. * * Copyright (C) 2001, 2002, 2003, 2004 Andrea Mazzoleni * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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. */ /* * This file contains a C and MMX implementation of the Scale2x effect. * * You can find an high level description of the effect at : * * http://scale2x.sourceforge.net/ * * Alternatively at the previous license terms, you are allowed to use this * code in your program with these conditions: * - the program is not used in commercial activities. * - the whole source code of the program is released with the binary. * - derivative works of the program are allowed. */ #include "scale3x.h" #include /***************************************************************************/ /* Scale3x C implementation */ static inline void scale3x_8_def_border(scale3x_uint8* __restrict__ dst, const scale3x_uint8* __restrict__ src0, const scale3x_uint8* __restrict__ src1, const scale3x_uint8* __restrict__ src2, unsigned count) { assert(count >= 2); /* first pixel */ dst[0] = src1[0]; dst[1] = src1[0]; if (src1[1] == src0[0] && src2[0] != src0[0]) dst[2] = src0[0]; else dst[2] = src1[0]; ++src0; ++src1; ++src2; dst += 3; /* central pixels */ count -= 2; while (count) { if (src0[0] != src2[0] && src1[-1] != src1[1]) { dst[0] = src1[-1] == src0[0] ? src1[-1] : src1[0]; dst[1] = (src1[-1] == src0[0] && src1[0] != src0[1]) || (src1[1] == src0[0] && src1[0] != src0[-1]) ? src0[0] : src1[0]; dst[2] = src1[1] == src0[0] ? src1[1] : src1[0]; } else { dst[0] = src1[0]; dst[1] = src1[0]; dst[2] = src1[0]; } ++src0; ++src1; ++src2; dst += 3; --count; } /* last pixel */ if (src1[-1] == src0[0] && src2[0] != src0[0]) dst[0] = src0[0]; else dst[0] = src1[0]; dst[1] = src1[0]; dst[2] = src1[0]; } static inline void scale3x_8_def_center(scale3x_uint8* __restrict__ dst, const scale3x_uint8* __restrict__ src0, const scale3x_uint8* __restrict__ src1, const scale3x_uint8* __restrict__ src2, unsigned count) { assert(count >= 2); /* first pixel */ dst[0] = src1[0]; dst[1] = src1[0]; if (src0[0] != src2[0]) { dst[2] = (src1[1] == src0[0] && src1[0] != src2[1]) || (src1[1] == src2[0] && src1[0] != src0[1]) ? src1[1] : src1[0]; } else { dst[2] = src1[0]; } ++src0; ++src1; ++src2; dst += 3; /* central pixels */ count -= 2; while (count) { if (src0[0] != src2[0] && src1[-1] != src1[1]) { dst[0] = (src1[-1] == src0[0] && src1[0] != src2[-1]) || (src1[-1] == src2[0] && src1[0] != src0[-1]) ? src1[-1] : src1[0]; dst[1] = src1[0]; dst[2] = (src1[1] == src0[0] && src1[0] != src2[1]) || (src1[1] == src2[0] && src1[0] != src0[1]) ? src1[1] : src1[0]; } else { dst[0] = src1[0]; dst[1] = src1[0]; dst[2] = src1[0]; } ++src0; ++src1; ++src2; dst += 3; --count; } /* last pixel */ if (src0[0] != src2[0]) { dst[0] = (src1[-1] == src0[0] && src1[0] != src2[-1]) || (src1[-1] == src2[0] && src1[0] != src0[-1]) ? src1[-1] : src1[0]; } else { dst[0] = src1[0]; } dst[1] = src1[0]; dst[2] = src1[0]; } static inline void scale3x_16_def_border(scale3x_uint16* __restrict__ dst, const scale3x_uint16* __restrict__ src0, const scale3x_uint16* __restrict__ src1, const scale3x_uint16* __restrict__ src2, unsigned count) { assert(count >= 2); /* first pixel */ dst[0] = src1[0]; dst[1] = src1[0]; if (src1[1] == src0[0] && src2[0] != src0[0]) dst[2] = src0[0]; else dst[2] = src1[0]; ++src0; ++src1; ++src2; dst += 3; /* central pixels */ count -= 2; while (count) { if (src0[0] != src2[0] && src1[-1] != src1[1]) { dst[0] = src1[-1] == src0[0] ? src1[-1] : src1[0]; dst[1] = (src1[-1] == src0[0] && src1[0] != src0[1]) || (src1[1] == src0[0] && src1[0] != src0[-1]) ? src0[0] : src1[0]; dst[2] = src1[1] == src0[0] ? src1[1] : src1[0]; } else { dst[0] = src1[0]; dst[1] = src1[0]; dst[2] = src1[0]; } ++src0; ++src1; ++src2; dst += 3; --count; } /* last pixel */ if (src1[-1] == src0[0] && src2[0] != src0[0]) dst[0] = src0[0]; else dst[0] = src1[0]; dst[1] = src1[0]; dst[2] = src1[0]; } static inline void scale3x_16_def_center(scale3x_uint16* __restrict__ dst, const scale3x_uint16* __restrict__ src0, const scale3x_uint16* __restrict__ src1, const scale3x_uint16* __restrict__ src2, unsigned count) { assert(count >= 2); /* first pixel */ dst[0] = src1[0]; dst[1] = src1[0]; if (src0[0] != src2[0]) { dst[2] = (src1[1] == src0[0] && src1[0] != src2[1]) || (src1[1] == src2[0] && src1[0] != src0[1]) ? src1[1] : src1[0]; } else { dst[2] = src1[0]; } ++src0; ++src1; ++src2; dst += 3; /* central pixels */ count -= 2; while (count) { if (src0[0] != src2[0] && src1[-1] != src1[1]) { dst[0] = (src1[-1] == src0[0] && src1[0] != src2[-1]) || (src1[-1] == src2[0] && src1[0] != src0[-1]) ? src1[-1] : src1[0]; dst[1] = src1[0]; dst[2] = (src1[1] == src0[0] && src1[0] != src2[1]) || (src1[1] == src2[0] && src1[0] != src0[1]) ? src1[1] : src1[0]; } else { dst[0] = src1[0]; dst[1] = src1[0]; dst[2] = src1[0]; } ++src0; ++src1; ++src2; dst += 3; --count; } /* last pixel */ if (src0[0] != src2[0]) { dst[0] = (src1[-1] == src0[0] && src1[0] != src2[-1]) || (src1[-1] == src2[0] && src1[0] != src0[-1]) ? src1[-1] : src1[0]; } else { dst[0] = src1[0]; } dst[1] = src1[0]; dst[2] = src1[0]; } static inline void scale3x_32_def_border(scale3x_uint32* __restrict__ dst, const scale3x_uint32* __restrict__ src0, const scale3x_uint32* __restrict__ src1, const scale3x_uint32* __restrict__ src2, unsigned count) { assert(count >= 2); /* first pixel */ dst[0] = src1[0]; dst[1] = src1[0]; if (src1[1] == src0[0] && src2[0] != src0[0]) dst[2] = src0[0]; else dst[2] = src1[0]; ++src0; ++src1; ++src2; dst += 3; /* central pixels */ count -= 2; while (count) { if (src0[0] != src2[0] && src1[-1] != src1[1]) { dst[0] = src1[-1] == src0[0] ? src1[-1] : src1[0]; dst[1] = (src1[-1] == src0[0] && src1[0] != src0[1]) || (src1[1] == src0[0] && src1[0] != src0[-1]) ? src0[0] : src1[0]; dst[2] = src1[1] == src0[0] ? src1[1] : src1[0]; } else { dst[0] = src1[0]; dst[1] = src1[0]; dst[2] = src1[0]; } ++src0; ++src1; ++src2; dst += 3; --count; } /* last pixel */ if (src1[-1] == src0[0] && src2[0] != src0[0]) dst[0] = src0[0]; else dst[0] = src1[0]; dst[1] = src1[0]; dst[2] = src1[0]; } static inline void scale3x_32_def_center(scale3x_uint32* __restrict__ dst, const scale3x_uint32* __restrict__ src0, const scale3x_uint32* __restrict__ src1, const scale3x_uint32* __restrict__ src2, unsigned count) { assert(count >= 2); /* first pixel */ dst[0] = src1[0]; dst[1] = src1[0]; if (src0[0] != src2[0]) { dst[2] = (src1[1] == src0[0] && src1[0] != src2[1]) || (src1[1] == src2[0] && src1[0] != src0[1]) ? src1[1] : src1[0]; } else { dst[2] = src1[0]; } ++src0; ++src1; ++src2; dst += 3; /* central pixels */ count -= 2; while (count) { if (src0[0] != src2[0] && src1[-1] != src1[1]) { dst[0] = (src1[-1] == src0[0] && src1[0] != src2[-1]) || (src1[-1] == src2[0] && src1[0] != src0[-1]) ? src1[-1] : src1[0]; dst[1] = src1[0]; dst[2] = (src1[1] == src0[0] && src1[0] != src2[1]) || (src1[1] == src2[0] && src1[0] != src0[1]) ? src1[1] : src1[0]; } else { dst[0] = src1[0]; dst[1] = src1[0]; dst[2] = src1[0]; } ++src0; ++src1; ++src2; dst += 3; --count; } /* last pixel */ if (src0[0] != src2[0]) { dst[0] = (src1[-1] == src0[0] && src1[0] != src2[-1]) || (src1[-1] == src2[0] && src1[0] != src0[-1]) ? src1[-1] : src1[0]; } else { dst[0] = src1[0]; } dst[1] = src1[0]; dst[2] = src1[0]; } /** * Scale by a factor of 3 a row of pixels of 8 bits. * The function is implemented in C. * The pixels over the left and right borders are assumed of the same color of * the pixels on the border. * \param src0 Pointer at the first pixel of the previous row. * \param src1 Pointer at the first pixel of the current row. * \param src2 Pointer at the first pixel of the next row. * \param count Length in pixels of the src0, src1 and src2 rows. * It must be at least 2. * \param dst0 First destination row, triple length in pixels. * \param dst1 Second destination row, triple length in pixels. * \param dst2 Third destination row, triple length in pixels. */ void scale3x_8_def(scale3x_uint8* dst0, scale3x_uint8* dst1, scale3x_uint8* dst2, const scale3x_uint8* src0, const scale3x_uint8* src1, const scale3x_uint8* src2, unsigned count) { assert(count >= 2); scale3x_8_def_border(dst0, src0, src1, src2, count); scale3x_8_def_center(dst1, src0, src1, src2, count); scale3x_8_def_border(dst2, src2, src1, src0, count); } /** * Scale by a factor of 3 a row of pixels of 16 bits. * This function operates like scale3x_8_def() but for 16 bits pixels. * \param src0 Pointer at the first pixel of the previous row. * \param src1 Pointer at the first pixel of the current row. * \param src2 Pointer at the first pixel of the next row. * \param count Length in pixels of the src0, src1 and src2 rows. * It must be at least 2. * \param dst0 First destination row, triple length in pixels. * \param dst1 Second destination row, triple length in pixels. * \param dst2 Third destination row, triple length in pixels. */ void scale3x_16_def(scale3x_uint16* dst0, scale3x_uint16* dst1, scale3x_uint16* dst2, const scale3x_uint16* src0, const scale3x_uint16* src1, const scale3x_uint16* src2, unsigned count) { assert(count >= 2); scale3x_16_def_border(dst0, src0, src1, src2, count); scale3x_16_def_center(dst1, src0, src1, src2, count); scale3x_16_def_border(dst2, src2, src1, src0, count); } /** * Scale by a factor of 3 a row of pixels of 32 bits. * This function operates like scale3x_8_def() but for 32 bits pixels. * \param src0 Pointer at the first pixel of the previous row. * \param src1 Pointer at the first pixel of the current row. * \param src2 Pointer at the first pixel of the next row. * \param count Length in pixels of the src0, src1 and src2 rows. * It must be at least 2. * \param dst0 First destination row, triple length in pixels. * \param dst1 Second destination row, triple length in pixels. * \param dst2 Third destination row, triple length in pixels. */ void scale3x_32_def(scale3x_uint32* dst0, scale3x_uint32* dst1, scale3x_uint32* dst2, const scale3x_uint32* src0, const scale3x_uint32* src1, const scale3x_uint32* src2, unsigned count) { assert(count >= 2); scale3x_32_def_border(dst0, src0, src1, src2, count); scale3x_32_def_center(dst1, src0, src1, src2, count); scale3x_32_def_border(dst2, src2, src1, src0, count); } fceu-0.98.12/src/drivers/common/hq3x.c0000644000175000000620000021557310037024126017306 0ustar joestaff00000000000000//hq3x filter demo program //---------------------------------------------------------- //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 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 program is distributed in the hope that 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 program; if not, write to the Free Software //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA /* Modified for usage in FCE Ultra */ #include #include #include "hq3x.h" static int *LUT16to32 = NULL; static int *RGBtoYUV = NULL; static int YUV1, YUV2; static const int Ymask = 0x00FF0000; static const int Umask = 0x0000FF00; static const int Vmask = 0x000000FF; static const int trY = 0x00300000; static const int trU = 0x00000700; static const int trV = 0x00000006; inline void Interp1(unsigned char * pc, int c1, int c2) { *((int*)pc) = (c1*3+c2) >> 2; } inline void Interp2(unsigned char * pc, int c1, int c2, int c3) { *((int*)pc) = (c1*2+c2+c3) >> 2; } inline void Interp3(unsigned char * pc, int c1, int c2) { //*((int*)pc) = (c1*7+c2)/8; *((int*)pc) = ((((c1 & 0x00FF00)*7 + (c2 & 0x00FF00) ) & 0x0007F800) + (((c1 & 0xFF00FF)*7 + (c2 & 0xFF00FF) ) & 0x07F807F8)) >> 3; } inline void Interp4(unsigned char * pc, int c1, int c2, int c3) { //*((int*)pc) = (c1*2+(c2+c3)*7)/16; *((int*)pc) = ((((c1 & 0x00FF00)*2 + ((c2 & 0x00FF00) + (c3 & 0x00FF00))*7 ) & 0x000FF000) + (((c1 & 0xFF00FF)*2 + ((c2 & 0xFF00FF) + (c3 & 0xFF00FF))*7 ) & 0x0FF00FF0)) >> 4; } inline void Interp5(unsigned char * pc, int c1, int c2) { *((int*)pc) = (c1+c2) >> 1; } #define PIXEL00_1M Interp1(pOut, c[5], c[1]); #define PIXEL00_1U Interp1(pOut, c[5], c[2]); #define PIXEL00_1L Interp1(pOut, c[5], c[4]); #define PIXEL00_2 Interp2(pOut, c[5], c[4], c[2]); #define PIXEL00_4 Interp4(pOut, c[5], c[4], c[2]); #define PIXEL00_5 Interp5(pOut, c[4], c[2]); #define PIXEL00_C *((int*)(pOut)) = c[5]; #define PIXEL01_1 Interp1(pOut+4, c[5], c[2]); #define PIXEL01_3 Interp3(pOut+4, c[5], c[2]); #define PIXEL01_6 Interp1(pOut+4, c[2], c[5]); #define PIXEL01_C *((int*)(pOut+4)) = c[5]; #define PIXEL02_1M Interp1(pOut+8, c[5], c[3]); #define PIXEL02_1U Interp1(pOut+8, c[5], c[2]); #define PIXEL02_1R Interp1(pOut+8, c[5], c[6]); #define PIXEL02_2 Interp2(pOut+8, c[5], c[2], c[6]); #define PIXEL02_4 Interp4(pOut+8, c[5], c[2], c[6]); #define PIXEL02_5 Interp5(pOut+8, c[2], c[6]); #define PIXEL02_C *((int*)(pOut+8)) = c[5]; #define PIXEL10_1 Interp1(pOut+BpL, c[5], c[4]); #define PIXEL10_3 Interp3(pOut+BpL, c[5], c[4]); #define PIXEL10_6 Interp1(pOut+BpL, c[4], c[5]); #define PIXEL10_C *((int*)(pOut+BpL)) = c[5]; #define PIXEL11 *((int*)(pOut+BpL+4)) = c[5]; #define PIXEL12_1 Interp1(pOut+BpL+8, c[5], c[6]); #define PIXEL12_3 Interp3(pOut+BpL+8, c[5], c[6]); #define PIXEL12_6 Interp1(pOut+BpL+8, c[6], c[5]); #define PIXEL12_C *((int*)(pOut+BpL+8)) = c[5]; #define PIXEL20_1M Interp1(pOut+BpL+BpL, c[5], c[7]); #define PIXEL20_1D Interp1(pOut+BpL+BpL, c[5], c[8]); #define PIXEL20_1L Interp1(pOut+BpL+BpL, c[5], c[4]); #define PIXEL20_2 Interp2(pOut+BpL+BpL, c[5], c[8], c[4]); #define PIXEL20_4 Interp4(pOut+BpL+BpL, c[5], c[8], c[4]); #define PIXEL20_5 Interp5(pOut+BpL+BpL, c[8], c[4]); #define PIXEL20_C *((int*)(pOut+BpL+BpL)) = c[5]; #define PIXEL21_1 Interp1(pOut+BpL+BpL+4, c[5], c[8]); #define PIXEL21_3 Interp3(pOut+BpL+BpL+4, c[5], c[8]); #define PIXEL21_6 Interp1(pOut+BpL+BpL+4, c[8], c[5]); #define PIXEL21_C *((int*)(pOut+BpL+BpL+4)) = c[5]; #define PIXEL22_1M Interp1(pOut+BpL+BpL+8, c[5], c[9]); #define PIXEL22_1D Interp1(pOut+BpL+BpL+8, c[5], c[8]); #define PIXEL22_1R Interp1(pOut+BpL+BpL+8, c[5], c[6]); #define PIXEL22_2 Interp2(pOut+BpL+BpL+8, c[5], c[6], c[8]); #define PIXEL22_4 Interp4(pOut+BpL+BpL+8, c[5], c[6], c[8]); #define PIXEL22_5 Interp5(pOut+BpL+BpL+8, c[6], c[8]); #define PIXEL22_C *((int*)(pOut+BpL+BpL+8)) = c[5]; static inline int Diff(unsigned int w1, unsigned int w2) { YUV1 = RGBtoYUV[w1]; YUV2 = RGBtoYUV[w2]; return ( ( abs((YUV1 & Ymask) - (YUV2 & Ymask)) > trY ) || ( abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ) || ( abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ) ); } void hq3x_32( unsigned char * pIn, unsigned char * pOut, int Xres, int Yres, int BpL ) { int i, j, k; int prevline, nextline; int w[10]; int c[10]; // +----+----+----+ // | | | | // | w1 | w2 | w3 | // +----+----+----+ // | | | | // | w4 | w5 | w6 | // +----+----+----+ // | | | | // | w7 | w8 | w9 | // +----+----+----+ for (j=0; j0) prevline = -Xres*2; else prevline = 0; if (j0) { w[1] = *((unsigned short*)(pIn + prevline - 2)); w[4] = *((unsigned short*)(pIn - 2)); w[7] = *((unsigned short*)(pIn + nextline - 2)); } else { w[1] = w[2]; w[4] = w[5]; w[7] = w[8]; } if (i 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] = LUT16to32[w[k]]; 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_2 PIXEL01_1 PIXEL02_2 PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_2 PIXEL21_1 PIXEL22_2 break; } case 2: case 34: case 130: case 162: { PIXEL00_1M PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_2 PIXEL21_1 PIXEL22_2 break; } case 16: case 17: case 48: case 49: { PIXEL00_2 PIXEL01_1 PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_2 PIXEL21_1 PIXEL22_1M break; } case 64: case 65: case 68: case 69: { PIXEL00_2 PIXEL01_1 PIXEL02_2 PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1M break; } case 8: case 12: case 136: case 140: { PIXEL00_1M PIXEL01_1 PIXEL02_2 PIXEL10_C PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_1 PIXEL22_2 break; } case 3: case 35: case 131: case 163: { PIXEL00_1L PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_2 PIXEL21_1 PIXEL22_2 break; } case 6: case 38: case 134: case 166: { PIXEL00_1M PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_2 PIXEL21_1 PIXEL22_2 break; } case 20: case 21: case 52: case 53: { PIXEL00_2 PIXEL01_1 PIXEL02_1U PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_2 PIXEL21_1 PIXEL22_1M break; } case 144: case 145: case 176: case 177: { PIXEL00_2 PIXEL01_1 PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_2 PIXEL21_1 PIXEL22_1D break; } case 192: case 193: case 196: case 197: { PIXEL00_2 PIXEL01_1 PIXEL02_2 PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1R break; } case 96: case 97: case 100: case 101: { PIXEL00_2 PIXEL01_1 PIXEL02_2 PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1M break; } case 40: case 44: case 168: case 172: { PIXEL00_1M PIXEL01_1 PIXEL02_2 PIXEL10_C PIXEL11 PIXEL12_1 PIXEL20_1D PIXEL21_1 PIXEL22_2 break; } case 9: case 13: case 137: case 141: { PIXEL00_1U PIXEL01_1 PIXEL02_2 PIXEL10_C PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_1 PIXEL22_2 break; } case 18: case 50: { PIXEL00_1M if (Diff(w[2], w[6])) { PIXEL01_C PIXEL02_1M PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL10_1 PIXEL11 PIXEL20_2 PIXEL21_1 PIXEL22_1M break; } case 80: case 81: { PIXEL00_2 PIXEL01_1 PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL20_1M if (Diff(w[6], w[8])) { PIXEL12_C PIXEL21_C PIXEL22_1M } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; } case 72: case 76: { PIXEL00_1M PIXEL01_1 PIXEL02_2 PIXEL11 PIXEL12_1 if (Diff(w[8], w[4])) { PIXEL10_C PIXEL20_1M PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; } case 10: case 138: { if (Diff(w[4], w[2])) { PIXEL00_1M PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } PIXEL02_1M PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_1 PIXEL22_2 break; } case 66: { PIXEL00_1M PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1M break; } case 24: { PIXEL00_1M PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1M break; } case 7: case 39: case 135: { PIXEL00_1L PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_2 PIXEL21_1 PIXEL22_2 break; } case 148: case 149: case 180: { PIXEL00_2 PIXEL01_1 PIXEL02_1U PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_2 PIXEL21_1 PIXEL22_1D break; } case 224: case 228: case 225: { PIXEL00_2 PIXEL01_1 PIXEL02_2 PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1R break; } case 41: case 169: case 45: { PIXEL00_1U PIXEL01_1 PIXEL02_2 PIXEL10_C PIXEL11 PIXEL12_1 PIXEL20_1D PIXEL21_1 PIXEL22_2 break; } case 22: case 54: { PIXEL00_1M if (Diff(w[2], w[6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL10_1 PIXEL11 PIXEL20_2 PIXEL21_1 PIXEL22_1M break; } case 208: case 209: { PIXEL00_2 PIXEL01_1 PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL20_1M if (Diff(w[6], w[8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; } case 104: case 108: { PIXEL00_1M PIXEL01_1 PIXEL02_2 PIXEL11 PIXEL12_1 if (Diff(w[8], w[4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; } case 11: case 139: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } PIXEL02_1M PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_1 PIXEL22_2 break; } case 19: case 51: { if (Diff(w[2], w[6])) { PIXEL00_1L PIXEL01_C PIXEL02_1M PIXEL12_C } else { PIXEL00_2 PIXEL01_6 PIXEL02_5 PIXEL12_1 } PIXEL10_1 PIXEL11 PIXEL20_2 PIXEL21_1 PIXEL22_1M break; } case 146: case 178: { if (Diff(w[2], w[6])) { PIXEL01_C PIXEL02_1M PIXEL12_C PIXEL22_1D } else { PIXEL01_1 PIXEL02_5 PIXEL12_6 PIXEL22_2 } PIXEL00_1M PIXEL10_1 PIXEL11 PIXEL20_2 PIXEL21_1 break; } case 84: case 85: { if (Diff(w[6], w[8])) { PIXEL02_1U PIXEL12_C PIXEL21_C PIXEL22_1M } else { PIXEL02_2 PIXEL12_6 PIXEL21_1 PIXEL22_5 } PIXEL00_2 PIXEL01_1 PIXEL10_1 PIXEL11 PIXEL20_1M break; } case 112: case 113: { if (Diff(w[6], w[8])) { PIXEL12_C PIXEL20_1L PIXEL21_C PIXEL22_1M } else { PIXEL12_1 PIXEL20_2 PIXEL21_6 PIXEL22_5 } PIXEL00_2 PIXEL01_1 PIXEL02_1M PIXEL10_1 PIXEL11 break; } case 200: case 204: { if (Diff(w[8], w[4])) { PIXEL10_C PIXEL20_1M PIXEL21_C PIXEL22_1R } else { PIXEL10_1 PIXEL20_5 PIXEL21_6 PIXEL22_2 } PIXEL00_1M PIXEL01_1 PIXEL02_2 PIXEL11 PIXEL12_1 break; } case 73: case 77: { if (Diff(w[8], w[4])) { PIXEL00_1U PIXEL10_C PIXEL20_1M PIXEL21_C } else { PIXEL00_2 PIXEL10_6 PIXEL20_5 PIXEL21_1 } PIXEL01_1 PIXEL02_2 PIXEL11 PIXEL12_1 PIXEL22_1M break; } case 42: case 170: { if (Diff(w[4], w[2])) { PIXEL00_1M PIXEL01_C PIXEL10_C PIXEL20_1D } else { PIXEL00_5 PIXEL01_1 PIXEL10_6 PIXEL20_2 } PIXEL02_1M PIXEL11 PIXEL12_1 PIXEL21_1 PIXEL22_2 break; } case 14: case 142: { if (Diff(w[4], w[2])) { PIXEL00_1M PIXEL01_C PIXEL02_1R PIXEL10_C } else { PIXEL00_5 PIXEL01_6 PIXEL02_2 PIXEL10_1 } PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_1 PIXEL22_2 break; } case 67: { PIXEL00_1L PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1M break; } case 70: { PIXEL00_1M PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1M break; } case 28: { PIXEL00_1M PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1M break; } case 152: { PIXEL00_1M PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1D break; } case 194: { PIXEL00_1M PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1R break; } case 98: { PIXEL00_1M PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1M break; } case 56: { PIXEL00_1M PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1M break; } case 25: { PIXEL00_1U PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1M break; } case 26: case 31: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL10_C } else { PIXEL00_4 PIXEL10_3 } PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_C PIXEL12_C } else { PIXEL02_4 PIXEL12_3 } PIXEL11 PIXEL20_1M PIXEL21_1 PIXEL22_1M break; } case 82: case 214: { PIXEL00_1M if (Diff(w[2], w[6])) { PIXEL01_C PIXEL02_C } else { PIXEL01_3 PIXEL02_4 } PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_1M if (Diff(w[6], w[8])) { PIXEL21_C PIXEL22_C } else { PIXEL21_3 PIXEL22_4 } break; } case 88: case 248: { PIXEL00_1M PIXEL01_1 PIXEL02_1M PIXEL11 if (Diff(w[8], w[4])) { PIXEL10_C PIXEL20_C } else { PIXEL10_3 PIXEL20_4 } PIXEL21_C if (Diff(w[6], w[8])) { PIXEL12_C PIXEL22_C } else { PIXEL12_3 PIXEL22_4 } break; } case 74: case 107: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL01_C } else { PIXEL00_4 PIXEL01_3 } PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_1 if (Diff(w[8], w[4])) { PIXEL20_C PIXEL21_C } else { PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; } case 27: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } PIXEL02_1M PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1M break; } case 86: { PIXEL00_1M if (Diff(w[2], w[6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL10_1 PIXEL11 PIXEL20_1M PIXEL21_C PIXEL22_1M break; } case 216: { PIXEL00_1M PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL20_1M if (Diff(w[6], w[8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; } case 106: { PIXEL00_1M PIXEL01_C PIXEL02_1M PIXEL11 PIXEL12_1 if (Diff(w[8], w[4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; } case 30: { PIXEL00_1M if (Diff(w[2], w[6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL10_C PIXEL11 PIXEL20_1M PIXEL21_1 PIXEL22_1M break; } case 210: { PIXEL00_1M PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL20_1M if (Diff(w[6], w[8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; } case 120: { PIXEL00_1M PIXEL01_1 PIXEL02_1M PIXEL11 PIXEL12_C if (Diff(w[8], w[4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; } case 75: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } PIXEL02_1M PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1M break; } case 29: { PIXEL00_1U PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1M break; } case 198: { PIXEL00_1M PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1R break; } case 184: { PIXEL00_1M PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1D break; } case 99: { PIXEL00_1L PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1M break; } case 57: { PIXEL00_1U PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1M break; } case 71: { PIXEL00_1L PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1M break; } case 156: { PIXEL00_1M PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1D break; } case 226: { PIXEL00_1M PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1R break; } case 60: { PIXEL00_1M PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1M break; } case 195: { PIXEL00_1L PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1R break; } case 102: { PIXEL00_1M PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1M break; } case 153: { PIXEL00_1U PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1D break; } case 58: { if (Diff(w[4], w[2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1M break; } case 83: { PIXEL00_1L PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_C if (Diff(w[6], w[8])) { PIXEL22_1M } else { PIXEL22_2 } break; } case 92: { PIXEL00_1M PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C if (Diff(w[8], w[4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C if (Diff(w[6], w[8])) { PIXEL22_1M } else { PIXEL22_2 } break; } case 202: { if (Diff(w[4], w[2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_1 if (Diff(w[8], w[4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C PIXEL22_1R break; } case 78: { if (Diff(w[4], w[2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C PIXEL02_1R PIXEL10_C PIXEL11 PIXEL12_1 if (Diff(w[8], w[4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C PIXEL22_1M break; } case 154: { if (Diff(w[4], w[2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1D break; } case 114: { PIXEL00_1M PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_1L PIXEL21_C if (Diff(w[6], w[8])) { PIXEL22_1M } else { PIXEL22_2 } break; } case 89: { PIXEL00_1U PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C if (Diff(w[8], w[4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C if (Diff(w[6], w[8])) { PIXEL22_1M } else { PIXEL22_2 } break; } case 90: { if (Diff(w[4], w[2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_C PIXEL11 PIXEL12_C if (Diff(w[8], w[4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C if (Diff(w[6], w[8])) { PIXEL22_1M } else { PIXEL22_2 } break; } case 55: case 23: { if (Diff(w[2], w[6])) { PIXEL00_1L PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL00_2 PIXEL01_6 PIXEL02_5 PIXEL12_1 } PIXEL10_1 PIXEL11 PIXEL20_2 PIXEL21_1 PIXEL22_1M break; } case 182: case 150: { if (Diff(w[2], w[6])) { PIXEL01_C PIXEL02_C PIXEL12_C PIXEL22_1D } else { PIXEL01_1 PIXEL02_5 PIXEL12_6 PIXEL22_2 } PIXEL00_1M PIXEL10_1 PIXEL11 PIXEL20_2 PIXEL21_1 break; } case 213: case 212: { if (Diff(w[6], w[8])) { PIXEL02_1U PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL02_2 PIXEL12_6 PIXEL21_1 PIXEL22_5 } PIXEL00_2 PIXEL01_1 PIXEL10_1 PIXEL11 PIXEL20_1M break; } case 241: case 240: { if (Diff(w[6], w[8])) { PIXEL12_C PIXEL20_1L PIXEL21_C PIXEL22_C } else { PIXEL12_1 PIXEL20_2 PIXEL21_6 PIXEL22_5 } PIXEL00_2 PIXEL01_1 PIXEL02_1M PIXEL10_1 PIXEL11 break; } case 236: case 232: { if (Diff(w[8], w[4])) { PIXEL10_C PIXEL20_C PIXEL21_C PIXEL22_1R } else { PIXEL10_1 PIXEL20_5 PIXEL21_6 PIXEL22_2 } PIXEL00_1M PIXEL01_1 PIXEL02_2 PIXEL11 PIXEL12_1 break; } case 109: case 105: { if (Diff(w[8], w[4])) { PIXEL00_1U PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL00_2 PIXEL10_6 PIXEL20_5 PIXEL21_1 } PIXEL01_1 PIXEL02_2 PIXEL11 PIXEL12_1 PIXEL22_1M break; } case 171: case 43: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL01_C PIXEL10_C PIXEL20_1D } else { PIXEL00_5 PIXEL01_1 PIXEL10_6 PIXEL20_2 } PIXEL02_1M PIXEL11 PIXEL12_1 PIXEL21_1 PIXEL22_2 break; } case 143: case 15: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL01_C PIXEL02_1R PIXEL10_C } else { PIXEL00_5 PIXEL01_6 PIXEL02_2 PIXEL10_1 } PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_1 PIXEL22_2 break; } case 124: { PIXEL00_1M PIXEL01_1 PIXEL02_1U PIXEL11 PIXEL12_C if (Diff(w[8], w[4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; } case 203: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } PIXEL02_1M PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1R break; } case 62: { PIXEL00_1M if (Diff(w[2], w[6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL10_C PIXEL11 PIXEL20_1D PIXEL21_1 PIXEL22_1M break; } case 211: { PIXEL00_1L PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL20_1M if (Diff(w[6], w[8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; } case 118: { PIXEL00_1M if (Diff(w[2], w[6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL10_1 PIXEL11 PIXEL20_1L PIXEL21_C PIXEL22_1M break; } case 217: { PIXEL00_1U PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL20_1M if (Diff(w[6], w[8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; } case 110: { PIXEL00_1M PIXEL01_C PIXEL02_1R PIXEL11 PIXEL12_1 if (Diff(w[8], w[4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; } case 155: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } PIXEL02_1M PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1D break; } case 188: { PIXEL00_1M PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1D break; } case 185: { PIXEL00_1U PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1D break; } case 61: { PIXEL00_1U PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1M break; } case 157: { PIXEL00_1U PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1D break; } case 103: { PIXEL00_1L PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1M break; } case 227: { PIXEL00_1L PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1R break; } case 230: { PIXEL00_1M PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1R break; } case 199: { PIXEL00_1L PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1R break; } case 220: { PIXEL00_1M PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 if (Diff(w[8], w[4])) { PIXEL20_1M } else { PIXEL20_2 } if (Diff(w[6], w[8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; } case 158: { if (Diff(w[4], w[2])) { PIXEL00_1M } else { PIXEL00_2 } if (Diff(w[2], w[6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL10_C PIXEL11 PIXEL20_1M PIXEL21_1 PIXEL22_1D break; } case 234: { if (Diff(w[4], w[2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C PIXEL02_1M PIXEL11 PIXEL12_1 if (Diff(w[8], w[4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } PIXEL22_1R break; } case 242: { PIXEL00_1M PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_1 PIXEL11 PIXEL20_1L if (Diff(w[6], w[8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; } case 59: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } if (Diff(w[2], w[6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1M break; } case 121: { PIXEL00_1U PIXEL01_1 PIXEL02_1M PIXEL11 PIXEL12_C if (Diff(w[8], w[4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } if (Diff(w[6], w[8])) { PIXEL22_1M } else { PIXEL22_2 } break; } case 87: { PIXEL00_1L if (Diff(w[2], w[6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL10_1 PIXEL11 PIXEL20_1M PIXEL21_C if (Diff(w[6], w[8])) { PIXEL22_1M } else { PIXEL22_2 } break; } case 79: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } PIXEL02_1R PIXEL11 PIXEL12_1 if (Diff(w[8], w[4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C PIXEL22_1M break; } case 122: { if (Diff(w[4], w[2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL11 PIXEL12_C if (Diff(w[8], w[4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } if (Diff(w[6], w[8])) { PIXEL22_1M } else { PIXEL22_2 } break; } case 94: { if (Diff(w[4], w[2])) { PIXEL00_1M } else { PIXEL00_2 } if (Diff(w[2], w[6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL10_C PIXEL11 if (Diff(w[8], w[4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C if (Diff(w[6], w[8])) { PIXEL22_1M } else { PIXEL22_2 } break; } case 218: { if (Diff(w[4], w[2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_C PIXEL11 if (Diff(w[8], w[4])) { PIXEL20_1M } else { PIXEL20_2 } if (Diff(w[6], w[8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; } case 91: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } if (Diff(w[2], w[6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL11 PIXEL12_C if (Diff(w[8], w[4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C if (Diff(w[6], w[8])) { PIXEL22_1M } else { PIXEL22_2 } break; } case 229: { PIXEL00_2 PIXEL01_1 PIXEL02_2 PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1R break; } case 167: { PIXEL00_1L PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_2 PIXEL21_1 PIXEL22_2 break; } case 173: { PIXEL00_1U PIXEL01_1 PIXEL02_2 PIXEL10_C PIXEL11 PIXEL12_1 PIXEL20_1D PIXEL21_1 PIXEL22_2 break; } case 181: { PIXEL00_2 PIXEL01_1 PIXEL02_1U PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_2 PIXEL21_1 PIXEL22_1D break; } case 186: { if (Diff(w[4], w[2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1D break; } case 115: { PIXEL00_1L PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_1L PIXEL21_C if (Diff(w[6], w[8])) { PIXEL22_1M } else { PIXEL22_2 } break; } case 93: { PIXEL00_1U PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C if (Diff(w[8], w[4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C if (Diff(w[6], w[8])) { PIXEL22_1M } else { PIXEL22_2 } break; } case 206: { if (Diff(w[4], w[2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C PIXEL02_1R PIXEL10_C PIXEL11 PIXEL12_1 if (Diff(w[8], w[4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C PIXEL22_1R break; } case 205: case 201: { PIXEL00_1U PIXEL01_1 PIXEL02_2 PIXEL10_C PIXEL11 PIXEL12_1 if (Diff(w[8], w[4])) { PIXEL20_1M } else { PIXEL20_2 } PIXEL21_C PIXEL22_1R break; } case 174: case 46: { if (Diff(w[4], w[2])) { PIXEL00_1M } else { PIXEL00_2 } PIXEL01_C PIXEL02_1R PIXEL10_C PIXEL11 PIXEL12_1 PIXEL20_1D PIXEL21_1 PIXEL22_2 break; } case 179: case 147: { PIXEL00_1L PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_1M } else { PIXEL02_2 } PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_2 PIXEL21_1 PIXEL22_1D break; } case 117: case 116: { PIXEL00_2 PIXEL01_1 PIXEL02_1U PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_1L PIXEL21_C if (Diff(w[6], w[8])) { PIXEL22_1M } else { PIXEL22_2 } break; } case 189: { PIXEL00_1U PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1D break; } case 231: { PIXEL00_1L PIXEL01_C PIXEL02_1R PIXEL10_1 PIXEL11 PIXEL12_1 PIXEL20_1L PIXEL21_C PIXEL22_1R break; } case 126: { PIXEL00_1M if (Diff(w[2], w[6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_4 PIXEL12_3 } PIXEL11 if (Diff(w[8], w[4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; } case 219: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_4 PIXEL01_3 PIXEL10_3 } PIXEL02_1M PIXEL11 PIXEL20_1M if (Diff(w[6], w[8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_4 } break; } case 125: { if (Diff(w[8], w[4])) { PIXEL00_1U PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL00_2 PIXEL10_6 PIXEL20_5 PIXEL21_1 } PIXEL01_1 PIXEL02_1U PIXEL11 PIXEL12_C PIXEL22_1M break; } case 221: { if (Diff(w[6], w[8])) { PIXEL02_1U PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL02_2 PIXEL12_6 PIXEL21_1 PIXEL22_5 } PIXEL00_1U PIXEL01_1 PIXEL10_C PIXEL11 PIXEL20_1M break; } case 207: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL01_C PIXEL02_1R PIXEL10_C } else { PIXEL00_5 PIXEL01_6 PIXEL02_2 PIXEL10_1 } PIXEL11 PIXEL12_1 PIXEL20_1M PIXEL21_C PIXEL22_1R break; } case 238: { if (Diff(w[8], w[4])) { PIXEL10_C PIXEL20_C PIXEL21_C PIXEL22_1R } else { PIXEL10_1 PIXEL20_5 PIXEL21_6 PIXEL22_2 } PIXEL00_1M PIXEL01_C PIXEL02_1R PIXEL11 PIXEL12_1 break; } case 190: { if (Diff(w[2], w[6])) { PIXEL01_C PIXEL02_C PIXEL12_C PIXEL22_1D } else { PIXEL01_1 PIXEL02_5 PIXEL12_6 PIXEL22_2 } PIXEL00_1M PIXEL10_C PIXEL11 PIXEL20_1D PIXEL21_1 break; } case 187: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL01_C PIXEL10_C PIXEL20_1D } else { PIXEL00_5 PIXEL01_1 PIXEL10_6 PIXEL20_2 } PIXEL02_1M PIXEL11 PIXEL12_C PIXEL21_1 PIXEL22_1D break; } case 243: { if (Diff(w[6], w[8])) { PIXEL12_C PIXEL20_1L PIXEL21_C PIXEL22_C } else { PIXEL12_1 PIXEL20_2 PIXEL21_6 PIXEL22_5 } PIXEL00_1L PIXEL01_C PIXEL02_1M PIXEL10_1 PIXEL11 break; } case 119: { if (Diff(w[2], w[6])) { PIXEL00_1L PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL00_2 PIXEL01_6 PIXEL02_5 PIXEL12_1 } PIXEL10_1 PIXEL11 PIXEL20_1L PIXEL21_C PIXEL22_1M break; } case 237: case 233: { PIXEL00_1U PIXEL01_1 PIXEL02_2 PIXEL10_C PIXEL11 PIXEL12_1 if (Diff(w[8], w[4])) { PIXEL20_C } else { PIXEL20_2 } PIXEL21_C PIXEL22_1R break; } case 175: case 47: { if (Diff(w[4], w[2])) { PIXEL00_C } else { PIXEL00_2 } PIXEL01_C PIXEL02_1R PIXEL10_C PIXEL11 PIXEL12_1 PIXEL20_1D PIXEL21_1 PIXEL22_2 break; } case 183: case 151: { PIXEL00_1L PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_C } else { PIXEL02_2 } PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_2 PIXEL21_1 PIXEL22_1D break; } case 245: case 244: { PIXEL00_2 PIXEL01_1 PIXEL02_1U PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_1L PIXEL21_C if (Diff(w[6], w[8])) { PIXEL22_C } else { PIXEL22_2 } break; } case 250: { PIXEL00_1M PIXEL01_C PIXEL02_1M PIXEL11 if (Diff(w[8], w[4])) { PIXEL10_C PIXEL20_C } else { PIXEL10_3 PIXEL20_4 } PIXEL21_C if (Diff(w[6], w[8])) { PIXEL12_C PIXEL22_C } else { PIXEL12_3 PIXEL22_4 } break; } case 123: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL01_C } else { PIXEL00_4 PIXEL01_3 } PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_C if (Diff(w[8], w[4])) { PIXEL20_C PIXEL21_C } else { PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; } case 95: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL10_C } else { PIXEL00_4 PIXEL10_3 } PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_C PIXEL12_C } else { PIXEL02_4 PIXEL12_3 } PIXEL11 PIXEL20_1M PIXEL21_C PIXEL22_1M break; } case 222: { PIXEL00_1M if (Diff(w[2], w[6])) { PIXEL01_C PIXEL02_C } else { PIXEL01_3 PIXEL02_4 } PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1M if (Diff(w[6], w[8])) { PIXEL21_C PIXEL22_C } else { PIXEL21_3 PIXEL22_4 } break; } case 252: { PIXEL00_1M PIXEL01_1 PIXEL02_1U PIXEL11 PIXEL12_C if (Diff(w[8], w[4])) { PIXEL10_C PIXEL20_C } else { PIXEL10_3 PIXEL20_4 } PIXEL21_C if (Diff(w[6], w[8])) { PIXEL22_C } else { PIXEL22_2 } break; } case 249: { PIXEL00_1U PIXEL01_1 PIXEL02_1M PIXEL10_C PIXEL11 if (Diff(w[8], w[4])) { PIXEL20_C } else { PIXEL20_2 } PIXEL21_C if (Diff(w[6], w[8])) { PIXEL12_C PIXEL22_C } else { PIXEL12_3 PIXEL22_4 } break; } case 235: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL01_C } else { PIXEL00_4 PIXEL01_3 } PIXEL02_1M PIXEL10_C PIXEL11 PIXEL12_1 if (Diff(w[8], w[4])) { PIXEL20_C } else { PIXEL20_2 } PIXEL21_C PIXEL22_1R break; } case 111: { if (Diff(w[4], w[2])) { PIXEL00_C } else { PIXEL00_2 } PIXEL01_C PIXEL02_1R PIXEL10_C PIXEL11 PIXEL12_1 if (Diff(w[8], w[4])) { PIXEL20_C PIXEL21_C } else { PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; } case 63: { if (Diff(w[4], w[2])) { PIXEL00_C } else { PIXEL00_2 } PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_C PIXEL12_C } else { PIXEL02_4 PIXEL12_3 } PIXEL10_C PIXEL11 PIXEL20_1D PIXEL21_1 PIXEL22_1M break; } case 159: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL10_C } else { PIXEL00_4 PIXEL10_3 } PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_C } else { PIXEL02_2 } PIXEL11 PIXEL12_C PIXEL20_1M PIXEL21_1 PIXEL22_1D break; } case 215: { PIXEL00_1L PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_C } else { PIXEL02_2 } PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_1M if (Diff(w[6], w[8])) { PIXEL21_C PIXEL22_C } else { PIXEL21_3 PIXEL22_4 } break; } case 246: { PIXEL00_1M if (Diff(w[2], w[6])) { PIXEL01_C PIXEL02_C } else { PIXEL01_3 PIXEL02_4 } PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_1L PIXEL21_C if (Diff(w[6], w[8])) { PIXEL22_C } else { PIXEL22_2 } break; } case 254: { PIXEL00_1M if (Diff(w[2], w[6])) { PIXEL01_C PIXEL02_C } else { PIXEL01_3 PIXEL02_4 } PIXEL11 if (Diff(w[8], w[4])) { PIXEL10_C PIXEL20_C } else { PIXEL10_3 PIXEL20_4 } if (Diff(w[6], w[8])) { PIXEL12_C PIXEL21_C PIXEL22_C } else { PIXEL12_3 PIXEL21_3 PIXEL22_2 } break; } case 253: { PIXEL00_1U PIXEL01_1 PIXEL02_1U PIXEL10_C PIXEL11 PIXEL12_C if (Diff(w[8], w[4])) { PIXEL20_C } else { PIXEL20_2 } PIXEL21_C if (Diff(w[6], w[8])) { PIXEL22_C } else { PIXEL22_2 } break; } case 251: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL01_C } else { PIXEL00_4 PIXEL01_3 } PIXEL02_1M PIXEL11 if (Diff(w[8], w[4])) { PIXEL10_C PIXEL20_C PIXEL21_C } else { PIXEL10_3 PIXEL20_2 PIXEL21_3 } if (Diff(w[6], w[8])) { PIXEL12_C PIXEL22_C } else { PIXEL12_3 PIXEL22_4 } break; } case 239: { if (Diff(w[4], w[2])) { PIXEL00_C } else { PIXEL00_2 } PIXEL01_C PIXEL02_1R PIXEL10_C PIXEL11 PIXEL12_1 if (Diff(w[8], w[4])) { PIXEL20_C } else { PIXEL20_2 } PIXEL21_C PIXEL22_1R break; } case 127: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL01_C PIXEL10_C } else { PIXEL00_2 PIXEL01_3 PIXEL10_3 } if (Diff(w[2], w[6])) { PIXEL02_C PIXEL12_C } else { PIXEL02_4 PIXEL12_3 } PIXEL11 if (Diff(w[8], w[4])) { PIXEL20_C PIXEL21_C } else { PIXEL20_4 PIXEL21_3 } PIXEL22_1M break; } case 191: { if (Diff(w[4], w[2])) { PIXEL00_C } else { PIXEL00_2 } PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_C } else { PIXEL02_2 } PIXEL10_C PIXEL11 PIXEL12_C PIXEL20_1D PIXEL21_1 PIXEL22_1D break; } case 223: { if (Diff(w[4], w[2])) { PIXEL00_C PIXEL10_C } else { PIXEL00_4 PIXEL10_3 } if (Diff(w[2], w[6])) { PIXEL01_C PIXEL02_C PIXEL12_C } else { PIXEL01_3 PIXEL02_2 PIXEL12_3 } PIXEL11 PIXEL20_1M if (Diff(w[6], w[8])) { PIXEL21_C PIXEL22_C } else { PIXEL21_3 PIXEL22_4 } break; } case 247: { PIXEL00_1L PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_C } else { PIXEL02_2 } PIXEL10_1 PIXEL11 PIXEL12_C PIXEL20_1L PIXEL21_C if (Diff(w[6], w[8])) { PIXEL22_C } else { PIXEL22_2 } break; } case 255: { if (Diff(w[4], w[2])) { PIXEL00_C } else { PIXEL00_2 } PIXEL01_C if (Diff(w[2], w[6])) { PIXEL02_C } else { PIXEL02_2 } PIXEL10_C PIXEL11 PIXEL12_C if (Diff(w[8], w[4])) { PIXEL20_C } else { PIXEL20_2 } PIXEL21_C if (Diff(w[6], w[8])) { PIXEL22_C } else { PIXEL22_2 } break; } } pIn+=2; pOut+=12; } pOut+=BpL - Xres * 3 * 4; pOut+=BpL; pOut+=BpL; } } int hq3x_InitLUTs(void) { int i, j, k, r, g, b, Y, u, v; if(!(LUT16to32 = malloc(65536*sizeof(int)))) return(0); if(!(RGBtoYUV = malloc(65536*sizeof(int)))) { free(LUT16to32); return(0); } for (i=0; i<65536; i++) LUT16to32[i] = ((i & 0xF800) << 8) + ((i & 0x07E0) << 5) + ((i & 0x001F) << 3); for (i=0; i<32; i++) for (j=0; j<64; j++) for (k=0; k<32; k++) { r = i << 3; g = j << 2; b = k << 3; Y = (r + g + b) >> 2; u = 128 + ((r - b) >> 2); v = 128 + ((-r + 2*g -b)>>3); RGBtoYUV[ (i << 11) + (j << 5) + k ] = (Y<<16) + (u<<8) + v; } return(1); } void hq3x_Kill(void) { free(LUT16to32); free(RGBtoYUV); } fceu-0.98.12/src/drivers/common/hq3x.h0000644000175000000620000000020710031750475017304 0ustar joestaff00000000000000void hq3x_32( unsigned char * pIn, unsigned char * pOut, int Xres, int Yres, int BpL); int hq3x_InitLUTs(void); void hq3x_Kill(void); fceu-0.98.12/src/drivers/sexyal/0002755000175000000620000000000010111545623016264 5ustar joestaff00000000000000fceu-0.98.12/src/drivers/sexyal/md5.c0000644000175000000620000001505610030466343017123 0ustar joestaff00000000000000/* * RFC 1321 compliant MD5 implementation, * by Christophe Devine ; * this program is licensed under the GPL. */ /* Modified October 3, 2003, to remove testing code, and add include of "types.h". -Xodnizel */ #include #include "inttypes.h" #include "md5.h" #define GET_UINT32(n,b,i) \ { \ (n) = ( (uint32_t) (b)[(i) + 3] << 24 ) \ | ( (uint32_t) (b)[(i) + 2] << 16 ) \ | ( (uint32_t) (b)[(i) + 1] << 8 ) \ | ( (uint32_t) (b)[(i) ] ); \ } #define PUT_UINT32(n,b,i) \ { \ (b)[(i) ] = (uint8_t) ( (n) ); \ (b)[(i) + 1] = (uint8_t) ( (n) >> 8 ); \ (b)[(i) + 2] = (uint8_t) ( (n) >> 16 ); \ (b)[(i) + 3] = (uint8_t) ( (n) >> 24 ); \ } void sal_md5_starts( struct sal_md5_context *ctx ) { ctx->total[0] = 0; ctx->total[1] = 0; ctx->state[0] = 0x67452301; ctx->state[1] = 0xEFCDAB89; ctx->state[2] = 0x98BADCFE; ctx->state[3] = 0x10325476; } void sal_md5_process( struct sal_md5_context *ctx, uint8_t data[64] ) { uint32_t A, B, C, D, X[16]; GET_UINT32( X[0], data, 0 ); GET_UINT32( X[1], data, 4 ); GET_UINT32( X[2], data, 8 ); GET_UINT32( X[3], data, 12 ); GET_UINT32( X[4], data, 16 ); GET_UINT32( X[5], data, 20 ); GET_UINT32( X[6], data, 24 ); GET_UINT32( X[7], data, 28 ); GET_UINT32( X[8], data, 32 ); GET_UINT32( X[9], data, 36 ); GET_UINT32( X[10], data, 40 ); GET_UINT32( X[11], data, 44 ); GET_UINT32( X[12], data, 48 ); GET_UINT32( X[13], data, 52 ); GET_UINT32( X[14], data, 56 ); GET_UINT32( X[15], data, 60 ); #define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) #define P(a,b,c,d,k,s,t) \ { \ a += F(b,c,d) + X[k] + t; a = S(a,s) + b; \ } A = ctx->state[0]; B = ctx->state[1]; C = ctx->state[2]; D = ctx->state[3]; #define F(x,y,z) (z ^ (x & (y ^ z))) P( A, B, C, D, 0, 7, 0xD76AA478 ); P( D, A, B, C, 1, 12, 0xE8C7B756 ); P( C, D, A, B, 2, 17, 0x242070DB ); P( B, C, D, A, 3, 22, 0xC1BDCEEE ); P( A, B, C, D, 4, 7, 0xF57C0FAF ); P( D, A, B, C, 5, 12, 0x4787C62A ); P( C, D, A, B, 6, 17, 0xA8304613 ); P( B, C, D, A, 7, 22, 0xFD469501 ); P( A, B, C, D, 8, 7, 0x698098D8 ); P( D, A, B, C, 9, 12, 0x8B44F7AF ); P( C, D, A, B, 10, 17, 0xFFFF5BB1 ); P( B, C, D, A, 11, 22, 0x895CD7BE ); P( A, B, C, D, 12, 7, 0x6B901122 ); P( D, A, B, C, 13, 12, 0xFD987193 ); P( C, D, A, B, 14, 17, 0xA679438E ); P( B, C, D, A, 15, 22, 0x49B40821 ); #undef F #define F(x,y,z) (y ^ (z & (x ^ y))) P( A, B, C, D, 1, 5, 0xF61E2562 ); P( D, A, B, C, 6, 9, 0xC040B340 ); P( C, D, A, B, 11, 14, 0x265E5A51 ); P( B, C, D, A, 0, 20, 0xE9B6C7AA ); P( A, B, C, D, 5, 5, 0xD62F105D ); P( D, A, B, C, 10, 9, 0x02441453 ); P( C, D, A, B, 15, 14, 0xD8A1E681 ); P( B, C, D, A, 4, 20, 0xE7D3FBC8 ); P( A, B, C, D, 9, 5, 0x21E1CDE6 ); P( D, A, B, C, 14, 9, 0xC33707D6 ); P( C, D, A, B, 3, 14, 0xF4D50D87 ); P( B, C, D, A, 8, 20, 0x455A14ED ); P( A, B, C, D, 13, 5, 0xA9E3E905 ); P( D, A, B, C, 2, 9, 0xFCEFA3F8 ); P( C, D, A, B, 7, 14, 0x676F02D9 ); P( B, C, D, A, 12, 20, 0x8D2A4C8A ); #undef F #define F(x,y,z) (x ^ y ^ z) P( A, B, C, D, 5, 4, 0xFFFA3942 ); P( D, A, B, C, 8, 11, 0x8771F681 ); P( C, D, A, B, 11, 16, 0x6D9D6122 ); P( B, C, D, A, 14, 23, 0xFDE5380C ); P( A, B, C, D, 1, 4, 0xA4BEEA44 ); P( D, A, B, C, 4, 11, 0x4BDECFA9 ); P( C, D, A, B, 7, 16, 0xF6BB4B60 ); P( B, C, D, A, 10, 23, 0xBEBFBC70 ); P( A, B, C, D, 13, 4, 0x289B7EC6 ); P( D, A, B, C, 0, 11, 0xEAA127FA ); P( C, D, A, B, 3, 16, 0xD4EF3085 ); P( B, C, D, A, 6, 23, 0x04881D05 ); P( A, B, C, D, 9, 4, 0xD9D4D039 ); P( D, A, B, C, 12, 11, 0xE6DB99E5 ); P( C, D, A, B, 15, 16, 0x1FA27CF8 ); P( B, C, D, A, 2, 23, 0xC4AC5665 ); #undef F #define F(x,y,z) (y ^ (x | ~z)) P( A, B, C, D, 0, 6, 0xF4292244 ); P( D, A, B, C, 7, 10, 0x432AFF97 ); P( C, D, A, B, 14, 15, 0xAB9423A7 ); P( B, C, D, A, 5, 21, 0xFC93A039 ); P( A, B, C, D, 12, 6, 0x655B59C3 ); P( D, A, B, C, 3, 10, 0x8F0CCC92 ); P( C, D, A, B, 10, 15, 0xFFEFF47D ); P( B, C, D, A, 1, 21, 0x85845DD1 ); P( A, B, C, D, 8, 6, 0x6FA87E4F ); P( D, A, B, C, 15, 10, 0xFE2CE6E0 ); P( C, D, A, B, 6, 15, 0xA3014314 ); P( B, C, D, A, 13, 21, 0x4E0811A1 ); P( A, B, C, D, 4, 6, 0xF7537E82 ); P( D, A, B, C, 11, 10, 0xBD3AF235 ); P( C, D, A, B, 2, 15, 0x2AD7D2BB ); P( B, C, D, A, 9, 21, 0xEB86D391 ); #undef F ctx->state[0] += A; ctx->state[1] += B; ctx->state[2] += C; ctx->state[3] += D; } void sal_md5_update( struct sal_md5_context *ctx, uint8_t *input, uint32_t length ) { uint32_t left, fill; if( ! length ) return; left = ( ctx->total[0] >> 3 ) & 0x3F; fill = 64 - left; ctx->total[0] += length << 3; ctx->total[1] += length >> 29; ctx->total[0] &= 0xFFFFFFFF; ctx->total[1] += ctx->total[0] < ( length << 3 ); if( left && length >= fill ) { memcpy( (void *) (ctx->buffer + left), (void *) input, fill ); sal_md5_process( ctx, ctx->buffer ); length -= fill; input += fill; left = 0; } while( length >= 64 ) { sal_md5_process( ctx, input ); length -= 64; input += 64; } if( length ) { memcpy( (void *) (ctx->buffer + left), (void *) input, length ); } } static uint8_t md5_padding[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 }; void sal_md5_finish( struct sal_md5_context *ctx, uint8_t digest[16] ) { uint32_t last, padn; uint8_t msglen[8]; PUT_UINT32( ctx->total[0], msglen, 0 ); PUT_UINT32( ctx->total[1], msglen, 4 ); last = ( ctx->total[0] >> 3 ) & 0x3F; padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last ); sal_md5_update( ctx, md5_padding, padn ); sal_md5_update( ctx, msglen, 8 ); PUT_UINT32( ctx->state[0], digest, 0 ); PUT_UINT32( ctx->state[1], digest, 4 ); PUT_UINT32( ctx->state[2], digest, 8 ); PUT_UINT32( ctx->state[3], digest, 12 ); } fceu-0.98.12/src/drivers/sexyal/sexyal.c0000644000175000000620000000461510110477772017751 0ustar joestaff00000000000000#include #include #include "sexyal.h" #include "convert.h" #ifdef WIN32 #else #include "drivers/oss.h" #endif static uint32_t FtoB(const SexyAL_format *format, uint32_t frames) { return(frames*format->channels*(format->sampformat>>4)); } /* static uint32_t BtoF(const SexyAL_format *format, uint32_t bytes) { return(bytes / (format->channels * (format->sampformat>>4))); } */ static uint32_t CanWrite(SexyAL_device *device) { uint32_t bytes,frames; #ifdef WIN32 bytes=SexyALI_DSound_RawCanWrite(device); #else bytes=SexyALI_OSS_RawCanWrite(device); #endif frames=bytes / device->format.channels / (device->format.sampformat>>4); return(frames); } static uint32_t Write(SexyAL_device *device, void *data, uint32_t frames) { uint8_t buffer[2048*4]; while(frames) { int32_t tmp; tmp=frames; if(tmp>2048) { tmp=2048; frames-=2048; } else frames-=tmp; SexiALI_Convert(&device->srcformat, &device->format, buffer, data, tmp); //printf("%02x, %02x, %02x\n", device->srcformat.sampformat, device->srcformat.byteorder, device->srcformat.channels); //printf("buffer: %d\n",buffer[0]); /* FIXME: Return the actual number of frame written. It should always equal the number of frames requested to be written, except in cases of sound device failures. */ #ifdef WIN32 SexyALI_DSound_RawWrite(device,buffer,FtoB(&device->format,tmp)); #else SexyALI_OSS_RawWrite(device,buffer,FtoB(&device->format,tmp)); #endif } return(frames); } static int Close(SexyAL_device *device) { #ifdef WIN32 return(SexyALI_DSound_Close(device)); #else return(SexyALI_OSS_Close(device)); #endif } int SetConvert(struct __SexyAL_device *device, SexyAL_format *format) { memcpy(&device->srcformat,format,sizeof(SexyAL_format)); return(1); } static SexyAL_device *Open(SexyAL *iface, uint64_t id, SexyAL_format *format, SexyAL_buffering *buffering) { SexyAL_device *ret; #ifdef WIN32 if(!(ret=SexyALI_DSound_Open(id,format,buffering))) return(0); #else if(!(ret=SexyALI_OSS_Open(id,format,buffering))) return(0); #endif ret->Write=Write; ret->Close=Close; ret->CanWrite=CanWrite; ret->SetConvert=SetConvert; return(ret); } void Destroy(SexyAL *iface) { free(iface); } void *SexyAL_Init(int version) { SexyAL *iface; if(!version != 1) return(0); iface=malloc(sizeof(SexyAL)); iface->Open=Open; iface->Destroy=Destroy; return((void *)iface); } fceu-0.98.12/src/drivers/sexyal/smallc.c0000644000175000000620000000136110030466343017703 0ustar joestaff00000000000000#include "smallc.h" void sal_memcpy(void *dest, const void *src, uint32_t n) { while(n--) { *(uint8_t*)dest=*(uint8_t *)src; (uint8_t*)dest++; (uint8_t*)src++; } } uint32_t sal_strlen(const char *buf) { uint32_t size=0; while(*buf++) size++; return(size); } void sal_strcpy(char *dest, const char *src) { while(*src) *dest++ = *src++; *dest=0; } void sal_strcat(char *dest, const char *src) { while(*dest) dest++; while(*src) *dest++ = *src++; *dest=0; } const char *sal_uinttos(int value) { static char buf[64],buf2[64]; char *tmp; int len=0; tmp=buf; while(value) { *tmp='0'+(value%10); len++; tmp++; value/=10; } tmp=buf2; while(len-- >= 0) { *tmp=buf[len]; tmp++; } *tmp=0; return(buf2); } fceu-0.98.12/src/drivers/sexyal/md5.h0000644000175000000620000000054710030466300017120 0ustar joestaff00000000000000#ifndef _MD5_H #define _MD5_H struct sal_md5_context { uint32_t total[2]; uint32_t state[4]; uint8_t buffer[64]; }; void sal_md5_starts( struct sal_md5_context *ctx ); void sal_md5_update( struct sal_md5_context *ctx, uint8_t *input, uint32_t length ); void sal_md5_finish( struct sal_md5_context *ctx, uint8_t digest[16] ); #endif /* md5.h */ fceu-0.98.12/src/drivers/sexyal/sexyal.h0000644000175000000620000000310010030466300017724 0ustar joestaff00000000000000#include typedef struct { uint32_t sampformat; uint32_t channels; /* 1 = mono, 2 = stereo */ uint32_t rate; /* Number of frames per second, 22050, 44100, etc. */ uint32_t byteorder; /* 0 = Native(to CPU), 1 = Reversed. PDP can go to hell. */ } SexyAL_format; typedef struct { uint32_t fragcount; uint32_t fragsize; uint32_t totalsize; /* Shouldn't be filled in by application code. */ uint32_t ms; /* Milliseconds of buffering, approximate. */ } SexyAL_buffering; #define SEXYAL_ID_DEFAULT 0 #define SEXYAL_ID_UNUSED 1 #define SEXYAL_FMT_PCMU8 0x10 #define SEXYAL_FMT_PCMS8 0x11 #define SEXYAL_FMT_PCMU16 0x20 #define SEXYAL_FMT_PCMS16 0x21 #define SEXYAL_FMT_PCMU32U24 0x40 #define SEXYAL_FMT_PCMS32S24 0x41 #define SEXYAL_FMT_PCMU32U16 0x42 #define SEXYAL_FMT_PCMS32S16 0x43 typedef struct __SexyAL_device { int (*SetConvert)(struct __SexyAL_device *, SexyAL_format *); uint32_t (*Write)(struct __SexyAL_device *, void *data, uint32_t frames); uint32_t (*CanWrite)(struct __SexyAL_device *); int (*Close)(struct __SexyAL_device *); SexyAL_format format; SexyAL_format srcformat; SexyAL_buffering buffering; void *private; } SexyAL_device; typedef struct __SexyAL { SexyAL_device * (*Open)(struct __SexyAL *, uint64_t id, SexyAL_format *, SexyAL_buffering *buffering); void (*Enumerate)(struct __SexyAL *, int (*func)(uint8_t *name, uint64_t id, void *udata)); void (*Destroy)(struct __SexyAL *); } SexyAL; /* Initializes the library, requesting the interface of the version specified. */ void *SexyAL_Init(int version); fceu-0.98.12/src/drivers/sexyal/smallc.h0000644000175000000620000000032210030466300017675 0ustar joestaff00000000000000#include void sal_memcpy(void *dest, const void *src, uint32_t n); void sal_strcpy(char *dest, const char *src); const char *sal_uinttos(int value); void sal_strcat(char *dest, const char *src); fceu-0.98.12/src/drivers/sexyal/drivers/0002755000175000000620000000000010111545623017742 5ustar joestaff00000000000000fceu-0.98.12/src/drivers/sexyal/drivers/oss.c0000644000175000000620000001220010110500020020660 0ustar joestaff00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include #include "../sexyal.h" #include "../md5.h" #include "../smallc.h" #include "oss.h" #define IDBASE 0x1000 void SexyALI_OSS_Enumerate(int (*func)(uint8_t *name, uint64_t id, void *udata), void *udata) { struct stat buf; char fn[64]; unsigned int n; n=0; do { sal_strcpy(fn,"/dev/dsp"); sal_strcat(fn,sal_uinttos(n)); if(stat(fn,&buf)!=0) break; } while(func(fn,n+IDBASE,udata)); } static int FODevice(uint64_t id) { char fn[64]; if(id==SEXYAL_ID_DEFAULT) { sal_strcpy(fn,"/dev/dsp"); return(open(fn,O_WRONLY)); } else if(id==SEXYAL_ID_UNUSED) { int x=-1; int dspfd; do { sal_strcpy(fn,"/dev/dsp"); if(x!=-1) sal_strcat(fn,sal_uinttos(x)); dspfd=open(fn,O_WRONLY|O_NONBLOCK); if(dspfd!=-1) break; x++; } while(errno!=ENOENT); if(dspfd==-1) return(0); fcntl(dspfd,F_SETFL,fcntl(dspfd,F_GETFL)&~O_NONBLOCK); return(dspfd); } else { sal_strcpy(fn,"/dev/dsp"); sal_strcat(fn,sal_uinttos(id-IDBASE)); return(open(fn,O_WRONLY)); } } unsigned int Log2(unsigned int value) { int x=0; value>>=1; while(value) { value>>=1; x++; } return(x?x:1); } SexyAL_device *SexyALI_OSS_Open(uint64_t id, SexyAL_format *format, SexyAL_buffering *buffering) { SexyAL_device *device; int fd; unsigned int temp; if(!(fd=FODevice(id))) return(0); /* Set sample format. */ /* TODO: Handle devices with byte order different from native byte order. */ /* TODO: Fix fragment size calculation to work well with lower/higher playback rates, as reported by OSS. */ if(format->sampformat == SEXYAL_FMT_PCMU8) temp=AFMT_U8; else if(format->sampformat == SEXYAL_FMT_PCMS8) temp=AFMT_S8; else if(format->sampformat == SEXYAL_FMT_PCMU16) temp=AFMT_U16_LE; else temp=AFMT_S16_NE; format->byteorder=0; ioctl(fd,SNDCTL_DSP_SETFMT,&temp); switch(temp) { case AFMT_U8: format->sampformat = SEXYAL_FMT_PCMU8;break; case AFMT_S8: format->sampformat = SEXYAL_FMT_PCMS8;break; case AFMT_U16_LE: #ifndef LSB_FIRST format->byteorder=1; #endif format->sampformat = SEXYAL_FMT_PCMU16;break; case AFMT_U16_BE: #ifdef LSB_FIRST format->byteorder=1; #endif format->sampformat = SEXYAL_FMT_PCMU16;break; case AFMT_S16_LE: #ifndef LSB_FIRST format->byteorder=1; #endif format->sampformat = SEXYAL_FMT_PCMS16;break; case AFMT_S16_BE: #ifdef LSB_FIRST format->byteorder=1; #endif format->sampformat = SEXYAL_FMT_PCMS16;break; default: close(fd); return(0); } /* Set number of channels. */ temp=format->channels; if(ioctl(fd,SNDCTL_DSP_CHANNELS,&temp)==-1) { close(fd); return(0); } if(temp<1 || temp>2) { close(fd); return(0); } format->channels=temp; /* Set frame rate. */ temp=format->rate; if(ioctl(fd,SNDCTL_DSP_SPEED,&temp)==-1) { close(fd); return(0); } format->rate=temp; device=malloc(sizeof(SexyAL_device)); sal_memcpy(&device->format,format,sizeof(SexyAL_format)); sal_memcpy(&device->buffering,buffering,sizeof(SexyAL_buffering)); if(buffering->fragcount == 0 || buffering->fragsize == 0) { buffering->fragcount=16; buffering->fragsize=64; } else { if(buffering->fragsize<32) buffering->fragsize=32; if(buffering->fragcount<2) buffering->fragcount=2; } if(buffering->ms) { int64_t tc; //printf("%d\n",buffering->ms); /* 2*, >>1, |1 for crude rounding(it will always round 0.5 up, so it is a bit biased). */ tc=2*buffering->ms * format->rate / 1000 / buffering->fragsize; //printf("%f\n",(double)buffering->ms * format->rate / 1000 / buffering->fragsize); buffering->fragcount=(tc>>1)+(tc&1); //1<fragcount); } temp=Log2(buffering->fragsize*(format->sampformat>>4)*format->channels); temp|=buffering->fragcount<<16; ioctl(fd,SNDCTL_DSP_SETFRAGMENT,&temp); { audio_buf_info info; ioctl(fd,SNDCTL_DSP_GETOSPACE,&info); buffering->fragsize=info.fragsize/(format->sampformat>>4)/format->channels; buffering->fragcount=info.fragments; buffering->totalsize=buffering->fragsize*buffering->fragcount; //printf("Actual: %d, %d\n",buffering->fragsize,buffering->fragcount); } device->private=malloc(sizeof(int)); *(int*)device->private=fd; return(device); } int SexyALI_OSS_Close(SexyAL_device *device) { if(device) { if(device->private) { close(*(int*)device->private); free(device->private); } free(device); return(1); } return(0); } uint32_t SexyALI_OSS_RawWrite(SexyAL_device *device, void *data, uint32_t len) { ssize_t bytes; bytes = write(*(int *)device->private,data,len); if(bytes <= 0) return(0); /* FIXME: What to do on -1? */ return(bytes); } uint32_t SexyALI_OSS_RawCanWrite(SexyAL_device *device) { struct audio_buf_info ai; if(!ioctl(*(int *)device->private,SNDCTL_DSP_GETOSPACE,&ai)) return(ai.bytes); else return(0); } fceu-0.98.12/src/drivers/sexyal/drivers/dsound.c0000644000175000000620000001605610030466341021407 0ustar joestaff00000000000000#include #include #include #undef WINNT #define NONAMELESSUNION #define DIRECTSOUND_VERSION 0x0300 #include #include "../sexyal.h" typedef struct { LPDIRECTSOUND ppDS; /* DirectSound interface object. */ LPDIRECTSOUNDBUFFER ppbuf; /* Primary buffer. */ LPDIRECTSOUNDBUFFER ppbufsec; /* Secondary buffer. */ LPDIRECTSOUNDBUFFER ppbufw; /* Buffer to do writes to. */ WAVEFORMATEX wf; /* Format of the primary and secondary buffers. */ long DSBufferSize; /* The size of the buffer that we can write to, in bytes. */ long BufHowMuch; /* How many bytes we should try to buffer. */ DWORD ToWritePos; /* Position which the next write to the buffer should write to. */ } DSFobby; static void CheckStatus(DSFobby *tmp) { DWORD status=0; IDirectSoundBuffer_GetStatus(tmp->ppbufw, &status); if(status&DSBSTATUS_BUFFERLOST) IDirectSoundBuffer_Restore(tmp->ppbufw); if(!(status&DSBSTATUS_PLAYING)) { tmp->ToWritePos=0; IDirectSoundBuffer_SetCurrentPosition(tmp->ppbufsec,0); IDirectSoundBuffer_SetFormat(tmp->ppbufw,&tmp->wf); IDirectSoundBuffer_Play(tmp->ppbufw,0,0,DSBPLAY_LOOPING); } } SexyAL_device *SexyALI_DSound_Open(uint64_t id, SexyAL_format *format, SexyAL_buffering *buffering) { SexyAL_device *dev; DSFobby *fobby; DSBUFFERDESC DSBufferDesc; DSCAPS dscaps; DSBCAPS dsbcaps; dev=malloc(sizeof(SexyAL_device)); fobby=malloc(sizeof(DSFobby)); memset(fobby,0,sizeof(DSFobby)); memset(&fobby->wf,0,sizeof(WAVEFORMATEX)); fobby->wf.wFormatTag = WAVE_FORMAT_PCM; fobby->wf.nChannels = format->channels; fobby->wf.nSamplesPerSec = format->rate; if(DirectSoundCreate(0,&fobby->ppDS,0) != DS_OK) { free(dev); free(fobby); return(0); } { //HWND hWnd = GetForegroundWindow(); // Ugly. //if(!hWnd) //{ hWnd=GetDesktopWindow(); exit(1); } HWND hWnd; hWnd=GetDesktopWindow(); IDirectSound_SetCooperativeLevel(fobby->ppDS,hWnd,DSSCL_PRIORITY); } memset(&dscaps,0x00,sizeof(dscaps)); dscaps.dwSize=sizeof(dscaps); IDirectSound_GetCaps(fobby->ppDS,&dscaps); IDirectSound_Compact(fobby->ppDS); /* Create primary buffer */ memset(&DSBufferDesc,0x00,sizeof(DSBUFFERDESC)); DSBufferDesc.dwSize=sizeof(DSBufferDesc); DSBufferDesc.dwFlags=DSBCAPS_PRIMARYBUFFER; if(IDirectSound_CreateSoundBuffer(fobby->ppDS,&DSBufferDesc,&fobby->ppbuf,0) != DS_OK) { IDirectSound_Release(fobby->ppDS); free(dev); free(fobby); return(0); } /* Set primary buffer format. */ if(format->sampformat == SEXYAL_FMT_PCMU8) fobby->wf.wBitsPerSample=8; else // if(format->sampformat == SEXYAL_FMT_PCMS16) { fobby->wf.wBitsPerSample=16; format->sampformat=SEXYAL_FMT_PCMS16; } fobby->wf.nBlockAlign=fobby->wf.wBitsPerSample>>3; fobby->wf.nAvgBytesPerSec=fobby->wf.nSamplesPerSec*fobby->wf.nBlockAlign; if(IDirectSoundBuffer_SetFormat(fobby->ppbuf,&fobby->wf) != DS_OK) { IDirectSound_Release(fobby->ppbuf); IDirectSound_Release(fobby->ppDS); free(dev); free(fobby); return(0); } /* Create secondary sound buffer */ IDirectSoundBuffer_GetFormat(fobby->ppbuf,&fobby->wf,sizeof(WAVEFORMATEX),0); memset(&DSBufferDesc,0x00,sizeof(DSBUFFERDESC)); DSBufferDesc.dwSize=sizeof(DSBufferDesc); DSBufferDesc.dwFlags=DSBCAPS_GETCURRENTPOSITION2; DSBufferDesc.dwFlags|=DSBCAPS_GLOBALFOCUS; DSBufferDesc.dwBufferBytes=65536; DSBufferDesc.lpwfxFormat=&fobby->wf; if(IDirectSound_CreateSoundBuffer(fobby->ppDS, &DSBufferDesc, &fobby->ppbufsec, 0) != DS_OK) { IDirectSound_Release(fobby->ppbuf); IDirectSound_Release(fobby->ppDS); free(dev); free(fobby); return(0); } fobby->DSBufferSize=65536; IDirectSoundBuffer_SetCurrentPosition(fobby->ppbufsec,0); fobby->ppbufw=fobby->ppbufsec; memcpy(&dev->format,format,sizeof(SexyAL_format)); if(!buffering->ms) buffering->ms=53; buffering->totalsize=(int64_t)format->rate*buffering->ms/1000; fobby->BufHowMuch=buffering->totalsize* format->channels * (format->sampformat>>4); //printf("%d\n",fobby->BufHowMuch); //fflush(stdout); dev->private=fobby; timeBeginPeriod(1); return(dev); } uint32_t SexyALI_DSound_RawCanWrite(SexyAL_device *device) { DSFobby *tmp=device->private; DWORD CurWritePos,CurPlayPos=0; CheckStatus(tmp); CurWritePos=0; if(IDirectSoundBuffer_GetCurrentPosition(tmp->ppbufw,&CurPlayPos,&CurWritePos)==DS_OK) { //FCEU_DispMessage("%d",CurWritePos-CurPlayPos); } CurWritePos=(CurPlayPos+tmp->BufHowMuch)%tmp->DSBufferSize; /* If the current write pos is >= half the buffer size less than the to write pos, assume DirectSound has wrapped around. */ if(((int32_t)tmp->ToWritePos-(int32_t)CurWritePos) >= (tmp->DSBufferSize/2)) { CurWritePos+=tmp->DSBufferSize; //printf("Fixit: %d,%d,%d\n",tmp->ToWritePos,CurWritePos,CurWritePos-tmp->DSBufferSize); } if(tmp->ToWritePosToWritePos; if(howmuch > tmp->BufHowMuch) /* Oopsie. Severe buffer overflow... */ { tmp->ToWritePos=CurWritePos%tmp->DSBufferSize; //IDirectSoundBuffer_Stop(tmp->ppbufsec); //IDirectSoundBuffer_SetCurrentPosition(tmp->ppbufsec,tmp->ToWritePos); //puts("Oops"); //fflush(stdout); //return(0); } return(CurWritePos-tmp->ToWritePos); } else return(0); } int SexyALI_DSound_RawWrite(SexyAL_device *device, void *data, uint32_t len) { DSFobby *tmp=device->private; uint32_t cw; //printf("Pre: %d\n",SexyALI_DSound_RawCanWrite(device)); //fflush(stdout); CheckStatus(tmp); /* In this block, we write as much data as we can, then we write the rest of it in >=1ms chunks. */ while(len) { VOID *LockPtr[2]={0,0}; DWORD LockLen[2]={0,0}; int32_t curlen; while(!(curlen=SexyALI_DSound_RawCanWrite(device))) { Sleep(1); } if(curlen>len) curlen=len; if(DS_OK == IDirectSoundBuffer_Lock(tmp->ppbufw,tmp->ToWritePos,curlen,&LockPtr[0],&LockLen[0],&LockPtr[1],&LockLen[1],0)) { } if(LockPtr[1] != 0 && LockPtr[1] != LockPtr[0]) { memcpy(LockPtr[0],data,LockLen[0]); memcpy(LockPtr[1],data+LockLen[0],len-LockLen[0]); } else if(LockPtr[0]) { memcpy(LockPtr[0],data,curlen); } IDirectSoundBuffer_Unlock(tmp->ppbufw,LockPtr[0],LockLen[0],LockPtr[1],LockLen[1]); tmp->ToWritePos=(tmp->ToWritePos+curlen)%tmp->DSBufferSize; len-=curlen; (uint8_t *) data+=curlen; if(len) Sleep(1); } // end while(len) loop return(1); } int SexyALI_DSound_Close(SexyAL_device *device) { if(device) { if(device->private) { DSFobby *tmp=device->private; if(tmp->ppbufsec) { IDirectSoundBuffer_Stop(tmp->ppbufsec); IDirectSoundBuffer_Release(tmp->ppbufsec); } if(tmp->ppbuf) { IDirectSoundBuffer_Stop(tmp->ppbuf); IDirectSoundBuffer_Release(tmp->ppbuf); } if(tmp->ppDS) { IDirectSound_Release(tmp->ppDS); } free(device->private); } free(device); timeEndPeriod(1); return(1); } return(0); } fceu-0.98.12/src/drivers/sexyal/drivers/osxcoreaudio.c0000644000175000000620000000011710030466341022606 0ustar joestaff00000000000000#include #include #include fceu-0.98.12/src/drivers/sexyal/drivers/oss.h0000644000175000000620000000057110110477452020723 0ustar joestaff00000000000000void SexyALI_OSS_Enumerate(int (*func)(uint8_t *name, uint64_t id, void *udata), void *udata); SexyAL_device *SexyALI_OSS_Open(uint64_t id, SexyAL_format *format, SexyAL_buffering *buffering); int SexyALI_OSS_Close(SexyAL_device *device); uint32_t SexyALI_OSS_RawWrite(SexyAL_device *device, void *data, uint32_t len); uint32_t SexyALI_OSS_RawCanWrite(SexyAL_device *device); fceu-0.98.12/src/drivers/sexyal/Makefile.am.inc0000644000175000000620000000041310032704574021070 0ustar joestaff00000000000000sexyal_SOURCES = drivers/sexyal/sexyal.c drivers/sexyal/md5.c drivers/sexyal/smallc.c drivers/sexyal/convert.c if WIN32 TMP_SEXYAL = drivers/sexyal/drivers/dsound.c endif if UNIX TMP_SEXYAL = drivers/sexyal/drivers/oss.c endif sexyal_SOURCES += $(TMP_SEXYAL) fceu-0.98.12/src/drivers/sexyal/convertgen.c0000644000175000000620000000715710040661443020612 0ustar joestaff00000000000000#include char *check[]={"SEXYAL_FMT_PCMS8","SEXYAL_FMT_PCMU8","SEXYAL_FMT_PCMS16", "SEXYAL_FMT_PCMU16","SEXYAL_FMT_PCMS32S16","SEXYAL_FMT_PCMU32U16","SEXYAL_FMT_PCMS32S24","SEXYAL_FMT_PCMU32U24"}; char *str[]={"int8_t","uint8_t","int16_t","uint16_t","int32_t","uint32_t","int32_t","uint32_t"}; int bitss[]={8,8,16,16,16,16,24,24}; int bitsreal[]={8,8,16,16,32,32,32,32}; void Fetch(int x,char *wt) { printf(" int32_t tmp%s=*src;\n",wt); printf(" src++;\n"); } void BitConv(int src, int dest, char *wt) { if((src^dest)&1) /* signed/unsigned change. */ if(src&1) /* Source unsigned, dest signed. */ { if(src==1) printf(" tmp%s-=128;\n",wt); else if(src==3) printf(" tmp%s-=32768;\n",wt); else if(src==5) printf(" tmp%s-=32768;\n",wt); else if(src==7) printf(" tmp%s-=(1<<23);\n",wt); } else /* Source signed, dest unsigned */ { if(src==0) printf(" tmp%s+=128;\n",wt); else if(src==2) printf(" tmp%s+=32768;\n",wt); else if(src==4) printf(" tmp%s+=32768;\n",wt); else if(src==6) printf(" tmp%s+=(1<<23);\n",wt); } if((src>>1) != (dest>>1)) { int shifty=bitss[src]-bitss[dest]; if(shifty>0) printf(" tmp%s >>= %d;\n",wt,shifty); else printf(" tmp%s <<= %d;\n",wt,-shifty); } } void Save(int x, char *wt) { printf(" *dest=tmp%s;\n",wt); printf(" dest++;\n"); } main() { int srcbits,destbits,srcchannels,destchannels; int srcbo,destbo; puts("void SexiALI_Convert(SexyAL_format *srcformat, SexyAL_format *destformat, void *vdest, void *vsrc, uint32_t frames)"); puts("{"); for(srcbits=0;srcbits<8;srcbits++) { printf("if(srcformat->sampformat == %s)\n{\n",check[srcbits]); printf("%s* src=vsrc;\n",str[srcbits]); for(destbits=0;destbits<8;destbits++) { printf("if(destformat->sampformat == %s)\n{\n",check[destbits]); printf("%s* dest=vdest;\n",str[destbits]); for(srcchannels=0;srcchannels<2;srcchannels++) { printf("if(srcformat->channels == %c)\n{\n",'1'+srcchannels); for(destchannels=0;destchannels<2;destchannels++) { printf("if(destformat->channels == %c)\n{\n",'1'+destchannels); for(srcbo=0;srcbo<2;srcbo++) { printf("if(srcformat->byteorder == %d)\n{\n",srcbo); for(destbo=0;destbo<2;destbo++) { printf("if(destformat->byteorder == %d)\n{\n",destbo); //printf("if(srcformat->sampformat==%s && destformat->sameck[srcbits],check[destbits]); printf("while(frames--)\n{\n"); Fetch(srcbits,""); if(srcbo) { if(bitsreal[srcbits]==16) puts("FLIP16(tmp);"); else puts("FLIP32(tmp);"); } if(srcchannels) { Fetch(srcbits,"2"); if(srcbo) { if(bitsreal[srcbits]==16) puts("FLIP16(tmp2);"); else puts("FLIP32(tmp2);"); } } BitConv(srcbits,destbits,""); if(srcchannels) BitConv(srcbits,destbits,"2"); if(destbo) { if(bitsreal[srcbits]==16) puts("FLIP16(tmp);"); else puts("FLIP32(tmp);"); if(srcchannels && destchannels && destbo) { if(bitsreal[srcbits]==16) puts("FLIP16(tmp2);"); else puts("FLIP32(tmp2);"); } } if(srcchannels && !destchannels) printf("tmp = (tmp+tmp2)>>1;\n"); Save(destbits,""); if(!srcchannels && destchannels) Save(destbits,""); if(srcchannels && destchannels) Save(destbits,"2"); puts("}"); puts("}"); } // destbo puts("}"); } // srcbo puts("}"); } puts("}"); } puts("}"); } puts("}"); } puts("}"); } fceu-0.98.12/src/drivers/sexyal/convertgen0000755000175000000620000003371410040661444020373 0ustar joestaff00000000000000ELFô‚4ô&4 (# 44€4€àà€€< < < <<¤¨P PPÈÈ((( Qåtd/lib/ld-linux.so.2GNU5~Iû.9:؉  _Jv_RegisterClasses__gmon_start__libc.so.6printfputs_IO_stdin_used__libc_start_mainGLIBC_2.0$ii [ž(ž,ž0žU‰åƒìèqèÌèãÉÃÿ5 žÿ%$žÿ%(žhéàÿÿÿÿ%,žhéÐÿÿÿÿ%0žhéÀÿÿÿ1í^‰áƒäðPTRh`‰h0‰QVh\…è¿ÿÿÿôU‰åSPè[Ãú‹ƒüÿÿÿ…ÀtÿЋ]üÉÃU‰åƒì€=àžu)¡Hž‹…Òt‰öƒÀ£HžÿÒ¡Hž‹…ÒuëÆàžÉÉöU‰åƒì¡L…Àt¸…Àtƒì hLÿЃÄvÉÃU‰åƒìƒìÿu h§Šè*ÿÿÿƒÄƒì h½ŠèÿÿÿƒÄÉÃU‰åƒì‹E 3Eƒà…À„é‹Eƒà…Àtuƒ}uƒìÿuhÆŠèÞþÿÿƒÄéÁƒ}uƒìÿuhÔŠèÀþÿÿƒÄ飃}uƒìÿuhÔŠè¢þÿÿƒÄé…ƒ}uƒìÿuhäŠè„þÿÿƒÄëjƒ}uƒìÿuhöŠèiþÿÿƒÄëOƒ}uƒìÿuh‹èNþÿÿƒÄë4ƒ}uƒìÿuh‹è3þÿÿƒÄëƒ}uƒìÿuh‹èþÿÿƒÄ‹E‰ÂÑú‹E Ñø9ÂtP‹M‹E ‹… ž‹ ž)ЉEüƒ}ü~ƒìÿuüÿuh&‹èÓýÿÿƒÄëƒì‹Eü÷ØPÿuh6‹è¸ýÿÿƒÄÉÃU‰åƒìƒìÿu hF‹èýÿÿƒÄƒì hU‹èýÿÿƒÄÉÃU‰åƒìƒäð¸)ăì h`‹èKýÿÿƒÄƒì hÔ‹è;ýÿÿƒÄÇEüƒ}ü~é}ƒì‹Eüÿ4…`žhØ‹è/ýÿÿƒÄƒì‹Eüÿ4…€žhû‹èýÿÿƒÄÇEøƒ}ø~éƒì‹Eøÿ4…`žh ŒèéüÿÿƒÄƒì‹Eøÿ4…€žh0ŒèÏüÿÿƒÄÇEôƒ}ô~齃ì‹EôƒÀ1PhDŒè¦üÿÿƒÄÇEðƒ}ð~ézƒì‹EðƒÀ1PhhŒè}üÿÿƒÄÇEìƒ}ì~é7ƒìÿuìhŒŒèXüÿÿƒÄÇEèƒ}è~éøƒìÿuèh°Œè3üÿÿƒÄƒì hÓŒè#üÿÿƒÄƒìhæŒÿuüèÐüÿÿƒÄƒ}ìt/‹Eüƒ<…Àžuƒì hçŒèÍûÿÿƒÄëƒì hôŒè»ûÿÿƒÄƒ}ôtHƒìhÿuüè‚üÿÿƒÄƒ}ìt/‹Eüƒ<…Àžuƒì hèûÿÿƒÄëƒì hèmûÿÿƒÄƒìhæŒÿuøÿuüèbüÿÿƒÄƒ}ôtƒìhÿuøÿuüèFüÿÿƒÄƒ}ètp‹Eüƒ<…Àžuƒì hçŒèûÿÿƒÄëƒì hôŒèûÿÿƒÄƒ}ôt;ƒ}ðt5ƒ}èt/‹Eüƒ<…Àžuƒì hè×úÿÿƒÄëƒì hèÅúÿÿƒÄƒ}ôtƒ}ðuƒì hèÉúÿÿƒÄƒìhæŒÿuøèýÿÿƒÄƒ}ôuƒ}ðtƒìhæŒÿuøèäüÿÿƒÄƒ}ôtƒ}ðtƒìhÿuøèÅüÿÿƒÄƒì h5èHúÿÿƒÄƒì h5è8úÿÿƒÄEèÿéýýÿÿƒì h5èúÿÿƒÄEìÿé¾ýÿÿƒì h5èúÿÿƒÄEðÿé{ýÿÿƒì h5èêùÿÿƒÄEôÿé8ýÿÿƒì h5èÐùÿÿƒÄEøÿéØüÿÿƒì h5è¶ùÿÿƒÄEüÿéxüÿÿƒì h5èœùÿÿƒÄÉÃU‰åVSèbùÿÿ¸<-<Áø1Û9Ãs‰Æÿ<C9órô[^ÉÃU‰åSP¸<-<Áø…ÀXÿu ‹]üÉé6‰öÿ<‰ÚK…ÒuòëåU‰åSR¡<ƒøÿ»<t ƒëÿЋƒøÿuôX[ÉÃU‰åSRè[ÃZènùÿÿ‹]üÉÃSEXYAL_FMT_PCMS8SEXYAL_FMT_PCMU8SEXYAL_FMT_PCMS16SEXYAL_FMT_PCMU16SEXYAL_FMT_PCMS32S16SEXYAL_FMT_PCMU32U16SEXYAL_FMT_PCMS32S24SEXYAL_FMT_PCMU32U24int8_tuint8_tint16_tuint16_tint32_tuint32_t int32_t tmp%s=*src; src++; tmp%s-=128; tmp%s-=32768; tmp%s-=(1<<23); tmp%s+=128; tmp%s+=32768; tmp%s+=(1<<23); tmp%s >>= %d; tmp%s <<= %d; *dest=tmp%s; dest++; void SexiALI_Convert(SexyAL_format *srcformat, SexyAL_format *destformat, void *vdest, void *vsrc, uint32_t frames){if(srcformat->sampformat == %s) { %s* src=vsrc; if(destformat->sampformat == %s) { %s* dest=vdest; if(srcformat->channels == %c) { if(destformat->channels == %c) { if(srcformat->byteorder == %d) { if(destformat->byteorder == %d) { while(frames--) { FLIP16(tmp);FLIP32(tmp);2FLIP16(tmp2);FLIP32(tmp2);tmp = (tmp+tmp2)>>1; }ÿÿÿÿÿÿÿÿ$ œ‚ ¸‰Hèx e ž„‚|‚þÿÿo\‚ÿÿÿoðÿÿoN‚Pʂڂê‚H܉í‰þ‰Š"Š7ŠLŠaŠvŠ}Š…ŠŠ–ŠžŠ–ŠžŠ GCC: (GNU) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)GCC: (GNU) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)GCC: (GNU) 3.3.3 20040326 (Red Hat Linux 3.3.3-6)GCC: (GNU) 3.3.3 20040326 (Red Hat Linux 3.3.3-6)GCC: (GNU) 3.3.3 20040326 (Red Hat Linux 3.3.3-6)GCC: (GNU) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)ô‚$, ¸‰œ‚ ƒ#$Ò Ή±‚!„œ„_IO_stdin_used€ô‚ƒ../sysdeps/i386/elf/start.S/usr/src/build/231499-i386/BUILD/glibc-2.3.2-20030313/csuGNU AS 2.13.90.0.18€˜oƒƒ/š<Î<#LSLbint…N ‰b… RLb wMŒbœœL¬ÈO>IS#ÔNZ#  ŠÂÐ# ÓO£óé#3:# [‹:Â!#ó"é#. †& „  ö M ç a Ÿ  h ¼ ›8 ƒ <B xX=j§# û]ükÀ# ›e=‡lÙ#Šmç# nO#SSSdçéûé  jÕ…Ydð<?ýu[#òva#¾xS#Zzl# Ë{l# NHrÈ}«# K«e~Ä# ANÆçÝ# ÈOÜ2€ö# f„S#$ð…S#( †S#,u‡S#0ŠS#4ŠŒç#8jç $@O“#¹”#±˜S#œS# ç S#&¢î#ó£é#<§O# ïô£éôG=SçééCO盵Ugœœx«SSdûé SS±ÆbSôÌÜSSâîSé+ƒ­Ü®G#C¯S#а+#:jL_,4û2ô#Š3j#~,5 û/ô Å4: ç"ô 4#” —$… O%±] {(Ã¥ D)ô °*à ~+” 7,S Ô-… C2: Õ3X F9: : &ƒ o„… ß…… †± q‡ ¯ˆ… ¨‰… ,ŒS X% Ž I± ] à‘… ’ ±“… c” -–S ²— ߘS ç›S …žS e¡ Z¦ “§: ª±  « 6®± K¯ ´S §µ ¸¶% ‘·l XºS 7½… {E qÈ q#  aäêSa  a Ðd!6S6aç }±Gô R5_ å7à 8S ›9” œ:…Ø–؉S®:/usr/src/build/231499-i386/BUILD/glibc-2.3.2-20030313/build-i386-linux/csu/crti.S/usr/src/build/231499-i386/BUILD/glibc-2.3.2-20030313/csuGNU AS 2.13.90.0.18€®(ì/usr/src/build/231499-i386/BUILD/glibc-2.3.2-20030313/build-i386-linux/csu/crtn.S/usr/src/build/231499-i386/BUILD/glibc-2.3.2-20030313/csuGNU AS 2.13.90.0.18€%%  : ;  : ; I8 I!I/ $ > $ >  : ; : ;I : ; I : ; I  : ; (  : ;  I' II &I' < !I4: ; I?  %%Q/û ../sysdeps/i386/elfstart.Sô‚.01:"!VWYWû ÇÁû ../sysdeps/generic/bits../wcsmbs/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include../sysdeps/gnu../iconvinit.ctypes.hwchar.hstddef.h_G_config.hgconv.h®eû /usr/src/build/231499-i386/BUILD/glibc-2.3.2-20030313/build-i386-linux/csucrti.S¸‰2,W œ‚",:ƒ ,Wdd,,-:Œeû /usr/src/build/231499-i386/BUILD/glibc-2.3.2-20030313/build-i386-linux/csucrtn.SΉ:±‚ ÿÿÿÿ| ˆ_G_int32_t__time_t__GCONV_INCOMPLETE_INPUT__daddr_t__int32_t__gconv_init_fct_G_iconv_t__rlim64_t__GCONV_ILLEGAL_DESCRIPTOR__gconv_infoshort unsigned intunsigned char__useconds_t__counter__fct__val__value__nsteps_G_int16_t__max_needed_from__gconv_btowc_fct__off_t__ssize_t__statepinit.c__fsfilcnt_t__steps__fsfilcnt64_t__blkcnt_t__blksize_t_G_fpos64_t__gconv_t__trans_end_fct__u_int__GCONV_ILLEGAL_INPUT__gconv_loaded_object__to_name__uint64_t__id_t__GCONV_EMPTY_INPUT__cd__ino_t__GCONV_NOCONV__invocation_counter__pid_t__u_short__count__quad_t__u_long__fsid_t__GCONV_FULL_OUTPUT__max_needed_to__timer_t__stateful/usr/src/build/231499-i386/BUILD/glibc-2.3.2-20030313/csu__uint32_t__key_t__u_char__gconv_step__shlib_handle__min_needed_toshort int__dev_tlong long int__gconv_trans_data__outbuflong long unsigned int__uid_t__wchb__uint16_twint_t__u_quad_t__gconv_trans_end_fct__flags__outbufend__combined__gconv_trans_init_fct__init_fct__modname__trans_context_fctGNU C 3.2.2 20030222 (Red Hat Linux 3.2.2-5)__trans_fct__rlim_t__wch__intptr_t__suseconds_t__ino64_twchar_t__GCONV_IS_LAST__blkcnt64_t__fsblkcnt64_t__mode_t__qaddr_t__pos__gconv_end_fct_IO_stdin_used__internal_use__GCONV_NODB__clock_t__gconv_step_data__gconv_trans_query_fct__socklen_t__int64_t__GCONV_NOMEM__off64_t__btowc_fct_G_fpos_t__int8_t__GCONV_OK__fsblkcnt_t_G_uint32_t__nlink_t__swblk_t__GCONV_INTERNAL_ERROR__mbstate_t__gid_t__clockid_t__state__gconv_trans_context_fct__next__GCONV_IGNORE_ERRORS__end_fct__trans__uint8_t__gconv_fct__from_name__min_needed_from__gconv_trans_fct__data__caddr_t_G_uint16_t__loff_t__int16_t.symtab.strtab.shstrtab.interp.note.ABI-tag.hash.dynsym.dynstr.gnu.version.gnu.version_r.rel.dyn.rel.plt.init.text.fini.rodata.eh_frame.ctors.dtors.jcr.dynamic.got.got.plt.data.bss.comment.debug_aranges.debug_pubnames.debug_info.debug_abbrev.debug_line.debug_frame.debug_str#(( 1HH07 xxp?èèeGÿÿÿoN‚NTþÿÿo\‚\ c |‚|l „‚„ uœ‚œp´‚´@{ô‚ôĸ‰¸ ‡Ô‰Ô c88 ™<<  DD §LL ¬PP ȵžºžÃ@ž@  ÉàžàÎà2×xæ%öµ„ 98q|ð)0º¾%4l,@"T ¬3 (HxèN‚\‚|‚„‚ œ‚ ´‚ ô‚ ¸‰ Ô‰8<DLPžž@žàž !"ñÿñÿñÿ`ñÿkñÿvñÿkñÿñÿkñÿñÿñÿñÿ`ñÿkñÿËñÿÒñÿ$ñÿvñÿÒñÿñÿñÿñÿ`ñÿÒñÿƒ ‘ñÿœ<ªD¸LÅHžÉàžÕ<ƒ ëxƒ ‘ñÿ÷@H8L+”‰ Añÿ$ñÿvñÿAñÿñÿñÿñÿ`ñÿAñÿ“ñÿ P©Ô‰°<ñÿÁÀž ÊDž×`‰4 ç~÷œ‚ ý ž `ž  ô‚ 1…+ <ñÿ(0‰0 8àžñÿD\…Ñ Iσb Qûn<ñÿ@ž Š9œ¸‰ ¢¤ƒ+ ¨àžñÿ¯žÅäžñÿÊ€ž Î<ñÿá؉ð@žý  /usr/src/build/231499-i386/BUILD/glibc-2.3.2-20030313/build-i386-linux/config.habi-note.S/usr/src/build/231499-i386/BUILD/glibc-2.3.2-20030313/build-i386-linux/csu/abi-tag.hinit.c/usr/src/build/231499-i386/BUILD/glibc-2.3.2-20030313/build-i386-linux/csu/crti.S/usr/src/build/231499-i386/BUILD/glibc-2.3.2-20030313/build-i386-linux/csu/defs.hinitfini.ccall_gmon_startcrtstuff.c__CTOR_LIST____DTOR_LIST____JCR_LIST__p.0completed.1__do_global_dtors_auxframe_dummy__CTOR_END____DTOR_END____FRAME_END____JCR_END____do_global_ctors_aux/usr/src/build/231499-i386/BUILD/glibc-2.3.2-20030313/build-i386-linux/csu/crtn.Sconvertgen.c_DYNAMIC_fp_hw__fini_array_endbitsreal__dso_handle__libc_csu_finiputs@@GLIBC_2.0_initbitsscheck_startSave__fini_array_start__libc_csu_init__bss_startmainBitConv__libc_start_main@@GLIBC_2.0__init_array_enddata_startprintf@@GLIBC_2.0_finiFetch_edata_GLOBAL_OFFSET_TABLE__endstr__init_array_start_IO_stdin_used__data_start_Jv_RegisterClasses__gmon_start__fceu-0.98.12/src/drivers/sexyal/convert.c0000644000175000000620000000041110047320037020100 0ustar joestaff00000000000000#include "sexyal.h" #include "convert.h" static inline uint16_t FLIP16(uint16_t b) { return((b<<8)|((b>>8)&0xFF)); } static inline uint32_t FLIP32(uint32_t b) { return( (b<<24) | ((b>>8)&0xFF00) | ((b<<8)&0xFF0000) | ((b>>24)&0xFF) ); } #include "convert.inc" fceu-0.98.12/src/drivers/sexyal/convert.inc0000755000175000000620000064442410040661445020460 0ustar joestaff00000000000000void SexiALI_Convert(SexyAL_format *srcformat, SexyAL_format *destformat, void *vdest, void *vsrc, uint32_t frames) { if(srcformat->sampformat == SEXYAL_FMT_PCMS8) { int8_t* src=vsrc; if(destformat->sampformat == SEXYAL_FMT_PCMS8) { int8_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU8) { uint8_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=128; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=128; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=128; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=128; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=128; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=128; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=128; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=128; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=128; tmp2+=128; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=128; tmp2+=128; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=128; tmp2+=128; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=128; tmp2+=128; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=128; tmp2+=128; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=128; tmp2+=128; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=128; tmp2+=128; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=128; tmp2+=128; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS16) { int16_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU16) { uint16_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=128; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=128; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=128; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=128; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=128; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=128; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=128; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=128; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=128; tmp <<= 8; tmp2+=128; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=128; tmp <<= 8; tmp2+=128; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=128; tmp <<= 8; tmp2+=128; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=128; tmp <<= 8; tmp2+=128; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=128; tmp <<= 8; tmp2+=128; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=128; tmp <<= 8; tmp2+=128; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=128; tmp <<= 8; tmp2+=128; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=128; tmp <<= 8; tmp2+=128; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS32S16) { int32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU32U16) { uint32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=128; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=128; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=128; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=128; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=128; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=128; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=128; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=128; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=128; tmp <<= 8; tmp2+=128; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=128; tmp <<= 8; tmp2+=128; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=128; tmp <<= 8; tmp2+=128; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=128; tmp <<= 8; tmp2+=128; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=128; tmp <<= 8; tmp2+=128; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=128; tmp <<= 8; tmp2+=128; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=128; tmp <<= 8; tmp2+=128; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=128; tmp <<= 8; tmp2+=128; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS32S24) { int32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 16; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 16; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 16; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 16; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 16; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 16; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 16; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 16; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 16; tmp2 <<= 16; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 16; tmp2 <<= 16; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 16; tmp2 <<= 16; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 16; tmp2 <<= 16; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 16; tmp2 <<= 16; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 16; tmp2 <<= 16; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 16; tmp2 <<= 16; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 16; tmp2 <<= 16; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU32U24) { uint32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=128; tmp <<= 16; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=128; tmp <<= 16; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=128; tmp <<= 16; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=128; tmp <<= 16; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=128; tmp <<= 16; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=128; tmp <<= 16; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=128; tmp <<= 16; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=128; tmp <<= 16; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=128; tmp <<= 16; tmp2+=128; tmp2 <<= 16; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=128; tmp <<= 16; tmp2+=128; tmp2 <<= 16; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=128; tmp <<= 16; tmp2+=128; tmp2 <<= 16; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=128; tmp <<= 16; tmp2+=128; tmp2 <<= 16; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=128; tmp <<= 16; tmp2+=128; tmp2 <<= 16; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=128; tmp <<= 16; tmp2+=128; tmp2 <<= 16; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=128; tmp <<= 16; tmp2+=128; tmp2 <<= 16; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=128; tmp <<= 16; tmp2+=128; tmp2 <<= 16; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } } if(srcformat->sampformat == SEXYAL_FMT_PCMU8) { uint8_t* src=vsrc; if(destformat->sampformat == SEXYAL_FMT_PCMS8) { int8_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=128; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=128; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=128; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=128; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=128; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=128; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=128; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=128; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=128; tmp2-=128; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=128; tmp2-=128; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=128; tmp2-=128; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=128; tmp2-=128; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=128; tmp2-=128; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=128; tmp2-=128; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=128; tmp2-=128; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=128; tmp2-=128; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU8) { uint8_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS16) { int16_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=128; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=128; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=128; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=128; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=128; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=128; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=128; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=128; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=128; tmp <<= 8; tmp2-=128; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=128; tmp <<= 8; tmp2-=128; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=128; tmp <<= 8; tmp2-=128; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=128; tmp <<= 8; tmp2-=128; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=128; tmp <<= 8; tmp2-=128; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=128; tmp <<= 8; tmp2-=128; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=128; tmp <<= 8; tmp2-=128; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=128; tmp <<= 8; tmp2-=128; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU16) { uint16_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS32S16) { int32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=128; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=128; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=128; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=128; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=128; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=128; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=128; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=128; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=128; tmp <<= 8; tmp2-=128; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=128; tmp <<= 8; tmp2-=128; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=128; tmp <<= 8; tmp2-=128; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=128; tmp <<= 8; tmp2-=128; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=128; tmp <<= 8; tmp2-=128; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=128; tmp <<= 8; tmp2-=128; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=128; tmp <<= 8; tmp2-=128; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=128; tmp <<= 8; tmp2-=128; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU32U16) { uint32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS32S24) { int32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=128; tmp <<= 16; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=128; tmp <<= 16; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=128; tmp <<= 16; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=128; tmp <<= 16; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=128; tmp <<= 16; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=128; tmp <<= 16; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=128; tmp <<= 16; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=128; tmp <<= 16; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=128; tmp <<= 16; tmp2-=128; tmp2 <<= 16; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=128; tmp <<= 16; tmp2-=128; tmp2 <<= 16; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=128; tmp <<= 16; tmp2-=128; tmp2 <<= 16; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=128; tmp <<= 16; tmp2-=128; tmp2 <<= 16; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=128; tmp <<= 16; tmp2-=128; tmp2 <<= 16; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=128; tmp <<= 16; tmp2-=128; tmp2 <<= 16; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=128; tmp <<= 16; tmp2-=128; tmp2 <<= 16; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=128; tmp <<= 16; tmp2-=128; tmp2 <<= 16; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU32U24) { uint32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 16; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 16; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 16; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 16; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 16; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 16; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 16; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 16; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 16; tmp2 <<= 16; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 16; tmp2 <<= 16; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 16; tmp2 <<= 16; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 16; tmp2 <<= 16; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 16; tmp2 <<= 16; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 16; tmp2 <<= 16; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 16; tmp2 <<= 16; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 16; tmp2 <<= 16; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } } if(srcformat->sampformat == SEXYAL_FMT_PCMS16) { int16_t* src=vsrc; if(destformat->sampformat == SEXYAL_FMT_PCMS8) { int8_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; FLIP16(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp >>= 8; FLIP16(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp >>= 8; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp >>= 8; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp >>= 8; tmp2 >>= 8; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp >>= 8; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp >>= 8; tmp2 >>= 8; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU8) { uint8_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp >>= 8; FLIP16(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp+=32768; tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp+=32768; tmp >>= 8; FLIP16(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp >>= 8; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp+=32768; tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp+=32768; tmp >>= 8; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp >>= 8; tmp2+=32768; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp >>= 8; tmp2+=32768; tmp2 >>= 8; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp+=32768; tmp >>= 8; tmp2+=32768; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp+=32768; tmp >>= 8; tmp2+=32768; tmp2 >>= 8; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp >>= 8; tmp2+=32768; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp >>= 8; tmp2+=32768; tmp2 >>= 8; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp+=32768; tmp >>= 8; tmp2+=32768; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp+=32768; tmp >>= 8; tmp2+=32768; tmp2 >>= 8; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS16) { int16_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); FLIP16(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU16) { uint16_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; FLIP16(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp+=32768; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp+=32768; FLIP16(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp+=32768; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp+=32768; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp2+=32768; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp2+=32768; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp+=32768; tmp2+=32768; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp+=32768; tmp2+=32768; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp2+=32768; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp2+=32768; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp+=32768; tmp2+=32768; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp+=32768; tmp2+=32768; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS32S16) { int32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 0; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 0; FLIP16(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp <<= 0; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp <<= 0; FLIP16(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 0; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 0; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp <<= 0; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp <<= 0; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 0; tmp2 <<= 0; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 0; tmp2 <<= 0; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp <<= 0; tmp2 <<= 0; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp <<= 0; tmp2 <<= 0; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 0; tmp2 <<= 0; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 0; tmp2 <<= 0; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp <<= 0; tmp2 <<= 0; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp <<= 0; tmp2 <<= 0; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU32U16) { uint32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp <<= 0; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp <<= 0; FLIP16(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp+=32768; tmp <<= 0; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp+=32768; tmp <<= 0; FLIP16(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp <<= 0; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp <<= 0; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp+=32768; tmp <<= 0; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp+=32768; tmp <<= 0; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp <<= 0; tmp2+=32768; tmp2 <<= 0; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp <<= 0; tmp2+=32768; tmp2 <<= 0; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp+=32768; tmp <<= 0; tmp2+=32768; tmp2 <<= 0; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp+=32768; tmp <<= 0; tmp2+=32768; tmp2 <<= 0; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp <<= 0; tmp2+=32768; tmp2 <<= 0; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp <<= 0; tmp2+=32768; tmp2 <<= 0; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp+=32768; tmp <<= 0; tmp2+=32768; tmp2 <<= 0; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp+=32768; tmp <<= 0; tmp2+=32768; tmp2 <<= 0; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS32S24) { int32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; FLIP16(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp <<= 8; FLIP16(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp <<= 8; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp <<= 8; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp <<= 8; tmp2 <<= 8; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp <<= 8; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp <<= 8; tmp2 <<= 8; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU32U24) { uint32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp <<= 8; FLIP16(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp+=32768; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp+=32768; tmp <<= 8; FLIP16(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp <<= 8; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp+=32768; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp+=32768; tmp <<= 8; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp <<= 8; tmp2+=32768; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp <<= 8; tmp2+=32768; tmp2 <<= 8; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp+=32768; tmp <<= 8; tmp2+=32768; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp+=32768; tmp <<= 8; tmp2+=32768; tmp2 <<= 8; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp <<= 8; tmp2+=32768; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp <<= 8; tmp2+=32768; tmp2 <<= 8; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp+=32768; tmp <<= 8; tmp2+=32768; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp+=32768; tmp <<= 8; tmp2+=32768; tmp2 <<= 8; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } } if(srcformat->sampformat == SEXYAL_FMT_PCMU16) { uint16_t* src=vsrc; if(destformat->sampformat == SEXYAL_FMT_PCMS8) { int8_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp >>= 8; FLIP16(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp-=32768; tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp-=32768; tmp >>= 8; FLIP16(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp >>= 8; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp-=32768; tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp-=32768; tmp >>= 8; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp >>= 8; tmp2-=32768; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp >>= 8; tmp2-=32768; tmp2 >>= 8; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp-=32768; tmp >>= 8; tmp2-=32768; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp-=32768; tmp >>= 8; tmp2-=32768; tmp2 >>= 8; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp >>= 8; tmp2-=32768; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp >>= 8; tmp2-=32768; tmp2 >>= 8; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp-=32768; tmp >>= 8; tmp2-=32768; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp-=32768; tmp >>= 8; tmp2-=32768; tmp2 >>= 8; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU8) { uint8_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; FLIP16(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp >>= 8; FLIP16(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp >>= 8; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp >>= 8; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp >>= 8; tmp2 >>= 8; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp >>= 8; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp >>= 8; tmp2 >>= 8; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS16) { int16_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; FLIP16(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp-=32768; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp-=32768; FLIP16(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp-=32768; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp-=32768; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp2-=32768; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp2-=32768; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp-=32768; tmp2-=32768; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp-=32768; tmp2-=32768; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp2-=32768; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp2-=32768; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp-=32768; tmp2-=32768; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp-=32768; tmp2-=32768; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU16) { uint16_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); FLIP16(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS32S16) { int32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp <<= 0; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp <<= 0; FLIP16(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp-=32768; tmp <<= 0; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp-=32768; tmp <<= 0; FLIP16(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp <<= 0; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp <<= 0; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp-=32768; tmp <<= 0; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp-=32768; tmp <<= 0; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp <<= 0; tmp2-=32768; tmp2 <<= 0; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp <<= 0; tmp2-=32768; tmp2 <<= 0; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp-=32768; tmp <<= 0; tmp2-=32768; tmp2 <<= 0; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp-=32768; tmp <<= 0; tmp2-=32768; tmp2 <<= 0; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp <<= 0; tmp2-=32768; tmp2 <<= 0; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp <<= 0; tmp2-=32768; tmp2 <<= 0; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp-=32768; tmp <<= 0; tmp2-=32768; tmp2 <<= 0; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp-=32768; tmp <<= 0; tmp2-=32768; tmp2 <<= 0; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU32U16) { uint32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 0; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 0; FLIP16(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp <<= 0; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp <<= 0; FLIP16(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 0; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 0; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp <<= 0; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp <<= 0; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 0; tmp2 <<= 0; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 0; tmp2 <<= 0; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp <<= 0; tmp2 <<= 0; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp <<= 0; tmp2 <<= 0; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 0; tmp2 <<= 0; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 0; tmp2 <<= 0; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp <<= 0; tmp2 <<= 0; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp <<= 0; tmp2 <<= 0; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS32S24) { int32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp <<= 8; FLIP16(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp-=32768; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp-=32768; tmp <<= 8; FLIP16(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp <<= 8; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp-=32768; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp-=32768; tmp <<= 8; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp <<= 8; tmp2-=32768; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp <<= 8; tmp2-=32768; tmp2 <<= 8; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp-=32768; tmp <<= 8; tmp2-=32768; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp-=32768; tmp <<= 8; tmp2-=32768; tmp2 <<= 8; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp <<= 8; tmp2-=32768; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp <<= 8; tmp2-=32768; tmp2 <<= 8; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp-=32768; tmp <<= 8; tmp2-=32768; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp-=32768; tmp <<= 8; tmp2-=32768; tmp2 <<= 8; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU32U24) { uint32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; FLIP16(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp <<= 8; FLIP16(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); tmp <<= 8; FLIP16(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp <<= 8; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp <<= 8; tmp2 <<= 8; FLIP16(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp <<= 8; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP16(tmp); int32_t tmp2=*src; src++; FLIP16(tmp2); tmp <<= 8; tmp2 <<= 8; FLIP16(tmp); FLIP16(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } } if(srcformat->sampformat == SEXYAL_FMT_PCMS32S16) { int32_t* src=vsrc; if(destformat->sampformat == SEXYAL_FMT_PCMS8) { int8_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU8) { uint8_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=32768; tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=32768; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=32768; tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=32768; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp >>= 8; tmp2+=32768; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp >>= 8; tmp2+=32768; tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=32768; tmp >>= 8; tmp2+=32768; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=32768; tmp >>= 8; tmp2+=32768; tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp >>= 8; tmp2+=32768; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp >>= 8; tmp2+=32768; tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=32768; tmp >>= 8; tmp2+=32768; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=32768; tmp >>= 8; tmp2+=32768; tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS16) { int16_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 0; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 0; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 0; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 0; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 0; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 0; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 0; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 0; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 0; tmp2 <<= 0; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 0; tmp2 <<= 0; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 0; tmp2 <<= 0; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 0; tmp2 <<= 0; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 0; tmp2 <<= 0; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 0; tmp2 <<= 0; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 0; tmp2 <<= 0; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 0; tmp2 <<= 0; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU16) { uint16_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp <<= 0; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp <<= 0; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=32768; tmp <<= 0; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=32768; tmp <<= 0; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp <<= 0; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp <<= 0; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=32768; tmp <<= 0; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=32768; tmp <<= 0; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp <<= 0; tmp2+=32768; tmp2 <<= 0; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp <<= 0; tmp2+=32768; tmp2 <<= 0; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=32768; tmp <<= 0; tmp2+=32768; tmp2 <<= 0; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=32768; tmp <<= 0; tmp2+=32768; tmp2 <<= 0; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp <<= 0; tmp2+=32768; tmp2 <<= 0; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp <<= 0; tmp2+=32768; tmp2 <<= 0; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=32768; tmp <<= 0; tmp2+=32768; tmp2 <<= 0; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=32768; tmp <<= 0; tmp2+=32768; tmp2 <<= 0; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS32S16) { int32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU32U16) { uint32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=32768; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=32768; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=32768; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=32768; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp2+=32768; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp2+=32768; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=32768; tmp2+=32768; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=32768; tmp2+=32768; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp2+=32768; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp2+=32768; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=32768; tmp2+=32768; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=32768; tmp2+=32768; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS32S24) { int32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU32U24) { uint32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=32768; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=32768; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=32768; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=32768; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=32768; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp <<= 8; tmp2+=32768; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp <<= 8; tmp2+=32768; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=32768; tmp <<= 8; tmp2+=32768; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=32768; tmp <<= 8; tmp2+=32768; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp <<= 8; tmp2+=32768; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=32768; tmp <<= 8; tmp2+=32768; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=32768; tmp <<= 8; tmp2+=32768; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=32768; tmp <<= 8; tmp2+=32768; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } } if(srcformat->sampformat == SEXYAL_FMT_PCMU32U16) { uint32_t* src=vsrc; if(destformat->sampformat == SEXYAL_FMT_PCMS8) { int8_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=32768; tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=32768; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=32768; tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=32768; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp >>= 8; tmp2-=32768; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp >>= 8; tmp2-=32768; tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=32768; tmp >>= 8; tmp2-=32768; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=32768; tmp >>= 8; tmp2-=32768; tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp >>= 8; tmp2-=32768; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp >>= 8; tmp2-=32768; tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=32768; tmp >>= 8; tmp2-=32768; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=32768; tmp >>= 8; tmp2-=32768; tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU8) { uint8_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS16) { int16_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp <<= 0; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp <<= 0; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=32768; tmp <<= 0; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=32768; tmp <<= 0; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp <<= 0; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp <<= 0; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=32768; tmp <<= 0; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=32768; tmp <<= 0; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp <<= 0; tmp2-=32768; tmp2 <<= 0; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp <<= 0; tmp2-=32768; tmp2 <<= 0; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=32768; tmp <<= 0; tmp2-=32768; tmp2 <<= 0; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=32768; tmp <<= 0; tmp2-=32768; tmp2 <<= 0; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp <<= 0; tmp2-=32768; tmp2 <<= 0; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp <<= 0; tmp2-=32768; tmp2 <<= 0; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=32768; tmp <<= 0; tmp2-=32768; tmp2 <<= 0; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=32768; tmp <<= 0; tmp2-=32768; tmp2 <<= 0; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU16) { uint16_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 0; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 0; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 0; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 0; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 0; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 0; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 0; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 0; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 0; tmp2 <<= 0; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 0; tmp2 <<= 0; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 0; tmp2 <<= 0; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 0; tmp2 <<= 0; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 0; tmp2 <<= 0; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 0; tmp2 <<= 0; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 0; tmp2 <<= 0; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 0; tmp2 <<= 0; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS32S16) { int32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=32768; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=32768; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=32768; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=32768; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp2-=32768; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp2-=32768; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=32768; tmp2-=32768; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=32768; tmp2-=32768; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp2-=32768; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp2-=32768; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=32768; tmp2-=32768; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=32768; tmp2-=32768; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU32U16) { uint32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS32S24) { int32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=32768; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=32768; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=32768; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=32768; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=32768; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp <<= 8; tmp2-=32768; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp <<= 8; tmp2-=32768; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=32768; tmp <<= 8; tmp2-=32768; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=32768; tmp <<= 8; tmp2-=32768; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp <<= 8; tmp2-=32768; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=32768; tmp <<= 8; tmp2-=32768; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=32768; tmp <<= 8; tmp2-=32768; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=32768; tmp <<= 8; tmp2-=32768; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU32U24) { uint32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp <<= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp <<= 8; tmp2 <<= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } } if(srcformat->sampformat == SEXYAL_FMT_PCMS32S24) { int32_t* src=vsrc; if(destformat->sampformat == SEXYAL_FMT_PCMS8) { int8_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 16; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 16; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 16; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 16; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 16; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 16; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 16; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 16; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 16; tmp2 >>= 16; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 16; tmp2 >>= 16; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 16; tmp2 >>= 16; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 16; tmp2 >>= 16; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 16; tmp2 >>= 16; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 16; tmp2 >>= 16; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 16; tmp2 >>= 16; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 16; tmp2 >>= 16; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU8) { uint8_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=(1<<23); tmp >>= 16; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=(1<<23); tmp >>= 16; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=(1<<23); tmp >>= 16; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=(1<<23); tmp >>= 16; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=(1<<23); tmp >>= 16; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=(1<<23); tmp >>= 16; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=(1<<23); tmp >>= 16; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=(1<<23); tmp >>= 16; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=(1<<23); tmp >>= 16; tmp2+=(1<<23); tmp2 >>= 16; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=(1<<23); tmp >>= 16; tmp2+=(1<<23); tmp2 >>= 16; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=(1<<23); tmp >>= 16; tmp2+=(1<<23); tmp2 >>= 16; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=(1<<23); tmp >>= 16; tmp2+=(1<<23); tmp2 >>= 16; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=(1<<23); tmp >>= 16; tmp2+=(1<<23); tmp2 >>= 16; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=(1<<23); tmp >>= 16; tmp2+=(1<<23); tmp2 >>= 16; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=(1<<23); tmp >>= 16; tmp2+=(1<<23); tmp2 >>= 16; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=(1<<23); tmp >>= 16; tmp2+=(1<<23); tmp2 >>= 16; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS16) { int16_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU16) { uint16_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=(1<<23); tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=(1<<23); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=(1<<23); tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=(1<<23); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=(1<<23); tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=(1<<23); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=(1<<23); tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=(1<<23); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=(1<<23); tmp >>= 8; tmp2+=(1<<23); tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=(1<<23); tmp >>= 8; tmp2+=(1<<23); tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=(1<<23); tmp >>= 8; tmp2+=(1<<23); tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=(1<<23); tmp >>= 8; tmp2+=(1<<23); tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=(1<<23); tmp >>= 8; tmp2+=(1<<23); tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=(1<<23); tmp >>= 8; tmp2+=(1<<23); tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=(1<<23); tmp >>= 8; tmp2+=(1<<23); tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=(1<<23); tmp >>= 8; tmp2+=(1<<23); tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS32S16) { int32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU32U16) { uint32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=(1<<23); tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=(1<<23); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=(1<<23); tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=(1<<23); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=(1<<23); tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=(1<<23); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=(1<<23); tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=(1<<23); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=(1<<23); tmp >>= 8; tmp2+=(1<<23); tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=(1<<23); tmp >>= 8; tmp2+=(1<<23); tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=(1<<23); tmp >>= 8; tmp2+=(1<<23); tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=(1<<23); tmp >>= 8; tmp2+=(1<<23); tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=(1<<23); tmp >>= 8; tmp2+=(1<<23); tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=(1<<23); tmp >>= 8; tmp2+=(1<<23); tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=(1<<23); tmp >>= 8; tmp2+=(1<<23); tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=(1<<23); tmp >>= 8; tmp2+=(1<<23); tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS32S24) { int32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU32U24) { uint32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=(1<<23); *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=(1<<23); FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=(1<<23); *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=(1<<23); FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp+=(1<<23); *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp+=(1<<23); FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=(1<<23); *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp+=(1<<23); FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=(1<<23); tmp2+=(1<<23); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=(1<<23); tmp2+=(1<<23); FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=(1<<23); tmp2+=(1<<23); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=(1<<23); tmp2+=(1<<23); FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=(1<<23); tmp2+=(1<<23); *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp+=(1<<23); tmp2+=(1<<23); FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=(1<<23); tmp2+=(1<<23); *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp+=(1<<23); tmp2+=(1<<23); FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } } if(srcformat->sampformat == SEXYAL_FMT_PCMU32U24) { uint32_t* src=vsrc; if(destformat->sampformat == SEXYAL_FMT_PCMS8) { int8_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=(1<<23); tmp >>= 16; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=(1<<23); tmp >>= 16; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=(1<<23); tmp >>= 16; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=(1<<23); tmp >>= 16; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=(1<<23); tmp >>= 16; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=(1<<23); tmp >>= 16; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=(1<<23); tmp >>= 16; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=(1<<23); tmp >>= 16; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=(1<<23); tmp >>= 16; tmp2-=(1<<23); tmp2 >>= 16; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=(1<<23); tmp >>= 16; tmp2-=(1<<23); tmp2 >>= 16; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=(1<<23); tmp >>= 16; tmp2-=(1<<23); tmp2 >>= 16; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=(1<<23); tmp >>= 16; tmp2-=(1<<23); tmp2 >>= 16; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=(1<<23); tmp >>= 16; tmp2-=(1<<23); tmp2 >>= 16; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=(1<<23); tmp >>= 16; tmp2-=(1<<23); tmp2 >>= 16; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=(1<<23); tmp >>= 16; tmp2-=(1<<23); tmp2 >>= 16; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=(1<<23); tmp >>= 16; tmp2-=(1<<23); tmp2 >>= 16; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU8) { uint8_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 16; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 16; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 16; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 16; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 16; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 16; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 16; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 16; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 16; tmp2 >>= 16; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 16; tmp2 >>= 16; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 16; tmp2 >>= 16; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 16; tmp2 >>= 16; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 16; tmp2 >>= 16; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 16; tmp2 >>= 16; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 16; tmp2 >>= 16; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 16; tmp2 >>= 16; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS16) { int16_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=(1<<23); tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=(1<<23); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=(1<<23); tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=(1<<23); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=(1<<23); tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=(1<<23); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=(1<<23); tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=(1<<23); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=(1<<23); tmp >>= 8; tmp2-=(1<<23); tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=(1<<23); tmp >>= 8; tmp2-=(1<<23); tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=(1<<23); tmp >>= 8; tmp2-=(1<<23); tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=(1<<23); tmp >>= 8; tmp2-=(1<<23); tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=(1<<23); tmp >>= 8; tmp2-=(1<<23); tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=(1<<23); tmp >>= 8; tmp2-=(1<<23); tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=(1<<23); tmp >>= 8; tmp2-=(1<<23); tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=(1<<23); tmp >>= 8; tmp2-=(1<<23); tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU16) { uint16_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS32S16) { int32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=(1<<23); tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=(1<<23); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=(1<<23); tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=(1<<23); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=(1<<23); tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=(1<<23); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=(1<<23); tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=(1<<23); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=(1<<23); tmp >>= 8; tmp2-=(1<<23); tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=(1<<23); tmp >>= 8; tmp2-=(1<<23); tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=(1<<23); tmp >>= 8; tmp2-=(1<<23); tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=(1<<23); tmp >>= 8; tmp2-=(1<<23); tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=(1<<23); tmp >>= 8; tmp2-=(1<<23); tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=(1<<23); tmp >>= 8; tmp2-=(1<<23); tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=(1<<23); tmp >>= 8; tmp2-=(1<<23); tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=(1<<23); tmp >>= 8; tmp2-=(1<<23); tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU32U16) { uint32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp >>= 8; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp >>= 8; tmp2 >>= 8; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMS32S24) { int32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=(1<<23); *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=(1<<23); FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=(1<<23); *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=(1<<23); FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; tmp-=(1<<23); *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; tmp-=(1<<23); FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=(1<<23); *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); tmp-=(1<<23); FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=(1<<23); tmp2-=(1<<23); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=(1<<23); tmp2-=(1<<23); FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=(1<<23); tmp2-=(1<<23); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=(1<<23); tmp2-=(1<<23); FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=(1<<23); tmp2-=(1<<23); *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp-=(1<<23); tmp2-=(1<<23); FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=(1<<23); tmp2-=(1<<23); *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp-=(1<<23); tmp2-=(1<<23); FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } if(destformat->sampformat == SEXYAL_FMT_PCMU32U24) { uint32_t* dest=vdest; if(srcformat->channels == 1) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); FLIP32(tmp); *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); FLIP32(tmp); *dest=tmp; dest++; *dest=tmp; dest++; } } } } } if(srcformat->channels == 2) { if(destformat->channels == 1) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); FLIP32(tmp); tmp = (tmp+tmp2)>>1; *dest=tmp; dest++; } } } } if(destformat->channels == 2) { if(srcformat->byteorder == 0) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; int32_t tmp2=*src; src++; FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } if(srcformat->byteorder == 1) { if(destformat->byteorder == 0) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } if(destformat->byteorder == 1) { while(frames--) { int32_t tmp=*src; src++; FLIP32(tmp); int32_t tmp2=*src; src++; FLIP32(tmp2); FLIP32(tmp); FLIP32(tmp2); *dest=tmp; dest++; *dest=tmp2; dest++; } } } } } } } } fceu-0.98.12/src/drivers/sexyal/convert.h0000644000175000000620000000016610047320025020111 0ustar joestaff00000000000000void SexiALI_Convert(SexyAL_format *srcformat, SexyAL_format *destformat, void *vdest, void *vsrc, uint32_t frames); fceu-0.98.12/src/drivers/pc/0002755000175000000620000000000010111545623015361 5ustar joestaff00000000000000fceu-0.98.12/src/drivers/pc/dface.h0000644000175000000620000000276210110501151016564 0ustar joestaff00000000000000#ifdef __cplusplus extern "C" { #endif #include "../common/args.h" #include "../common/config.h" #include "input.h" extern FCEUGI *CurGame; extern CFGSTRUCT DriverConfig[]; extern ARGPSTRUCT DriverArgs[]; extern char *DriverUsage; void DoDriverArgs(void); uint8 *GetBaseDirectory(void); int InitSound(FCEUGI *gi); void WriteSound(int32 *Buffer, int Count); int KillSound(void); uint32 GetMaxSound(void); uint32 GetWriteSound(void); void SilenceSound(int s); /* DOS and SDL */ int InitMouse(void); void KillMouse(void); void GetMouseData(uint32 *MouseData); int InitJoysticks(void); int KillJoysticks(void); uint32 *GetJSOr(void); int InitKeyboard(void); int UpdateKeyboard(void); char *GetKeyboard(void); void KillKeyboard(void); int InitVideo(FCEUGI *gi); int KillVideo(void); void BlitScreen(uint8 *XBuf); void LockConsole(void); void UnlockConsole(void); void ToggleFS(); /* SDL */ int LoadGame(const char *path); int CloseGame(void); int GUI_Init(int argc, char **argv, int (*dofunc)(void)); int GUI_Idle(void); int GUI_Update(void); void GUI_Hide(int); void GUI_RequestExit(void); int GUI_SetVideo(int fullscreen, int width, int height); char *GUI_GetKeyboard(void); void GUI_GetMouseState(uint32 *b, int *x, int *y); void UpdatePhysicalInput(void); int DTestButton(ButtConfig *bc); int DWaitButton(const uint8 *text, ButtConfig *bc, int wb); int ButtonConfigBegin(void); void ButtonConfigEnd(void); void Giggles(int); void DoFun(void); int FCEUD_NetworkConnect(void); #ifdef __cplusplus } #endif fceu-0.98.12/src/drivers/pc/input.c0000644000175000000620000003644710110501101016656 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "main.h" #include "dface.h" #include "input.h" #include "../common/cheat.h" /* UsrInputType[] is user-specified. InputType[] is current (game loading can override user settings) */ int UsrInputType[3]={SI_GAMEPAD,SI_GAMEPAD,SIFC_NONE}; int InputType[3]; static int cspec; int gametype; /* Necessary for proper GUI functioning(configuring when a game isn't loaded). */ void InputUserActiveFix(void) { int x; for(x=0;x<3;x++) InputType[x]=UsrInputType[x]; } void ParseGIInput(FCEUGI *gi) { gametype=gi->type; InputType[0]=UsrInputType[0]; InputType[1]=UsrInputType[1]; InputType[2]=UsrInputType[2]; if(gi->input[0]>=0) InputType[0]=gi->input[0]; if(gi->input[1]>=0) InputType[1]=gi->input[1]; if(gi->inputfc>=0) InputType[2]=gi->inputfc; cspec = gi->cspecial; #ifdef EXTGUI Giggles(gi->cspecial); #endif } static uint8 QuizKingData; static uint8 HyperShotData; static uint32 MahjongData; static uint32 FTrainerData; static uint8 TopRiderData; static uint8 BWorldData[1+13+1]; static void UpdateFKB(void); static void UpdateGamepad(void); static void UpdateQuizKing(void); static void UpdateHyperShot(void); static void UpdateMahjong(void); static void UpdateFTrainer(void); static void UpdateTopRider(void); static uint32 JSreturn; int NoWaiting=1; #ifndef EXTGUI static void DoCheatSeq(void) { #if defined(DOS) || defined(SDL) SilenceSound(1); #endif KillKeyboard(); KillVideo(); DoConsoleCheatConfig(); InitVideo(CurGame); InitKeyboard(); #if defined(DOS) || defined(SDL) SilenceSound(0); #endif } #endif #include "keyscan.h" static char *keys; static int DIPS=0; static uint8 keyonce[MKK_COUNT]; #define KEY(__a) keys[MKK(__a)] static int _keyonly(int a) { if(keys[a]) { if(!keyonce[a]) { keyonce[a]=1; return(1); } } else keyonce[a]=0; return(0); } #define keyonly(__a) _keyonly(MKK(__a)) static int cidisabled=0; static void KeyboardCommands(void) { int is_shift, is_alt; keys=GetKeyboard(); if(InputType[2]==SIFC_FKB) { if(keyonly(SCROLLLOCK)) { cidisabled^=1; FCEUI_DispMessage("Family Keyboard %sabled.",cidisabled?"en":"dis"); } #ifdef SDL SDL_WM_GrabInput(cidisabled?SDL_GRAB_ON:SDL_GRAB_OFF); #endif if(cidisabled) return; } is_shift = KEY(LEFTSHIFT) | KEY(RIGHTSHIFT); is_alt = KEY(LEFTALT) | KEY(RIGHTALT); if(keyonly(F4)) { if(is_shift) FCEUI_SetRenderDisable(-1, 2); else FCEUI_SetRenderDisable(2, -1); } #ifdef SDL if(keyonly(ENTER) && is_alt) ToggleFS(); #endif NoWaiting&=~1; if(KEY(GRAVE)) NoWaiting|=1; if(gametype==GIT_FDS) { if(keyonly(F6)) FCEUI_FDSSelect(); if(keyonly(F8)) FCEUI_FDSInsert(0); } if(keyonly(F9)) FCEUI_SaveSnapshot(); if(gametype!=GIT_NSF) { #ifndef EXTGUI if(keyonly(F2)) DoCheatSeq(); #endif if(keyonly(F5)) { if(is_shift) FCEUI_SaveMovie(NULL); else FCEUI_SaveState(NULL); } if(keyonly(F7)) { if(is_shift) FCEUI_LoadMovie(NULL); else FCEUI_LoadState(NULL); } } if(keyonly(F1)) FCEUI_ToggleTileView(); if(keyonly(F10)) FCEUI_ResetNES(); if(keyonly(F11)) FCEUI_PowerNES(); #ifdef EXTGUI if(keyonly(F3)) GUI_Hide(-1); if(KEY(F12)) GUI_RequestExit(); if(KEY(ESCAPE)) CloseGame(); #else if(KEY(F12) || KEY(ESCAPE)) CloseGame(); #endif if(gametype==GIT_VSUNI) { if(keyonly(F8)) FCEUI_VSUniCoin(); if(keyonly(F6)) { DIPS^=1; FCEUI_VSUniToggleDIPView(); } if(!(DIPS&1)) goto DIPSless; if(keyonly(1)) FCEUI_VSUniToggleDIP(0); if(keyonly(2)) FCEUI_VSUniToggleDIP(1); if(keyonly(3)) FCEUI_VSUniToggleDIP(2); if(keyonly(4)) FCEUI_VSUniToggleDIP(3); if(keyonly(5)) FCEUI_VSUniToggleDIP(4); if(keyonly(6)) FCEUI_VSUniToggleDIP(5); if(keyonly(7)) FCEUI_VSUniToggleDIP(6); if(keyonly(8)) FCEUI_VSUniToggleDIP(7); } else { static uint8 bbuf[32]; static int bbuft; static int barcoder = 0; if(keyonly(H)) FCEUI_NTSCSELHUE(); if(keyonly(T)) FCEUI_NTSCSELTINT(); if(KEY(KP_MINUS) || KEY(MINUS)) FCEUI_NTSCDEC(); if(KEY(KP_PLUS) || KEY(EQUAL)) FCEUI_NTSCINC(); if((InputType[2] == SIFC_BWORLD) || (cspec == SIS_DATACH)) { if(keyonly(F8)) { barcoder ^= 1; if(!barcoder) { if(InputType[2] == SIFC_BWORLD) { strcpy(&BWorldData[1],bbuf); BWorldData[0]=1; } else FCEUI_DatachSet(bbuf); FCEUI_DispMessage("Barcode Entered"); } else { bbuft = 0; FCEUI_DispMessage("Enter Barcode");} } } else barcoder = 0; #define SSM(x) \ { if(barcoder) { if(bbuft < 13) {bbuf[bbuft++] = '0' + x; bbuf[bbuft] = 0;} FCEUI_DispMessage("Barcode: %s",bbuf);} \ else { \ if(is_shift) FCEUI_SelectMovie(x); \ else FCEUI_SelectState(x); \ } } DIPSless: if(keyonly(0)) SSM(0); if(keyonly(1)) SSM(1); if(keyonly(2)) SSM(2); if(keyonly(3)) SSM(3); if(keyonly(4)) SSM(4); if(keyonly(5)) SSM(5); if(keyonly(6)) SSM(6); if(keyonly(7)) SSM(7); if(keyonly(8)) SSM(8); if(keyonly(9)) SSM(9); #undef SSM } } #define MK(x) {{BUTTC_KEYBOARD},{0},{MKK(x)},1} #define MK2(x1,x2) {{BUTTC_KEYBOARD},{0},{MKK(x1),MKK(x2)},2} #define MKZ() {{0},{0},{0},0} #define GPZ() {MKZ(), MKZ(), MKZ(), MKZ()} ButtConfig GamePadConfig[4][10]={ /* Gamepad 1 */ { MK(KP3), MK(KP2), MK(TAB), MK(ENTER), MK(W),MK(Z), MK(A), MK(S), MKZ(), MKZ() }, /* Gamepad 2 */ GPZ(), /* Gamepad 3 */ GPZ(), /* Gamepad 4 */ GPZ() }; static void UpdateGamepad(void) { static int rapid=0; uint32 JS=0; int x; int wg; rapid^=1; for(wg=0;wg<4;wg++) { for(x=0;x<8;x++) if(DTestButton(&GamePadConfig[wg][x])) JS|=(1<ButtType[wc]==bc->ButtType[wc-1] && bc->DeviceNum[wc]==bc->DeviceNum[wc-1] && bc->ButtonNum[wc]==bc->ButtonNum[wc-1]) break; } bc->NumC=wc; } void ConfigDevice(int which, int arg) { uint8 buf[256]; int x; ButtonConfigBegin(); switch(which) { case FCFGD_QUIZKING: for(x=0;x<6;x++) { sprintf(buf,"Quiz King Buzzer #%d", x+1); subcon(buf,&QuizKingButtons[x]); } break; case FCFGD_HYPERSHOT: for(x=0;x<4;x++) { sprintf(buf,"Hyper Shot %d: %s",((x&2)>>1)+1,(x&1)?"JUMP":"RUN"); subcon(buf,&HyperShotButtons[x]); } break; case FCFGD_POWERPAD: for(x=0;x<12;x++) { sprintf(buf,"PowerPad %d: %d", (arg&1)+1,x+11); subcon(buf,&powerpadsc[arg&1][x]); } break; case FCFGD_GAMEPAD: { char *str[10]={"A","B","SELECT","START","UP","DOWN","LEFT","RIGHT","Rapid A","Rapid B"}; for(x=0;x<10;x++) { sprintf(buf,"GamePad #%d: %s",arg+1,str[x]); subcon(buf,&GamePadConfig[arg][x]); } } break; } ButtonConfigEnd(); } CFGSTRUCT InputConfig[]={ ACA(UsrInputType), AC(powerpadsc), AC(QuizKingButtons), AC(FTrainerButtons), AC(HyperShotButtons), AC(MahjongButtons), AC(GamePadConfig), AC(fkbmap), ENDCFGSTRUCT }; static void InputCfg(char *text) { if(!strncasecmp(text,"gamepad",strlen("gamepad"))) { ConfigDevice(FCFGD_GAMEPAD,(text[strlen("gamepad")]-'1')&3); } else if(!strncasecmp(text,"powerpad",strlen("powerpad"))) { ConfigDevice(FCFGD_POWERPAD,(text[strlen("powerpad")]-'1')&1); } else if(!strcasecmp(text,"hypershot")) ConfigDevice(FCFGD_HYPERSHOT,0); else if(!strcasecmp(text,"quizking")) ConfigDevice(FCFGD_QUIZKING,0); } static void FCExp(char *text) { static char *fccortab[11]={"none","arkanoid","shadow","4player","fkb","hypershot", "mahjong","quizking","ftrainera","ftrainerb","oekakids"}; static int fccortabi[11]={SIFC_NONE,SIFC_ARKANOID,SIFC_SHADOW, SIFC_4PLAYER,SIFC_FKB,SIFC_HYPERSHOT,SIFC_MAHJONG,SIFC_QUIZKING, SIFC_FTRAINERA,SIFC_FTRAINERB,SIFC_OEKAKIDS}; int y; for(y=0;y<11;y++) if(!strcmp(fccortab[y],text)) UsrInputType[2]=fccortabi[y]; } static char *cortab[6]={"none","gamepad","zapper","powerpada","powerpadb","arkanoid"}; static int cortabi[6]={SI_NONE,SI_GAMEPAD, SI_ZAPPER,SI_POWERPADA,SI_POWERPADB,SI_ARKANOID}; static void Input1(char *text) { int y; for(y=0;y<6;y++) if(!strcmp(cortab[y],text)) UsrInputType[0]=cortabi[y]; } static void Input2(char *text) { int y; for(y=0;y<6;y++) if(!strcmp(cortab[y],text)) UsrInputType[1]=cortabi[y]; } ARGPSTRUCT InputArgs[]={ {"-inputcfg",0,(void *)InputCfg,0x2000}, {"-fcexp",0,(void *)FCExp,0x2000}, {"-input1",0,(void *)Input1,0x2000}, {"-input2",0,(void *)Input2,0x2000}, {0,0,0,0} }; fceu-0.98.12/src/drivers/pc/main.c0000644000175000000620000002560010110500754016445 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 #include #include #include #include #include #include #include #include "main.h" #include "throttle.h" #include "../common/cheat.h" #include "input.h" #include "dface.h" int CloseGame(void); static char *soundrecfn=0; /* File name of sound recording. */ static int ntsccol=0,ntschue=0,ntsctint=0; int soundvol=100; long soundq=0; int _sound=1; long soundrate=48000; #ifdef WIN32 long soundbufsize=52; #else long soundbufsize=24; #endif #ifdef FRAMESKIP static int frameskip=0; #endif static int inited=0; static int isloaded=0; // Is game loaded? int srendlinev[2]={8,0}; int erendlinev[2]={231,239}; static uint8 *DrBaseDirectory; int eoptions=0; static void DriverKill(void); static int DriverInitialize(FCEUGI *gi); int gametype; FCEUGI *CurGame=NULL; static void ParseGI(FCEUGI *gi) { ParseGIInput(gi); gametype=gi->type; } #ifndef EXTGUI void FCEUD_PrintError(char *s) { puts(s); } void FCEUD_Message(char *s) { fputs(s,stdout); } #endif static char *cpalette=0; static void LoadCPalette(void) { uint8 tmpp[192]; FILE *fp; if(!(fp=fopen(cpalette,"rb"))) { printf(" Error loading custom palette from file: %s\n",cpalette); return; } fread(tmpp,1,192,fp); FCEUI_SetPaletteArray(tmpp); fclose(fp); } #ifdef EXTGUI extern CFGSTRUCT GUIConfig; #endif static CFGSTRUCT fceuconfig[]={ AC(soundrate), AC(soundq), AC(_sound), AC(soundvol), AC(soundbufsize), ACS(cpalette), AC(ntsctint), AC(ntschue), AC(ntsccol), AC(eoptions), ACA(srendlinev), ACA(erendlinev), ADDCFGSTRUCT(InputConfig), ADDCFGSTRUCT(DriverConfig), #ifdef EXTGUI ADDCFGSTRUCT(GUIConfig), #endif ENDCFGSTRUCT }; static void SaveConfig(void) { char tdir[2048]; sprintf(tdir,"%s"PSS"fceu98.cfg",DrBaseDirectory); FCEUI_GetNTSCTH(&ntsctint, &ntschue); SaveFCEUConfig(tdir,fceuconfig); } static void LoadConfig(void) { char tdir[2048]; sprintf(tdir,"%s"PSS"fceu98.cfg",DrBaseDirectory); FCEUI_GetNTSCTH(&ntsctint, &ntschue); /* Get default settings for if no config file exists. */ LoadFCEUConfig(tdir,fceuconfig); InputUserActiveFix(); } static void CreateDirs(void) { char *subs[6]={"fcs","fcm","snaps","gameinfo","sav","cheats"}; char tdir[2048]; int x; #ifdef WIN32 mkdir(DrBaseDirectory); for(x=0;x<5;x++) { sprintf(tdir,"%s"PSS"%s",DrBaseDirectory,subs[x]); mkdir(tdir); } #else mkdir(DrBaseDirectory,S_IRWXU); for(x=0;x<5;x++) { sprintf(tdir,"%s"PSS"%s",DrBaseDirectory,subs[x]); mkdir(tdir,S_IRWXU); } #endif } #ifndef WIN32 static void SetSignals(void (*t)(int)) { int sigs[11]={SIGINT,SIGTERM,SIGHUP,SIGPIPE,SIGSEGV,SIGFPE,SIGKILL,SIGALRM,SIGABRT,SIGUSR1,SIGUSR2}; int x; for(x=0;x<11;x++) signal(sigs[x],t); } static void CloseStuff(int signum) { DriverKill(); printf("\nSignal %d has been caught and dealt with...\n",signum); switch(signum) { case SIGINT:printf("How DARE you interrupt me!\n");break; case SIGTERM:printf("MUST TERMINATE ALL HUMANS\n");break; case SIGHUP:printf("Reach out and hang-up on someone.\n");break; case SIGPIPE:printf("The pipe has broken! Better watch out for floods...\n");break; case SIGSEGV:printf("Iyeeeeeeeee!!! A segmentation fault has occurred. Have a fluffy day.\n");break; /* So much SIGBUS evil. */ #ifdef SIGBUS #if(SIGBUS!=SIGSEGV) case SIGBUS:printf("I told you to be nice to the driver.\n");break; #endif #endif case SIGFPE:printf("Those darn floating points. Ne'er know when they'll bite!\n");break; case SIGALRM:printf("Don't throw your clock at the meowing cats!\n");break; case SIGABRT:printf("Abort, Retry, Ignore, Fail?\n");break; case SIGUSR1: case SIGUSR2:printf("Killing your processes is not nice.\n");break; } exit(1); } #endif static void DoArgs(int argc, char *argv[]) { int x; static ARGPSTRUCT FCEUArgs[]={ {"-soundbufsize",0,&soundbufsize,0}, {"-soundrate",0,&soundrate,0}, {"-soundq",0,&soundq,0}, #ifdef FRAMESKIP {"-frameskip",0,&frameskip,0}, #endif {"-sound",0,&_sound,0}, {"-soundvol",0,&soundvol,0}, {"-cpalette",0,&cpalette,0x4001}, {"-soundrecord",0,&soundrecfn,0x4001}, {"-ntsccol",0,&ntsccol,0}, {"-pal",0,&eoptions,0x8000|EO_PAL}, {"-lowpass",0,&eoptions,0x8000|EO_LOWPASS}, {"-gg",0,&eoptions,0x8000|EO_GAMEGENIE}, {"-no8lim",0,&eoptions,0x8001}, {"-snapname",0,&eoptions,0x8000|EO_SNAPNAME}, {"-nofs",0,&eoptions,0x8000|EO_NOFOURSCORE}, {"-clipsides",0,&eoptions,0x8000|EO_CLIPSIDES}, {"-nothrottle",0,&eoptions,0x8000|EO_NOTHROTTLE}, {"-slstart",0,&srendlinev[0],0},{"-slend",0,&erendlinev[0],0}, {"-slstartp",0,&srendlinev[1],0},{"-slendp",0,&erendlinev[1],0}, {0,(int *)InputArgs,0,0}, {0,(int *)DriverArgs,0,0}, {0,0,0,0} }; ParseArguments(argc, argv, FCEUArgs); if(cpalette) { if(cpalette[0]=='0') if(cpalette[1]==0) { free(cpalette); cpalette=0; } } FCEUI_SetVidSystem((eoptions&EO_PAL)?1:0); FCEUI_SetGameGenie((eoptions&EO_GAMEGENIE)?1:0); FCEUI_SetLowPass((eoptions&EO_LOWPASS)?1:0); FCEUI_DisableSpriteLimitation(eoptions&1); FCEUI_SetSnapName(eoptions&EO_SNAPNAME); for(x=0;x<2;x++) { if(srendlinev[x]<0 || srendlinev[x]>239) srendlinev[x]=0; if(erendlinev[x]239) erendlinev[x]=239; } FCEUI_SetRenderedLines(srendlinev[0],erendlinev[0],srendlinev[1],erendlinev[1]); DoDriverArgs(); } #include "usage.h" /* Loads a game, given a full path/filename. The driver code must be initialized after the game is loaded, because the emulator code provides data necessary for the driver code(number of scanlines to render, what virtual input devices to use, etc.). */ int LoadGame(const char *path) { FCEUGI *tmp; CloseGame(); if(!(tmp=FCEUI_LoadGame(path))) return 0; CurGame=tmp; ParseGI(tmp); RefreshThrottleFPS(); if(!DriverInitialize(tmp)) return(0); if(soundrecfn) { if(!FCEUI_BeginWaveRecord(soundrecfn)) { free(soundrecfn); soundrecfn=0; } } isloaded=1; #ifdef EXTGUI if(eoptions&EO_AUTOHIDE) GUI_Hide(1); #endif FCEUD_NetworkConnect(); return 1; } /* Closes a game. Frees memory, and deinitializes the drivers. */ int CloseGame(void) { if(!isloaded) return(0); FCEUI_CloseGame(); DriverKill(); isloaded=0; CurGame=0; if(soundrecfn) FCEUI_EndWaveRecord(); #ifdef EXTGUI GUI_Hide(0); #endif InputUserActiveFix(); return(1); } void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count); void DoFun(void) { uint8 *gfx; int32 *sound; int32 ssize; static int fskipc=0; #ifdef FRAMESKIP fskipc=(fskipc+1)%(frameskip+1); #endif if(NoWaiting) {gfx=0;} FCEUI_Emulate(&gfx, &sound, &ssize, fskipc); FCEUD_Update(gfx, sound, ssize); } int CLImain(int argc, char *argv[]) { int ret; if(!(ret=FCEUI_Initialize())) return(0); DrBaseDirectory=GetBaseDirectory(); FCEUI_SetBaseDirectory(DrBaseDirectory); CreateDirs(); #ifdef EXTGUI if(argc==2 && !strcmp(argv[1],"-help")) // I hope no one has a game named "-help" :b #else if(argc<=1) #endif { ShowUsage(argv[0]); return(0); } LoadConfig(); DoArgs(argc-2,&argv[1]); FCEUI_SetNTSCTH(ntsccol, ntsctint, ntschue); if(cpalette) LoadCPalette(); /* All the config files and arguments are parsed now. */ #ifdef EXTGUI return(1); #else if(!LoadGame(argv[argc-1])) { DriverKill(); return(0); } while(CurGame) DoFun(); //CloseGame(); SaveConfig(); FCEUI_Kill(); #endif return(1); } static int DriverInitialize(FCEUGI *gi) { #ifndef WIN32 SetSignals(CloseStuff); #endif /* Initialize video before all else, due to some wacko dependencies in the SexyAL code(DirectSound) that need to be fixed. */ if(!InitVideo(gi)) return 0; inited|=4; if(InitSound(gi)) inited|=1; if(InitJoysticks()) inited|=2; if(!InitKeyboard()) return 0; inited|=8; InitOtherInput(); return 1; } static void DriverKill(void) { SaveConfig(); #ifndef WIN32 SetSignals(SIG_IGN); #endif if(inited&2) KillJoysticks(); if(inited&8) KillKeyboard(); if(inited&4) KillVideo(); if(inited&1) KillSound(); if(inited&16) KillMouse(); inited=0; } void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count) { #ifdef NETWORK extern int FCEUDnetplay; #endif //Count = 0; if(Count) { int32 can=GetWriteSound(); static int uflow=0; int32 tmpcan; if(can >= GetMaxSound()) uflow=1; /* Go into massive underflow mode. */ if(can > Count) can=Count; else uflow=0; WriteSound(Buffer,can); //if(uflow) puts("Underflow"); tmpcan = GetWriteSound(); if((tmpcan < Count*0.90) && !uflow) { if(XBuf && (inited&4) && !(NoWaiting & 2)) BlitScreen(XBuf); Buffer+=can; Count-=can; if(Count) { if(NoWaiting) { can=GetWriteSound(); if(Count>can) Count=can; } WriteSound(Buffer,Count); } } //else puts("Skipped"); #ifdef NETWORK else if(!NoWaiting && FCEUDnetplay && (uflow || tmpcan >= (Count * 1.8))) { if(Count > tmpcan) Count=tmpcan; while(tmpcan > 0) { // printf("Overwrite: %d\n", (Count <= tmpcan)?Count : tmpcan); WriteSound(Buffer, (Count <= tmpcan)?Count : tmpcan); tmpcan -= Count; } } #endif } else { if(!NoWaiting && !(eoptions&EO_NOTHROTTLE)) SpeedThrottle(); if(XBuf && (inited&4)) { BlitScreen(XBuf); } } FCEUD_UpdateInput(); //if(!Count && !NoWaiting && !(eoptions&EO_NOTHROTTLE)) // SpeedThrottle(); //if(XBuf && (inited&4)) //{ // BlitScreen(XBuf); //} //if(Count) // WriteSound(Buffer,Count,NoWaiting); //FCEUD_UpdateInput(); } /* Maybe ifndef WXWINDOWS would be better? ^_^ */ #ifndef EXTGUI FILE *FCEUD_UTF8fopen(const char *fn, const char *mode) { return(fopen(fn,mode)); } #endif fceu-0.98.12/src/drivers/pc/keyscan.h0000644000175000000620000000244510003562762017175 0ustar joestaff00000000000000#ifdef SDL #include #define SDLK_A SDLK_a #define SDLK_B SDLK_b #define SDLK_C SDLK_c #define SDLK_D SDLK_d #define SDLK_E SDLK_e #define SDLK_F SDLK_f #define SDLK_G SDLK_g #define SDLK_H SDLK_h #define SDLK_I SDLK_i #define SDLK_J SDLK_j #define SDLK_K SDLK_k #define SDLK_L SDLK_l #define SDLK_M SDLK_m #define SDLK_N SDLK_n #define SDLK_O SDLK_o #define SDLK_P SDLK_p #define SDLK_Q SDLK_q #define SDLK_R SDLK_r #define SDLK_S SDLK_s #define SDLK_T SDLK_t #define SDLK_U SDLK_u #define SDLK_V SDLK_v #define SDLK_W SDLK_w #define SDLK_X SDLK_x #define SDLK_Y SDLK_y #define SDLK_Z SDLK_z #define SDLK_LEFTCONTROL SDLK_LCTRL #define SDLK_RIGHTCONTROL SDLK_RCTRL #define SDLK_LEFTALT SDLK_LALT #define SDLK_RIGHTALT SDLK_RALT #define SDLK_LEFTSHIFT SDLK_LSHIFT #define SDLK_RIGHTSHIFT SDLK_RSHIFT #define SDLK_CURSORDOWN SDLK_DOWN #define SDLK_CURSORUP SDLK_UP #define SDLK_CURSORLEFT SDLK_LEFT #define SDLK_CURSORRIGHT SDLK_RIGHT #define SDLK_ENTER SDLK_RETURN #define SDLK_EQUAL SDLK_EQUALS #define SDLK_APOSTROPHE SDLK_QUOTE #define SDLK_BRACKET_LEFT SDLK_LEFTBRACKET #define SDLK_BRACKET_RIGHT SDLK_RIGHTBRACKET #define SDLK_SCROLLLOCK SDLK_SCROLLOCK /* I guess the SDL people don't like lots of Ls... */ #define SDLK_GRAVE SDLK_BACKQUOTE #define MKK(k) SDLK_##k #define MKK_COUNT (SDLK_LAST+1) #endif fceu-0.98.12/src/drivers/pc/sdl.c0000644000175000000620000001763510110501404016305 0ustar joestaff00000000000000#include #include #include #include "sdl.h" #include "sdl-video.h" #ifdef NETWORK #include "unix-netplay.h" #endif DSETTINGS Settings; CFGSTRUCT DriverConfig[]={ #ifdef OPENGL AC(_stretchx), AC(_stretchy), AC(_opengl), AC(_openglip), #endif AC(Settings.special), AC(Settings.specialfs), AC(_doublebuf), AC(_xscale), AC(_yscale), AC(_xscalefs), AC(_yscalefs), AC(_bpp), AC(_efx), AC(_efxfs), AC(_fullscreen), AC(_xres), AC(_yres), #ifdef NETWORK ACS(netplaynick), AC(netlocalplayers), AC(tport), ACS(netpassword), ACS(netgamekey), #endif ENDCFGSTRUCT }; //-fshack x Set the environment variable SDL_VIDEODRIVER to \"x\" when // entering full screen mode and x is not \"0\". char *DriverUsage= "-xres x Set horizontal resolution to x for full screen mode.\n\ -yres x Set vertical resolution to x for full screen mode.\n\ -xscale(fs) x Multiply width by x(Real numbers >0 with OpenGL, otherwise integers >0).\n\ -yscale(fs) x Multiply height by x(Real numbers >0 with OpenGL, otherwise integers >0).\n\ -bpp(fs) x Bits per pixel for SDL surface(and video mode in fs). 8, 16, 32.\n\ -opengl x Enable OpenGL support if x is 1.\n\ -openglip x Enable OpenGL linear interpolation if x is 1.\n\ -doublebuf x \n\ -special(fs) x Specify special scaling filter.\n\ -stretch(x/y) x Stretch to fill surface on x or y axis(fullscreen, only with OpenGL).\n\ -efx(fs) x Enable special effects. Logically OR the following together:\n\ 1 = scanlines(for yscale>=2).\n\ 2 = TV blur(for bpp of 16 or 32).\n\ -fs x Select full screen mode if x is non zero.\n\ -connect s Connect to server 's' for TCP/IP network play.\n\ -netnick s Set the nickname to use in network play.\n\ -netgamekey s Use key 's' to create a unique session for the game loaded.\n\ -netpassword s Password to use for connecting to the server.\n\ -netlocalplayers x Set the number of local players.\n\ -netport x Use TCP/IP port x for network play."; ARGPSTRUCT DriverArgs[]={ #ifdef OPENGL {"-opengl",0,&_opengl,0}, {"-openglip",0,&_openglip,0}, {"-stretchx",0,&_stretchx,0}, {"-stretchy",0,&_stretchy,0}, #endif {"-special",0,&Settings.special,0}, {"-specialfs",0,&Settings.specialfs,0}, {"-doublebuf",0,&_doublebuf,0}, {"-bpp",0,&_bpp,0}, {"-xscale",0,&_xscale,2}, {"-yscale",0,&_yscale,2}, {"-efx",0,&_efx,0}, {"-xscalefs",0,&_xscalefs,2}, {"-yscalefs",0,&_yscalefs,2}, {"-efxfs",0,&_efxfs,0}, {"-xres",0,&_xres,0}, {"-yres",0,&_yres,0}, {"-fs",0,&_fullscreen,0}, //{"-fshack",0,&_fshack,0x4001}, #ifdef NETWORK {"-connect",0,&netplayhost,0x4001}, {"-netport",0,&tport,0}, {"-netlocalplayers",0,&netlocalplayers,0}, {"-netnick",0,&netplaynick,0x4001}, {"-netpassword",0,&netpassword,0x4001}, #endif {0,0,0,0} }; static void SetDefaults(void) { Settings.special=Settings.specialfs=0; _bpp=8; _xres=640; _yres=480; _fullscreen=0; _xscale=2.50; _yscale=2; _xscalefs=_yscalefs=2; _efx=_efxfs=0; //_fshack=_fshacksave=0; #ifdef OPENGL _opengl=1; _stretchx=1; _stretchy=0; _openglip=1; #endif } void DoDriverArgs(void) { #ifdef BROKEN if(_fshack) { if(_fshack[0]=='0') if(_fshack[1]==0) { free(_fshack); _fshack=0; } } #endif } int InitMouse(void) { return(0); } void KillMouse(void){} void GetMouseData(uint32 *d) { int x,y; uint32 t; t=SDL_GetMouseState(&x,&y); #ifdef EXTGUI GUI_GetMouseState(&t,&x,&y); #endif d[2]=0; if(t&SDL_BUTTON(1)) d[2]|=1; if(t&SDL_BUTTON(3)) d[2]|=2; t=PtoV(x,y); d[0]=t&0xFFFF; d[1]=(t>>16)&0xFFFF; } int InitKeyboard(void) { return(1); } int UpdateKeyboard(void) { return(1); } void KillKeyboard(void) { } void UpdatePhysicalInput(void) { SDL_Event event; while(SDL_PollEvent(&event)) { switch(event.type) { //case SDL_SYSWMEVENT: puts("Nifty keen");break; //case SDL_VIDEORESIZE: puts("Okie dokie");break; case SDL_QUIT: CloseGame();puts("Quit");break; } //printf("Event: %d\n",event.type); //fflush(stdout); } //SDL_PumpEvents(); } static uint8 *KeyState=NULL; char *GetKeyboard(void) { KeyState=SDL_GetKeyState(0); #ifdef EXTGUI { char *tmp=GUI_GetKeyboard(); if(tmp) KeyState=tmp; } #endif return((char *)KeyState); } #ifdef WIN32 #include /* Stupid SDL */ #ifdef main #undef main #endif #endif #ifndef EXTGUI uint8 *GetBaseDirectory(void) { uint8 *ol; uint8 *ret; ol=getenv("HOME"); if(ol) { ret=malloc(strlen(ol)+1+strlen("./fceultra")); strcpy(ret,ol); strcat(ret,"/.fceultra"); } else { #ifdef WIN32 char *sa; ret=malloc(MAX_PATH+1); GetModuleFileName(NULL,ret,MAX_PATH+1); sa=strrchr(ret,'\\'); if(sa) *sa = 0; #else ret=malloc(1); ret[0]=0; #endif printf("%s\n",ret); } return(ret); } #endif #ifdef OPENGL int sdlhaveogl; #endif int DTestButton(ButtConfig *bc) { int x; for(x=0;xNumC;x++) { if(bc->ButtType[x]==BUTTC_KEYBOARD) { if(KeyState[bc->ButtonNum[x]]) return(1); } else if(bc->ButtType[x]==BUTTC_JOYSTICK) { if(DTestButtonJoy(bc)) return(1); } } return(0); } static int bcpv,bcpj; int ButtonConfigBegin(void) { SDL_Surface *screen; SDL_QuitSubSystem(SDL_INIT_VIDEO); bcpv=KillVideo(); bcpj=KillJoysticks(); if(!(SDL_WasInit(SDL_INIT_VIDEO)&SDL_INIT_VIDEO)) if(SDL_InitSubSystem(SDL_INIT_VIDEO)==-1) { FCEUD_Message(SDL_GetError()); return(0); } screen = SDL_SetVideoMode(300, 1, 8, 0); SDL_WM_SetCaption("Button Config",0); InitJoysticks(); return(1); } void ButtonConfigEnd(void) { extern FCEUGI *CurGame; KillJoysticks(); SDL_QuitSubSystem(SDL_INIT_VIDEO); if(bcpv) InitVideo(CurGame); if(bcpj) InitJoysticks(); } int DWaitButton(const uint8 *text, ButtConfig *bc, int wb) { SDL_Event event; static int32 LastAx[64][64]; int x,y; SDL_WM_SetCaption(text,0); #ifndef EXTGUI puts(text); #endif for(x=0;x<64;x++) for(y=0;y<64;y++) LastAx[x][y]=0x100000; while(SDL_WaitEvent(&event)) { switch(event.type) { case SDL_KEYDOWN:bc->ButtType[wb]=BUTTC_KEYBOARD; bc->DeviceNum[wb]=0; bc->ButtonNum[wb]=event.key.keysym.sym; return(1); case SDL_JOYBUTTONDOWN:bc->ButtType[wb]=BUTTC_JOYSTICK; bc->DeviceNum[wb]=event.jbutton.which; bc->ButtonNum[wb]=event.jbutton.button; return(1); case SDL_JOYHATMOTION:if(!(event.jhat.value&SDL_HAT_CENTERED)) { bc->ButtType[wb]=BUTTC_JOYSTICK; bc->DeviceNum[wb]=event.jhat.which; bc->ButtonNum[wb]=0x2000|((event.jhat.hat&0x1F)<<8)|event.jhat.value; } break; case SDL_JOYAXISMOTION: if(LastAx[event.jaxis.which][event.jaxis.axis]==0x100000) { if(abs(event.jaxis.value)<1000) LastAx[event.jaxis.which][event.jaxis.axis]=event.jaxis.value; } else { if(abs(LastAx[event.jaxis.which][event.jaxis.axis]-event.jaxis.value)>=8192) { bc->ButtType[wb]=BUTTC_JOYSTICK; bc->DeviceNum[wb]=event.jaxis.which; bc->ButtonNum[wb]=0x8000|(event.jaxis.axis)|((event.jaxis.value<0)?0x4000:0); return(1); } } break; } } return(0); } #ifdef EXTGUI int FCEUSDLmain(int argc, char *argv[]) #else int main(int argc, char *argv[]) #endif { FCEUD_Message("\nStarting FCE Ultra "FCEU_VERSION"...\n"); #ifdef WIN32 /* Taken from win32 sdl_main.c */ SDL_SetModuleHandle(GetModuleHandle(NULL)); #endif if(SDL_Init(SDL_INIT_VIDEO)) /* SDL_INIT_VIDEO Needed for (joystick config) event processing? */ { printf("Could not initialize SDL: %s.\n", SDL_GetError()); return(-1); } #ifdef OPENGL #ifdef APPLEOPENGL sdlhaveogl = 1; /* Stupid something... Hack. */ #else if(!SDL_GL_LoadLibrary(0)) sdlhaveogl=1; else sdlhaveogl=0; #endif #endif SetDefaults(); { int ret=CLImain(argc,argv); SDL_Quit(); return(ret?0:-1); } } uint64 FCEUD_GetTime(void) { return(SDL_GetTicks()); } uint64 FCEUD_GetTimeFreq(void) { return(1000); } fceu-0.98.12/src/drivers/pc/sdl-joystick.c0000644000175000000620000000473710110501425020144 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * Copyright (C) 2002 Paul Kuliniewicz * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ /* PK: SDL joystick input stuff */ #include #include #include #include #include "sdl.h" #define MAX_JOYSTICKS 32 static SDL_Joystick *Joysticks[MAX_JOYSTICKS] = {NULL}; int DTestButtonJoy(ButtConfig *bc) { int x; for(x=0;xNumC;x++) { if(bc->ButtonNum[x]&0x8000) /* Axis "button" */ { int pos; pos = SDL_JoystickGetAxis(Joysticks[bc->DeviceNum[x]], bc->ButtonNum[x]&16383); if ((bc->ButtonNum[x]&0x4000) && pos <= -16383) return(1); else if (!(bc->ButtonNum[x]&0x4000) && pos >= 16363) return(1); } else if(bc->ButtonNum[x]&0x2000) /* Hat "button" */ { if( SDL_JoystickGetHat(Joysticks[bc->DeviceNum[x]],(bc->ButtonNum[x]>>8)&0x1F) & (bc->ButtonNum[x]&0xFF)) return(1); } else if(SDL_JoystickGetButton(Joysticks[bc->DeviceNum[x]], bc->ButtonNum[x] )) return(1); } return(0); } static int jinited=0; /* Cleanup opened joysticks. */ int KillJoysticks (void) { int n; /* joystick index */ if(!jinited) return(0); for (n = 0; n < MAX_JOYSTICKS; n++) { if (Joysticks[n] != 0) SDL_JoystickClose(Joysticks[n]); Joysticks[n]=0; } SDL_QuitSubSystem(SDL_INIT_JOYSTICK); return(1); } /* Initialize joysticks. */ int InitJoysticks (void) { int n; /* joystick index */ int total; SDL_InitSubSystem(SDL_INIT_JOYSTICK); total=SDL_NumJoysticks(); if(total>MAX_JOYSTICKS) total=MAX_JOYSTICKS; for (n = 0; n < total; n++) { /* Open the joystick under SDL. */ Joysticks[n] = SDL_JoystickOpen(n); //printf("Could not open joystick %d: %s.\n", //joy[n] - 1, SDL_GetError()); continue; } jinited=1; return(1); } fceu-0.98.12/src/drivers/pc/sdl-netplay.c0000644000175000000620000001022010030467473017760 0ustar joestaff00000000000000#include "sdl.h" #include #include "sdl-netplay.h" char *ServerHost; static int LocalPortTCP=0xFCE; static int LocalPortUDP=0xFCE; static int RemotePortTCP=0xFCE; static int RemotePortUDP; /* Not configurable, figured out during handshake. */ static TCPsocket Socket; static UDPsocket UDPSocket; static SDLNet_SocketSet set; static void en32(uint8 *buf, uint32 morp) { buf[0]=morp; buf[1]=morp>>8; buf[2]=morp>>16; buf[3]=morp>>24; } static uint32 de32(uint8 *morp) { return(morp[0]|(morp[1]<<8)|(morp[2]<<16)|(morp[3]<<24)); } int FCEUD_NetworkConnect(void) { IPaddress rip; SDLNet_Init(); if(netplay==1) /* Be a server. */ { TCPsocket tmp; Uint16 p=LocalPortUDP; SDLNet_ResolveHost(&rip,NULL,LocalPortTCP); UDPSocket=SDLNet_UDP_Open(&p); tmp=SDLNet_TCP_Open(&rip); Socket=SDLNet_TCP_Accept(&tmp); memcpy(&rip,SDLNet_TCP_GetPeerAddress(Socket),sizeof(IPaddress)); { uint8 buf[12]; uint32 player=1; magic=SDL_GetTicks(); SDLNet_Write32(buf,uport); SDLNet_Write32(buf+4,1); SDLNet_Write32(buf+8,magic); SDLNet_TCP_Send(Socket, buf, 12); /* Get the UDP port the client is waiting for data on. */ SDLNet_TCP_Recv(Socket, buf, 2); RemotePortUDP=de32(buf); } } else /* Be a client */ { SDLNet_ResolveHost(&rip,ServerHost,RemotePortTCP); Socket=SDLNet_TCP_Open(&rip); { Uint16 p=LocalPortUDP; uint8 buf[12]; UDPSocket=SDLNet_UDP_Open(&p); /* Now, tell the server what local UDP port it should send to. */ en32(buf,p); SDLNet_TCP_Send(Socket, buf, 4); /* Get the UDP port from the server we should send data to. */ SDLNet_TCP_Recv(Socket, buf, 12); RemotePortUDP=de32(buf); magic=de32(buf+8); } set=SDLNet_AllocSocketSet(1); SDLNet_TCP_AddSocket(set,TCPSocket); SDLNet_UDP_AddSocket(set,UDPSocket); } // End client connect code. rip.port=RemotePortUDP; SDLNet_UDP_Bind(UDPSocket, 0, &rip); } static int CheckUDP(uint8 *packet, int32 len, int32 alt) { uint32 crc; uint32 repcrc; crc=FCEUI_CRC32(0,packet+4,len+8); repcrc=de32(packet); if(crc!=repcrc) return(0); /* CRC32 mismatch, bad packet. */ packet+=4; if(de32(packet)!=magic) /* Magic number mismatch, bad or spoofed packet. */ return(0); packet+=4; if(alt) { if(de32(packet) #include #include #else #include #include #include #endif #include #include #include "sdl.h" #include "sdl-opengl.h" #include "../common/vidblit.h" #ifndef APIENTRY #define APIENTRY #endif static GLuint textures[2]={0,0}; // Normal image, scanline overlay. static int left,right,top,bottom; // right and bottom are not inclusive. static int scanlines; static void *HiBuffer; void APIENTRY (*p_glBindTexture)(GLenum target,GLuint texture); void APIENTRY (*p_glColorTableEXT)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); void APIENTRY (*p_glTexImage2D)( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ); void APIENTRY (*p_glBegin)(GLenum mode); void APIENTRY (*p_glVertex2f)(GLfloat x, GLfloat y); void APIENTRY (*p_glTexCoord2f)(GLfloat s, GLfloat t); void APIENTRY (*p_glEnd)(void); void APIENTRY (*p_glEnable)(GLenum cap); void APIENTRY (*p_glBlendFunc)(GLenum sfactor, GLenum dfactor); const GLubyte* APIENTRY (*p_glGetString)(GLenum name); void APIENTRY (*p_glViewport)(GLint x, GLint y,GLsizei width, GLsizei height); void APIENTRY (*p_glGenTextures)(GLsizei n, GLuint *textures); void APIENTRY (*p_glDeleteTextures)(GLsizei n,const GLuint *textures); void APIENTRY (*p_glTexParameteri)(GLenum target, GLenum pname, GLint param); void APIENTRY (*p_glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); void APIENTRY (*p_glLoadIdentity)(void); void APIENTRY (*p_glClear)(GLbitfield mask); void APIENTRY (*p_glMatrixMode)(GLenum mode); void APIENTRY (*p_glDisable)(GLenum cap); void SetOpenGLPalette(uint8 *data) { if(!HiBuffer) { p_glBindTexture(GL_TEXTURE_2D, textures[0]); p_glColorTableEXT(GL_TEXTURE_2D,GL_RGB,256,GL_RGBA,GL_UNSIGNED_BYTE,data); } else SetPaletteBlitToHigh((uint8*)data); } void BlitOpenGL(uint8 *buf) { p_glBindTexture(GL_TEXTURE_2D, textures[0]); if(HiBuffer) { static int xo=0; xo=(xo+1)&3; Blit8ToHigh(buf,(uint8*)HiBuffer,256,240,256*4,1,1); if(!xo) p_glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA8,256,256, 0, GL_RGBA,GL_UNSIGNED_BYTE, HiBuffer); } else { //glPixelStorei(GL_UNPACK_ROW_LENGTH, 256); p_glTexImage2D(GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, 256, 256, 0, GL_COLOR_INDEX,GL_UNSIGNED_BYTE,buf); } p_glBegin(GL_QUADS); p_glTexCoord2f(1.0f*left/256, 1.0f*bottom/256); // Bottom left of our picture. p_glVertex2f(-1.0f, -1.0f); // Bottom left of target. p_glTexCoord2f(1.0f*right/256, 1.0f*bottom/256); // Bottom right of our picture. p_glVertex2f( 1.0f, -1.0f); // Bottom right of target. p_glTexCoord2f(1.0f*right/256, 1.0f*top/256); // Top right of our picture. p_glVertex2f( 1.0f, 1.0f); // Top right of target. p_glTexCoord2f(1.0f*left/256, 1.0f*top/256); // Top left of our picture. p_glVertex2f(-1.0f, 1.0f); // Top left of target. p_glEnd(); //glDisable(GL_BLEND); if(scanlines) { p_glEnable(GL_BLEND); p_glBindTexture(GL_TEXTURE_2D, textures[1]); p_glBlendFunc(GL_DST_COLOR, GL_SRC_ALPHA); p_glBegin(GL_QUADS); p_glTexCoord2f(1.0f*left/256, 1.0f*bottom/256); // Bottom left of our picture. p_glVertex2f(-1.0f, -1.0f); // Bottom left of target. p_glTexCoord2f(1.0f*right/256, 1.0f*bottom/256); // Bottom right of our picture. p_glVertex2f( 1.0f, -1.0f); // Bottom right of target. p_glTexCoord2f(1.0f*right/256, 1.0f*top/256); // Top right of our picture. p_glVertex2f( 1.0f, 1.0f); // Top right of target. p_glTexCoord2f(1.0f*left/256, 1.0f*top/256); // Top left of our picture. p_glVertex2f(-1.0f, 1.0f); // Top left of target. p_glEnd(); p_glDisable(GL_BLEND); } SDL_GL_SwapBuffers(); } void KillOpenGL(void) { if(textures[0]) p_glDeleteTextures(2, &textures[0]); textures[0]=0; if(HiBuffer) { free(HiBuffer); HiBuffer=0; } } /* Rectangle, left, right(not inclusive), top, bottom(not inclusive). */ int InitOpenGL(int l, int r, int t, int b, double xscale,double yscale, int efx, int ipolate, int stretchx, int stretchy, SDL_Surface *screen) { const char *extensions; #define LFG(x) if(!(p_##x = SDL_GL_GetProcAddress(#x))) return(0); #define LFGN(x) p_##x = SDL_GL_GetProcAddress(#x) LFG(glBindTexture); LFGN(glColorTableEXT); LFG(glTexImage2D); LFG(glBegin); LFG(glVertex2f); LFG(glTexCoord2f); LFG(glEnd); LFG(glEnable); LFG(glBlendFunc); LFG(glGetString); LFG(glViewport); LFG(glGenTextures); LFG(glDeleteTextures); LFG(glTexParameteri); LFG(glClearColor); LFG(glLoadIdentity); LFG(glClear); LFG(glMatrixMode); LFG(glDisable); left=l; right=r; top=t; bottom=b; HiBuffer=0; extensions=(const char*)p_glGetString(GL_EXTENSIONS); if((efx&2) || !extensions || !p_glColorTableEXT || !strstr(extensions,"GL_EXT_paletted_texture")) { if(!(efx&2)) // Don't want to print out a warning message in this case... FCEU_printf("Paletted texture extension not found. Using slower texture format..."); HiBuffer=malloc(4*256*256); memset(HiBuffer,0x00,4*256*256); #ifndef LSB_FIRST InitBlitToHigh(4,0xFF000000,0xFF0000,0xFF00,efx&2,0); #else InitBlitToHigh(4,0xFF,0xFF00,0xFF0000,efx&2,0); #endif } { int rw=(r-l)*xscale; int rh=(b-t)*yscale; int sx=(screen->w-rw)/2; // Start x int sy=(screen->h-rh)/2; // Start y if(stretchx) { sx=0; rw=screen->w; } if(stretchy) { sy=0; rh=screen->h; } p_glViewport(sx, sy, rw, rh); } p_glGenTextures(2, &textures[0]); scanlines=0; if(efx&1) { uint8 *buf; int x,y; scanlines=1; p_glBindTexture(GL_TEXTURE_2D, textures[1]); p_glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,ipolate?GL_LINEAR:GL_NEAREST); p_glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,ipolate?GL_LINEAR:GL_NEAREST); buf=(uint8*)malloc(256*(256*2)*4); for(y=0;y<(256*2);y++) for(x=0;x<256;x++) { buf[y*256*4+x*4]=0; buf[y*256*4+x*4+1]=0; buf[y*256*4+x*4+2]=0; buf[y*256*4+x*4+3]=(y&1)?0x00:0xFF; //?0xa0:0xFF; // <-- Pretty //buf[y*256+x]=(y&1)?0x00:0xFF; } p_glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 256, (scanlines==2)?256*4:512, 0, GL_RGBA,GL_UNSIGNED_BYTE,buf); free(buf); } p_glBindTexture(GL_TEXTURE_2D, textures[0]); p_glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,ipolate?GL_LINEAR:GL_NEAREST); p_glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,ipolate?GL_LINEAR:GL_NEAREST); p_glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP); p_glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP); p_glEnable(GL_TEXTURE_2D); p_glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Background color to black. p_glMatrixMode(GL_MODELVIEW); p_glClear(GL_COLOR_BUFFER_BIT); p_glLoadIdentity(); return(1); } fceu-0.98.12/src/drivers/pc/sdl-netplay.h0000644000175000000620000000000010003562762017755 0ustar joestaff00000000000000fceu-0.98.12/src/drivers/pc/sdl-video.c0000644000175000000620000002044210107022242017403 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 #include "sdl.h" #include "sdl-opengl.h" #include "../common/vidblit.h" #include "sdl-icon.h" #include "dface.h" SDL_Surface *screen; SDL_Surface *BlitBuf; // Used as a buffer when using hardware-accelerated blits. SDL_Surface *IconSurface=NULL; static int curbpp; static int srendline,erendline; static int tlines; static int inited=0; #ifdef OPENGL extern int sdlhaveogl; static int usingogl; static double exs,eys; #else static int exs,eys; #endif static int eefx; #define NWIDTH (256-((eoptions&EO_CLIPSIDES)?16:0)) #define NOFFSET (eoptions&EO_CLIPSIDES?8:0) static int paletterefresh; /* Return 1 if video was killed, 0 otherwise(video wasn't initialized). */ int KillVideo(void) { if(IconSurface) { SDL_FreeSurface(IconSurface); IconSurface=0; } if(inited&1) { #ifdef OPENGL if(usingogl) KillOpenGL(); else #endif if(curbpp>8) KillBlitToHigh(); SDL_QuitSubSystem(SDL_INIT_VIDEO); inited&=~1; return(1); } inited=0; return(0); } static int sponge; int InitVideo(FCEUGI *gi) { const SDL_VideoInfo *vinf; int flags=0; FCEUI_printf("Initializing video..."); FCEUI_GetCurrentVidSystem(&srendline,&erendline); if(_fullscreen) sponge=Settings.specialfs; else sponge=Settings.special; #ifdef OPENGL usingogl=0; if(_opengl && sdlhaveogl && !sponge) { flags=SDL_OPENGL; usingogl=1; } #endif #ifdef EXTGUI GUI_SetVideo(_fullscreen, 0, 0); #endif if(!(SDL_WasInit(SDL_INIT_VIDEO)&SDL_INIT_VIDEO)) if(SDL_InitSubSystem(SDL_INIT_VIDEO)==-1) { FCEUD_PrintError(SDL_GetError()); return(0); } inited|=1; SDL_ShowCursor(0); tlines=erendline-srendline+1; vinf=SDL_GetVideoInfo(); if(vinf->hw_available) flags|=SDL_HWSURFACE; if(_fullscreen) flags|=SDL_FULLSCREEN; flags|=SDL_HWPALETTE; //flags|=SDL_DOUBLEBUF; #ifdef OPENGL if(usingogl) { FCEU_printf("\n Initializing with OpenGL(Use \"-opengl 0\" to disable).\n"); if(_doublebuf) SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); } else #endif if(_doublebuf && (flags&SDL_HWSURFACE)) flags|=SDL_DOUBLEBUF; if(_fullscreen) { int desbpp=_bpp; exs=_xscalefs; eys=_yscalefs; eefx=_efxfs; #ifdef OPENGL if(!usingogl) {exs=(int)exs;eys=(int)eys;} else desbpp=0; if(sponge) { exs=eys=2; if(sponge == 3 || sponge == 4) exs = eys = 3; eefx=0; if(sponge == 1 || sponge == 3) desbpp = 32; } if( (usingogl && !_stretchx) || !usingogl) #endif if(_xres= 3) exs=eys=3; eefx=0; // SDL's 32bpp->16bpp code is slighty faster than mine, at least :/ if(sponge == 1 || sponge == 3) desbpp=32; } #ifdef OPENGL if(!usingogl) {exs=(int)exs;eys=(int)eys;} if(exs <= 0.01) { FCEUD_PrintError("xscale out of bounds."); KillVideo(); return(0); } if(eys <= 0.01) { FCEUD_PrintError("yscale out of bounds."); KillVideo(); return(0); } #endif #ifdef EXTGUI GUI_SetVideo(_fullscreen, (NWIDTH*exs), tlines*eys); #endif screen = SDL_SetVideoMode((NWIDTH*exs), tlines*eys, desbpp, flags); } curbpp=screen->format->BitsPerPixel; if(!screen) { FCEUD_PrintError(SDL_GetError()); KillVideo(); return(0); } //BlitBuf=SDL_CreateRGBSurface(SDL_HWSURFACE,256,240,screen->format->BitsPerPixel,screen->format->Rmask,screen->format->Gmask,screen->format->Bmask,0); inited=1; FCEU_printf(" Video Mode: %d x %d x %d bpp %s\n",screen->w,screen->h,screen->format->BitsPerPixel,_fullscreen?"full screen":""); if(curbpp!=16 && curbpp!=24 && curbpp!=8 && curbpp!=32) { FCEU_printf(" Sorry, %dbpp modes are not supported by FCE Ultra. Supported bit depths are 8bpp, 16bpp, and 32bpp.\n",curbpp); KillVideo(); return(0); } if(gi->name) SDL_WM_SetCaption(gi->name,gi->name); else SDL_WM_SetCaption("FCE Ultra","FCE Ultra"); #ifdef LSB_FIRST IconSurface=SDL_CreateRGBSurfaceFrom((void *)fceu_playicon.pixel_data,32,32,24,32*3,0xFF,0xFF00,0xFF0000,0x00); #else IconSurface=SDL_CreateRGBSurfaceFrom((void *)fceu_playicon.pixel_data,32,32,24,32*3,0xFF0000,0xFF00,0xFF,0x00); #endif SDL_WM_SetIcon(IconSurface,0); paletterefresh=1; if(curbpp>8) #ifdef OPENGL if(!usingogl) #endif InitBlitToHigh(curbpp>>3,screen->format->Rmask,screen->format->Gmask,screen->format->Bmask,eefx,sponge); #ifdef OPENGL if(usingogl) if(!InitOpenGL((eoptions&EO_CLIPSIDES)?8:0,256-((eoptions&EO_CLIPSIDES)?8:0),srendline,erendline+1,exs,eys,eefx,_openglip,_stretchx,_stretchy,screen)) { FCEUD_PrintError("Error initializing OpenGL."); KillVideo(); return(0); } #endif return 1; } void ToggleFS(void) { extern FCEUGI *CurGame; KillVideo(); _fullscreen=!_fullscreen; if(!InitVideo(CurGame)) { _fullscreen=!_fullscreen; InitVideo(CurGame); } } static SDL_Color psdl[256]; void FCEUD_SetPalette(uint8 index, uint8 r, uint8 g, uint8 b) { psdl[index].r=r; psdl[index].g=g; psdl[index].b=b; paletterefresh=1; } void FCEUD_GetPalette(uint8 index, uint8 *r, uint8 *g, uint8 *b) { *r=psdl[index].r; *g=psdl[index].g; *b=psdl[index].b; } static void RedoPalette(void) { #ifdef OPENGL if(usingogl) SetOpenGLPalette((uint8*)psdl); else #endif { if(curbpp>8) SetPaletteBlitToHigh((uint8*)psdl); else { SDL_SetPalette(screen,SDL_PHYSPAL,psdl,0,256); } } } void LockConsole(){} void UnlockConsole(){} void BlitScreen(uint8 *XBuf) { SDL_Surface *TmpScreen; uint8 *dest; int xo=0,yo=0; if(!screen) return; if(paletterefresh) { RedoPalette(); paletterefresh=0; } #ifdef OPENGL if(usingogl) { BlitOpenGL(XBuf); return; } #endif XBuf+=srendline*256; if(BlitBuf) TmpScreen=BlitBuf; else TmpScreen=screen; if(SDL_MUSTLOCK(TmpScreen)) if(SDL_LockSurface(TmpScreen)) { return; } dest=(uint8*)TmpScreen->pixels; if(_fullscreen) { xo=(((TmpScreen->w-NWIDTH*exs))/2); dest+=xo*(curbpp>>3); if(TmpScreen->h>(tlines*eys)) { yo=((TmpScreen->h-tlines*eys)/2); dest+=yo*TmpScreen->pitch; } } if(curbpp>8) { if(BlitBuf) Blit8ToHigh(XBuf+NOFFSET,dest, NWIDTH, tlines, TmpScreen->pitch,1,1); else Blit8ToHigh(XBuf+NOFFSET,dest, NWIDTH, tlines, TmpScreen->pitch,exs,eys); } else { if(BlitBuf) Blit8To8(XBuf+NOFFSET,dest, NWIDTH, tlines, TmpScreen->pitch,1,1,0,sponge); else Blit8To8(XBuf+NOFFSET,dest, NWIDTH, tlines, TmpScreen->pitch,exs,eys,eefx,sponge); } if(SDL_MUSTLOCK(TmpScreen)) SDL_UnlockSurface(TmpScreen); if(BlitBuf) { SDL_Rect srect; SDL_Rect drect; srect.x=0; srect.y=0; srect.w=NWIDTH; srect.h=tlines; drect.x=0; drect.y=0; drect.w=exs*NWIDTH; drect.h=eys*tlines; SDL_BlitSurface(BlitBuf, &srect,screen,&drect); } SDL_UpdateRect(screen, xo, yo, NWIDTH*exs, tlines*eys); if(screen->flags&SDL_DOUBLEBUF) SDL_Flip(screen); } uint32 PtoV(uint16 x, uint16 y) { y=(double)y/eys; x=(double)x/exs; if(eoptions&EO_CLIPSIDES) x+=8; y+=srendline; return(x|(y<<16)); } fceu-0.98.12/src/drivers/pc/throttle.c0000644000175000000620000000124410030467473017377 0ustar joestaff00000000000000#include #include "main.h" #include "throttle.h" static uint64 tfreq; static uint64 desiredfps; void RefreshThrottleFPS(void) { desiredfps=FCEUI_GetDesiredFPS()>>8; tfreq=1000000; tfreq<<=16; /* Adjustment for fps returned from FCEUI_GetDesiredFPS(). */ } static uint64 GetCurTime(void) { uint64 ret; struct timeval tv; gettimeofday(&tv,0); ret=(uint64)tv.tv_sec*1000000; ret+=tv.tv_usec; return(ret); } void SpeedThrottle(void) { static uint64 ttime,ltime=0; waiter: ttime=GetCurTime(); if( (ttime-ltime) < (tfreq/desiredfps) ) goto waiter; if( (ttime-ltime) >= (tfreq*4/desiredfps)) ltime=ttime; else ltime+=tfreq/desiredfps; } fceu-0.98.12/src/drivers/pc/sdl-video.h0000644000175000000620000000004110003562762017414 0ustar joestaff00000000000000uint32 PtoV(uint16 x, uint16 y); fceu-0.98.12/src/drivers/pc/sdl.h0000644000175000000620000000206610110501320016277 0ustar joestaff00000000000000#include #include "main.h" #include "dface.h" #include "input.h" int DTestButtonJoy(ButtConfig *bc); typedef struct { int xres; int yres; double xscale,yscale; double xscalefs,yscalefs; int efx,efxfs; int bpp; int fullscreen; int doublebuf; char *fshack; char *fshacksave; #ifdef OPENGL int opengl; int openglip; int stretchx,stretchy; #endif int special,specialfs; } DSETTINGS; extern DSETTINGS Settings; #define _doublebuf Settings.doublebuf #define _bpp Settings.bpp #define _xres Settings.xres #define _yres Settings.yres #define _fullscreen Settings.fullscreen #define _xscale Settings.xscale #define _yscale Settings.yscale #define _xscalefs Settings.xscalefs #define _yscalefs Settings.yscalefs #define _efx Settings.efx #define _efxfs Settings.efxfs #define _ebufsize Settings.ebufsize #define _fshack Settings.fshack #define _fshacksave Settings.fshacksave #ifdef OPENGL #define _opengl Settings.opengl #define _openglip Settings.openglip #define _stretchx Settings.stretchx #define _stretchy Settings.stretchy #endif fceu-0.98.12/src/drivers/pc/sdl-throttle.c0000644000175000000620000000134710030467473020163 0ustar joestaff00000000000000#include "sdl.h" #include "throttle.h" static uint64 tfreq; static uint64 desiredfps; void RefreshThrottleFPS(void) { desiredfps=FCEUI_GetDesiredFPS()>>8; tfreq=10000000; tfreq<<=16; /* Adjustment for fps returned from FCEUI_GetDesiredFPS(). */ } void SpeedThrottle(void) { static uint64 ttime,ltime=0; waiter: ttime=SDL_GetTicks(); ttime*=10000; if( (ttime-ltime) < (tfreq/desiredfps) ) { int64 delay; delay=(tfreq/desiredfps)-(ttime-ltime); if(delay>0) SDL_Delay(delay/10000); //printf("%d\n",(tfreq/desiredfps)-(ttime-ltime)); //SDL_Delay((tfreq/desiredfps)-(ttime-ltime)); goto waiter; } if( (ttime-ltime) >= (tfreq*4/desiredfps)) ltime=ttime; else ltime+=tfreq/desiredfps; } fceu-0.98.12/src/drivers/pc/unix-netplay.c0000644000175000000620000001244510110501444020156 0ustar joestaff00000000000000#ifdef NETWORK /* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 #include #include #include #include #include #include #include #include #include #include #include #include "main.h" #include "dface.h" #include "unix-netplay.h" #include "../../md5.h" #ifndef socklen_t #define socklen_t int #endif char *netplayhost=0; char *netplaynick=0; char *netgamekey = 0; char *netpassword = 0; int netlocalplayers = 1; int Port=0xFCE; int FCEUDnetplay=0; int tport=0xFCE; static int Socket=-1; static void en32(uint8 *buf, uint32 morp) { buf[0]=morp; buf[1]=morp>>8; buf[2]=morp>>16; buf[3]=morp>>24; } /* static uint32 de32(uint8 *morp) { return(morp[0]|(morp[1]<<8)|(morp[2]<<16)|(morp[3]<<24)); } */ int FCEUD_NetworkConnect(void) { struct sockaddr_in sockin; /* I want to play with fighting robots. */ struct hostent *phostentb; unsigned long hadr; int TSocket; int netdivisor; if(!netplayhost) return(0); if( (TSocket=socket(AF_INET,SOCK_STREAM,0))==-1) { puts("Error creating stream socket."); FCEUD_NetworkClose(); return(0); } int tcpopt = 1; if(setsockopt(TSocket, SOL_TCP, TCP_NODELAY, &tcpopt, sizeof(int))) puts("Nodelay fail"); memset(&sockin,0,sizeof(sockin)); sockin.sin_family=AF_INET; hadr=inet_addr(netplayhost); if(hadr!=INADDR_NONE) sockin.sin_addr.s_addr=hadr; else { puts("*** Looking up host name..."); if(!(phostentb=gethostbyname((const char *)netplayhost))) { puts("Error getting host network information."); close(TSocket); FCEUD_NetworkClose(); return(0); } memcpy(&sockin.sin_addr,phostentb->h_addr,phostentb->h_length); } sockin.sin_port=htons(tport); puts("*** Connecting to remote host..."); if(connect(TSocket,(struct sockaddr *)&sockin,sizeof(sockin))==-1) { puts("Error connecting to remote host."); close(TSocket); FCEUD_NetworkClose(); return(0); } Socket=TSocket; puts("*** Sending initialization data to server..."); { uint8 *sendbuf; uint8 buf[5]; uint32 sblen; sblen = 4 + 16 + 16 + 64 + 1 + (netplaynick?strlen(netplaynick):0); sendbuf = malloc(sblen); memset(sendbuf, 0, sblen); en32(sendbuf, sblen - 4); if(netgamekey) { struct md5_context md5; uint8 md5out[16]; md5_starts(&md5); md5_update(&md5, CurGame->MD5, 16); md5_update(&md5, netgamekey, strlen(netgamekey)); md5_finish(&md5, md5out); memcpy(sendbuf + 4, md5out, 16); } else memcpy(sendbuf + 4, CurGame->MD5, 16); if(netpassword) { struct md5_context md5; uint8 md5out[16]; md5_starts(&md5); md5_update(&md5, netpassword, strlen(netpassword)); md5_finish(&md5, md5out); memcpy(sendbuf + 4 + 16, md5out, 16); } memset(sendbuf + 4 + 16 + 16, 0, 64); sendbuf[4 + 16 + 16 + 64] = netlocalplayers; if(netplaynick) memcpy(sendbuf + 4 + 16 + 16 + 64 + 1,netplaynick,strlen(netplaynick)); send(Socket, sendbuf, sblen, 0); free(sendbuf); recv(Socket, buf, 1, MSG_WAITALL); netdivisor = buf[0]; } puts("*** Connection established."); FCEUDnetplay = 1; FCEUI_NetplayStart(netlocalplayers, netdivisor); return(1); } int FCEUD_SendData(void *data, uint32 len) { int check; if(!ioctl(fileno(stdin),FIONREAD,&check)) if(check) { char buf[1024]; char *f; fgets(buf,1024,stdin); if((f=strrchr(buf,'\n'))) *f=0; FCEUI_NetplayText(buf); } send(Socket, data, len ,0); return(1); } int FCEUD_RecvData(void *data, uint32 len) { NoWaiting&=~2; for(;;) { fd_set funfun; struct timeval popeye; popeye.tv_sec=0; popeye.tv_usec=100000; FD_ZERO(&funfun); FD_SET(Socket,&funfun); switch(select(Socket + 1,&funfun,0,0,&popeye)) { case 0: continue; case -1:return(0); } if(FD_ISSET(Socket,&funfun)) { if(recv(Socket,data,len,MSG_WAITALL) == len) { unsigned long beefie; if(!ioctl(Socket,FIONREAD,&beefie)) if(beefie) NoWaiting|=2; return(1); } else return(0); } } return 0; } void FCEUD_NetworkClose(void) { if(Socket>0) close(Socket); Socket=-1; if(FCEUDnetplay) FCEUI_NetplayStop(); FCEUDnetplay = 0; } void FCEUD_NetplayText(uint8 *text) { char *tot = malloc(strlen(text) + 1); char *tmp; strcpy(tot, text); tmp = tot; while(*tmp) { if(*tmp < 0x20) *tmp = ' '; tmp++; } puts(tot); free(tot); } #endif fceu-0.98.12/src/drivers/pc/throttle.h0000644000175000000620000000007110003562763017377 0ustar joestaff00000000000000void RefreshThrottleFPS(void); void SpeedThrottle(void); fceu-0.98.12/src/drivers/pc/unix-netplay.h0000644000175000000620000000025410052042776020173 0ustar joestaff00000000000000#ifdef NETWORK extern char *netplaynick; extern char *netplayhost; extern char *netpassword; extern char *netgamekey; extern int tport; extern int netlocalplayers; #endif fceu-0.98.12/src/drivers/pc/usage.h0000644000175000000620000000502510003562763016642 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ void ShowUsage(char *prog) { printf("\nUsage is as follows:\n%s filename\n\n",prog); puts("Options:"); puts(DriverUsage); puts("-cpalette x Load a custom global palette from file x.\n\ -ntsccol x Emulate an NTSC's TV's colors.\n\ 0 = Disabled.\n\ 1 = Enabled.\n\ -pal x Emulate a PAL NES if x is 1.\n\ -sound x Sound.\n\ 0 = Disabled.\n\ Otherwise, x = playback rate.\n\ -soundvol x Sound volume. x is an integral percentage value.\n\ -soundq x Sets sound quality.\n\ 0 = Low quality.\n\ 1 = High quality.\n\ -inputx str Select device mapped to virtual input port x(1-2).\n\ str may be: none, gamepad, zapper, powerpada, powerpadb,\n\ arkanoid\n\ -fcexp str Select Famicom expansion port device.\n\ str may be: none, shadow, arkanoid, 4player, fkb\n\ -inputcfg s Configure virtual input device \"s\".\n\ -nofs x Disables Four-Score emulation if x is 1.\n\ -gg x Enable Game Genie emulation if x is 1.\n\ -no8lim x Disables the 8 sprites per scanline limitation.\n\ 0 = Limitation enabled.\n\ 1 = Limitation disabled.\n\ -snapname x Selects what type of file name snapshots will have.\n\ 0 = Numeric(0.png)\n\ 1 = File base and numeric(mario-0.png)\n\ -nothrottle x Disable artificial speed throttling if x is non-zero.\n\ -clipsides x Clip leftmost and rightmost 8 columns of pixels of video output.\n\ 0 = No clipping.\n\ 1 = Clipping.\n\ -slstart x Set the first drawn emulated scanline. Valid values for x are\n\ 0 through 239.\n\ -slend x Set the last drawn emulated scanline. Valid values for x are\n\ 0 through 239."); } fceu-0.98.12/src/drivers/pc/Makefile.am.inc0000644000175000000620000000042210040102704020147 0ustar joestaff00000000000000fceud_SOURCES = drivers/pc/input.c drivers/pc/main.c drivers/pc/sdl.c drivers/pc/sdl-joystick.c drivers/pc/sdl-sound.c drivers/pc/sdl-throttle.c drivers/pc/sdl-video.c drivers/pc/unix-netplay.c if OPENGL TMP_OGL = drivers/pc/sdl-opengl.c endif fceud_SOURCES += $(TMP_OGL) fceu-0.98.12/src/drivers/pc/sdl-opengl.h0000644000175000000620000000037110003562763017601 0ustar joestaff00000000000000void SetOpenGLPalette(uint8 *data); void BlitOpenGL(uint8 *buf); void KillOpenGL(void); int InitOpenGL(int l, int r, int t, int b, double xscale,double yscale, int efx, int ipolate, int stretchx, int stretchy, SDL_Surface *screen); fceu-0.98.12/src/drivers/pc/input.h0000644000175000000620000000155610110501116016662 0ustar joestaff00000000000000#ifndef _aosdfjk02fmasf #define _aosdfjk02fmasf #define MAXBUTTCONFIG 4 typedef struct { uint8 ButtType[MAXBUTTCONFIG]; uint8 DeviceNum[MAXBUTTCONFIG]; uint16 ButtonNum[MAXBUTTCONFIG]; uint32 NumC; //uint64 DeviceID[MAXBUTTCONFIG]; /* TODO */ } ButtConfig; extern CFGSTRUCT InputConfig[]; extern ARGPSTRUCT InputArgs[]; void ParseGIInput(FCEUGI *GI); #define BUTTC_KEYBOARD 0x00 #define BUTTC_JOYSTICK 0x01 #define BUTTC_MOUSE 0x02 #define FCFGD_GAMEPAD 1 #define FCFGD_POWERPAD 2 #define FCFGD_HYPERSHOT 3 #define FCFGD_QUIZKING 4 void InitOtherInput(void); void InputUserActiveFix(void); #ifdef EXTGUI extern ButtConfig GamePadConfig[4][10]; extern ButtConfig powerpadsc[2][12]; extern ButtConfig QuizKingButtons[6]; extern ButtConfig FTrainerButtons[12]; #endif void FCEUD_UpdateInput(void); #endif fceu-0.98.12/src/drivers/pc/sdl-sound.c0000644000175000000620000001577110047317210017443 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 #include "sdl.h" #ifdef USE_SEXYAL #include "../sexyal/sexyal.h" static SexyAL *Interface; static SexyAL_device *Output; static SexyAL_format format; static SexyAL_buffering buffering; uint32 GetMaxSound(void) { return(buffering.totalsize); } uint32 GetWriteSound(void) { return(Output->CanWrite(Output)); } void WriteSound(int32 *Buffer, int Count) { //printf("%d\n",Output->CanWrite(Output)); Output->Write(Output, Buffer, Count); } int InitSound(FCEUGI *gi) { if(!_sound) return(0); memset(&format,0,sizeof(format)); memset(&buffering,0,sizeof(buffering)); FCEUI_SetSoundVolume(soundvol); FCEUI_SetSoundQuality(soundq); Interface=SexyAL_Init(0); format.sampformat=SEXYAL_FMT_PCMS32S16; format.channels=gi->soundchan?gi->soundchan:1; format.rate=gi->soundrate?gi->soundrate:soundrate; buffering.fragcount=buffering.fragsize=0; buffering.ms=soundbufsize; FCEUI_printf("\nInitializing sound..."); if(!(Output=Interface->Open(Interface,SEXYAL_ID_UNUSED,&format,&buffering))) { FCEUD_PrintError("Error opening a sound device."); Interface->Destroy(Interface); Interface=0; return(0); } if(soundq && format.rate!=48000 && format.rate!=44100 && format.rate!=96000) { FCEUD_PrintError("Set sound playback rate neither 44100, 48000, nor 96000, but needs to be when in high-quality sound mode."); KillSound(); return(0); } if(format.rate<8192 || format.rate > 96000) { FCEUD_PrintError("Set rate is out of range [8192-96000]"); KillSound(); return(0); } FCEUI_printf("\n Bits: %u\n Rate: %u\n Channels: %u\n Byte order: CPU %s\n Buffer size: %u sample frames(%f ms)\n",(format.sampformat>>4)*8,format.rate,format.channels,format.byteorder?"Reversed":"Native",buffering.totalsize,(double)buffering.totalsize*1000/format.rate); format.sampformat=SEXYAL_FMT_PCMS32S16; format.channels=gi->soundchan?gi->soundchan:1; format.byteorder=0; //format.rate=gi->soundrate?gi->soundrate:soundrate; Output->SetConvert(Output,&format); FCEUI_Sound(format.rate); return(1); } void SilenceSound(int n) { } int KillSound(void) { FCEUI_Sound(0); if(Output) Output->Close(Output); if(Interface) Interface->Destroy(Interface); Interface=0; if(!Output) return(0); Output=0; return(1); } #elif USE_JACKACK /* Use JACK Audio Connection Kit */ #include #include static jack_port_t *output_port = NULL; static jack_client_t *client = NULL; static jack_ringbuffer_t *tmpbuf = NULL; static unsigned int BufferSize; static int process(jack_nframes_t nframes, void *arg) { jack_default_audio_sample_t *out = (jack_default_audio_sample_t *) jack_port_get_buffer(output_port, nframes); size_t canread; canread = jack_ringbuffer_read_space(tmpbuf) / sizeof(jack_default_audio_sample_t); if(canread > nframes) canread = nframes; jack_ringbuffer_read(tmpbuf, out,canread * sizeof(jack_default_audio_sample_t)); nframes -= canread; if(nframes) /* Buffer underflow. Hmm. */ { } } uint32 GetMaxSound(void) { return(BufferSize); } uint32 GetWriteSound(void) { return(jack_readbuffer_write_space / sizeof(jack_default_audio_sample_t)); } static void DeadSound(void *arg) { puts("AGH! Sound server hates us! Let's go on a rampage."); } int InitSound(FCEUGI *gi) { const char **ports; client = jack_client_new("FCE Ultra"); jack_set_process_callback(client, process, 0); jack_on_shutdown(client, DeadSound, 0); printf("%ld\n",jack_get_sample_rate(client)); output_port = jack_port_register(client, "output", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); BufferSize = soundbufsize * soundrate / 1000; tmpbuf = jack_ringbuffer_create(BufferSize * sizeof(jack_default_audio_sample_t)); jack_activate(client); ports = jack_get_ports(client, NULL, NULL, JackPortIsPhysical | JackPortIsInput); jack_connect(client, jack_port_name(output_port), ports[0]); free(ports); } void WriteSound(int32 *buf, int Count) { jack_default_audio_sample_t jbuf[Count]; int x; for(x=0;x>= 1; while(len) { int16 sample = 0; if(BufferIn) { sample = Buffer[BufferRead]; BufferRead = (BufferRead + 1) % BufferSize; BufferIn--; } else sample = 0; *tmps = sample; tmps++; len--; } } int InitSound(FCEUGI *gi) { SDL_AudioSpec spec; if(!_sound) return(0); memset(&spec,0,sizeof(spec)); if(SDL_InitSubSystem(SDL_INIT_AUDIO)<0) { puts(SDL_GetError()); KillSound(); return(0); } spec.freq = soundrate; spec.format = AUDIO_S16SYS; spec.channels = 1; spec.samples = 256; spec.callback = fillaudio; spec.userdata = 0; BufferSize = soundbufsize * soundrate / 1000; BufferSize -= spec.samples * 2; /* SDL uses at least double-buffering, so multiply by 2. */ if(BufferSize < spec.samples) BufferSize = spec.samples; Buffer = malloc(sizeof(int) * BufferSize); BufferRead = BufferWrite = BufferIn = 0; //printf("SDL Size: %d, Internal size: %d\n",spec.samples,BufferSize); if(SDL_OpenAudio(&spec,0)<0) { puts(SDL_GetError()); KillSound(); return(0); } SDL_PauseAudio(0); FCEUI_Sound(soundrate); return(1); } uint32 GetMaxSound(void) { return(BufferSize); } uint32 GetWriteSound(void) { return(BufferSize - BufferIn); } void WriteSound(int32 *buf, int Count) { while(Count) { while(BufferIn == BufferSize) SDL_Delay(1); Buffer[BufferWrite] = *buf; Count--; BufferWrite = (BufferWrite + 1) % BufferSize; BufferIn++; buf++; } } void SilenceSound(int n) { SDL_PauseAudio(n); } void KillSound(void) { FCEUI_Sound(0); SDL_CloseAudio(); SDL_QuitSubSystem(SDL_INIT_AUDIO); if(Buffer) { free(Buffer); Buffer = 0; } } #endif fceu-0.98.12/src/drivers/pc/sdl-icon.h0000644000175000000620000002322110003562763017244 0ustar joestaff00000000000000static const struct { unsigned int width; unsigned int height; unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ uint8 pixel_data[32 * 32 * 3 + 1]; } fceu_playicon = { 32, 32, 3, "\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\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\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\0\0\0\0\0\0\0\0\0\\\223\373\\\223\373\\\223\373\\\223" "\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373" "\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\" "\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223" "\373\\\223\373\\\223\373\0\0\0\0\0\0\0\0\0\\\223\373\\\223\373\267\317\373" "\246\304\373\260\312\373\222\267\373\246\304\373\\\223\373\\\223\373\\\223" "\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373" "\267\317\373\246\304\373\260\312\373\210\261\373\246\304\373\\\223\373\\" "\223\373\210\261\373\222\267\373\267\317\373\241\301\373\\\223\373\\\223" "\373\0\0\0\0\0\0\\\223\373\\\223\373\227\272\373\227\272\373\227\272\373" "\227\272\373\227\272\373\227\272\373\\\223\373\\\223\373z`sr\242\373\227" "\272\373\227\272\373\\\223\373\\\223\373\\\223\373\\\223\373\213\261\373" "z\247\373\213\261\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\" "\223\373\\\223\373\\\223\373\\\223\373\0\0\0\0\0\0\\\223\373\\\223\373\\" "\223\373\\\223\373\313i=\315Z\40\315Z\40\315Z\40\315Z\40\315Z\40\315Z\40" "\315Z\40\315Z\40\315Z\40\315Z\40\315Z\40\315Z\40\315Z\40\315Z\40\315Z\40" "\315Z\40\315Z\40\315Z\40\315Z\40\315Z\40\257T*\\\223\373\\\223\373\\\223" "\373\\\223\373\0\0\0\0\0\0\\\223\373\\\223\373\\\223\373\\\223\373\315Z\40" "\355\235\203\355\235\203\341\232\205\341\232\205\365\255\233\355\235\203" "\355\235\203\350\250\232\365\255\233\355\235\203\307L\14\307L\14\307L\14" "\307L\14\307L\14\307L\14\307L\14\307L\14\307L\14\307L\14\256B\12\\\223\373" "\\\223\373\\\223\373\\\223\373\0\0\0\0\0\0\\\223\373\\\223\373\\\223\373" "\\\223\373\315Z\40\273zc\233l_\325\225\205\325\225\205\325\225\205\273\212" "\201\325\225\205\237qd\325\225\205\317\231\216\307L\14\307L\14\307L\14\307" "L\14\307L\14\307L\14\307L\14\307L\14\307L\14\307L\14\256B\12\\\223\373\\" "\223\373\\\223\373\\\223\373\0\0\0\0\0\0\\\223\373\\\223\373\\\223\373\\" "\223\373\315Z\40\344\232\203\301\215\201\344\232\203\273\212\201\325\225" "\205\2114\10\344\232\203\350\250\232\325\225\205\333\230\205\307L\14\307" "L\14\307L\14\307L\14\307L\14\307L\14\307L\14\307L\14\307L\14\307L\14\256" "B\12\\\223\373\\\223\373\\\223\373\\\223\373\0\0\0\0\0\0\\\223\373\\\223" "\373\\\223\373\\\223\373\315Z\40\2259\11}0\10\2259\11}0\10}0\10\307L\14\225" "9\11d&\6}0\10}0\10\307L\14\307L\14\307L\14\307L\14\307L\14\307L\14\307L\14" "\307L\14\307L\14\307L\14\256B\12\\\223\373\\\223\373\\\223\373\\\223\373" "\0\0\0\0\0\0\\\223\373\\\223\373\\\223\373\\\223\373\315Z\40\355\235\203" "\355\233\201\355\235\203\355\235\203\355\235\203\365\255\233\355\235\203" "\341\232\205\355\235\203\355\235\203\307L\14\365\255\233\355\235\203\365" "\255\233\355\235\203\355\235\203\355\235\203\355\235\203\355\235\203\307" "L\14\256B\12\\\223\373\\\223\373\\\223\373\\\223\373\0\0\0\0\0\0\\\223\373" "\\\223\373\\\223\373\\\223\373\315Z\40\325\225\205\311\221\204\311\221\204" "\325\225\205\311\221\204\325\225\205\311\221\204\325\225\205\325\225\205" "\311\221\204\307L\14\325\225\205\311\221\204\325\225\205\311\221\204\325" "\225\205\311\221\204\325\225\205\311\221\204\307L\14\256B\12\\\223\373\\" "\223\373\\\223\373\\\223\373\0\0\0\0\0\0\\\223\373\\\223\373\\\223\373\\" "\223\373\315Z\40\325\225\205\325\225\205\325\225\205\325\225\205\325\225" "\205\325\225\205\317\231\216\325\225\205\325\225\205\325\225\205\307L\14" "\325\225\205\317\231\216\325\225\205\317\231\216\325\225\205\325\225\205" "\273zc\241n_\307L\14\256B\12\\\223\373\\\223\373\\\223\373\\\223\373\0\0" "\0\0\0\0\\\223\373\\\223\373\\\223\373\\\223\373\315Z\40\325\225\205\325" "\225\205\325\225\205\365\255\233\333\243\231\325\225\205\333\230\205\325" "\225\205\325\225\205\325\225\205\307L\14\325\225\205\317\223\204\325\225" "\205\333\230\205\325\225\205\325\225\205\333\230\205\317\223\204\307L\14" "\256B\12\\\223\373\\\223\373\\\223\373\\\223\373\0\0\0\0\0\0\\\223\373\\" "\223\373\\\223\373\\\223\373\315Z\40\325\225\205\325\225\205\325\225\205" "\325\225\205\311\221\204\325\225\205\325\225\205\325\225\205\344\232\203" "\273\212\201\307L\14\325\225\205\273\212\201\325\225\205\325\225\205\344" "\232\203\273\212\201\344\232\203\273\212\201\341\232\205\256B\12\\\223\373" "\\\223\373\\\223\373\\\223\373\0\0\0\0\0\0\\\223\373\\\223\373\\\223\373" "\\\223\373\257T*d&\6d&\6d&\6d&\6d&\6d&\6d&\6d&\6}0\10d&\6\256B\12d&\6p+\7" "d&\6d&\6}0\10d&\6}0\10d&\6d&\6\223@\26\\\223\373\\\223\373\\\223\373\\\223" "\373\0\0\0\0\0\0\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223" "\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\234\243" "\335\213\237\344\237\244\333\251\247\326\237\244\333\\\223\373\267\252\317" "\222\241\341\267\252\317\210\237\346\241\245\332\267\252\317\246\246\327" "\246\246\327\\\223\373\\\223\373\\\223\373\\\223\373\0\0\0\0\0\0\\\223\373" "\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\" "\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223" "\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373" "\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\0" "\0\0\0\0\0\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\" "\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223" "\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373" "\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\" "\223\373\\\223\373\0\0\0\0\0\0\\\223\373\\\223\373\\\223\373\\\223\373\\" "\223\373\\\223\373\\\223\373\\\223\373\257hT\\\223\373\213\261\373\\\223" "\373\241\301\373\210\261\373\246\304\373\222\267\373\241\301\373\260\312" "\373\\\223\373\237\277\373\246\304\373\267\317\373\241\301\373\\\223\373" "\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\0\0\0\0\0\0" "\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\" "\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223" "\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373" "\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\" "\223\373\0\0\0\0\0\0\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\" "\223\373\\\223\373\\\223\373\\\223\373\\\223\373\246\304\373\\\223\373\241" "\301\373\210\261\373\246\304\373\222\267\373\241\301\373\260\312\373\\\223" "\373\237\277\373\246\304\373\267\317\373\241\301\373\\\223\373\\\223\373" "\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\0\0\0\0\0\0\\\223\373" "\\\223\373\\\223\373D\203\270D\203\270\\\223\373\\\223\373\\\223\373\\\223" "\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373" "\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\" "\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\0\0" "\0\0\0\0\\\223\373\\\223\373(\211n\0\247\0\0n\0(\211n\\\223\373\\\223\373" "\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\" "\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223" "\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373" "\0\0\0\0\0\0\\\223\373(\211n\0\247\0\0\247\0\0\247\0\0\247\0(\211n\\\223" "\373\\\223\373\\\223\373\\\223\373\210\261\373\246\304\373\241\301\373z\247" "\373\\\223\373\227\272\373\227\272\373\227\272\373\227\272\373\227\272\373" "\227\272\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373" "\\\223\373\\\223\373\0\0\0\0\0\0(\211n\0\247\0\0n\0\0\247\0\\\215\12fs\16" "\0\247\0(\211n\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373" "\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\" "\223\373\\\223\373Z\231Z[\230SZ\231Z[\230SZ\231Z[\230S\\\223\373\0\0\0\0" "\0\0\0\247\0\0\247\0\0\247\0\0\247\0vy\7p|\7\0\247\0\0\247\0(\211n\\\223" "\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373" "\\\223\373\\\223\373\\\223\373\\\223\373\\\223\373b\237L\200\317\20\200\317" "\20\200\317\20\200\317\20\200\317\20\200\317\20[\223H\0\0\0\0\0\0\230P.\323" "d0\230P.\323d0\221M&\313`%\230P.\323d0\230P.\323d0\230P.\323d0\230P.\323" "d0\230P.\323d0\230P.\323d0\230P.\323d0\230P.\323d0\230P.\323d0\230P.\323" "d0\230P.\323d0\230P.\323d0\0\0\0\0\0\0\0\0\0\237N(\225E\35\237N(\225E\35" "\237N(\225E\35\237N(\225E\35\237N(\225E\35\237N(\225E\35\237N(\225E\35\237" "N(\225E\35\237N(\225E\35\237N(\225E\35\237N(\225E\35\237N(\225E\35\237N(" "\225E\35\237N(\225E\35\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\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\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\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\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", }; fceu-0.98.12/src/drivers/win/0002755000175000000620000000000010111545623015554 5ustar joestaff00000000000000fceu-0.98.12/src/drivers/win/common.h0000644000175000000620000000167310110476322017220 0ustar joestaff00000000000000#include #include #include #ifndef WIN32 #define WIN32 #endif #undef WINNT #define NONAMELESSUNION #define DIRECTSOUND_VERSION 0x0700 #define DIRECTDRAW_VERSION 0x0700 #define DIRECTINPUT_VERSION 0x700 #include "../../driver.h" #include "../common/config.h" /* Message logging(non-netplay messages, usually) for all. */ #include "log.h" extern HWND hAppWnd; extern HINSTANCE fceu_hInstance; extern int NoWaiting; extern FCEUGI *GI; void DSMFix(UINT msg); void StopSound(void); extern int eoptions; #define EO_BGRUN 1 #define EO_CPALETTE 4 #define EO_NOSPRLIM 8 #define EO_FSAFTERLOAD 32 #define EO_FOAFTERSTART 64 #define EO_NOTHROTTLE 128 #define EO_CLIPSIDES 256 #define EO_SNAPNAME 512 #define EO_HIDEMENU 2048 #define EO_HIGHPRIO 4096 #define EO_FORCEASPECT 8192 #define EO_FORCEISCALE 16384 #define EO_NOFOURSCORE 32768 fceu-0.98.12/src/drivers/win/args.c0000644000175000000620000000255610110476314016661 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "../common/args.h" char *ParseArgies(int argc, char *argv[]) { int x; static ARGPSTRUCT FCEUArgs[]={ {"-pal",0,&palyo,0}, {"-gg",0,&genie,0}, {"-no8lim",0,&eoptions,0x8000|EO_NOSPRLIM}, //{"-nofs",0,&eoptions,0}, {"-clipsides",0,&eoptions,0x8000|EO_CLIPSIDES}, {"-nothrottle",0,&eoptions,0x8000|EO_NOTHROTTLE}, }; if(argc<=1) return(0); ParseArguments(argc-2, &argv[1], FCEUArgs); return(argv[argc-1]); } fceu-0.98.12/src/drivers/win/cheat.h0000644000175000000620000000010210110476322016776 0ustar joestaff00000000000000void ConfigCheats(HWND hParent); void ConfigAddCheat(HWND wnd); fceu-0.98.12/src/drivers/win/config.c0000644000175000000620000000651610110476314017172 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ /****************************************************************/ /* FCE Ultra */ /* */ /* This file contains code to interface to the standard */ /* FCE Ultra configuration file saving/loading code. */ /* */ /****************************************************************/ static CFGSTRUCT fceuconfig[]={ ACS(rfiles[0]), ACS(rfiles[1]), ACS(rfiles[2]), ACS(rfiles[3]), ACS(rfiles[4]), ACS(rfiles[5]), ACS(rfiles[6]), ACS(rfiles[7]), ACS(rfiles[8]), ACS(rfiles[9]), ACS(rdirs[0]), ACS(rdirs[1]), ACS(rdirs[2]), ACS(rdirs[3]), ACS(rdirs[4]), ACS(rdirs[5]), ACS(rdirs[6]), ACS(rdirs[7]), ACS(rdirs[8]), ACS(rdirs[9]), AC(ntsccol),AC(ntsctint),AC(ntschue), NAC("palyo",palyo), NAC("genie",genie), NAC("fs",fullscreen), NAC("vgamode",vmod), NAC("sound",soundo), ACS(gfsdir), NACS("odcheats",DOvers[0]), NACS("odmisc",DOvers[1]), NACS("odnonvol",DOvers[2]), NACS("odstates",DOvers[3]), NACS("odsnaps",DOvers[4]), NACS("odbase",DOvers[5]), AC(winspecial), AC(winsizemulx), AC(winsizemuly), NAC("saspectw987",saspectw), NAC("saspecth987",saspecth), AC(soundrate), AC(soundbuftime), AC(soundoptions), AC(soundquality), AC(soundvolume), AC(goptions), NAC("eoptions",eoptions), NACA("cpalette",cpalette), NACA("InputType",UsrInputType), NAC("vmcx",vmodes[0].x), NAC("vmcy",vmodes[0].y), NAC("vmcb",vmodes[0].bpp), NAC("vmcf",vmodes[0].flags), NAC("vmcxs",vmodes[0].xscale), NAC("vmcys",vmodes[0].yscale), NAC("vmspecial",vmodes[0].special), NAC("srendline",srendlinen), NAC("erendline",erendlinen), NAC("srendlinep",srendlinep), NAC("erendlinep",erendlinep), AC(disvaccel), AC(winsync), NAC("988fssync",fssync), AC(ismaximized), AC(maxconbskip), AC(ffbskip), ADDCFGSTRUCT(NetplayConfig), ADDCFGSTRUCT(InputConfig), ENDCFGSTRUCT }; static void SaveConfig(char *filename) { SaveFCEUConfig(filename,fceuconfig); } static void LoadConfig(char *filename) { FCEUI_GetNTSCTH(&ntsctint,&ntschue); LoadFCEUConfig(filename,fceuconfig); FCEUI_SetNTSCTH(ntsccol,ntsctint,ntschue); } fceu-0.98.12/src/drivers/win/input.c0000644000175000000620000006672710110476314017076 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "common.h" #include #include "input.h" #include "keyboard.h" #include "joystick.h" LPDIRECTINPUT7 lpDI; /* UsrInputType[] is user-specified. InputType[] is current (game loading can override user settings) */ int UsrInputType[3]={SI_GAMEPAD,SI_GAMEPAD,SIFC_NONE}; int InputType[3]; static int cspec; int gametype; int InitDInput(void) { HRESULT ddrval; ddrval=DirectInputCreateEx(fceu_hInstance,DIRECTINPUT_VERSION,&IID_IDirectInput7,(LPVOID *)&lpDI,0); if(ddrval!=DI_OK) { FCEUD_PrintError("DirectInput: Error creating DirectInput object."); return 0; } return 1; } static uint32 MouseData[3]; static int screenmode=0; void InputScreenChanged(int fs) { int x; if(GI) { for(x=0;x<2;x++) if(InputType[x]==SI_ZAPPER) FCEUI_SetInput(x,SI_ZAPPER,MouseData,fs); if(InputType[2]==SIFC_SHADOW) FCEUI_SetInputFC(SIFC_SHADOW,MouseData,fs); } screenmode=fs; } /* Necessary for proper GUI functioning(configuring when a game isn't loaded). */ void InputUserActiveFix(void) { int x; for(x=0;x<3;x++) InputType[x]=UsrInputType[x]; } void ParseGIInput(FCEUGI *gi) { InputType[0]=UsrInputType[0]; InputType[1]=UsrInputType[1]; InputType[2]=UsrInputType[2]; if(gi) { if(gi->input[0]>=0) InputType[0]=gi->input[0]; if(gi->input[1]>=0) InputType[1]=gi->input[1]; if(gi->inputfc>=0) InputType[2]=gi->inputfc; cspec = gi->cspecial; gametype=gi->type; InitOtherInput(); } else cspec=gametype=0; } static uint8 QuizKingData; static uint8 HyperShotData; static uint32 MahjongData; static uint32 FTrainerData; static uint8 TopRiderData; static uint8 BWorldData[1+13+1]; static void UpdateFKB(void); static void UpdateGamepad(void); static void UpdateQuizKing(void); static void UpdateHyperShot(void); static void UpdateMahjong(void); static void UpdateFTrainer(void); static void UpdateTopRider(void); static uint32 JSreturn; int NoWaiting=1; #include "keyscan.h" static char *keys; static int DIPS=0; static uint8 keyonce[MKK_COUNT]; #define KEY(__a) keys[MKK(__a)] static int _keyonly(int a) { if(keys[a]) { if(!keyonce[a]) { keyonce[a]=1; return(1); } } else keyonce[a]=0; return(0); } #define keyonly(__a) _keyonly(MKK(__a)) int cidisabled=0; static void KeyboardCommands(void) { int is_shift, is_alt; keys=GetKeyboard(); if(InputType[2]==SIFC_FKB) { if(cidisabled) return; } is_shift = KEY(LEFTSHIFT) | KEY(RIGHTSHIFT); is_alt = KEY(LEFTALT) | KEY(RIGHTALT); if(keyonly(F4)) { if(is_shift) FCEUI_SetRenderDisable(-1, 2); else FCEUI_SetRenderDisable(2, -1); } { static int nocount=0; NoWaiting&=~1; if(KEY(GRAVE)) //&& nocount) NoWaiting|=1; nocount=(nocount+1)&3; } if(gametype==GIT_FDS) { if(keyonly(F6)) FCEUI_FDSSelect(); if(keyonly(F8)) FCEUI_FDSInsert(0); } if(keyonly(F9)) FCEUI_SaveSnapshot(); if(gametype!=GIT_NSF) { if(keyonly(F5)) { if(is_shift) FCEUI_SaveMovie(NULL); else FCEUI_SaveState(NULL); } if(keyonly(F7)) { if(is_shift) FCEUI_LoadMovie(NULL); else FCEUI_LoadState(NULL); } } if(keyonly(F1)) FCEUI_ToggleTileView(); if(gametype==GIT_VSUNI) { if(keyonly(F8)) FCEUI_VSUniCoin(); if(keyonly(F6)) { DIPS^=1; FCEUI_VSUniToggleDIPView(); } if(!(DIPS&1)) goto DIPSless; if(keyonly(1)) FCEUI_VSUniToggleDIP(0); if(keyonly(2)) FCEUI_VSUniToggleDIP(1); if(keyonly(3)) FCEUI_VSUniToggleDIP(2); if(keyonly(4)) FCEUI_VSUniToggleDIP(3); if(keyonly(5)) FCEUI_VSUniToggleDIP(4); if(keyonly(6)) FCEUI_VSUniToggleDIP(5); if(keyonly(7)) FCEUI_VSUniToggleDIP(6); if(keyonly(8)) FCEUI_VSUniToggleDIP(7); } else { static uint8 bbuf[32]; static int bbuft; static int barcoder = 0; if(keyonly(H)) FCEUI_NTSCSELHUE(); if(keyonly(T)) FCEUI_NTSCSELTINT(); if(KEY(KP_MINUS) || KEY(MINUS)) FCEUI_NTSCDEC(); if(KEY(KP_PLUS) || KEY(EQUAL)) FCEUI_NTSCINC(); if((InputType[2] == SIFC_BWORLD) || (cspec == SIS_DATACH)) { if(keyonly(F8)) { barcoder ^= 1; if(!barcoder) { if(InputType[2] == SIFC_BWORLD) { strcpy(&BWorldData[1],bbuf); BWorldData[0]=1; } else FCEUI_DatachSet(bbuf); FCEUI_DispMessage("Barcode Entered"); } else { bbuft = 0; FCEUI_DispMessage("Enter Barcode");} } } else barcoder = 0; #define SSM(x) \ { if(barcoder) { if(bbuft < 13) {bbuf[bbuft++] = '0' + x; bbuf[bbuft] = 0;} FCEUI_DispMessage("Barcode: %s",bbuf);} \ else { \ if(is_shift) FCEUI_SelectMovie(x); \ else FCEUI_SelectState(x); \ } } DIPSless: if(keyonly(0)) SSM(0); if(keyonly(1)) SSM(1); if(keyonly(2)) SSM(2); if(keyonly(3)) SSM(3); if(keyonly(4)) SSM(4); if(keyonly(5)) SSM(5); if(keyonly(6)) SSM(6); if(keyonly(7)) SSM(7); if(keyonly(8)) SSM(8); if(keyonly(9)) SSM(9); #undef SSM } } #define MK(x) {{BUTTC_KEYBOARD},{0},{MKK(x)},1} #define MK2(x1,x2) {{BUTTC_KEYBOARD},{0},{MKK(x1),MKK(x2)},2} #define MKZ() {{0},{0},{0},0} #define GPZ() {MKZ(), MKZ(), MKZ(), MKZ()} ButtConfig GamePadConfig[4][10]={ /* Gamepad 1 */ { MK(LEFTALT), MK(LEFTCONTROL), MK(TAB), MK(ENTER), MK(BL_CURSORUP), MK(BL_CURSORDOWN),MK(BL_CURSORLEFT),MK(BL_CURSORRIGHT) }, /* Gamepad 2 */ GPZ(), /* Gamepad 3 */ GPZ(), /* Gamepad 4 */ GPZ() }; static void UpdateGamepad(void) { static int rapid=0; uint32 JS=0; int x; int wg; rapid^=1; for(wg=0;wg<4;wg++) { for(x=0;x<8;x++) if(DTestButton(&GamePadConfig[wg][x])) JS|=(1<NumC;x++) { if(bc->ButtType[x]==BUTTC_KEYBOARD) { if(keys[bc->ButtonNum[x]]) { return(1); } } } if(DTestButtonJoy(bc)) return(1); return(0); } static char *MakeButtString(ButtConfig *bc) { int x; char tmpstr[512]; char *astr; tmpstr[0] = 0; for(x=0;xNumC;x++) { if(x) strcat(tmpstr, ", "); if(bc->ButtType[x] == BUTTC_KEYBOARD) { strcat(tmpstr,"KB: "); if(!GetKeyNameText(bc->ButtonNum[x]<<16,tmpstr+strlen(tmpstr),16)) sprintf(tmpstr+strlen(tmpstr),"%03d",bc->ButtonNum[x]); } else if(bc->ButtType[x] == BUTTC_JOYSTICK) { strcat(tmpstr,"JS "); sprintf(tmpstr+strlen(tmpstr), "%d ", bc->DeviceNum[x]); if(bc->ButtonNum[x] & 0x8000) { char *asel[3]={"x","y","z"}; sprintf(tmpstr+strlen(tmpstr), "axis %s%s", asel[bc->ButtonNum[x] & 3],(bc->ButtonNum[x]&0x4000)?"-":"+"); } else if(bc->ButtonNum[x] & 0x2000) { sprintf(tmpstr+strlen(tmpstr), "hat %d:%d", (bc->ButtonNum[x] >> 4)&3, bc->ButtonNum[x]&3); } else { sprintf(tmpstr+strlen(tmpstr), "button %d", bc->ButtonNum[x] & 127); } } } astr=malloc(strlen(tmpstr) + 1); strcpy(astr,tmpstr); return(astr); } static int DWBStarted; static ButtConfig *DWBButtons; static const uint8 *DWBText; static HWND die; static BOOL CALLBACK DWBCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { case WM_DESTROY: die = NULL; return(0); case WM_TIMER: { uint8 devicenum; uint16 buttonnum; GUID guid; if(DoJoyWaitTest(&guid, &devicenum, &buttonnum)) { ButtConfig *bc = DWBButtons; char *nstr; int wc; if(DWBStarted) { ButtConfig *bc = DWBButtons; bc->NumC = 0; DWBStarted = 0; } wc = bc->NumC; //FCEU_printf("%d: %d\n",devicenum,buttonnum); bc->ButtType[wc]=BUTTC_JOYSTICK; bc->DeviceNum[wc]=devicenum; bc->ButtonNum[wc]=buttonnum; bc->DeviceInstance[wc] = guid; /* Stop config if the user pushes the same button twice in a row. */ if(wc && bc->ButtType[wc]==bc->ButtType[wc-1] && bc->DeviceNum[wc]==bc->DeviceNum[wc-1] && bc->ButtonNum[wc]==bc->ButtonNum[wc-1]) goto gornk; bc->NumC++; /* Stop config if we reached our maximum button limit. */ if(bc->NumC >= MAXBUTTCONFIG) goto gornk; nstr = MakeButtString(bc); SetDlgItemText(hwndDlg, 100, nstr); free(nstr); } } break; case WM_USER + 666: //SetFocus(GetDlgItem(hwndDlg,100)); if(DWBStarted) { char *nstr; ButtConfig *bc = DWBButtons; bc->NumC = 0; DWBStarted = 0; nstr = MakeButtString(bc); SetDlgItemText(hwndDlg, 100, nstr); free(nstr); } { ButtConfig *bc = DWBButtons; int wc = bc->NumC; char *nstr; bc->ButtType[wc]=BUTTC_KEYBOARD; bc->DeviceNum[wc]=0; bc->ButtonNum[wc]=lParam&255; /* Stop config if the user pushes the same button twice in a row. */ if(wc && bc->ButtType[wc]==bc->ButtType[wc-1] && bc->DeviceNum[wc]==bc->DeviceNum[wc-1] && bc->ButtonNum[wc]==bc->ButtonNum[wc-1]) goto gornk; bc->NumC++; /* Stop config if we reached our maximum button limit. */ if(bc->NumC >= MAXBUTTCONFIG) goto gornk; nstr = MakeButtString(bc); SetDlgItemText(hwndDlg, 100, nstr); free(nstr); } break; case WM_INITDIALOG: SetWindowText(hwndDlg, DWBText); BeginJoyWait(hwndDlg); SetTimer(hwndDlg,666,25,0); /* Every 25ms.*/ { char *nstr = MakeButtString(DWBButtons); SetDlgItemText(hwndDlg, 100, nstr); free(nstr); } break; case WM_CLOSE: case WM_QUIT: goto gornk; case WM_COMMAND: switch(wParam&0xFFFF) { case 200: { ButtConfig *bc = DWBButtons; char *nstr; bc->NumC = 0; nstr = MakeButtString(bc); SetDlgItemText(hwndDlg, 100, nstr); free(nstr); } break; case 201: gornk: KillTimer(hwndDlg,666); EndJoyWait(hAppWnd); SetForegroundWindow(GetParent(hwndDlg)); DestroyWindow(hwndDlg); break; } } return 0; } int DWaitButton(HWND hParent, const uint8 *text, ButtConfig *bc) { DWBText=text; DWBButtons = bc; DWBStarted = 1; die = CreateDialog(fceu_hInstance, "DWBDIALOG", hParent, DWBCallB); EnableWindow(hParent, 0); ShowWindow(die, 1); while(die) { MSG msg; while(PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE)) { if(GetMessage(&msg, 0, 0, 0) > 0) { if(msg.message == WM_KEYDOWN || msg.message == WM_SYSKEYDOWN) { LPARAM tmpo; tmpo=((msg.lParam>>16)&0x7F)|((msg.lParam>>17)&0x80); PostMessage(die,WM_USER+666,0,tmpo); continue; } if(msg.message == WM_SYSCOMMAND) continue; if(!IsDialogMessage(die, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } } Sleep(10); } EnableWindow(hParent, 1); } static ButtConfig *DoTBButtons; static const char *DoTBTitle; static int DoTBMax; static int DoTBType,DoTBPort; static BOOL CALLBACK DoTBCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { case WM_INITDIALOG: if(DoTBType == SI_GAMEPAD) { char buf[32]; sprintf(buf,"Virtual Gamepad %d",DoTBPort+1); SetDlgItemText(hwndDlg, 100,buf); sprintf(buf,"Virtual Gamepad %d",DoTBPort+3); SetDlgItemText(hwndDlg, 101, buf); CheckDlgButton(hwndDlg,400,(eoptions & EO_NOFOURSCORE)?BST_CHECKED:BST_UNCHECKED); } SetWindowText(hwndDlg, DoTBTitle); break; case WM_CLOSE: case WM_QUIT: goto gornk; case WM_COMMAND: { int b; b=wParam&0xFFFF; if(b>= 300 && b < (300 + DoTBMax)) { char btext[128]; btext[0]=0; GetDlgItemText(hwndDlg, b, btext, 128); DWaitButton(hwndDlg, btext,&DoTBButtons[b - 300]); } else switch(wParam&0xFFFF) { case 1: gornk: if(DoTBType == SI_GAMEPAD) { eoptions &= ~EO_NOFOURSCORE; if(IsDlgButtonChecked(hwndDlg,400)==BST_CHECKED) eoptions|=EO_NOFOURSCORE; } EndDialog(hwndDlg,0); break; } } } return 0; } static void DoTBConfig(HWND hParent, const char *text, char *template, ButtConfig *buttons, int max) { DoTBTitle=text; DoTBButtons = buttons; DoTBMax = max; DialogBox(fceu_hInstance,template,hParent,DoTBCallB); } static BOOL CALLBACK InputConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { static const char *strn[6]={"","Gamepad","Zapper","Power Pad A","Power Pad B","Arkanoid Paddle"}; static const char *strf[13]= {"","Arkanoid Paddle","Hyper Shot gun","4-Player Adapter", "Family Keyboard","HyperShot Pads", "Mahjong", "Quiz King Buzzers", "Family Trainer A","Family Trainer B", "Oeka Kids Tablet", "Barcode World", "Top Rider"}; static const int haven[6]={0,1,0,1,1,0}; static const int havef[13]={0,0,0,0, 1,0,0,1, 1,1,0,0, 0}; int x; switch(uMsg) { case WM_INITDIALOG: for(x=0;x<2;x++) { int y; for(y=0;y<6;y++) SendDlgItemMessage(hwndDlg,104+x,CB_ADDSTRING,0,(LPARAM)(LPSTR)strn[y]); SendDlgItemMessage(hwndDlg,104+x,CB_SETCURSEL,UsrInputType[x],(LPARAM)(LPSTR)0); EnableWindow(GetDlgItem(hwndDlg,106+x),haven[InputType[x]]); SetDlgItemText(hwndDlg,200+x,(LPTSTR)strn[InputType[x]]); } { int y; for(y=0;y<13;y++) SendDlgItemMessage(hwndDlg,110,CB_ADDSTRING,0,(LPARAM)(LPSTR)strf[y]); SendDlgItemMessage(hwndDlg,110,CB_SETCURSEL,UsrInputType[2],(LPARAM)(LPSTR)0); EnableWindow(GetDlgItem(hwndDlg,111),havef[InputType[2]]); SetDlgItemText(hwndDlg,202,(LPTSTR)strf[InputType[2]]); } break; case WM_CLOSE: case WM_QUIT: goto gornk; case WM_COMMAND: if(HIWORD(wParam)==CBN_SELENDOK) { switch(LOWORD(wParam)) { case 104: case 105:UsrInputType[LOWORD(wParam)-104]=InputType[LOWORD(wParam)-104]=SendDlgItemMessage(hwndDlg,LOWORD(wParam),CB_GETCURSEL,0,(LPARAM)(LPSTR)0); EnableWindow( GetDlgItem(hwndDlg,LOWORD(wParam)+2),haven[InputType[LOWORD(wParam)-104]]); SetDlgItemText(hwndDlg,200+LOWORD(wParam)-104,(LPTSTR)strn[InputType[LOWORD(wParam)-104]]); break; case 110:UsrInputType[2]=InputType[2]=SendDlgItemMessage(hwndDlg,110,CB_GETCURSEL,0,(LPARAM)(LPSTR)0); EnableWindow(GetDlgItem(hwndDlg,111),havef[InputType[2]]); SetDlgItemText(hwndDlg,202,(LPTSTR)strf[InputType[2]]); break; } } if(!(wParam>>16)) switch(wParam&0xFFFF) { case 111: { const char *text = strf[InputType[2]]; DoTBType=DoTBPort=0; switch(InputType[2]) { case SIFC_FTRAINERA: case SIFC_FTRAINERB:DoTBConfig(hwndDlg, text, "POWERPADDIALOG", FTrainerButtons, 12); break; case SIFC_FKB:DoTBConfig(hwndDlg, text, "FKBDIALOG",fkbmap,0x48);break; case SIFC_QUIZKING:DoTBConfig(hwndDlg, text, "QUIZKINGDIALOG",QuizKingButtons,6);break; } } break; case 107: case 106: { int which=(wParam&0xFFFF)-106; const char *text = strn[InputType[which]]; DoTBType=DoTBPort=0; switch(InputType[which]) { case SI_GAMEPAD: { ButtConfig tmp[10 + 10]; memcpy(tmp, GamePadConfig[which], 10 * sizeof(ButtConfig)); memcpy(&tmp[10], GamePadConfig[which+2], 10 * sizeof(ButtConfig)); DoTBType=SI_GAMEPAD; DoTBPort=which; DoTBConfig(hwndDlg, text, "GAMEPADDIALOG", tmp, 10 + 10); memcpy(GamePadConfig[which], tmp, 10 * sizeof(ButtConfig)); memcpy(GamePadConfig[which+2], &tmp[10], 10 * sizeof(ButtConfig)); } break; case SI_POWERPADA: case SI_POWERPADB: DoTBConfig(hwndDlg, text, "POWERPADDIALOG",powerpadsc[which],12); break; } } break; case 1: gornk: EndDialog(hwndDlg,0); break; } } return 0; } void ConfigInput(HWND hParent) { DialogBox(fceu_hInstance,"INPUTCONFIG",hParent,InputConCallB); if(GI) InitOtherInput(); } void DestroyInput(void) { if(lpDI) { KillJoysticks(); KeyboardClose(); IDirectInput7_Release(lpDI); } } fceu-0.98.12/src/drivers/win/input.h0000644000175000000620000000205010110476322017055 0ustar joestaff00000000000000void ConfigInput(HWND hParent); int InitDInput(void); void CreateInputStuff(void); void InitInputStuff(void); void DestroyInput(void); void InputScreenChanged(int fs); extern LPDIRECTINPUT7 lpDI; extern int InputType[3]; extern int UsrInputType[3]; extern int cidisabled; #ifndef _aosdfjk02fmasf #define _aosdfjk02fmasf #include "../common/args.h" #include "../common/config.h" #define MAXBUTTCONFIG 4 typedef struct { uint8 ButtType[MAXBUTTCONFIG]; uint8 DeviceNum[MAXBUTTCONFIG]; uint16 ButtonNum[MAXBUTTCONFIG]; uint32 NumC; GUID DeviceInstance[MAXBUTTCONFIG]; //uint64 DeviceID[MAXBUTTCONFIG]; /* TODO */ } ButtConfig; extern CFGSTRUCT InputConfig[]; extern ARGPSTRUCT InputArgs[]; void ParseGIInput(FCEUGI *GI); #define BUTTC_KEYBOARD 0x00 #define BUTTC_JOYSTICK 0x01 #define BUTTC_MOUSE 0x02 #define FCFGD_GAMEPAD 1 #define FCFGD_POWERPAD 2 #define FCFGD_HYPERSHOT 3 #define FCFGD_QUIZKING 4 void InitOtherInput(void); #endif fceu-0.98.12/src/drivers/win/joystick.c0000644000175000000620000002405710110476314017564 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "common.h" #include #include "input.h" #include "joystick.h" #define MAX_JOYSTICKS 32 static LPDIRECTINPUTDEVICE7 Joysticks[MAX_JOYSTICKS]={0}; static GUID JoyGUID[MAX_JOYSTICKS]; static int numjoysticks = 0; static int HavePolled[MAX_JOYSTICKS]; static DIJOYSTATE2 StatusSave[MAX_JOYSTICKS]; static int FindByGUID(GUID how) { int x; for(x=0; x> 1) + (pov & 1); pov &= 3; return(pov); } lowpov = pov % 9000; if(lowpov < (4500 - 4500 / 2)) { pov /= 9000; } else if(lowpov > (4500 + 4500/2)) { pov /= 9000; pov = (pov + 1) % 4; } else { if(!roundpos) pov /= 9000; else { pov /= 9000; pov = (pov + 1) % 4; } } return(pov); } typedef struct { LONG MinX; LONG MaxX; LONG MinY; LONG MaxY; LONG MinZ; LONG MaxZ; } POWER_RANGER; static POWER_RANGER ranges[MAX_JOYSTICKS]; // r=diprg.lMax-diprg.lMin; // JoyXMax[w]=diprg.lMax-(r>>2); // JoyXMin[w]=diprg.lMin+(r>>2); static int JoyAutoRestore(HRESULT dival,LPDIRECTINPUTDEVICE7 lpJJoy) { switch(dival) { case DIERR_INPUTLOST: case DIERR_NOTACQUIRED: return(IDirectInputDevice7_Acquire(lpJJoy)==DI_OK); } return(0); } /* Called during normal emulator operation, not during button configuration. */ /* Call before DTestButtonJoy */ void UpdateJoysticks(void) { memset(HavePolled, 0, sizeof(HavePolled)); } int DTestButtonJoy(ButtConfig *bc) { int x; for(x=0;xNumC;x++) { HRESULT dival; int n = bc->DeviceNum[x]; if(n == 0xFF) continue; if(bc->ButtType[x] != BUTTC_JOYSTICK) continue; if(n >= numjoysticks) continue; if(!HavePolled[n]) { while((dival = IDirectInputDevice7_Poll(Joysticks[n])) != DI_OK) { if(dival == DI_NOEFFECT) break; if(!JoyAutoRestore(dival,Joysticks[n])) { return(0); } } IDirectInputDevice7_GetDeviceState(Joysticks[n],sizeof(DIJOYSTATE2),&StatusSave[n]); HavePolled[n] = 1; } if(bc->ButtonNum[x]&0x8000) /* Axis "button" */ { int sa = bc->ButtonNum[x]&3; long source; if(sa == 0) source=((int64)StatusSave[n].lX - ranges[n].MinX) * 262144 / (ranges[n].MaxX - ranges[n].MinX) - 131072; else if(sa == 1) source=((int64)StatusSave[n].lY - ranges[n].MinY) * 262144 / (ranges[n].MaxY - ranges[n].MinY) - 131072; else if(sa == 2) source=((int64)StatusSave[n].lZ - ranges[n].MinZ) * 262144 / (ranges[n].MaxZ - ranges[n].MinZ) - 131072; /* Now, source is of the range -131072 to 131071. Good enough. */ if(bc->ButtonNum[x] & 0x4000) { if(source <= (0 - 262144/4)) return(1); } else { if(source >= (262144/4)) return(1); } } else if(bc->ButtonNum[x]&0x2000) /* Hat "button" */ { int wpov = StatusSave[n].rgdwPOV[(bc->ButtonNum[x] >> 4) &3]; int tpov = bc->ButtonNum[x] & 3; if(POVFix(wpov, 0) == tpov || POVFix(wpov, 1) == tpov) return(1); } else /* Normal button */ { if(StatusSave[n].rgbButtons[bc->ButtonNum[x] & 127]&0x80) return(1); } } return(0); } static int canax[MAX_JOYSTICKS][3]; /* Now the fun configuration test begins. */ void BeginJoyWait(HWND hwnd) { int n; //StatusSave = malloc(sizeof(DIJOYSTATE2) * numjoysticks); memset(canax, 0, sizeof(canax)); for(n=0; n= 65536 && canax[n][0]) { *guid = JoyGUID[n]; *devicenum = n; *buttonnum = 0x8000 | (0) | ((source < 0) ? 0x4000 : 0); memcpy(&StatusSave[n], &JoyStatus, sizeof(DIJOYSTATE2)); canax[n][0] = 0; return(1); } else if(abs(source) <= 32768) canax[n][0] = 1; } if(day) { source=((int64)JoyStatus.lY - ranges[n].MinY) * 262144 / day - 131072; psource=((int64)StatusSave[n].lY - ranges[n].MinY) * 262144 / day - 131072; if(abs(source) >= 65536 && canax[n][1]) { *guid = JoyGUID[n]; *devicenum = n; *buttonnum = 0x8000 | (1) | ((source < 0) ? 0x4000 : 0); memcpy(&StatusSave[n], &JoyStatus, sizeof(DIJOYSTATE2)); canax[n][1] = 0; return(1); } else if(abs(source) <= 32768) canax[n][1] = 1; } if(daz) { } for(x=0; x<4; x++) { if(POVFix(JoyStatus.rgdwPOV[x],-1) != FPOV_CENTER && POVFix(StatusSave[n].rgdwPOV[x],-1) == FPOV_CENTER) { *guid = JoyGUID[n]; *devicenum = n; *buttonnum = 0x2000 | (x<<4) | POVFix(JoyStatus.rgdwPOV[x], -1); memcpy(&StatusSave[n], &JoyStatus, sizeof(DIJOYSTATE2)); return(1); } } memcpy(&StatusSave[n], &JoyStatus, sizeof(DIJOYSTATE2)); } return(0); } void EndJoyWait(HWND hwnd) { int n; for(n=0; nNumC; x++) if(bc->ButtType[x] == BUTTC_JOYSTICK) bc->DeviceNum[x] = FindByGUID(bc->DeviceInstance[x]); } static int GetARange(LPDIRECTINPUTDEVICE7 dev, LONG which, LONG *min, LONG *max) { HRESULT dival; DIPROPRANGE diprg; int r; memset(&diprg,0,sizeof(DIPROPRANGE)); diprg.diph.dwSize=sizeof(DIPROPRANGE); diprg.diph.dwHeaderSize=sizeof(DIPROPHEADER); diprg.diph.dwHow=DIPH_BYOFFSET; diprg.diph.dwObj=which; dival=IDirectInputDevice7_GetProperty(dev,DIPROP_RANGE,&diprg.diph); if(dival!=DI_OK) { *min = *max = 0; return(1); } *min = diprg.lMin; *max = diprg.lMax; return(1); } static BOOL CALLBACK JoystickFound(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef) { HRESULT dival; int n = numjoysticks; if(DI_OK != IDirectInput7_CreateDeviceEx(lpDI,&lpddi->guidInstance,&IID_IDirectInputDevice7,(LPVOID *)&Joysticks[n],0)) { FCEU_printf("Device creation of a joystick failed during init.\n"); return(DIENUM_CONTINUE); } if(DI_OK != IDirectInputDevice7_SetCooperativeLevel(Joysticks[n],*(HWND *)pvRef, DISCL_FOREGROUND|DISCL_NONEXCLUSIVE)) { FCEU_printf("Cooperative level set of a joystick failed during init.\n"); IDirectInputDevice7_Release(Joysticks[n]); return(DIENUM_CONTINUE); } if(DI_OK != IDirectInputDevice7_SetDataFormat(Joysticks[n], &c_dfDIJoystick2)) { FCEU_printf("Data format set of a joystick failed during init.\n"); IDirectInputDevice7_Release(Joysticks[n]); return(DIENUM_CONTINUE); } GetARange(Joysticks[n], DIJOFS_X, &ranges[n].MinX, &ranges[n].MaxX); GetARange(Joysticks[n], DIJOFS_Y, &ranges[n].MinY, &ranges[n].MaxY); GetARange(Joysticks[n], DIJOFS_Z, &ranges[n].MinZ, &ranges[n].MaxZ); JoyGUID[numjoysticks] = lpddi->guidInstance; if(DI_OK != IDirectInputDevice7_Acquire(Joysticks[n])) { //FCEU_printf("Acquire of a joystick failed during init.\n"); } numjoysticks++; if(numjoysticks > MAX_JOYSTICKS) return(0); return(DIENUM_CONTINUE); } int InitJoysticks(HWND hwnd) { IDirectInput7_EnumDevices(lpDI, DIDEVTYPE_JOYSTICK, JoystickFound, (LPVOID *)&hwnd, DIEDFL_ATTACHEDONLY); return(1); } fceu-0.98.12/src/drivers/win/joystick.h0000644000175000000620000000044310110476322017561 0ustar joestaff00000000000000int InitJoysticks(HWND wnd); int KillJoysticks(void); void BeginJoyWait(HWND hwnd); int DoJoyWaitTest(GUID *guid, uint8 *devicenum, uint16 *buttonnum); void EndJoyWait(HWND hwnd); void JoyClearBC(ButtConfig *bc); void UpdateJoysticks(void); int DTestButtonJoy(ButtConfig *bc); fceu-0.98.12/src/drivers/win/keyboard.c0000644000175000000620000000462310110476314017522 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "common.h" #include #include "input.h" #include "keyboard.h" HRESULT ddrval; static LPDIRECTINPUTDEVICE7 lpdid=0; void KeyboardClose(void) { if(lpdid) IDirectInputDevice7_Unacquire(lpdid); lpdid=0; } static char keys[256]; void KeyboardUpdateState(void) { char tk[256]; ddrval=IDirectInputDevice7_GetDeviceState(lpdid,256,tk); switch(ddrval) { case DI_OK: memcpy(keys,tk,256);break; case DIERR_INPUTLOST: case DIERR_NOTACQUIRED: memset(keys,0,256); IDirectInputDevice7_Acquire(lpdid); break; } } char *GetKeyboard(void) { return(keys); } int KeyboardInitialize(void) { if(lpdid) return(1); ddrval=IDirectInput7_CreateDeviceEx(lpDI, &GUID_SysKeyboard,&IID_IDirectInputDevice7, (LPVOID *)&lpdid,0); if(ddrval != DI_OK) { FCEUD_PrintError("DirectInput: Error creating keyboard device."); return 0; } ddrval=IDirectInputDevice7_SetCooperativeLevel(lpdid, hAppWnd,DISCL_FOREGROUND|DISCL_NONEXCLUSIVE); if(ddrval != DI_OK) { FCEUD_PrintError("DirectInput: Error setting keyboard cooperative level."); return 0; } ddrval=IDirectInputDevice7_SetDataFormat(lpdid,&c_dfDIKeyboard); if(ddrval != DI_OK) { FCEUD_PrintError("DirectInput: Error setting keyboard data format."); return 0; } ddrval=IDirectInputDevice7_Acquire(lpdid); /* Not really a fatal error. */ //if(ddrval != DI_OK) //{ // FCEUD_PrintError("DirectInput: Error acquiring keyboard."); // return 0; //} return 1; } fceu-0.98.12/src/drivers/win/keyboard.h0000644000175000000620000000016210110476322017520 0ustar joestaff00000000000000void KeyboardClose(void); int KeyboardInitialize(void); void KeyboardUpdate(void); char *GetKeyboard(void); fceu-0.98.12/src/drivers/win/keyscan.h0000644000175000000620000000755610110476322017373 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 SCAN_GRAVE 0x29 #define SCAN_1 0x02 #define SCAN_2 0x03 #define SCAN_3 0x04 #define SCAN_4 0x05 #define SCAN_5 0x06 #define SCAN_6 0x07 #define SCAN_7 0x08 #define SCAN_8 0x09 #define SCAN_9 0x0A #define SCAN_0 0x0B #define SCAN_MINUS 0x0C #define SCAN_EQUAL 0x0D #define SCAN_BACKSLASH 0x2B #define SCAN_BACKSPACE 0x0E #define SCAN_TAB 0x0F #define SCAN_Q 0x10 #define SCAN_W 0x11 #define SCAN_E 0x12 #define SCAN_R 0x13 #define SCAN_T 0x14 #define SCAN_Y 0x15 #define SCAN_U 0x16 #define SCAN_I 0x17 #define SCAN_O 0x18 #define SCAN_P 0x19 #define SCAN_BRACKET_LEFT 0x1A #define SCAN_BRACKET_RIGHT 0x1B #define SCAN_LOWBACKSLASH 0x2B #define SCAN_CAPSLOCK 0x3A #define SCAN_A 0x1E #define SCAN_S 0x1F #define SCAN_D 0x20 #define SCAN_F 0x21 #define SCAN_G 0x22 #define SCAN_H 0x23 #define SCAN_J 0x24 #define SCAN_K 0x25 #define SCAN_L 0x26 #define SCAN_SEMICOLON 0x27 #define SCAN_APOSTROPHE 0x28 #define SCAN_ENTER 0x1C #define SCAN_LEFTSHIFT 0x2A #define SCAN_Z 0x2C #define SCAN_X 0x2D #define SCAN_C 0x2E #define SCAN_V 0x2F #define SCAN_B 0x30 #define SCAN_N 0x31 #define SCAN_M 0x32 #define SCAN_COMMA 0x33 #define SCAN_PERIOD 0x34 #define SCAN_SLASH 0x35 #define SCAN_RIGHTSHIFT 0x36 #define SCAN_LEFTCONTROL 0x1D #define SCAN_LEFTALT 0x38 #define SCAN_SPACE 0x39 #define SCAN_RIGHTALT (0x38|0x80) #define SCAN_RIGHTCONTROL (0x1D|0x80) #define SCAN_BL_INSERT (0x52|0x80) #define SCAN_BL_DELETE (0x53|0x80) #define SCAN_BL_CURSORLEFT (0x4B|0x80) #define SCAN_BL_HOME (0x47|0x80) #define SCAN_BL_END (0x4F|0x80) #define SCAN_BL_CURSORUP (0x48|0x80) #define SCAN_BL_CURSORDOWN (0x50|0x80) #define SCAN_BL_PAGEUP (0x49|0x80) #define SCAN_BL_PAGEDOWN (0x51|0x80) #define SCAN_BL_CURSORRIGHT (0x4D|0x80) #define SCAN_SCROLLLOCK 0x46 /* Keys in the key pad area. */ #define SCAN_NUMLOCK 0x45 #define SCAN_HOME 0x47 #define SCAN_CURSORLEFT 0x4B #define SCAN_END 0x4F #define SCAN_SLASH 0x35 #define SCAN_CURSORUP 0x48 #define SCAN_CENTER 0x4C #define SCAN_CURSORDOWN 0x50 #define SCAN_INSERT 0x52 #define SCAN_ASTERISK 0x37 #define SCAN_PAGEUP 0x49 #define SCAN_CURSORRIGHT 0x4D #define SCAN_PAGEDOWN 0x51 #define SCAN_KP_DELETE 0x53 #define SCAN_KP_MINUS 0x4A #define SCAN_KP_PLUS 0x4E #define SCAN_KP_ENTER 0x1C #define SCAN_ESCAPE 0x01 #define SCAN_F1 0x3B #define SCAN_F2 0x3C #define SCAN_F3 0x3D #define SCAN_F4 0x3E #define SCAN_F5 0x3F #define SCAN_F6 0x40 #define SCAN_F7 0x41 #define SCAN_F8 0x42 #define SCAN_F9 0x43 #define SCAN_F10 0x44 #define SCAN_F11 0x57 #define SCAN_F12 0x58 #define MKK(k) SCAN_##k #define MKK_COUNT (256) fceu-0.98.12/src/drivers/win/throttle.c0000644000175000000620000000421410110476314017563 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ static uint64 tmethod,tfreq; static uint64 desiredfps; static void RefreshThrottleFPS(void) { desiredfps=FCEUI_GetDesiredFPS()>>8; } static uint64 GetCurTime(void) { if(tmethod) { uint64 tmp; /* Practically, LARGE_INTEGER and uint64 differ only by signness and name. */ QueryPerformanceCounter((LARGE_INTEGER*)&tmp); return(tmp); } else return((uint64)GetTickCount()); } static void InitSpeedThrottle(void) { tmethod=0; if(QueryPerformanceFrequency((LARGE_INTEGER*)&tfreq)) { tmethod=1; } else tfreq=1000; tfreq<<=16; /* Adjustment for fps returned from FCEUI_GetDesiredFPS(). */ } static int SpeedThrottle(void) { static uint64 ttime,ltime; waiter: ttime=GetCurTime(); if( (ttime-ltime) < (tfreq/desiredfps) ) { uint64 sleepy; sleepy=(tfreq/desiredfps)-(ttime-ltime); sleepy*=1000; sleepy/=tfreq>>16; Sleep(sleepy); goto waiter; } if( (ttime-ltime) >= (tfreq*4/desiredfps)) ltime=ttime; else { ltime+=tfreq/desiredfps; if( (ttime-ltime) >= (tfreq/desiredfps) ) // Oops, we're behind! return(1); } return(0); } // Quick code for internal FPS display. uint64 FCEUD_GetTime(void) { return(GetCurTime()); } uint64 FCEUD_GetTimeFreq(void) { return(tfreq>>16); } fceu-0.98.12/src/drivers/win/state.c0000644000175000000620000000164610110476314017044 0ustar joestaff00000000000000void SaveStateAs(void) { const char filter[]="FCE Ultra Save State(*.fc?)\0*.fc?\0"; char nameo[2048]; OPENFILENAME ofn; memset(&ofn,0,sizeof(ofn)); ofn.lStructSize=sizeof(ofn); ofn.hInstance=fceu_hInstance; ofn.lpstrTitle="Save State As..."; ofn.lpstrFilter=filter; nameo[0]=0; ofn.lpstrFile=nameo; ofn.nMaxFile=256; ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY; if(GetSaveFileName(&ofn)) FCEUI_SaveState(nameo); } void LoadStateFrom(void) { const char filter[]="FCE Ultra Save State(*.fc?)\0*.fc?\0"; char nameo[2048]; OPENFILENAME ofn; memset(&ofn,0,sizeof(ofn)); ofn.lStructSize=sizeof(ofn); ofn.hInstance=fceu_hInstance; ofn.lpstrTitle="Load State From..."; ofn.lpstrFilter=filter; nameo[0]=0; ofn.lpstrFile=nameo; ofn.nMaxFile=256; ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY; if(GetOpenFileName(&ofn)) FCEUI_LoadState(nameo); } fceu-0.98.12/src/drivers/win/debug.h0000644000175000000620000000012510110476322017005 0ustar joestaff00000000000000void KillDebugger(void); void UpdateDebugger(void); void BeginDSeq(HWND hParent); fceu-0.98.12/src/drivers/win/log.h0000644000175000000620000000010510110476322016476 0ustar joestaff00000000000000void MakeLogWindow(void); void AddLogText(char *text,int newline); fceu-0.98.12/src/drivers/win/log.c0000644000175000000620000000315510110476314016502 0ustar joestaff00000000000000#include #include "common.h" static HWND logwin=0; static char *logtext[64]; static int logcount=0; static void RedoText(void) { char textbuf[65536]; int x; textbuf[0]=0; if(logcount>=64) { x=logcount&63; for(;;) { strcat(textbuf,logtext[x]); x=(x+1)&63; if(x==(logcount&63)) break; } } else for(x=0;x=64) free(logtext[logcount&63]); x=0; t=text; while(*t) { if(*t=='\n') x++; t++; } if(!(logtext[logcount&63]=malloc(strlen(text)+1+x+newline*2))) return; t=logtext[logcount&63]; while(*text) { if(*text=='\n') { *t='\r'; t++; } *t=*text; t++; text++; } if(newline) { *t='\r'; t++; *t='\n'; t++; } *t=0; logcount++; if(logwin) RedoText(); } void FCEUD_Message(char *text) { AddLogText(text,0); } fceu-0.98.12/src/drivers/win/window.c0000644000175000000620000007513010110476314017232 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "state.c" /* Save/Load state AS */ void DSMFix(UINT msg) { switch(msg) { case WM_VSCROLL: case WM_NCRBUTTONDOWN: case WM_NCMBUTTONDOWN: case WM_NCLBUTTONDOWN: case WM_ENTERMENULOOP:StopSound();break; } } static void ConfigGUI(void); static void ConfigTiming(void); static void ConfigPalette(void); static void ConfigDirectories(void); static HMENU fceumenu=0; static int tog=0; void ShowCursorAbs(int w) { static int stat=0; if(w) { if(stat==-1) {stat++; ShowCursor(1);} } else { if(stat==0) {stat--; ShowCursor(0);} } } void CalcWindowSize(RECT *al) { al->left=0; al->right=VNSWID*winsizemulx; al->top=0; al->bottom=totallines*winsizemuly; AdjustWindowRectEx(al,GetWindowLong(hAppWnd,GWL_STYLE),GetMenu(hAppWnd)!=NULL,GetWindowLong(hAppWnd,GWL_EXSTYLE)); al->right-=al->left; al->left=0; al->bottom-=al->top; al->top=0; } void RedoMenuGI(FCEUGI *gi) { int simpled[]={101,111,110,200,201,204,203,0}; int x; x = 0; while(simpled[x]) { EnableMenuItem(fceumenu,simpled[x],MF_BYCOMMAND | (gi?MF_ENABLED:MF_GRAYED)); x++; } } void UpdateMenu(void) { static int *polo[2]={&genie,&palyo}; static int polo2[2]={310,311}; int x; for(x=0;x<2;x++) CheckMenuItem(fceumenu,polo2[x],*polo[x]?MF_CHECKED:MF_UNCHECKED); if(eoptions&EO_BGRUN) CheckMenuItem(fceumenu,301,MF_CHECKED); else CheckMenuItem(fceumenu,301,MF_UNCHECKED); } static HMENU recentmenu, recentdmenu; char *rfiles[10]={0,0,0,0,0,0,0,0,0,0}; char *rdirs[10]={0,0,0,0,0,0,0,0,0,0}; void UpdateRMenu(HMENU menu, char **strs, int mitem, int baseid) { MENUITEMINFO moo; int x; moo.cbSize=sizeof(moo); moo.fMask=MIIM_SUBMENU|MIIM_STATE; GetMenuItemInfo(GetSubMenu(fceumenu,0),mitem,FALSE,&moo); moo.hSubMenu=menu; moo.fState=strs[0]?MFS_ENABLED:MFS_GRAYED; SetMenuItemInfo(GetSubMenu(fceumenu,0),mitem,FALSE,&moo); for(x=0;x<10;x++) RemoveMenu(menu,baseid+x,MF_BYCOMMAND); for(x=9;x>=0;x--) { char tmp[128+5]; if(!strs[x]) continue; moo.cbSize=sizeof(moo); moo.fMask=MIIM_DATA|MIIM_ID|MIIM_TYPE; if(strlen(strs[x])<128) { sprintf(tmp,"&%d. %s",(x+1)%10,strs[x]); } else sprintf(tmp,"&%d. %s",(x+1)%10,strs[x]+strlen(strs[x])-127); moo.cch=strlen(tmp); moo.fType=0; moo.wID=baseid+x; moo.dwTypeData=tmp; InsertMenuItem(menu,0,1,&moo); } DrawMenuBar(hAppWnd); } void AddRecent(char *fn) { int x; for(x=0;x<10;x++) if(rfiles[x]) if(!strcmp(rfiles[x],fn)) // Item is already in list. { int y; char *tmp; tmp=rfiles[x]; // Save pointer. for(y=x;y;y--) rfiles[y]=rfiles[y-1]; // Move items down. rfiles[0]=tmp; // Put item on top. UpdateRMenu(recentmenu, rfiles, 102, 600); return; } if(rfiles[9]) free(rfiles[9]); for(x=9;x;x--) rfiles[x]=rfiles[x-1]; rfiles[0]=malloc(strlen(fn)+1); strcpy(rfiles[0],fn); UpdateRMenu(recentmenu, rfiles, 102, 600); } void AddRecentDir(char *fn) { int x; for(x=0;x<10;x++) if(rdirs[x]) if(!strcmp(rdirs[x],fn)) // Item is already in list. { int y; char *tmp; tmp=rdirs[x]; // Save pointer. for(y=x;y;y--) rdirs[y]=rdirs[y-1]; // Move items down. rdirs[0]=tmp; // Put item on top. UpdateRMenu(recentdmenu, rdirs, 103, 700); return; } if(rdirs[9]) free(rdirs[9]); for(x=9;x;x--) rdirs[x]=rdirs[x-1]; rdirs[0]=malloc(strlen(fn)+1); strcpy(rdirs[0],fn); UpdateRMenu(recentdmenu, rdirs, 103, 700); } void HideMenu(int h) { if(h) { SetMenu(hAppWnd,0); } else { SetMenu(hAppWnd,fceumenu); } } static LONG WindowXC=1<<30,WindowYC; void HideFWindow(int h) { LONG desa; if(h) /* Full-screen. */ { RECT bo; GetWindowRect(hAppWnd,&bo); WindowXC=bo.left; WindowYC=bo.top; SetMenu(hAppWnd,0); desa=WS_POPUP|WS_CLIPSIBLINGS; } else { desa=WS_OVERLAPPEDWINDOW|WS_CLIPSIBLINGS; HideMenu(tog); /* Stupid DirectDraw bug(I think?) requires this. Need to investigate it. */ SetWindowPos(hAppWnd,HWND_NOTOPMOST,0,0,0,0,SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOREPOSITION|SWP_NOSIZE); } SetWindowLong(hAppWnd,GWL_STYLE,desa|(GetWindowLong(hAppWnd,GWL_STYLE)&WS_VISIBLE)); SetWindowPos(hAppWnd,0,0,0,0,0,SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOREPOSITION|SWP_NOSIZE|SWP_NOZORDER); } void ToggleHideMenu(void) { if(!fullscreen) { tog^=1; HideMenu(tog); SetMainWindowStuff(); } } static void ALoad(char *nameo) { if((GI=FCEUI_LoadGame(nameo))) { FixFL(); SetMainWindowStuff(); AddRecent(nameo); RefreshThrottleFPS(); if(eoptions&EO_HIDEMENU && !tog) ToggleHideMenu(); if(eoptions&EO_FSAFTERLOAD) SetFSVideoMode(); } else StopSound(); ParseGIInput(GI); RedoMenuGI(GI); } void LoadNewGamey(HWND hParent, char *initialdir) { const char filter[]="All usable files(*.nes,*.nsf,*.fds,*.unf,*.zip,*.gz)\0*.nes;*.nsf;*.fds;*.unf;*.zip;*.gz\0All non-compressed usable files(*.nes,*.nsf,*.fds,*.unf)\0*.nes;*.nsf;*.fds;*.unf\0All files (*.*)\0*.*\0"; char nameo[2048]; OPENFILENAME ofn; memset(&ofn,0,sizeof(ofn)); ofn.lStructSize=sizeof(ofn); ofn.hInstance=fceu_hInstance; ofn.lpstrTitle="FCE Ultra Open File..."; ofn.lpstrFilter=filter; nameo[0]=0; ofn.hwndOwner=hParent; ofn.lpstrFile=nameo; ofn.nMaxFile=256; ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY; //OFN_EXPLORER|OFN_ENABLETEMPLATE|OFN_ENABLEHOOK; ofn.lpstrInitialDir=initialdir?initialdir:gfsdir; if(GetOpenFileName(&ofn)) { char *tmpdir; if((tmpdir=malloc(ofn.nFileOffset+1))) { strncpy(tmpdir,ofn.lpstrFile,ofn.nFileOffset); tmpdir[ofn.nFileOffset]=0; AddRecentDir(tmpdir); if(!initialdir) // Prevent setting the File->Open default // directory when a "Recent Directory" is selected. { if(gfsdir) free(gfsdir); gfsdir = tmpdir; } else free(tmpdir); } ALoad(nameo); } } static uint32 mousex,mousey,mouseb; void GetMouseData(uint32 *md) { md[0]=mousex; md[1]=mousey; if(!fullscreen) { if(ismaximized) { RECT t; GetClientRect(hAppWnd, &t); md[0] = md[0] * VNSWID / (t.right?t.right:1); md[1] = md[1] * totallines / (t.bottom?t.bottom:1); } else { md[0]/=winsizemulx; md[1]/=winsizemuly; } md[0]+=VNSCLIP; } md[1]+=srendline; md[2]=((mouseb==MK_LBUTTON)?1:0)|((mouseb==MK_RBUTTON)?2:0); } //static int sizchange=0; static int vchanged=0; LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) { DSMFix(msg); switch(msg) { case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_RBUTTONDOWN: case WM_RBUTTONUP: mouseb=wParam; goto proco; case WM_MOUSEMOVE: { mousex=LOWORD(lParam); mousey=HIWORD(lParam); } goto proco; case WM_ERASEBKGND: if(xbsave) return(0); else goto proco; case WM_PAINT:if(xbsave) { PAINTSTRUCT ps; BeginPaint(hWnd,&ps); FCEUD_BlitScreen(xbsave); EndPaint(hWnd,&ps); return(0); } goto proco; case WM_SIZE: if(!fullscreen && !changerecursive) switch(wParam) { case SIZE_MAXIMIZED: ismaximized = 1;SetMainWindowStuff();break; case SIZE_RESTORED: ismaximized = 0;SetMainWindowStuff();break; } break; case WM_SIZING: { RECT *wrect=(RECT *)lParam; RECT srect; int h=wrect->bottom-wrect->top; int w=wrect->right-wrect->left; int how; if(wParam == WMSZ_BOTTOM || wParam == WMSZ_TOP) how = 2; else if(wParam == WMSZ_LEFT || wParam == WMSZ_RIGHT) how = 1; else if(wParam == WMSZ_BOTTOMLEFT || wParam == WMSZ_BOTTOMRIGHT || wParam == WMSZ_TOPRIGHT || wParam == WMSZ_TOPLEFT) how = 3; if(how & 1) winsizemulx*= (double)w/winwidth; if(how & 2) winsizemuly*= (double)h/winheight; if(how & 1) FixWXY(0); else FixWXY(1); CalcWindowSize(&srect); winwidth=srect.right; winheight=srect.bottom; wrect->right = wrect->left + srect.right; wrect->bottom = wrect->top + srect.bottom; } //sizchange=1; //break; goto proco; case WM_DISPLAYCHANGE: if(!fullscreen && !changerecursive) vchanged=1; goto proco; case WM_DROPFILES: { UINT len; char *ftmp; len=DragQueryFile((HANDLE)wParam,0,0,0)+1; if((ftmp=malloc(len))) { DragQueryFile((HANDLE)wParam,0,ftmp,len); ALoad(ftmp); free(ftmp); } } break; case WM_COMMAND: if(!(wParam>>16)) { wParam&=0xFFFF; if(wParam>=600 && wParam<=609) // Recent files { if(rfiles[wParam-600]) ALoad(rfiles[wParam-600]); } else if(wParam >= 700 && wParam <= 709) // Recent dirs { if(rdirs[wParam-700]) LoadNewGamey(hWnd, rdirs[wParam - 700]); } switch(wParam) { case 300:ToggleHideMenu();break; case 301:eoptions^=EO_BGRUN;UpdateMenu();break; case 310:genie^=1;FCEUI_SetGameGenie(genie);UpdateMenu();break; case 311:palyo^=1; FCEUI_SetVidSystem(palyo); RefreshThrottleFPS(); UpdateMenu(); FixFL(); SetMainWindowStuff(); break; case 320:StopSound();ConfigDirectories();break; case 327:StopSound();ConfigGUI();break; case 321:StopSound();ConfigInput(hWnd);break; case 322:ConfigTiming();break; case 323:StopSound();ShowNetplayConsole();break; case 324:StopSound();ConfigPalette();break; case 325:StopSound();ConfigSound();break; case 326:ConfigVideo();break; case 200:FCEUI_ResetNES();break; case 201:FCEUI_PowerNES();break; case 203:BeginDSeq(hWnd);break; case 204:ConfigAddCheat(hWnd);break; case 100:StopSound(); LoadNewGamey(hWnd, 0); break; case 101:if(GI) { KillDebugger(); FCEUI_CloseGame(); GI=0; RedoMenuGI(GI); } break; case 110:SaveStateAs();break; case 111:LoadStateFrom();break; case 120: { MENUITEMINFO mi; char *str; StopSound(); if(CreateSoundSave()) str="Stop Sound Logging"; else str="Log Sound As..."; memset(&mi,0,sizeof(mi)); mi.fMask=MIIM_DATA|MIIM_TYPE; mi.cbSize=sizeof(mi); GetMenuItemInfo(fceumenu,120,0,&mi); mi.fMask=MIIM_DATA|MIIM_TYPE; mi.cbSize=sizeof(mi); mi.dwTypeData=str; mi.cch=strlen(str); SetMenuItemInfo(fceumenu,120,0,&mi); } break; case 130:DoFCEUExit();break; case 400:StopSound();ShowAboutBox();break; case 401:MakeLogWindow();break; } } break; case WM_SYSCOMMAND: if(GI && wParam == SC_SCREENSAVE && (goptions & GOO_DISABLESS)) return(0); if(wParam==SC_KEYMENU) { if(GI && InputType[2]==SIFC_FKB && cidisabled) break; if(lParam == VK_RETURN || fullscreen || tog) break; } goto proco; case WM_SYSKEYDOWN: if(GI && InputType[2]==SIFC_FKB && cidisabled) break; /* Hopefully this won't break DInput... */ if(fullscreen || tog) { if(wParam==VK_MENU) break; } if(wParam==VK_F10) { if(!moocow) FCEUD_PrintError("Iyee"); if(!(lParam&0x40000000)) FCEUI_ResetNES(); break; } if(wParam == VK_RETURN) { if(!(lParam&(1<<30))) { UpdateMenu(); changerecursive=1; if(!SetVideoMode(fullscreen^1)) SetVideoMode(fullscreen); changerecursive=0; } break; } goto proco; case WM_KEYDOWN: if(GI) { /* Only disable command keys if a game is loaded(and the other conditions are right, of course). */ if(InputType[2]==SIFC_FKB) { if(wParam==VK_SCROLL) { cidisabled^=1; FCEUI_DispMessage("Family Keyboard %sabled.",cidisabled?"en":"dis"); } if(cidisabled) break; /* Hopefully this won't break DInput... */ } } if(!(lParam&0x40000000)) switch( wParam ) { case VK_F11:FCEUI_PowerNES();break; case VK_F12:DoFCEUExit();break; case VK_F2:userpause^=1;break; case VK_F3:ToggleHideMenu();break; } goto proco; case WM_CLOSE: case WM_DESTROY: case WM_QUIT:DoFCEUExit();break; case WM_ACTIVATEAPP: if((BOOL)wParam) { nofocus=0; } else { nofocus=1; } default: proco: return DefWindowProc(hWnd,msg,wParam,lParam); } return 0; } void FixWXY(int pref) { if(eoptions&EO_FORCEASPECT) { /* First, make sure the ratio is valid, and if it's not, change it so that it doesn't break everything. */ if(saspectw < 0.01) saspectw = 0.01; if(saspecth < 0.01) saspecth = 0.01; if((saspectw / saspecth) > 100) saspecth = saspectw; if((saspecth / saspectw) > 100) saspectw = saspecth; if((saspectw / saspecth) < 0.1) saspecth = saspectw; if((saspecth / saspectw) > 0.1) saspectw = saspecth; if(!pref) { winsizemuly = winsizemulx * 256 / 240 * 3 / 4 * saspectw / saspecth; } else { winsizemulx = winsizemuly * 240 / 256 * 4 / 3 * saspecth / saspectw; } } if(winspecial) { int mult; if(winspecial == 1 || winspecial == 2) mult = 2; else mult = 3; if(winsizemulx < mult) { if(eoptions&EO_FORCEASPECT) winsizemuly *= mult / winsizemulx; winsizemulx = mult; } if(winsizemuly < mult) { if(eoptions&EO_FORCEASPECT) winsizemulx *= mult / winsizemuly; winsizemuly = mult; } } if(winsizemulx<0.1) winsizemulx=0.1; if(winsizemuly<0.1) winsizemuly=0.1; if(eoptions & EO_FORCEISCALE) { int x,y; x = winsizemulx * 2; y = winsizemuly * 2; x = (x>>1) + (x&1); y = (y>>1) + (y&1); if(!x) x=1; if(!y) y=1; winsizemulx = x; winsizemuly = y; } if(winsizemulx > 100) winsizemulx = 100; if(winsizemuly > 100) winsizemuly = 100; } void UpdateFCEUWindow(void) { int w,h; RECT wrect; if(vchanged && !fullscreen && !changerecursive && !nofocus) { SetVideoMode(0); vchanged=0; } BlockingCheck(); UpdateDebugger(); if(!(eoptions&EO_BGRUN)) while(nofocus) { StopSound(); Sleep(75); BlockingCheck(); } if(userpause) { StopSound(); while(userpause) { Sleep(50); BlockingCheck(); } } } void ByebyeWindow(void) { SetMenu(hAppWnd,0); DestroyMenu(fceumenu); DestroyWindow(hAppWnd); } int CreateMainWindow(void) { WNDCLASSEX winclass; RECT tmp; memset(&winclass,0,sizeof(winclass)); winclass.cbSize=sizeof(WNDCLASSEX); winclass.style=CS_OWNDC|CS_HREDRAW|CS_VREDRAW|CS_SAVEBITS; winclass.lpfnWndProc=AppWndProc; winclass.cbClsExtra=0; winclass.cbWndExtra=0; winclass.hInstance=fceu_hInstance; winclass.hIcon=LoadIcon(fceu_hInstance, "ICON_1"); winclass.hIconSm=LoadIcon(fceu_hInstance, "ICON_1"); winclass.hCursor=LoadCursor(NULL, IDC_ARROW); winclass.hbrBackground=GetStockObject(BLACK_BRUSH); //winclass.lpszMenuName="FCEUMENU"; winclass.lpszClassName="FCEULTRA"; if(!RegisterClassEx(&winclass)) return FALSE; AdjustWindowRectEx(&tmp,WS_OVERLAPPEDWINDOW,1,0); fceumenu=LoadMenu(fceu_hInstance,"FCEUMENU"); recentmenu=CreateMenu(); recentdmenu = CreateMenu(); UpdateRMenu(recentmenu, rfiles, 102, 600); UpdateRMenu(recentdmenu, rdirs, 103, 700); RedoMenuGI(NULL); hAppWnd = CreateWindowEx(0,"FCEULTRA","FCE Ultra", WS_OVERLAPPEDWINDOW|WS_CLIPSIBLINGS, /* Style */ CW_USEDEFAULT,CW_USEDEFAULT,256,240, /* X,Y ; Width, Height */ NULL,fceumenu,fceu_hInstance,NULL ); DragAcceptFiles(hAppWnd, 1); SetMainWindowStuff(); return 1; } int SetMainWindowStuff(void) { RECT tmp; GetWindowRect(hAppWnd,&tmp); if(ismaximized) { winwidth=tmp.right - tmp.left; winheight=tmp.bottom - tmp.top; ShowWindow(hAppWnd, SW_SHOWMAXIMIZED); } else { RECT srect; if(WindowXC!=(1<<30)) { /* Subtracting and adding for if(eoptions&EO_USERFORCE) below. */ tmp.bottom-=tmp.top; tmp.bottom+=WindowYC; tmp.right-=tmp.left; tmp.right+=WindowXC; tmp.left=WindowXC; tmp.top=WindowYC; WindowXC=1<<30; } CalcWindowSize(&srect); SetWindowPos(hAppWnd,HWND_TOP,tmp.left,tmp.top,srect.right,srect.bottom,SWP_SHOWWINDOW); winwidth=srect.right; winheight=srect.bottom; ShowWindow(hAppWnd, SW_SHOWNORMAL); } return 1; } int GetClientAbsRect(LPRECT lpRect) { POINT point; point.x=point.y=0; if(!ClientToScreen(hAppWnd,&point)) return 0; lpRect->top=point.y; lpRect->left=point.x; if(ismaximized) { RECT al; GetClientRect(hAppWnd, &al); lpRect->right = point.x + al.right; lpRect->bottom = point.y + al.bottom; } else { lpRect->right=point.x+VNSWID*winsizemulx; lpRect->bottom=point.y+totallines*winsizemuly; } return 1; } int LoadPaletteFile(void) { FILE *fp; const char filter[]="All usable files(*.pal)\0*.pal\0All files (*.*)\0*.*\0"; char nameo[2048]; OPENFILENAME ofn; memset(&ofn,0,sizeof(ofn)); ofn.lStructSize=sizeof(ofn); ofn.hInstance=fceu_hInstance; ofn.lpstrTitle="FCE Ultra Open Palette File..."; ofn.lpstrFilter=filter; nameo[0]=0; ofn.lpstrFile=nameo; ofn.nMaxFile=256; ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY; ofn.lpstrInitialDir=0; if(GetOpenFileName(&ofn)) { if((fp=fopen(nameo,"rb"))) { fread(cpalette,1,192,fp); fclose(fp); FCEUI_SetPaletteArray(cpalette); eoptions|=EO_CPALETTE; return(1); } else FCEUD_PrintError("Error opening palette file!"); } return(0); } static HWND pwindow; static BOOL CALLBACK PaletteConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { DSMFix(uMsg); switch(uMsg) { case WM_INITDIALOG: if(ntsccol) CheckDlgButton(hwndDlg,100,BST_CHECKED); SendDlgItemMessage(hwndDlg,500,TBM_SETRANGE,1,MAKELONG(0,128)); SendDlgItemMessage(hwndDlg,501,TBM_SETRANGE,1,MAKELONG(0,128)); FCEUI_GetNTSCTH(&ntsctint,&ntschue); SendDlgItemMessage(hwndDlg,500,TBM_SETPOS,1,ntsctint); SendDlgItemMessage(hwndDlg,501,TBM_SETPOS,1,ntschue); EnableWindow(GetDlgItem(hwndDlg,201),(eoptions&EO_CPALETTE)?1:0); break; case WM_HSCROLL: ntsctint=SendDlgItemMessage(hwndDlg,500,TBM_GETPOS,0,(LPARAM)(LPSTR)0); ntschue=SendDlgItemMessage(hwndDlg,501,TBM_GETPOS,0,(LPARAM)(LPSTR)0); FCEUI_SetNTSCTH(ntsccol,ntsctint,ntschue); break; case WM_CLOSE: case WM_QUIT: goto gornk; case WM_COMMAND: if(!(wParam>>16)) switch(wParam&0xFFFF) { case 100:ntsccol^=1;FCEUI_SetNTSCTH(ntsccol,ntsctint,ntschue);break; case 200: StopSound(); if(LoadPaletteFile()) EnableWindow(GetDlgItem(hwndDlg,201),1); break; case 201:FCEUI_SetPaletteArray(0); eoptions&=~EO_CPALETTE; EnableWindow(GetDlgItem(hwndDlg,201),0); break; case 1: gornk: DestroyWindow(hwndDlg); pwindow=0; // Yay for user race conditions. break; } } return 0; } static void ConfigPalette(void) { if(!pwindow) pwindow=CreateDialog(fceu_hInstance,"PALCONFIG",0,PaletteConCallB); else SetFocus(pwindow); } static BOOL CALLBACK TimingConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { int x; switch(uMsg) { case WM_INITDIALOG: if(eoptions&EO_HIGHPRIO) CheckDlgButton(hwndDlg,105,BST_CHECKED); if(eoptions&EO_NOTHROTTLE) CheckDlgButton(hwndDlg,101,BST_CHECKED); for(x=0;x<10;x++) { char buf[8]; sprintf(buf,"%d",x); SendDlgItemMessage(hwndDlg,110,CB_ADDSTRING,0,(LPARAM)(LPSTR)buf); SendDlgItemMessage(hwndDlg,111,CB_ADDSTRING,0,(LPARAM)(LPSTR)buf); } SendDlgItemMessage(hwndDlg,110,CB_SETCURSEL,maxconbskip,(LPARAM)(LPSTR)0); SendDlgItemMessage(hwndDlg,111,CB_SETCURSEL,ffbskip,(LPARAM)(LPSTR)0); break; case WM_CLOSE: case WM_QUIT: goto gornk; case WM_COMMAND: if(!(wParam>>16)) switch(wParam&0xFFFF) { case 1: gornk: if(IsDlgButtonChecked(hwndDlg,105)==BST_CHECKED) eoptions|=EO_HIGHPRIO; else eoptions&=~EO_HIGHPRIO; if(IsDlgButtonChecked(hwndDlg,101)==BST_CHECKED) eoptions|=EO_NOTHROTTLE; else eoptions&=~EO_NOTHROTTLE; maxconbskip=SendDlgItemMessage(hwndDlg,110,CB_GETCURSEL,0,(LPARAM)(LPSTR)0); ffbskip=SendDlgItemMessage(hwndDlg,111,CB_GETCURSEL,0,(LPARAM)(LPSTR)0); EndDialog(hwndDlg,0); break; } } return 0; } void DoTimingConfigFix(void) { DoPriority(); } static void ConfigTiming(void) { DialogBox(fceu_hInstance,"TIMINGCONFIG",hAppWnd,TimingConCallB); DoTimingConfigFix(); } static BOOL CALLBACK GUIConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { case WM_INITDIALOG: if(eoptions&EO_FOAFTERSTART) CheckDlgButton(hwndDlg,102,BST_CHECKED); if(eoptions&EO_HIDEMENU) CheckDlgButton(hwndDlg,104,BST_CHECKED); if(goptions & GOO_CONFIRMEXIT) CheckDlgButton(hwndDlg,110,BST_CHECKED); if(goptions & GOO_DISABLESS) CheckDlgButton(hwndDlg,111,BST_CHECKED); break; case WM_CLOSE: case WM_QUIT: goto gornk; case WM_COMMAND: if(!(wParam>>16)) switch(wParam&0xFFFF) { case 1: gornk: if(IsDlgButtonChecked(hwndDlg,102)==BST_CHECKED) eoptions|=EO_FOAFTERSTART; else eoptions&=~EO_FOAFTERSTART; if(IsDlgButtonChecked(hwndDlg,104)==BST_CHECKED) eoptions|=EO_HIDEMENU; else eoptions&=~EO_HIDEMENU; goptions &= ~(GOO_CONFIRMEXIT | GOO_DISABLESS); if(IsDlgButtonChecked(hwndDlg,110)==BST_CHECKED) goptions |= GOO_CONFIRMEXIT; if(IsDlgButtonChecked(hwndDlg,111)==BST_CHECKED) goptions |= GOO_DISABLESS; EndDialog(hwndDlg,0); break; } } return 0; } static void ConfigGUI(void) { DialogBox(fceu_hInstance,"GUICONFIG",hAppWnd,GUIConCallB); } static int BrowseForFolder(HWND hParent, char *htext, char *buf) { BROWSEINFO bi; LPCITEMIDLIST pidl; int ret=1; buf[0]=0; memset(&bi,0,sizeof(bi)); bi.hwndOwner=hParent; bi.lpszTitle=htext; bi.ulFlags=BIF_RETURNONLYFSDIRS; if(FAILED(CoInitialize(0))) return(0); if(!(pidl=SHBrowseForFolder(&bi))) { ret=0; goto end1; } if(!SHGetPathFromIDList(pidl,buf)) { ret=0; goto end2; } end2: /* This probably isn't the best way to free the memory... */ CoTaskMemFree((PVOID)pidl); end1: CoUninitialize(); return(ret); } static BOOL CALLBACK DirConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { int x; switch(uMsg){ case WM_INITDIALOG: for(x=0;x<6;x++) SetDlgItemText(hwndDlg,100+x,DOvers[x]); if(eoptions&EO_SNAPNAME) CheckDlgButton(hwndDlg,300,BST_CHECKED); break; case WM_CLOSE: case WM_QUIT: goto gornk; case WM_COMMAND: if(!(wParam>>16)) { if((wParam&0xFFFF)>=200 && (wParam&0xFFFF)<=205) { static char *helpert[6]={"Cheats","Miscellaneous","Nonvolatile Game Data","Save States","Screen Snapshots","Base Directory"}; char name[MAX_PATH]; if(BrowseForFolder(hwndDlg,helpert[((wParam&0xFFFF)-200)],name)) SetDlgItemText(hwndDlg,100+((wParam&0xFFFF)-200),name); } else switch(wParam&0xFFFF) { case 1: gornk: if(IsDlgButtonChecked(hwndDlg,300)==BST_CHECKED) eoptions|=EO_SNAPNAME; else eoptions&=~EO_SNAPNAME; RemoveDirs(); // Remove empty directories. for(x=0;x<6;x++) { LONG len; len=SendDlgItemMessage(hwndDlg,100+x,WM_GETTEXTLENGTH,0,0); if(len<=0) { if(DOvers[x]) free(DOvers[x]); DOvers[x]=0; continue; } len++; // Add 1 for null character. if(!(DOvers[x]=malloc(len))) continue; if(!GetDlgItemText(hwndDlg,100+x,DOvers[x],len)) { free(DOvers[x]); DOvers[x]=0; continue; } } CreateDirs(); // Create needed directories. SetDirs(); // Set the directories in the core. EndDialog(hwndDlg,0); break; } } } return 0; } static void ConfigDirectories(void) { DialogBox(fceu_hInstance,"DIRCONFIG",hAppWnd,DirConCallB); } fceu-0.98.12/src/drivers/win/video.c0000644000175000000620000007637110114011553017033 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ static int RecalcCustom(void); #define VF_DDSTRETCHED 1 #define VEF_LOSTSURFACE 1 #define VEF____INTERNAL 2 #define VMDF_DXBLT 1 #define VMDF_STRFS 2 typedef struct { int x; int y; int bpp; int flags; int xscale; int yscale; RECT srect; RECT drect; int special; } vmdef; // left, top, right, bottom static vmdef vmodes[11]={ {320,240,8,0,1,1,0}, //0 {320,240,8,0,1,1,0}, //1 {512,384,8,0,1,1,0}, //2 {640,480,8,0,1,1,0}, //3 {640,480,8,0,1,1,0}, //4 {640,480,8,0,1,1,0}, //5 {640,480,8,VMDF_DXBLT,2,2,0}, //6 {1024,768,8,VMDF_DXBLT,4,3,0}, //7 {1280,1024,8,VMDF_DXBLT,5,4,0}, //8 {1600,1200,8,VMDF_DXBLT,6,5,0}, //9 {800,600,8,VMDF_DXBLT|VMDF_STRFS,0,0} //10 }; static DDCAPS caps; static int mustrestore=0; static DWORD CBM[3]; static int bpp; static int vflags; static int veflags; static int winspecial = 0; int disvaccel = 0; /* Disable video hardware acceleration. */ int fssync=0; int winsync=0; PALETTEENTRY color_palette[256]; static int PaletteChanged=0; LPDIRECTDRAWCLIPPER lpClipper=0; LPDIRECTDRAW lpDD=0; LPDIRECTDRAW7 lpDD7=0; LPDIRECTDRAWPALETTE lpddpal = 0; DDSURFACEDESC2 ddsd; DDSURFACEDESC2 ddsdback; LPDIRECTDRAWSURFACE7 lpDDSPrimary=0; LPDIRECTDRAWSURFACE7 lpDDSDBack=0; LPDIRECTDRAWSURFACE7 lpDDSBack=0; static void ShowDDErr(char *s) { char tempo[512]; sprintf(tempo,"DirectDraw: %s",s); FCEUD_PrintError(tempo); } int RestoreDD(int w) { if(w) { if(!lpDDSBack) return 0; if(IDirectDrawSurface7_Restore(lpDDSBack)!=DD_OK) return 0; } else { if(!lpDDSPrimary) return 0; if(IDirectDrawSurface7_Restore(lpDDSPrimary)!=DD_OK) return 0; } veflags|=1; return 1; } void FCEUD_SetPalette(unsigned char index, unsigned char r, unsigned char g, unsigned char b) { color_palette[index].peRed=r; color_palette[index].peGreen=g; color_palette[index].peBlue=b; PaletteChanged=1; } void FCEUD_GetPalette(unsigned char i, unsigned char *r, unsigned char *g, unsigned char *b) { *r=color_palette[i].peRed; *g=color_palette[i].peGreen; *b=color_palette[i].peBlue; } static int InitializeDDraw(int fs) { //(disvaccel&(1<<(fs?1:0)))?(GUID FAR *)DDCREATE_EMULATIONONLY: ddrval = DirectDrawCreate((disvaccel&(1<<(fs?1:0)))?(GUID FAR *)DDCREATE_EMULATIONONLY:NULL, &lpDD, NULL); if (ddrval != DD_OK) { ShowDDErr("Error creating DirectDraw object."); return 0; } ddrval = IDirectDraw_QueryInterface(lpDD,&IID_IDirectDraw7,(LPVOID *)&lpDD7); IDirectDraw_Release(lpDD); if (ddrval != DD_OK) { ShowDDErr("Error querying interface."); return 0; } caps.dwSize=sizeof(caps); if(IDirectDraw7_GetCaps(lpDD7,&caps,0)!=DD_OK) { ShowDDErr("Error getting capabilities."); return 0; } return 1; } static int GetBPP(void) { DDPIXELFORMAT ddpix; memset(&ddpix,0,sizeof(ddpix)); ddpix.dwSize=sizeof(ddpix); ddrval=IDirectDrawSurface7_GetPixelFormat(lpDDSPrimary,&ddpix); if (ddrval != DD_OK) { ShowDDErr("Error getting primary surface pixel format."); return 0; } if(ddpix.dwFlags&DDPF_RGB) { bpp=ddpix.DUMMYUNIONNAMEN(1).dwRGBBitCount; CBM[0]=ddpix.DUMMYUNIONNAMEN(2).dwRBitMask; CBM[1]=ddpix.DUMMYUNIONNAMEN(3).dwGBitMask; CBM[2]=ddpix.DUMMYUNIONNAMEN(4).dwBBitMask; } else { ShowDDErr("RGB data not valid."); return 0; } if(bpp==15) bpp=16; return 1; } static int InitBPPStuff(int fs) { if(bpp >= 16) { InitBlitToHigh(bpp >> 3, CBM[0], CBM[1], CBM[2], 0, fs?vmodes[vmod].special:winspecial); } else if(bpp==8) { ddrval=IDirectDraw7_CreatePalette( lpDD7, DDPCAPS_8BIT|DDPCAPS_ALLOW256|DDPCAPS_INITIALIZE,color_palette,&lpddpal,NULL); if (ddrval != DD_OK) { ShowDDErr("Error creating palette object."); return 0; } ddrval=IDirectDrawSurface7_SetPalette(lpDDSPrimary, lpddpal); if (ddrval != DD_OK) { ShowDDErr("Error setting palette object."); return 0; } } return 1; } int SetVideoMode(int fs) { int specmul; // Special scaler size multiplier if(fs) if(!vmod) if(!RecalcCustom()) return(0); vflags=0; veflags=1; PaletteChanged=1; ResetVideo(); StopSound(); if(!InitializeDDraw(fs)) return(1); // DirectDraw not initialized if(!fs) { if(winspecial == 2 || winspecial == 1) specmul = 2; else if(winspecial == 3 || winspecial == 4) specmul = 3; else specmul = 1; ShowCursorAbs(1); windowedfailed=1; HideFWindow(0); ddrval = IDirectDraw7_SetCooperativeLevel ( lpDD7, hAppWnd, DDSCL_NORMAL); if (ddrval != DD_OK) { ShowDDErr("Error setting cooperative level."); return 1; } /* Beginning */ memset(&ddsd,0,sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; ddrval = IDirectDraw7_CreateSurface ( lpDD7, &ddsd, &lpDDSPrimary,(IUnknown FAR*)NULL); if (ddrval != DD_OK) { FCEU_PrintError("%08x, %d\n",ddrval,lpDD7); ShowDDErr("Error creating primary surface."); return 1; } memset(&ddsdback,0,sizeof(ddsdback)); ddsdback.dwSize=sizeof(ddsdback); ddsdback.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; ddsdback.ddsCaps.dwCaps= DDSCAPS_OFFSCREENPLAIN; ddsdback.dwWidth=256 * specmul; ddsdback.dwHeight=240 * specmul; /* If the blit hardware can't stretch, assume it's cheap(and slow) and create the buffer in system memory. */ if(!(caps.dwCaps&DDCAPS_BLTSTRETCH)) ddsdback.ddsCaps.dwCaps|=DDSCAPS_SYSTEMMEMORY; ddrval = IDirectDraw7_CreateSurface ( lpDD7, &ddsdback, &lpDDSBack, (IUnknown FAR*)NULL); if (ddrval != DD_OK) { ShowDDErr("Error creating secondary surface."); return 0; } if(!GetBPP()) return 0; if(bpp!=16 && bpp!=24 && bpp!=32) { ShowDDErr("Current bit depth not supported!"); return 0; } if(!InitBPPStuff(fs)) return 0; ddrval=IDirectDraw7_CreateClipper(lpDD7,0,&lpClipper,0); if (ddrval != DD_OK) { ShowDDErr("Error creating clipper."); return 0; } ddrval=IDirectDrawClipper_SetHWnd(lpClipper,0,hAppWnd); if (ddrval != DD_OK) { ShowDDErr("Error setting clipper window."); return 0; } ddrval=IDirectDrawSurface7_SetClipper(lpDDSPrimary,lpClipper); if (ddrval != DD_OK) { ShowDDErr("Error attaching clipper to primary surface."); return 0; } windowedfailed=0; SetMainWindowStuff(); } else /* Following is full-screen */ { if(vmod == 0) { if(vmodes[0].special == 2 || vmodes[0].special == 1) specmul = 2; else if(vmodes[0].special == 3 || vmodes[0].special == 4) specmul = 3; else specmul = 1; } HideFWindow(1); ddrval = IDirectDraw7_SetCooperativeLevel ( lpDD7, hAppWnd,DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_ALLOWREBOOT); if (ddrval != DD_OK) { ShowDDErr("Error setting cooperative level."); return 0; } ddrval = IDirectDraw7_SetDisplayMode(lpDD7, vmodes[vmod].x, vmodes[vmod].y,vmodes[vmod].bpp,0,0); if (ddrval != DD_OK) { ShowDDErr("Error setting display mode."); return 0; } if(vmodes[vmod].flags&VMDF_DXBLT) { memset(&ddsdback,0,sizeof(ddsdback)); ddsdback.dwSize=sizeof(ddsdback); ddsdback.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; ddsdback.ddsCaps.dwCaps= DDSCAPS_OFFSCREENPLAIN; ddsdback.dwWidth=256 * specmul; //vmodes[vmod].srect.right; ddsdback.dwHeight=240 * specmul; //vmodes[vmod].srect.bottom; if(!(caps.dwCaps&DDCAPS_BLTSTRETCH)) ddsdback.ddsCaps.dwCaps|=DDSCAPS_SYSTEMMEMORY; ddrval = IDirectDraw7_CreateSurface ( lpDD7, &ddsdback, &lpDDSBack, (IUnknown FAR*)NULL); if(ddrval!=DD_OK) { ShowDDErr("Error creating secondary surface."); return 0; } } // create foreground surface memset(&ddsd,0,sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; if(fssync==3) // Double buffering. { ddsd.dwFlags |= DDSD_BACKBUFFERCOUNT; ddsd.dwBackBufferCount = 1; ddsd.ddsCaps.dwCaps |= DDSCAPS_COMPLEX | DDSCAPS_FLIP; } ddrval = IDirectDraw7_CreateSurface ( lpDD7, &ddsd, &lpDDSPrimary,(IUnknown FAR*)NULL); if (ddrval != DD_OK) { ShowDDErr("Error creating primary surface."); return 0; } if(fssync==3) { DDSCAPS2 tmp; memset(&tmp,0,sizeof(tmp)); tmp.dwCaps=DDSCAPS_BACKBUFFER; if(IDirectDrawSurface7_GetAttachedSurface(lpDDSPrimary,&tmp,&lpDDSDBack)!=DD_OK) { ShowDDErr("Error getting attached surface."); return 0; } } if(!GetBPP()) return 0; if(!InitBPPStuff(fs)) return 0; mustrestore=1; ShowCursorAbs(0); } InputScreenChanged(fs); fullscreen=fs; return 1; } static void BlitScreenWindow(uint8 *XBuf); static void BlitScreenFull(uint8 *XBuf); //static uint8 *XBSave; void FCEUD_BlitScreen(uint8 *XBuf) { xbsave = XBuf; if(!NoWaiting) { int ws; if(fullscreen) ws=fssync; else ws = winsync; if(ws==1) IDirectDraw7_WaitForVerticalBlank(lpDD7,DDWAITVB_BLOCKBEGIN,0); else if(ws == 2) { BOOL invb = 0; while((DD_OK == IDirectDraw7_GetVerticalBlankStatus(lpDD7,&invb)) && !invb) Sleep(0); } } if(fullscreen) { BlitScreenFull(XBuf); } else { if(!windowedfailed) BlitScreenWindow(XBuf); } } static void FixPaletteHi(void) { int x; SetPaletteBlitToHigh(color_palette); } static void BlitScreenWindow(unsigned char *XBuf) { int pitch; unsigned char *ScreenLoc; static RECT srect; RECT drect; int specialmul; if(winspecial == 2 || winspecial == 1) specialmul = 2; else if(winspecial == 4 || winspecial == 3) specialmul = 3; else specialmul = 1; srect.top=srect.left=0; srect.right=VNSWID * specialmul; srect.bottom=totallines * specialmul; if(PaletteChanged==1) { FixPaletteHi(); PaletteChanged=0; } if(!GetClientAbsRect(&drect)) return; ddrval=IDirectDrawSurface7_Lock(lpDDSBack,NULL,&ddsdback, 0, NULL); if(ddrval!=DD_OK) { if(ddrval==DDERR_SURFACELOST) RestoreDD(1); return; } pitch=ddsdback.DUMMYUNIONNAMEN(1).lPitch; ScreenLoc=ddsdback.lpSurface; if(veflags&1) { memset(ScreenLoc,0,pitch*240); veflags&=~1; } Blit8ToHigh(XBuf+srendline*256+VNSCLIP,ScreenLoc, VNSWID, totallines, pitch,specialmul,specialmul); IDirectDrawSurface7_Unlock(lpDDSBack, NULL); if(IDirectDrawSurface7_Blt(lpDDSPrimary, &drect,lpDDSBack,&srect,DDBLT_ASYNC,0)!=DD_OK) { ddrval=IDirectDrawSurface7_Blt(lpDDSPrimary, &drect,lpDDSBack,&srect,DDBLT_WAIT,0); if(ddrval!=DD_OK) { if(ddrval==DDERR_SURFACELOST) {RestoreDD(1);RestoreDD(0);} return; } } } static void BlitScreenFull(uint8 *XBuf) { static int pitch; char *ScreenLoc; unsigned long x; uint8 y; RECT srect,drect; LPDIRECTDRAWSURFACE7 lpDDSVPrimary; int specmul; // Special scaler size multiplier if(vmodes[0].special == 2 || vmodes[0].special == 1) specmul = 2; else if(vmodes[0].special == 3 || vmodes[0].special == 4) specmul = 3; else specmul = 1; if(fssync==3) lpDDSVPrimary=lpDDSDBack; else lpDDSVPrimary=lpDDSPrimary; if(PaletteChanged==1) { if(bpp>=16) FixPaletteHi(); else { ddrval=IDirectDrawPalette_SetEntries(lpddpal,0,0,256,color_palette); if(ddrval!=DD_OK) { if(ddrval==DDERR_SURFACELOST) RestoreDD(0); return; } } PaletteChanged=0; } if(vmodes[vmod].flags&VMDF_DXBLT) { ddrval=IDirectDrawSurface7_Lock(lpDDSBack,NULL,&ddsdback, 0, NULL); if(ddrval!=DD_OK) { if(ddrval==DDERR_SURFACELOST) RestoreDD(1); return; } ScreenLoc=ddsdback.lpSurface; pitch=ddsdback.DUMMYUNIONNAMEN(1).lPitch; srect.top=0; srect.left=0; srect.right=VNSWID * specmul; srect.bottom=totallines * specmul; if(vmodes[vmod].flags&VMDF_STRFS) { drect.top=0; drect.left=0; drect.right=vmodes[vmod].x; drect.bottom=vmodes[vmod].y; } else { drect.top=(vmodes[vmod].y-(totallines*vmodes[vmod].yscale))>>1; drect.bottom=drect.top+(totallines*vmodes[vmod].yscale); drect.left=(vmodes[vmod].x-VNSWID*vmodes[vmod].xscale)>>1; drect.right=drect.left+VNSWID*vmodes[vmod].xscale; } } else { ddrval=IDirectDrawSurface7_Lock(lpDDSVPrimary,NULL,&ddsd, 0, NULL); if(ddrval!=DD_OK) { if(ddrval==DDERR_SURFACELOST) RestoreDD(0); return; } ScreenLoc=ddsd.lpSurface; pitch=ddsd.DUMMYUNIONNAMEN(1).lPitch; } if(veflags&1) { if(vmodes[vmod].flags&VMDF_DXBLT) { veflags|=2; memset((char *)ScreenLoc,0,pitch*srect.bottom); } else { memset((char *)ScreenLoc,0,pitch*vmodes[vmod].y); } PaletteChanged=1; veflags&=~1; } if(vmod==5) { if(eoptions&EO_CLIPSIDES) { asm volatile( "xorl %%edx, %%edx\n\t" "akoop1:\n\t" "movb $120,%%al \n\t" "akoop2:\n\t" "movb 1(%%esi),%%dl\n\t" "shl $16,%%edx\n\t" "movb (%%esi),%%dl\n\t" "movl %%edx,(%%edi)\n\t" "addl $2,%%esi\n\t" "addl $4,%%edi\n\t" "decb %%al\n\t" "jne akoop2\n\t" "addl $16,%%esi\n\t" "addl %%ecx,%%edi\n\t" "decb %%bl\n\t" "jne akoop1\n\t" : : "S" (XBuf+srendline*256+VNSCLIP), "D" (ScreenLoc+((240-totallines)/2)*pitch+(640-(VNSWID<<1))/2),"b" (totallines), "c" ((pitch-VNSWID)<<1) : "%al", "%edx", "%cc" ); } else { asm volatile( "xorl %%edx, %%edx\n\t" "koop1:\n\t" "movb $128,%%al \n\t" "koop2:\n\t" "movb 1(%%esi),%%dl\n\t" "shl $16,%%edx\n\t" "movb (%%esi),%%dl\n\t" "movl %%edx,(%%edi)\n\t" "addl $2,%%esi\n\t" "addl $4,%%edi\n\t" "decb %%al\n\t" "jne koop2\n\t" "addl %%ecx,%%edi\n\t" "decb %%bl\n\t" "jne koop1\n\t" : : "S" (XBuf+srendline*256), "D" (ScreenLoc+((240-totallines)/2)*pitch+(640-512)/2),"b" (totallines), "c" (pitch-512+pitch) : "%al", "%edx", "%cc" ); } } else if(vmod==4) { if(eoptions&EO_CLIPSIDES) { asm volatile( "ayoop1:\n\t" "movb $120,%%al \n\t" "ayoop2:\n\t" "movb 1(%%esi),%%dh\n\t" "movb %%dh,%%dl\n\t" "shl $16,%%edx\n\t" "movb (%%esi),%%dl\n\t" "movb %%dl,%%dh\n\t" // Ugh "movl %%edx,(%%edi)\n\t" "addl $2,%%esi\n\t" "addl $4,%%edi\n\t" "decb %%al\n\t" "jne ayoop2\n\t" "addl $16,%%esi\n\t" "addl %%ecx,%%edi\n\t" "decb %%bl\n\t" "jne ayoop1\n\t" : : "S" (XBuf+srendline*256+VNSCLIP), "D" (ScreenLoc+((240-totallines)/2)*pitch+(640-(VNSWID<<1))/2),"b" (totallines), "c" ((pitch-VNSWID)<<1) : "%al", "%edx", "%cc" ); } else { asm volatile( "yoop1:\n\t" "movb $128,%%al \n\t" "yoop2:\n\t" "movb 1(%%esi),%%dh\n\t" "movb %%dh,%%dl\n\t" "shl $16,%%edx\n\t" "movb (%%esi),%%dl\n\t" "movb %%dl,%%dh\n\t" // Ugh "movl %%edx,(%%edi)\n\t" "addl $2,%%esi\n\t" "addl $4,%%edi\n\t" "decb %%al\n\t" "jne yoop2\n\t" "addl %%ecx,%%edi\n\t" "decb %%bl\n\t" "jne yoop1\n\t" : : "S" (XBuf+srendline*256), "D" (ScreenLoc+((240-totallines)/2)*pitch+(640-512)/2),"b" (totallines), "c" (pitch-512+pitch) : "%al", "%edx", "%cc" ); } } else { if(!(vmodes[vmod].flags&VMDF_DXBLT)) { if(vmodes[vmod].special) ScreenLoc += (vmodes[vmod].drect.left*(bpp>>3)) + ((vmodes[vmod].drect.top)*pitch); else ScreenLoc+=((vmodes[vmod].x-VNSWID)>>1)*(bpp>>3)+(((vmodes[vmod].y-totallines)>>1))*pitch; } if(bpp>=16) { Blit8ToHigh(XBuf+srendline*256+VNSCLIP,ScreenLoc, VNSWID, totallines, pitch,specmul,specmul); } else { XBuf+=srendline*256+VNSCLIP; if(vmodes[vmod].special) Blit8To8(XBuf,ScreenLoc, VNSWID, totallines, pitch,vmodes[vmod].xscale,vmodes[vmod].yscale,0,vmodes[vmod].special); else Blit8To8(XBuf,ScreenLoc, VNSWID, totallines, pitch,1,1,0,0); } } if(vmodes[vmod].flags&VMDF_DXBLT) { IDirectDrawSurface7_Unlock(lpDDSBack, NULL); if(veflags&2) { if(IDirectDrawSurface7_Lock(lpDDSVPrimary,NULL,&ddsd, 0, NULL)==DD_OK) { memset(ddsd.lpSurface,0,ddsd.DUMMYUNIONNAMEN(1).lPitch*vmodes[vmod].y); IDirectDrawSurface7_Unlock(lpDDSVPrimary, NULL); veflags&=~2; } } if(IDirectDrawSurface7_Blt(lpDDSVPrimary, &drect,lpDDSBack,&srect,DDBLT_ASYNC,0)!=DD_OK) { ddrval=IDirectDrawSurface7_Blt(lpDDSVPrimary, &drect,lpDDSBack,&srect,DDBLT_WAIT,0); if(ddrval!=DD_OK) { if(ddrval==DDERR_SURFACELOST) { RestoreDD(0); RestoreDD(1); } return; } } } else IDirectDrawSurface7_Unlock(lpDDSVPrimary, NULL); if(fssync==3) { IDirectDrawSurface7_Flip(lpDDSPrimary,0,0); } } void ResetVideo(void) { ShowCursorAbs(1); KillBlitToHigh(); if(lpDD7) if(mustrestore) {IDirectDraw7_RestoreDisplayMode(lpDD7);mustrestore=0;} if(lpddpal) {IDirectDrawPalette_Release(lpddpal); lpddpal = 0;} if(lpDDSBack) {IDirectDrawSurface7_Release(lpDDSBack);lpDDSBack=0;} if(lpDDSPrimary) {IDirectDrawSurface7_Release(lpDDSPrimary);lpDDSPrimary=0;} if(lpClipper) {IDirectDrawClipper_Release(lpClipper);lpClipper=0;} if(lpDD7) { IDirectDraw_Release(lpDD7); lpDD7 = NULL; } } int specialmlut[5] = {1,2,2,3,3}; static int RecalcCustom(void) { vmdef *cmode = &vmodes[0]; cmode->flags&=~VMDF_DXBLT; if(cmode->flags&VMDF_STRFS) { cmode->flags|=VMDF_DXBLT; } else if(cmode->xscale!=1 || cmode->yscale!=1 || cmode->special) { if(cmode->special) { int mult = specialmlut[cmode->special]; if(cmode->xscale < mult) cmode->xscale = mult; if(cmode->yscale < mult) cmode->yscale = mult; if(cmode->xscale != mult || cmode->yscale != mult) cmode->flags|=VMDF_DXBLT; } else cmode->flags|=VMDF_DXBLT; if(VNSWID*cmode->xscale>cmode->x) { if(cmode->special) { FCEUD_PrintError("Scaled width is out of range."); return(0); } else { FCEUD_PrintError("Scaled width is out of range. Reverting to no horizontal scaling."); cmode->xscale=1; } } if(totallines*cmode->yscale>cmode->y) { if(cmode->special) { FCEUD_PrintError("Scaled height is out of range."); return(0); } else { FCEUD_PrintError("Scaled height is out of range. Reverting to no vertical scaling."); cmode->yscale=1; } } cmode->srect.left=VNSCLIP; cmode->srect.top=srendline; cmode->srect.right=256-VNSCLIP; cmode->srect.bottom=erendline+1; cmode->drect.top=(cmode->y-(totallines*cmode->yscale))>>1; cmode->drect.bottom=cmode->drect.top+totallines*cmode->yscale; cmode->drect.left=(cmode->x-(VNSWID*cmode->xscale))>>1; cmode->drect.right=cmode->drect.left+VNSWID*cmode->xscale; } if((cmode->special == 1 || cmode->special == 3) && cmode->bpp == 8) { cmode->bpp = 32; //FCEUD_PrintError("HQ2x/HQ3x requires 16bpp or 32bpp(best)."); //return(0); } if(cmode->xyflags&VMDF_STRFS)) { FCEUD_PrintError("Vertical resolution must not be less than the total number of drawn scanlines."); return(0); } return(1); } BOOL SetDlgItemDouble(HWND hDlg, int item, double value) { char buf[8]; sprintf(buf,"%.6f",value); SetDlgItemText(hDlg, item, buf); } double GetDlgItemDouble(HWND hDlg, int item) { char buf[8]; double ret = 0; GetDlgItemText(hDlg, item, buf, 8); sscanf(buf,"%lf",&ret); return(ret); } BOOL CALLBACK VideoConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { static char *vmstr[11]={ "Custom", "320x240 Full Screen", "512x384 Centered", "640x480 Centered", "640x480 Scanlines", "640x480 \"4 per 1\"", "640x480 2x,2y", "1024x768 4x,3y", "1280x1024 5x,4y", "1600x1200 6x,5y", "800x600 Stretched" }; int x; switch(uMsg) { case WM_INITDIALOG: for(x=0;x<11;x++) SendDlgItemMessage(hwndDlg,100,CB_ADDSTRING,0,(LPARAM)(LPSTR)vmstr[x]); SendDlgItemMessage(hwndDlg,100,CB_SETCURSEL,vmod,(LPARAM)(LPSTR)0); SendDlgItemMessage(hwndDlg,202,CB_ADDSTRING,0,(LPARAM)(LPSTR)"8"); SendDlgItemMessage(hwndDlg,202,CB_ADDSTRING,0,(LPARAM)(LPSTR)"16"); SendDlgItemMessage(hwndDlg,202,CB_ADDSTRING,0,(LPARAM)(LPSTR)"24"); SendDlgItemMessage(hwndDlg,202,CB_ADDSTRING,0,(LPARAM)(LPSTR)"32"); SendDlgItemMessage(hwndDlg,202,CB_SETCURSEL,(vmodes[0].bpp>>3)-1,(LPARAM)(LPSTR)0); SetDlgItemInt(hwndDlg,200,vmodes[0].x,0); SetDlgItemInt(hwndDlg,201,vmodes[0].y,0); SetDlgItemInt(hwndDlg,302,vmodes[0].xscale,0); SetDlgItemInt(hwndDlg,303,vmodes[0].yscale,0); CheckRadioButton(hwndDlg,300,301,(vmodes[0].flags&VMDF_STRFS)?301:300); { char *str[]={"","hq2x","Scale2x","hq3x","Scale3x"}; int x; for(x=0;x<5;x++) { SendDlgItemMessage(hwndDlg,304,CB_ADDSTRING,0,(LPARAM)(LPSTR)str[x]); SendDlgItemMessage(hwndDlg,406,CB_ADDSTRING,0,(LPARAM)(LPSTR)str[x]); } } SendDlgItemMessage(hwndDlg,304,CB_SETCURSEL,vmodes[0].special,(LPARAM)(LPSTR)0); SendDlgItemMessage(hwndDlg,406,CB_SETCURSEL,winspecial,(LPARAM)(LPSTR)0); if(eoptions&EO_FSAFTERLOAD) CheckDlgButton(hwndDlg,102,BST_CHECKED); if(eoptions&EO_CLIPSIDES) CheckDlgButton(hwndDlg,106,BST_CHECKED); if(disvaccel&1) CheckDlgButton(hwndDlg,130,BST_CHECKED); if(disvaccel&2) CheckDlgButton(hwndDlg,131,BST_CHECKED); if(eoptions&EO_FORCEISCALE) CheckDlgButton(hwndDlg,402,BST_CHECKED); if(eoptions&EO_FORCEASPECT) CheckDlgButton(hwndDlg,403,BST_CHECKED); SetDlgItemInt(hwndDlg,500,srendlinen,0); SetDlgItemInt(hwndDlg,501,erendlinen,0); SetDlgItemInt(hwndDlg,502,srendlinep,0); SetDlgItemInt(hwndDlg,503,erendlinep,0); SetDlgItemDouble(hwndDlg, 400, winsizemulx); SetDlgItemDouble(hwndDlg, 401, winsizemuly); SetDlgItemDouble(hwndDlg, 404, saspectw); SetDlgItemDouble(hwndDlg, 405, saspecth); //SetDlgI temInt(hwndDlg,103,winsizemul,0); SendDlgItemMessage(hwndDlg,104,CB_ADDSTRING,0,(LPARAM)(LPSTR)""); SendDlgItemMessage(hwndDlg,105,CB_ADDSTRING,0,(LPARAM)(LPSTR)""); SendDlgItemMessage(hwndDlg,104,CB_ADDSTRING,0,(LPARAM)(LPSTR)"Wait for VBlank"); SendDlgItemMessage(hwndDlg,104,CB_ADDSTRING,0,(LPARAM)(LPSTR)"Lazy wait for VBlank"); SendDlgItemMessage(hwndDlg,105,CB_ADDSTRING,0,(LPARAM)(LPSTR)"Wait for VBlank"); SendDlgItemMessage(hwndDlg,105,CB_ADDSTRING,0,(LPARAM)(LPSTR)"Lazy wait for VBlank"); SendDlgItemMessage(hwndDlg,105,CB_ADDSTRING,0,(LPARAM)(LPSTR)"Double Buffering"); SendDlgItemMessage(hwndDlg,104,CB_SETCURSEL,winsync,(LPARAM)(LPSTR)0); SendDlgItemMessage(hwndDlg,105,CB_SETCURSEL,fssync,(LPARAM)(LPSTR)0); if(eoptions&EO_NOSPRLIM) CheckDlgButton(hwndDlg,600,BST_CHECKED); break; case WM_CLOSE: case WM_QUIT: goto gornk; case WM_COMMAND: if(!(wParam>>16)) switch(wParam&0xFFFF) { case 1: gornk: if(IsDlgButtonChecked(hwndDlg,106)==BST_CHECKED) eoptions|=EO_CLIPSIDES; else eoptions&=~EO_CLIPSIDES; if(IsDlgButtonChecked(hwndDlg,600)==BST_CHECKED) eoptions|=EO_NOSPRLIM; else eoptions&=~EO_NOSPRLIM; srendlinen=GetDlgItemInt(hwndDlg,500,0,0); erendlinen=GetDlgItemInt(hwndDlg,501,0,0); srendlinep=GetDlgItemInt(hwndDlg,502,0,0); erendlinep=GetDlgItemInt(hwndDlg,503,0,0); if(erendlinen>239) erendlinen=239; if(srendlinen>erendlinen) srendlinen=erendlinen; if(erendlinep>239) erendlinep=239; if(srendlinep>erendlinen) srendlinep=erendlinep; UpdateRendBounds(); if(IsDlgButtonChecked(hwndDlg,301)==BST_CHECKED) vmodes[0].flags|=VMDF_STRFS; else vmodes[0].flags&=~VMDF_STRFS; vmod=SendDlgItemMessage(hwndDlg,100,CB_GETCURSEL,0,(LPARAM)(LPSTR)0); vmodes[0].x=GetDlgItemInt(hwndDlg,200,0,0); vmodes[0].y=GetDlgItemInt(hwndDlg,201,0,0); vmodes[0].bpp=(SendDlgItemMessage(hwndDlg,202,CB_GETCURSEL,0,(LPARAM)(LPSTR)0)+1)<<3; vmodes[0].xscale=GetDlgItemInt(hwndDlg,302,0,0); vmodes[0].yscale=GetDlgItemInt(hwndDlg,303,0,0); vmodes[0].special=SendDlgItemMessage(hwndDlg,304,CB_GETCURSEL,0,(LPARAM)(LPSTR)0); winspecial = SendDlgItemMessage(hwndDlg,406,CB_GETCURSEL,0,(LPARAM)(LPSTR)0); disvaccel = 0; if(IsDlgButtonChecked(hwndDlg,130)==BST_CHECKED) disvaccel |= 1; if(IsDlgButtonChecked(hwndDlg,131)==BST_CHECKED) disvaccel |= 2; if(IsDlgButtonChecked(hwndDlg,101)==BST_CHECKED) fullscreen=1; else fullscreen=0; if(IsDlgButtonChecked(hwndDlg,102)==BST_CHECKED) eoptions|=EO_FSAFTERLOAD; else eoptions&=~EO_FSAFTERLOAD; eoptions &= ~(EO_FORCEISCALE | EO_FORCEASPECT); if(IsDlgButtonChecked(hwndDlg,402)==BST_CHECKED) eoptions|=EO_FORCEISCALE; if(IsDlgButtonChecked(hwndDlg,403)==BST_CHECKED) eoptions|=EO_FORCEASPECT; winsizemulx=GetDlgItemDouble(hwndDlg, 400); winsizemuly=GetDlgItemDouble(hwndDlg, 401); saspectw=GetDlgItemDouble(hwndDlg, 404); saspecth=GetDlgItemDouble(hwndDlg, 405); FixWXY(0); winsync=SendDlgItemMessage(hwndDlg,104,CB_GETCURSEL,0,(LPARAM)(LPSTR)0); fssync=SendDlgItemMessage(hwndDlg,105,CB_GETCURSEL,0,(LPARAM)(LPSTR)0); EndDialog(hwndDlg,0); break; } } return 0; } static void SetFSVideoMode(void) { changerecursive=1; if(!SetVideoMode(1)) SetVideoMode(0); changerecursive=0; } void DoVideoConfigFix(void) { FCEUI_DisableSpriteLimitation(eoptions&EO_NOSPRLIM); UpdateRendBounds(); } void ConfigVideo(void) { DialogBox(fceu_hInstance,"VIDEOCONFIG",hAppWnd,VideoConCallB); DoVideoConfigFix(); if(fullscreen) SetFSVideoMode(); else { changerecursive=1; SetVideoMode(0); changerecursive=0; } //SetMainWindowStuff(); } fceu-0.98.12/src/drivers/win/main.c0000644000175000000620000002677610110476314016663 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "common.h" // I like hacks. #define uint8 __UNO492032 #include #include #undef LPCWAVEFORMATEX #include #include #include #include #include // For directories configuration dialog. #undef uint8 #include "input.h" #include "netplay.h" #include "joystick.h" #include "keyboard.h" #include "cheat.h" #include "debug.h" #define VNSCLIP ((eoptions&EO_CLIPSIDES)?8:0) #define VNSWID ((eoptions&EO_CLIPSIDES)?240:256) uint8 *xbsave=NULL; int eoptions=EO_BGRUN | EO_FORCEISCALE; void ResetVideo(void); void ShowCursorAbs(int w); void HideFWindow(int h); void FixWXY(int pref); int SetMainWindowStuff(void); int GetClientAbsRect(LPRECT lpRect); void UpdateFCEUWindow(void); HWND hAppWnd=0; HINSTANCE fceu_hInstance; HRESULT ddrval; FCEUGI *GI=0; // cheats, misc, nonvol, states, snaps, base static char *DOvers[6]={0,0,0,0,0,0}; static char *defaultds[5]={"cheats","gameinfo","sav","fcs","snaps"}; static char TempArray[2048]; static char BaseDirectory[2048]; void SetDirs(void) { int x; static int jlist[5]= {FCEUIOD_CHEATS,FCEUIOD_MISC,FCEUIOD_NV,FCEUIOD_STATE,FCEUIOD_SNAPS}; FCEUI_SetSnapName(eoptions&EO_SNAPNAME); for(x=0;x<5;x++) FCEUI_SetDirOverride(jlist[x], DOvers[x]); if(DOvers[5]) FCEUI_SetBaseDirectory(DOvers[5]); else FCEUI_SetBaseDirectory(BaseDirectory); } /* Remove empty, unused directories. */ void RemoveDirs(void) { int x; for(x=0;x<5;x++) if(!DOvers[x]) { sprintf(TempArray,"%s\\%s",DOvers[5]?DOvers[5]:BaseDirectory,defaultds[x]); RemoveDirectory(TempArray); } } void CreateDirs(void) { int x; for(x=0;x<5;x++) if(!DOvers[x]) { sprintf(TempArray,"%s\\%s",DOvers[5]?DOvers[5]:BaseDirectory,defaultds[x]); CreateDirectory(TempArray,0); } } static char *gfsdir=0; void GetBaseDirectory(void) { int x; BaseDirectory[0]=0; GetModuleFileName(0,(LPTSTR)BaseDirectory,2047); for(x=strlen(BaseDirectory);x>=0;x--) { if(BaseDirectory[x]=='\\' || BaseDirectory[x]=='/') {BaseDirectory[x]=0;break;} } } static int exiting=0; static volatile int moocow = 0; int BlockingCheck(void) { MSG msg; moocow = 1; while( PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ) ) { if( GetMessage( &msg, 0, 0, 0)>0 ) { TranslateMessage(&msg); DispatchMessage(&msg); } } moocow = 0; if(exiting) return(0); return(1); } /* Some timing-related variables. */ static int maxconbskip = 9; /* Maximum consecutive blit skips. */ static int ffbskip = 9; /* Blit skips per blit when FF-ing */ static int fullscreen=0; static int soundflush=0; static int genie=0; static int palyo=0; static int windowedfailed; static double saspectw=1, saspecth=1; static double winsizemulx=1, winsizemuly=1; static int winwidth,winheight; static int ismaximized = 0; static volatile int nofocus=0; static volatile int userpause=0; #define SO_FORCE8BIT 1 #define SO_SECONDARY 2 #define SO_GFOCUS 4 #define SO_D16VOL 8 #define GOO_DISABLESS 1 /* Disable screen saver when game is loaded. */ #define GOO_CONFIRMEXIT 2 /* Confirmation before exiting. */ #define GOO_POWERRESET 4 /* Confirm on power/reset. */ static uint32 goptions = GOO_DISABLESS; static int soundrate=44100; static int soundbuftime=50; static int soundoptions=SO_SECONDARY|SO_GFOCUS; static int soundvolume=100; static int soundquality=0; static unsigned int srendline,erendline; static unsigned int srendlinen=8; static unsigned int erendlinen=231; static unsigned int srendlinep=0; static unsigned int erendlinep=239; static unsigned int totallines; static void FixFL(void) { FCEUI_GetCurrentVidSystem(&srendline,&erendline); totallines=erendline-srendline+1; } static void UpdateRendBounds(void) { FCEUI_SetRenderedLines(srendlinen,erendlinen,srendlinep,erendlinep); FixFL(); } static uint8 cpalette[192]; static int vmod = 0; static int soundo=1; static int ntsccol=0,ntsctint,ntschue; void FCEUD_PrintError(char *s) { AddLogText(s,1); if(fullscreen) ShowCursorAbs(1); MessageBox(0,s,"FCE Ultra Error",MB_ICONERROR|MB_OK|MB_SETFOREGROUND|MB_TOPMOST); if(fullscreen)ShowCursorAbs(0); } void ShowAboutBox(void) { sprintf(TempArray,"FCE Ultra "FCEU_VERSION"\n\nhttp://fceultra.sourceforge.net\n\n"__TIME__"\n"__DATE__"\n""gcc "__VERSION__); MessageBox(hAppWnd,TempArray,"About FCE Ultra",MB_OK); } void DoFCEUExit(void) { /* Wolfenstein 3D had cute exit messages. */ char *emsg[4]={"Are you sure you want to leave? I'll become lonely!", "If you exit, I'll... EAT YOUR MOUSE.", "You can never really exit, you know.", "E-x-i-t?" }; if(exiting) /* Eh, oops. I'll need to try to fix this later. */ return; StopSound(); if(goptions & GOO_CONFIRMEXIT) if(IDYES != MessageBox(hAppWnd,emsg[rand()&3],"Exit FCE Ultra?",MB_ICONQUESTION|MB_YESNO)) return; exiting=1; if(GI) { FCEUI_CloseGame(); GI=0; } } void DoPriority(void) { if(eoptions&EO_HIGHPRIO) { if(!SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_HIGHEST)) { AddLogText("Error setting thread priority to THREAD_PRIORITY_HIGHEST.",1); } } else if(!SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_NORMAL)) { AddLogText("Error setting thread priority to THREAD_PRIORITY_NORMAL.",1); } } static int changerecursive=0; #include "throttle.c" #include "sound.c" #include "video.c" #include "window.c" #include "config.c" #include "args.c" int DriverInitialize(void) { if(soundo) soundo=InitSound(); SetVideoMode(fullscreen); InitInputStuff(); /* Initialize DInput interfaces. */ return 1; } static void DriverKill(void) { sprintf(TempArray,"%s/fceu98.cfg",BaseDirectory); SaveConfig(TempArray); DestroyInput(); ResetVideo(); if(soundo) TrashSound(); CloseWave(); ByebyeWindow(); } void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count); int main(int argc,char *argv[]) { char *t; if(timeBeginPeriod(1)!=TIMERR_NOERROR) { AddLogText("Error setting timer granularity to 1ms.",1); } if(!FCEUI_Initialize()) goto doexito; srand(GetTickCount()); // rand() is used for some GUI sillyness. fceu_hInstance=GetModuleHandle(0); GetBaseDirectory(); sprintf(TempArray,"%s\\fceu98.cfg",BaseDirectory); LoadConfig(TempArray); t=ParseArgies(argc,argv); /* Bleh, need to find a better place for this. */ { palyo&=1; FCEUI_SetVidSystem(palyo); genie&=1; FCEUI_SetGameGenie(genie); fullscreen&=1; soundo&=1; FCEUI_SetSoundVolume(soundvolume); FCEUI_SetSoundQuality(soundquality); } ParseGIInput(NULL); /* Since a game doesn't have to be loaded before the GUI can be used, make sure the temporary input type variables are set. */ CreateDirs(); SetDirs(); DoVideoConfigFix(); DoTimingConfigFix(); if(eoptions&EO_CPALETTE) FCEUI_SetPaletteArray(cpalette); if(!t) fullscreen=0; CreateMainWindow(); if(!InitDInput()) goto doexito; if(!DriverInitialize()) goto doexito; InitSpeedThrottle(); UpdateMenu(); if(t) ALoad(t); else if(eoptions&EO_FOAFTERSTART) LoadNewGamey(hAppWnd, 0); doloopy: UpdateFCEUWindow(); if(GI) { while(GI) { uint8 *gfx; int32 *sound; int32 ssize; FCEUI_Emulate(&gfx, &sound, &ssize, 0); xbsave = gfx; FCEUD_Update(gfx, sound, ssize); } xbsave = NULL; RedrawWindow(hAppWnd,0,0,RDW_ERASE|RDW_INVALIDATE); StopSound(); } Sleep(50); if(!exiting) goto doloopy; doexito: DriverKill(); timeEndPeriod(1); FCEUI_Kill(); return(0); } void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count) { static int skipcount = 0; int maxskip = maxconbskip; if(NoWaiting & 1) maxskip = ffbskip; if(Count) { int32 can=GetWriteSound(); static int uflow=0; int32 tmpcan; extern int FCEUDnetplay; if(can >= GetMaxSound()) uflow=1; /* Go into massive underflow mode. */ if(can > Count) can=Count; else uflow=0; FCEUD_WriteSoundData(Buffer,can); tmpcan = GetWriteSound(); if(((tmpcan < Count*0.90) && !uflow) || (skipcount >= maxskip)) { if(XBuf && (!NoWaiting || skipcount >= maxskip)) { skipcount = 0; FCEUD_BlitScreen(XBuf); } else { skipcount++; //FCEU_printf("Skipped0"); } Buffer+=can; Count-=can; if(Count) { if(NoWaiting) { can=GetWriteSound(); if(Count>can) Count=can; } FCEUD_WriteSoundData(Buffer,Count); } } else { skipcount++; //FCEU_printf("Skipped"); #ifdef NETWORK if(!NoWaiting && FCEUDnetplay && (uflow || tmpcan >= (Count * 0.90))) { if(Count > tmpcan) Count=tmpcan; while(tmpcan > 0) { //printf("Overwrite: %d\n", (Count <= tmpcan)?Count : tmpcan); FCEUD_WriteSoundData(Buffer, (Count <= tmpcan)?Count : tmpcan); tmpcan -= Count; } } #endif } } else { /* This complex statement deserves some explanation. Make sure this special speed throttling hasn't been disabled by the user first. Second, we don't want to throttle the speed if the fast-forward button is pressed down(or during certain network play conditions). Now, if we're at this point, we'll throttle speed if sound is disabled. Otherwise, it gets a bit more complicated. We'll throttle speed if focus to FCE Ultra has been lost and we're writing to the primary sound buffer because our sound code won't block. Blocking does seem to work when writing to a secondary buffer, so we won't throttle when a secondary buffer is used. */ int skipthis = 0; if(!(eoptions&EO_NOTHROTTLE)) if(!NoWaiting) if(!soundo || (soundo && nofocus && !(soundoptions&SO_SECONDARY)) ) skipthis = SpeedThrottle(); if(XBuf) { if((!skipthis && !NoWaiting) || (skipcount >= maxskip)) { FCEUD_BlitScreen(XBuf); skipcount = 0; } else { skipcount++; } } } UpdateFCEUWindow(); FCEUD_UpdateInput(); } /* void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count) { FCEUD_BlitScreen(XBuf); if(Count && soundo) FCEUD_WriteSoundData(Buffer,Count); FCEUD_UpdateInput(); } */ FILE *FCEUD_UTF8fopen(const char *n, const char *m) { return(fopen(n,m)); } fceu-0.98.12/src/drivers/win/debug.c0000644000175000000620000004775010110476314017020 0ustar joestaff00000000000000#include "common.h" #include "../../x6502.h" #include "../../debug.h" #include "debug.h" static void DoMemmo(HWND hParent); void UpdateDebugger(void); static int discallb(uint16 a, char *s); static void crs(HWND hParent); static void Disyou(uint16 a); static void UpdateDMem(uint16 a); static HWND mwin=0; static int32 cmsi; static int instep=-1; static X6502 *Xsave; HWND dwin; static uint16 StrToU16(char *s) { unsigned int ret=0; sscanf(s,"%4x",&ret); return ret; } static uint8 StrToU8(char *s) { unsigned int ret=0; sscanf(s,"%2x",&ret); return ret; } /* Need to be careful where these functions are used. */ static char *U16ToStr(uint16 a) { static char TempArray[16]; sprintf(TempArray,"%04X",a); return TempArray; } static char *U8ToStr(uint8 a) { static char TempArray[16]; sprintf(TempArray,"%02X",a); return TempArray; } static uint16 asavers[27]; static void crs(HWND hParent) { // SetDlgItemText(hParent,320,(LPTSTR)(instep>=0)?"Stopped.":"Running..."); EnableWindow( GetDlgItem(hParent,301),(instep>=0)?1:0); } static void Disyou(uint16 a) { int discount; SendDlgItemMessage(dwin,100,LB_RESETCONTENT,0,0); discount = 0; while(discount < 25) { char buffer[256]; uint16 prea = a; asavers[discount]=a; sprintf(buffer,"%04x: ",a); a = FCEUI_Disassemble(Xsave,a,buffer + strlen(buffer)); if(prea==Xsave->PC) SendDlgItemMessage(dwin,100,LB_SETCURSEL,discount,0); SendDlgItemMessage(dwin,100,LB_ADDSTRING,0,(LPARAM)(LPSTR)buffer); discount++; } //FCEUI_Disassemble(Xsave,a,discallb); } static void SSI(X6502 *X) { SCROLLINFO si; memset(&si,0,sizeof(si)); si.cbSize=sizeof(si); si.fMask=SIF_ALL; si.nMin=-32768; si.nMax=32767; si.nPage=27; si.nPos=X->PC-32768; SetScrollInfo(GetDlgItem(dwin,101),SB_CTL,&si,1); } static void RFlags(X6502 *X) { int x; SetDlgItemText(dwin,202,(LPTSTR)U8ToStr(X->P&~0x30)); for(x=0;x<8;x++) { if(x!=4 && x!=5) CheckDlgButton(dwin,400+x,((X->P>>x)&1)?BST_CHECKED:BST_UNCHECKED); } } static void RRegs(X6502 *X) { SetDlgItemText(dwin,200,(LPTSTR)U16ToStr(X->PC)); SetDlgItemText(dwin,201,(LPTSTR)U8ToStr(X->S)); SetDlgItemText(dwin,210,(LPTSTR)U8ToStr(X->A)); SetDlgItemText(dwin,211,(LPTSTR)U8ToStr(X->X)); SetDlgItemText(dwin,212,(LPTSTR)U8ToStr(X->Y)); } static void DoVecties(HWND hParent) { uint16 m[3]; int x; FCEUI_GetIVectors(&m[2],&m[0],&m[1]); for(x=0;x<3;x++) SetDlgItemText(hParent,220+x,(LPTSTR)U16ToStr(m[x])); } static void Redrawsy(X6502 *X) { SSI(X); RFlags(X); RRegs(X); Disyou(X->PC); DoVecties(dwin); } static void MultiCB(X6502 *X) { Xsave=X; if(instep>=0) { Redrawsy(X); if(mwin) UpdateDMem(cmsi); } while(instep>=0) { if(instep>=1) { instep--; return; } StopSound(); if(!BlockingCheck()) /* Whoops, need to exit for some reason. */ { instep=-1; FCEUI_SetCPUCallback(0); return; } Sleep(50); } } static int multistep=0; static void cpucb(X6502 *X) { multistep=0; MultiCB(X); } static void BPointHandler(X6502 *X, int type, unsigned int A) { if(multistep) return; /* To handle instructions that can cause multiple breakpoints per instruction. */ if(!dwin) return; /* Window is closed, don't do breakpoints. */ multistep=1; instep=0; crs(dwin); MultiCB(X); } static HWND hWndCallB; static int RBPCallBack(int type, unsigned int A1, unsigned int A2, void (*Handler)(X6502 *, int type, unsigned int A) ) { char buf[128]; sprintf(buf,"%s%s%s $%04x - $%04x",(type&BPOINT_READ)?"R":" ", (type&BPOINT_WRITE)?"W":" ",(type&BPOINT_PC)?"P":" ",A1,A2); SendDlgItemMessage(hWndCallB,510,LB_ADDSTRING,0,(LPARAM)(LPSTR)buf); return(1); } static void RebuildBPointList(HWND hwndDlg) { SendDlgItemMessage(hwndDlg,510,LB_RESETCONTENT,0,0); hWndCallB=hwndDlg; FCEUI_ListBreakPoints(RBPCallBack); } static void FetchBPDef(HWND hwndDlg, uint16 *A1, uint16 *A2, int *type) { char tmp[256]; GetDlgItemText(hwndDlg,520,tmp,256); *A1=StrToU16(tmp); GetDlgItemText(hwndDlg,521,tmp,256); if(tmp[0]==0) *A2=*A1; else *A2=StrToU16(tmp); *type=0; *type|=(IsDlgButtonChecked(hwndDlg,530)==BST_CHECKED)?BPOINT_READ:0; *type|=(IsDlgButtonChecked(hwndDlg,531)==BST_CHECKED)?BPOINT_WRITE:0; *type|=(IsDlgButtonChecked(hwndDlg,532)==BST_CHECKED)?BPOINT_PC:0; } static void SetBPDef(HWND hwndDlg, int32 A1, int32 A2, int type) { if(A1>=0) SetDlgItemText(hwndDlg,520,(LPTSTR)U16ToStr(A1)); if(A2>=0) SetDlgItemText(hwndDlg,521,(LPTSTR)U16ToStr(A2)); if(type>=0) { // CheckDlgButton(hwndDlg,123,(soundoptions&SO_SECONDARY)?BST_CHECKED:BST_UNCHECKED); } } static BOOL CALLBACK DebugCon(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { int32 scrollindex=0,ced=0; DSMFix(uMsg); switch(uMsg) { case WM_INITDIALOG: crs(hwndDlg); DoVecties(hwndDlg); FCEUI_SetCPUCallback(cpucb); RebuildBPointList(hwndDlg); break; case WM_VSCROLL: if(0!=instep) break; switch((int)LOWORD(wParam)) { case SB_TOP: scrollindex=-32768; ced=1; break; case SB_BOTTOM: scrollindex=32767; ced=1; break; case SB_LINEUP: scrollindex=GetScrollPos(GetDlgItem(hwndDlg,101),SB_CTL); if(scrollindex>-32768) { scrollindex--; ced=1; } break; case SB_PAGEUP: scrollindex=GetScrollPos(GetDlgItem(hwndDlg,101),SB_CTL); scrollindex-=27; if(scrollindex<-32768) scrollindex=-32768; ced=1; break; case SB_LINEDOWN: scrollindex=GetScrollPos(GetDlgItem(hwndDlg,101),SB_CTL); if(scrollindex<32767) { scrollindex++; ced=1; } break; case SB_PAGEDOWN: scrollindex=GetScrollPos(GetDlgItem(hwndDlg,101),SB_CTL); scrollindex+=27; if(scrollindex>32767) { scrollindex=32767; } ced=1; break; case SB_THUMBPOSITION: case SB_THUMBTRACK: scrollindex=(int16)(wParam>>16); ced=1; break; } if(ced) { SendDlgItemMessage(hwndDlg,101,SBM_SETPOS,scrollindex,1); Disyou(scrollindex+32768); } break; case WM_CLOSE: case WM_QUIT: goto gornk; case WM_COMMAND: switch(HIWORD(wParam)) { case LBN_DBLCLK: if(0==instep) { Xsave->PC=asavers[SendDlgItemMessage(hwndDlg,100,LB_GETCURSEL,0,0)]; RRegs(Xsave); Disyou(Xsave->PC); } break; case EN_KILLFOCUS: { char TempArray[64]; int id=LOWORD(wParam); GetDlgItemText(hwndDlg,id,TempArray,64); if(0==instep) { int tscroll=32768+SendDlgItemMessage(hwndDlg,101,SBM_GETPOS,0,0); switch(id) { case 200: if(Xsave->PC!=StrToU16(TempArray)) { Xsave->PC=StrToU16(TempArray); Disyou(Xsave->PC); RRegs(Xsave); } break; case 201:Xsave->S=StrToU8(TempArray); RRegs(Xsave); Disyou(tscroll); break; case 202:Xsave->P&=0x30; Xsave->P|=StrToU8(TempArray)&~0x30; RFlags(Xsave); Disyou(tscroll); break; case 210:Xsave->A=StrToU8(TempArray); RRegs(Xsave); Disyou(tscroll); break; case 211:Xsave->X=StrToU8(TempArray); RRegs(Xsave); Disyou(tscroll); break; case 212:Xsave->Y=StrToU8(TempArray); RRegs(Xsave); Disyou(tscroll); break; } } } break; case BN_CLICKED: if(LOWORD(wParam)>=400 && LOWORD(wParam)<=407) { if(0==instep) { Xsave->P^=1<<(LOWORD(wParam)&7); RFlags(Xsave); } } else switch(LOWORD(wParam)) { case 300: instep=1; crs(hwndDlg); break; case 301: instep=-1; crs(hwndDlg); break; case 302:FCEUI_NMI();break; case 303:FCEUI_IRQ();break; case 310:FCEUI_ResetNES(); if(instep>=0) instep=1; crs(hwndDlg); break; case 311:DoMemmo(hwndDlg);break; case 540: { LONG t; t=SendDlgItemMessage(hwndDlg,510,LB_GETCURSEL,0,0); if(t!=LB_ERR) { FCEUI_DeleteBreakPoint(t); SendDlgItemMessage(hWndCallB,510,LB_DELETESTRING,t,(LPARAM)(LPSTR)0); } } break; case 541: { uint16 A1,A2; int type; FetchBPDef(hwndDlg, &A1, &A2, &type); FCEUI_AddBreakPoint(type, A1,A2,BPointHandler); hWndCallB=hwndDlg; /* Hacky hacky. */ RBPCallBack(type, A1,A2,0); } break; } break; } if(!(wParam>>16)) switch(wParam&0xFFFF) { case 1: gornk: instep=-1; FCEUI_SetCPUCallback(0); DestroyWindow(dwin); dwin=0; break; } } return 0; } void BeginDSeq(HWND hParent) { if(dwin) { SetFocus(dwin); return; } if(!GI) { FCEUD_PrintError("You must have a game loaded before you can screw up a game."); return; } dwin=CreateDialog(fceu_hInstance,"DEBUGGER",0,DebugCon); } /* 16 numbers per line times 3 then minus one(no space at end) and plus 6 for "8000: "-like string and plus 2 for crlf. *16 for 16 lines, and +1 for a null. */ static uint8 kbuf[(16*3-1+6+2)*16+1]; static void sexycallb(uint16 a, uint8 v) { if((a&15)==15) sprintf(kbuf+strlen(kbuf),"%02X\r\n",v); else if((a&15)==0) sprintf(kbuf+strlen(kbuf),"%03xx: %02X ",a>>4,v); else sprintf(kbuf+strlen(kbuf),"%02X ",v); } static void MDSSI(void) { SCROLLINFO si; memset(&si,0,sizeof(si)); si.cbSize=sizeof(si); si.fMask=SIF_ALL; si.nMin=0; si.nMax=0xFFFF>>4; si.nPage=16; cmsi=si.nPos=0; SetScrollInfo(GetDlgItem(mwin,103),SB_CTL,&si,1); } static void UpdateDMem(uint16 a) { kbuf[0]=0; FCEUI_MemDump(a<<4,256,sexycallb); SetDlgItemText(mwin,100,kbuf); } int CreateDumpSave(uint32 a1, uint32 a2) { const char filter[]="Raw dump(*.dmp)\0*.dmp\0"; char nameo[2048]; OPENFILENAME ofn; memset(&ofn,0,sizeof(ofn)); ofn.lStructSize=sizeof(ofn); ofn.hInstance=fceu_hInstance; ofn.lpstrTitle="Dump Memory As..."; ofn.lpstrFilter=filter; nameo[0]=0; ofn.lpstrFile=nameo; ofn.nMaxFile=256; ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY; if(GetSaveFileName(&ofn)) { FCEUI_DumpMem(nameo,a1,a2); return(1); } return 0; } int LoadSave(uint32 a) { const char filter[]="Raw dump(*.dmp)\0*.dmp\0"; char nameo[2048]; OPENFILENAME ofn; memset(&ofn,0,sizeof(ofn)); ofn.lStructSize=sizeof(ofn); ofn.hInstance=fceu_hInstance; ofn.lpstrTitle="Load Memory..."; ofn.lpstrFilter=filter; nameo[0]=0; ofn.lpstrFile=nameo; ofn.nMaxFile=256; ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY; if(GetOpenFileName(&ofn)) { FCEUI_LoadMem(nameo,a,0); /* LL Load */ return(1); } return 0; } static BOOL CALLBACK MemCon(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { int32 scrollindex=0,ced=0; char TempArray[64]; DSMFix(uMsg); switch(uMsg) { case WM_CLOSE: case WM_QUIT: goto gornk; case WM_COMMAND: switch(HIWORD(wParam)) { case BN_CLICKED: switch(LOWORD(wParam)) { case 203: case 202: { uint16 a; uint8 v; GetDlgItemText(hwndDlg,200,TempArray,64); a=StrToU16(TempArray); GetDlgItemText(hwndDlg,201,TempArray,64); v=StrToU8(TempArray); FCEUI_MemPoke(a,v,LOWORD(wParam)&1); UpdateDMem(cmsi); if(dwin && 0==instep) { int tscroll=32768+SendDlgItemMessage(dwin,101,SBM_GETPOS,0,0); Disyou(tscroll); } } break; case 212: { uint16 a1; uint16 a2; GetDlgItemText(hwndDlg,210,TempArray,64); a1=StrToU16(TempArray); GetDlgItemText(hwndDlg,211,TempArray,64); a2=StrToU16(TempArray); CreateDumpSave(a1,a2); } break; case 222: { uint16 a; GetDlgItemText(hwndDlg,220,TempArray,64); a=StrToU16(TempArray); LoadSave(a); UpdateDMem(cmsi); if(dwin && 0==instep) { int tscroll=32768+SendDlgItemMessage(dwin,101,SBM_GETPOS,0,0); Disyou(tscroll); } } break; } break; } if(!(wParam>>16)) switch(wParam&0xFFFF) { case 1: gornk: DestroyWindow(mwin); mwin=0; break; } break; case WM_INITDIALOG: return(1); case WM_VSCROLL: switch((int)LOWORD(wParam)) { case SB_TOP: scrollindex=0; ced=1; break; case SB_BOTTOM: scrollindex=0xffff>>4; ced=1; break; case SB_LINEUP: scrollindex=GetScrollPos(GetDlgItem(hwndDlg,103),SB_CTL); if(scrollindex>0) { scrollindex--; ced=1; } break; case SB_PAGEUP: scrollindex=GetScrollPos(GetDlgItem(hwndDlg,103),SB_CTL); scrollindex-=16; if(scrollindex<0) scrollindex=0; ced=1; break; case SB_LINEDOWN: scrollindex=GetScrollPos(GetDlgItem(hwndDlg,103),SB_CTL); if(scrollindex<(0xFFFF>>4)) { scrollindex++; ced=1; } break; case SB_PAGEDOWN: scrollindex=GetScrollPos(GetDlgItem(hwndDlg,103),SB_CTL); scrollindex+=16; if(scrollindex>(0xFFFF>>4)) { scrollindex=(65535>>4); } ced=1; break; case SB_THUMBPOSITION: case SB_THUMBTRACK: scrollindex=HIWORD(wParam); ced=1; break; } if(ced) { SendDlgItemMessage(hwndDlg,103,SBM_SETPOS,scrollindex,1); UpdateDMem(scrollindex); cmsi=scrollindex; } break; } return 0; } static void DoMemmo(HWND hParent) { if(mwin) { SetFocus(mwin); return; } mwin=CreateDialog(fceu_hInstance,"MEMVIEW",0,MemCon); MDSSI(); UpdateDMem(0); } void UpdateDebugger(void) { if(mwin) UpdateDMem(cmsi); } void KillDebugger(void) { if(mwin) DestroyWindow(mwin); if(dwin) DestroyWindow(dwin); dwin=mwin=0; } fceu-0.98.12/src/drivers/win/sound.c0000644000175000000620000003735210110476314017057 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ LPDIRECTSOUND ppDS=0; /* DirectSound object. */ LPDIRECTSOUNDBUFFER ppbuf=0; /* Primary buffer object. */ LPDIRECTSOUNDBUFFER ppbufsec=0; /* Secondary buffer object. */ LPDIRECTSOUNDBUFFER ppbufw; /* Buffer to actually write to. */ long DSBufferSize; /* The size of the buffer that we can write to, in bytes. */ long BufHowMuch; /* How many bytes we should try to buffer. */ DWORD ToWritePos; /* Position which the next write to the buffer should write to. */ DSBUFFERDESC DSBufferDesc; WAVEFORMATEX wfa; WAVEFORMATEX wf; static int bittage; void TrashSound(void) { FCEUI_Sound(0); if(ppbufsec) { IDirectSoundBuffer_Stop(ppbufsec); IDirectSoundBuffer_Release(ppbufsec); ppbufsec=0; } if(ppbuf) { IDirectSoundBuffer_Stop(ppbuf); IDirectSoundBuffer_Release(ppbuf); ppbuf=0; } if(ppDS) { IDirectSound_Release(ppDS); ppDS=0; } } void CheckDStatus(void) { DWORD status; status=0; IDirectSoundBuffer_GetStatus(ppbufw, &status); if(status&DSBSTATUS_BUFFERLOST) { IDirectSoundBuffer_Restore(ppbufw); } if(!(status&DSBSTATUS_PLAYING)) { ToWritePos=0; IDirectSoundBuffer_SetFormat(ppbufw,&wf); IDirectSoundBuffer_Play(ppbufw,0,0,DSBPLAY_LOOPING); } } static uint32_t RawCanWrite(void) { DWORD CurWritePos,CurPlayPos=0; CheckDStatus(); CurWritePos=0; if(IDirectSoundBuffer_GetCurrentPosition(ppbufw,&CurPlayPos,&CurWritePos)==DS_OK) { // FCEU_DispMessage("%8d",(CurWritePos-CurPlayPos)); } CurWritePos=(CurPlayPos+BufHowMuch)%DSBufferSize; /* If the current write pos is >= half the buffer size less than the to write pos, assume DirectSound has wrapped around. */ if(((int32_t)ToWritePos-(int32_t)CurWritePos) >= (DSBufferSize/2)) { CurWritePos+=DSBufferSize; //FCEU_printf("Fixit: %d,%d,%d\n",ToWritePos,CurWritePos,CurWritePos-DSBufferSize); } if(ToWritePos BufHowMuch) /* Oopsie. Severe buffer overflow... */ { //FCEU_printf("Ack"); ToWritePos=CurWritePos%DSBufferSize; } return(CurWritePos-ToWritePos); } else return(0); } int32 GetWriteSound(void) { return(RawCanWrite() >> bittage); } int32 GetMaxSound(void) { return( BufHowMuch >> bittage); } static int RawWrite(void *data, uint32_t len) { uint32_t cw; //printf("Pre: %d\n",SexyALI_DSound_RawCanWrite(device)); //fflush(stdout); CheckDStatus(); /* In this block, we write as much data as we can, then we write the rest of it in >=1ms chunks. */ while(len) { VOID *LockPtr[2]={0,0}; DWORD LockLen[2]={0,0}; int32_t curlen; while(!(curlen=RawCanWrite())) { Sleep(1); } if(curlen>len) curlen=len; if(DS_OK == IDirectSoundBuffer_Lock(ppbufw,ToWritePos,curlen,&LockPtr[0],&LockLen[0],&LockPtr[1],&LockLen[1],0)) { } if(LockPtr[1] != 0 && LockPtr[1] != LockPtr[0]) { memcpy(LockPtr[0],data,LockLen[0]); memcpy(LockPtr[1],data+LockLen[0],len-LockLen[0]); } else if(LockPtr[0]) { memcpy(LockPtr[0],data,curlen); } IDirectSoundBuffer_Unlock(ppbufw,LockPtr[0],LockLen[0],LockPtr[1],LockLen[1]); ToWritePos=(ToWritePos+curlen)%DSBufferSize; len-=curlen; (uint8_t *) data+=curlen; if(len) Sleep(1); } // end while(len) loop return(1); } void FCEUD_WriteSoundData(int32 *Buffer, int Count) { static int16 MBuffer[2 * 96000 / 50]; /* * 2 for safety. */ int P; if(!bittage) { for(P=0;P>8))^128; RawWrite(MBuffer,Count); } else { for(P=0;P>16)) switch(wParam&0xFFFF) { case 1: gornk: DestroyWindow(hwndDlg); uug=0; break; } } return 0; } void ConfigSound(void) { if(!uug) uug=CreateDialog(fceu_hInstance,"SOUNDCONFIG",0,SoundConCallB); else SetFocus(uug); } void StopSound(void) { if(soundo) { VOID *LockPtr=0; DWORD LockLen=0; if(DS_OK == IDirectSoundBuffer_Lock(ppbufw,0,DSBufferSize,&LockPtr,&LockLen,0,0,0)) { //FCEUD_PrintError("K"); if(bittage) memset(LockPtr, 0, LockLen); else memset(LockPtr, 0x80, LockLen); IDirectSoundBuffer_Unlock(ppbufw,LockPtr,LockLen,0,0); } //IDirectSoundBuffer_Stop(ppbufw); } } #include "wave.c" fceu-0.98.12/src/drivers/win/wave.c0000644000175000000620000000253010110476314016657 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ int CloseWave(void) { return(FCEUI_EndWaveRecord()); } int CreateSoundSave(void) { const char filter[]="MS WAVE(*.wav)\0*.wav\0"; char nameo[2048]; OPENFILENAME ofn; FCEUI_EndWaveRecord(); memset(&ofn,0,sizeof(ofn)); ofn.lStructSize=sizeof(ofn); ofn.hInstance=fceu_hInstance; ofn.lpstrTitle="Log Sound As..."; ofn.lpstrFilter=filter; nameo[0]=0; ofn.lpstrFile=nameo; ofn.nMaxFile=256; ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY; if(GetSaveFileName(&ofn)) return FCEUI_BeginWaveRecord(nameo); return 0; } fceu-0.98.12/src/drivers/win/res.res0000644000175000000620000006574010110476324017072 0ustar joestaff00000000000000 ÿÿÿÿ¨ ÿÿÿÿ0( @@€ÿ @ € ÿ @@@€@ÿ@`@`€`ÿ`€@€€€ÿ€ @ € ÿ À@À€ÀÿÀÿ@ÿ€ÿÿÿ @ € ÿ @ € ÿ @ @@ €@ ÿ@ ` @` €` ÿ` € @€ €€ ÿ€   @  €  ÿ  À @À €À ÿÀ ÿ @ÿ €ÿ ÿÿ @@@€@ÿ@ @@ @€ @ÿ @@@@@@€@@ÿ@@`@@`@€`@ÿ`@€@@€@€€@ÿ€@ @@ @€ @ÿ @À@@À@€À@ÿÀ@ÿ@@ÿ@€ÿ@ÿÿ@`@`€`ÿ` `@ `€ `ÿ `@`@@`€@`ÿ@```@``€``ÿ``€`@€`€€`ÿ€` `@ `€ `ÿ `À`@À`€À`ÿÀ`ÿ`@ÿ`€ÿ`ÿÿ`€@€€€ÿ€ €@ €€ €ÿ €@€@@€€@€ÿ@€`€@`€€`€ÿ`€€€@€€€€€ÿ€€ €@ €€ €ÿ €À€@À€€À€ÿÀ€ÿ€@ÿ€€ÿ€ÿÿ€ @ € ÿ   @  €  ÿ  @ @@ €@ ÿ@ ` @` €` ÿ` € @€ €€ ÿ€   @  €  ÿ  À @À €À ÿÀ ÿ @ÿ €ÿ ÿÿ À@À€ÀÿÀ À@ À€ Àÿ À@À@@À€@Àÿ@À`À@`À€`Àÿ`À€À@€À€€Àÿ€À À@ À€ Àÿ ÀÀÀ@ÀÀ€ÀÀÿÀÀÿÀ@ÿÀ€ÿÀÿÿÀÿ@ÿ€ÿÿÿ ÿ@ ÿ€ ÿÿ ÿ@ÿ@@ÿ€@ÿÿ@ÿ`ÿ@`ÿ€`ÿÿ`ÿ€ÿ@€ÿ€€ÿÿ€ÿ ÿ@ ÿ€ ÿÿ ÿÀÿ@Àÿ€ÀÿÿÀÿÿÿ@ÿÿ€ÿÿÿÿÿ’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’à’à’à’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’ààÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛàààààààÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛààààÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÿÿÿÿÿÿÿÿq‹Uwz»Uwz»U7:»1wz»Uwz»U±ÿÿÿÿÿÿÿÿààÀÀ€€€ÿÿÿÿÿÿÿÿ¨ ÿÿÿÿ0( @€€€€€€€€€ÀÀÀÀÜÀðʦ @ ` €   À à@@ @@@`@€@ @À@à`` `@```€` `À`à€€ €@€`€€€ €À€à    @ ` €   À àÀÀ À@À`À€À ÀÀÀààà à@à`à€à àÀàà@@ @@@`@€@ @À@à@ @ @ @@ `@ €@  @ À@ à@@@@ @@@@@`@@€@@ @@À@@à@`@` @`@@``@`€@` @`À@`à@€@€ @€@@€`@€€@€ @€À@€à@ @  @ @@ `@ €@  @ À@ à@À@À @À@@À`@À€@À @ÀÀ@Àà@à@à @à@@à`@à€@à @àÀ@àà€€ €@€`€€€ €À€à€ € € @€ `€ €€  € À€ à€@€@ €@@€@`€@€€@ €@À€@à€`€` €`@€``€`€€` €`À€`à€€€€ €€@€€`€€€€€ €€À€€à€ €  € @€ `€ €€  € À€ à€À€À €À@€À`€À€€À €ÀÀ€Àà€à€à €à@€à`€à€€à €àÀ€ààÀÀ À@À`À€À ÀÀÀàÀ À À @À `À €À  À ÀÀ àÀ@À@ À@@À@`À@€À@ À@ÀÀ@àÀ`À` À`@À``À`€À` À`ÀÀ`àÀ€À€ À€@À€`À€€À€ À€ÀÀ€àÀ À  À @À `À €À  À ÀÀ àÀÀÀÀ ÀÀ@ÀÀ`ÀÀ€ÀÀ ðûÿ¤  €€€ÿÿÿÿÿÿÿÿÿÿÿÿ[SRR››››››[R››››››››››››S››››››››S››››››››[››¤¤£›››››››››››£££›[[RR›££ ¬¤¤››››££¤¤£›£ RZ££ ­¤¤ä䤛ZQR¤£R££ ÿÿ ¤R [ R£› ­®®¦® ÿÿ ÿÿÿ¤››£ ›£ ÿÿÿÿÿÿÿ¤¤£¤ÿÿ£ ÿÿÿÿÿÿÿ¤¤¤¤ÿÿ ää ÿÿÿ¤¤¤¤ÿÿ ä ¬››£¤ÿÿ ¤¤›¤ ¬ ¤£››£¬ ÿÿÿÿÿÿÿÿÿÿÿÿq‹Uwz»Uwz»U7:»1wz»Uwz»U±ÿÿÿÿÿÿÿÿÿÿÿÿÿ‡ÿÿÿÿÿþÿüÿøðàÀ€€€€€€€àÿÀÿþÿÿÿÿÿn0ÿÿFCEUMENU0&Filed&Open...e&Closef&RecentgRecent &DirectoriesoLoad State From...nSave State As...xLog &Sound As...€‚E&xit F12&NESÈ&Reset F10É&Power F11Ì&Cheats...€Ë&Debugger...&Config,Hide Menu F3-Active While Focus Lost6Game Genie7PAL Emulation@&Directories...G&GUI...A&Input...C&Network Play...D&Palette...E&Sound...B&Timing...€F&Video...&Help‘&Message Log...€&About...²0ÿÿADDCHEAT0ÄÈ#5•ïAdd CheatMS Sans SerifA€P 8ÊlÿÿƒPU' ÿÿÿÿ‚V1:Pˆ' ÿÿÿÿ‚V2:€Pe% nÿÿ€P˜% oÿÿPbÕ;pÿÿ€&Reset SearchP]Â1qÿÿ€&Do SearchPY¤;kÿÿ€&Unhide ExcludedPR‹Prÿÿ€Set Original to CurrentP¬Ûÿÿÿÿ€Cheat SearchPPagÿÿÿÿ€Parameters PV6W sÿÿ€O==V1 &&&& C==V2 PVBW tÿÿ€O==V1 &&&& |O-C|==V2 PVf0 uÿÿ€|O-C|==V2 PVr0 vÿÿ€O!=CPB Èxÿÿ„P=ÚQjÿÿ€Close PVNK wÿÿ€Value decreased. PVZK xÿÿ€Value increased.P,ÿÿÿÿ‚Name:€PHA ÈÿÿP0/ÿÿÿÿ‚Address:€PT. ÉÿÿP5?ÿÿÿÿ‚Value:€PT> Êÿÿ€PTN ËÿÿPIt2úÿÿ€AddP¶Ù¼ÿÿÿÿ€CheatsP2Pÿÿÿÿ‚Compare:P=^J Ìÿÿ€Read SubstitutePFž:ûÿÿ€Update P¼n¤,ÿÿƒPF»:üÿÿ€DeletePCˆ@ýÿÿ€Add Game GenieP ƒÿÿÿÿ‚To add a Game Genie code, type the code into the "Name" field, and hit "Add Game Genie".80ÿÿDEBUGGER0ÄÈ.3|ãDebuggerFixedsysP?Î8ÿÿ€CloseP»Üdÿÿƒ€Pâ4 ÈÿÿPÎ6ÿÿÿÿ‚PC:€PâB ÉÿÿPÎEÿÿÿÿ‚SP:€PâP ÊÿÿPÎRÿÿÿÿ‚P:€P_5 ÒÿÿPK6ÿÿÿÿ‚A:PKCÿÿÿÿ‚X:€P_C ÓÿÿPKQÿÿÿÿ‚Y:€P_Q ÔÿÿP?@ÿÿÿÿ‚N V - - D I Z CPI —ÿÿ€P I –ÿÿ€P#I “ÿÿ€P+I ’ÿÿ€P3I ‘ÿÿ€P;I ÿÿ€Pü6Q#ÿÿÿÿ€Flags:PÐ(-ÿÿ€&RunP%6ÿÿ€R&esetPÏ(,ÿÿ€&StepPX.ÿÿ€&NMIPX/ÿÿ€&IRQP¾ Ôeÿÿ„PóÌ37ÿÿ€&Memory...PÉi°Tÿÿÿÿ€BreakPointsP( ÿÿÿÿ‚IRQ:P9 Üÿÿ‚P(ÿÿÿÿ‚NMI:P9Ýÿÿ‚Pÿÿÿÿ‚Reset:P9Þÿÿ‚ PÍrd3þÿÿƒPϨ"ÿÿ€DeleteP4r ÿÿPUr ÿÿP6‚* ÿÿ€ReadP6˜$ ÿÿ€WriteP;Œ* ÿÿ€PC SamePQ¨$ÿÿ€AddPÉ*«6ÿÿÿÿ€RegistersPLtÿÿÿÿ‚-ž0ÿÿDIRCONFIG0ÄÈ?KDirectories ConfigurationMS Sans SerifP×78ÿÿ€ClosePþ2ÿÿÿÿ‚The settings in the "Individual Directory Overrides" group will override the settings in the "Base Directory Override" group. To delete an override, delete the text from the text edit control. Note that the directory the configuration file is in can not be overridden. Also, no override directories as specified here will be created; they must already exist.Pnë ÿÿÿÿ€Cheats€Pz– dÿÿP¿y8Èÿÿ€Browse...P‘ë ÿÿÿÿ€Miscellaneous(custom game palettes)€P– eÿÿP¿œ8Éÿÿ€Browse...P´ë ÿÿÿÿ€Nonvolatile Game Data(battery-backed RAM)€PÀ– fÿÿP¿¿8Êÿÿ€Browse...P×ë ÿÿÿÿ€Save States€Pã– gÿÿP¿â8Ëÿÿ€Browse...Púë*ÿÿÿÿ€Screen Snapshots€P– hÿÿP¿8Ìÿÿ€Browse...P `Íÿÿÿÿ€Individual Directory OverridesP 9ë ÿÿÿÿ€Base Directory Override€PG– iÿÿP¶F8Íÿÿ€Browse...P$Æ ,ÿÿ€Save screen snapshots as "<filebase>-<x>.png".¬0ÿÿDWBDIALOG0ÄÈ!cú8DWB!MS Sans SerifP ídÿÿ‚TextP@ 2Èÿÿ€ClearP¼!2Éÿÿ€Closeæ 0ÿÿFKBDIALOG0ÄÈK H’ÂFamily Keyboard ConfigurationMS Sans SerifP@ª8ÿÿ€ClosePr ÿÿÿÿ‚Remember to push the "Scroll Lock" key during emulation to enable Family Keyboard input.P |…ÿÿÿÿ€P+ ,ÿÿ€F1P; 4ÿÿ€1P<+ -ÿÿ€F2Pb+ .ÿÿ€F3Pˆ+ /ÿÿ€F4P®+ 0ÿÿ€F5PÔ+ 1ÿÿ€F6Pú+ 2ÿÿ€F7P + 3ÿÿ€F8P1; 5ÿÿ€2PD; 6ÿÿ€3PW; 7ÿÿ€4Pj; 8ÿÿ€5P}; 9ÿÿ€6P; :ÿÿ€7P£; ;ÿÿ€8P¶; <ÿÿ€9PÉ; =ÿÿ€0PÜ; >ÿÿ€-Pï; ?ÿÿ€^P; @ÿÿ€\\\P; Aÿÿ€STPPK Bÿÿ€ESCP)K Cÿÿ€QP<K Dÿÿ€WPOK Eÿÿ€EPbK Fÿÿ€RPuK Gÿÿ€TPˆK Hÿÿ€YP›K Iÿÿ€UP®K Jÿÿ€IPÁK Kÿÿ€OPÔK Lÿÿ€PPçK Mÿÿ€@PúK Nÿÿ€[PK Oÿÿ€RETURNP[ Pÿÿ€CTRP-[ Qÿÿ€AP@[ Rÿÿ€SPS[ Sÿÿ€DPf[ Tÿÿ€FPy[ Uÿÿ€GPŒ[ Vÿÿ€HPŸ[ Wÿÿ€JP²[ Xÿÿ€KPÅ[ Yÿÿ€LPØ[ Zÿÿ€;Pë[ [ÿÿ€:Pþ[ \ÿÿ€]P[ ]ÿÿ€KANAP7k _ÿÿ€ZPJk `ÿÿ€XP]k aÿÿ€CPpk bÿÿ€VPƒk cÿÿ€BP–k dÿÿ€NP©k eÿÿ€MP¼k fÿÿ€,PÏk gÿÿ€.Pâk hÿÿ€/Põk iÿÿ€Pk ^ÿÿ€SHIFTP k jÿÿ€SHIFTPJ{ kÿÿ€GRPHP]{• lÿÿ€SPACEP<C mÿÿ€CLRPOC nÿÿ€INSPbC oÿÿ€DELPGS pÿÿ€UPP6c qÿÿ€LEFTPZc rÿÿ€RIGHTPGs sÿÿ€DOWNÐ8ÿÿGAMEPADDIALOG0ÄÈmóÜGamepad ConfigurationMS Sans SerifP­Ä8ÿÿ€ClosePèRdÿÿ€P# 0ÿÿ€UpP - 2ÿÿ€LeftP<- 3ÿÿ€RightP#@ 1ÿÿ€DownP[- .ÿÿ€SelectP~- /ÿÿ€StartP©- -ÿÿ€BPÃ- ,ÿÿ€APš 5ÿÿ€Turbo BPà 4ÿÿ€Turbo APeèReÿÿ€P#x :ÿÿ€UpP Š <ÿÿ€LeftP<Š =ÿÿ€RightP# ;ÿÿ€DownP[Š 8ÿÿ€SelectP~Š 9ÿÿ€StartP©Š 7ÿÿ€BPÊ 6ÿÿ€APšz ?ÿÿ€Turbo BPÃz >ÿÿ€Turbo AP Áj ÿÿ€Disable four-score emulation."0ÿÿGUICONFIG0ÄÈ{ØgGUI ConfigurationMS Sans SerifP™S8ÿÿ€CloseP Æ fÿÿ€Load "File Open" dialog when FCE Ultra starts.PÆ hÿÿ€Automatically hide menu on game load.P*’ nÿÿ€Ask confirmation on exit attempt.P:Á oÿÿ€Disable screen saver while game is loaded.ú4ÿÿINPUTCONFIG0ÄÈzi^ÞInput ConfigurationMS Sans SerifP Â8ÿÿ€CloseP@7ÿÿÿÿ‚Select the device you want to be enabled on input ports 1 and 2, and the Famicom expansion port. You may configure the device listed above each drop-down list by pressing "Configure", if applicable. The device currently being emulated on the each port is listed above the drop down list; loading certain games will override your settings, but only temporarily. If you select a device to be on the emulated Famicom Expansion Port, you should probably have emulated gamepads on the emulated NES-style input ports.PP˜7fÿÿ€Port 1:!PmG<hÿÿ…Pj_8jÿÿ€ConfigureP²P˜7gÿÿ€Port 2:!P¸mG<iÿÿ…P _8kÿÿ€ConfigureP BHOlÿÿ€NES-style Input PortsP)™¥7mÿÿ€Famicom Expansion Port:!P/¶T<nÿÿ…Pލ8oÿÿ€ConfigureP]G ÿÿÿÿ‚P¸]G ÿÿÿÿ‚P/¦T ÿÿÿÿ‚P^A Èÿÿ‚P»^A Éÿÿ‚P2§N Êÿÿ‚,8ÿÿMAHJONGDIALOG0ÄÈæÿjØ[mahjongMS Sans SerifPnI8ÿÿ€ClosePÈ7.ÿÿ€PH( ,ÿÿ€1P^( -ÿÿ€2Pt( .ÿÿ€3PŠ( /ÿÿ€4P ( 0ÿÿ€5P¶( 1ÿÿ€6¦,ÿÿMEMVIEW0ÄÈ0GíMemory ViewerFixedsysPÈÚ8ÿÿ€ClosePí„dÿÿP§ ÈÿÿP*§ ÉÿÿPDœ*Êÿÿ€Poke Me!P’o0fÿÿ€Memory PokePô „gÿÿ„Pv’!hÿÿ€Memory File DumpP…  ÒÿÿP½  ÓÿÿPœ¢ÿÿÿÿ‚throughPÕŸ*Ôÿÿ€Dump Me!PÈf!ÿÿÿÿ€Memory File LoadPÕ ÜÿÿP8Ó*Þÿÿ€Load!PD°*Ëÿÿ€HL Store‚4ÿÿMESSAGELOG0ÄÈ!&r¸Message Log TerminalP+8ÿÿ€CloseD¡PS‚dÿÿr,ÿÿNETMOO0ÄÈ,;^ÊNetwork PlayMS Sans SerifÄP^ fÿÿD¡P^‚eÿÿP0ÿÿÿÿ‚Remote Host:P6›Z ÈÿÿP‘› ÉÿÿP‘^7dÿÿ€SettingsP"™8úÿÿ€Connect€P¬F ËÿÿPµ.ÿÿÿÿ‚Local Players:Pè¯(ÿÿÿÿ‚Nickname:Pè›3Ìÿÿ…Py®'ÿÿÿÿ‚Game Key:P£¬C ÍÿÿP ®%ÿÿÿÿ‚Password: P6¬C Îÿÿ*8ÿÿNETPLAYCONFIG0ÄÈ!1æÈNetplay ConfigurationMS Sans SerifP£­8ÿÿ€CloseP Óÿÿÿÿ‚Network play will commence when a new game is loaded.€PBB‡ eÿÿP "ÆBÿÿÿÿ€Client€Pa/ dÿÿP ªf ,ÿÿ€Enable network play.P nÆ4ÿÿÿÿ€ServerP}Dÿÿÿÿ‚Listen on TCP port:€PU| ÈÿÿP1>ÿÿÿÿ‚Local UDP port:PD2ÿÿÿÿ‚Remote host:PeT=ÿÿÿÿ‚Remote TCP Port:€P£R fÿÿ P" .ÿÿ€ Pn -ÿÿ€Ž0ÿÿPALCONFIG0ÄÈ QØPalette ConfigurationMS Sans SerifP—z8ÿÿ€ClosePÏÿÿÿÿ‚The "NES Palette" section's options will only affect NTSC NES games. NTSC Color Emulation will override any loaded custom palette.P%fQ.ÿÿ€NES PaletteP 7:Èÿÿ€&Load Palette...P NUÉÿÿ€&Reset to Default PalettePq3W dÿÿ€EnabledPoI[ ômsctls_trackbar32TintPj%gQeÿÿ€NTSC Color EmulationPpb[ õmsctls_trackbar32HuePsXUÿÿÿÿ‚HuePr?Uÿÿÿÿ‚Tintþ<ÿÿPOWERPADDIALOG0ÄÈ{ƒwPower Pad ConfigurationMS Sans SerifP"_8ÿÿ€CloseP rJ.ÿÿ€P ,ÿÿ€1P+ -ÿÿ€2PF .ÿÿ€3P[ /ÿÿ€4P) 0ÿÿ€5P+) 1ÿÿ€6PF) 2ÿÿ€7P[) 3ÿÿ€8P; 4ÿÿ€9P+; 5ÿÿ€10PF; 6ÿÿ€11P[; 7ÿÿ€12<<ÿÿQUIZKINGDIALOG0ÄÈ{ Jquiz kingMS Sans SerifP688ÿÿ€CloseP'.ÿÿ€BuzzersP ,ÿÿ€1P& -ÿÿ€2P< .ÿÿ€3PR /ÿÿ€4Ph 0ÿÿ€5P~ 1ÿÿ€6~4ÿÿSOUNDCONFIG0ÄÈ_s˜Sound ConfigurationMS Sans SerifP0„8ÿÿ€CloseP ^ÿÿÿÿ‚Set various sound options here. The default sound buffering length is rather conservative. Lower settings are probably possible and will reduce sound latency.P ‚].ÿÿ€Output/Output Format:P0u ~ÿÿ€Sound enabled.P?u zÿÿ€Force 8-bit sound.Pj" ÿÿÿÿ‚Rate:Pvk ÿÿÿÿ‚HzPš~aÿÿ€Buffering:P¢,p {ÿÿ€Use secondary sound buffer...Pª8d |ÿÿ€...with global focus.P¤Ikÿÿÿÿ‚Length of Sound to Buffer:P¤bk €msctls_trackbar32P*:V}ÿÿ€Volume P8&Kômsctls_trackbar32P¡pÿÿÿÿ‚15 msPüpÿÿÿÿ‚200 msPÙVÿÿÿÿ‚msPÃVšÿÿ‚!P;h5.Èÿÿ…!P;OM.ÿÿ…PP# ÿÿÿÿ‚Quality:.8ÿÿTIMINGCONFIG0ÄÈÝqTiming ConfigurationMS Sans SerifPŸ]8ÿÿ€CloseP Æ eÿÿ€Disable speed throttling used when sound is disabled.P ’ iÿÿ€Set high-priority thread.P 3pÿÿÿÿ‚Maximum consecutive blit-skips:P DQÿÿÿÿ‚...when fast-forwarding:!Pt1+nÿÿ…!PZB,oÿÿ…º 4ÿÿVIDEOCONFIG0ÄÈ8ðÿLz(Video ConfigurationMS Sans SerifP [+ÿÿÿÿ‚For the custom video mode settings to be in effect, the "Custom" video mode needs to be selected. If you select a sync method, and sound is disabled, you may want to disable speed throttling(in the "Timing" window). If you use "wait for vblank", you should use the "lazy" form. Allowing more than 8 sprites per scanline can cause graphics corruption in some games, including "Solstice".P 2Zpÿÿÿÿ€Full Screen SettingsP@< eÿÿ€Full ScreenPO fÿÿ€Enter full screen mode after file is loaded.Pa4 ÿÿÿÿ‚Sync Method:PL^Y2iÿÿ…Pq* ÿÿÿÿ‚Video Mode:!P@pe4dÿÿ…PŽ“ ƒÿÿ€Disable hardware acceleration.P©<¾cÿÿÿÿ€Custom Video ModeP±Iÿÿÿÿ‚Mode:PÍG ÈÿÿPìI ÿÿÿÿ‚byPùG ÉÿÿPI ÿÿÿÿ‚@P$F#<Êÿÿ…PLHÿÿÿÿ‚bppP¯aª<ÿÿÿÿ€Image Size TransformP·p<ÿÿÿÿ‚Special scaler:!Pm1.0ÿÿ… P¸U ,ÿÿ€Scale dimensions by: P¸ŽX -ÿÿ€Stretch to Fill ScreenP‚ ÿÿÿÿ‚X:P .ÿÿP3‚ ÿÿÿÿ‚Y:P= /ÿÿP ¥§vÿÿÿÿ€Windowed SettingsPÀ<ÿÿÿÿ‚Size Multiplier:PJÀ ÿÿÿÿ‚X:P~À ÿÿÿÿ‚Y:€PY¾# ÿÿ€P¾# ‘ÿÿPË“ ’ÿÿ€Force integral scaling factors.PÙ“ “ÿÿ€Force aspect ratio correction.Pú<ÿÿÿÿ‚Sync Method:!PSøX/hÿÿ…P“ ‚ÿÿ€Disable hardware acceleration.P¸¥¬Jÿÿÿÿ€Drawing AreaPɽ'ÿÿÿÿ‚First Line:PÉÑ+ÿÿÿÿ‚Last Line:Pô°ÿÿÿÿ‚NTSCP'°ÿÿÿÿ‚PALPö¼ ôÿÿPöÏ õÿÿP(¼ öÿÿP(Ï ÷ÿÿPÃà jÿÿ€Clip left and right sides(8 columns on each).PA8ÿÿ€ClosePè\ÿÿÿÿ‚Current Pixel Aspect Ratio:€Pxç ”ÿÿP‘éÿÿÿÿ‚:€Pšç •ÿÿPˆ Xÿÿ€Allow more than 8 sprites per scanline.P¸ó¬ ÿÿÿÿ€EmulationP±<ÿÿÿÿ‚Special Scaler:!Pq°1.–ÿÿ…,ÿÿICON_10 ¨,ÿÿICON_20 ¨fceu-0.98.12/src/drivers/win/cheat.c0000644000175000000620000004271210110476314017007 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "common.h" #include "cheat.h" static HWND acwin=0; static int selcheat; static int scheatmethod=0; static uint8 cheatval1=0; static uint8 cheatval2=0; #define CSTOD 24 static uint16 StrToU16(char *s) { unsigned int ret=0; sscanf(s,"%4x",&ret); return ret; } static uint8 StrToU8(char *s) { unsigned int ret=0; sscanf(s,"%d",&ret); return ret; } static int StrToI(char *s) { int ret=0; sscanf(s,"%d",&ret); return ret; } /* Need to be careful where these functions are used. */ static char *U16ToStr(uint16 a) { static char TempArray[16]; sprintf(TempArray,"%04X",a); return TempArray; } static char *U8ToStr(uint8 a) { static char TempArray[16]; sprintf(TempArray,"%03d",a); return TempArray; } static char *IToStr(int a) { static char TempArray[32]; sprintf(TempArray,"%d",a); return TempArray; } static HWND RedoCheatsWND; static int RedoCheatsCallB(char *name, uint32 a, uint8 v, int compare, int s, int type, void *data) { char tmp[512]; sprintf(tmp,"%s %s",s?"+":"-",name); SendDlgItemMessage(RedoCheatsWND,300,LB_ADDSTRING,0,(LPARAM)(LPSTR)tmp); return(1); } static void RedoCheatsLB(HWND hwndDlg) { SendDlgItemMessage(hwndDlg,300,LB_RESETCONTENT,0,0); RedoCheatsWND=hwndDlg; FCEUI_ListCheats(RedoCheatsCallB, 0); } int cfcallb(uint32 a, uint8 last, uint8 current) { char temp[16]; sprintf(temp,"%04X:%03d:%03d",(unsigned int)a,last,current); SendDlgItemMessage(acwin,108,LB_ADDSTRING,0,(LPARAM)(LPSTR)temp); return(1); } static int scrollindex; static int scrollnum; static int scrollmax; int cfcallbinsert(uint32 a, uint8 last, uint8 current) { char temp[16]; sprintf(temp,"%04X:%03d:%03d",(unsigned int)a,last,current); SendDlgItemMessage(acwin,108,LB_INSERTSTRING,(CSTOD-1),(LPARAM)(LPSTR)temp); return(1); } int cfcallbinsertt(uint32 a, uint8 last, uint8 current) { char temp[16]; sprintf(temp,"%04X:%03d:%03d",(unsigned int)a,last,current); SendDlgItemMessage(acwin,108,LB_INSERTSTRING,0,(LPARAM)(LPSTR)temp); return(1); } void AddTheThing(HWND hwndDlg, char *s, int a, int v) { if(FCEUI_AddCheat(s,a,v,-1,0)) MessageBox(hwndDlg,"Cheat Added","Cheat Added",MB_OK); } static void DoGet(void) { int n=FCEUI_CheatSearchGetCount(); int t; scrollnum=n; scrollindex=-32768; SendDlgItemMessage(acwin,108,LB_RESETCONTENT,0,0); FCEUI_CheatSearchGetRange(0,(CSTOD-1),cfcallb); t=-32768+n-1-(CSTOD-1); if(t<-32768) t=-32768; scrollmax=t; SendDlgItemMessage(acwin,120,SBM_SETRANGE,-32768,t); SendDlgItemMessage(acwin,120,SBM_SETPOS,-32768,1); } static void FixCheatSelButtons(HWND hwndDlg, int how) { /* Update Cheat Button */ EnableWindow(GetDlgItem(hwndDlg,251),how); /* Delete Cheat Button */ EnableWindow(GetDlgItem(hwndDlg,252),how); } static BOOL CALLBACK AddCheatCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { static int lbfocus; static HWND hwndLB; switch(uMsg) { case WM_VSCROLL: if(scrollnum>(CSTOD-1)) { switch((int)LOWORD(wParam)) { case SB_TOP: scrollindex=-32768; SendDlgItemMessage(hwndDlg,120,SBM_SETPOS,scrollindex,1); SendDlgItemMessage(hwndDlg,108,LB_RESETCONTENT,(CSTOD-1),0); FCEUI_CheatSearchGetRange(scrollindex+32768,scrollindex+32768+(CSTOD-1),cfcallb); break; case SB_BOTTOM: scrollindex=scrollmax; SendDlgItemMessage(hwndDlg,120,SBM_SETPOS,scrollindex,1); SendDlgItemMessage(hwndDlg,108,LB_RESETCONTENT,(CSTOD-1),0); FCEUI_CheatSearchGetRange(scrollindex+32768,scrollindex+32768+(CSTOD-1),cfcallb); break; case SB_LINEUP: if(scrollindex>-32768) { scrollindex--; SendDlgItemMessage(hwndDlg,120,SBM_SETPOS,scrollindex,1); SendDlgItemMessage(hwndDlg,108,LB_DELETESTRING,(CSTOD-1),0); FCEUI_CheatSearchGetRange(scrollindex+32768,scrollindex+32768,cfcallbinsertt); } break; case SB_PAGEUP: scrollindex-=CSTOD; if(scrollindex<-32768) scrollindex=-32768; SendDlgItemMessage(hwndDlg,120,SBM_SETPOS,scrollindex,1); SendDlgItemMessage(hwndDlg,108,LB_RESETCONTENT,(CSTOD-1),0); FCEUI_CheatSearchGetRange(scrollindex+32768,scrollindex+32768+(CSTOD-1),cfcallb); break; case SB_LINEDOWN: if(scrollindexscrollmax) scrollindex=scrollmax; SendDlgItemMessage(hwndDlg,120,SBM_SETPOS,scrollindex,1); SendDlgItemMessage(hwndDlg,108,LB_RESETCONTENT,0,0); FCEUI_CheatSearchGetRange(scrollindex+32768,scrollindex+32768+(CSTOD-1),cfcallb); break; case SB_THUMBPOSITION: case SB_THUMBTRACK: scrollindex=(short int)HIWORD(wParam); SendDlgItemMessage(hwndDlg,120,SBM_SETPOS,scrollindex,1); SendDlgItemMessage(hwndDlg,108,LB_RESETCONTENT,0,0); FCEUI_CheatSearchGetRange(32768+scrollindex,32768+scrollindex+(CSTOD-1),cfcallb); break; } } break; case WM_INITDIALOG: selcheat = -1; FixCheatSelButtons(hwndDlg, 0); acwin=hwndDlg; SetDlgItemText(hwndDlg,110,(LPTSTR)U8ToStr(cheatval1)); SetDlgItemText(hwndDlg,111,(LPTSTR)U8ToStr(cheatval2)); DoGet(); CheckRadioButton(hwndDlg,115,120,scheatmethod+115); lbfocus=0; hwndLB=0; RedoCheatsLB(hwndDlg); break; case WM_VKEYTOITEM: if(lbfocus) { int real; real=SendDlgItemMessage(hwndDlg,108,LB_GETCURSEL,0,(LPARAM)(LPSTR)0); switch((int)LOWORD(wParam)) { case VK_UP: /* mmmm....recursive goodness */ if(!real) SendMessage(hwndDlg,WM_VSCROLL,SB_LINEUP,0); return(-1); break; case VK_DOWN: if(real==(CSTOD-1)) SendMessage(hwndDlg,WM_VSCROLL,SB_LINEDOWN,0); return(-1); break; case VK_PRIOR: SendMessage(hwndDlg,WM_VSCROLL,SB_PAGEUP,0); break; case VK_NEXT: SendMessage(hwndDlg,WM_VSCROLL,SB_PAGEDOWN,0); break; case VK_HOME: SendMessage(hwndDlg,WM_VSCROLL,SB_TOP,0); break; case VK_END: SendMessage(hwndDlg,WM_VSCROLL,SB_BOTTOM,0); break; } return(-2); } break; case WM_CLOSE: case WM_QUIT: goto gornk; case WM_COMMAND: switch(LOWORD(wParam)) { case 300: /* List box selection changed. */ if(HIWORD(wParam)==LBN_SELCHANGE) { char *s; uint32 a; uint8 v; int status; int c,type; selcheat=SendDlgItemMessage(hwndDlg,300,LB_GETCURSEL,0,(LPARAM)(LPSTR)0); if(selcheat<0) { FixCheatSelButtons(hwndDlg,0); break; } FixCheatSelButtons(hwndDlg, 1); FCEUI_GetCheat(selcheat,&s,&a,&v,&c,&status,&type); SetDlgItemText(hwndDlg,200,(LPTSTR)s); SetDlgItemText(hwndDlg,201,(LPTSTR)U16ToStr(a)); SetDlgItemText(hwndDlg,202,(LPTSTR)U8ToStr(v)); SetDlgItemText(hwndDlg,203,(c==-1)?(LPTSTR)"":(LPTSTR)IToStr(c)); CheckDlgButton(hwndDlg,204,type?BST_CHECKED:BST_UNCHECKED); } break; case 108: switch(HIWORD(wParam)) { case LBN_SELCHANGE: { char TempArray[32]; SendDlgItemMessage(hwndDlg,108,LB_GETTEXT,SendDlgItemMessage(hwndDlg,108,LB_GETCURSEL,0,(LPARAM)(LPSTR)0),(LPARAM)(LPCTSTR)TempArray); TempArray[4]=0; SetDlgItemText(hwndDlg,201,(LPTSTR)TempArray); } break; case LBN_SETFOCUS: lbfocus=1; break; case LBN_KILLFOCUS: lbfocus=0; break; } break; } switch(HIWORD(wParam)) { case LBN_DBLCLK: if(selcheat>=0) { if(LOWORD(wParam)==300) FCEUI_ToggleCheat(selcheat); RedoCheatsLB(hwndDlg); SendDlgItemMessage(hwndDlg,300,LB_SETCURSEL,selcheat,0); } break; case BN_CLICKED: if(LOWORD(wParam)>=115 && LOWORD(wParam)<=120) scheatmethod=LOWORD(wParam)-115; else switch(LOWORD(wParam)) { case 112: FCEUI_CheatSearchBegin(); DoGet(); break; case 113: FCEUI_CheatSearchEnd(scheatmethod,cheatval1,cheatval2); DoGet(); break; case 114: FCEUI_CheatSearchSetCurrentAsOriginal(); DoGet(); break; case 107: FCEUI_CheatSearchShowExcluded(); DoGet(); break; case 250: /* Add Cheat Button */ { int a,v,c,t; char name[257]; char temp[16]; GetDlgItemText(hwndDlg,200,name,256+1); GetDlgItemText(hwndDlg,201,temp,4+1); a=StrToU16(temp); GetDlgItemText(hwndDlg,202,temp,3+1); v=StrToU8(temp); GetDlgItemText(hwndDlg,203,temp,3+1); if(temp[0]==0) c=-1; else c=StrToI(temp); t=(IsDlgButtonChecked(hwndDlg,204)==BST_CHECKED)?1:0; FCEUI_AddCheat(name,a,v,c,t); RedoCheatsLB(hwndDlg); SendDlgItemMessage(hwndDlg,300,LB_SETCURSEL,selcheat,0); } break; case 253: /* Add GG Cheat Button */ { uint16 a; int c; uint8 v; char name[257]; GetDlgItemText(hwndDlg,200,name,256+1); if(FCEUI_DecodeGG(name,&a,&v,&c)) { FCEUI_AddCheat(name,a,v,c,1); RedoCheatsLB(hwndDlg); SendDlgItemMessage(hwndDlg,300,LB_SETCURSEL,selcheat,0); } } break; case 251: /* Update Cheat Button */ if(selcheat>=0) { int a,v,c,t; char name[257]; char temp[16]; GetDlgItemText(hwndDlg,200,name,256+1); GetDlgItemText(hwndDlg,201,temp,4+1); a=StrToU16(temp); GetDlgItemText(hwndDlg,202,temp,3+1); v=StrToU8(temp); GetDlgItemText(hwndDlg,203,temp,3+1); if(temp[0]==0) c=-1; else c=StrToI(temp); t=(IsDlgButtonChecked(hwndDlg,204)==BST_CHECKED)?1:0; FCEUI_SetCheat(selcheat,name,a,v,c,-1,t); RedoCheatsLB(hwndDlg); SendDlgItemMessage(hwndDlg,300,LB_SETCURSEL,selcheat,0); } break; case 252: /* Delete cheat button */ if(selcheat>=0) { FCEUI_DelCheat(selcheat); SendDlgItemMessage(hwndDlg,300,LB_DELETESTRING,selcheat,0); FixCheatSelButtons(hwndDlg, 0); selcheat=-1; SetDlgItemText(hwndDlg,200,(LPTSTR)""); SetDlgItemText(hwndDlg,201,(LPTSTR)""); SetDlgItemText(hwndDlg,202,(LPTSTR)""); SetDlgItemText(hwndDlg,203,(LPTSTR)""); CheckDlgButton(hwndDlg,204,BST_UNCHECKED); } break; case 106: gornk: EndDialog(hwndDlg,0); acwin=0; break; } break; case EN_CHANGE: { char TempArray[256]; GetDlgItemText(hwndDlg,LOWORD(wParam),TempArray,256); switch(LOWORD(wParam)) { case 110:cheatval1=StrToU8(TempArray);break; case 111:cheatval2=StrToU8(TempArray);break; } } break; } } return 0; } void ConfigAddCheat(HWND wnd) { if(!GI) { FCEUD_PrintError("You must have a game loaded before you can manipulate cheats."); return; } if(GI->type==GIT_NSF) { FCEUD_PrintError("Sorry, you can't cheat with NSFs."); return; } DialogBox(fceu_hInstance,"ADDCHEAT",wnd,AddCheatCallB); } fceu-0.98.12/src/drivers/win/Makefile.am.inc0000644000175000000620000000034710047334065020366 0ustar joestaff00000000000000.res.o: windres -o $@ $< fceud_SOURCES = drivers/win/cheat.c drivers/win/debug.c drivers/win/input.c drivers/win/joystick.c drivers/win/keyboard.c drivers/win/log.c drivers/win/main.c drivers/win/netplay.c drivers/win/res.res fceu-0.98.12/src/drivers/win/netplay.c0000644000175000000620000002760410110476314017402 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "common.h" #include "../../md5.h" static int recv_tcpwrap(uint8 *buf, int len); static void NetStatAdd(char *text); static HWND netwin=0; static char *netstatt[64]; static int netstattcount=0; static int netlocalplayers = 1; static char *netplayhost = 0; static char *netplaynick = 0; static char *netgamekey = 0; static char *netpassword = 0; static int remotetport=0xFCE; static SOCKET Socket=INVALID_SOCKET; static int wsainit=0; int FCEUDnetplay = 0; static void WSE(char *ahh) { char tmp[256]; sprintf(tmp,"*** Winsock: %s",ahh); NetStatAdd(tmp); } static void en32(uint8 *buf, uint32 morp) { buf[0]=morp; buf[1]=morp>>8; buf[2]=morp>>16; buf[3]=morp>>24; } static uint32 de32(uint8 *morp) { return(morp[0]|(morp[1]<<8)|(morp[2]<<16)|(morp[3]<<24)); } static void FixCDis(HWND hParent, int how); void FCEUD_NetworkClose(void) { NetStatAdd("*** Connection lost."); if(netwin) { SetDlgItemText(netwin,250,"Connect"); FixCDis(netwin,1); } if(Socket!=INVALID_SOCKET) { closesocket(Socket); Socket=INVALID_SOCKET; } if(wsainit) { WSACleanup(); wsainit=0; } /* Make sure blocking is returned to normal once network play is stopped. */ NoWaiting&=~2; FCEUDnetplay = 0; FCEUI_NetplayStop(); } static void FixCDis(HWND hParent, int how) { int x; for(x=200;x<=206;x++) EnableWindow( GetDlgItem(hParent,x),how); } static void GetSettings(HWND hwndDlg) { char buf[256]; char **strs[4]={&netplayhost,&netplaynick,&netgamekey,&netpassword}; int ids[4]={200,203,205,206}; int x; for(x=0;x<4;x++) { GetDlgItemText(hwndDlg,ids[x],buf,256); if(*strs[x]) { free(*strs[x]); *strs[x] = 0; } if(buf[0]) { *strs[x] = malloc(strlen(buf) + 1); strcpy(*strs[x], buf); } } remotetport = GetDlgItemInt(hwndDlg,201,0,0); netlocalplayers=1 + SendDlgItemMessage(hwndDlg,204,CB_GETCURSEL,0,(LPARAM)(LPSTR)0); } static BOOL CALLBACK NetCon(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { case WM_CLOSE: GetSettings(hwndDlg); DestroyWindow(hwndDlg); netwin=0; FCEUD_NetworkClose(); break; case WM_COMMAND: if(HIWORD(wParam)==BN_CLICKED) { switch(LOWORD(wParam)) { case 250: if(FCEUDnetplay) { FCEUD_NetworkClose(); SetDlgItemText(hwndDlg,250,"Connect"); FixCDis(hwndDlg,1); } else if(GI) { GetSettings(hwndDlg); if(FCEUD_NetworkConnect()) { SetDlgItemText(hwndDlg,250,"Disconnect"); FixCDis(hwndDlg,0); } } break; } } else if(HIWORD(wParam)==EN_CHANGE && Socket!=INVALID_SOCKET) { char buf[1024]; int t; t=GetDlgItemText(hwndDlg,102,buf,1024); buf[1023]=0; if(strchr(buf,'\r')) { char *src,*dest; src=dest=buf; while(*src) { if(*src != '\n' && *src != '\r') { *dest = *src; dest++; } src++; } *dest = 0; FCEUI_NetplayText(buf); SetDlgItemText(hwndDlg,102,""); } } break; case WM_INITDIALOG: if(netplayhost) SetDlgItemText(hwndDlg,200,netplayhost); SetDlgItemInt(hwndDlg,201,remotetport,0); if(netplaynick) SetDlgItemText(hwndDlg,203,netplaynick); if(netgamekey) SetDlgItemText(hwndDlg,205,netgamekey); if(netpassword) SetDlgItemText(hwndDlg,206,netpassword); { int x; char buf[8]; for(x=0;x<4;x++) { sprintf(buf,"%d",x+1); SendDlgItemMessage(hwndDlg,204,CB_ADDSTRING,0,(LPARAM)(LPSTR)buf); } SendDlgItemMessage(hwndDlg,204,CB_SETCURSEL,netlocalplayers-1,(LPARAM)(LPSTR)0); } break; } return 0; } static void NetStatAdd(char *text) { int x; uint32 totallen = 0; char *textbuf; if(!netwin) return; if(netstattcount>=64) free(netstatt[netstattcount&63]); if(!(netstatt[netstattcount&63]=malloc(strlen(text)+1))) return; strcpy(netstatt[netstattcount&63],text); netstattcount++; if(netstattcount>=64) { for(x=netstattcount&63;;) { totallen += strlen(netstatt[x]); x=(x+1)&63; if(x==(netstattcount&63)) break; totallen += 2; } totallen++; // NULL textbuf = malloc(totallen); textbuf[0] = 0; for(x=netstattcount&63;;) { strcat(textbuf,netstatt[x]); x=(x+1)&63; if(x==(netstattcount&63)) break; strcat(textbuf,"\r\n"); } } else { for(x=0;xh_addr,((PHOSTENT)phostentb)->h_length); } sockin.sin_port=htons(remotetport); NetStatAdd("*** Connecting to remote host..."); if(connect(TSocket,(PSOCKADDR)&sockin,sizeof(sockin))==SOCKET_ERROR) { WSE("Error connecting to remote host."); closesocket(TSocket); FCEUD_NetworkClose(); return(0); } Socket=TSocket; NetStatAdd("*** Sending initialization data to server..."); { uint8 *sendbuf; uint8 buf[1]; uint32 sblen; sblen = 4 + 16 + 16 + 64 + 1 + (netplaynick?strlen(netplaynick):0); sendbuf = malloc(sblen); memset(sendbuf, 0, sblen); en32(sendbuf, sblen - 4); if(netgamekey) { struct md5_context md5; uint8 md5out[16]; md5_starts(&md5); md5_update(&md5, GI->MD5, 16); md5_update(&md5, netgamekey, strlen(netgamekey)); md5_finish(&md5, md5out); memcpy(sendbuf + 4, md5out, 16); } else memcpy(sendbuf + 4, GI->MD5, 16); if(netpassword) { struct md5_context md5; uint8 md5out[16]; md5_starts(&md5); md5_update(&md5, netpassword, strlen(netpassword)); md5_finish(&md5, md5out); memcpy(sendbuf + 4 + 16, md5out, 16); } memset(sendbuf + 4 + 16 + 16, 0, 64); sendbuf[4 + 16 + 16 + 64] = netlocalplayers; if(netplaynick) memcpy(sendbuf + 4 + 16 + 16 + 64 + 1,netplaynick,strlen(netplaynick)); send(Socket, sendbuf, sblen, 0); free(sendbuf); recv_tcpwrap(buf, 1); netdivisor = buf[0]; } } FCEUI_NetplayStart(netlocalplayers,netdivisor); NetStatAdd("*** Connection established."); FCEUDnetplay = 1; int tcpopt = 1; if(setsockopt(TSocket, IPPROTO_TCP, TCP_NODELAY, &tcpopt, sizeof(int))) puts("Nodelay fail"); return(1); } int FCEUD_SendData(void *data, uint32 len) { send(Socket, data, len ,0); return(1); } static int recv_tcpwrap(uint8 *buf, int len) { fd_set fdoo; int t; struct timeval popeye; popeye.tv_sec=0; popeye.tv_usec=100000; while(len) { FD_ZERO(&fdoo); FD_SET(Socket,&fdoo); switch(select(0,&fdoo,0,0,&popeye)) { case 0: //BlockingCheck(); continue; case SOCKET_ERROR:return(0); } t=recv(Socket,buf,len,0); if(t<=0) return(0); len -= t; buf += t; } return(1); } int FCEUD_RecvData(void *data, uint32 len) { NoWaiting&=~2; for(;;) { fd_set funfun; struct timeval popeye; popeye.tv_sec=0; popeye.tv_usec=100000; FD_ZERO(&funfun); FD_SET(Socket,&funfun); switch(select(0,&funfun,0,0,&popeye)) { case 0:continue; case SOCKET_ERROR:return(0); } if(FD_ISSET(Socket,&funfun)) { if(recv_tcpwrap(data,len)>0) { unsigned long beefie; if(!ioctlsocket(Socket,FIONREAD,&beefie)) if(beefie) NoWaiting|=2; return(1); } else return(0); } else return(0); } return 0; } void ShowNetplayConsole(void) { if(!netwin) netwin=CreateDialog(fceu_hInstance,"NETMOO",0,NetCon); } CFGSTRUCT NetplayConfig[]={ AC(remotetport), AC(netlocalplayers), ACS(netgamekey), ACS(netplayhost), ACS(netplaynick), ACS(netpassword), ENDCFGSTRUCT }; fceu-0.98.12/src/drivers/win/netplay.h0000644000175000000620000000004310110476322017372 0ustar joestaff00000000000000extern CFGSTRUCT NetplayConfig[]; fceu-0.98.12/src/endian.c0000644000175000000620000000413110051214106014670 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ /* Contains file I/O functions that write/read data */ /* LSB first. */ #include #include "types.h" #include "endian.h" void FlipByteOrder(uint8 *src, uint32 count) { uint8 *start=src; uint8 *end=src+count-1; if((count&1) || !count) return; /* This shouldn't happen. */ while(count--) { uint8 tmp; tmp=*end; *end=*start; *start=tmp; end--; start++; } } int write16le(uint16 b, FILE *fp) { uint8 s[2]; s[0]=b; s[1]=b>>8; return((fwrite(s,1,2,fp)<2)?0:2); } int write32le(uint32 b, FILE *fp) { uint8 s[4]; s[0]=b; s[1]=b>>8; s[2]=b>>16; s[3]=b>>24; return((fwrite(s,1,4,fp)<4)?0:4); } int read32le(uint32 *Bufo, FILE *fp) { uint32 buf; if(fread(&buf,1,4,fp)<4) return 0; #ifdef LSB_FIRST *(uint32*)Bufo=buf; #else *(uint32*)Bufo=((buf&0xFF)<<24)|((buf&0xFF00)<<8)|((buf&0xFF0000)>>8)|((buf&0xFF000000)>>24); #endif return 1; } int read16le(char *d, FILE *fp) { #ifdef LSB_FIRST return((fread(d,1,2,fp)<2)?0:2); #else int ret; ret=fread(d+1,1,1,fp); ret+=fread(d,1,1,fp); return ret<2?0:2; #endif } void FCEU_en32lsb(uint8 *buf, uint32 morp) { buf[0]=morp; buf[1]=morp>>8; buf[2]=morp>>16; buf[3]=morp>>24; } uint32 FCEU_de32lsb(uint8 *morp) { return(morp[0]|(morp[1]<<8)|(morp[2]<<16)|(morp[3]<<24)); } fceu-0.98.12/src/endian.h0000644000175000000620000000033510051214045014701 0ustar joestaff00000000000000int write16le(uint16 b, FILE *fp); int write32le(uint32 b, FILE *fp); int read32le(uint32 *Bufo, FILE *fp); void FlipByteOrder(uint8 *src, uint32 count); void FCEU_en32lsb(uint8 *, uint32); uint32 FCEU_de32lsb(uint8 *); fceu-0.98.12/src/Makefile.in0000644000175000000620000056345110112240350015350 0ustar joestaff00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AWK = @AWK@ CC = @CC@ CPP = @CPP@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ PACKAGE = @PACKAGE@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = fceu # soundexp.c fceu_SOURCES = fceustr.c cart.c cheat.c crc32.c debug.c endian.c fceu.c fds.c file.c filter.c general.c ines.c input.c md5.c memory.c netplay.c nsf.c palette.c ppu.c sound.c state.c unif.c video.c vsuni.c wave.c x6502.c movie.c unzip.c boards/8237.c boards/h2288.c boards/malee.c boards/novel.c boards/sachen.c boards/simple.c boards/super24.c boards/supervision.c input/cursor.c input/zapper.c input/powerpad.c input/arkanoid.c input/shadow.c input/fkb.c input/fkb.h input/hypershot.c input/mahjong.c input/oekakids.c input/ftrainer.c input/quiz.c input/toprider.c input/bworld.c mappers/mmc2and4.c mappers/simple.c mappers/112.c mappers/117.c mappers/15.c mappers/151.c mappers/16.c mappers/17.c mappers/18.c mappers/180.c mappers/184.c mappers/21.c mappers/22.c mappers/225.c mappers/226.c mappers/228.c mappers/229.c mappers/23.c mappers/24and26.c mappers/240.c mappers/246.c mappers/25.c mappers/32.c mappers/33.c mappers/40.c mappers/41.c mappers/6.c mappers/65.c mappers/67.c mappers/68.c mappers/69.c mappers/71.c mappers/73.c mappers/75.c mappers/76.c mappers/79.c mappers/8.c mappers/80.c mappers/85.c mappers/95.c mappers/97.c mappers/99.c mappers/182.c mappers/46.c mappers/43.c mappers/42.c mappers/113.c mappers/86.c mappers/89.c mappers/83.c mappers/77.c mappers/92.c mappers/88.c mappers/248.c mappers/emu2413.c mappers/242.c mappers/232.c mappers/72.c mappers/234.c mappers/227.c mappers/82.c mappers/189.c mappers/51.c mappers/91.c mappers/114.c mappers/241.c mappers/235.c mappers/57.c mappers/255.c mappers/61.c mappers/59.c mappers/193.c mappers/50.c mappers/60.c mappers/62.c mappers/244.c mappers/230.c mappers/200.c mappers/201.c mappers/202.c mappers/203.c mappers/231.c mappers/208.c mappers/58.c mappers/187.c mbshare/mmc5.c mbshare/mmc3.c mbshare/mmc1.c mbshare/tengen.c mbshare/90.c mbshare/deirom.c mbshare/n106.c mbshare/164.c drivers/common/args.c drivers/common/cheat.c drivers/common/config.c drivers/common/vidblit.c drivers/common/hq2x.c drivers/common/hq3x.c drivers/common/scale2x.c drivers/common/scale3x.c drivers/common/scalebit.c $(sexyal_SOURCES) $(fceud_SOURCES) @USE_SEXYAL_TRUE@sexyal_SOURCES = drivers/sexyal/sexyal.c drivers/sexyal/md5.c drivers/sexyal/smallc.c drivers/sexyal/convert.c $(TMP_SEXYAL) @UNIX_TRUE@@USE_SEXYAL_TRUE@TMP_SEXYAL = drivers/sexyal/drivers/oss.c @USE_SEXYAL_TRUE@@WIN32_TRUE@TMP_SEXYAL = drivers/sexyal/drivers/dsound.c @NATIVEWIN32_TRUE@fceud_SOURCES = drivers/win/cheat.c drivers/win/debug.c drivers/win/input.c drivers/win/joystick.c drivers/win/keyboard.c drivers/win/log.c drivers/win/main.c drivers/win/netplay.c drivers/win/res.res @NATIVEWIN32_FALSE@fceud_SOURCES = drivers/pc/input.c drivers/pc/main.c drivers/pc/sdl.c drivers/pc/sdl-joystick.c drivers/pc/sdl-sound.c drivers/pc/sdl-throttle.c drivers/pc/sdl-video.c drivers/pc/unix-netplay.c $(TMP_OGL) @NATIVEWIN32_FALSE@@OPENGL_TRUE@TMP_OGL = drivers/pc/sdl-opengl.c DEFAULT_INCLUDES = subdir = src mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = bin_PROGRAMS = fceu$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) @UNIX_TRUE@@USE_SEXYAL_TRUE@am__objects_1 = \ @UNIX_TRUE@@USE_SEXYAL_TRUE@ drivers/sexyal/drivers/oss.$(OBJEXT) @USE_SEXYAL_TRUE@@WIN32_TRUE@am__objects_1 = \ @USE_SEXYAL_TRUE@@WIN32_TRUE@ drivers/sexyal/drivers/dsound.$(OBJEXT) @USE_SEXYAL_TRUE@am__objects_2 = drivers/sexyal/sexyal.$(OBJEXT) \ @USE_SEXYAL_TRUE@ drivers/sexyal/md5.$(OBJEXT) \ @USE_SEXYAL_TRUE@ drivers/sexyal/smallc.$(OBJEXT) \ @USE_SEXYAL_TRUE@ drivers/sexyal/convert.$(OBJEXT) \ @USE_SEXYAL_TRUE@ $(am__objects_1) @NATIVEWIN32_FALSE@@OPENGL_TRUE@am__objects_3 = \ @NATIVEWIN32_FALSE@@OPENGL_TRUE@ drivers/pc/sdl-opengl.$(OBJEXT) @NATIVEWIN32_TRUE@am__objects_4 = drivers/win/cheat.$(OBJEXT) \ @NATIVEWIN32_TRUE@ drivers/win/debug.$(OBJEXT) \ @NATIVEWIN32_TRUE@ drivers/win/input.$(OBJEXT) \ @NATIVEWIN32_TRUE@ drivers/win/joystick.$(OBJEXT) \ @NATIVEWIN32_TRUE@ drivers/win/keyboard.$(OBJEXT) \ @NATIVEWIN32_TRUE@ drivers/win/log.$(OBJEXT) \ @NATIVEWIN32_TRUE@ drivers/win/main.$(OBJEXT) \ @NATIVEWIN32_TRUE@ drivers/win/netplay.$(OBJEXT) res.$(OBJEXT) @NATIVEWIN32_FALSE@am__objects_4 = drivers/pc/input.$(OBJEXT) \ @NATIVEWIN32_FALSE@ drivers/pc/main.$(OBJEXT) \ @NATIVEWIN32_FALSE@ drivers/pc/sdl.$(OBJEXT) \ @NATIVEWIN32_FALSE@ drivers/pc/sdl-joystick.$(OBJEXT) \ @NATIVEWIN32_FALSE@ drivers/pc/sdl-sound.$(OBJEXT) \ @NATIVEWIN32_FALSE@ drivers/pc/sdl-throttle.$(OBJEXT) \ @NATIVEWIN32_FALSE@ drivers/pc/sdl-video.$(OBJEXT) \ @NATIVEWIN32_FALSE@ drivers/pc/unix-netplay.$(OBJEXT) \ @NATIVEWIN32_FALSE@ $(am__objects_3) am_fceu_OBJECTS = fceustr.$(OBJEXT) cart.$(OBJEXT) cheat.$(OBJEXT) \ crc32.$(OBJEXT) debug.$(OBJEXT) endian.$(OBJEXT) fceu.$(OBJEXT) \ fds.$(OBJEXT) file.$(OBJEXT) filter.$(OBJEXT) general.$(OBJEXT) \ ines.$(OBJEXT) input.$(OBJEXT) md5.$(OBJEXT) memory.$(OBJEXT) \ netplay.$(OBJEXT) nsf.$(OBJEXT) palette.$(OBJEXT) ppu.$(OBJEXT) \ sound.$(OBJEXT) state.$(OBJEXT) unif.$(OBJEXT) video.$(OBJEXT) \ vsuni.$(OBJEXT) wave.$(OBJEXT) x6502.$(OBJEXT) movie.$(OBJEXT) \ unzip.$(OBJEXT) boards/8237.$(OBJEXT) boards/h2288.$(OBJEXT) \ boards/malee.$(OBJEXT) boards/novel.$(OBJEXT) \ boards/sachen.$(OBJEXT) boards/simple.$(OBJEXT) \ boards/super24.$(OBJEXT) boards/supervision.$(OBJEXT) \ input/cursor.$(OBJEXT) input/zapper.$(OBJEXT) \ input/powerpad.$(OBJEXT) input/arkanoid.$(OBJEXT) \ input/shadow.$(OBJEXT) input/fkb.$(OBJEXT) \ input/hypershot.$(OBJEXT) input/mahjong.$(OBJEXT) \ input/oekakids.$(OBJEXT) input/ftrainer.$(OBJEXT) \ input/quiz.$(OBJEXT) input/toprider.$(OBJEXT) \ input/bworld.$(OBJEXT) mappers/mmc2and4.$(OBJEXT) \ mappers/simple.$(OBJEXT) mappers/112.$(OBJEXT) \ mappers/117.$(OBJEXT) mappers/15.$(OBJEXT) \ mappers/151.$(OBJEXT) mappers/16.$(OBJEXT) mappers/17.$(OBJEXT) \ mappers/18.$(OBJEXT) mappers/180.$(OBJEXT) \ mappers/184.$(OBJEXT) mappers/21.$(OBJEXT) mappers/22.$(OBJEXT) \ mappers/225.$(OBJEXT) mappers/226.$(OBJEXT) \ mappers/228.$(OBJEXT) mappers/229.$(OBJEXT) \ mappers/23.$(OBJEXT) mappers/24and26.$(OBJEXT) \ mappers/240.$(OBJEXT) mappers/246.$(OBJEXT) \ mappers/25.$(OBJEXT) mappers/32.$(OBJEXT) mappers/33.$(OBJEXT) \ mappers/40.$(OBJEXT) mappers/41.$(OBJEXT) mappers/6.$(OBJEXT) \ mappers/65.$(OBJEXT) mappers/67.$(OBJEXT) mappers/68.$(OBJEXT) \ mappers/69.$(OBJEXT) mappers/71.$(OBJEXT) mappers/73.$(OBJEXT) \ mappers/75.$(OBJEXT) mappers/76.$(OBJEXT) mappers/79.$(OBJEXT) \ mappers/8.$(OBJEXT) mappers/80.$(OBJEXT) mappers/85.$(OBJEXT) \ mappers/95.$(OBJEXT) mappers/97.$(OBJEXT) mappers/99.$(OBJEXT) \ mappers/182.$(OBJEXT) mappers/46.$(OBJEXT) mappers/43.$(OBJEXT) \ mappers/42.$(OBJEXT) mappers/113.$(OBJEXT) mappers/86.$(OBJEXT) \ mappers/89.$(OBJEXT) mappers/83.$(OBJEXT) mappers/77.$(OBJEXT) \ mappers/92.$(OBJEXT) mappers/88.$(OBJEXT) mappers/248.$(OBJEXT) \ mappers/emu2413.$(OBJEXT) mappers/242.$(OBJEXT) \ mappers/232.$(OBJEXT) mappers/72.$(OBJEXT) \ mappers/234.$(OBJEXT) mappers/227.$(OBJEXT) \ mappers/82.$(OBJEXT) mappers/189.$(OBJEXT) mappers/51.$(OBJEXT) \ mappers/91.$(OBJEXT) mappers/114.$(OBJEXT) \ mappers/241.$(OBJEXT) mappers/235.$(OBJEXT) \ mappers/57.$(OBJEXT) mappers/255.$(OBJEXT) mappers/61.$(OBJEXT) \ mappers/59.$(OBJEXT) mappers/193.$(OBJEXT) mappers/50.$(OBJEXT) \ mappers/60.$(OBJEXT) mappers/62.$(OBJEXT) mappers/244.$(OBJEXT) \ mappers/230.$(OBJEXT) mappers/200.$(OBJEXT) \ mappers/201.$(OBJEXT) mappers/202.$(OBJEXT) \ mappers/203.$(OBJEXT) mappers/231.$(OBJEXT) \ mappers/208.$(OBJEXT) mappers/58.$(OBJEXT) \ mappers/187.$(OBJEXT) mbshare/mmc5.$(OBJEXT) \ mbshare/mmc3.$(OBJEXT) mbshare/mmc1.$(OBJEXT) \ mbshare/tengen.$(OBJEXT) mbshare/90.$(OBJEXT) \ mbshare/deirom.$(OBJEXT) mbshare/n106.$(OBJEXT) \ mbshare/164.$(OBJEXT) drivers/common/args.$(OBJEXT) \ drivers/common/cheat.$(OBJEXT) drivers/common/config.$(OBJEXT) \ drivers/common/vidblit.$(OBJEXT) drivers/common/hq2x.$(OBJEXT) \ drivers/common/hq3x.$(OBJEXT) drivers/common/scale2x.$(OBJEXT) \ drivers/common/scale3x.$(OBJEXT) \ drivers/common/scalebit.$(OBJEXT) $(am__objects_2) \ $(am__objects_4) fceu_OBJECTS = $(am_fceu_OBJECTS) fceu_LDADD = $(LDADD) fceu_DEPENDENCIES = fceu_LDFLAGS = DEFS = @DEFS@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cart.Po ./$(DEPDIR)/cheat.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/crc32.Po ./$(DEPDIR)/debug.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/endian.Po ./$(DEPDIR)/fceu.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/fceustr.Po ./$(DEPDIR)/fds.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/file.Po ./$(DEPDIR)/filter.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/general.Po ./$(DEPDIR)/ines.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/input.Po ./$(DEPDIR)/md5.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/memory.Po ./$(DEPDIR)/movie.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/netplay.Po ./$(DEPDIR)/nsf.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/palette.Po ./$(DEPDIR)/ppu.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/sound.Po ./$(DEPDIR)/state.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/unif.Po ./$(DEPDIR)/unzip.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/video.Po ./$(DEPDIR)/vsuni.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/wave.Po ./$(DEPDIR)/x6502.Po \ @AMDEP_TRUE@ boards/$(DEPDIR)/8237.Po boards/$(DEPDIR)/h2288.Po \ @AMDEP_TRUE@ boards/$(DEPDIR)/malee.Po boards/$(DEPDIR)/novel.Po \ @AMDEP_TRUE@ boards/$(DEPDIR)/sachen.Po \ @AMDEP_TRUE@ boards/$(DEPDIR)/simple.Po \ @AMDEP_TRUE@ boards/$(DEPDIR)/super24.Po \ @AMDEP_TRUE@ boards/$(DEPDIR)/supervision.Po \ @AMDEP_TRUE@ drivers/common/$(DEPDIR)/args.Po \ @AMDEP_TRUE@ drivers/common/$(DEPDIR)/cheat.Po \ @AMDEP_TRUE@ drivers/common/$(DEPDIR)/config.Po \ @AMDEP_TRUE@ drivers/common/$(DEPDIR)/hq2x.Po \ @AMDEP_TRUE@ drivers/common/$(DEPDIR)/hq3x.Po \ @AMDEP_TRUE@ drivers/common/$(DEPDIR)/scale2x.Po \ @AMDEP_TRUE@ drivers/common/$(DEPDIR)/scale3x.Po \ @AMDEP_TRUE@ drivers/common/$(DEPDIR)/scalebit.Po \ @AMDEP_TRUE@ drivers/common/$(DEPDIR)/vidblit.Po \ @AMDEP_TRUE@ drivers/pc/$(DEPDIR)/input.Po \ @AMDEP_TRUE@ drivers/pc/$(DEPDIR)/main.Po \ @AMDEP_TRUE@ drivers/pc/$(DEPDIR)/sdl-joystick.Po \ @AMDEP_TRUE@ drivers/pc/$(DEPDIR)/sdl-opengl.Po \ @AMDEP_TRUE@ drivers/pc/$(DEPDIR)/sdl-sound.Po \ @AMDEP_TRUE@ drivers/pc/$(DEPDIR)/sdl-throttle.Po \ @AMDEP_TRUE@ drivers/pc/$(DEPDIR)/sdl-video.Po \ @AMDEP_TRUE@ drivers/pc/$(DEPDIR)/sdl.Po \ @AMDEP_TRUE@ drivers/pc/$(DEPDIR)/unix-netplay.Po \ @AMDEP_TRUE@ drivers/sexyal/$(DEPDIR)/convert.Po \ @AMDEP_TRUE@ drivers/sexyal/$(DEPDIR)/md5.Po \ @AMDEP_TRUE@ drivers/sexyal/$(DEPDIR)/sexyal.Po \ @AMDEP_TRUE@ drivers/sexyal/$(DEPDIR)/smallc.Po \ @AMDEP_TRUE@ drivers/sexyal/drivers/$(DEPDIR)/dsound.Po \ @AMDEP_TRUE@ drivers/sexyal/drivers/$(DEPDIR)/oss.Po \ @AMDEP_TRUE@ drivers/win/$(DEPDIR)/cheat.Po \ @AMDEP_TRUE@ drivers/win/$(DEPDIR)/debug.Po \ @AMDEP_TRUE@ drivers/win/$(DEPDIR)/input.Po \ @AMDEP_TRUE@ drivers/win/$(DEPDIR)/joystick.Po \ @AMDEP_TRUE@ drivers/win/$(DEPDIR)/keyboard.Po \ @AMDEP_TRUE@ drivers/win/$(DEPDIR)/log.Po \ @AMDEP_TRUE@ drivers/win/$(DEPDIR)/main.Po \ @AMDEP_TRUE@ drivers/win/$(DEPDIR)/netplay.Po \ @AMDEP_TRUE@ input/$(DEPDIR)/arkanoid.Po \ @AMDEP_TRUE@ input/$(DEPDIR)/bworld.Po input/$(DEPDIR)/cursor.Po \ @AMDEP_TRUE@ input/$(DEPDIR)/fkb.Po input/$(DEPDIR)/ftrainer.Po \ @AMDEP_TRUE@ input/$(DEPDIR)/hypershot.Po \ @AMDEP_TRUE@ input/$(DEPDIR)/mahjong.Po \ @AMDEP_TRUE@ input/$(DEPDIR)/oekakids.Po \ @AMDEP_TRUE@ input/$(DEPDIR)/powerpad.Po input/$(DEPDIR)/quiz.Po \ @AMDEP_TRUE@ input/$(DEPDIR)/shadow.Po \ @AMDEP_TRUE@ input/$(DEPDIR)/toprider.Po \ @AMDEP_TRUE@ input/$(DEPDIR)/zapper.Po mappers/$(DEPDIR)/112.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/113.Po mappers/$(DEPDIR)/114.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/117.Po mappers/$(DEPDIR)/15.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/151.Po mappers/$(DEPDIR)/16.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/17.Po mappers/$(DEPDIR)/18.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/180.Po mappers/$(DEPDIR)/182.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/184.Po mappers/$(DEPDIR)/187.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/189.Po mappers/$(DEPDIR)/193.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/200.Po mappers/$(DEPDIR)/201.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/202.Po mappers/$(DEPDIR)/203.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/208.Po mappers/$(DEPDIR)/21.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/22.Po mappers/$(DEPDIR)/225.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/226.Po mappers/$(DEPDIR)/227.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/228.Po mappers/$(DEPDIR)/229.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/23.Po mappers/$(DEPDIR)/230.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/231.Po mappers/$(DEPDIR)/232.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/234.Po mappers/$(DEPDIR)/235.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/240.Po mappers/$(DEPDIR)/241.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/242.Po mappers/$(DEPDIR)/244.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/246.Po mappers/$(DEPDIR)/248.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/24and26.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/25.Po mappers/$(DEPDIR)/255.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/32.Po mappers/$(DEPDIR)/33.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/40.Po mappers/$(DEPDIR)/41.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/42.Po mappers/$(DEPDIR)/43.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/46.Po mappers/$(DEPDIR)/50.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/51.Po mappers/$(DEPDIR)/57.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/58.Po mappers/$(DEPDIR)/59.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/6.Po mappers/$(DEPDIR)/60.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/61.Po mappers/$(DEPDIR)/62.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/65.Po mappers/$(DEPDIR)/67.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/68.Po mappers/$(DEPDIR)/69.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/71.Po mappers/$(DEPDIR)/72.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/73.Po mappers/$(DEPDIR)/75.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/76.Po mappers/$(DEPDIR)/77.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/79.Po mappers/$(DEPDIR)/8.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/80.Po mappers/$(DEPDIR)/82.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/83.Po mappers/$(DEPDIR)/85.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/86.Po mappers/$(DEPDIR)/88.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/89.Po mappers/$(DEPDIR)/91.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/92.Po mappers/$(DEPDIR)/95.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/97.Po mappers/$(DEPDIR)/99.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/emu2413.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/mmc2and4.Po \ @AMDEP_TRUE@ mappers/$(DEPDIR)/simple.Po \ @AMDEP_TRUE@ mbshare/$(DEPDIR)/164.Po mbshare/$(DEPDIR)/90.Po \ @AMDEP_TRUE@ mbshare/$(DEPDIR)/deirom.Po \ @AMDEP_TRUE@ mbshare/$(DEPDIR)/mmc1.Po mbshare/$(DEPDIR)/mmc3.Po \ @AMDEP_TRUE@ mbshare/$(DEPDIR)/mmc5.Po mbshare/$(DEPDIR)/n106.Po \ @AMDEP_TRUE@ mbshare/$(DEPDIR)/tengen.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(fceu_SOURCES) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(fceu_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj .res $(srcdir)/Makefile.in: Makefile.am $(srcdir)/boards/Makefile.am.inc $(srcdir)/input/Makefile.am.inc $(srcdir)/mappers/Makefile.am.inc $(srcdir)/mbshare/Makefile.am.inc $(srcdir)/drivers/common/Makefile.am.inc $(srcdir)/drivers/sexyal/Makefile.am.inc $(srcdir)/drivers/win/Makefile.am.inc $(srcdir)/drivers/pc/Makefile.am.inc $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) boards/.dirstamp: @$(mkinstalldirs) boards @: > boards/.dirstamp boards/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) boards/$(DEPDIR) @: > boards/$(DEPDIR)/.dirstamp boards/8237.$(OBJEXT): boards/8237.c boards/.dirstamp \ boards/$(DEPDIR)/.dirstamp boards/h2288.$(OBJEXT): boards/h2288.c boards/.dirstamp \ boards/$(DEPDIR)/.dirstamp boards/malee.$(OBJEXT): boards/malee.c boards/.dirstamp \ boards/$(DEPDIR)/.dirstamp boards/novel.$(OBJEXT): boards/novel.c boards/.dirstamp \ boards/$(DEPDIR)/.dirstamp boards/sachen.$(OBJEXT): boards/sachen.c boards/.dirstamp \ boards/$(DEPDIR)/.dirstamp boards/simple.$(OBJEXT): boards/simple.c boards/.dirstamp \ boards/$(DEPDIR)/.dirstamp boards/super24.$(OBJEXT): boards/super24.c boards/.dirstamp \ boards/$(DEPDIR)/.dirstamp boards/supervision.$(OBJEXT): boards/supervision.c boards/.dirstamp \ boards/$(DEPDIR)/.dirstamp input/.dirstamp: @$(mkinstalldirs) input @: > input/.dirstamp input/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) input/$(DEPDIR) @: > input/$(DEPDIR)/.dirstamp input/cursor.$(OBJEXT): input/cursor.c input/.dirstamp \ input/$(DEPDIR)/.dirstamp input/zapper.$(OBJEXT): input/zapper.c input/.dirstamp \ input/$(DEPDIR)/.dirstamp input/powerpad.$(OBJEXT): input/powerpad.c input/.dirstamp \ input/$(DEPDIR)/.dirstamp input/arkanoid.$(OBJEXT): input/arkanoid.c input/.dirstamp \ input/$(DEPDIR)/.dirstamp input/shadow.$(OBJEXT): input/shadow.c input/.dirstamp \ input/$(DEPDIR)/.dirstamp input/fkb.$(OBJEXT): input/fkb.c input/.dirstamp \ input/$(DEPDIR)/.dirstamp input/hypershot.$(OBJEXT): input/hypershot.c input/.dirstamp \ input/$(DEPDIR)/.dirstamp input/mahjong.$(OBJEXT): input/mahjong.c input/.dirstamp \ input/$(DEPDIR)/.dirstamp input/oekakids.$(OBJEXT): input/oekakids.c input/.dirstamp \ input/$(DEPDIR)/.dirstamp input/ftrainer.$(OBJEXT): input/ftrainer.c input/.dirstamp \ input/$(DEPDIR)/.dirstamp input/quiz.$(OBJEXT): input/quiz.c input/.dirstamp \ input/$(DEPDIR)/.dirstamp input/toprider.$(OBJEXT): input/toprider.c input/.dirstamp \ input/$(DEPDIR)/.dirstamp input/bworld.$(OBJEXT): input/bworld.c input/.dirstamp \ input/$(DEPDIR)/.dirstamp mappers/.dirstamp: @$(mkinstalldirs) mappers @: > mappers/.dirstamp mappers/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) mappers/$(DEPDIR) @: > mappers/$(DEPDIR)/.dirstamp mappers/mmc2and4.$(OBJEXT): mappers/mmc2and4.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/simple.$(OBJEXT): mappers/simple.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/112.$(OBJEXT): mappers/112.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/117.$(OBJEXT): mappers/117.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/15.$(OBJEXT): mappers/15.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/151.$(OBJEXT): mappers/151.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/16.$(OBJEXT): mappers/16.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/17.$(OBJEXT): mappers/17.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/18.$(OBJEXT): mappers/18.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/180.$(OBJEXT): mappers/180.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/184.$(OBJEXT): mappers/184.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/21.$(OBJEXT): mappers/21.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/22.$(OBJEXT): mappers/22.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/225.$(OBJEXT): mappers/225.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/226.$(OBJEXT): mappers/226.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/228.$(OBJEXT): mappers/228.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/229.$(OBJEXT): mappers/229.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/23.$(OBJEXT): mappers/23.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/24and26.$(OBJEXT): mappers/24and26.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/240.$(OBJEXT): mappers/240.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/246.$(OBJEXT): mappers/246.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/25.$(OBJEXT): mappers/25.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/32.$(OBJEXT): mappers/32.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/33.$(OBJEXT): mappers/33.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/40.$(OBJEXT): mappers/40.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/41.$(OBJEXT): mappers/41.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/6.$(OBJEXT): mappers/6.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/65.$(OBJEXT): mappers/65.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/67.$(OBJEXT): mappers/67.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/68.$(OBJEXT): mappers/68.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/69.$(OBJEXT): mappers/69.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/71.$(OBJEXT): mappers/71.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/73.$(OBJEXT): mappers/73.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/75.$(OBJEXT): mappers/75.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/76.$(OBJEXT): mappers/76.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/79.$(OBJEXT): mappers/79.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/8.$(OBJEXT): mappers/8.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/80.$(OBJEXT): mappers/80.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/85.$(OBJEXT): mappers/85.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/95.$(OBJEXT): mappers/95.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/97.$(OBJEXT): mappers/97.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/99.$(OBJEXT): mappers/99.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/182.$(OBJEXT): mappers/182.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/46.$(OBJEXT): mappers/46.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/43.$(OBJEXT): mappers/43.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/42.$(OBJEXT): mappers/42.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/113.$(OBJEXT): mappers/113.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/86.$(OBJEXT): mappers/86.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/89.$(OBJEXT): mappers/89.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/83.$(OBJEXT): mappers/83.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/77.$(OBJEXT): mappers/77.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/92.$(OBJEXT): mappers/92.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/88.$(OBJEXT): mappers/88.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/248.$(OBJEXT): mappers/248.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/emu2413.$(OBJEXT): mappers/emu2413.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/242.$(OBJEXT): mappers/242.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/232.$(OBJEXT): mappers/232.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/72.$(OBJEXT): mappers/72.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/234.$(OBJEXT): mappers/234.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/227.$(OBJEXT): mappers/227.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/82.$(OBJEXT): mappers/82.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/189.$(OBJEXT): mappers/189.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/51.$(OBJEXT): mappers/51.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/91.$(OBJEXT): mappers/91.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/114.$(OBJEXT): mappers/114.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/241.$(OBJEXT): mappers/241.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/235.$(OBJEXT): mappers/235.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/57.$(OBJEXT): mappers/57.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/255.$(OBJEXT): mappers/255.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/61.$(OBJEXT): mappers/61.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/59.$(OBJEXT): mappers/59.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/193.$(OBJEXT): mappers/193.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/50.$(OBJEXT): mappers/50.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/60.$(OBJEXT): mappers/60.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/62.$(OBJEXT): mappers/62.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/244.$(OBJEXT): mappers/244.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/230.$(OBJEXT): mappers/230.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/200.$(OBJEXT): mappers/200.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/201.$(OBJEXT): mappers/201.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/202.$(OBJEXT): mappers/202.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/203.$(OBJEXT): mappers/203.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/231.$(OBJEXT): mappers/231.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/208.$(OBJEXT): mappers/208.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/58.$(OBJEXT): mappers/58.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mappers/187.$(OBJEXT): mappers/187.c mappers/.dirstamp \ mappers/$(DEPDIR)/.dirstamp mbshare/.dirstamp: @$(mkinstalldirs) mbshare @: > mbshare/.dirstamp mbshare/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) mbshare/$(DEPDIR) @: > mbshare/$(DEPDIR)/.dirstamp mbshare/mmc5.$(OBJEXT): mbshare/mmc5.c mbshare/.dirstamp \ mbshare/$(DEPDIR)/.dirstamp mbshare/mmc3.$(OBJEXT): mbshare/mmc3.c mbshare/.dirstamp \ mbshare/$(DEPDIR)/.dirstamp mbshare/mmc1.$(OBJEXT): mbshare/mmc1.c mbshare/.dirstamp \ mbshare/$(DEPDIR)/.dirstamp mbshare/tengen.$(OBJEXT): mbshare/tengen.c mbshare/.dirstamp \ mbshare/$(DEPDIR)/.dirstamp mbshare/90.$(OBJEXT): mbshare/90.c mbshare/.dirstamp \ mbshare/$(DEPDIR)/.dirstamp mbshare/deirom.$(OBJEXT): mbshare/deirom.c mbshare/.dirstamp \ mbshare/$(DEPDIR)/.dirstamp mbshare/n106.$(OBJEXT): mbshare/n106.c mbshare/.dirstamp \ mbshare/$(DEPDIR)/.dirstamp mbshare/164.$(OBJEXT): mbshare/164.c mbshare/.dirstamp \ mbshare/$(DEPDIR)/.dirstamp drivers/common/.dirstamp: @$(mkinstalldirs) drivers/common @: > drivers/common/.dirstamp drivers/common/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) drivers/common/$(DEPDIR) @: > drivers/common/$(DEPDIR)/.dirstamp drivers/common/args.$(OBJEXT): drivers/common/args.c \ drivers/common/.dirstamp drivers/common/$(DEPDIR)/.dirstamp drivers/common/cheat.$(OBJEXT): drivers/common/cheat.c \ drivers/common/.dirstamp drivers/common/$(DEPDIR)/.dirstamp drivers/common/config.$(OBJEXT): drivers/common/config.c \ drivers/common/.dirstamp drivers/common/$(DEPDIR)/.dirstamp drivers/common/vidblit.$(OBJEXT): drivers/common/vidblit.c \ drivers/common/.dirstamp drivers/common/$(DEPDIR)/.dirstamp drivers/common/hq2x.$(OBJEXT): drivers/common/hq2x.c \ drivers/common/.dirstamp drivers/common/$(DEPDIR)/.dirstamp drivers/common/hq3x.$(OBJEXT): drivers/common/hq3x.c \ drivers/common/.dirstamp drivers/common/$(DEPDIR)/.dirstamp drivers/common/scale2x.$(OBJEXT): drivers/common/scale2x.c \ drivers/common/.dirstamp drivers/common/$(DEPDIR)/.dirstamp drivers/common/scale3x.$(OBJEXT): drivers/common/scale3x.c \ drivers/common/.dirstamp drivers/common/$(DEPDIR)/.dirstamp drivers/common/scalebit.$(OBJEXT): drivers/common/scalebit.c \ drivers/common/.dirstamp drivers/common/$(DEPDIR)/.dirstamp drivers/sexyal/.dirstamp: @$(mkinstalldirs) drivers/sexyal @: > drivers/sexyal/.dirstamp drivers/sexyal/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) drivers/sexyal/$(DEPDIR) @: > drivers/sexyal/$(DEPDIR)/.dirstamp drivers/sexyal/sexyal.$(OBJEXT): drivers/sexyal/sexyal.c \ drivers/sexyal/.dirstamp drivers/sexyal/$(DEPDIR)/.dirstamp drivers/sexyal/md5.$(OBJEXT): drivers/sexyal/md5.c \ drivers/sexyal/.dirstamp drivers/sexyal/$(DEPDIR)/.dirstamp drivers/sexyal/smallc.$(OBJEXT): drivers/sexyal/smallc.c \ drivers/sexyal/.dirstamp drivers/sexyal/$(DEPDIR)/.dirstamp drivers/sexyal/convert.$(OBJEXT): drivers/sexyal/convert.c \ drivers/sexyal/.dirstamp drivers/sexyal/$(DEPDIR)/.dirstamp drivers/sexyal/drivers/.dirstamp: @$(mkinstalldirs) drivers/sexyal/drivers @: > drivers/sexyal/drivers/.dirstamp drivers/sexyal/drivers/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) drivers/sexyal/drivers/$(DEPDIR) @: > drivers/sexyal/drivers/$(DEPDIR)/.dirstamp drivers/sexyal/drivers/oss.$(OBJEXT): drivers/sexyal/drivers/oss.c \ drivers/sexyal/drivers/.dirstamp \ drivers/sexyal/drivers/$(DEPDIR)/.dirstamp drivers/sexyal/drivers/dsound.$(OBJEXT): drivers/sexyal/drivers/dsound.c \ drivers/sexyal/drivers/.dirstamp \ drivers/sexyal/drivers/$(DEPDIR)/.dirstamp drivers/win/.dirstamp: @$(mkinstalldirs) drivers/win @: > drivers/win/.dirstamp drivers/win/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) drivers/win/$(DEPDIR) @: > drivers/win/$(DEPDIR)/.dirstamp drivers/win/cheat.$(OBJEXT): drivers/win/cheat.c drivers/win/.dirstamp \ drivers/win/$(DEPDIR)/.dirstamp drivers/win/debug.$(OBJEXT): drivers/win/debug.c drivers/win/.dirstamp \ drivers/win/$(DEPDIR)/.dirstamp drivers/win/input.$(OBJEXT): drivers/win/input.c drivers/win/.dirstamp \ drivers/win/$(DEPDIR)/.dirstamp drivers/win/joystick.$(OBJEXT): drivers/win/joystick.c \ drivers/win/.dirstamp drivers/win/$(DEPDIR)/.dirstamp drivers/win/keyboard.$(OBJEXT): drivers/win/keyboard.c \ drivers/win/.dirstamp drivers/win/$(DEPDIR)/.dirstamp drivers/win/log.$(OBJEXT): drivers/win/log.c drivers/win/.dirstamp \ drivers/win/$(DEPDIR)/.dirstamp drivers/win/main.$(OBJEXT): drivers/win/main.c drivers/win/.dirstamp \ drivers/win/$(DEPDIR)/.dirstamp drivers/win/netplay.$(OBJEXT): drivers/win/netplay.c \ drivers/win/.dirstamp drivers/win/$(DEPDIR)/.dirstamp res.$(OBJEXT): drivers/win/res.res drivers/pc/.dirstamp: @$(mkinstalldirs) drivers/pc @: > drivers/pc/.dirstamp drivers/pc/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) drivers/pc/$(DEPDIR) @: > drivers/pc/$(DEPDIR)/.dirstamp drivers/pc/input.$(OBJEXT): drivers/pc/input.c drivers/pc/.dirstamp \ drivers/pc/$(DEPDIR)/.dirstamp drivers/pc/main.$(OBJEXT): drivers/pc/main.c drivers/pc/.dirstamp \ drivers/pc/$(DEPDIR)/.dirstamp drivers/pc/sdl.$(OBJEXT): drivers/pc/sdl.c drivers/pc/.dirstamp \ drivers/pc/$(DEPDIR)/.dirstamp drivers/pc/sdl-joystick.$(OBJEXT): drivers/pc/sdl-joystick.c \ drivers/pc/.dirstamp drivers/pc/$(DEPDIR)/.dirstamp drivers/pc/sdl-sound.$(OBJEXT): drivers/pc/sdl-sound.c \ drivers/pc/.dirstamp drivers/pc/$(DEPDIR)/.dirstamp drivers/pc/sdl-throttle.$(OBJEXT): drivers/pc/sdl-throttle.c \ drivers/pc/.dirstamp drivers/pc/$(DEPDIR)/.dirstamp drivers/pc/sdl-video.$(OBJEXT): drivers/pc/sdl-video.c \ drivers/pc/.dirstamp drivers/pc/$(DEPDIR)/.dirstamp drivers/pc/unix-netplay.$(OBJEXT): drivers/pc/unix-netplay.c \ drivers/pc/.dirstamp drivers/pc/$(DEPDIR)/.dirstamp drivers/pc/sdl-opengl.$(OBJEXT): drivers/pc/sdl-opengl.c \ drivers/pc/.dirstamp drivers/pc/$(DEPDIR)/.dirstamp fceu$(EXEEXT): $(fceu_OBJECTS) $(fceu_DEPENDENCIES) @rm -f fceu$(EXEEXT) $(LINK) $(fceu_LDFLAGS) $(fceu_OBJECTS) $(fceu_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core -rm -f boards/8237.$(OBJEXT) -rm -f boards/h2288.$(OBJEXT) -rm -f boards/malee.$(OBJEXT) -rm -f boards/novel.$(OBJEXT) -rm -f boards/sachen.$(OBJEXT) -rm -f boards/simple.$(OBJEXT) -rm -f boards/super24.$(OBJEXT) -rm -f boards/supervision.$(OBJEXT) -rm -f drivers/common/args.$(OBJEXT) -rm -f drivers/common/cheat.$(OBJEXT) -rm -f drivers/common/config.$(OBJEXT) -rm -f drivers/common/hq2x.$(OBJEXT) -rm -f drivers/common/hq3x.$(OBJEXT) -rm -f drivers/common/scale2x.$(OBJEXT) -rm -f drivers/common/scale3x.$(OBJEXT) -rm -f drivers/common/scalebit.$(OBJEXT) -rm -f drivers/common/vidblit.$(OBJEXT) -rm -f drivers/pc/input.$(OBJEXT) -rm -f drivers/pc/main.$(OBJEXT) -rm -f drivers/pc/sdl-joystick.$(OBJEXT) -rm -f drivers/pc/sdl-opengl.$(OBJEXT) -rm -f drivers/pc/sdl-sound.$(OBJEXT) -rm -f drivers/pc/sdl-throttle.$(OBJEXT) -rm -f drivers/pc/sdl-video.$(OBJEXT) -rm -f drivers/pc/sdl.$(OBJEXT) -rm -f drivers/pc/unix-netplay.$(OBJEXT) -rm -f drivers/sexyal/convert.$(OBJEXT) -rm -f drivers/sexyal/drivers/dsound.$(OBJEXT) -rm -f drivers/sexyal/drivers/oss.$(OBJEXT) -rm -f drivers/sexyal/md5.$(OBJEXT) -rm -f drivers/sexyal/sexyal.$(OBJEXT) -rm -f drivers/sexyal/smallc.$(OBJEXT) -rm -f drivers/win/cheat.$(OBJEXT) -rm -f drivers/win/debug.$(OBJEXT) -rm -f drivers/win/input.$(OBJEXT) -rm -f drivers/win/joystick.$(OBJEXT) -rm -f drivers/win/keyboard.$(OBJEXT) -rm -f drivers/win/log.$(OBJEXT) -rm -f drivers/win/main.$(OBJEXT) -rm -f drivers/win/netplay.$(OBJEXT) -rm -f input/arkanoid.$(OBJEXT) -rm -f input/bworld.$(OBJEXT) -rm -f input/cursor.$(OBJEXT) -rm -f input/fkb.$(OBJEXT) -rm -f input/ftrainer.$(OBJEXT) -rm -f input/hypershot.$(OBJEXT) -rm -f input/mahjong.$(OBJEXT) -rm -f input/oekakids.$(OBJEXT) -rm -f input/powerpad.$(OBJEXT) -rm -f input/quiz.$(OBJEXT) -rm -f input/shadow.$(OBJEXT) -rm -f input/toprider.$(OBJEXT) -rm -f input/zapper.$(OBJEXT) -rm -f mappers/112.$(OBJEXT) -rm -f mappers/113.$(OBJEXT) -rm -f mappers/114.$(OBJEXT) -rm -f mappers/117.$(OBJEXT) -rm -f mappers/15.$(OBJEXT) -rm -f mappers/151.$(OBJEXT) -rm -f mappers/16.$(OBJEXT) -rm -f mappers/17.$(OBJEXT) -rm -f mappers/18.$(OBJEXT) -rm -f mappers/180.$(OBJEXT) -rm -f mappers/182.$(OBJEXT) -rm -f mappers/184.$(OBJEXT) -rm -f mappers/187.$(OBJEXT) -rm -f mappers/189.$(OBJEXT) -rm -f mappers/193.$(OBJEXT) -rm -f mappers/200.$(OBJEXT) -rm -f mappers/201.$(OBJEXT) -rm -f mappers/202.$(OBJEXT) -rm -f mappers/203.$(OBJEXT) -rm -f mappers/208.$(OBJEXT) -rm -f mappers/21.$(OBJEXT) -rm -f mappers/22.$(OBJEXT) -rm -f mappers/225.$(OBJEXT) -rm -f mappers/226.$(OBJEXT) -rm -f mappers/227.$(OBJEXT) -rm -f mappers/228.$(OBJEXT) -rm -f mappers/229.$(OBJEXT) -rm -f mappers/23.$(OBJEXT) -rm -f mappers/230.$(OBJEXT) -rm -f mappers/231.$(OBJEXT) -rm -f mappers/232.$(OBJEXT) -rm -f mappers/234.$(OBJEXT) -rm -f mappers/235.$(OBJEXT) -rm -f mappers/240.$(OBJEXT) -rm -f mappers/241.$(OBJEXT) -rm -f mappers/242.$(OBJEXT) -rm -f mappers/244.$(OBJEXT) -rm -f mappers/246.$(OBJEXT) -rm -f mappers/248.$(OBJEXT) -rm -f mappers/24and26.$(OBJEXT) -rm -f mappers/25.$(OBJEXT) -rm -f mappers/255.$(OBJEXT) -rm -f mappers/32.$(OBJEXT) -rm -f mappers/33.$(OBJEXT) -rm -f mappers/40.$(OBJEXT) -rm -f mappers/41.$(OBJEXT) -rm -f mappers/42.$(OBJEXT) -rm -f mappers/43.$(OBJEXT) -rm -f mappers/46.$(OBJEXT) -rm -f mappers/50.$(OBJEXT) -rm -f mappers/51.$(OBJEXT) -rm -f mappers/57.$(OBJEXT) -rm -f mappers/58.$(OBJEXT) -rm -f mappers/59.$(OBJEXT) -rm -f mappers/6.$(OBJEXT) -rm -f mappers/60.$(OBJEXT) -rm -f mappers/61.$(OBJEXT) -rm -f mappers/62.$(OBJEXT) -rm -f mappers/65.$(OBJEXT) -rm -f mappers/67.$(OBJEXT) -rm -f mappers/68.$(OBJEXT) -rm -f mappers/69.$(OBJEXT) -rm -f mappers/71.$(OBJEXT) -rm -f mappers/72.$(OBJEXT) -rm -f mappers/73.$(OBJEXT) -rm -f mappers/75.$(OBJEXT) -rm -f mappers/76.$(OBJEXT) -rm -f mappers/77.$(OBJEXT) -rm -f mappers/79.$(OBJEXT) -rm -f mappers/8.$(OBJEXT) -rm -f mappers/80.$(OBJEXT) -rm -f mappers/82.$(OBJEXT) -rm -f mappers/83.$(OBJEXT) -rm -f mappers/85.$(OBJEXT) -rm -f mappers/86.$(OBJEXT) -rm -f mappers/88.$(OBJEXT) -rm -f mappers/89.$(OBJEXT) -rm -f mappers/91.$(OBJEXT) -rm -f mappers/92.$(OBJEXT) -rm -f mappers/95.$(OBJEXT) -rm -f mappers/97.$(OBJEXT) -rm -f mappers/99.$(OBJEXT) -rm -f mappers/emu2413.$(OBJEXT) -rm -f mappers/mmc2and4.$(OBJEXT) -rm -f mappers/simple.$(OBJEXT) -rm -f mbshare/164.$(OBJEXT) -rm -f mbshare/90.$(OBJEXT) -rm -f mbshare/deirom.$(OBJEXT) -rm -f mbshare/mmc1.$(OBJEXT) -rm -f mbshare/mmc3.$(OBJEXT) -rm -f mbshare/mmc5.$(OBJEXT) -rm -f mbshare/n106.$(OBJEXT) -rm -f mbshare/tengen.$(OBJEXT) distclean-compile: -rm -f *.tab.c -rm -f boards/$(DEPDIR)/.dirstamp -rm -f boards/.dirstamp -rm -f drivers/common/$(DEPDIR)/.dirstamp -rm -f drivers/common/.dirstamp -rm -f drivers/pc/$(DEPDIR)/.dirstamp -rm -f drivers/pc/.dirstamp -rm -f drivers/sexyal/$(DEPDIR)/.dirstamp -rm -f drivers/sexyal/.dirstamp -rm -f drivers/sexyal/drivers/$(DEPDIR)/.dirstamp -rm -f drivers/sexyal/drivers/.dirstamp -rm -f drivers/win/$(DEPDIR)/.dirstamp -rm -f drivers/win/.dirstamp -rm -f input/$(DEPDIR)/.dirstamp -rm -f input/.dirstamp -rm -f mappers/$(DEPDIR)/.dirstamp -rm -f mappers/.dirstamp -rm -f mbshare/$(DEPDIR)/.dirstamp -rm -f mbshare/.dirstamp @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cheat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/endian.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fceu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fceustr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fds.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/general.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ines.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/input.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/movie.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netplay.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/palette.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sound.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/state.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unif.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unzip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/video.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vsuni.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x6502.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@boards/$(DEPDIR)/8237.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@boards/$(DEPDIR)/h2288.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@boards/$(DEPDIR)/malee.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@boards/$(DEPDIR)/novel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@boards/$(DEPDIR)/sachen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@boards/$(DEPDIR)/simple.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@boards/$(DEPDIR)/super24.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@boards/$(DEPDIR)/supervision.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/common/$(DEPDIR)/args.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/common/$(DEPDIR)/cheat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/common/$(DEPDIR)/config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/common/$(DEPDIR)/hq2x.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/common/$(DEPDIR)/hq3x.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/common/$(DEPDIR)/scale2x.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/common/$(DEPDIR)/scale3x.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/common/$(DEPDIR)/scalebit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/common/$(DEPDIR)/vidblit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/pc/$(DEPDIR)/input.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/pc/$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/pc/$(DEPDIR)/sdl-joystick.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/pc/$(DEPDIR)/sdl-opengl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/pc/$(DEPDIR)/sdl-sound.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/pc/$(DEPDIR)/sdl-throttle.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/pc/$(DEPDIR)/sdl-video.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/pc/$(DEPDIR)/sdl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/pc/$(DEPDIR)/unix-netplay.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/sexyal/$(DEPDIR)/convert.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/sexyal/$(DEPDIR)/md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/sexyal/$(DEPDIR)/sexyal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/sexyal/$(DEPDIR)/smallc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/sexyal/drivers/$(DEPDIR)/dsound.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/sexyal/drivers/$(DEPDIR)/oss.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/win/$(DEPDIR)/cheat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/win/$(DEPDIR)/debug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/win/$(DEPDIR)/input.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/win/$(DEPDIR)/joystick.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/win/$(DEPDIR)/keyboard.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/win/$(DEPDIR)/log.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/win/$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@drivers/win/$(DEPDIR)/netplay.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/arkanoid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/bworld.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/cursor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/fkb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/ftrainer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/hypershot.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/mahjong.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/oekakids.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/powerpad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/quiz.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/shadow.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/toprider.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/zapper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/112.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/113.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/114.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/117.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/15.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/151.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/17.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/18.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/180.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/182.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/184.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/187.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/189.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/193.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/200.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/201.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/202.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/203.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/208.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/21.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/22.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/225.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/226.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/227.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/228.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/229.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/23.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/230.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/231.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/232.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/234.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/235.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/240.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/241.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/242.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/244.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/246.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/248.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/24and26.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/25.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/255.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/33.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/40.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/41.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/42.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/43.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/46.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/50.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/51.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/57.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/58.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/59.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/6.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/60.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/61.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/62.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/65.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/67.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/68.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/69.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/71.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/72.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/73.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/75.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/76.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/77.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/79.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/80.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/82.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/83.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/85.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/86.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/88.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/89.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/91.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/92.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/95.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/97.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/99.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/emu2413.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/mmc2and4.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mappers/$(DEPDIR)/simple.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mbshare/$(DEPDIR)/164.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mbshare/$(DEPDIR)/90.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mbshare/$(DEPDIR)/deirom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mbshare/$(DEPDIR)/mmc1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mbshare/$(DEPDIR)/mmc3.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mbshare/$(DEPDIR)/mmc5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mbshare/$(DEPDIR)/n106.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mbshare/$(DEPDIR)/tengen.Po@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) boards/$(DEPDIR) drivers/common/$(DEPDIR) drivers/pc/$(DEPDIR) drivers/sexyal/$(DEPDIR) drivers/sexyal/drivers/$(DEPDIR) drivers/win/$(DEPDIR) input/$(DEPDIR) mappers/$(DEPDIR) mbshare/$(DEPDIR) .c.o: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c -o $@ `cygpath -w $<` boards/8237.o: boards/8237.c @AMDEP_TRUE@ source='boards/8237.c' object='boards/8237.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='boards/$(DEPDIR)/8237.Po' tmpdepfile='boards/$(DEPDIR)/8237.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o boards/8237.o `test -f 'boards/8237.c' || echo '$(srcdir)/'`boards/8237.c boards/8237.obj: boards/8237.c @AMDEP_TRUE@ source='boards/8237.c' object='boards/8237.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='boards/$(DEPDIR)/8237.Po' tmpdepfile='boards/$(DEPDIR)/8237.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o boards/8237.obj `cygpath -w boards/8237.c` boards/h2288.o: boards/h2288.c @AMDEP_TRUE@ source='boards/h2288.c' object='boards/h2288.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='boards/$(DEPDIR)/h2288.Po' tmpdepfile='boards/$(DEPDIR)/h2288.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o boards/h2288.o `test -f 'boards/h2288.c' || echo '$(srcdir)/'`boards/h2288.c boards/h2288.obj: boards/h2288.c @AMDEP_TRUE@ source='boards/h2288.c' object='boards/h2288.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='boards/$(DEPDIR)/h2288.Po' tmpdepfile='boards/$(DEPDIR)/h2288.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o boards/h2288.obj `cygpath -w boards/h2288.c` boards/malee.o: boards/malee.c @AMDEP_TRUE@ source='boards/malee.c' object='boards/malee.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='boards/$(DEPDIR)/malee.Po' tmpdepfile='boards/$(DEPDIR)/malee.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o boards/malee.o `test -f 'boards/malee.c' || echo '$(srcdir)/'`boards/malee.c boards/malee.obj: boards/malee.c @AMDEP_TRUE@ source='boards/malee.c' object='boards/malee.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='boards/$(DEPDIR)/malee.Po' tmpdepfile='boards/$(DEPDIR)/malee.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o boards/malee.obj `cygpath -w boards/malee.c` boards/novel.o: boards/novel.c @AMDEP_TRUE@ source='boards/novel.c' object='boards/novel.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='boards/$(DEPDIR)/novel.Po' tmpdepfile='boards/$(DEPDIR)/novel.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o boards/novel.o `test -f 'boards/novel.c' || echo '$(srcdir)/'`boards/novel.c boards/novel.obj: boards/novel.c @AMDEP_TRUE@ source='boards/novel.c' object='boards/novel.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='boards/$(DEPDIR)/novel.Po' tmpdepfile='boards/$(DEPDIR)/novel.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o boards/novel.obj `cygpath -w boards/novel.c` boards/sachen.o: boards/sachen.c @AMDEP_TRUE@ source='boards/sachen.c' object='boards/sachen.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='boards/$(DEPDIR)/sachen.Po' tmpdepfile='boards/$(DEPDIR)/sachen.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o boards/sachen.o `test -f 'boards/sachen.c' || echo '$(srcdir)/'`boards/sachen.c boards/sachen.obj: boards/sachen.c @AMDEP_TRUE@ source='boards/sachen.c' object='boards/sachen.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='boards/$(DEPDIR)/sachen.Po' tmpdepfile='boards/$(DEPDIR)/sachen.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o boards/sachen.obj `cygpath -w boards/sachen.c` boards/simple.o: boards/simple.c @AMDEP_TRUE@ source='boards/simple.c' object='boards/simple.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='boards/$(DEPDIR)/simple.Po' tmpdepfile='boards/$(DEPDIR)/simple.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o boards/simple.o `test -f 'boards/simple.c' || echo '$(srcdir)/'`boards/simple.c boards/simple.obj: boards/simple.c @AMDEP_TRUE@ source='boards/simple.c' object='boards/simple.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='boards/$(DEPDIR)/simple.Po' tmpdepfile='boards/$(DEPDIR)/simple.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o boards/simple.obj `cygpath -w boards/simple.c` boards/super24.o: boards/super24.c @AMDEP_TRUE@ source='boards/super24.c' object='boards/super24.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='boards/$(DEPDIR)/super24.Po' tmpdepfile='boards/$(DEPDIR)/super24.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o boards/super24.o `test -f 'boards/super24.c' || echo '$(srcdir)/'`boards/super24.c boards/super24.obj: boards/super24.c @AMDEP_TRUE@ source='boards/super24.c' object='boards/super24.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='boards/$(DEPDIR)/super24.Po' tmpdepfile='boards/$(DEPDIR)/super24.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o boards/super24.obj `cygpath -w boards/super24.c` boards/supervision.o: boards/supervision.c @AMDEP_TRUE@ source='boards/supervision.c' object='boards/supervision.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='boards/$(DEPDIR)/supervision.Po' tmpdepfile='boards/$(DEPDIR)/supervision.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o boards/supervision.o `test -f 'boards/supervision.c' || echo '$(srcdir)/'`boards/supervision.c boards/supervision.obj: boards/supervision.c @AMDEP_TRUE@ source='boards/supervision.c' object='boards/supervision.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='boards/$(DEPDIR)/supervision.Po' tmpdepfile='boards/$(DEPDIR)/supervision.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o boards/supervision.obj `cygpath -w boards/supervision.c` input/cursor.o: input/cursor.c @AMDEP_TRUE@ source='input/cursor.c' object='input/cursor.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/cursor.Po' tmpdepfile='input/$(DEPDIR)/cursor.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/cursor.o `test -f 'input/cursor.c' || echo '$(srcdir)/'`input/cursor.c input/cursor.obj: input/cursor.c @AMDEP_TRUE@ source='input/cursor.c' object='input/cursor.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/cursor.Po' tmpdepfile='input/$(DEPDIR)/cursor.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/cursor.obj `cygpath -w input/cursor.c` input/zapper.o: input/zapper.c @AMDEP_TRUE@ source='input/zapper.c' object='input/zapper.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/zapper.Po' tmpdepfile='input/$(DEPDIR)/zapper.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/zapper.o `test -f 'input/zapper.c' || echo '$(srcdir)/'`input/zapper.c input/zapper.obj: input/zapper.c @AMDEP_TRUE@ source='input/zapper.c' object='input/zapper.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/zapper.Po' tmpdepfile='input/$(DEPDIR)/zapper.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/zapper.obj `cygpath -w input/zapper.c` input/powerpad.o: input/powerpad.c @AMDEP_TRUE@ source='input/powerpad.c' object='input/powerpad.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/powerpad.Po' tmpdepfile='input/$(DEPDIR)/powerpad.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/powerpad.o `test -f 'input/powerpad.c' || echo '$(srcdir)/'`input/powerpad.c input/powerpad.obj: input/powerpad.c @AMDEP_TRUE@ source='input/powerpad.c' object='input/powerpad.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/powerpad.Po' tmpdepfile='input/$(DEPDIR)/powerpad.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/powerpad.obj `cygpath -w input/powerpad.c` input/arkanoid.o: input/arkanoid.c @AMDEP_TRUE@ source='input/arkanoid.c' object='input/arkanoid.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/arkanoid.Po' tmpdepfile='input/$(DEPDIR)/arkanoid.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/arkanoid.o `test -f 'input/arkanoid.c' || echo '$(srcdir)/'`input/arkanoid.c input/arkanoid.obj: input/arkanoid.c @AMDEP_TRUE@ source='input/arkanoid.c' object='input/arkanoid.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/arkanoid.Po' tmpdepfile='input/$(DEPDIR)/arkanoid.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/arkanoid.obj `cygpath -w input/arkanoid.c` input/shadow.o: input/shadow.c @AMDEP_TRUE@ source='input/shadow.c' object='input/shadow.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/shadow.Po' tmpdepfile='input/$(DEPDIR)/shadow.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/shadow.o `test -f 'input/shadow.c' || echo '$(srcdir)/'`input/shadow.c input/shadow.obj: input/shadow.c @AMDEP_TRUE@ source='input/shadow.c' object='input/shadow.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/shadow.Po' tmpdepfile='input/$(DEPDIR)/shadow.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/shadow.obj `cygpath -w input/shadow.c` input/fkb.o: input/fkb.c @AMDEP_TRUE@ source='input/fkb.c' object='input/fkb.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/fkb.Po' tmpdepfile='input/$(DEPDIR)/fkb.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/fkb.o `test -f 'input/fkb.c' || echo '$(srcdir)/'`input/fkb.c input/fkb.obj: input/fkb.c @AMDEP_TRUE@ source='input/fkb.c' object='input/fkb.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/fkb.Po' tmpdepfile='input/$(DEPDIR)/fkb.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/fkb.obj `cygpath -w input/fkb.c` input/hypershot.o: input/hypershot.c @AMDEP_TRUE@ source='input/hypershot.c' object='input/hypershot.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/hypershot.Po' tmpdepfile='input/$(DEPDIR)/hypershot.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/hypershot.o `test -f 'input/hypershot.c' || echo '$(srcdir)/'`input/hypershot.c input/hypershot.obj: input/hypershot.c @AMDEP_TRUE@ source='input/hypershot.c' object='input/hypershot.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/hypershot.Po' tmpdepfile='input/$(DEPDIR)/hypershot.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/hypershot.obj `cygpath -w input/hypershot.c` input/mahjong.o: input/mahjong.c @AMDEP_TRUE@ source='input/mahjong.c' object='input/mahjong.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/mahjong.Po' tmpdepfile='input/$(DEPDIR)/mahjong.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/mahjong.o `test -f 'input/mahjong.c' || echo '$(srcdir)/'`input/mahjong.c input/mahjong.obj: input/mahjong.c @AMDEP_TRUE@ source='input/mahjong.c' object='input/mahjong.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/mahjong.Po' tmpdepfile='input/$(DEPDIR)/mahjong.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/mahjong.obj `cygpath -w input/mahjong.c` input/oekakids.o: input/oekakids.c @AMDEP_TRUE@ source='input/oekakids.c' object='input/oekakids.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/oekakids.Po' tmpdepfile='input/$(DEPDIR)/oekakids.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/oekakids.o `test -f 'input/oekakids.c' || echo '$(srcdir)/'`input/oekakids.c input/oekakids.obj: input/oekakids.c @AMDEP_TRUE@ source='input/oekakids.c' object='input/oekakids.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/oekakids.Po' tmpdepfile='input/$(DEPDIR)/oekakids.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/oekakids.obj `cygpath -w input/oekakids.c` input/ftrainer.o: input/ftrainer.c @AMDEP_TRUE@ source='input/ftrainer.c' object='input/ftrainer.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/ftrainer.Po' tmpdepfile='input/$(DEPDIR)/ftrainer.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/ftrainer.o `test -f 'input/ftrainer.c' || echo '$(srcdir)/'`input/ftrainer.c input/ftrainer.obj: input/ftrainer.c @AMDEP_TRUE@ source='input/ftrainer.c' object='input/ftrainer.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/ftrainer.Po' tmpdepfile='input/$(DEPDIR)/ftrainer.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/ftrainer.obj `cygpath -w input/ftrainer.c` input/quiz.o: input/quiz.c @AMDEP_TRUE@ source='input/quiz.c' object='input/quiz.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/quiz.Po' tmpdepfile='input/$(DEPDIR)/quiz.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/quiz.o `test -f 'input/quiz.c' || echo '$(srcdir)/'`input/quiz.c input/quiz.obj: input/quiz.c @AMDEP_TRUE@ source='input/quiz.c' object='input/quiz.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/quiz.Po' tmpdepfile='input/$(DEPDIR)/quiz.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/quiz.obj `cygpath -w input/quiz.c` input/toprider.o: input/toprider.c @AMDEP_TRUE@ source='input/toprider.c' object='input/toprider.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/toprider.Po' tmpdepfile='input/$(DEPDIR)/toprider.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/toprider.o `test -f 'input/toprider.c' || echo '$(srcdir)/'`input/toprider.c input/toprider.obj: input/toprider.c @AMDEP_TRUE@ source='input/toprider.c' object='input/toprider.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/toprider.Po' tmpdepfile='input/$(DEPDIR)/toprider.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/toprider.obj `cygpath -w input/toprider.c` input/bworld.o: input/bworld.c @AMDEP_TRUE@ source='input/bworld.c' object='input/bworld.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/bworld.Po' tmpdepfile='input/$(DEPDIR)/bworld.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/bworld.o `test -f 'input/bworld.c' || echo '$(srcdir)/'`input/bworld.c input/bworld.obj: input/bworld.c @AMDEP_TRUE@ source='input/bworld.c' object='input/bworld.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='input/$(DEPDIR)/bworld.Po' tmpdepfile='input/$(DEPDIR)/bworld.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o input/bworld.obj `cygpath -w input/bworld.c` mappers/mmc2and4.o: mappers/mmc2and4.c @AMDEP_TRUE@ source='mappers/mmc2and4.c' object='mappers/mmc2and4.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/mmc2and4.Po' tmpdepfile='mappers/$(DEPDIR)/mmc2and4.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/mmc2and4.o `test -f 'mappers/mmc2and4.c' || echo '$(srcdir)/'`mappers/mmc2and4.c mappers/mmc2and4.obj: mappers/mmc2and4.c @AMDEP_TRUE@ source='mappers/mmc2and4.c' object='mappers/mmc2and4.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/mmc2and4.Po' tmpdepfile='mappers/$(DEPDIR)/mmc2and4.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/mmc2and4.obj `cygpath -w mappers/mmc2and4.c` mappers/simple.o: mappers/simple.c @AMDEP_TRUE@ source='mappers/simple.c' object='mappers/simple.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/simple.Po' tmpdepfile='mappers/$(DEPDIR)/simple.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/simple.o `test -f 'mappers/simple.c' || echo '$(srcdir)/'`mappers/simple.c mappers/simple.obj: mappers/simple.c @AMDEP_TRUE@ source='mappers/simple.c' object='mappers/simple.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/simple.Po' tmpdepfile='mappers/$(DEPDIR)/simple.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/simple.obj `cygpath -w mappers/simple.c` mappers/112.o: mappers/112.c @AMDEP_TRUE@ source='mappers/112.c' object='mappers/112.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/112.Po' tmpdepfile='mappers/$(DEPDIR)/112.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/112.o `test -f 'mappers/112.c' || echo '$(srcdir)/'`mappers/112.c mappers/112.obj: mappers/112.c @AMDEP_TRUE@ source='mappers/112.c' object='mappers/112.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/112.Po' tmpdepfile='mappers/$(DEPDIR)/112.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/112.obj `cygpath -w mappers/112.c` mappers/117.o: mappers/117.c @AMDEP_TRUE@ source='mappers/117.c' object='mappers/117.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/117.Po' tmpdepfile='mappers/$(DEPDIR)/117.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/117.o `test -f 'mappers/117.c' || echo '$(srcdir)/'`mappers/117.c mappers/117.obj: mappers/117.c @AMDEP_TRUE@ source='mappers/117.c' object='mappers/117.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/117.Po' tmpdepfile='mappers/$(DEPDIR)/117.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/117.obj `cygpath -w mappers/117.c` mappers/15.o: mappers/15.c @AMDEP_TRUE@ source='mappers/15.c' object='mappers/15.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/15.Po' tmpdepfile='mappers/$(DEPDIR)/15.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/15.o `test -f 'mappers/15.c' || echo '$(srcdir)/'`mappers/15.c mappers/15.obj: mappers/15.c @AMDEP_TRUE@ source='mappers/15.c' object='mappers/15.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/15.Po' tmpdepfile='mappers/$(DEPDIR)/15.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/15.obj `cygpath -w mappers/15.c` mappers/151.o: mappers/151.c @AMDEP_TRUE@ source='mappers/151.c' object='mappers/151.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/151.Po' tmpdepfile='mappers/$(DEPDIR)/151.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/151.o `test -f 'mappers/151.c' || echo '$(srcdir)/'`mappers/151.c mappers/151.obj: mappers/151.c @AMDEP_TRUE@ source='mappers/151.c' object='mappers/151.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/151.Po' tmpdepfile='mappers/$(DEPDIR)/151.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/151.obj `cygpath -w mappers/151.c` mappers/16.o: mappers/16.c @AMDEP_TRUE@ source='mappers/16.c' object='mappers/16.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/16.Po' tmpdepfile='mappers/$(DEPDIR)/16.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/16.o `test -f 'mappers/16.c' || echo '$(srcdir)/'`mappers/16.c mappers/16.obj: mappers/16.c @AMDEP_TRUE@ source='mappers/16.c' object='mappers/16.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/16.Po' tmpdepfile='mappers/$(DEPDIR)/16.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/16.obj `cygpath -w mappers/16.c` mappers/17.o: mappers/17.c @AMDEP_TRUE@ source='mappers/17.c' object='mappers/17.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/17.Po' tmpdepfile='mappers/$(DEPDIR)/17.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/17.o `test -f 'mappers/17.c' || echo '$(srcdir)/'`mappers/17.c mappers/17.obj: mappers/17.c @AMDEP_TRUE@ source='mappers/17.c' object='mappers/17.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/17.Po' tmpdepfile='mappers/$(DEPDIR)/17.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/17.obj `cygpath -w mappers/17.c` mappers/18.o: mappers/18.c @AMDEP_TRUE@ source='mappers/18.c' object='mappers/18.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/18.Po' tmpdepfile='mappers/$(DEPDIR)/18.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/18.o `test -f 'mappers/18.c' || echo '$(srcdir)/'`mappers/18.c mappers/18.obj: mappers/18.c @AMDEP_TRUE@ source='mappers/18.c' object='mappers/18.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/18.Po' tmpdepfile='mappers/$(DEPDIR)/18.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/18.obj `cygpath -w mappers/18.c` mappers/180.o: mappers/180.c @AMDEP_TRUE@ source='mappers/180.c' object='mappers/180.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/180.Po' tmpdepfile='mappers/$(DEPDIR)/180.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/180.o `test -f 'mappers/180.c' || echo '$(srcdir)/'`mappers/180.c mappers/180.obj: mappers/180.c @AMDEP_TRUE@ source='mappers/180.c' object='mappers/180.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/180.Po' tmpdepfile='mappers/$(DEPDIR)/180.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/180.obj `cygpath -w mappers/180.c` mappers/184.o: mappers/184.c @AMDEP_TRUE@ source='mappers/184.c' object='mappers/184.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/184.Po' tmpdepfile='mappers/$(DEPDIR)/184.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/184.o `test -f 'mappers/184.c' || echo '$(srcdir)/'`mappers/184.c mappers/184.obj: mappers/184.c @AMDEP_TRUE@ source='mappers/184.c' object='mappers/184.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/184.Po' tmpdepfile='mappers/$(DEPDIR)/184.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/184.obj `cygpath -w mappers/184.c` mappers/21.o: mappers/21.c @AMDEP_TRUE@ source='mappers/21.c' object='mappers/21.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/21.Po' tmpdepfile='mappers/$(DEPDIR)/21.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/21.o `test -f 'mappers/21.c' || echo '$(srcdir)/'`mappers/21.c mappers/21.obj: mappers/21.c @AMDEP_TRUE@ source='mappers/21.c' object='mappers/21.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/21.Po' tmpdepfile='mappers/$(DEPDIR)/21.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/21.obj `cygpath -w mappers/21.c` mappers/22.o: mappers/22.c @AMDEP_TRUE@ source='mappers/22.c' object='mappers/22.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/22.Po' tmpdepfile='mappers/$(DEPDIR)/22.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/22.o `test -f 'mappers/22.c' || echo '$(srcdir)/'`mappers/22.c mappers/22.obj: mappers/22.c @AMDEP_TRUE@ source='mappers/22.c' object='mappers/22.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/22.Po' tmpdepfile='mappers/$(DEPDIR)/22.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/22.obj `cygpath -w mappers/22.c` mappers/225.o: mappers/225.c @AMDEP_TRUE@ source='mappers/225.c' object='mappers/225.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/225.Po' tmpdepfile='mappers/$(DEPDIR)/225.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/225.o `test -f 'mappers/225.c' || echo '$(srcdir)/'`mappers/225.c mappers/225.obj: mappers/225.c @AMDEP_TRUE@ source='mappers/225.c' object='mappers/225.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/225.Po' tmpdepfile='mappers/$(DEPDIR)/225.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/225.obj `cygpath -w mappers/225.c` mappers/226.o: mappers/226.c @AMDEP_TRUE@ source='mappers/226.c' object='mappers/226.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/226.Po' tmpdepfile='mappers/$(DEPDIR)/226.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/226.o `test -f 'mappers/226.c' || echo '$(srcdir)/'`mappers/226.c mappers/226.obj: mappers/226.c @AMDEP_TRUE@ source='mappers/226.c' object='mappers/226.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/226.Po' tmpdepfile='mappers/$(DEPDIR)/226.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/226.obj `cygpath -w mappers/226.c` mappers/228.o: mappers/228.c @AMDEP_TRUE@ source='mappers/228.c' object='mappers/228.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/228.Po' tmpdepfile='mappers/$(DEPDIR)/228.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/228.o `test -f 'mappers/228.c' || echo '$(srcdir)/'`mappers/228.c mappers/228.obj: mappers/228.c @AMDEP_TRUE@ source='mappers/228.c' object='mappers/228.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/228.Po' tmpdepfile='mappers/$(DEPDIR)/228.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/228.obj `cygpath -w mappers/228.c` mappers/229.o: mappers/229.c @AMDEP_TRUE@ source='mappers/229.c' object='mappers/229.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/229.Po' tmpdepfile='mappers/$(DEPDIR)/229.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/229.o `test -f 'mappers/229.c' || echo '$(srcdir)/'`mappers/229.c mappers/229.obj: mappers/229.c @AMDEP_TRUE@ source='mappers/229.c' object='mappers/229.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/229.Po' tmpdepfile='mappers/$(DEPDIR)/229.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/229.obj `cygpath -w mappers/229.c` mappers/23.o: mappers/23.c @AMDEP_TRUE@ source='mappers/23.c' object='mappers/23.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/23.Po' tmpdepfile='mappers/$(DEPDIR)/23.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/23.o `test -f 'mappers/23.c' || echo '$(srcdir)/'`mappers/23.c mappers/23.obj: mappers/23.c @AMDEP_TRUE@ source='mappers/23.c' object='mappers/23.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/23.Po' tmpdepfile='mappers/$(DEPDIR)/23.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/23.obj `cygpath -w mappers/23.c` mappers/24and26.o: mappers/24and26.c @AMDEP_TRUE@ source='mappers/24and26.c' object='mappers/24and26.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/24and26.Po' tmpdepfile='mappers/$(DEPDIR)/24and26.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/24and26.o `test -f 'mappers/24and26.c' || echo '$(srcdir)/'`mappers/24and26.c mappers/24and26.obj: mappers/24and26.c @AMDEP_TRUE@ source='mappers/24and26.c' object='mappers/24and26.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/24and26.Po' tmpdepfile='mappers/$(DEPDIR)/24and26.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/24and26.obj `cygpath -w mappers/24and26.c` mappers/240.o: mappers/240.c @AMDEP_TRUE@ source='mappers/240.c' object='mappers/240.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/240.Po' tmpdepfile='mappers/$(DEPDIR)/240.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/240.o `test -f 'mappers/240.c' || echo '$(srcdir)/'`mappers/240.c mappers/240.obj: mappers/240.c @AMDEP_TRUE@ source='mappers/240.c' object='mappers/240.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/240.Po' tmpdepfile='mappers/$(DEPDIR)/240.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/240.obj `cygpath -w mappers/240.c` mappers/246.o: mappers/246.c @AMDEP_TRUE@ source='mappers/246.c' object='mappers/246.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/246.Po' tmpdepfile='mappers/$(DEPDIR)/246.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/246.o `test -f 'mappers/246.c' || echo '$(srcdir)/'`mappers/246.c mappers/246.obj: mappers/246.c @AMDEP_TRUE@ source='mappers/246.c' object='mappers/246.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/246.Po' tmpdepfile='mappers/$(DEPDIR)/246.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/246.obj `cygpath -w mappers/246.c` mappers/25.o: mappers/25.c @AMDEP_TRUE@ source='mappers/25.c' object='mappers/25.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/25.Po' tmpdepfile='mappers/$(DEPDIR)/25.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/25.o `test -f 'mappers/25.c' || echo '$(srcdir)/'`mappers/25.c mappers/25.obj: mappers/25.c @AMDEP_TRUE@ source='mappers/25.c' object='mappers/25.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/25.Po' tmpdepfile='mappers/$(DEPDIR)/25.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/25.obj `cygpath -w mappers/25.c` mappers/32.o: mappers/32.c @AMDEP_TRUE@ source='mappers/32.c' object='mappers/32.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/32.Po' tmpdepfile='mappers/$(DEPDIR)/32.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/32.o `test -f 'mappers/32.c' || echo '$(srcdir)/'`mappers/32.c mappers/32.obj: mappers/32.c @AMDEP_TRUE@ source='mappers/32.c' object='mappers/32.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/32.Po' tmpdepfile='mappers/$(DEPDIR)/32.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/32.obj `cygpath -w mappers/32.c` mappers/33.o: mappers/33.c @AMDEP_TRUE@ source='mappers/33.c' object='mappers/33.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/33.Po' tmpdepfile='mappers/$(DEPDIR)/33.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/33.o `test -f 'mappers/33.c' || echo '$(srcdir)/'`mappers/33.c mappers/33.obj: mappers/33.c @AMDEP_TRUE@ source='mappers/33.c' object='mappers/33.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/33.Po' tmpdepfile='mappers/$(DEPDIR)/33.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/33.obj `cygpath -w mappers/33.c` mappers/40.o: mappers/40.c @AMDEP_TRUE@ source='mappers/40.c' object='mappers/40.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/40.Po' tmpdepfile='mappers/$(DEPDIR)/40.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/40.o `test -f 'mappers/40.c' || echo '$(srcdir)/'`mappers/40.c mappers/40.obj: mappers/40.c @AMDEP_TRUE@ source='mappers/40.c' object='mappers/40.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/40.Po' tmpdepfile='mappers/$(DEPDIR)/40.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/40.obj `cygpath -w mappers/40.c` mappers/41.o: mappers/41.c @AMDEP_TRUE@ source='mappers/41.c' object='mappers/41.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/41.Po' tmpdepfile='mappers/$(DEPDIR)/41.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/41.o `test -f 'mappers/41.c' || echo '$(srcdir)/'`mappers/41.c mappers/41.obj: mappers/41.c @AMDEP_TRUE@ source='mappers/41.c' object='mappers/41.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/41.Po' tmpdepfile='mappers/$(DEPDIR)/41.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/41.obj `cygpath -w mappers/41.c` mappers/6.o: mappers/6.c @AMDEP_TRUE@ source='mappers/6.c' object='mappers/6.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/6.Po' tmpdepfile='mappers/$(DEPDIR)/6.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/6.o `test -f 'mappers/6.c' || echo '$(srcdir)/'`mappers/6.c mappers/6.obj: mappers/6.c @AMDEP_TRUE@ source='mappers/6.c' object='mappers/6.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/6.Po' tmpdepfile='mappers/$(DEPDIR)/6.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/6.obj `cygpath -w mappers/6.c` mappers/65.o: mappers/65.c @AMDEP_TRUE@ source='mappers/65.c' object='mappers/65.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/65.Po' tmpdepfile='mappers/$(DEPDIR)/65.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/65.o `test -f 'mappers/65.c' || echo '$(srcdir)/'`mappers/65.c mappers/65.obj: mappers/65.c @AMDEP_TRUE@ source='mappers/65.c' object='mappers/65.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/65.Po' tmpdepfile='mappers/$(DEPDIR)/65.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/65.obj `cygpath -w mappers/65.c` mappers/67.o: mappers/67.c @AMDEP_TRUE@ source='mappers/67.c' object='mappers/67.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/67.Po' tmpdepfile='mappers/$(DEPDIR)/67.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/67.o `test -f 'mappers/67.c' || echo '$(srcdir)/'`mappers/67.c mappers/67.obj: mappers/67.c @AMDEP_TRUE@ source='mappers/67.c' object='mappers/67.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/67.Po' tmpdepfile='mappers/$(DEPDIR)/67.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/67.obj `cygpath -w mappers/67.c` mappers/68.o: mappers/68.c @AMDEP_TRUE@ source='mappers/68.c' object='mappers/68.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/68.Po' tmpdepfile='mappers/$(DEPDIR)/68.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/68.o `test -f 'mappers/68.c' || echo '$(srcdir)/'`mappers/68.c mappers/68.obj: mappers/68.c @AMDEP_TRUE@ source='mappers/68.c' object='mappers/68.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/68.Po' tmpdepfile='mappers/$(DEPDIR)/68.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/68.obj `cygpath -w mappers/68.c` mappers/69.o: mappers/69.c @AMDEP_TRUE@ source='mappers/69.c' object='mappers/69.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/69.Po' tmpdepfile='mappers/$(DEPDIR)/69.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/69.o `test -f 'mappers/69.c' || echo '$(srcdir)/'`mappers/69.c mappers/69.obj: mappers/69.c @AMDEP_TRUE@ source='mappers/69.c' object='mappers/69.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/69.Po' tmpdepfile='mappers/$(DEPDIR)/69.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/69.obj `cygpath -w mappers/69.c` mappers/71.o: mappers/71.c @AMDEP_TRUE@ source='mappers/71.c' object='mappers/71.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/71.Po' tmpdepfile='mappers/$(DEPDIR)/71.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/71.o `test -f 'mappers/71.c' || echo '$(srcdir)/'`mappers/71.c mappers/71.obj: mappers/71.c @AMDEP_TRUE@ source='mappers/71.c' object='mappers/71.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/71.Po' tmpdepfile='mappers/$(DEPDIR)/71.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/71.obj `cygpath -w mappers/71.c` mappers/73.o: mappers/73.c @AMDEP_TRUE@ source='mappers/73.c' object='mappers/73.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/73.Po' tmpdepfile='mappers/$(DEPDIR)/73.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/73.o `test -f 'mappers/73.c' || echo '$(srcdir)/'`mappers/73.c mappers/73.obj: mappers/73.c @AMDEP_TRUE@ source='mappers/73.c' object='mappers/73.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/73.Po' tmpdepfile='mappers/$(DEPDIR)/73.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/73.obj `cygpath -w mappers/73.c` mappers/75.o: mappers/75.c @AMDEP_TRUE@ source='mappers/75.c' object='mappers/75.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/75.Po' tmpdepfile='mappers/$(DEPDIR)/75.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/75.o `test -f 'mappers/75.c' || echo '$(srcdir)/'`mappers/75.c mappers/75.obj: mappers/75.c @AMDEP_TRUE@ source='mappers/75.c' object='mappers/75.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/75.Po' tmpdepfile='mappers/$(DEPDIR)/75.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/75.obj `cygpath -w mappers/75.c` mappers/76.o: mappers/76.c @AMDEP_TRUE@ source='mappers/76.c' object='mappers/76.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/76.Po' tmpdepfile='mappers/$(DEPDIR)/76.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/76.o `test -f 'mappers/76.c' || echo '$(srcdir)/'`mappers/76.c mappers/76.obj: mappers/76.c @AMDEP_TRUE@ source='mappers/76.c' object='mappers/76.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/76.Po' tmpdepfile='mappers/$(DEPDIR)/76.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/76.obj `cygpath -w mappers/76.c` mappers/79.o: mappers/79.c @AMDEP_TRUE@ source='mappers/79.c' object='mappers/79.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/79.Po' tmpdepfile='mappers/$(DEPDIR)/79.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/79.o `test -f 'mappers/79.c' || echo '$(srcdir)/'`mappers/79.c mappers/79.obj: mappers/79.c @AMDEP_TRUE@ source='mappers/79.c' object='mappers/79.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/79.Po' tmpdepfile='mappers/$(DEPDIR)/79.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/79.obj `cygpath -w mappers/79.c` mappers/8.o: mappers/8.c @AMDEP_TRUE@ source='mappers/8.c' object='mappers/8.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/8.Po' tmpdepfile='mappers/$(DEPDIR)/8.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/8.o `test -f 'mappers/8.c' || echo '$(srcdir)/'`mappers/8.c mappers/8.obj: mappers/8.c @AMDEP_TRUE@ source='mappers/8.c' object='mappers/8.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/8.Po' tmpdepfile='mappers/$(DEPDIR)/8.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/8.obj `cygpath -w mappers/8.c` mappers/80.o: mappers/80.c @AMDEP_TRUE@ source='mappers/80.c' object='mappers/80.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/80.Po' tmpdepfile='mappers/$(DEPDIR)/80.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/80.o `test -f 'mappers/80.c' || echo '$(srcdir)/'`mappers/80.c mappers/80.obj: mappers/80.c @AMDEP_TRUE@ source='mappers/80.c' object='mappers/80.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/80.Po' tmpdepfile='mappers/$(DEPDIR)/80.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/80.obj `cygpath -w mappers/80.c` mappers/85.o: mappers/85.c @AMDEP_TRUE@ source='mappers/85.c' object='mappers/85.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/85.Po' tmpdepfile='mappers/$(DEPDIR)/85.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/85.o `test -f 'mappers/85.c' || echo '$(srcdir)/'`mappers/85.c mappers/85.obj: mappers/85.c @AMDEP_TRUE@ source='mappers/85.c' object='mappers/85.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/85.Po' tmpdepfile='mappers/$(DEPDIR)/85.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/85.obj `cygpath -w mappers/85.c` mappers/95.o: mappers/95.c @AMDEP_TRUE@ source='mappers/95.c' object='mappers/95.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/95.Po' tmpdepfile='mappers/$(DEPDIR)/95.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/95.o `test -f 'mappers/95.c' || echo '$(srcdir)/'`mappers/95.c mappers/95.obj: mappers/95.c @AMDEP_TRUE@ source='mappers/95.c' object='mappers/95.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/95.Po' tmpdepfile='mappers/$(DEPDIR)/95.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/95.obj `cygpath -w mappers/95.c` mappers/97.o: mappers/97.c @AMDEP_TRUE@ source='mappers/97.c' object='mappers/97.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/97.Po' tmpdepfile='mappers/$(DEPDIR)/97.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/97.o `test -f 'mappers/97.c' || echo '$(srcdir)/'`mappers/97.c mappers/97.obj: mappers/97.c @AMDEP_TRUE@ source='mappers/97.c' object='mappers/97.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/97.Po' tmpdepfile='mappers/$(DEPDIR)/97.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/97.obj `cygpath -w mappers/97.c` mappers/99.o: mappers/99.c @AMDEP_TRUE@ source='mappers/99.c' object='mappers/99.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/99.Po' tmpdepfile='mappers/$(DEPDIR)/99.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/99.o `test -f 'mappers/99.c' || echo '$(srcdir)/'`mappers/99.c mappers/99.obj: mappers/99.c @AMDEP_TRUE@ source='mappers/99.c' object='mappers/99.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/99.Po' tmpdepfile='mappers/$(DEPDIR)/99.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/99.obj `cygpath -w mappers/99.c` mappers/182.o: mappers/182.c @AMDEP_TRUE@ source='mappers/182.c' object='mappers/182.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/182.Po' tmpdepfile='mappers/$(DEPDIR)/182.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/182.o `test -f 'mappers/182.c' || echo '$(srcdir)/'`mappers/182.c mappers/182.obj: mappers/182.c @AMDEP_TRUE@ source='mappers/182.c' object='mappers/182.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/182.Po' tmpdepfile='mappers/$(DEPDIR)/182.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/182.obj `cygpath -w mappers/182.c` mappers/46.o: mappers/46.c @AMDEP_TRUE@ source='mappers/46.c' object='mappers/46.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/46.Po' tmpdepfile='mappers/$(DEPDIR)/46.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/46.o `test -f 'mappers/46.c' || echo '$(srcdir)/'`mappers/46.c mappers/46.obj: mappers/46.c @AMDEP_TRUE@ source='mappers/46.c' object='mappers/46.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/46.Po' tmpdepfile='mappers/$(DEPDIR)/46.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/46.obj `cygpath -w mappers/46.c` mappers/43.o: mappers/43.c @AMDEP_TRUE@ source='mappers/43.c' object='mappers/43.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/43.Po' tmpdepfile='mappers/$(DEPDIR)/43.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/43.o `test -f 'mappers/43.c' || echo '$(srcdir)/'`mappers/43.c mappers/43.obj: mappers/43.c @AMDEP_TRUE@ source='mappers/43.c' object='mappers/43.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/43.Po' tmpdepfile='mappers/$(DEPDIR)/43.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/43.obj `cygpath -w mappers/43.c` mappers/42.o: mappers/42.c @AMDEP_TRUE@ source='mappers/42.c' object='mappers/42.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/42.Po' tmpdepfile='mappers/$(DEPDIR)/42.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/42.o `test -f 'mappers/42.c' || echo '$(srcdir)/'`mappers/42.c mappers/42.obj: mappers/42.c @AMDEP_TRUE@ source='mappers/42.c' object='mappers/42.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/42.Po' tmpdepfile='mappers/$(DEPDIR)/42.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/42.obj `cygpath -w mappers/42.c` mappers/113.o: mappers/113.c @AMDEP_TRUE@ source='mappers/113.c' object='mappers/113.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/113.Po' tmpdepfile='mappers/$(DEPDIR)/113.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/113.o `test -f 'mappers/113.c' || echo '$(srcdir)/'`mappers/113.c mappers/113.obj: mappers/113.c @AMDEP_TRUE@ source='mappers/113.c' object='mappers/113.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/113.Po' tmpdepfile='mappers/$(DEPDIR)/113.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/113.obj `cygpath -w mappers/113.c` mappers/86.o: mappers/86.c @AMDEP_TRUE@ source='mappers/86.c' object='mappers/86.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/86.Po' tmpdepfile='mappers/$(DEPDIR)/86.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/86.o `test -f 'mappers/86.c' || echo '$(srcdir)/'`mappers/86.c mappers/86.obj: mappers/86.c @AMDEP_TRUE@ source='mappers/86.c' object='mappers/86.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/86.Po' tmpdepfile='mappers/$(DEPDIR)/86.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/86.obj `cygpath -w mappers/86.c` mappers/89.o: mappers/89.c @AMDEP_TRUE@ source='mappers/89.c' object='mappers/89.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/89.Po' tmpdepfile='mappers/$(DEPDIR)/89.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/89.o `test -f 'mappers/89.c' || echo '$(srcdir)/'`mappers/89.c mappers/89.obj: mappers/89.c @AMDEP_TRUE@ source='mappers/89.c' object='mappers/89.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/89.Po' tmpdepfile='mappers/$(DEPDIR)/89.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/89.obj `cygpath -w mappers/89.c` mappers/83.o: mappers/83.c @AMDEP_TRUE@ source='mappers/83.c' object='mappers/83.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/83.Po' tmpdepfile='mappers/$(DEPDIR)/83.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/83.o `test -f 'mappers/83.c' || echo '$(srcdir)/'`mappers/83.c mappers/83.obj: mappers/83.c @AMDEP_TRUE@ source='mappers/83.c' object='mappers/83.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/83.Po' tmpdepfile='mappers/$(DEPDIR)/83.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/83.obj `cygpath -w mappers/83.c` mappers/77.o: mappers/77.c @AMDEP_TRUE@ source='mappers/77.c' object='mappers/77.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/77.Po' tmpdepfile='mappers/$(DEPDIR)/77.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/77.o `test -f 'mappers/77.c' || echo '$(srcdir)/'`mappers/77.c mappers/77.obj: mappers/77.c @AMDEP_TRUE@ source='mappers/77.c' object='mappers/77.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/77.Po' tmpdepfile='mappers/$(DEPDIR)/77.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/77.obj `cygpath -w mappers/77.c` mappers/92.o: mappers/92.c @AMDEP_TRUE@ source='mappers/92.c' object='mappers/92.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/92.Po' tmpdepfile='mappers/$(DEPDIR)/92.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/92.o `test -f 'mappers/92.c' || echo '$(srcdir)/'`mappers/92.c mappers/92.obj: mappers/92.c @AMDEP_TRUE@ source='mappers/92.c' object='mappers/92.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/92.Po' tmpdepfile='mappers/$(DEPDIR)/92.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/92.obj `cygpath -w mappers/92.c` mappers/88.o: mappers/88.c @AMDEP_TRUE@ source='mappers/88.c' object='mappers/88.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/88.Po' tmpdepfile='mappers/$(DEPDIR)/88.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/88.o `test -f 'mappers/88.c' || echo '$(srcdir)/'`mappers/88.c mappers/88.obj: mappers/88.c @AMDEP_TRUE@ source='mappers/88.c' object='mappers/88.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/88.Po' tmpdepfile='mappers/$(DEPDIR)/88.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/88.obj `cygpath -w mappers/88.c` mappers/248.o: mappers/248.c @AMDEP_TRUE@ source='mappers/248.c' object='mappers/248.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/248.Po' tmpdepfile='mappers/$(DEPDIR)/248.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/248.o `test -f 'mappers/248.c' || echo '$(srcdir)/'`mappers/248.c mappers/248.obj: mappers/248.c @AMDEP_TRUE@ source='mappers/248.c' object='mappers/248.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/248.Po' tmpdepfile='mappers/$(DEPDIR)/248.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/248.obj `cygpath -w mappers/248.c` mappers/emu2413.o: mappers/emu2413.c @AMDEP_TRUE@ source='mappers/emu2413.c' object='mappers/emu2413.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/emu2413.Po' tmpdepfile='mappers/$(DEPDIR)/emu2413.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/emu2413.o `test -f 'mappers/emu2413.c' || echo '$(srcdir)/'`mappers/emu2413.c mappers/emu2413.obj: mappers/emu2413.c @AMDEP_TRUE@ source='mappers/emu2413.c' object='mappers/emu2413.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/emu2413.Po' tmpdepfile='mappers/$(DEPDIR)/emu2413.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/emu2413.obj `cygpath -w mappers/emu2413.c` mappers/242.o: mappers/242.c @AMDEP_TRUE@ source='mappers/242.c' object='mappers/242.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/242.Po' tmpdepfile='mappers/$(DEPDIR)/242.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/242.o `test -f 'mappers/242.c' || echo '$(srcdir)/'`mappers/242.c mappers/242.obj: mappers/242.c @AMDEP_TRUE@ source='mappers/242.c' object='mappers/242.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/242.Po' tmpdepfile='mappers/$(DEPDIR)/242.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/242.obj `cygpath -w mappers/242.c` mappers/232.o: mappers/232.c @AMDEP_TRUE@ source='mappers/232.c' object='mappers/232.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/232.Po' tmpdepfile='mappers/$(DEPDIR)/232.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/232.o `test -f 'mappers/232.c' || echo '$(srcdir)/'`mappers/232.c mappers/232.obj: mappers/232.c @AMDEP_TRUE@ source='mappers/232.c' object='mappers/232.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/232.Po' tmpdepfile='mappers/$(DEPDIR)/232.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/232.obj `cygpath -w mappers/232.c` mappers/72.o: mappers/72.c @AMDEP_TRUE@ source='mappers/72.c' object='mappers/72.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/72.Po' tmpdepfile='mappers/$(DEPDIR)/72.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/72.o `test -f 'mappers/72.c' || echo '$(srcdir)/'`mappers/72.c mappers/72.obj: mappers/72.c @AMDEP_TRUE@ source='mappers/72.c' object='mappers/72.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/72.Po' tmpdepfile='mappers/$(DEPDIR)/72.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/72.obj `cygpath -w mappers/72.c` mappers/234.o: mappers/234.c @AMDEP_TRUE@ source='mappers/234.c' object='mappers/234.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/234.Po' tmpdepfile='mappers/$(DEPDIR)/234.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/234.o `test -f 'mappers/234.c' || echo '$(srcdir)/'`mappers/234.c mappers/234.obj: mappers/234.c @AMDEP_TRUE@ source='mappers/234.c' object='mappers/234.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/234.Po' tmpdepfile='mappers/$(DEPDIR)/234.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/234.obj `cygpath -w mappers/234.c` mappers/227.o: mappers/227.c @AMDEP_TRUE@ source='mappers/227.c' object='mappers/227.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/227.Po' tmpdepfile='mappers/$(DEPDIR)/227.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/227.o `test -f 'mappers/227.c' || echo '$(srcdir)/'`mappers/227.c mappers/227.obj: mappers/227.c @AMDEP_TRUE@ source='mappers/227.c' object='mappers/227.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/227.Po' tmpdepfile='mappers/$(DEPDIR)/227.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/227.obj `cygpath -w mappers/227.c` mappers/82.o: mappers/82.c @AMDEP_TRUE@ source='mappers/82.c' object='mappers/82.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/82.Po' tmpdepfile='mappers/$(DEPDIR)/82.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/82.o `test -f 'mappers/82.c' || echo '$(srcdir)/'`mappers/82.c mappers/82.obj: mappers/82.c @AMDEP_TRUE@ source='mappers/82.c' object='mappers/82.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/82.Po' tmpdepfile='mappers/$(DEPDIR)/82.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/82.obj `cygpath -w mappers/82.c` mappers/189.o: mappers/189.c @AMDEP_TRUE@ source='mappers/189.c' object='mappers/189.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/189.Po' tmpdepfile='mappers/$(DEPDIR)/189.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/189.o `test -f 'mappers/189.c' || echo '$(srcdir)/'`mappers/189.c mappers/189.obj: mappers/189.c @AMDEP_TRUE@ source='mappers/189.c' object='mappers/189.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/189.Po' tmpdepfile='mappers/$(DEPDIR)/189.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/189.obj `cygpath -w mappers/189.c` mappers/51.o: mappers/51.c @AMDEP_TRUE@ source='mappers/51.c' object='mappers/51.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/51.Po' tmpdepfile='mappers/$(DEPDIR)/51.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/51.o `test -f 'mappers/51.c' || echo '$(srcdir)/'`mappers/51.c mappers/51.obj: mappers/51.c @AMDEP_TRUE@ source='mappers/51.c' object='mappers/51.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/51.Po' tmpdepfile='mappers/$(DEPDIR)/51.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/51.obj `cygpath -w mappers/51.c` mappers/91.o: mappers/91.c @AMDEP_TRUE@ source='mappers/91.c' object='mappers/91.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/91.Po' tmpdepfile='mappers/$(DEPDIR)/91.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/91.o `test -f 'mappers/91.c' || echo '$(srcdir)/'`mappers/91.c mappers/91.obj: mappers/91.c @AMDEP_TRUE@ source='mappers/91.c' object='mappers/91.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/91.Po' tmpdepfile='mappers/$(DEPDIR)/91.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/91.obj `cygpath -w mappers/91.c` mappers/114.o: mappers/114.c @AMDEP_TRUE@ source='mappers/114.c' object='mappers/114.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/114.Po' tmpdepfile='mappers/$(DEPDIR)/114.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/114.o `test -f 'mappers/114.c' || echo '$(srcdir)/'`mappers/114.c mappers/114.obj: mappers/114.c @AMDEP_TRUE@ source='mappers/114.c' object='mappers/114.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/114.Po' tmpdepfile='mappers/$(DEPDIR)/114.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/114.obj `cygpath -w mappers/114.c` mappers/241.o: mappers/241.c @AMDEP_TRUE@ source='mappers/241.c' object='mappers/241.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/241.Po' tmpdepfile='mappers/$(DEPDIR)/241.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/241.o `test -f 'mappers/241.c' || echo '$(srcdir)/'`mappers/241.c mappers/241.obj: mappers/241.c @AMDEP_TRUE@ source='mappers/241.c' object='mappers/241.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/241.Po' tmpdepfile='mappers/$(DEPDIR)/241.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/241.obj `cygpath -w mappers/241.c` mappers/235.o: mappers/235.c @AMDEP_TRUE@ source='mappers/235.c' object='mappers/235.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/235.Po' tmpdepfile='mappers/$(DEPDIR)/235.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/235.o `test -f 'mappers/235.c' || echo '$(srcdir)/'`mappers/235.c mappers/235.obj: mappers/235.c @AMDEP_TRUE@ source='mappers/235.c' object='mappers/235.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/235.Po' tmpdepfile='mappers/$(DEPDIR)/235.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/235.obj `cygpath -w mappers/235.c` mappers/57.o: mappers/57.c @AMDEP_TRUE@ source='mappers/57.c' object='mappers/57.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/57.Po' tmpdepfile='mappers/$(DEPDIR)/57.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/57.o `test -f 'mappers/57.c' || echo '$(srcdir)/'`mappers/57.c mappers/57.obj: mappers/57.c @AMDEP_TRUE@ source='mappers/57.c' object='mappers/57.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/57.Po' tmpdepfile='mappers/$(DEPDIR)/57.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/57.obj `cygpath -w mappers/57.c` mappers/255.o: mappers/255.c @AMDEP_TRUE@ source='mappers/255.c' object='mappers/255.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/255.Po' tmpdepfile='mappers/$(DEPDIR)/255.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/255.o `test -f 'mappers/255.c' || echo '$(srcdir)/'`mappers/255.c mappers/255.obj: mappers/255.c @AMDEP_TRUE@ source='mappers/255.c' object='mappers/255.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/255.Po' tmpdepfile='mappers/$(DEPDIR)/255.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/255.obj `cygpath -w mappers/255.c` mappers/61.o: mappers/61.c @AMDEP_TRUE@ source='mappers/61.c' object='mappers/61.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/61.Po' tmpdepfile='mappers/$(DEPDIR)/61.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/61.o `test -f 'mappers/61.c' || echo '$(srcdir)/'`mappers/61.c mappers/61.obj: mappers/61.c @AMDEP_TRUE@ source='mappers/61.c' object='mappers/61.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/61.Po' tmpdepfile='mappers/$(DEPDIR)/61.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/61.obj `cygpath -w mappers/61.c` mappers/59.o: mappers/59.c @AMDEP_TRUE@ source='mappers/59.c' object='mappers/59.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/59.Po' tmpdepfile='mappers/$(DEPDIR)/59.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/59.o `test -f 'mappers/59.c' || echo '$(srcdir)/'`mappers/59.c mappers/59.obj: mappers/59.c @AMDEP_TRUE@ source='mappers/59.c' object='mappers/59.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/59.Po' tmpdepfile='mappers/$(DEPDIR)/59.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/59.obj `cygpath -w mappers/59.c` mappers/193.o: mappers/193.c @AMDEP_TRUE@ source='mappers/193.c' object='mappers/193.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/193.Po' tmpdepfile='mappers/$(DEPDIR)/193.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/193.o `test -f 'mappers/193.c' || echo '$(srcdir)/'`mappers/193.c mappers/193.obj: mappers/193.c @AMDEP_TRUE@ source='mappers/193.c' object='mappers/193.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/193.Po' tmpdepfile='mappers/$(DEPDIR)/193.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/193.obj `cygpath -w mappers/193.c` mappers/50.o: mappers/50.c @AMDEP_TRUE@ source='mappers/50.c' object='mappers/50.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/50.Po' tmpdepfile='mappers/$(DEPDIR)/50.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/50.o `test -f 'mappers/50.c' || echo '$(srcdir)/'`mappers/50.c mappers/50.obj: mappers/50.c @AMDEP_TRUE@ source='mappers/50.c' object='mappers/50.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/50.Po' tmpdepfile='mappers/$(DEPDIR)/50.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/50.obj `cygpath -w mappers/50.c` mappers/60.o: mappers/60.c @AMDEP_TRUE@ source='mappers/60.c' object='mappers/60.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/60.Po' tmpdepfile='mappers/$(DEPDIR)/60.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/60.o `test -f 'mappers/60.c' || echo '$(srcdir)/'`mappers/60.c mappers/60.obj: mappers/60.c @AMDEP_TRUE@ source='mappers/60.c' object='mappers/60.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/60.Po' tmpdepfile='mappers/$(DEPDIR)/60.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/60.obj `cygpath -w mappers/60.c` mappers/62.o: mappers/62.c @AMDEP_TRUE@ source='mappers/62.c' object='mappers/62.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/62.Po' tmpdepfile='mappers/$(DEPDIR)/62.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/62.o `test -f 'mappers/62.c' || echo '$(srcdir)/'`mappers/62.c mappers/62.obj: mappers/62.c @AMDEP_TRUE@ source='mappers/62.c' object='mappers/62.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/62.Po' tmpdepfile='mappers/$(DEPDIR)/62.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/62.obj `cygpath -w mappers/62.c` mappers/244.o: mappers/244.c @AMDEP_TRUE@ source='mappers/244.c' object='mappers/244.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/244.Po' tmpdepfile='mappers/$(DEPDIR)/244.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/244.o `test -f 'mappers/244.c' || echo '$(srcdir)/'`mappers/244.c mappers/244.obj: mappers/244.c @AMDEP_TRUE@ source='mappers/244.c' object='mappers/244.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/244.Po' tmpdepfile='mappers/$(DEPDIR)/244.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/244.obj `cygpath -w mappers/244.c` mappers/230.o: mappers/230.c @AMDEP_TRUE@ source='mappers/230.c' object='mappers/230.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/230.Po' tmpdepfile='mappers/$(DEPDIR)/230.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/230.o `test -f 'mappers/230.c' || echo '$(srcdir)/'`mappers/230.c mappers/230.obj: mappers/230.c @AMDEP_TRUE@ source='mappers/230.c' object='mappers/230.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/230.Po' tmpdepfile='mappers/$(DEPDIR)/230.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/230.obj `cygpath -w mappers/230.c` mappers/200.o: mappers/200.c @AMDEP_TRUE@ source='mappers/200.c' object='mappers/200.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/200.Po' tmpdepfile='mappers/$(DEPDIR)/200.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/200.o `test -f 'mappers/200.c' || echo '$(srcdir)/'`mappers/200.c mappers/200.obj: mappers/200.c @AMDEP_TRUE@ source='mappers/200.c' object='mappers/200.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/200.Po' tmpdepfile='mappers/$(DEPDIR)/200.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/200.obj `cygpath -w mappers/200.c` mappers/201.o: mappers/201.c @AMDEP_TRUE@ source='mappers/201.c' object='mappers/201.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/201.Po' tmpdepfile='mappers/$(DEPDIR)/201.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/201.o `test -f 'mappers/201.c' || echo '$(srcdir)/'`mappers/201.c mappers/201.obj: mappers/201.c @AMDEP_TRUE@ source='mappers/201.c' object='mappers/201.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/201.Po' tmpdepfile='mappers/$(DEPDIR)/201.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/201.obj `cygpath -w mappers/201.c` mappers/202.o: mappers/202.c @AMDEP_TRUE@ source='mappers/202.c' object='mappers/202.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/202.Po' tmpdepfile='mappers/$(DEPDIR)/202.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/202.o `test -f 'mappers/202.c' || echo '$(srcdir)/'`mappers/202.c mappers/202.obj: mappers/202.c @AMDEP_TRUE@ source='mappers/202.c' object='mappers/202.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/202.Po' tmpdepfile='mappers/$(DEPDIR)/202.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/202.obj `cygpath -w mappers/202.c` mappers/203.o: mappers/203.c @AMDEP_TRUE@ source='mappers/203.c' object='mappers/203.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/203.Po' tmpdepfile='mappers/$(DEPDIR)/203.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/203.o `test -f 'mappers/203.c' || echo '$(srcdir)/'`mappers/203.c mappers/203.obj: mappers/203.c @AMDEP_TRUE@ source='mappers/203.c' object='mappers/203.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/203.Po' tmpdepfile='mappers/$(DEPDIR)/203.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/203.obj `cygpath -w mappers/203.c` mappers/231.o: mappers/231.c @AMDEP_TRUE@ source='mappers/231.c' object='mappers/231.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/231.Po' tmpdepfile='mappers/$(DEPDIR)/231.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/231.o `test -f 'mappers/231.c' || echo '$(srcdir)/'`mappers/231.c mappers/231.obj: mappers/231.c @AMDEP_TRUE@ source='mappers/231.c' object='mappers/231.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/231.Po' tmpdepfile='mappers/$(DEPDIR)/231.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/231.obj `cygpath -w mappers/231.c` mappers/208.o: mappers/208.c @AMDEP_TRUE@ source='mappers/208.c' object='mappers/208.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/208.Po' tmpdepfile='mappers/$(DEPDIR)/208.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/208.o `test -f 'mappers/208.c' || echo '$(srcdir)/'`mappers/208.c mappers/208.obj: mappers/208.c @AMDEP_TRUE@ source='mappers/208.c' object='mappers/208.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/208.Po' tmpdepfile='mappers/$(DEPDIR)/208.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/208.obj `cygpath -w mappers/208.c` mappers/58.o: mappers/58.c @AMDEP_TRUE@ source='mappers/58.c' object='mappers/58.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/58.Po' tmpdepfile='mappers/$(DEPDIR)/58.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/58.o `test -f 'mappers/58.c' || echo '$(srcdir)/'`mappers/58.c mappers/58.obj: mappers/58.c @AMDEP_TRUE@ source='mappers/58.c' object='mappers/58.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/58.Po' tmpdepfile='mappers/$(DEPDIR)/58.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/58.obj `cygpath -w mappers/58.c` mappers/187.o: mappers/187.c @AMDEP_TRUE@ source='mappers/187.c' object='mappers/187.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/187.Po' tmpdepfile='mappers/$(DEPDIR)/187.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/187.o `test -f 'mappers/187.c' || echo '$(srcdir)/'`mappers/187.c mappers/187.obj: mappers/187.c @AMDEP_TRUE@ source='mappers/187.c' object='mappers/187.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mappers/$(DEPDIR)/187.Po' tmpdepfile='mappers/$(DEPDIR)/187.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mappers/187.obj `cygpath -w mappers/187.c` mbshare/mmc5.o: mbshare/mmc5.c @AMDEP_TRUE@ source='mbshare/mmc5.c' object='mbshare/mmc5.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mbshare/$(DEPDIR)/mmc5.Po' tmpdepfile='mbshare/$(DEPDIR)/mmc5.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mbshare/mmc5.o `test -f 'mbshare/mmc5.c' || echo '$(srcdir)/'`mbshare/mmc5.c mbshare/mmc5.obj: mbshare/mmc5.c @AMDEP_TRUE@ source='mbshare/mmc5.c' object='mbshare/mmc5.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mbshare/$(DEPDIR)/mmc5.Po' tmpdepfile='mbshare/$(DEPDIR)/mmc5.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mbshare/mmc5.obj `cygpath -w mbshare/mmc5.c` mbshare/mmc3.o: mbshare/mmc3.c @AMDEP_TRUE@ source='mbshare/mmc3.c' object='mbshare/mmc3.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mbshare/$(DEPDIR)/mmc3.Po' tmpdepfile='mbshare/$(DEPDIR)/mmc3.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mbshare/mmc3.o `test -f 'mbshare/mmc3.c' || echo '$(srcdir)/'`mbshare/mmc3.c mbshare/mmc3.obj: mbshare/mmc3.c @AMDEP_TRUE@ source='mbshare/mmc3.c' object='mbshare/mmc3.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mbshare/$(DEPDIR)/mmc3.Po' tmpdepfile='mbshare/$(DEPDIR)/mmc3.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mbshare/mmc3.obj `cygpath -w mbshare/mmc3.c` mbshare/mmc1.o: mbshare/mmc1.c @AMDEP_TRUE@ source='mbshare/mmc1.c' object='mbshare/mmc1.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mbshare/$(DEPDIR)/mmc1.Po' tmpdepfile='mbshare/$(DEPDIR)/mmc1.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mbshare/mmc1.o `test -f 'mbshare/mmc1.c' || echo '$(srcdir)/'`mbshare/mmc1.c mbshare/mmc1.obj: mbshare/mmc1.c @AMDEP_TRUE@ source='mbshare/mmc1.c' object='mbshare/mmc1.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mbshare/$(DEPDIR)/mmc1.Po' tmpdepfile='mbshare/$(DEPDIR)/mmc1.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mbshare/mmc1.obj `cygpath -w mbshare/mmc1.c` mbshare/tengen.o: mbshare/tengen.c @AMDEP_TRUE@ source='mbshare/tengen.c' object='mbshare/tengen.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mbshare/$(DEPDIR)/tengen.Po' tmpdepfile='mbshare/$(DEPDIR)/tengen.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mbshare/tengen.o `test -f 'mbshare/tengen.c' || echo '$(srcdir)/'`mbshare/tengen.c mbshare/tengen.obj: mbshare/tengen.c @AMDEP_TRUE@ source='mbshare/tengen.c' object='mbshare/tengen.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mbshare/$(DEPDIR)/tengen.Po' tmpdepfile='mbshare/$(DEPDIR)/tengen.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mbshare/tengen.obj `cygpath -w mbshare/tengen.c` mbshare/90.o: mbshare/90.c @AMDEP_TRUE@ source='mbshare/90.c' object='mbshare/90.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mbshare/$(DEPDIR)/90.Po' tmpdepfile='mbshare/$(DEPDIR)/90.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mbshare/90.o `test -f 'mbshare/90.c' || echo '$(srcdir)/'`mbshare/90.c mbshare/90.obj: mbshare/90.c @AMDEP_TRUE@ source='mbshare/90.c' object='mbshare/90.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mbshare/$(DEPDIR)/90.Po' tmpdepfile='mbshare/$(DEPDIR)/90.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mbshare/90.obj `cygpath -w mbshare/90.c` mbshare/deirom.o: mbshare/deirom.c @AMDEP_TRUE@ source='mbshare/deirom.c' object='mbshare/deirom.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mbshare/$(DEPDIR)/deirom.Po' tmpdepfile='mbshare/$(DEPDIR)/deirom.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mbshare/deirom.o `test -f 'mbshare/deirom.c' || echo '$(srcdir)/'`mbshare/deirom.c mbshare/deirom.obj: mbshare/deirom.c @AMDEP_TRUE@ source='mbshare/deirom.c' object='mbshare/deirom.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mbshare/$(DEPDIR)/deirom.Po' tmpdepfile='mbshare/$(DEPDIR)/deirom.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mbshare/deirom.obj `cygpath -w mbshare/deirom.c` mbshare/n106.o: mbshare/n106.c @AMDEP_TRUE@ source='mbshare/n106.c' object='mbshare/n106.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mbshare/$(DEPDIR)/n106.Po' tmpdepfile='mbshare/$(DEPDIR)/n106.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mbshare/n106.o `test -f 'mbshare/n106.c' || echo '$(srcdir)/'`mbshare/n106.c mbshare/n106.obj: mbshare/n106.c @AMDEP_TRUE@ source='mbshare/n106.c' object='mbshare/n106.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mbshare/$(DEPDIR)/n106.Po' tmpdepfile='mbshare/$(DEPDIR)/n106.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mbshare/n106.obj `cygpath -w mbshare/n106.c` mbshare/164.o: mbshare/164.c @AMDEP_TRUE@ source='mbshare/164.c' object='mbshare/164.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mbshare/$(DEPDIR)/164.Po' tmpdepfile='mbshare/$(DEPDIR)/164.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mbshare/164.o `test -f 'mbshare/164.c' || echo '$(srcdir)/'`mbshare/164.c mbshare/164.obj: mbshare/164.c @AMDEP_TRUE@ source='mbshare/164.c' object='mbshare/164.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='mbshare/$(DEPDIR)/164.Po' tmpdepfile='mbshare/$(DEPDIR)/164.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mbshare/164.obj `cygpath -w mbshare/164.c` drivers/common/args.o: drivers/common/args.c @AMDEP_TRUE@ source='drivers/common/args.c' object='drivers/common/args.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/common/$(DEPDIR)/args.Po' tmpdepfile='drivers/common/$(DEPDIR)/args.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/common/args.o `test -f 'drivers/common/args.c' || echo '$(srcdir)/'`drivers/common/args.c drivers/common/args.obj: drivers/common/args.c @AMDEP_TRUE@ source='drivers/common/args.c' object='drivers/common/args.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/common/$(DEPDIR)/args.Po' tmpdepfile='drivers/common/$(DEPDIR)/args.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/common/args.obj `cygpath -w drivers/common/args.c` drivers/common/cheat.o: drivers/common/cheat.c @AMDEP_TRUE@ source='drivers/common/cheat.c' object='drivers/common/cheat.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/common/$(DEPDIR)/cheat.Po' tmpdepfile='drivers/common/$(DEPDIR)/cheat.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/common/cheat.o `test -f 'drivers/common/cheat.c' || echo '$(srcdir)/'`drivers/common/cheat.c drivers/common/cheat.obj: drivers/common/cheat.c @AMDEP_TRUE@ source='drivers/common/cheat.c' object='drivers/common/cheat.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/common/$(DEPDIR)/cheat.Po' tmpdepfile='drivers/common/$(DEPDIR)/cheat.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/common/cheat.obj `cygpath -w drivers/common/cheat.c` drivers/common/config.o: drivers/common/config.c @AMDEP_TRUE@ source='drivers/common/config.c' object='drivers/common/config.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/common/$(DEPDIR)/config.Po' tmpdepfile='drivers/common/$(DEPDIR)/config.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/common/config.o `test -f 'drivers/common/config.c' || echo '$(srcdir)/'`drivers/common/config.c drivers/common/config.obj: drivers/common/config.c @AMDEP_TRUE@ source='drivers/common/config.c' object='drivers/common/config.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/common/$(DEPDIR)/config.Po' tmpdepfile='drivers/common/$(DEPDIR)/config.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/common/config.obj `cygpath -w drivers/common/config.c` drivers/common/vidblit.o: drivers/common/vidblit.c @AMDEP_TRUE@ source='drivers/common/vidblit.c' object='drivers/common/vidblit.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/common/$(DEPDIR)/vidblit.Po' tmpdepfile='drivers/common/$(DEPDIR)/vidblit.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/common/vidblit.o `test -f 'drivers/common/vidblit.c' || echo '$(srcdir)/'`drivers/common/vidblit.c drivers/common/vidblit.obj: drivers/common/vidblit.c @AMDEP_TRUE@ source='drivers/common/vidblit.c' object='drivers/common/vidblit.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/common/$(DEPDIR)/vidblit.Po' tmpdepfile='drivers/common/$(DEPDIR)/vidblit.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/common/vidblit.obj `cygpath -w drivers/common/vidblit.c` drivers/common/hq2x.o: drivers/common/hq2x.c @AMDEP_TRUE@ source='drivers/common/hq2x.c' object='drivers/common/hq2x.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/common/$(DEPDIR)/hq2x.Po' tmpdepfile='drivers/common/$(DEPDIR)/hq2x.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/common/hq2x.o `test -f 'drivers/common/hq2x.c' || echo '$(srcdir)/'`drivers/common/hq2x.c drivers/common/hq2x.obj: drivers/common/hq2x.c @AMDEP_TRUE@ source='drivers/common/hq2x.c' object='drivers/common/hq2x.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/common/$(DEPDIR)/hq2x.Po' tmpdepfile='drivers/common/$(DEPDIR)/hq2x.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/common/hq2x.obj `cygpath -w drivers/common/hq2x.c` drivers/common/hq3x.o: drivers/common/hq3x.c @AMDEP_TRUE@ source='drivers/common/hq3x.c' object='drivers/common/hq3x.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/common/$(DEPDIR)/hq3x.Po' tmpdepfile='drivers/common/$(DEPDIR)/hq3x.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/common/hq3x.o `test -f 'drivers/common/hq3x.c' || echo '$(srcdir)/'`drivers/common/hq3x.c drivers/common/hq3x.obj: drivers/common/hq3x.c @AMDEP_TRUE@ source='drivers/common/hq3x.c' object='drivers/common/hq3x.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/common/$(DEPDIR)/hq3x.Po' tmpdepfile='drivers/common/$(DEPDIR)/hq3x.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/common/hq3x.obj `cygpath -w drivers/common/hq3x.c` drivers/common/scale2x.o: drivers/common/scale2x.c @AMDEP_TRUE@ source='drivers/common/scale2x.c' object='drivers/common/scale2x.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/common/$(DEPDIR)/scale2x.Po' tmpdepfile='drivers/common/$(DEPDIR)/scale2x.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/common/scale2x.o `test -f 'drivers/common/scale2x.c' || echo '$(srcdir)/'`drivers/common/scale2x.c drivers/common/scale2x.obj: drivers/common/scale2x.c @AMDEP_TRUE@ source='drivers/common/scale2x.c' object='drivers/common/scale2x.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/common/$(DEPDIR)/scale2x.Po' tmpdepfile='drivers/common/$(DEPDIR)/scale2x.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/common/scale2x.obj `cygpath -w drivers/common/scale2x.c` drivers/common/scale3x.o: drivers/common/scale3x.c @AMDEP_TRUE@ source='drivers/common/scale3x.c' object='drivers/common/scale3x.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/common/$(DEPDIR)/scale3x.Po' tmpdepfile='drivers/common/$(DEPDIR)/scale3x.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/common/scale3x.o `test -f 'drivers/common/scale3x.c' || echo '$(srcdir)/'`drivers/common/scale3x.c drivers/common/scale3x.obj: drivers/common/scale3x.c @AMDEP_TRUE@ source='drivers/common/scale3x.c' object='drivers/common/scale3x.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/common/$(DEPDIR)/scale3x.Po' tmpdepfile='drivers/common/$(DEPDIR)/scale3x.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/common/scale3x.obj `cygpath -w drivers/common/scale3x.c` drivers/common/scalebit.o: drivers/common/scalebit.c @AMDEP_TRUE@ source='drivers/common/scalebit.c' object='drivers/common/scalebit.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/common/$(DEPDIR)/scalebit.Po' tmpdepfile='drivers/common/$(DEPDIR)/scalebit.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/common/scalebit.o `test -f 'drivers/common/scalebit.c' || echo '$(srcdir)/'`drivers/common/scalebit.c drivers/common/scalebit.obj: drivers/common/scalebit.c @AMDEP_TRUE@ source='drivers/common/scalebit.c' object='drivers/common/scalebit.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/common/$(DEPDIR)/scalebit.Po' tmpdepfile='drivers/common/$(DEPDIR)/scalebit.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/common/scalebit.obj `cygpath -w drivers/common/scalebit.c` drivers/sexyal/sexyal.o: drivers/sexyal/sexyal.c @AMDEP_TRUE@ source='drivers/sexyal/sexyal.c' object='drivers/sexyal/sexyal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/sexyal/$(DEPDIR)/sexyal.Po' tmpdepfile='drivers/sexyal/$(DEPDIR)/sexyal.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/sexyal/sexyal.o `test -f 'drivers/sexyal/sexyal.c' || echo '$(srcdir)/'`drivers/sexyal/sexyal.c drivers/sexyal/sexyal.obj: drivers/sexyal/sexyal.c @AMDEP_TRUE@ source='drivers/sexyal/sexyal.c' object='drivers/sexyal/sexyal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/sexyal/$(DEPDIR)/sexyal.Po' tmpdepfile='drivers/sexyal/$(DEPDIR)/sexyal.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/sexyal/sexyal.obj `cygpath -w drivers/sexyal/sexyal.c` drivers/sexyal/md5.o: drivers/sexyal/md5.c @AMDEP_TRUE@ source='drivers/sexyal/md5.c' object='drivers/sexyal/md5.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/sexyal/$(DEPDIR)/md5.Po' tmpdepfile='drivers/sexyal/$(DEPDIR)/md5.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/sexyal/md5.o `test -f 'drivers/sexyal/md5.c' || echo '$(srcdir)/'`drivers/sexyal/md5.c drivers/sexyal/md5.obj: drivers/sexyal/md5.c @AMDEP_TRUE@ source='drivers/sexyal/md5.c' object='drivers/sexyal/md5.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/sexyal/$(DEPDIR)/md5.Po' tmpdepfile='drivers/sexyal/$(DEPDIR)/md5.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/sexyal/md5.obj `cygpath -w drivers/sexyal/md5.c` drivers/sexyal/smallc.o: drivers/sexyal/smallc.c @AMDEP_TRUE@ source='drivers/sexyal/smallc.c' object='drivers/sexyal/smallc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/sexyal/$(DEPDIR)/smallc.Po' tmpdepfile='drivers/sexyal/$(DEPDIR)/smallc.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/sexyal/smallc.o `test -f 'drivers/sexyal/smallc.c' || echo '$(srcdir)/'`drivers/sexyal/smallc.c drivers/sexyal/smallc.obj: drivers/sexyal/smallc.c @AMDEP_TRUE@ source='drivers/sexyal/smallc.c' object='drivers/sexyal/smallc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/sexyal/$(DEPDIR)/smallc.Po' tmpdepfile='drivers/sexyal/$(DEPDIR)/smallc.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/sexyal/smallc.obj `cygpath -w drivers/sexyal/smallc.c` drivers/sexyal/convert.o: drivers/sexyal/convert.c @AMDEP_TRUE@ source='drivers/sexyal/convert.c' object='drivers/sexyal/convert.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/sexyal/$(DEPDIR)/convert.Po' tmpdepfile='drivers/sexyal/$(DEPDIR)/convert.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/sexyal/convert.o `test -f 'drivers/sexyal/convert.c' || echo '$(srcdir)/'`drivers/sexyal/convert.c drivers/sexyal/convert.obj: drivers/sexyal/convert.c @AMDEP_TRUE@ source='drivers/sexyal/convert.c' object='drivers/sexyal/convert.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/sexyal/$(DEPDIR)/convert.Po' tmpdepfile='drivers/sexyal/$(DEPDIR)/convert.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/sexyal/convert.obj `cygpath -w drivers/sexyal/convert.c` drivers/sexyal/drivers/oss.o: drivers/sexyal/drivers/oss.c @AMDEP_TRUE@ source='drivers/sexyal/drivers/oss.c' object='drivers/sexyal/drivers/oss.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/sexyal/drivers/$(DEPDIR)/oss.Po' tmpdepfile='drivers/sexyal/drivers/$(DEPDIR)/oss.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/sexyal/drivers/oss.o `test -f 'drivers/sexyal/drivers/oss.c' || echo '$(srcdir)/'`drivers/sexyal/drivers/oss.c drivers/sexyal/drivers/oss.obj: drivers/sexyal/drivers/oss.c @AMDEP_TRUE@ source='drivers/sexyal/drivers/oss.c' object='drivers/sexyal/drivers/oss.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/sexyal/drivers/$(DEPDIR)/oss.Po' tmpdepfile='drivers/sexyal/drivers/$(DEPDIR)/oss.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/sexyal/drivers/oss.obj `cygpath -w drivers/sexyal/drivers/oss.c` drivers/sexyal/drivers/dsound.o: drivers/sexyal/drivers/dsound.c @AMDEP_TRUE@ source='drivers/sexyal/drivers/dsound.c' object='drivers/sexyal/drivers/dsound.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/sexyal/drivers/$(DEPDIR)/dsound.Po' tmpdepfile='drivers/sexyal/drivers/$(DEPDIR)/dsound.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/sexyal/drivers/dsound.o `test -f 'drivers/sexyal/drivers/dsound.c' || echo '$(srcdir)/'`drivers/sexyal/drivers/dsound.c drivers/sexyal/drivers/dsound.obj: drivers/sexyal/drivers/dsound.c @AMDEP_TRUE@ source='drivers/sexyal/drivers/dsound.c' object='drivers/sexyal/drivers/dsound.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/sexyal/drivers/$(DEPDIR)/dsound.Po' tmpdepfile='drivers/sexyal/drivers/$(DEPDIR)/dsound.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/sexyal/drivers/dsound.obj `cygpath -w drivers/sexyal/drivers/dsound.c` drivers/win/cheat.o: drivers/win/cheat.c @AMDEP_TRUE@ source='drivers/win/cheat.c' object='drivers/win/cheat.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/win/$(DEPDIR)/cheat.Po' tmpdepfile='drivers/win/$(DEPDIR)/cheat.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/win/cheat.o `test -f 'drivers/win/cheat.c' || echo '$(srcdir)/'`drivers/win/cheat.c drivers/win/cheat.obj: drivers/win/cheat.c @AMDEP_TRUE@ source='drivers/win/cheat.c' object='drivers/win/cheat.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/win/$(DEPDIR)/cheat.Po' tmpdepfile='drivers/win/$(DEPDIR)/cheat.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/win/cheat.obj `cygpath -w drivers/win/cheat.c` drivers/win/debug.o: drivers/win/debug.c @AMDEP_TRUE@ source='drivers/win/debug.c' object='drivers/win/debug.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/win/$(DEPDIR)/debug.Po' tmpdepfile='drivers/win/$(DEPDIR)/debug.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/win/debug.o `test -f 'drivers/win/debug.c' || echo '$(srcdir)/'`drivers/win/debug.c drivers/win/debug.obj: drivers/win/debug.c @AMDEP_TRUE@ source='drivers/win/debug.c' object='drivers/win/debug.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/win/$(DEPDIR)/debug.Po' tmpdepfile='drivers/win/$(DEPDIR)/debug.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/win/debug.obj `cygpath -w drivers/win/debug.c` drivers/win/input.o: drivers/win/input.c @AMDEP_TRUE@ source='drivers/win/input.c' object='drivers/win/input.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/win/$(DEPDIR)/input.Po' tmpdepfile='drivers/win/$(DEPDIR)/input.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/win/input.o `test -f 'drivers/win/input.c' || echo '$(srcdir)/'`drivers/win/input.c drivers/win/input.obj: drivers/win/input.c @AMDEP_TRUE@ source='drivers/win/input.c' object='drivers/win/input.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/win/$(DEPDIR)/input.Po' tmpdepfile='drivers/win/$(DEPDIR)/input.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/win/input.obj `cygpath -w drivers/win/input.c` drivers/win/joystick.o: drivers/win/joystick.c @AMDEP_TRUE@ source='drivers/win/joystick.c' object='drivers/win/joystick.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/win/$(DEPDIR)/joystick.Po' tmpdepfile='drivers/win/$(DEPDIR)/joystick.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/win/joystick.o `test -f 'drivers/win/joystick.c' || echo '$(srcdir)/'`drivers/win/joystick.c drivers/win/joystick.obj: drivers/win/joystick.c @AMDEP_TRUE@ source='drivers/win/joystick.c' object='drivers/win/joystick.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/win/$(DEPDIR)/joystick.Po' tmpdepfile='drivers/win/$(DEPDIR)/joystick.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/win/joystick.obj `cygpath -w drivers/win/joystick.c` drivers/win/keyboard.o: drivers/win/keyboard.c @AMDEP_TRUE@ source='drivers/win/keyboard.c' object='drivers/win/keyboard.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/win/$(DEPDIR)/keyboard.Po' tmpdepfile='drivers/win/$(DEPDIR)/keyboard.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/win/keyboard.o `test -f 'drivers/win/keyboard.c' || echo '$(srcdir)/'`drivers/win/keyboard.c drivers/win/keyboard.obj: drivers/win/keyboard.c @AMDEP_TRUE@ source='drivers/win/keyboard.c' object='drivers/win/keyboard.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/win/$(DEPDIR)/keyboard.Po' tmpdepfile='drivers/win/$(DEPDIR)/keyboard.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/win/keyboard.obj `cygpath -w drivers/win/keyboard.c` drivers/win/log.o: drivers/win/log.c @AMDEP_TRUE@ source='drivers/win/log.c' object='drivers/win/log.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/win/$(DEPDIR)/log.Po' tmpdepfile='drivers/win/$(DEPDIR)/log.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/win/log.o `test -f 'drivers/win/log.c' || echo '$(srcdir)/'`drivers/win/log.c drivers/win/log.obj: drivers/win/log.c @AMDEP_TRUE@ source='drivers/win/log.c' object='drivers/win/log.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/win/$(DEPDIR)/log.Po' tmpdepfile='drivers/win/$(DEPDIR)/log.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/win/log.obj `cygpath -w drivers/win/log.c` drivers/win/main.o: drivers/win/main.c @AMDEP_TRUE@ source='drivers/win/main.c' object='drivers/win/main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/win/$(DEPDIR)/main.Po' tmpdepfile='drivers/win/$(DEPDIR)/main.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/win/main.o `test -f 'drivers/win/main.c' || echo '$(srcdir)/'`drivers/win/main.c drivers/win/main.obj: drivers/win/main.c @AMDEP_TRUE@ source='drivers/win/main.c' object='drivers/win/main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/win/$(DEPDIR)/main.Po' tmpdepfile='drivers/win/$(DEPDIR)/main.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/win/main.obj `cygpath -w drivers/win/main.c` drivers/win/netplay.o: drivers/win/netplay.c @AMDEP_TRUE@ source='drivers/win/netplay.c' object='drivers/win/netplay.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/win/$(DEPDIR)/netplay.Po' tmpdepfile='drivers/win/$(DEPDIR)/netplay.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/win/netplay.o `test -f 'drivers/win/netplay.c' || echo '$(srcdir)/'`drivers/win/netplay.c drivers/win/netplay.obj: drivers/win/netplay.c @AMDEP_TRUE@ source='drivers/win/netplay.c' object='drivers/win/netplay.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/win/$(DEPDIR)/netplay.Po' tmpdepfile='drivers/win/$(DEPDIR)/netplay.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/win/netplay.obj `cygpath -w drivers/win/netplay.c` drivers/pc/input.o: drivers/pc/input.c @AMDEP_TRUE@ source='drivers/pc/input.c' object='drivers/pc/input.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/pc/$(DEPDIR)/input.Po' tmpdepfile='drivers/pc/$(DEPDIR)/input.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/pc/input.o `test -f 'drivers/pc/input.c' || echo '$(srcdir)/'`drivers/pc/input.c drivers/pc/input.obj: drivers/pc/input.c @AMDEP_TRUE@ source='drivers/pc/input.c' object='drivers/pc/input.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/pc/$(DEPDIR)/input.Po' tmpdepfile='drivers/pc/$(DEPDIR)/input.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/pc/input.obj `cygpath -w drivers/pc/input.c` drivers/pc/main.o: drivers/pc/main.c @AMDEP_TRUE@ source='drivers/pc/main.c' object='drivers/pc/main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/pc/$(DEPDIR)/main.Po' tmpdepfile='drivers/pc/$(DEPDIR)/main.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/pc/main.o `test -f 'drivers/pc/main.c' || echo '$(srcdir)/'`drivers/pc/main.c drivers/pc/main.obj: drivers/pc/main.c @AMDEP_TRUE@ source='drivers/pc/main.c' object='drivers/pc/main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/pc/$(DEPDIR)/main.Po' tmpdepfile='drivers/pc/$(DEPDIR)/main.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/pc/main.obj `cygpath -w drivers/pc/main.c` drivers/pc/sdl.o: drivers/pc/sdl.c @AMDEP_TRUE@ source='drivers/pc/sdl.c' object='drivers/pc/sdl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/pc/$(DEPDIR)/sdl.Po' tmpdepfile='drivers/pc/$(DEPDIR)/sdl.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/pc/sdl.o `test -f 'drivers/pc/sdl.c' || echo '$(srcdir)/'`drivers/pc/sdl.c drivers/pc/sdl.obj: drivers/pc/sdl.c @AMDEP_TRUE@ source='drivers/pc/sdl.c' object='drivers/pc/sdl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/pc/$(DEPDIR)/sdl.Po' tmpdepfile='drivers/pc/$(DEPDIR)/sdl.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/pc/sdl.obj `cygpath -w drivers/pc/sdl.c` drivers/pc/sdl-joystick.o: drivers/pc/sdl-joystick.c @AMDEP_TRUE@ source='drivers/pc/sdl-joystick.c' object='drivers/pc/sdl-joystick.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/pc/$(DEPDIR)/sdl-joystick.Po' tmpdepfile='drivers/pc/$(DEPDIR)/sdl-joystick.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/pc/sdl-joystick.o `test -f 'drivers/pc/sdl-joystick.c' || echo '$(srcdir)/'`drivers/pc/sdl-joystick.c drivers/pc/sdl-joystick.obj: drivers/pc/sdl-joystick.c @AMDEP_TRUE@ source='drivers/pc/sdl-joystick.c' object='drivers/pc/sdl-joystick.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/pc/$(DEPDIR)/sdl-joystick.Po' tmpdepfile='drivers/pc/$(DEPDIR)/sdl-joystick.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/pc/sdl-joystick.obj `cygpath -w drivers/pc/sdl-joystick.c` drivers/pc/sdl-sound.o: drivers/pc/sdl-sound.c @AMDEP_TRUE@ source='drivers/pc/sdl-sound.c' object='drivers/pc/sdl-sound.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/pc/$(DEPDIR)/sdl-sound.Po' tmpdepfile='drivers/pc/$(DEPDIR)/sdl-sound.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/pc/sdl-sound.o `test -f 'drivers/pc/sdl-sound.c' || echo '$(srcdir)/'`drivers/pc/sdl-sound.c drivers/pc/sdl-sound.obj: drivers/pc/sdl-sound.c @AMDEP_TRUE@ source='drivers/pc/sdl-sound.c' object='drivers/pc/sdl-sound.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/pc/$(DEPDIR)/sdl-sound.Po' tmpdepfile='drivers/pc/$(DEPDIR)/sdl-sound.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/pc/sdl-sound.obj `cygpath -w drivers/pc/sdl-sound.c` drivers/pc/sdl-throttle.o: drivers/pc/sdl-throttle.c @AMDEP_TRUE@ source='drivers/pc/sdl-throttle.c' object='drivers/pc/sdl-throttle.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/pc/$(DEPDIR)/sdl-throttle.Po' tmpdepfile='drivers/pc/$(DEPDIR)/sdl-throttle.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/pc/sdl-throttle.o `test -f 'drivers/pc/sdl-throttle.c' || echo '$(srcdir)/'`drivers/pc/sdl-throttle.c drivers/pc/sdl-throttle.obj: drivers/pc/sdl-throttle.c @AMDEP_TRUE@ source='drivers/pc/sdl-throttle.c' object='drivers/pc/sdl-throttle.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/pc/$(DEPDIR)/sdl-throttle.Po' tmpdepfile='drivers/pc/$(DEPDIR)/sdl-throttle.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/pc/sdl-throttle.obj `cygpath -w drivers/pc/sdl-throttle.c` drivers/pc/sdl-video.o: drivers/pc/sdl-video.c @AMDEP_TRUE@ source='drivers/pc/sdl-video.c' object='drivers/pc/sdl-video.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/pc/$(DEPDIR)/sdl-video.Po' tmpdepfile='drivers/pc/$(DEPDIR)/sdl-video.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/pc/sdl-video.o `test -f 'drivers/pc/sdl-video.c' || echo '$(srcdir)/'`drivers/pc/sdl-video.c drivers/pc/sdl-video.obj: drivers/pc/sdl-video.c @AMDEP_TRUE@ source='drivers/pc/sdl-video.c' object='drivers/pc/sdl-video.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/pc/$(DEPDIR)/sdl-video.Po' tmpdepfile='drivers/pc/$(DEPDIR)/sdl-video.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/pc/sdl-video.obj `cygpath -w drivers/pc/sdl-video.c` drivers/pc/unix-netplay.o: drivers/pc/unix-netplay.c @AMDEP_TRUE@ source='drivers/pc/unix-netplay.c' object='drivers/pc/unix-netplay.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/pc/$(DEPDIR)/unix-netplay.Po' tmpdepfile='drivers/pc/$(DEPDIR)/unix-netplay.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/pc/unix-netplay.o `test -f 'drivers/pc/unix-netplay.c' || echo '$(srcdir)/'`drivers/pc/unix-netplay.c drivers/pc/unix-netplay.obj: drivers/pc/unix-netplay.c @AMDEP_TRUE@ source='drivers/pc/unix-netplay.c' object='drivers/pc/unix-netplay.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/pc/$(DEPDIR)/unix-netplay.Po' tmpdepfile='drivers/pc/$(DEPDIR)/unix-netplay.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/pc/unix-netplay.obj `cygpath -w drivers/pc/unix-netplay.c` drivers/pc/sdl-opengl.o: drivers/pc/sdl-opengl.c @AMDEP_TRUE@ source='drivers/pc/sdl-opengl.c' object='drivers/pc/sdl-opengl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/pc/$(DEPDIR)/sdl-opengl.Po' tmpdepfile='drivers/pc/$(DEPDIR)/sdl-opengl.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/pc/sdl-opengl.o `test -f 'drivers/pc/sdl-opengl.c' || echo '$(srcdir)/'`drivers/pc/sdl-opengl.c drivers/pc/sdl-opengl.obj: drivers/pc/sdl-opengl.c @AMDEP_TRUE@ source='drivers/pc/sdl-opengl.c' object='drivers/pc/sdl-opengl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='drivers/pc/$(DEPDIR)/sdl-opengl.Po' tmpdepfile='drivers/pc/$(DEPDIR)/sdl-opengl.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drivers/pc/sdl-opengl.obj `cygpath -w drivers/pc/sdl-opengl.c` CCDEPMODE = @CCDEPMODE@ uninstall-info-am: ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic distclean distclean-compile distclean-depend \ distclean-generic distclean-tags distdir dvi dvi-am info \ info-am install install-am install-binPROGRAMS install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-info-am @NATIVEWIN32_TRUE@.res.o: @NATIVEWIN32_TRUE@ windres -o $@ $< # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fceu-0.98.12/src/fceu.c0000644000175000000620000002207610052014275014372 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 #include #include "types.h" #include "x6502.h" #include "fceu.h" #include "ppu.h" #include "sound.h" #include "netplay.h" #include "general.h" #include "endian.h" #include "memory.h" #include "cart.h" #include "nsf.h" #include "fds.h" #include "ines.h" #include "unif.h" #include "cheat.h" #include "palette.h" #include "state.h" #include "movie.h" #include "video.h" #include "input.h" #include "file.h" #include "crc32.h" #include "vsuni.h" uint64 timestampbase; FCEUGI *FCEUGameInfo = NULL; void (*GameInterface)(int h); void (*GameStateRestore)(int version); readfunc ARead[0x10000]; writefunc BWrite[0x10000]; static readfunc *AReadG; static writefunc *BWriteG; static int RWWrap=0; static DECLFW(BNull) { } static DECLFR(ANull) { return(X.DB); } int AllocGenieRW(void) { if(!(AReadG=(readfunc *)FCEU_malloc(0x8000*sizeof(readfunc)))) return 0; if(!(BWriteG=(writefunc *)FCEU_malloc(0x8000*sizeof(writefunc)))) return 0; RWWrap=1; return 1; } void FlushGenieRW(void) { int32 x; if(RWWrap) { for(x=0;x<0x8000;x++) { ARead[x+0x8000]=AReadG[x]; BWrite[x+0x8000]=BWriteG[x]; } free(AReadG); free(BWriteG); AReadG=0; BWriteG=0; RWWrap=0; } } readfunc FASTAPASS(1) GetReadHandler(int32 a) { if(a>=0x8000 && RWWrap) return AReadG[a-0x8000]; else return ARead[a]; } void FASTAPASS(3) SetReadHandler(int32 start, int32 end, readfunc func) { int32 x; if(!func) func=ANull; if(RWWrap) for(x=end;x>=start;x--) { if(x>=0x8000) AReadG[x-0x8000]=func; else ARead[x]=func; } else for(x=end;x>=start;x--) ARead[x]=func; } writefunc FASTAPASS(1) GetWriteHandler(int32 a) { if(RWWrap && a>=0x8000) return BWriteG[a-0x8000]; else return BWrite[a]; } void FASTAPASS(3) SetWriteHandler(int32 start, int32 end, writefunc func) { int32 x; if(!func) func=BNull; if(RWWrap) for(x=end;x>=start;x--) { if(x>=0x8000) BWriteG[x-0x8000]=func; else BWrite[x]=func; } else for(x=end;x>=start;x--) BWrite[x]=func; } uint8 GameMemBlock[131072]; uint8 RAM[0x800]; uint8 PAL=0; static DECLFW(BRAML) { RAM[A]=V; } static DECLFW(BRAMH) { RAM[A&0x7FF]=V; } static DECLFR(ARAML) { return RAM[A]; } static DECLFR(ARAMH) { return RAM[A&0x7FF]; } static void CloseGame(void) { if(FCEUGameInfo) { if(FCEUnetplay) FCEUD_NetworkClose(); if(FCEUGameInfo->name) { free(FCEUGameInfo->name); FCEUGameInfo->name=0; } if(FCEUGameInfo->type!=GIT_NSF) FCEU_FlushGameCheats(0,0); GameInterface(GI_CLOSE); ResetExState(0,0); CloseGenie(); free(FCEUGameInfo); FCEUGameInfo = 0; } } void ResetGameLoaded(void) { if(FCEUGameInfo) CloseGame(); GameStateRestore=0; PPU_hook=0; GameHBIRQHook=0; if(GameExpSound.Kill) GameExpSound.Kill(); memset(&GameExpSound,0,sizeof(GameExpSound)); MapIRQHook=0; MMC5Hack=0; PAL&=1; pale=0; } int UNIFLoad(const char *name, FCEUFILE *fp); int iNESLoad(const char *name, FCEUFILE *fp); int FDSLoad(const char *name, FCEUFILE *fp); int NSFLoad(FCEUFILE *fp); FCEUGI *FCEUI_LoadGame(const char *name) { FCEUFILE *fp; char *ipsfn; ResetGameLoaded(); FCEUGameInfo = malloc(sizeof(FCEUGI)); memset(FCEUGameInfo, 0, sizeof(FCEUGI)); FCEUGameInfo->soundchan = 0; FCEUGameInfo->soundrate = 0; FCEUGameInfo->name=0; FCEUGameInfo->type=GIT_CART; FCEUGameInfo->vidsys=GIV_USER; FCEUGameInfo->input[0]=FCEUGameInfo->input[1]=-1; FCEUGameInfo->inputfc=-1; FCEUGameInfo->cspecial=0; FCEU_printf("Loading %s...\n\n",name); GetFileBase(name); ipsfn=FCEU_MakeFName(FCEUMKF_IPS,0,0); fp=FCEU_fopen(name,ipsfn,"rb",0); free(ipsfn); if(!fp) { FCEU_PrintError("Error opening \"%s\"!",name); return 0; } if(iNESLoad(name,fp)) goto endlseq; if(NSFLoad(fp)) goto endlseq; if(UNIFLoad(name,fp)) goto endlseq; if(FDSLoad(name,fp)) goto endlseq; FCEU_PrintError("An error occurred while loading the file."); FCEU_fclose(fp); return 0; endlseq: FCEU_fclose(fp); FCEU_ResetVidSys(); if(FCEUGameInfo->type!=GIT_NSF) if(FSettings.GameGenie) OpenGenie(); PowerNES(); FCEUSS_CheckStates(); FCEUMOV_CheckMovies(); if(FCEUGameInfo->type!=GIT_NSF) { FCEU_LoadGamePalette(); FCEU_LoadGameCheats(0); } FCEU_ResetPalette(); FCEU_ResetMessages(); // Save state, status messages, etc. return(FCEUGameInfo); } int FCEUI_Initialize(void) { if(!FCEU_InitVirtualVideo()) return 0; memset(&FSettings,0,sizeof(FSettings)); FSettings.UsrFirstSLine[0]=8; FSettings.UsrFirstSLine[1]=0; FSettings.UsrLastSLine[0]=231; FSettings.UsrLastSLine[1]=239; FSettings.SoundVolume=100; FCEUPPU_Init(); X6502_Init(); return 1; } void FCEUI_Kill(void) { FCEU_KillVirtualVideo(); FCEU_KillGenie(); } void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int skip) { int r,ssize; FCEU_UpdateInput(); if(geniestage!=1) FCEU_ApplyPeriodicCheats(); r=FCEUPPU_Loop(skip); ssize=FlushEmulateSound(); timestampbase += timestamp; timestamp = 0; *pXBuf=skip?0:XBuf; *SoundBuf=WaveFinal; *SoundBufSize=ssize; } void FCEUI_CloseGame(void) { CloseGame(); } void ResetNES(void) { FCEUMOV_AddCommand(FCEUNPCMD_RESET); if(!FCEUGameInfo) return; GameInterface(GI_RESETM2); FCEUSND_Reset(); FCEUPPU_Reset(); X6502_Reset(); } void FCEU_MemoryRand(uint8 *ptr, uint32 size) { int x=0; while(size) { *ptr=(x&4)?0xFF:0x00; x++; size--; ptr++; } } void hand(X6502 *X, int type, unsigned int A) { } void PowerNES(void) { FCEUMOV_AddCommand(FCEUNPCMD_POWER); if(!FCEUGameInfo) return; FCEU_CheatResetRAM(); FCEU_CheatAddRAM(2,0,RAM); GeniePower(); FCEU_MemoryRand(RAM,0x800); //memset(RAM,0xFF,0x800); SetReadHandler(0x0000,0xFFFF,ANull); SetWriteHandler(0x0000,0xFFFF,BNull); SetReadHandler(0,0x7FF,ARAML); SetWriteHandler(0,0x7FF,BRAML); SetReadHandler(0x800,0x1FFF,ARAMH); /* Part of a little */ SetWriteHandler(0x800,0x1FFF,BRAMH); /* hack for a small speed boost. */ InitializeInput(); FCEUSND_Power(); FCEUPPU_Power(); /* Have the external game hardware "powered" after the internal NES stuff. Needed for the NSF code and VS System code. */ GameInterface(GI_POWER); if(FCEUGameInfo->type==GIT_VSUNI) FCEU_VSUniPower(); timestampbase=0; X6502_Power(); FCEU_PowerCheats(); } void FCEU_ResetVidSys(void) { int w; if(FCEUGameInfo->vidsys==GIV_NTSC) w=0; else if(FCEUGameInfo->vidsys==GIV_PAL) w=1; else w=FSettings.PAL; PAL=w?1:0; FCEUPPU_SetVideoSystem(w); SetSoundVariables(); } FCEUS FSettings; void FCEU_printf(char *format, ...) { char temp[2048]; va_list ap; va_start(ap,format); vsprintf(temp,format,ap); FCEUD_Message(temp); va_end(ap); } void FCEU_PrintError(char *format, ...) { char temp[2048]; va_list ap; va_start(ap,format); vsprintf(temp,format,ap); FCEUD_PrintError(temp); va_end(ap); } void FCEUI_SetRenderedLines(int ntscf, int ntscl, int palf, int pall) { FSettings.UsrFirstSLine[0]=ntscf; FSettings.UsrLastSLine[0]=ntscl; FSettings.UsrFirstSLine[1]=palf; FSettings.UsrLastSLine[1]=pall; if(PAL) { FSettings.FirstSLine=FSettings.UsrFirstSLine[1]; FSettings.LastSLine=FSettings.UsrLastSLine[1]; } else { FSettings.FirstSLine=FSettings.UsrFirstSLine[0]; FSettings.LastSLine=FSettings.UsrLastSLine[0]; } } void FCEUI_SetVidSystem(int a) { FSettings.PAL=a?1:0; if(FCEUGameInfo) { FCEU_ResetVidSys(); FCEU_ResetPalette(); } } int FCEUI_GetCurrentVidSystem(int *slstart, int *slend) { if(slstart) *slstart=FSettings.FirstSLine; if(slend) *slend=FSettings.LastSLine; return(PAL); } void FCEUI_SetGameGenie(int a) { FSettings.GameGenie=a?1:0; } void FCEUI_SetSnapName(int a) { FSettings.SnapName=a; } int32 FCEUI_GetDesiredFPS(void) { if(PAL) return(838977920); // ~50.007 else return(1008307711); // ~60.1 } fceu-0.98.12/src/fceu.h0000644000175000000620000000452110035716616014403 0ustar joestaff00000000000000#ifndef _FCEUH extern int fceuindbg; void ResetGameLoaded(void); #define DECLFR(x) uint8 FP_FASTAPASS(1) x (uint32 A) #define DECLFW(x) void FP_FASTAPASS(2) x (uint32 A, uint8 V) void FCEU_MemoryRand(uint8 *ptr, uint32 size); void FASTAPASS(3) SetReadHandler(int32 start, int32 end, readfunc func); void FASTAPASS(3) SetWriteHandler(int32 start, int32 end, writefunc func); writefunc FASTAPASS(1) GetWriteHandler(int32 a); readfunc FASTAPASS(1) GetReadHandler(int32 a); int AllocGenieRW(void); void FlushGenieRW(void); void FCEU_ResetVidSys(void); void ResetMapping(void); void ResetNES(void); void PowerNES(void); extern uint64 timestampbase; extern uint32 MMC5HackVROMMask; extern uint8 *MMC5HackExNTARAMPtr; extern int MMC5Hack; extern uint8 *MMC5HackVROMPTR; extern uint8 MMC5HackCHRMode; extern uint8 MMC5HackSPMode; extern uint8 MMC5HackSPScroll; extern uint8 MMC5HackSPPage; extern uint8 RAM[0x800]; extern uint8 GameMemBlock[131072]; extern readfunc ARead[0x10000]; extern writefunc BWrite[0x10000]; extern void (*GameInterface)(int h); extern void (*GameStateRestore)(int version); #define GI_RESETM2 1 #define GI_POWER 2 #define GI_CLOSE 3 #include "git.h" extern FCEUGI *FCEUGameInfo; extern int GameAttributes; extern uint8 PAL; #include "driver.h" typedef struct { int PAL; int NetworkPlay; int SoundVolume; int GameGenie; /* Current first and last rendered scanlines. */ int FirstSLine; int LastSLine; /* Driver code(user)-specified first and last rendered scanlines. Usr*SLine[0] is for NTSC, Usr*SLine[1] is for PAL. */ int UsrFirstSLine[2]; int UsrLastSLine[2]; int SnapName; uint32 SndRate; int soundq; int lowpass; } FCEUS; extern FCEUS FSettings; void FCEU_PrintError(char *format, ...); void FCEU_printf(char *format, ...); void FCEU_DispMessage(char *format, ...); void SetNESDeemph(uint8 d, int force); void DrawTextTrans(uint8 *dest, uint32 width, uint8 *textmsg, uint8 fgcolor); void FCEU_PutImage(void); #ifdef FRAMESKIP void FCEU_PutImageDummy(void); #endif extern uint8 Exit; extern uint8 pale; extern uint8 vsdip; #define JOY_A 1 #define JOY_B 2 #define JOY_SELECT 4 #define JOY_START 8 #define JOY_UP 0x10 #define JOY_DOWN 0x20 #define JOY_LEFT 0x40 #define JOY_RIGHT 0x80 #else #define _FCEUH #endif fceu-0.98.12/src/fcoeffs.h0000644000175000000620000020526610106303763015077 0ustar joestaff00000000000000#define SQ2NCOEFFS 1024 static int32 sq2coeffs[SQ2NCOEFFS]; static int32 SQ2C44100NTSC[SQ2NCOEFFS/2]= { #include "fir/c44100ntsc.h" }; static int32 SQ2C48000NTSC[SQ2NCOEFFS/2]= { #include "fir/c48000ntsc.h" }; static int32 SQ2C96000NTSC[SQ2NCOEFFS/2]= { #include "fir/c96000ntsc.h" }; static int32 SQ2C44100PAL[SQ2NCOEFFS/2]= { #include "fir/c44100pal.h" }; static int32 SQ2C48000PAL[SQ2NCOEFFS/2]= { #include "fir/c48000pal.h" }; static int32 SQ2C96000PAL[SQ2NCOEFFS/2]= { #include "fir/c96000pal.h" }; #define NCOEFFS 484 static int32 coeffs[NCOEFFS]; /* 96000hz filter could probably be improved. */ /* Parks-McClellan FIR Filter Design Filter type: Low pass Passband: 0 - 0.016761904 Order: 483 Passband ripple: 0.01 dB Transition band: 0.01005714 Stopband attenuation: 103.0 dB Coefficients: */ static int32 C96000NTSC[NCOEFFS/2]= { /*0*/ 65536*16* -5.9950991853042605E-6 /*1*/, 65536*16* -3.0394382502604395E-6 /*2*/, 65536*16* -3.728403434239284E-6 /*3*/, 65536*16* -4.460351826790638E-6 /*4*/, 65536*16* -5.2164320385801135E-6 /*5*/, 65536*16* -5.9787071016806234E-6 /*6*/, 65536*16* -6.716463411023574E-6 /*7*/, 65536*16* -7.408551386580002E-6 /*8*/, 65536*16* -8.023491429829738E-6 /*9*/, 65536*16* -8.531232892238868E-6 /*10*/, 65536*16* -8.878741512154837E-6 /*11*/, 65536*16* -9.046773382992595E-6 /*12*/, 65536*16* -8.993971214348702E-6 /*13*/, 65536*16* -8.66944931521744E-6 /*14*/, 65536*16* -8.049348524459474E-6 /*15*/, 65536*16* -7.083238646482467E-6 /*16*/, 65536*16* -5.746762349938464E-6 /*17*/, 65536*16* -4.005753681691657E-6 /*18*/, 65536*16* -1.838018035195733E-6 /*19*/, 65536*16* 7.763983938828864E-7 /*20*/, 65536*16* 3.842232025916005E-6 /*21*/, 65536*16* 7.361161707034959E-6 /*22*/, 65536*16* 1.1325948767988128E-5 /*23*/, 65536*16* 1.5711486406341978E-5 /*24*/, 65536*16* 2.0488201424957098E-5 /*25*/, 65536*16* 2.5608402660083142E-5 /*26*/, 65536*16* 3.101231858515874E-5 /*27*/, 65536*16* 3.6630654060842745E-5 /*28*/, 65536*16* 4.2375439803123404E-5 /*29*/, 65536*16* 4.815060832963289E-5 /*30*/, 65536*16* 5.384626411548906E-5 /*31*/, 65536*16* 5.934549587237094E-5 /*32*/, 65536*16* 6.451785679907682E-5 /*33*/, 65536*16* 6.923065879553487E-5 /*34*/, 65536*16* 7.334304650233838E-5 /*35*/, 65536*16* 7.671308820252635E-5 /*36*/, 65536*16* 7.920112989696133E-5 /*37*/, 65536*16* 8.066793124218096E-5 /*38*/, 65536*16* 8.098382483962539E-5 /*39*/, 65536*16* 8.002921154479775E-5 /*40*/, 65536*16* 7.769789869215064E-5 /*41*/, 65536*16* 7.390152475899438E-5 /*42*/, 65536*16* 6.857231550142758E-5 /*43*/, 65536*16* 6.16673817460573E-5 /*44*/, 65536*16* 5.3169767940001464E-5 /*45*/, 65536*16* 4.309495398773014E-5 /*46*/, 65536*16* 3.148737405995964E-5 /*47*/, 65536*16* 1.8428415219696232E-5 /*48*/, 65536*16* 4.0337781533928895E-6 /*49*/, 65536*16* -1.154525373085283E-5 /*50*/, 65536*16* -2.8120750949316567E-5 /*51*/, 65536*16* -4.5470242422149815E-5 /*52*/, 65536*16* -6.333736379615692E-5 /*53*/, 65536*16* -8.143489509942166E-5 /*54*/, 65536*16* -9.94475640226242E-5 /*55*/, 65536*16* -1.1703729468742291E-4 /*56*/, 65536*16* -1.3384679191408508E-4 /*57*/, 65536*16* -1.4950548598267213E-4 /*58*/, 65536*16* -1.6363792959068823E-4 /*59*/, 65536*16* -1.7586732627086947E-4 /*60*/, 65536*16* -1.858264971517669E-4 /*61*/, 65536*16* -1.9316312487547242E-4 /*62*/, 65536*16* -1.975494021862538E-4 /*63*/, 65536*16* -1.9868977868165154E-4 /*64*/, 65536*16* -1.963293865814053E-4 /*65*/, 65536*16* -1.9026146175876417E-4 /*66*/, 65536*16* -1.803352078962109E-4 /*67*/, 65536*16* -1.66463443436789E-4 /*68*/, 65536*16* -1.4862710934868261E-4 /*69*/, 65536*16* -1.2688200452566298E-4 /*70*/, 65536*16* -1.0136212853169677E-4 /*71*/, 65536*16* -7.228199463954364E-5 /*72*/, 65536*16* -3.9939461621236575E-5 /*73*/, 65536*16* -4.7134932934724E-6 /*74*/, 65536*16* 3.2936215273699675E-5 /*75*/, 65536*16* 7.247384833064696E-5 /*76*/, 65536*16* 1.1329187082792405E-4 /*77*/, 65536*16* 1.5471948843725746E-4 /*78*/, 65536*16* 1.9603027714808286E-4 /*79*/, 65536*16* 2.364532958813608E-4 /*80*/, 65536*16* 2.751853212246927E-4 /*81*/, 65536*16* 3.114033208188799E-4 /*82*/, 65536*16* 3.442804841775461E-4 /*83*/, 65536*16* 3.7300098840546946E-4 /*84*/, 65536*16* 3.967764136715296E-4 /*85*/, 65536*16* 4.148631617351676E-4 /*86*/, 65536*16* 4.265789297533608E-4 /*87*/, 65536*16* 4.3132002526188114E-4 /*88*/, 65536*16* 4.2857701618443636E-4 /*89*/, 65536*16* 4.179510914969621E-4 /*90*/, 65536*16* 3.991670037587729E-4 /*91*/, 65536*16* 3.720870989970653E-4 /*92*/, 65536*16* 3.367209236003282E-4 /*93*/, 65536*16* 2.932338231303312E-4 /*94*/, 65536*16* 2.419533571940393E-4 /*95*/, 65536*16* 1.8337169647749448E-4 /*96*/, 65536*16* 1.1814612711310299E-4 /*97*/, 65536*16* 4.709567952563025E-5 /*98*/, 65536*16* -2.880519351052945E-5 /*99*/, 65536*16* -1.08436462295612E-4 /*100*/, 65536*16* -1.905455293630124E-4 /*101*/, 65536*16* -2.7376362665015007E-4 /*102*/, 65536*16* -3.566259161939277E-4 /*103*/, 65536*16* -4.375928024937683E-4 /*104*/, 65536*16* -5.150762555847844E-4 /*105*/, 65536*16* -5.874662774920191E-4 /*106*/, 65536*16* -6.531605887419429E-4 /*107*/, 65536*16* -7.105951946653638E-4 /*108*/, 65536*16* -7.582757639600853E-4 /*109*/, 65536*16* -7.948096207059845E-4 /*110*/, 65536*16* -8.189373133065186E-4 /*111*/, 65536*16* -8.295634640890689E-4 /*112*/, 65536*16* -8.257854455404298E-4 /*113*/, 65536*16* -8.069208861135825E-4 /*114*/, 65536*16* -7.725316214556066E-4 /*115*/, 65536*16* -7.224442067331338E-4 /*116*/, 65536*16* -6.567673177902021E-4 /*117*/, 65536*16* -5.759031970767677E-4 /*118*/, 65536*16* -4.8055576975832975E-4 /*119*/, 65536*16* -3.7173219275304865E-4 /*120*/, 65536*16* -2.507394811359122E-4 /*121*/, 65536*16* -1.191747608775131E-4 /*122*/, 65536*16* 2.1089774143064154E-5 /*123*/, 65536*16* 1.6792832047168277E-4 /*124*/, 65536*16* 3.189887341095747E-4 /*125*/, 65536*16* 4.7172479984555337E-4 /*126*/, 65536*16* 6.234346495766704E-4 /*127*/, 65536*16* 7.713029674040095E-4 /*128*/, 65536*16* 9.124478381058291E-4 /*129*/, 65536*16* 0.0010439713492973299 /*130*/, 65536*16* 0.0011630121060354824 /*131*/, 65536*16* 0.0012668003330792172 /*132*/, 65536*16* 0.0013527131638668246 /*133*/, 65536*16* 0.0014183305230994348 /*134*/, 65536*16* 0.0014614889365474647 /*135*/, 65536*16* 0.0014803340336415063 /*136*/, 65536*16* 0.0014733688575452508 /*137*/, 65536*16* 0.001439498243826639 /*138*/, 65536*16* 0.0013780680098511918 /*139*/, 65536*16* 0.0012888970057146566 /*140*/, 65536*16* 0.0011723026532406624 /*141*/, 65536*16* 0.0010291180003947405 /*142*/, 65536*16* 8.607001658653358E-4 /*143*/, 65536*16* 6.689295599970792E-4 /*144*/, 65536*16* 4.5619928199453885E-4 /*145*/, 65536*16* 2.253948582736753E-4 /*146*/, 65536*16* -2.0136349562764177E-5 /*147*/, 65536*16* -2.766248035657636E-4 /*148*/, 65536*16* -5.399290507797791E-4 /*149*/, 65536*16* -8.055939397996815E-4 /*150*/, 65536*16* -0.0010689177291287714 /*151*/, 65536*16* -0.0013250265370767429 /*152*/, 65536*16* -0.0015689549600474482 /*153*/, 65536*16* -0.0017957322527663085 /*154*/, 65536*16* -0.002000472024117418 /*155*/, 65536*16* -0.0021784645223266222 /*156*/, 65536*16* -0.0023252695222818146 /*157*/, 65536*16* -0.0024368087083972345 /*158*/, 65536*16* -0.002509455241851095 /*159*/, 65536*16* -0.0025401189567937766 /*160*/, 65536*16* -0.0025263261450844377 /*161*/, 65536*16* -0.0024662908754217406 /*162*/, 65536*16* -0.002358977944127433 /*163*/, 65536*16* -0.002204154401342649 /*164*/, 65536*16* -0.002002429343138771 /*165*/, 65536*16* -0.0017552803385372808 /*166*/, 65536*16* -0.0014650656045065488 /*167*/, 65536*16* -0.001135021049166992 /*168*/, 65536*16* -7.692415547098649E-4 /*169*/, 65536*16* -3.7264671522013244E-4 /*170*/, 65536*16* 4.906989195928291E-5 /*171*/, 65536*16* 4.895067103339711E-4 /*172*/, 65536*16* 9.416355837269647E-4 /*173*/, 65536*16* 0.001397897684142057 /*174*/, 65536*16* 0.0018503121614766558 /*175*/, 65536*16* 0.002290597319733804 /*176*/, 65536*16* 0.0027103015920374113 /*177*/, 65536*16* 0.0031009433327120863 /*178*/, 65536*16* 0.0034541565687980116 /*179*/, 65536*16* 0.0037618412630103333 /*180*/, 65536*16* 0.004016315066649496 /*181*/, 65536*16* 0.004210464374744574 /*182*/, 65536*16* 0.004337892288164658 /*183*/, 65536*16* 0.004393060165490985 /*184*/, 65536*16* 0.004371421226297046 /*185*/, 65536*16* 0.004269542847715132 /*186*/, 65536*16* 0.00408521543517564 /*187*/, 65536*16* 0.0038175457430583526 /*188*/, 65536*16* 0.00346703221076496 /*189*/, 65536*16* 0.0030356209846777236 /*190*/, 65536*16* 0.002526740400739804 /*191*/, 65536*16* 0.0019453134428630866 /*192*/, 65536*16* 0.0012977462825954304 /*193*/, 65536*16* 5.918933555500828E-4 /*194*/, 65536*16* -1.6300197379338156E-4 /*195*/, 65536*16* -9.563908629597664E-4 /*196*/, 65536*16* -0.0017765255338228524 /*197*/, 65536*16* -0.0026105886000394158 /*198*/, 65536*16* -0.003444843158936217 /*199*/, 65536*16* -0.004264802433556331 /*200*/, 65536*16* -0.00505541655658742 /*201*/, 65536*16* -0.005801274223045036 /*202*/, 65536*16* -0.0064868164183708756 /*203*/, 65536*16* -0.007096559102022994 /*204*/, 65536*16* -0.007615322236172286 /*205*/, 65536*16* -0.008028460796606074 /*206*/, 65536*16* -0.008322095341268461 /*207*/, 65536*16* -0.008483337773170242 /*208*/, 65536*16* -0.008500509194641638 /*209*/, 65536*16* -0.008363346317351387 /*210*/, 65536*16* -0.008063192746297233 /*211*/, 65536*16* -0.007593172286363423 /*212*/, 65536*16* -0.0069483408893122045 /*213*/, 65536*16* -0.006125814985695579 /*214*/, 65536*16* -0.005124873148956596 /*215*/, 65536*16* -0.003947029569132915 /*216*/, 65536*16* -0.002596077508306772 /*217*/, 65536*16* -0.0010781012650798818 /*218*/, 65536*16* 5.985434770618447E-4 /*219*/, 65536*16* 0.0024232820773754 /*220*/, 65536*16* 0.004383405101533075 /*221*/, 65536*16* 0.006464184070028333 /*222*/, 65536*16* 0.008649017282842432 /*223*/, 65536*16* 0.010919604285452066 /*224*/, 65536*16* 0.013256146772932903 /*225*/, 65536*16* 0.015637573164024095 /*226*/, 65536*16* 0.018041784432073237 /*227*/, 65536*16* 0.020445917198990023 /*228*/, 65536*16* 0.022826621253151515 /*229*/, 65536*16* 0.025160347111354456 /*230*/, 65536*16* 0.02742363969736895 /*231*/, 65536*16* 0.02959343430076011 /*232*/, 65536*16* 0.03164735012116834 /*233*/, 65536*16* 0.03356397767681876 /*234*/, 65536*16* 0.035323155364389396 /*235*/, 65536*16* 0.03690623176571385 /*236*/, 65536*16* 0.03829630932788767 /*237*/, 65536*16* 0.03947846623700253 /*238*/, 65536*16* 0.040439953107911 /*239*/, 65536*16* 0.0411703612762271 /*240*/, 65536*16* 0.04166176091370756 /*241*/, 65536*16* 0.041908806136461134 }; /* Parks-McClellan FIR Filter Design Filter type: Low pass Passband: 0 - 0.01804395 Order: 483 Passband ripple: 0.01 dB Transition band: 0.0108263 Stopband attenuation: 114.0 dB Coefficients: */ static int32 C96000PAL[NCOEFFS/2]= { /*0*/ 65536*16* 3.850781559466991E-7 /*1*/, 65536*16* -1.280019401722687E-6 /*2*/, 65536*16* -1.3004583488088965E-6 /*3*/, 65536*16* -1.7523167437749452E-6 /*4*/, 65536*16* -2.410249470764872E-6 /*5*/, 65536*16* -3.2346426554155092E-6 /*6*/, 65536*16* -4.227271662321092E-6 /*7*/, 65536*16* -5.3971678027414914E-6 /*8*/, 65536*16* -6.753444785567694E-6 /*9*/, 65536*16* -8.302128790766257E-6 /*10*/, 65536*16* -1.0045896006160685E-5 /*11*/, 65536*16* -1.1982368218542129E-5 /*12*/, 65536*16* -1.4104296519058353E-5 /*13*/, 65536*16* -1.6397945806910793E-5 /*14*/, 65536*16* -1.8843550708827064E-5 /*15*/, 65536*16* -2.1413952016264175E-5 /*16*/, 65536*16* -2.407540699773165E-5 /*17*/, 65536*16* -2.6786418491045868E-5 /*18*/, 65536*16* -2.949883620881563E-5 /*19*/, 65536*16* -3.215685693993941E-5 /*20*/, 65536*16* -3.4698621200866915E-5 /*21*/, 65536*16* -3.7055635055088747E-5 /*22*/, 65536*16* -3.915516367387583E-5 /*23*/, 65536*16* -4.092005046973106E-5 /*24*/, 65536*16* -4.227173792151256E-5 /*25*/, 65536*16* -4.313002076491602E-5 /*26*/, 65536*16* -4.3416606424857764E-5 /*27*/, 65536*16* -4.3054793786740716E-5 /*28*/, 65536*16* -4.1974462257106624E-5 /*29*/, 65536*16* -4.011236719136458E-5 /*30*/, 65536*16* -3.7415159397597796E-5 /*31*/, 65536*16* -3.3846213818414235E-5 /*32*/, 65536*16* -2.9372757531099172E-5 /*33*/, 65536*16* -2.3989695934591954E-5 /*34*/, 65536*16* -1.7705989252101064E-5 /*35*/, 65536*16* -1.0551320217411096E-5 /*36*/, 65536*16* -2.5775325043216536E-6 /*37*/, 65536*16* 6.139645766572715E-6 /*38*/, 65536*16* 1.5501423038008354E-5 /*39*/, 65536*16* 2.5384753820737575E-5 /*40*/, 65536*16* 3.5643398684518664E-5 /*41*/, 65536*16* 4.6108393091574726E-5 /*42*/, 65536*16* 5.659011526249589E-5 /*43*/, 65536*16* 6.68803323899828E-5 /*44*/, 65536*16* 7.675537622878941E-5 /*45*/, 65536*16* 8.597960059720824E-5 /*46*/, 65536*16* 9.430960279897814E-5 /*47*/, 65536*16* 1.0149893801465577E-4 /*48*/, 65536*16* 1.0730328189856642E-4 /*49*/, 65536*16* 1.1148622997923174E-4 /*50*/, 65536*16* 1.1382511217545132E-4 /*51*/, 65536*16* 1.141174295909343E-4 /*52*/, 65536*16* 1.1218671460549208E-4 /*53*/, 65536*16* 1.078890398041802E-4 /*54*/, 65536*16* 1.0111839925160891E-4 /*55*/, 65536*16* 9.181292532691402E-5 /*56*/, 65536*16* 7.995923739813694E-5 /*57*/, 65536*16* 6.559772591687974E-5 /*58*/, 65536*16* 4.882471526869663E-5 /*59*/, 65536*16* 2.9795861807919456E-5 /*60*/, 65536*16* 8.727003235393024E-6 /*61*/, 65536*16* -1.4106777294769694E-5 /*62*/, 65536*16* -3.836880959229582E-5 /*63*/, 65536*16* -6.366921149307032E-5 /*64*/, 65536*16* -8.956481187350594E-5 /*65*/, 65536*16* -1.1556632861786434E-4 /*66*/, 65536*16* -1.411455941949306E-4 /*67*/, 65536*16* -1.657445386231986E-4 /*68*/, 65536*16* -1.8878427001863077E-4 /*69*/, 65536*16* -2.0967688285495866E-4 /*70*/, 65536*16* -2.2783715638612827E-4 /*71*/, 65536*16* -2.4269587549180196E-4 /*72*/, 65536*16* -2.5371305459897316E-4 /*73*/, 65536*16* -2.603919787720978E-4 /*74*/, 65536*16* -2.6229284265917287E-4 /*75*/, 65536*16* -2.59046413963889E-4 /*76*/, 65536*16* -2.503668396740634E-4 /*77*/, 65536*16* -2.3606367328604213E-4 /*78*/, 65536*16* -2.160524966650091E-4 /*79*/, 65536*16* -1.903639226156617E-4 /*80*/, 65536*16* -1.59150691014015E-4 /*81*/, 65536*16* -1.2269241610349266E-4 /*82*/, 65536*16* -8.139812226735764E-5 /*83*/, 65536*16* -3.5805772732231955E-5 /*84*/, 65536*16* 1.3420603339835859E-5 /*85*/, 65536*16* 6.549742374431074E-5 /*86*/, 65536*16* 1.1953033076822495E-4 /*87*/, 65536*16* 1.745269622757623E-4 /*88*/, 65536*16* 2.2941123586808386E-4 /*89*/, 65536*16* 2.830419125977025E-4 /*90*/, 65536*16* 3.3423267917052983E-4 /*91*/, 65536*16* 3.81774499172079E-4 /*92*/, 65536*16* 4.244616654237554E-4 /*93*/, 65536*16* 4.611154134679936E-4 /*94*/, 65536*16* 4.906128810250551E-4 /*95*/, 65536*16* 5.119138315653597E-4 /*96*/, 65536*16* 5.240878477917174E-4 /*97*/, 65536*16* 5.263406012974186E-4 /*98*/, 65536*16* 5.180395272684202E-4 /*99*/, 65536*16* 4.987363674123535E-4 /*100*/, 65536*16* 4.681879119879578E-4 /*101*/, 65536*16* 4.263728836819278E-4 /*102*/, 65536*16* 3.735054898141368E-4 /*103*/, 65536*16* 3.1004425441119956E-4 /*104*/, 65536*16* 2.3669640454159868E-4 /*105*/, 65536*16* 1.5441686754990788E-4 /*106*/, 65536*16* 6.440207419421148E-5 /*107*/, 65536*16* -3.192198333335273E-5 /*108*/, 65536*16* -1.3291717686663037E-4 /*109*/, 65536*16* -2.3675627296534203E-4 /*110*/, 65536*16* -3.414512496033162E-4 /*111*/, 65536*16* -4.4488659997924806E-4 /*112*/, 65536*16* -5.44857304239037E-4 /*113*/, 65536*16* -6.391106241040588E-4 /*114*/, 65536*16* -7.253914361418537E-4 /*115*/, 65536*16* -8.0148962040363E-4 /*116*/, 65536*16* -8.652895191393541E-4 /*117*/, 65536*16* -9.148193159968953E-4 /*118*/, 65536*16* -9.483009583169883E-4 /*119*/, 65536*16* -9.64197392644944E-4 /*120*/, 65536*16* -9.612579850877552E-4 /*121*/, 65536*16* -9.385600118624972E-4 /*122*/, 65536*16* -8.955444281498081E-4 /*123*/, 65536*16* -8.320477398703453E-4 /*124*/, 65536*16* -7.483247067952744E-4 /*125*/, 65536*16* -6.450648142040654E-4 /*126*/, 65536*16* -5.234000259248345E-4 /*127*/, 65536*16* -3.8490357943433983E-4 /*128*/, 65536*16* -2.3157879639504726E-4 /*129*/, 65536*16* -6.583909529283622E-5 /*130*/, 65536*16* 1.0952239530879758E-4 /*131*/, 65536*16* 2.9137227027685464E-4 /*132*/, 65536*16* 4.76285797012954E-4 /*133*/, 65536*16* 6.606041066674581E-4 /*134*/, 65536*16* 8.404993785845289E-4 /*135*/, 65536*16* 0.0010120465600366754 /*136*/, 65536*16* 0.00117130077980147 /*137*/, 65536*16* 0.0013143787565297594 /*138*/, 65536*16* 0.0014375429397231808 /*139*/, 65536*16* 0.0015372865339524395 /*140*/, 65536*16* 0.0016104178085955662 /*141*/, 65536*16* 0.0016541417860661317 /*142*/, 65536*16* 0.0016661374441763997 /*143*/, 65536*16* 0.0016446287155235182 /*144*/, 65536*16* 0.0015884472759871292 /*145*/, 65536*16* 0.0014970858621845143 /*146*/, 65536*16* 0.0013707399310406382 /*147*/, 65536*16* 0.0012103371052757787 /*148*/, 65536*16* 0.0010175519857289184 /*149*/, 65536*16* 7.94807053668863E-4 /*150*/, 65536*16* 5.452573395422002E-4 /*151*/, 65536*16* 2.727594075846488E-4 /*152*/, 65536*16* -1.8175144027827955E-5 /*153*/, 65536*16* -3.2244298920455907E-4 /*154*/, 65536*16* -6.344261333752713E-4 /*155*/, 65536*16* -9.480839637356165E-4 /*156*/, 65536*16* -0.001257058056943197 /*157*/, 65536*16* -0.001554788246611654 /*158*/, 65536*16* -0.001834637661184569 /*159*/, 65536*16* -0.0020900256934556468 /*160*/, 65536*16* -0.0023145651572872143 /*161*/, 65536*16* -0.0025022020560114683 /*162*/, 65536*16* -0.002647354498854991 /*163*/, 65536*16* -0.002745048447695108 /*164*/, 65536*16* -0.0027910469441460657 /*165*/, 65536*16* -0.002781970255972488 /*166*/, 65536*16* -0.0027154038464012363 /*167*/, 65536*16* -0.002589991713387623 /*168*/, 65536*16* -0.0024055123883779776 /*169*/, 65536*16* -0.0021629354924022053 /*170*/, 65536*16* -0.0018644567566629092 /*171*/, 65536*16* -0.0015135100031795994 /*172*/, 65536*16* -0.0011147548631940517 /*173*/, 65536*16* -6.740394224166433E-4 /*174*/, 65536*16* -1.9833762845333352E-4 /*175*/, 65536*16* 3.043386309556266E-4 /*176*/, 65536*16* 8.250516255359581E-4 /*177*/, 65536*16* 0.0013540734762851313 /*178*/, 65536*16* 0.0018810427835111666 /*179*/, 65536*16* 0.002395141352428365 /*180*/, 65536*16* 0.002885286937512414 /*181*/, 65536*16* 0.0033403397957704442 /*182*/, 65536*16* 0.003749319662913449 /*183*/, 65536*16* 0.00410162844368435 /*184*/, 65536*16* 0.00438727601255591 /*185*/, 65536*16* 0.004597103692808949 /*186*/, 65536*16* 0.004723001540295747 /*187*/, 65536*16* 0.004758115147888017 /*188*/, 65536*16* 0.0046970379302800494 /*189*/, 65536*16* 0.0045359837766146575 /*190*/, 65536*16* 0.004272937350956345 /*191*/, 65536*16* 0.003907777448988567 /*192*/, 65536*16* 0.0034423707924944227 /*193*/, 65536*16* 0.0028806330094231125 /*194*/, 65536*16* 0.0022285548928660825 /*195*/, 65536*16* 0.0014941919971143964 /*196*/, 65536*16* 6.876167025638233E-4 /*197*/, 65536*16* -1.7916781098860902E-4 /*198*/, 65536*16* -0.001092351250031068 /*199*/, 65536*16* -0.002036476651580642 /*200*/, 65536*16* -0.002994635788760751 /*201*/, 65536*16* -0.003948697212655613 /*202*/, 65536*16* -0.004879563858611486 /*203*/, 65536*16* -0.005767456511229176 /*204*/, 65536*16* -0.006592218979894068 /*205*/, 65536*16* -0.007333640031607341 /*206*/, 65536*16* -0.007971787269457032 /*207*/, 65536*16* -0.008487346947516187 /*208*/, 65536*16* -0.008861964740105959 /*209*/, 65536*16* -0.009078580419089913 /*210*/, 65536*16* -0.009121751784315056 /*211*/, 65536*16* -0.008977961157199062 /*212*/, 65536*16* -0.008635898786325313 /*213*/, 65536*16* -0.008086718339557295 /*214*/, 65536*16* -0.007324258683042848 /*215*/, 65536*16* -0.0063452279676933475 /*216*/, 65536*16* -0.005149346015761238 /*217*/, 65536*16* -0.0037394415039958702 /*218*/, 65536*16* -0.0021215012056140783 /*219*/, 65536*16* -3.046703636518387E-4 /*220*/, 65536*16* 0.0016987979320526618 /*221*/, 65536*16* 0.0038736435001752246 /*222*/, 65536*16* 0.006201749792159754 /*223*/, 65536*16* 0.00866234250983842 /*224*/, 65536*16* 0.011232233932071251 /*225*/, 65536*16* 0.013886109426908738 /*226*/, 65536*16* 0.016596852190097027 /*227*/, 65536*16* 0.01933590131308301 /*228*/, 65536*16* 0.022073637826085922 /*229*/, 65536*16* 0.024779792715016697 /*230*/, 65536*16* 0.027423870545765342 /*231*/, 65536*16* 0.029975581949125456 /*232*/, 65536*16* 0.03240527801144671 /*233*/, 65536*16* 0.034684379593278115 /*234*/, 65536*16* 0.03678579448103684 /*235*/, 65536*16* 0.03868431571442653 /*236*/, 65536*16* 0.04035699420925718 /*237*/, 65536*16* 0.041783479941480954 /*238*/, 65536*16* 0.04294632536294341 /*239*/, 65536*16* 0.043831247006285705 /*240*/, 65536*16* 0.044427339714649856 /*241*/, 65536*16* 0.04472724072106236 }; /* Parks-McClellan FIR Filter Design Filter type: Low pass Passband: 0 - 0.0077845 Order: 483 Passband ripple: 0.1 dB Transition band: 0.005625 Stopband attenuation: 60.0 dB */ static int32 C48000NTSC[NCOEFFS/2]= { /*0*/ 65536*16* -1.2211019733097893E-4 /*1*/ , 65536*16* 5.374660789759626E-4 /*2*/ , 65536*16* 1.9882723274804067E-4 /*3*/ , 65536*16* 1.3631041618360223E-4 /*4*/ , 65536*16* 1.3153691128499229E-4 /*5*/ , 65536*16* 1.3886281724158703E-4 /*6*/ , 65536*16* 1.4887278966773673E-4 /*7*/ , 65536*16* 1.5943890243162037E-4 /*8*/ , 65536*16* 1.7020639605259616E-4 /*9*/ , 65536*16* 1.809192079749018E-4 /*10*/ , 65536*16* 1.9162093203709557E-4 /*11*/ , 65536*16* 2.02127312351196E-4 /*12*/ , 65536*16* 2.1249848894399555E-4 /*13*/ , 65536*16* 2.2254095363111247E-4 /*14*/ , 65536*16* 2.323202963851337E-4 /*15*/ , 65536*16* 2.4163344759163413E-4 /*16*/ , 65536*16* 2.505472122265602E-4 /*17*/ , 65536*16* 2.5885306226458603E-4 /*18*/ , 65536*16* 2.6660828860384193E-4 /*19*/ , 65536*16* 2.736061193417779E-4 /*20*/ , 65536*16* 2.79907587492226E-4 /*21*/ , 65536*16* 2.852884076207648E-4 /*22*/ , 65536*16* 2.898305905338908E-4 /*23*/ , 65536*16* 2.93305922863925E-4 /*24*/ , 65536*16* 2.958004341042564E-4 /*25*/ , 65536*16* 2.9706939623100196E-4 /*26*/ , 65536*16* 2.972508466837626E-4 /*27*/ , 65536*16* 2.960684730022295E-4 /*28*/ , 65536*16* 2.937123123731801E-4 /*29*/ , 65536*16* 2.898634667442807E-4 /*30*/ , 65536*16* 2.8478700978604426E-4 /*31*/ , 65536*16* 2.7808505097364714E-4 /*32*/ , 65536*16* 2.7016032300539216E-4 /*33*/ , 65536*16* 2.6042025835357706E-4 /*34*/ , 65536*16* 2.496053090718662E-4 /*35*/ , 65536*16* 2.3660011363209167E-4 /*36*/ , 65536*16* 2.228827056917728E-4 /*37*/ , 65536*16* 2.0662381151599093E-4 /*38*/ , 65536*16* 1.8946729340692708E-4 /*39*/ , 65536*16* 1.707894290302382E-4 /*40*/ , 65536*16* 1.4964075656329285E-4 /*41*/ , 65536*16* 1.2806315562352013E-4 /*42*/ , 65536*16* 1.0470129333132878E-4 /*43*/ , 65536*16* 7.952742687952367E-5 /*44*/ , 65536*16* 5.3080519892589936E-5 /*45*/ , 65536*16* 2.5960680465529317E-5 /*46*/ , 65536*16* -2.5651586484338896E-6 /*47*/ , 65536*16* -3.248840068536756E-5 /*48*/ , 65536*16* -6.374045088088799E-5 /*49*/ , 65536*16* -9.575401529845337E-5 /*50*/ , 65536*16* -1.2853435644071695E-4 /*51*/ , 65536*16* -1.6188456243132127E-4 /*52*/ , 65536*16* -1.9591394048834482E-4 /*53*/ , 65536*16* -2.3037663947407175E-4 /*54*/ , 65536*16* -2.6523734278928246E-4 /*55*/ , 65536*16* -3.0020331327926296E-4 /*56*/ , 65536*16* -3.352268879856044E-4 /*57*/ , 65536*16* -3.700260022275662E-4 /*58*/ , 65536*16* -4.045571559416333E-4 /*59*/ , 65536*16* -4.38534577720557E-4 /*60*/ , 65536*16* -4.718927645081437E-4 /*61*/ , 65536*16* -5.043317033789757E-4 /*62*/ , 65536*16* -5.357994753678582E-4 /*63*/ , 65536*16* -5.659671580788766E-4 /*64*/ , 65536*16* -5.947897013020397E-4 /*65*/ , 65536*16* -6.219384666963997E-4 /*66*/ , 65536*16* -6.473787936195385E-4 /*67*/ , 65536*16* -6.707514595741775E-4 /*68*/ , 65536*16* -6.920680579893526E-4 /*69*/ , 65536*16* -7.109402066802999E-4 /*70*/ , 65536*16* -7.274298271538291E-4 /*71*/ , 65536*16* -7.411375648954899E-4 /*72*/ , 65536*16* -7.520788343347275E-4 /*73*/ , 65536*16* -7.600510659768832E-4 /*74*/ , 65536*16* -7.647430899316486E-4 /*75*/ , 65536*16* -7.664294191482773E-4 /*76*/ , 65536*16* -7.644147173692687E-4 /*77*/ , 65536*16* -7.590920613362674E-4 /*78*/ , 65536*16* -7.501459543641885E-4 /*79*/ , 65536*16* -7.373621082253133E-4 /*80*/ , 65536*16* -7.208964561671388E-4 /*81*/ , 65536*16* -7.006901755632023E-4 /*82*/ , 65536*16* -6.764591748580997E-4 /*83*/ , 65536*16* -6.483697284795448E-4 /*84*/ , 65536*16* -6.164929718400197E-4 /*85*/ , 65536*16* -5.806918766677904E-4 /*86*/ , 65536*16* -5.409344735839229E-4 /*87*/ , 65536*16* -4.97405373620265E-4 /*88*/ , 65536*16* -4.502086002815554E-4 /*89*/ , 65536*16* -3.9932330033988294E-4 /*90*/ , 65536*16* -3.448028565721092E-4 /*91*/ , 65536*16* -2.8685420307046736E-4 /*92*/ , 65536*16* -2.256958038579715E-4 /*93*/ , 65536*16* -1.615040528190604E-4 /*94*/ , 65536*16* -9.438524808984473E-5 /*95*/ , 65536*16* -2.4519303584370608E-5 /*96*/ , 65536*16* 4.786961616483501E-5 /*97*/ , 65536*16* 1.2248011782462745E-4 /*98*/ , 65536*16* 1.990534978611127E-4 /*99*/ , 65536*16* 2.7728245405517893E-4 /*100*/ , 65536*16* 3.5690342407690407E-4 /*101*/ , 65536*16* 4.376002679601721E-4 /*102*/ , 65536*16* 5.19047629492113E-4 /*103*/ , 65536*16* 6.008846564336277E-4 /*104*/ , 65536*16* 6.827617063818499E-4 /*105*/ , 65536*16* 7.643160551093983E-4 /*106*/ , 65536*16* 8.451272011819538E-4 /*107*/ , 65536*16* 9.248890776355356E-4 /*108*/ , 65536*16* 0.001003072355955673 /*109*/ , 65536*16* 0.0010794672777372975 /*110*/ , 65536*16* 0.0011534276232606116 /*111*/ , 65536*16* 0.0012247823207262698 /*112*/ , 65536*16* 0.0012929541324917778 /*113*/ , 65536*16* 0.001357585199795128 /*114*/ , 65536*16* 0.001418338397346014 /*115*/ , 65536*16* 0.0014746734285279383 /*116*/ , 65536*16* 0.0015262884930771822 /*117*/ , 65536*16* 0.0015728226550844923 /*118*/ , 65536*16* 0.00161379655898045 /*119*/ , 65536*16* 0.001648915948444658 /*120*/ , 65536*16* 0.0016778840108713717 /*121*/ , 65536*16* 0.0017002560629258679 /*122*/ , 65536*16* 0.0017157641984855009 /*123*/ , 65536*16* 0.0017241805985007432 /*124*/ , 65536*16* 0.001725182645995729 /*125*/ , 65536*16* 0.0017184841648036691 /*126*/ , 65536*16* 0.0017039216808435336 /*127*/ , 65536*16* 0.001681334520841587 /*128*/ , 65536*16* 0.0016504918660173195 /*129*/ , 65536*16* 0.0016112687597971862 /*130*/ , 65536*16* 0.0015636063248128528 /*131*/ , 65536*16* 0.0015074624593932396 /*132*/ , 65536*16* 0.0014427699009003175 /*133*/ , 65536*16* 0.001369527394628539 /*134*/ , 65536*16* 0.0012878043567412672 /*135*/ , 65536*16* 0.0011977101442406943 /*136*/ , 65536*16* 0.0010993686954177168 /*137*/ , 65536*16* 9.928872878864818E-4 /*138*/ , 65536*16* 8.784941174786496E-4 /*139*/ , 65536*16* 7.564288883294911E-4 /*140*/ , 65536*16* 6.270372159510238E-4 /*141*/ , 65536*16* 4.905983779660314E-4 /*142*/ , 65536*16* 3.4754116793679786E-4 /*143*/ , 65536*16* 1.9816162887093084E-4 /*144*/ , 65536*16* 4.300342678121075E-5 /*145*/ , 65536*16* -1.1751370467978956E-4 /*146*/ , 65536*16* -2.8280605795854083E-4 /*147*/ , 65536*16* -4.523173545514795E-4 /*148*/ , 65536*16* -6.255041797790695E-4 /*149*/ , 65536*16* -8.016355996557292E-4 /*150*/ , 65536*16* -9.801573426762404E-4 /*151*/ , 65536*16* -0.0011602954820678437 /*152*/ , 65536*16* -0.001341343986206184 /*153*/ , 65536*16* -0.001522571621631356 /*154*/ , 65536*16* -0.001703172768158951 /*155*/ , 65536*16* -0.0018823360844618293 /*156*/ , 65536*16* -0.00205930337901632 /*157*/ , 65536*16* -0.0022331579230920632 /*158*/ , 65536*16* -0.002403069015327 /*159*/ , 65536*16* -0.0025682175666884455 /*160*/ , 65536*16* -0.002727682820990084 /*161*/ , 65536*16* -0.002880584481539458 /*162*/ , 65536*16* -0.003026077683940661 /*163*/ , 65536*16* -0.00316326704154516 /*164*/ , 65536*16* -0.003291235176827385 /*165*/ , 65536*16* -0.0034091436232751705 /*166*/ , 65536*16* -0.0035161624262765347 /*167*/ , 65536*16* -0.00361139707788214 /*168*/ , 65536*16* -0.0036940241232429707 /*169*/ , 65536*16* -0.003763249197925811 /*170*/ , 65536*16* -0.0038183138554794805 /*171*/ , 65536*16* -0.003858413648517434 /*172*/ , 65536*16* -0.0038828565696081884 /*173*/ , 65536*16* -0.0038909308779192654 /*174*/ , 65536*16* -0.0038820231307916493 /*175*/ , 65536*16* -0.0038554750792844325 /*176*/ , 65536*16* -0.003810737282493679 /*177*/ , 65536*16* -0.003747262375484652 /*178*/ , 65536*16* -0.0036646285078894706 /*179*/ , 65536*16* -0.0035623728689170597 /*180*/ , 65536*16* -0.0034401218523635543 /*181*/ , 65536*16* -0.003297594128579178 /*182*/ , 65536*16* -0.0031344918897463427 /*183*/ , 65536*16* -0.0029506999116335536 /*184*/ , 65536*16* -0.002746012743503227 /*185*/ , 65536*16* -0.0025204082871514897 /*186*/ , 65536*16* -0.0022738407863853822 /*187*/ , 65536*16* -0.0020063873037173175 /*188*/ , 65536*16* -0.0017182175415557032 /*189*/ , 65536*16* -0.0014095092681882975 /*190*/ , 65536*16* -0.0010805220633352567 /*191*/ , 65536*16* -7.316077716348434E-4 /*192*/ , 65536*16* -3.631468249678417E-4 /*193*/ , 65536*16* 2.438177178474359E-5 /*194*/ , 65536*16* 4.3040711526763105E-4 /*195*/ , 65536*16* 8.543758511240976E-4 /*196*/ , 65536*16* 0.0012955688715509065 /*197*/ , 65536*16* 0.0017532574138845757 /*198*/ , 65536*16* 0.0022266720975588176 /*199*/ , 65536*16* 0.0027149312534676365 /*200*/ , 65536*16* 0.003217102703811305 /*201*/ , 65536*16* 0.0037322302087511496 /*202*/ , 65536*16* 0.004259307964559864 /*203*/ , 65536*16* 0.004797205731205993 /*204*/ , 65536*16* 0.00534482556712745 /*205*/ , 65536*16* 0.00590099232932727 /*206*/ , 65536*16* 0.0064644836497811 /*207*/ , 65536*16* 0.007034017389280477 /*208*/ , 65536*16* 0.007608353016621833 /*209*/ , 65536*16* 0.008186157965561618 /*210*/ , 65536*16* 0.008766068964147668 /*211*/ , 65536*16* 0.009346716260147759 /*212*/ , 65536*16* 0.009926718862388615 /*213*/ , 65536*16* 0.010504681043184161 /*214*/ , 65536*16* 0.01107917387309342 /*215*/ , 65536*16* 0.011648797102049465 /*216*/ , 65536*16* 0.012212089485935572 /*217*/ , 65536*16* 0.012767702033610684 /*218*/ , 65536*16* 0.01331416222058608 /*219*/ , 65536*16* 0.013850107485964188 /*220*/ , 65536*16* 0.01437415626494087 /*221*/ , 65536*16* 0.01488494484218882 /*222*/ , 65536*16* 0.015381157046388828 /*223*/ , 65536*16* 0.015861470914555698 /*224*/ , 65536*16* 0.016324639468324405 /*225*/ , 65536*16* 0.01676942738258265 /*226*/ , 65536*16* 0.017194657140859698 /*227*/ , 65536*16* 0.01759919326505855 /*228*/ , 65536*16* 0.01798195744932672 /*229*/ , 65536*16* 0.018341882104229386 /*230*/ , 65536*16* 0.018678046774501487 /*231*/ , 65536*16* 0.018989525183852277 /*232*/ , 65536*16* 0.019275463483745325 /*233*/ , 65536*16* 0.019535099985330217 /*234*/ , 65536*16* 0.019767681230128092 /*235*/ , 65536*16* 0.019972616359274192 /*236*/ , 65536*16* 0.02014933369102741 /*237*/ , 65536*16* 0.020297350637687013 /*238*/ , 65536*16* 0.020416241350314838 /*239*/ , 65536*16* 0.020505719050281913 /*240*/ , 65536*16* 0.020565502954380747 /*241*/ , 65536*16* 0.02059542406883178 }; /* 44100 NTSC Parks-McClellan FIR Filter Design Filter type: Low pass Passband: 0 - 0.006695 Order: 483 Passband ripple: 0.2 dB Transition band: 0.005625 Stopband attenuation: 66.4 dB Coefficients: */ static int32 C44100NTSC[NCOEFFS/2]= { /*0*/ 65536 *16 * 2.7250584077004043E-4 /*1*/, 65536 *16 * -5.6651407794062126E-5 /*2*/, 65536 *16 * -5.387595203270082E-5 /*3*/, 65536 *16 * -5.3104114528112036E-5 /*4*/, 65536 *16 * -5.3927905431407917E-5 /*5*/, 65536 *16 * -5.624810531844495E-5 /*6*/, 65536 *16 * -5.9753966587005594E-5 /*7*/, 65536 *16 * -6.443298022976466E-5 /*8*/, 65536 *16 * -7.002861393823279E-5 /*9*/, 65536 *16 * -7.658937335809571E-5 /*10*/, 65536 *16 * -8.388337472693157E-5 /*11*/, 65536 *16 * -9.20081628039712E-5 /*12*/, 65536 *16 * -1.007311169050114E-4 /*13*/, 65536 *16 * -1.1019992230503533E-4 /*14*/, 65536 *16 * -1.2014773803429516E-4 /*15*/, 65536 *16 * -1.3080398984366903E-4 /*16*/, 65536 *16 * -1.4175865072457003E-4 /*17*/, 65536 *16 * -1.536527853404198E-4 /*18*/, 65536 *16 * -1.6517054562524376E-4 /*19*/, 65536 *16 * -1.7797585116596963E-4 /*20*/, 65536 *16 * -1.909845496405445E-4 /*21*/, 65536 *16 * -2.0389566936141008E-4 /*22*/, 65536 *16 * -2.1726846302640957E-4 /*23*/, 65536 *16 * -2.310008165840215E-4 /*24*/, 65536 *16 * -2.4506881863360544E-4 /*25*/, 65536 *16 * -2.5926465655995895E-4 /*26*/, 65536 *16 * -2.735381275272462E-4 /*27*/, 65536 *16 * -2.878190904612406E-4 /*28*/, 65536 *16 * -3.0209388781875723E-4 /*29*/, 65536 *16 * -3.163448868528516E-4 /*30*/, 65536 *16 * -3.30514980542584E-4 /*31*/, 65536 *16 * -3.4458721564408845E-4 /*32*/, 65536 *16 * -3.5843761692424506E-4 /*33*/, 65536 *16 * -3.720823326733447E-4 /*34*/, 65536 *16 * -3.8529611278848583E-4 /*35*/, 65536 *16 * -3.982435971141635E-4 /*36*/, 65536 *16 * -4.1054225307421383E-4 /*37*/, 65536 *16 * -4.223385042208698E-4 /*38*/, 65536 *16 * -4.3363210365443626E-4 /*39*/, 65536 *16 * -4.440451096331875E-4 /*40*/, 65536 *16 * -4.537334227294333E-4 /*41*/, 65536 *16 * -4.6260960194346025E-4 /*42*/, 65536 *16 * -4.706224417116799E-4 /*43*/, 65536 *16 * -4.776010427698281E-4 /*44*/, 65536 *16 * -4.8350610346281614E-4 /*45*/, 65536 *16 * -4.8826489934975626E-4 /*46*/, 65536 *16 * -4.918511387810396E-4 /*47*/, 65536 *16 * -4.941839548845786E-4 /*48*/, 65536 *16 * -4.95186572618022E-4 /*49*/, 65536 *16 * -4.947817087436606E-4 /*50*/, 65536 *16 * -4.928828353341973E-4 /*51*/, 65536 *16 * -4.894676199661217E-4 /*52*/, 65536 *16 * -4.8443244774343773E-4 /*53*/, 65536 *16 * -4.778002134883142E-4 /*54*/, 65536 *16 * -4.694896704084311E-4 /*55*/, 65536 *16 * -4.593928438902496E-4 /*56*/, 65536 *16 * -4.4763586771533415E-4 /*57*/, 65536 *16 * -4.3399559196764174E-4 /*58*/, 65536 *16 * -4.185187519793231E-4 /*59*/, 65536 *16 * -4.0118338859945383E-4 /*60*/, 65536 *16 * -3.820043675631783E-4 /*61*/, 65536 *16 * -3.6090543967085524E-4 /*62*/, 65536 *16 * -3.379128204177913E-4 /*63*/, 65536 *16 * -3.130247503897743E-4 /*64*/, 65536 *16 * -2.8628759491904673E-4 /*65*/, 65536 *16 * -2.5769205396918157E-4 /*66*/, 65536 *16 * -2.2726228845123853E-4 /*67*/, 65536 *16 * -1.9501222414998665E-4 /*68*/, 65536 *16 * -1.609903786128509E-4 /*69*/, 65536 *16 * -1.2525258280646142E-4 /*70*/, 65536 *16 * -8.786088130641809E-5 /*71*/, 65536 *16 * -4.885883411475722E-5 /*72*/, 65536 *16 * -8.373566315346232E-6 /*73*/, 65536 *16 * 3.362843819360238E-5 /*74*/, 65536 *16 * 7.69302822233031E-5 /*75*/, 65536 *16 * 1.2151249228835434E-4 /*76*/, 65536 *16 * 1.6724878315058612E-4 /*77*/, 65536 *16 * 2.1402171363813576E-4 /*78*/, 65536 *16 * 2.6167305946436103E-4 /*79*/, 65536 *16 * 3.10122854445744E-4 /*80*/, 65536 *16 * 3.5921866691687363E-4 /*81*/, 65536 *16 * 4.0882826181233784E-4 /*82*/, 65536 *16 * 4.5876834733749337E-4 /*83*/, 65536 *16 * 5.089048509923103E-4 /*84*/, 65536 *16 * 5.590621717784201E-4 /*85*/, 65536 *16 * 6.090870406928206E-4 /*86*/, 65536 *16 * 6.587768488216395E-4 /*87*/, 65536 *16 * 7.079653533691067E-4 /*88*/, 65536 *16 * 7.56434905175643E-4 /*89*/, 65536 *16 * 8.040537989021466E-4 /*90*/, 65536 *16 * 8.505576158388297E-4 /*91*/, 65536 *16 * 8.958345533585908E-4 /*92*/, 65536 *16 * 9.396170235698547E-4 /*93*/, 65536 *16 * 9.817197600520506E-4 /*94*/, 65536 *16 * 0.0010219440113723856 /*95*/, 65536 *16 * 0.0010600976395277468 /*96*/, 65536 *16 * 0.0010959465933076378 /*97*/, 65536 *16 * 0.0011293213059753442 /*98*/, 65536 *16 * 0.001160012212002378 /*99*/, 65536 *16 * 0.0011878334518393636 /*100*/, 65536 *16 * 0.0012125633172564833 /*101*/, 65536 *16 * 0.0012340340153475305 /*102*/, 65536 *16 * 0.0012520523486154733 /*103*/, 65536 *16 * 0.001266464375255462 /*104*/, 65536 *16 * 0.001277070934117742 /*105*/, 65536 *16 * 0.0012837351142488396 /*106*/, 65536 *16 * 0.0012862625405968798 /*107*/, 65536 *16 * 0.0012845614834936406 /*108*/, 65536 *16 * 0.0012784420593778636 /*109*/, 65536 *16 * 0.0012678178114382621 /*110*/, 65536 *16 * 0.0012525556826375537 /*111*/, 65536 *16 * 0.0012325473943852084 /*112*/, 65536 *16 * 0.0012077126268838676 /*113*/, 65536 *16 * 0.0011779966448355029 /*114*/, 65536 *16 * 0.0011433146771737655 /*115*/, 65536 *16 * 0.0011036347058885887 /*116*/, 65536 *16 * 0.0010589202139950945 /*117*/, 65536 *16 * 0.0010091683044254098 /*118*/, 65536 *16 * 9.543624468571229E-4 /*119*/, 65536 *16 * 8.945398819399117E-4 /*120*/, 65536 *16 * 8.297313883125644E-4 /*121*/, 65536 *16 * 7.600155199968718E-4 /*122*/, 65536 *16 * 6.854405952299358E-4 /*123*/, 65536 *16 * 6.061236114458317E-4 /*124*/, 65536 *16 * 5.221478191516476E-4 /*125*/, 65536 *16 * 4.336813620599164E-4 /*126*/, 65536 *16 * 3.408549526515998E-4 /*127*/, 65536 *16 * 2.438450825114285E-4 /*128*/, 65536 *16 * 1.428494911857926E-4 /*129*/, 65536 *16 * 3.8067640594361634E-5 /*130*/, 65536 *16 * -7.027035111775681E-5 /*131*/, 65536 *16 * -1.818984143827126E-4 /*132*/, 65536 *16 * -2.9656343184630157E-4 /*133*/, 65536 *16 * -4.1397802421901906E-4 /*134*/, 65536 *16 * -5.33838500742085E-4 /*135*/, 65536 *16 * -6.558110253978588E-4 /*136*/, 65536 *16 * -7.795655816897978E-4 /*137*/, 65536 *16 * -9.047371821667003E-4 /*138*/, 65536 *16 * -0.001030961345825847 /*139*/, 65536 *16 * -0.0011578367988084777 /*140*/, 65536 *16 * -0.0012849810572319298 /*141*/, 65536 *16 * -0.0014119662266064482 /*142*/, 65536 *16 * -0.0015383759515758101 /*143*/, 65536 *16 * -0.001663756794188296 /*144*/, 65536 *16 * -0.0017876541594460456 /*145*/, 65536 *16 * -0.001909621722046808 /*146*/, 65536 *16 * -0.0020291786719378088 /*147*/, 65536 *16 * -0.002145855089743562 /*148*/, 65536 *16 * -0.002259171910476534 /*149*/, 65536 *16 * -0.0023686314802222655 /*150*/, 65536 *16 * -0.002473745572697707 /*151*/, 65536 *16 * -0.0025740277587192853 /*152*/, 65536 *16 * -0.0026689831666099955 /*153*/, 65536 *16 * -0.0027581124255643377 /*154*/, 65536 *16 * -0.0028409282136656177 /*155*/, 65536 *16 * -0.0029169432593640367 /*156*/, 65536 *16 * -0.002985680612410139 /*157*/, 65536 *16 * -0.003046658228485494 /*158*/, 65536 *16 * -0.003099414222252269 /*159*/, 65536 *16 * -0.0031434902530511595 /*160*/, 65536 *16 * -0.003178436798255356 /*161*/, 65536 *16 * -0.0032038260756887147 /*162*/, 65536 *16 * -0.003219225355080285 /*163*/, 65536 *16 * -0.0032242502222488744 /*164*/, 65536 *16 * -0.003218506103318342 /*165*/, 65536 *16 * -0.003201625222636992 /*166*/, 65536 *16 * -0.003173259488065382 /*167*/, 65536 *16 * -0.0031330803817718332 /*168*/, 65536 *16 * -0.0030807779128908526 /*169*/, 65536 *16 * -0.0030160821637947783 /*170*/, 65536 *16 * -0.0029387362752889335 /*171*/, 65536 *16 * -0.002848510131379585 /*172*/, 65536 *16 * -0.0027451998188029363 /*173*/, 65536 *16 * -0.00262863682904045 /*174*/, 65536 *16 * -0.0024986780420415064 /*175*/, 65536 *16 * -0.0023552114528323513 /*176*/, 65536 *16 * -0.0021981491527779964 /*177*/, 65536 *16 * -0.0020274504745732714 /*178*/, 65536 *16 * -0.0018430877753141852 /*179*/, 65536 *16 * -0.0016450910502005863 /*180*/, 65536 *16 * -0.0014334955802048866 /*181*/, 65536 *16 * -0.0012083983821827642 /*182*/, 65536 *16 * -9.699135443572468E-4 /*183*/, 65536 *16 * -7.181935207475589E-4 /*184*/, 65536 *16 * -4.534224887286362E-4 /*185*/, 65536 *16 * -1.758311300125605E-4 /*186*/, 65536 *16 * 1.1433027008948132E-4 /*187*/, 65536 *16 * 4.1675921199616097E-4 /*188*/, 65536 *16 * 7.311320710094336E-4 /*189*/, 65536 *16 * 0.0010570872458505827 /*190*/, 65536 *16 * 0.0013942372682560795 /*191*/, 65536 *16 * 0.001742148094642797 /*192*/, 65536 *16 * 0.002100362793433286 /*193*/, 65536 *16 * 0.0024683818857210646 /*194*/, 65536 *16 * 0.002845695057494279 /*195*/, 65536 *16 * 0.0032317385772924275 /*196*/, 65536 *16 * 0.0036259433326630884 /*197*/, 65536 *16 * 0.0040276894120370626 /*198*/, 65536 *16 * 0.004436353627556968 /*199*/, 65536 *16 * 0.004851271439526238 /*200*/, 65536 *16 * 0.005271762758295799 /*201*/, 65536 *16 * 0.005697120565601845 /*202*/, 65536 *16 * 0.006126626859240469 /*203*/, 65536 *16 * 0.006559527746778011 /*204*/, 65536 *16 * 0.0069950693344747504 /*205*/, 65536 *16 * 0.007432470090915211 /*206*/, 65536 *16 * 0.007870944336430185 /*207*/, 65536 *16 * 0.008309688701943495 /*208*/, 65536 *16 * 0.008747898549370043 /*209*/, 65536 *16 * 0.009184747205291654 /*210*/, 65536 *16 * 0.009619414724898365 /*211*/, 65536 *16 * 0.010051063453485451 /*212*/, 65536 *16 * 0.010478876316671397 /*213*/, 65536 *16 * 0.010902016899039163 /*214*/, 65536 *16 * 0.011319665474466693 /*215*/, 65536 *16 * 0.011730992134403782 /*216*/, 65536 *16 * 0.012135186113163639 /*217*/, 65536 *16 * 0.01253143889871197 /*218*/, 65536 *16 * 0.012918956981226547 /*219*/, 65536 *16 * 0.013296952886747157 /*220*/, 65536 *16 * 0.013664665893392403 /*221*/, 65536 *16 * 0.014021339353548561 /*222*/, 65536 *16 * 0.014366244972764902 /*223*/, 65536 *16 * 0.014698670942210527 /*224*/, 65536 *16 * 0.015017930945351435 /*225*/, 65536 *16 * 0.015323359168800435 /*226*/, 65536 *16 * 0.015614322198635518 /*227*/, 65536 *16 * 0.015890204972590742 /*228*/, 65536 *16 * 0.016150433344740527 /*229*/, 65536 *16 * 0.01639445378257351 /*230*/, 65536 *16 * 0.016621758349582072 /*231*/, 65536 *16 * 0.01683186471138077 /*232*/, 65536 *16 * 0.01702432745775747 /*233*/, 65536 *16 * 0.017198732908190056 /*234*/, 65536 *16 * 0.017354710361561963 /*235*/, 65536 *16 * 0.017491928210652433 /*236*/, 65536 *16 * 0.017610096156964024 /*237*/, 65536 *16 * 0.017708958417438553 /*238*/, 65536 *16 * 0.017788304726419644 /*239*/, 65536 *16 * 0.01784796484627723 /*240*/, 65536 *16 * 0.017887808513528385 /*241*/, 65536 *16 * 0.01790775243433271 }; /* 48000 PAL Parks-McClellan FIR Filter Design Filter type: Low pass Passband: 0 - 0.008810 Order: 483 Passband ripple: 0.133 dB Transition band: 0.005625 Stopband attenuation: 63.0 dB Coefficients: */ static int32 C48000PAL[NCOEFFS/2]= { /*0*/ 65536 *16 * -4.8720337170268194E-4 /*1*/, 65536 *16 * 7.629902642634879E-7 /*2*/, 65536 *16 * 2.1378369687164975E-6 /*3*/, 65536 *16 * 4.2506426520122444E-6 /*4*/, 65536 *16 * 7.369889860416342E-6 /*5*/, 65536 *16 * 1.1216062943011637E-5 /*6*/, 65536 *16 * 1.6073843505677063E-5 /*7*/, 65536 *16 * 2.1633099120040373E-5 /*8*/, 65536 *16 * 2.8206508485377597E-5 /*9*/, 65536 *16 * 3.543629776593455E-5 /*10*/, 65536 *16 * 4.368764327716006E-5 /*11*/, 65536 *16 * 5.2518982409171E-5 /*12*/, 65536 *16 * 6.239757141317561E-5 /*13*/, 65536 *16 * 7.27096511997309E-5 /*14*/, 65536 *16 * 8.417180660805913E-5 /*15*/, 65536 *16 * 9.556951705928003E-5 /*16*/, 65536 *16 * 1.0902571193097876E-4 /*17*/, 65536 *16 * 1.227237340685471E-4 /*18*/, 65536 *16 * 1.3608963828565135E-4 /*19*/, 65536 *16 * 1.5074291732163737E-4 /*20*/, 65536 *16 * 1.654957671774518E-4 /*21*/, 65536 *16 * 1.8094544537755017E-4 /*22*/, 65536 *16 * 1.9650254639058925E-4 /*23*/, 65536 *16 * 2.124977005396817E-4 /*24*/, 65536 *16 * 2.2850169154416925E-4 /*25*/, 65536 *16 * 2.447269340662641E-4 /*26*/, 65536 *16 * 2.60813097374866E-4 /*27*/, 65536 *16 * 2.769089011403406E-4 /*28*/, 65536 *16 * 2.926838284872595E-4 /*29*/, 65536 *16 * 3.082587328683191E-4 /*30*/, 65536 *16 * 3.233018169377691E-4 /*31*/, 65536 *16 * 3.379664790017549E-4 /*32*/, 65536 *16 * 3.520147829064225E-4 /*33*/, 65536 *16 * 3.6489502104188965E-4 /*34*/, 65536 *16 * 3.771837837785839E-4 /*35*/, 65536 *16 * 3.8841744550992556E-4 /*36*/, 65536 *16 * 3.985152578693797E-4 /*37*/, 65536 *16 * 4.0737410559796126E-4 /*38*/, 65536 *16 * 4.1485052511765913E-4 /*39*/, 65536 *16 * 4.2087321591616255E-4 /*40*/, 65536 *16 * 4.252880030529943E-4 /*41*/, 65536 *16 * 4.2804175098790727E-4 /*42*/, 65536 *16 * 4.289792011350111E-4 /*43*/, 65536 *16 * 4.280677040429387E-4 /*44*/, 65536 *16 * 4.251526022872329E-4 /*45*/, 65536 *16 * 4.202312572840644E-4 /*46*/, 65536 *16 * 4.1313629237647344E-4 /*47*/, 65536 *16 * 4.0393669855985745E-4 /*48*/, 65536 *16 * 3.9229544134295797E-4 /*49*/, 65536 *16 * 3.785081882385653E-4 /*50*/, 65536 *16 * 3.624387298611128E-4 /*51*/, 65536 *16 * 3.439609793120755E-4 /*52*/, 65536 *16 * 3.2317107312926493E-4 /*53*/, 65536 *16 * 3.0001522643985015E-4 /*54*/, 65536 *16 * 2.7456037312211196E-4 /*55*/, 65536 *16 * 2.468022375847908E-4 /*56*/, 65536 *16 * 2.1682011116032351E-4 /*57*/, 65536 *16 * 1.846463359087917E-4 /*58*/, 65536 *16 * 1.5038519581308458E-4 /*59*/, 65536 *16 * 1.1409999503195986E-4 /*60*/, 65536 *16 * 7.592602477010921E-5 /*61*/, 65536 *16 * 3.594949037485983E-5 /*62*/, 65536 *16 * -5.654205953473915E-6 /*63*/, 65536 *16 * -4.8796158887641113E-5 /*64*/, 65536 *16 * -9.324450907374415E-5 /*65*/, 65536 *16 * -1.3875102646747199E-4 /*66*/, 65536 *16 * -1.853099936736042E-4 /*67*/, 65536 *16 * -2.3256519878196182E-4 /*68*/, 65536 *16 * -2.803629983423417E-4 /*69*/, 65536 *16 * -3.284299717573991E-4 /*70*/, 65536 *16 * -3.7655572805983734E-4 /*71*/, 65536 *16 * -4.244648731259925E-4 /*72*/, 65536 *16 * -4.7191652130487173E-4 /*73*/, 65536 *16 * -5.18626812434502E-4 /*74*/, 65536 *16 * -5.64334322901072E-4 /*75*/, 65536 *16 * -6.087503654593899E-4 /*76*/, 65536 *16 * -6.515995849807032E-4 /*77*/, 65536 *16 * -6.925935510204477E-4 /*78*/, 65536 *16 * -7.314432865833455E-4 /*79*/, 65536 *16 * -7.678735923848921E-4 /*80*/, 65536 *16 * -8.015359919770463E-4 /*81*/, 65536 *16 * -8.322768680565776E-4 /*82*/, 65536 *16 * -8.597539203190856E-4 /*83*/, 65536 *16 * -8.836879776280238E-4 /*84*/, 65536 *16 * -9.038629010388075E-4 /*85*/, 65536 *16 * -9.200080217158554E-4 /*86*/, 65536 *16 * -9.319235257639778E-4 /*87*/, 65536 *16 * -9.393690949611698E-4 /*88*/, 65536 *16 * -9.421725179420662E-4 /*89*/, 65536 *16 * -9.401299048871544E-4 /*90*/, 65536 *16 * -9.33106896645869E-4 /*91*/, 65536 *16 * -9.209400636174311E-4 /*92*/, 65536 *16 * -9.035401279622776E-4 /*93*/, 65536 *16 * -8.807854817776823E-4 /*94*/, 65536 *16 * -8.526430615286829E-4 /*95*/, 65536 *16 * -8.190296190822509E-4 /*96*/, 65536 *16 * -7.799980167439345E-4 /*97*/, 65536 *16 * -7.355478199155667E-4 /*98*/, 65536 *16 * -6.8567697874281E-4 /*99*/, 65536 *16 * -6.305240657493408E-4 /*100*/, 65536 *16 * -5.701694385732142E-4 /*101*/, 65536 *16 * -5.047740591296687E-4 /*102*/, 65536 *16 * -4.344980221283718E-4 /*103*/, 65536 *16 * -3.595556715693896E-4 /*104*/, 65536 *16 * -2.8017864491759883E-4 /*105*/, 65536 *16 * -1.9664106446578853E-4 /*106*/, 65536 *16 * -1.0924056590418239E-4 /*107*/, 65536 *16 * -1.831009861307028E-5 /*108*/, 65536 *16 * 7.579029921420169E-5 /*109*/, 65536 *16 * 1.726696848384902E-4 /*110*/, 65536 *16 * 2.719067221880469E-4 /*111*/, 65536 *16 * 3.7305728261123155E-4 /*112*/, 65536 *16 * 4.7562651195605295E-4 /*113*/, 65536 *16 * 5.791888527128953E-4 /*114*/, 65536 *16 * 6.831673135667645E-4 /*115*/, 65536 *16 * 7.870493762901182E-4 /*116*/, 65536 *16 * 8.902822670362451E-4 /*117*/, 65536 *16 * 9.923024258505538E-4 /*118*/, 65536 *16 * 0.0010925350458368308 /*119*/, 65536 *16 * 0.0011903898503065698 /*120*/, 65536 *16 * 0.0012852771482304163 /*121*/, 65536 *16 * 0.0013765956662458894 /*122*/, 65536 *16 * 0.001463753120426749 /*123*/, 65536 *16 * 0.001546148019165285 /*124*/, 65536 *16 * 0.0016231971391851225 /*125*/, 65536 *16 * 0.0016943089588603764 /*126*/, 65536 *16 * 0.0017589264521182184 /*127*/, 65536 *16 * 0.001816477825843157 /*128*/, 65536 *16 * 0.001866465750234791 /*129*/, 65536 *16 * 0.001908351881851273 /*130*/, 65536 *16 * 0.0019416355874888774 /*131*/, 65536 *16 * 0.0019658912100497094 /*132*/, 65536 *16 * 0.0019806705540431754 /*133*/, 65536 *16 * 0.001985602463070219 /*134*/, 65536 *16 * 0.0019803173347810094 /*135*/, 65536 *16 * 0.001964518487218229 /*136*/, 65536 *16 * 0.00193792749109128 /*137*/, 65536 *16 * 0.0019003361153152295 /*138*/, 65536 *16 * 0.0018515636696845045 /*139*/, 65536 *16 * 0.0017915008584460717 /*140*/, 65536 *16 * 0.0017200735452676211 /*141*/, 65536 *16 * 0.0016372830430278298 /*142*/, 65536 *16 * 0.0015431709906056357 /*143*/, 65536 *16 * 0.0014378573929982352 /*144*/, 65536 *16 * 0.0013215084987890104 /*145*/, 65536 *16 * 0.001194328283068528 /*146*/, 65536 *16 * 0.0010566468386934231 /*147*/, 65536 *16 * 9.088002025373218E-4 /*148*/, 65536 *16 * 7.512135584215806E-4 /*149*/, 65536 *16 * 5.843621536328689E-4 /*150*/, 65536 *16 * 4.087894375795271E-4 /*151*/, 65536 *16 * 2.2510227575334467E-4 /*152*/, 65536 *16 * 3.396239791846655E-5 /*153*/, 65536 *16 * -1.6390294871759475E-4 /*154*/, 65536 *16 * -3.6771789280231503E-4 /*155*/, 65536 *16 * -5.766405458635558E-4 /*156*/, 65536 *16 * -7.897872933737203E-4 /*157*/, 65536 *16 * -0.001006209757480115 /*158*/, 65536 *16 * -0.0012249304977170316 /*159*/, 65536 *16 * -0.0014449054341312839 /*160*/, 65536 *16 * -0.0016650898600315796 /*161*/, 65536 *16 * -0.001884343774622382 /*162*/, 65536 *16 * -0.0021015342465919864 /*163*/, 65536 *16 * -0.0023154975831354337 /*164*/, 65536 *16 * -0.0025250324219407566 /*165*/, 65536 *16 * -0.0027289312457094736 /*166*/, 65536 *16 * -0.0029259546931934967 /*167*/, 65536 *16 * -0.003114871201398419 /*168*/, 65536 *16 * -0.003294430723892981 /*169*/, 65536 *16 * -0.003463396424710959 /*170*/, 65536 *16 * -0.003620525188769811 /*171*/, 65536 *16 * -0.0037645967189351955 /*172*/, 65536 *16 * -0.003894396916361478 /*173*/, 65536 *16 * -0.00400874728567525 /*174*/, 65536 *16 * -0.004106485394068385 /*175*/, 65536 *16 * -0.004186497692846864 /*176*/, 65536 *16 * -0.004247692032125654 /*177*/, 65536 *16 * -0.004289020763525844 /*178*/, 65536 *16 * -0.0043095197889136795 /*179*/, 65536 *16 * -0.004308238489219152 /*180*/, 65536 *16 * -0.004284317631022625 /*181*/, 65536 *16 * -0.0042369380515990835 /*182*/, 65536 *16 * -0.004165372803509635 /*183*/, 65536 *16 * -0.004068956516951112 /*184*/, 65536 *16 * -0.003947110543306579 /*185*/, 65536 *16 * -0.003799332887739826 /*186*/, 65536 *16 * -0.0036252122359255057 /*187*/, 65536 *16 * -0.0034244255727248728 /*188*/, 65536 *16 * -0.0031967441992062605 /*189*/, 65536 *16 * -0.0029420359603045624 /*190*/, 65536 *16 * -0.002660262473612329 /*191*/, 65536 *16 * -0.0023514913391939015 /*192*/, 65536 *16 * -0.002015874218170038 /*193*/, 65536 *16 * -0.0016537021922741356 /*194*/, 65536 *16 * -0.0012653326032471951 /*195*/, 65536 *16 * -8.512425489658283E-4 /*196*/, 65536 *16 * -4.12008134196091E-4 /*197*/, 65536 *16 * 5.169160678832697E-5 /*198*/, 65536 *16 * 5.3906734093252E-4 /*199*/, 65536 *16 * 0.0010492444783799305 /*200*/, 65536 *16 * 0.0015812369440962736 /*201*/, 65536 *16 * 0.002133975437656693 /*202*/, 65536 *16 * 0.002706284295633396 /*203*/, 65536 *16 * 0.003296910987472264 /*204*/, 65536 *16 * 0.0039045040922850343 /*205*/, 65536 *16 * 0.004527645156076457 /*206*/, 65536 *16 * 0.005164822580527953 /*207*/, 65536 *16 * 0.00581446977998051 /*208*/, 65536 *16 * 0.00647492818678252 /*209*/, 65536 *16 * 0.007144495527005753 /*210*/, 65536 *16 * 0.007821417135435386 /*211*/, 65536 *16 * 0.008503870707064397 /*212*/, 65536 *16 * 0.00919000676302643 /*213*/, 65536 *16 * 0.009877917856582038 /*214*/, 65536 *16 * 0.010565689475867907 /*215*/, 65536 *16 * 0.011251366750588049 /*216*/, 65536 *16 * 0.01193298816023733 /*217*/, 65536 *16 * 0.012608574497468706 /*218*/, 65536 *16 * 0.013276151008399953 /*219*/, 65536 *16 * 0.013933744269275995 /*220*/, 65536 *16 * 0.014579397589755912 /*221*/, 65536 *16 * 0.015211171751139368 /*222*/, 65536 *16 * 0.015827155422328678 /*223*/, 65536 *16 * 0.01642547256780349 /*224*/, 65536 *16 * 0.01700428326907068 /*225*/, 65536 *16 * 0.017561819587529177 /*226*/, 65536 *16 * 0.018096338432718698 /*227*/, 65536 *16 * 0.018606183762999433 /*228*/, 65536 *16 * 0.019089749497960648 /*229*/, 65536 *16 * 0.019545523698532997 /*230*/, 65536 *16 * 0.019972069058400564 /*231*/, 65536 *16 * 0.02036803110561515 /*232*/, 65536 *16 * 0.020732154475618856 /*233*/, 65536 *16 * 0.021063275458886234 /*234*/, 65536 *16 * 0.021360340738775345 /*235*/, 65536 *16 * 0.02162239534537267 /*236*/, 65536 *16 * 0.021848603142668337 /*237*/, 65536 *16 * 0.02203823092181804 /*238*/, 65536 *16 * 0.022190674411724294 /*239*/, 65536 *16 * 0.022305434241445123 /*240*/, 65536 *16 * 0.022382153728111424 /*241*/, 65536 *16 * 0.022420574751016616 }; /* 44100 PAL Parks-McClellan FIR Filter Design Filter type: Low pass Passband: 0 - 0.0076373 Order: 483 Passband ripple: 0.1 dB Transition band: 0.005625 Stopband attenuation: 60.5 dB Coefficients: */ static int32 C44100PAL[NCOEFFS/2]= { /*0*/ 65536 *16 * 5.793783958720019E-4 /*1*/, 65536 *16 * 1.0571291666629312E-4 /*2*/, 65536 *16 * 1.1459085882755871E-4 /*3*/, 65536 *16 * 1.2371675029136968E-4 /*4*/, 65536 *16 * 1.3275170325031607E-4 /*5*/, 65536 *16 * 1.4207721167879995E-4 /*6*/, 65536 *16 * 1.5130497600100568E-4 /*7*/, 65536 *16 * 1.6077227873948047E-4 /*8*/, 65536 *16 * 1.6990814771316866E-4 /*9*/, 65536 *16 * 1.79005024990367E-4 /*10*/, 65536 *16 * 1.8739246068939436E-4 /*11*/, 65536 *16 * 1.9572039600801667E-4 /*12*/, 65536 *16 * 2.0352846914404956E-4 /*13*/, 65536 *16 * 2.1201116607443127E-4 /*14*/, 65536 *16 * 2.188838839136502E-4 /*15*/, 65536 *16 * 2.2495686284733203E-4 /*16*/, 65536 *16 * 2.3149812422937834E-4 /*17*/, 65536 *16 * 2.363635497444841E-4 /*18*/, 65536 *16 * 2.410054979130104E-4 /*19*/, 65536 *16 * 2.445286108284421E-4 /*20*/, 65536 *16 * 2.474675828550653E-4 /*21*/, 65536 *16 * 2.4934815214903343E-4 /*22*/, 65536 *16 * 2.50372333906785E-4 /*23*/, 65536 *16 * 2.501665763315339E-4 /*24*/, 65536 *16 * 2.488750795254978E-4 /*25*/, 65536 *16 * 2.4640153199411455E-4 /*26*/, 65536 *16 * 2.428720291968876E-4 /*27*/, 65536 *16 * 2.3801309032826844E-4 /*28*/, 65536 *16 * 2.3160240772113682E-4 /*29*/, 65536 *16 * 2.2423402291517938E-4 /*30*/, 65536 *16 * 2.152856501527123E-4 /*31*/, 65536 *16 * 2.0488674543318888E-4 /*32*/, 65536 *16 * 1.9317919544163198E-4 /*33*/, 65536 *16 * 1.7994016398005858E-4 /*34*/, 65536 *16 * 1.6541109383681028E-4 /*35*/, 65536 *16 * 1.4938382649739635E-4 /*36*/, 65536 *16 * 1.3200975730094075E-4 /*37*/, 65536 *16 * 1.1313240842725184E-4 /*38*/, 65536 *16 * 9.296992728984174E-5 /*39*/, 65536 *16 * 7.143010735440594E-5 /*40*/, 65536 *16 * 4.8632764324109725E-5 /*41*/, 65536 *16 * 2.443073549738759E-5 /*42*/, 65536 *16 * -8.284349612349981E-7 /*43*/, 65536 *16 * -2.7227387247375577E-5 /*44*/, 65536 *16 * -5.4818038895146106E-5 /*45*/, 65536 *16 * -8.330005435111118E-5 /*46*/, 65536 *16 * -1.1275737974091186E-4 /*47*/, 65536 *16 * -1.4298620796919756E-4 /*48*/, 65536 *16 * -1.7390785487074508E-4 /*49*/, 65536 *16 * -2.054308580401118E-4 /*50*/, 65536 *16 * -2.37415521983132E-4 /*51*/, 65536 *16 * -2.697456782629617E-4 /*52*/, 65536 *16 * -3.022375619849705E-4 /*53*/, 65536 *16 * -3.348339660959209E-4 /*54*/, 65536 *16 * -3.673583086741243E-4 /*55*/, 65536 *16 * -3.996554197363865E-4 /*56*/, 65536 *16 * -4.3147108191834185E-4 /*57*/, 65536 *16 * -4.6285023012872966E-4 /*58*/, 65536 *16 * -4.934440989261961E-4 /*59*/, 65536 *16 * -5.231720978150925E-4 /*60*/, 65536 *16 * -5.518656107257292E-4 /*61*/, 65536 *16 * -5.793049560550073E-4 /*62*/, 65536 *16 * -6.053792205725333E-4 /*63*/, 65536 *16 * -6.298765704841736E-4 /*64*/, 65536 *16 * -6.526402738994988E-4 /*65*/, 65536 *16 * -6.734722964365358E-4 /*66*/, 65536 *16 * -6.922485843472661E-4 /*67*/, 65536 *16 * -7.088111930758961E-4 /*68*/, 65536 *16 * -7.229789042068006E-4 /*69*/, 65536 *16 * -7.34572975483669E-4 /*70*/, 65536 *16 * -7.435049180176613E-4 /*71*/, 65536 *16 * -7.496258178311876E-4 /*72*/, 65536 *16 * -7.527294926570751E-4 /*73*/, 65536 *16 * -7.528075552986548E-4 /*74*/, 65536 *16 * -7.496410435428715E-4 /*75*/, 65536 *16 * -7.432054606042111E-4 /*76*/, 65536 *16 * -7.33375741493331E-4 /*77*/, 65536 *16 * -7.200753858529672E-4 /*78*/, 65536 *16 * -7.03226653737734E-4 /*79*/, 65536 *16 * -6.827921676621563E-4 /*80*/, 65536 *16 * -6.58752773848678E-4 /*81*/, 65536 *16 * -6.31061807229375E-4 /*82*/, 65536 *16 * -5.997124150992168E-4 /*83*/, 65536 *16 * -5.647352645065657E-4 /*84*/, 65536 *16 * -5.261799041455252E-4 /*85*/, 65536 *16 * -4.8402880277824417E-4 /*86*/, 65536 *16 * -4.3840329475572E-4 /*87*/, 65536 *16 * -3.893672279202991E-4 /*88*/, 65536 *16 * -3.37002579326518E-4 /*89*/, 65536 *16 * -2.8148278838384204E-4 /*90*/, 65536 *16 * -2.2288467365854118E-4 /*91*/, 65536 *16 * -1.6140368454103024E-4 /*92*/, 65536 *16 * -9.718648150744015E-5 /*93*/, 65536 *16 * -3.046343268277719E-5 /*94*/, 65536 *16 * 3.859234051837562E-5 /*95*/, 65536 *16 * 1.0974328274324426E-4 /*96*/, 65536 *16 * 1.8273974279995372E-4 /*97*/, 65536 *16 * 2.5730055402762935E-4 /*98*/, 65536 *16 * 3.3318458939353874E-4 /*99*/, 65536 *16 * 4.100891270013777E-4 /*100*/, 65536 *16 * 4.876860015464126E-4 /*101*/, 65536 *16 * 5.657011755504638E-4 /*102*/, 65536 *16 * 6.437547403393535E-4 /*103*/, 65536 *16 * 7.215350856659516E-4 /*104*/, 65536 *16 * 7.986901321007353E-4 /*105*/, 65536 *16 * 8.748424228508639E-4 /*106*/, 65536 *16 * 9.496338070297501E-4 /*107*/, 65536 *16 * 0.0010226804298925178 /*108*/, 65536 *16 * 0.001093633836878271 /*109*/, 65536 *16 * 0.0011620773771650913 /*110*/, 65536 *16 * 0.001227641045409496 /*111*/, 65536 *16 * 0.0012899374110895208 /*112*/, 65536 *16 * 0.001348607725415767 /*113*/, 65536 *16 * 0.001403236086962171 /*114*/, 65536 *16 * 0.0014534904370406968 /*115*/, 65536 *16 * 0.0014989864777827345 /*116*/, 65536 *16 * 0.0015393672007052272 /*117*/, 65536 *16 * 0.0015743174329729173 /*118*/, 65536 *16 * 0.0016034756800234508 /*119*/, 65536 *16 * 0.0016265420570988364 /*120*/, 65536 *16 * 0.0016432110467175217 /*121*/, 65536 *16 * 0.0016532197970121178 /*122*/, 65536 *16 * 0.0016562968359550962 /*123*/, 65536 *16 * 0.0016521969919585549 /*124*/, 65536 *16 * 0.001640721606064916 /*125*/, 65536 *16 * 0.001621678045313759 /*126*/, 65536 *16 * 0.0015948992297934834 /*127*/, 65536 *16 * 0.0015602457924787695 /*128*/, 65536 *16 * 0.0015176354451292787 /*129*/, 65536 *16 * 0.0014669598890367775 /*130*/, 65536 *16 * 0.001408218899058892 /*131*/, 65536 *16 * 0.001341376545671481 /*132*/, 65536 *16 * 0.0012664621369705463 /*133*/, 65536 *16 * 0.0011835425953369801 /*134*/, 65536 *16 * 0.0010927146027981068 /*135*/, 65536 *16 * 9.941150953832762E-4 /*136*/, 65536 *16 * 8.878982163088053E-4 /*137*/, 65536 *16 * 7.742911468907501E-4 /*138*/, 65536 *16 * 6.535350381595103E-4 /*139*/, 65536 *16 * 5.259114487251054E-4 /*140*/, 65536 *16 * 3.9173611703422796E-4 /*141*/, 65536 *16 * 2.513813444320677E-4 /*142*/, 65536 *16 * 1.0522988594595334E-4 /*143*/, 65536 *16 * -4.627799877161863E-5 /*144*/, 65536 *16 * -2.0266153878465397E-4 /*145*/, 65536 *16 * -3.6344539072942917E-4 /*146*/, 65536 *16 * -5.28061484912101E-4 /*147*/, 65536 *16 * -6.959549845043866E-4 /*148*/, 65536 *16 * -8.665108935058429E-4 /*149*/, 65536 *16 * -0.0010391137133997624 /*150*/, 65536 *16 * -0.001213088248571412 /*151*/, 65536 *16 * -0.0013877438142645866 /*152*/, 65536 *16 * -0.0015623746142961936 /*153*/, 65536 *16 * -0.001736242850147973 /*154*/, 65536 *16 * -0.0019085899496564314 /*155*/, 65536 *16 * -0.002078639823528187 /*156*/, 65536 *16 * -0.0022456104279907118 /*157*/, 65536 *16 * -0.002408678368623706 /*158*/, 65536 *16 * -0.002567052121352872 /*159*/, 65536 *16 * -0.0027198956481072887 /*160*/, 65536 *16 * -0.0028663750213148488 /*161*/, 65536 *16 * -0.0030056713494924794 /*162*/, 65536 *16 * -0.0031369487365098063 /*163*/, 65536 *16 * -0.0032593909953083865 /*164*/, 65536 *16 * -0.0033721594370116153 /*165*/, 65536 *16 * -0.0034744643621211356 /*166*/, 65536 *16 * -0.0035654990231207963 /*167*/, 65536 *16 * -0.003644488024347632 /*168*/, 65536 *16 * -0.0037106644342197828 /*169*/, 65536 *16 * -0.0037632989436418352 /*170*/, 65536 *16 * -0.00380166827783197 /*171*/, 65536 *16 * -0.0038250950477227447 /*172*/, 65536 *16 * -0.0038329329853570827 /*173*/, 65536 *16 * -0.0038245430145814447 /*174*/, 65536 *16 * -0.0037993625516763766 /*175*/, 65536 *16 * -0.003756842883124589 /*176*/, 65536 *16 * -0.0036964913119694686 /*177*/, 65536 *16 * -0.0036178458358447655 /*178*/, 65536 *16 * -0.00352050628243193 /*179*/, 65536 *16 * -0.003404123578517079 /*180*/, 65536 *16 * -0.003268383375473133 /*181*/, 65536 *16 * -0.0031130454148921446 /*182*/, 65536 *16 * -0.002937909773123352 /*183*/, 65536 *16 * -0.0027428475146560275 /*184*/, 65536 *16 * -0.0025277729297779944 /*185*/, 65536 *16 * -0.0022926869206439508 /*186*/, 65536 *16 * -0.0020376141174133374 /*187*/, 65536 *16 * -0.0017626719756025908 /*188*/, 65536 *16 * -0.0014680351622130402 /*189*/, 65536 *16 * -0.0011539297872750212 /*190*/, 65536 *16 * -8.206567501069872E-4 /*191*/, 65536 *16 * -4.685710694984321E-4 /*192*/, 65536 *16 * -9.811116382477182E-5 /*193*/, 65536 *16 * 2.902488429495873E-4 /*194*/, 65536 *16 * 6.959516881166062E-4 /*195*/, 65536 *16 * 0.0011183883405789612 /*196*/, 65536 *16 * 0.0015568865209671754 /*197*/, 65536 *16 * 0.0020107155705137744 /*198*/, 65536 *16 * 0.002479084293281152 /*199*/, 65536 *16 * 0.002961149037985776 /*200*/, 65536 *16 * 0.0034560223628435746 /*201*/, 65536 *16 * 0.0039627343373741354 /*202*/, 65536 *16 * 0.0044803036416812955 /*203*/, 65536 *16 * 0.005007678185806692 /*204*/, 65536 *16 * 0.00554377521563058 /*205*/, 65536 *16 * 0.006087456836491167 /*206*/, 65536 *16 * 0.006637561024809676 /*207*/, 65536 *16 * 0.007192890398414245 /*208*/, 65536 *16 * 0.0077522050201042055 /*209*/, 65536 *16 * 0.008314254820045306 /*210*/, 65536 *16 * 0.008877749982246051 /*211*/, 65536 *16 * 0.009441393781470539 /*212*/, 65536 *16 * 0.010003862886118781 /*213*/, 65536 *16 * 0.01056383933598836 /*214*/, 65536 *16 * 0.011119972235266088 /*215*/, 65536 *16 * 0.011670924253482212 /*216*/, 65536 *16 * 0.012215363764388693 /*217*/, 65536 *16 * 0.012751945584822125 /*218*/, 65536 *16 * 0.013279348664168343 /*219*/, 65536 *16 * 0.013796251849197938 /*220*/, 65536 *16 * 0.0143013718962506 /*221*/, 65536 *16 * 0.014793420656675483 /*222*/, 65536 *16 * 0.015271157641252524 /*223*/, 65536 *16 * 0.015733358657288442 /*224*/, 65536 *16 * 0.016178837288118402 /*225*/, 65536 *16 * 0.016606446422463023 /*226*/, 65536 *16 * 0.01701507865820779 /*227*/, 65536 *16 * 0.017403671672970734 /*228*/, 65536 *16 * 0.01777119975394863 /*229*/, 65536 *16 * 0.018116717572056962 /*230*/, 65536 *16 * 0.01843930362202181 /*231*/, 65536 *16 * 0.01873811058717855 /*232*/, 65536 *16 * 0.01901234584784063 /*233*/, 65536 *16 * 0.019261287195027194 /*234*/, 65536 *16 * 0.019484271195397335 /*235*/, 65536 *16 * 0.0196806998422779 /*236*/, 65536 *16 * 0.019850058102456474 /*237*/, 65536 *16 * 0.019991882444368586 /*238*/, 65536 *16 * 0.0201058042761605 /*239*/, 65536 *16 * 0.02019151207246131 /*240*/, 65536 *16 * 0.02024878178965319 /*241*/, 65536 *16 * 0.020277449712345474 }; fceu-0.98.12/src/fds.c0000644000175000000620000004023610052013303014211 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 #include "types.h" #include "x6502.h" #include "fceu.h" #include "fds.h" #include "sound.h" #include "general.h" #include "state.h" #include "file.h" #include "memory.h" #include "cart.h" #include "md5.h" #include "netplay.h" /* TODO: Add code to put a delay in between the time a disk is inserted and the when it can be successfully read/written to. This should prevent writes to wrong places OR add code to prevent disk ejects when the virtual motor is on(mmm...virtual motor). */ static DECLFR(FDSRead4030); static DECLFR(FDSRead4031); static DECLFR(FDSRead4032); static DECLFR(FDSRead4033); static DECLFW(FDSWrite); static DECLFW(FDSWaveWrite); static DECLFR(FDSWaveRead); static DECLFR(FDSSRead); static DECLFW(FDSSWrite); static DECLFR(FDSBIOSRead); static DECLFR(FDSRAMRead); static DECLFW(FDSRAMWrite); static void FDSInit(void); static void FP_FASTAPASS(1) FDSFix(int a); #define FDSRAM GameMemBlock #define CHRRAM (GameMemBlock+32768) static uint8 FDSRegs[6]; static int32 IRQLatch,IRQCount; static uint8 IRQa; static void FDSClose(void); static uint8 FDSBIOS[8192]; /* Original disk data backup, to help in creating save states. */ static uint8 *diskdatao[8]={0,0,0,0,0,0,0,0}; static uint8 *diskdata[8]={0,0,0,0,0,0,0,0}; static unsigned int TotalSides; static uint8 DiskWritten=0; /* Set to 1 if disk was written to. */ static uint8 writeskip; static uint32 DiskPtr; static int32 DiskSeekIRQ; static uint8 SelectDisk,InDisk; #define DC_INC 1 void FDSGI(int h) { switch(h) { case GI_CLOSE: FDSClose();break; case GI_POWER: FDSInit();break; } } static void FDSStateRestore(int version) { int x; setmirror(((FDSRegs[5]&8)>>3)^1); if(version >= 9810) for(x=0;x>1,(SelectDisk&1)?"B":"A"); InDisk=SelectDisk; } else { FCEU_DispMessage("Disk %d Side %s Ejected",SelectDisk>>1,(SelectDisk&1)?"B":"A"); InDisk=255; } } void FCEU_FDSEject(void) { InDisk=255; } void FCEU_FDSSelect(void) { if(InDisk!=255) { FCEU_DispMessage("Eject disk before selecting."); return; } SelectDisk=((SelectDisk+1)%TotalSides)&3; FCEU_DispMessage("Disk %d Side %s Selected",SelectDisk>>1,(SelectDisk&1)?"B":"A"); } static void FP_FASTAPASS(1) FDSFix(int a) { if((IRQa&2) && IRQCount) { IRQCount-=a; if(IRQCount<=0) { if(!(IRQa&1)) { IRQa&=~2; IRQCount=IRQLatch=0; } else IRQCount=IRQLatch; //IRQCount=IRQLatch; //0xFFFF; X6502_IRQBegin(FCEU_IQEXT); //printf("IRQ: %d\n",timestamp); // printf("IRQ: %d\n",scanline); } } if(DiskSeekIRQ>0) { DiskSeekIRQ-=a; if(DiskSeekIRQ<=0) { if(FDSRegs[5]&0x80) { X6502_IRQBegin(FCEU_IQEXT2); } } } } static DECLFR(FDSRead4030) { uint8 ret=0; /* Cheap hack. */ if(X.IRQlow&FCEU_IQEXT) ret|=1; if(X.IRQlow&FCEU_IQEXT2) ret|=2; if(!fceuindbg) { X6502_IRQEnd(FCEU_IQEXT); X6502_IRQEnd(FCEU_IQEXT2); } return ret; } static DECLFR(FDSRead4031) { static uint8 z=0; if(InDisk!=255) { z=diskdata[InDisk][DiskPtr]; if(!fceuindbg) { if(DiskPtr<64999) DiskPtr++; DiskSeekIRQ=150; X6502_IRQEnd(FCEU_IQEXT2); } } return z; } static DECLFR(FDSRead4032) { uint8 ret; ret=X.DB&~7; if(InDisk==255) ret|=5; if(InDisk==255 || !(FDSRegs[5]&1) || (FDSRegs[5]&2)) ret|=2; return ret; } static DECLFR(FDSRead4033) { return 0x80; // battery } static DECLFW(FDSRAMWrite) { (FDSRAM-0x6000)[A]=V; } static DECLFR(FDSBIOSRead) { return (FDSBIOS-0xE000)[A]; } static DECLFR(FDSRAMRead) { return (FDSRAM-0x6000)[A]; } /* Begin FDS sound */ #define FDSClock (1789772.7272727272727272/2) typedef struct { int64 cycles; // Cycles per PCM sample int64 count; // Cycle counter int64 envcount; // Envelope cycle counter uint32 b19shiftreg60; uint32 b24adder66; uint32 b24latch68; uint32 b17latch76; int32 clockcount; // Counter to divide frequency by 8. uint8 b8shiftreg88; // Modulation register. uint8 amplitude[2]; // Current amplitudes. uint8 speedo[2]; uint8 mwcount; uint8 mwstart; uint8 mwave[0x20]; // Modulation waveform uint8 cwave[0x40]; // Game-defined waveform(carrier) uint8 SPSG[0xB]; } FDSSOUND; static FDSSOUND fdso; #define SPSG fdso.SPSG #define b19shiftreg60 fdso.b19shiftreg60 #define b24adder66 fdso.b24adder66 #define b24latch68 fdso.b24latch68 #define b17latch76 fdso.b17latch76 #define b8shiftreg88 fdso.b8shiftreg88 #define clockcount fdso.clockcount #define amplitude fdso.amplitude #define speedo fdso.speedo void FDSSoundStateAdd(void) { AddExState(fdso.cwave,64,0,"WAVE"); AddExState(fdso.mwave,32,0,"MWAV"); AddExState(amplitude,2,0,"AMPL"); AddExState(SPSG,0xB,0,"SPSG"); AddExState(&b8shiftreg88,1,0,"B88"); AddExState(&clockcount, 4, 1, "CLOC"); AddExState(&b19shiftreg60,4,1,"B60"); AddExState(&b24adder66,4,1,"B66"); AddExState(&b24latch68,4,1,"B68"); AddExState(&b17latch76,4,1,"B76"); } static DECLFR(FDSSRead) { switch(A&0xF) { case 0x0:return(amplitude[0]|(X.DB&0xC0)); case 0x2:return(amplitude[1]|(X.DB&0xC0)); } return(X.DB); } static DECLFW(FDSSWrite) { if(FSettings.SndRate) { if(FSettings.soundq>=1) RenderSoundHQ(); else RenderSound(); } A-=0x4080; switch(A) { case 0x0: case 0x4: if(V&0x80) amplitude[(A&0xF)>>2]=V&0x3F; //)>0x20?0x20:(V&0x3F); break; case 0x5://printf("$%04x:$%02x\n",A,V); break; case 0x7: b17latch76=0;SPSG[0x5]=0;//printf("$%04x:$%02x\n",A,V); break; case 0x8: b17latch76=0; // printf("%d:$%02x, $%02x\n",SPSG[0x5],V,b17latch76); fdso.mwave[SPSG[0x5]&0x1F]=V&0x7; SPSG[0x5]=(SPSG[0x5]+1)&0x1F; break; } //if(A>=0x7 && A!=0x8 && A<=0xF) //if(A==0xA || A==0x9) //printf("$%04x:$%02x\n",A,V); SPSG[A]=V; } // $4080 - Fundamental wave amplitude data register 92 // $4082 - Fundamental wave frequency data register 58 // $4083 - Same as $4082($4083 is the upper 4 bits). // $4084 - Modulation amplitude data register 78 // $4086 - Modulation frequency data register 72 // $4087 - Same as $4086($4087 is the upper 4 bits) static void DoEnv() { int x; for(x=0;x<2;x++) if(!(SPSG[x<<2]&0x80) && !(SPSG[0x3]&0x40)) { static int counto[2]={0,0}; if(counto[x]<=0) { if(!(SPSG[x<<2]&0x80)) { if(SPSG[x<<2]&0x40) { if(amplitude[x]<0x3F) amplitude[x]++; } else { if(amplitude[x]>0) amplitude[x]--; } } counto[x]=(SPSG[x<<2]&0x3F); } else counto[x]--; } } static DECLFR(FDSWaveRead) { return(fdso.cwave[A&0x3f]|(X.DB&0xC0)); } static DECLFW(FDSWaveWrite) { //printf("$%04x:$%02x, %d\n",A,V,SPSG[0x9]&0x80); if(SPSG[0x9]&0x80) fdso.cwave[A&0x3f]=V&0x3F; } static int ta; static INLINE void ClockRise(void) { if(!clockcount) { ta++; b19shiftreg60=(SPSG[0x2]|((SPSG[0x3]&0xF)<<8)); b17latch76=(SPSG[0x6]|((SPSG[0x07]&0xF)<<8))+b17latch76; if(!(SPSG[0x7]&0x80)) { int t=fdso.mwave[(b17latch76>>13)&0x1F]&7; int t2=amplitude[1]; int adj = 0; if((t&3)) { if((t&4)) adj -= (t2 * ((4 - (t&3) ) )); else adj += (t2 * ( (t&3) )); } adj *= 2; if(adj > 0x7F) adj = 0x7F; if(adj < -0x80) adj = -0x80; //if(adj) printf("%d ",adj); b8shiftreg88=0x80 + adj; } else { b8shiftreg88=0x80; } } else { b19shiftreg60<<=1; b8shiftreg88>>=1; } // b24adder66=(b24latch68+b19shiftreg60)&0x3FFFFFF; b24adder66=(b24latch68+b19shiftreg60)&0x1FFFFFF; } static INLINE void ClockFall(void) { //if(!(SPSG[0x7]&0x80)) { if((b8shiftreg88&1)) // || clockcount==7) b24latch68=b24adder66; } clockcount=(clockcount+1)&7; } static INLINE int32 FDSDoSound(void) { fdso.count+=fdso.cycles; if(fdso.count>=((int64)1<<40)) { dogk: fdso.count-=(int64)1<<40; ClockRise(); ClockFall(); fdso.envcount--; if(fdso.envcount<=0) { fdso.envcount+=SPSG[0xA]*3; DoEnv(); } } if(fdso.count>=32768) goto dogk; // Might need to emulate applying the amplitude to the waveform a bit better... { int k=amplitude[0]; if(k>0x20) k=0x20; return (fdso.cwave[b24latch68>>19]*k)*4/((SPSG[0x9]&0x3)+2); } } static int32 FBC=0; static void RenderSound(void) { int32 end, start; int32 x; start=FBC; end=(SOUNDTS<<16)/soundtsinc; if(end<=start) return; FBC=end; if(!(SPSG[0x9]&0x80)) for(x=start;x>1; t>>=4; Wave[x>>4]+=t; //(t>>2)-(t>>3); //>>3; } } static void RenderSoundHQ(void) { int32 x; if(!(SPSG[0x9]&0x80)) for(x=FBC;x>1; WaveHi[x]+=t; //(t<<2)-(t<<1); } FBC=SOUNDTS; } static void HQSync(int32 ts) { FBC=ts; } void FDSSound(int c) { RenderSound(); FBC=c; } /* static DECLFR(FDSBIOSPatch) { if(FDSRegs[5]&0x4) { X.X=FDSRead4031(0x4031); FDSWrite(0x4024,X.A); X.A=X.X; return(0x60); } else { return(0x58); //puts("Write"); } } */ static void FDS_ESI(void) { if(FSettings.SndRate) { if(FSettings.soundq>=1) { fdso.cycles=(int64)1<<39; } else { fdso.cycles=((int64)1<<40)*FDSClock; fdso.cycles/=FSettings.SndRate *16; } } // fdso.cycles=(int64)32768*FDSClock/(FSettings.SndRate *16); SetReadHandler(0x4040,0x407f,FDSWaveRead); SetWriteHandler(0x4040,0x407f,FDSWaveWrite); SetWriteHandler(0x4080,0x408A,FDSSWrite); SetReadHandler(0x4090,0x4092,FDSSRead); //SetReadHandler(0xE7A3,0xE7A3,FDSBIOSPatch); } void FDSSoundReset(void) { memset(&fdso,0,sizeof(fdso)); FDS_ESI(); GameExpSound.HiSync=HQSync; GameExpSound.HiFill=RenderSoundHQ; GameExpSound.Fill=FDSSound; GameExpSound.RChange=FDS_ESI; } static DECLFW(FDSWrite) { //extern int scanline; //FCEU_printf("$%04x:$%02x, %d\n",A,V,scanline); switch(A) { case 0x4020: X6502_IRQEnd(FCEU_IQEXT); IRQLatch&=0xFF00; IRQLatch|=V; // printf("$%04x:$%02x\n",A,V); break; case 0x4021: X6502_IRQEnd(FCEU_IQEXT); IRQLatch&=0xFF; IRQLatch|=V<<8; // printf("$%04x:$%02x\n",A,V); break; case 0x4022: X6502_IRQEnd(FCEU_IQEXT); IRQCount=IRQLatch; IRQa=V&3; // printf("$%04x:$%02x\n",A,V); break; case 0x4023:break; case 0x4024: if(InDisk!=255 && !(FDSRegs[5]&0x4) && (FDSRegs[3]&0x1)) { if(DiskPtr>=0 && DiskPtr<65500) { if(writeskip) writeskip--; else if(DiskPtr>=2) { DiskWritten=1; diskdata[InDisk][DiskPtr-2]=V; } } } break; case 0x4025: X6502_IRQEnd(FCEU_IQEXT2); if(InDisk!=255) { if(!(V&0x40)) { if(FDSRegs[5]&0x40 && !(V&0x10)) { DiskSeekIRQ=200; DiskPtr-=2; } if(DiskPtr<0) DiskPtr=0; } if(!(V&0x4)) writeskip=2; if(V&2) {DiskPtr=0;DiskSeekIRQ=200;} if(V&0x40) DiskSeekIRQ=200; } setmirror(((V>>3)&1)^1); break; } FDSRegs[A&7]=V; } static void FreeFDSMemory(void) { int x; for(x=0;x8) TotalSides=8; if(TotalSides<1) TotalSides=1; for(x=0;xMD5); return(1); } static void PreSave(void) { int x; //if(DiskWritten) for(x=0;xtype=GIT_FDS; GameInterface=FDSGI; SelectDisk=0; InDisk=255; ResetExState(PreSave,PostSave); FDSSoundStateAdd(); for(x=0;x #include #include #include #include #include "unzip.h" #include "types.h" #include "file.h" #include "endian.h" #include "memory.h" #include "driver.h" #include "general.h" typedef struct { uint8 *data; uint32 size; uint32 location; } MEMWRAP; void ApplyIPS(FILE *ips, MEMWRAP *dest) { uint8 header[5]; uint32 count=0; FCEU_printf(" Applying IPS...\n"); if(fread(header,1,5,ips)!=5) { fclose(ips); return; } if(memcmp(header,"PATCH",5)) { fclose(ips); return; } while(fread(header,1,3,ips)==3) { uint32 offset=(header[0]<<16)|(header[1]<<8)|header[2]; uint16 size; if(!memcmp(header,"EOF",3)) { FCEU_printf(" IPS EOF: Did %d patches\n\n",count); fclose(ips); return; } size=fgetc(ips)<<8; size|=fgetc(ips); if(!size) /* RLE */ { uint8 *start; uint8 b; size=fgetc(ips)<<8; size|=fgetc(ips); //FCEU_printf(" Offset: %8d Size: %5d RLE\n",offset,size); if((offset+size)>dest->size) { uint8 *tmp; // Probably a little slow. tmp=(uint8 *)realloc(dest->data,offset+size); if(!tmp) { FCEU_printf(" Oops. IPS patch %d(type RLE) goes beyond end of file. Could not allocate memory.\n",count); fclose(ips); return; } dest->size=offset+size; dest->data=tmp; memset(dest->data+dest->size,0,offset+size-dest->size); } b=fgetc(ips); start=dest->data+offset; do { *start=b; start++; } while(--size); } else /* Normal patch */ { //FCEU_printf(" Offset: %8d Size: %5d\n",offset,size); if((offset+size)>dest->size) { uint8 *tmp; // Probably a little slow. tmp=(uint8 *)realloc(dest->data,offset+size); if(!tmp) { FCEU_printf(" Oops. IPS patch %d(type normal) goes beyond end of file. Could not allocate memory.\n",count); fclose(ips); return; } dest->data=tmp; memset(dest->data+dest->size,0,offset+size-dest->size); } fread(dest->data+offset,1,size,ips); } count++; } fclose(ips); FCEU_printf(" Hard IPS end!\n"); } static MEMWRAP *MakeMemWrap(void *tz, int type) { MEMWRAP *tmp; if(!(tmp=(MEMWRAP *)FCEU_malloc(sizeof(MEMWRAP)))) goto doret; tmp->location=0; if(type==0) { fseek((FILE *)tz,0,SEEK_END); tmp->size=ftell((FILE *)tz); fseek((FILE *)tz,0,SEEK_SET); if(!(tmp->data=(uint8*)FCEU_malloc(tmp->size))) { free(tmp); tmp=0; goto doret; } fread(tmp->data,1,tmp->size,(FILE *)tz); } else if(type==1) { /* Bleck. The gzip file format has the size of the uncompressed data, but I can't get to the info with the zlib interface(?). */ for(tmp->size=0; gzgetc(tz) != EOF; tmp->size++); gzseek(tz,0,SEEK_SET); if(!(tmp->data=(uint8 *)FCEU_malloc(tmp->size))) { free(tmp); tmp=0; goto doret; } gzread(tz,tmp->data,tmp->size); } else if(type==2) { unz_file_info ufo; unzGetCurrentFileInfo(tz,&ufo,0,0,0,0,0,0); tmp->size=ufo.uncompressed_size; if(!(tmp->data=(uint8 *)FCEU_malloc(ufo.uncompressed_size))) { free(tmp); tmp=0; goto doret; } unzReadCurrentFile(tz,tmp->data,ufo.uncompressed_size); } doret: if(type==0) { fclose((FILE *)tz); } else if(type==1) { gzclose(tz); } else if(type==2) { unzCloseCurrentFile(tz); unzClose(tz); } return tmp; } #ifndef __GNUC__ #define strcasecmp strcmp #endif FCEUFILE * FCEU_fopen(const char *path, const char *ipsfn, char *mode, char *ext) { FILE *ipsfile=0; FCEUFILE *fceufp; void *t; if(strchr(mode,'r')) ipsfile=FCEUD_UTF8fopen(ipsfn,"rb"); fceufp=(FCEUFILE *)malloc(sizeof(FCEUFILE)); { unzFile tz; if((tz=unzOpen(path))) // If it's not a zip file, use regular file handlers. // Assuming file type by extension usually works, // but I don't like it. :) { if(unzGoToFirstFile(tz)==UNZ_OK) { for(;;) { char tempu[512]; // Longer filenames might be possible, but I don't // think people would name files that long in zip files... unzGetCurrentFileInfo(tz,0,tempu,512,0,0,0,0); tempu[511]=0; if(strlen(tempu)>=4) { char *za=tempu+strlen(tempu)-4; if(!ext) { if(!strcasecmp(za,".nes") || !strcasecmp(za,".fds") || !strcasecmp(za,".nsf") || !strcasecmp(za,".unf") || !strcasecmp(za,".nez")) break; } else if(!strcasecmp(za,ext)) break; } if(strlen(tempu)>=5) { if(!strcasecmp(tempu+strlen(tempu)-5,".unif")) break; } if(unzGoToNextFile(tz)!=UNZ_OK) { if(unzGoToFirstFile(tz)!=UNZ_OK) goto zpfail; break; } } if(unzOpenCurrentFile(tz)!=UNZ_OK) goto zpfail; } else { zpfail: free(fceufp); unzClose(tz); return 0; } if(!(fceufp->fp=MakeMemWrap(tz,2))) { free(fceufp); return(0); } fceufp->type=2; if(ipsfile) ApplyIPS(ipsfile,(MEMWRAP *)fceufp->fp); return(fceufp); } } if((t=FCEUD_UTF8fopen(path,"rb"))) { uint32 magic; magic=fgetc((FILE *)t); magic|=fgetc((FILE *)t)<<8; magic|=fgetc((FILE *)t)<<16; if(magic!=0x088b1f) /* Not gzip... */ fclose((FILE *)t); else /* Probably gzip */ { int fd; fd = dup(fileno( (FILE *)t)); fclose(t); lseek(fd, 0, SEEK_SET); if((t=gzdopen(fd,mode))) { fceufp->type=1; fceufp->fp=t; if(ipsfile) { fceufp->fp=MakeMemWrap(t,1); gzclose(t); if(fceufp->fp) { free(fceufp); return(0); } fceufp->type=3; ApplyIPS(ipsfile,(MEMWRAP *)fceufp->fp); } return(fceufp); } close(fd); } } if((t=FCEUD_UTF8fopen(path,mode))) { fseek((FILE *)t,0,SEEK_SET); fceufp->type=0; fceufp->fp=t; if(ipsfile) { if(!(fceufp->fp=MakeMemWrap(t,0))) { free(fceufp); return(0); } fceufp->type=3; ApplyIPS(ipsfile,(MEMWRAP *)fceufp->fp); } return(fceufp); } free(fceufp); return 0; } int FCEU_fclose(FCEUFILE *fp) { if(fp->type==1) { gzclose(fp->fp); } else if(fp->type>=2) { free(((MEMWRAP*)(fp->fp))->data); free(fp->fp); } else { fclose((FILE *)fp->fp); } free(fp); return 1; } uint64 FCEU_fread(void *ptr, size_t size, size_t nmemb, FCEUFILE *fp) { if(fp->type==1) { return gzread(fp->fp,ptr,size*nmemb); } else if(fp->type>=2) { MEMWRAP *wz; uint32 total=size*nmemb; wz=(MEMWRAP*)fp->fp; if(wz->location>=wz->size) return 0; if((wz->location+total)>wz->size) { int ak=wz->size-wz->location; memcpy((uint8*)ptr,wz->data+wz->location,ak); wz->location=wz->size; return(ak/size); } else { memcpy((uint8*)ptr,wz->data+wz->location,total); wz->location+=total; return nmemb; } } else { return fread(ptr,size,nmemb,(FILE *)fp->fp); } } uint64 FCEU_fwrite(void *ptr, size_t size, size_t nmemb, FCEUFILE *fp) { if(fp->type==1) { return gzwrite(fp->fp,ptr,size*nmemb); } else if(fp->type>=2) { return 0; } else return fwrite(ptr,size,nmemb,(FILE *)fp->fp); } int FCEU_fseek(FCEUFILE *fp, long offset, int whence) { if(fp->type==1) { return( (gzseek(fp->fp,offset,whence)>0)?0:-1); } else if(fp->type>=2) { MEMWRAP *wz; wz=(MEMWRAP*)fp->fp; switch(whence) { case SEEK_SET:if(offset>=wz->size) return(-1); wz->location=offset;break; case SEEK_CUR:if(offset+wz->location>wz->size) return (-1); wz->location+=offset; break; } return 0; } else return fseek((FILE *)fp->fp,offset,whence); } uint64 FCEU_ftell(FCEUFILE *fp) { if(fp->type==1) { return gztell(fp->fp); } else if(fp->type>=2) { return (((MEMWRAP *)(fp->fp))->location); } else return ftell((FILE *)fp->fp); } void FCEU_rewind(FCEUFILE *fp) { if(fp->type==1) { gzrewind(fp->fp); } else if(fp->type>=2) { ((MEMWRAP *)(fp->fp))->location=0; } else /* Rewind */ fseek(fp->fp,0,SEEK_SET); } int FCEU_read16le(uint16 *val, FCEUFILE *fp) { uint8 t[2]; if(fp->type>=1) { if(fp->type>=2) { MEMWRAP *wz; wz=(MEMWRAP *)fp->fp; if(wz->location+2>wz->size) {return 0;} *(uint32 *)t=*(uint32 *)(wz->data+wz->location); wz->location+=2; } else if(fp->type==1) if(gzread(fp->fp,&t,2)!=2) return(0); return(1); } else { if(fread(t,1,2,(FILE *)fp->fp)!=2) return(0); } *val=t[0]|(t[1]<<8); return(1); } int FCEU_read32le(uint32 *Bufo, FCEUFILE *fp) { if(fp->type>=1) { uint8 t[4]; #ifndef LSB_FIRST uint8 x[4]; #endif if(fp->type>=2) { MEMWRAP *wz; wz=(MEMWRAP *)fp->fp; if(wz->location+4>wz->size) {return 0;} *(uint32 *)t=*(uint32 *)(wz->data+wz->location); wz->location+=4; } else if(fp->type==1) gzread(fp->fp,&t,4); #ifndef LSB_FIRST x[0]=t[3]; x[1]=t[2]; x[2]=t[1]; x[3]=t[0]; *(uint32*)Bufo=*(uint32*)x; #else *(uint32*)Bufo=*(uint32*)t; #endif return 1; } else { return read32le(Bufo,(FILE *)fp->fp); } } int FCEU_fgetc(FCEUFILE *fp) { if(fp->type==1) return gzgetc(fp->fp); else if(fp->type>=2) { MEMWRAP *wz; wz=(MEMWRAP *)fp->fp; if(wz->locationsize) return wz->data[wz->location++]; return EOF; } else return fgetc((FILE *)fp->fp); } uint64 FCEU_fgetsize(FCEUFILE *fp) { if(fp->type==1) { int x,t; t=gztell(fp->fp); gzrewind(fp->fp); for(x=0; gzgetc(fp->fp) != EOF; x++); gzseek(fp->fp,t,SEEK_SET); return(x); } else if(fp->type>=2) return ((MEMWRAP*)(fp->fp))->size; else { long t,r; t=ftell((FILE *)fp->fp); fseek((FILE *)fp->fp,0,SEEK_END); r=ftell((FILE *)fp->fp); fseek((FILE *)fp->fp,t,SEEK_SET); return r; } } int FCEU_fisarchive(FCEUFILE *fp) { if(fp->type==2) return 1; return 0; } fceu-0.98.12/src/file.h0000644000175000000620000000124410003562763014374 0ustar joestaff00000000000000typedef struct { void *fp; // FILE* or ptr to ZIPWRAP uint32 type; // 0=normal file, 1=gzip, 2=zip } FCEUFILE; FCEUFILE *FCEU_fopen(const char *path, const char *ipsfn, char *mode, char *ext); int FCEU_fclose(FCEUFILE*); uint64 FCEU_fread(void *ptr, size_t size, size_t nmemb, FCEUFILE*); uint64 FCEU_fwrite(void *ptr, size_t size, size_t nmemb, FCEUFILE*); int FCEU_fseek(FCEUFILE*, long offset, int whence); uint64 FCEU_ftell(FCEUFILE*); void FCEU_rewind(FCEUFILE*); int FCEU_read32le(uint32 *Bufo, FCEUFILE*); int FCEU_read16le(uint16 *Bufo, FCEUFILE*); int FCEU_fgetc(FCEUFILE*); uint64 FCEU_fgetsize(FCEUFILE*); int FCEU_fisarchive(FCEUFILE*); fceu-0.98.12/src/filter.c0000644000175000000620000001024610106303767014740 0ustar joestaff00000000000000#include #include #include "types.h" #include "sound.h" #include "x6502.h" #include "fceu.h" #include "filter.h" #include "fcoeffs.h" static uint32 mrindex; static uint32 mrratio; void SexyFilter2(int32 *in, int32 count) { #ifdef moo static int64 acc=0; double x,p; int64 c; x=2*M_PI*6000/FSettings.SndRate; p=((double)2-cos(x)) - sqrt(pow((double)2-cos(x),2) -1 ); c=p*0x100000; //printf("%f\n",(double)c/0x100000); #endif static int64 acc=0; while(count--) { int64 dropcurrent; dropcurrent=((*in<<16)-acc)>>3; acc+=dropcurrent; *in=acc>>16; in++; //acc=((int64)0x100000-c)* *in + ((c*acc)>>20); //*in=acc>>20; //in++; } } void SexyFilter(int32 *in, int32 *out, int32 count) { static int64 acc1=0,acc2=0; int32 mul1,mul2,vmul; mul1=(94<<16)/FSettings.SndRate; mul2=(24<<16)/FSettings.SndRate; vmul=(FSettings.SoundVolume<<16)*3/4/100; if(FSettings.soundq) vmul/=4; else vmul*=2; /* TODO: Increase volume in low quality sound rendering code itself */ while(count) { int64 ino=(int64)*in*vmul; acc1+=((ino-acc1)*mul1)>>16; acc2+=((ino-acc1-acc2)*mul2)>>16; //printf("%d ",*in); *in=0; { int32 t=(acc1-ino+acc2)>>16; //if(t>32767 || t<-32768) printf("Flow: %d\n",t); if(t>32767) t=32767; if(t<-32768) t=-32768; *out=t; } in++; out++; count--; } } /* Returns number of samples written to out. */ /* leftover is set to the number of samples that need to be copied from the end of in to the beginning of in. */ //static uint32 mva=1000; /* This filtering code assumes that almost all input values stay below 32767. Do not adjust the volume in the wlookup tables and the expansion sound code to be higher, or you *might* overflow the FIR code. */ int32 NeoFilterSound(int32 *in, int32 *out, uint32 inlen, int32 *leftover) { uint32 x; uint32 max; int32 *outsave=out; int32 count=0; // for(x=0;xmva){ mva=in[x]; printf("%ld\n",in[x]);} // } max=(inlen-1)<<16; if(FSettings.soundq==2) for(x=mrindex;x>16)-SQ2NCOEFFS],D=sq2coeffs;c;c--,D++) { acc+=(S[c]**D)>>6; acc2+=(S[1+c]**D)>>6; } acc=((int64)acc*(65536-(x&65535))+(int64)acc2*(x&65535))>>(16+11); *out=acc; out++; count++; } else for(x=mrindex;x>16)-NCOEFFS],D=coeffs;c;c--,D++) { acc+=(S[c]**D)>>6; acc2+=(S[1+c]**D)>>6; } acc=((int64)acc*(65536-(x&65535))+(int64)acc2*(x&65535))>>(16+11); *out=acc; out++; count++; } mrindex=x-max; if(FSettings.soundq==2) { mrindex+=SQ2NCOEFFS*65536; *leftover=SQ2NCOEFFS+1; } else { mrindex+=NCOEFFS*65536; *leftover=NCOEFFS+1; } if(GameExpSound.NeoFill) GameExpSound.NeoFill(outsave,count); SexyFilter(outsave,outsave,count); if(FSettings.lowpass) SexyFilter2(outsave,count); return(count); } void MakeFilters(int32 rate) { int32 *tabs[6]={C44100NTSC,C44100PAL,C48000NTSC,C48000PAL,C96000NTSC, C96000PAL}; int32 *sq2tabs[6]={SQ2C44100NTSC,SQ2C44100PAL,SQ2C48000NTSC,SQ2C48000PAL, SQ2C96000NTSC,SQ2C96000PAL}; int32 *tmp; int32 x; uint32 nco; if(FSettings.soundq==2) nco=SQ2NCOEFFS; else nco=NCOEFFS; mrindex=(nco+1)<<16; mrratio=(PAL?(int64)(PAL_CPU*65536):(int64)(NTSC_CPU*65536))/rate; if(FSettings.soundq==2) tmp=sq2tabs[(PAL?1:0)|(rate==48000?2:0)|(rate==96000?4:0)]; else tmp=tabs[(PAL?1:0)|(rate==48000?2:0)|(rate==96000?4:0)]; if(FSettings.soundq==2) for(x=0;x>1;x++) sq2coeffs[x]=sq2coeffs[SQ2NCOEFFS-1-x]=tmp[x]; else for(x=0;x>1;x++) coeffs[x]=coeffs[NCOEFFS-1-x]=tmp[x]; #ifdef MOO /* Some tests involving precision and error. */ { static int64 acc=0; int x; for(x=0;x #define MAX 512 main() { char buf[256]; int count=0; while(fgets(buf,256,stdin)>0) { double p; if(sscanf(buf,"%lf",&p)==1) { p*=65536*16; printf("%ld,\n",(long)p); count++; if(count==MAX) break; } } } fceu-0.98.12/src/fir/c48000ntsc.coef0000755000175000000620000005123610003562763016441 0ustar joestaff00000000000000;; ***** Simple test filter ***** ;; Filter length: 1024 ;; Symmetry: cosine ;; Sampling frequency: 1789772.72727273 ;; Grid density: 10257 ;; Deviation parameter: y=-4.15334587672572e-4 ;; ;; Specifications: ;; (limit > 24000 894886.363636 0 0.5) ;; (limit < 24000 894886.363636 0 0.5) ;; (limit > 0 17000 1 1) ;; (limit < 0 17000 1 1) ;; ;; Coefficients: -1.09949811042225e-4 -1.22806738594947e-5 -1.2856649387849e-5 -1.33942943882967e-5 -1.38759188766186e-5 -1.42903486313313e-5 -1.46314856397791e-5 -1.48912662330057e-5 -1.50872358926362e-5 -1.51736783706926e-5 -1.51920174272043e-5 -1.50946540712042e-5 -1.4906159571695e-5 -1.46043232504438e-5 -1.41826804115075e-5 -1.3656619477754e-5 -1.30159730761761e-5 -1.22550097006306e-5 -1.13887071556529e-5 -1.03867032653885e-5 -9.28900860776593e-6 -8.04914399027275e-6 -6.71896085473064e-6 -5.26687936275949e-6 -3.70827372384805e-6 -2.05782362044426e-6 -3.07184084317173e-7 1.56196204778674e-6 3.49335533222506e-6 5.50094513191646e-6 7.58454405677602e-6 9.73122206351426e-6 1.1925384533121e-5 1.41723759116143e-5 1.64486730093282e-5 1.87185665617164e-5 2.10193314554571e-5 2.32868013030244e-5 2.553385658201e-5 2.77448936592136e-5 2.98938550558335e-5 3.19813209008917e-5 3.39767566092725e-5 3.58854777832478e-5 3.77083338973254e-5 3.93896125185267e-5 4.09448701284991e-5 4.2335041675049e-5 4.355182102547e-5 4.45811599449272e-5 4.53754087968507e-5 4.5963991898548e-5 4.63912768895152e-5 4.66332273332272e-5 4.6623761079951e-5 4.61449042224772e-5 4.56999092246609e-5 4.48566415488991e-5 4.37716646911701e-5 4.24332940559181e-5 4.08053879668338e-5 3.88924305216162e-5 3.67371834848531e-5 3.42871968756067e-5 3.16108049585284e-5 2.86477428425672e-5 2.54397360410253e-5 2.19995003725315e-5 1.83235898190551e-5 1.44365831918759e-5 1.0347151946393e-5 6.06550691029756e-6 1.62938066833157e-6 -2.97932202860966e-6 -7.69928040586833e-6 -1.25326516699612e-5 -1.74386499250263e-5 -2.24193699837587e-5 -2.74121537882667e-5 -3.2420323875298e-5 -3.74096430792575e-5 -4.23517165718808e-5 -4.71910843635185e-5 -5.19552722226438e-5 -5.65526133942226e-5 -6.09864135270981e-5 -6.52252080560519e-5 -6.92340008906634e-5 -7.29676421256746e-5 -7.64220773917906e-5 -7.957469184604e-5 -8.23723520198843e-5 -8.48145294498788e-5 -8.68637280156417e-5 -8.847590640524e-5 -8.96579831689903e-5 -9.03754273981505e-5 -9.06277650874391e-5 -9.0390962049786e-5 -8.96295019021089e-5 -8.83699462608486e-5 -8.65929014634202e-5 -8.42777636122367e-5 -8.1438947139124e-5 -7.80310589482434e-5 -7.4130290344153e-5 -6.97213148895689e-5 -6.47743915798445e-5 -5.93190057095397e-5 -5.3369300678592e-5 -4.70020380599523e-5 -4.01241085336933e-5 -3.28791381626816e-5 -2.52335267849121e-5 -1.72013052766137e-5 -8.85204247806303e-6 -2.36203952998983e-7 8.65426060083348e-6 1.77326837630105e-5 2.70119909588562e-5 3.63935730200405e-5 4.58302978650995e-5 5.53120362349631e-5 6.47532841902274e-5 7.41091974779693e-5 8.33336809092267e-5 9.23584465403365e-5 1.0115262933884e-4 1.09631128039229e-4 1.17757486894641e-4 1.25489570576103e-4 1.32754230059236e-4 1.39503431050419e-4 1.45701107814038e-4 1.51259946463513e-4 1.56172084911138e-4 1.6038874820501e-4 1.63870537117991e-4 1.66539506236844e-4 1.68421511031107e-4 1.69442548025091e-4 1.69579877038768e-4 1.6881612357465e-4 1.67142961466588e-4 1.64531403910968e-4 1.60985251495646e-4 1.56489605383482e-4 1.5103863824127e-4 1.44638439288558e-4 1.3732499213528e-4 1.29095155164885e-4 1.19970934485128e-4 1.09972583377882e-4 9.91339782697809e-5 8.75139349992027e-5 7.51413396638277e-5 6.20524024461875e-5 4.83301074719599e-5 3.39882067477733e-5 1.91401658681103e-5 3.81291646780894e-6 -1.18969312223288e-5 -2.79091174901399e-5 -4.41757419681384e-5 -6.06051695381194e-5 -7.70882672632681e-5 -9.35502837597759e-5 -1.09925493394208e-4 -1.26105817993473e-4 -1.41986602739464e-4 -1.57477825556515e-4 -1.72511116490329e-4 -1.86975264016647e-4 -2.0078755537738e-4 -2.13836321481426e-4 -2.26049064513734e-4 -2.37368218087728e-4 -2.47667060725941e-4 -2.56892753723085e-4 -2.64968427146944e-4 -2.71811293915514e-4 -2.77368381437469e-4 -2.81573581193851e-4 -2.84371752243438e-4 -2.85739766097855e-4 -2.85600433310225e-4 -2.83955117995654e-4 -2.80740799593234e-4 -2.75948247317517e-4 -2.69611626635144e-4 -2.61691007650807e-4 -2.52188089302722e-4 -2.41138311003691e-4 -2.28565411014119e-4 -2.14482121588247e-4 -1.9895360017079e-4 -1.8201715772697e-4 -1.63736603204964e-4 -1.44183596994227e-4 -1.23436201666099e-4 -1.01558928824961e-4 -7.86622769828866e-5 -5.48472741191755e-5 -3.02274887834648e-5 -4.9052508479435e-6 2.10064626953057e-5 4.73692357955313e-5 7.40576789101123e-5 1.00930166818208e-4 1.27850827966983e-4 1.54673624437643e-4 1.81245925229617e-4 2.07459909036642e-4 2.33129240741297e-4 2.58109799089455e-4 2.82247208675082e-4 3.05421790075743e-4 3.27480832505477e-4 3.48269568065021e-4 3.6763827845558e-4 3.85499646838909e-4 4.01682103671787e-4 4.16086785395773e-4 4.28597839023261e-4 4.39097519078108e-4 4.47510063482399e-4 4.53732616193564e-4 4.57673475015079e-4 4.59289837761018e-4 4.5850639594641e-4 4.55297854632095e-4 4.49607814238691e-4 4.41429940481748e-4 4.30750173165062e-4 4.17571750776714e-4 4.01921059289583e-4 3.83832134824733e-4 3.63333748980151e-4 3.40524023663407e-4 3.15436084161991e-4 2.88188541554642e-4 2.58843348650986e-4 2.2755513753174e-4 1.94439484002676e-4 1.59617684118401e-4 1.23249634741989e-4 8.5510700519544e-5 4.65441005957331e-5 6.57031586978297e-6 -3.42428951570416e-5 -7.5699448554351e-5 -1.17574026058653e-4 -1.59659853873827e-4 -2.01745572207549e-4 -2.4360492525437e-4 -2.8501090249108e-4 -3.25733846890315e-4 -3.65540766223455e-4 -4.04206100994041e-4 -4.41510228555032e-4 -4.77213532040263e-4 -5.11116556934743e-4 -5.42986611641292e-4 -5.72614695207158e-4 -5.99800201510281e-4 -6.24363710833356e-4 -6.46126331992769e-4 -6.64897970015276e-4 -6.8052501770588e-4 -6.92886060830722e-4 -7.01833451901113e-4 -7.07250228969443e-4 -7.09057753989528e-4 -7.07154827552179e-4 -7.01496865293485e-4 -6.92021891429721e-4 -6.78737292920809e-4 -6.61615877709466e-4 -6.40668301834071e-4 -6.15954503334807e-4 -5.87516953638343e-4 -5.5543054818097e-4 -5.19817664992314e-4 -4.80761718393648e-4 -4.38443435457234e-4 -3.92999331139588e-4 -3.44607011339858e-4 -2.9348321650997e-4 -2.3983421051813e-4 -1.83896811789197e-4 -1.2592231659735e-4 -6.61594042730277e-5 -4.9252546289175e-6 5.75175579438193e-5 1.20840816301453e-4 1.84748121533308e-4 2.48893569837659e-4 3.12957694717443e-4 3.76586747195116e-4 4.39458057575329e-4 5.01208720002647e-4 5.61505630848618e-4 6.19978340175428e-4 6.76328791582876e-4 7.30187225165355e-4 7.81228789019675e-4 8.29133676742072e-4 8.73586107685454e-4 9.14292826672621e-4 9.50980660353665e-4 9.8335580172593e-4 0.00101117365679917 0.0010342034115958 0.00105223766601628 0.0010650850759155 0.00107259035326429 0.00107459393770505 0.00107099171776075 0.0010616907401631 0.00104663727550016 0.00102579422906041 9.99174270226947e-4 9.66796775092314e-4 9.28727841773456e-4 8.85038362639593e-4 8.35888033960542e-4 7.81415464948617e-4 7.21781542997729e-4 6.5723033289136e-4 5.88002310491308e-4 5.14363552961592e-4 4.36612788588694e-4 3.55077835414929e-4 2.70131130639128e-4 1.82143163521255e-4 9.15090743372197e-5 -1.33605757547524e-6 -9.59647394963337e-5 -1.91891614650009e-4 -2.88666748710662e-4 -3.85790985377778e-4 -4.82744482577328e-4 -5.79040781433632e-4 -6.74149659110707e-4 -7.67559001801454e-4 -8.58757697345997e-4 -9.47196836410621e-4 -0.00103237718183087 -0.00111379514944025 -0.00119095339891772 -0.00126336405490239 -0.0013305487657181 -0.00139205895696274 -0.00144748189993549 -0.00149637609832828 -0.00153838019191627 -0.00157313252823261 -0.00160031824966766 -0.00161963448121335 -0.00163083428806327 -0.00163368043294617 -0.00162801106822713 -0.00161369463758679 -0.001590627176841 -0.00155873704279726 -0.00151802687039672 -0.00146852840940013 -0.00141032303015301 -0.00134354264387151 -0.00126835601060216 -0.00118498680408603 -0.00109369844655022 -9.94796296696515e-4 -8.8865052983109e-4 -7.75668795643321e-4 -6.56296891780576e-4 -5.31000918141328e-4 -4.00317796479334e-4 -2.64818077987588e-4 -1.25114221854341e-4 1.81841346036177e-5 1.64393641166078e-4 3.12811847712545e-4 4.62729945674983e-4 6.13406073593611e-4 7.64065647645698e-4 9.13943516660458e-4 0.00106223039501543 0.00120813812086204 0.00135086874684724 0.00148959926942261 0.00162354046408344 0.00175189262820587 0.00187387246188932 0.00198871017104844 0.00209565287683832 0.0021939767567535 0.00228297968827271 0.00236200869351783 0.00243042754510312 0.00248762788988958 0.0025330698432872 0.00256626682234492 0.00258674212159455 0.00259411104319052 0.00258801693114338 0.0025681874145284 0.00253439944797282 0.0024864849067166 0.00242436415305489 0.00234800707561149 0.00225745930340907 0.00215285442473657 0.00203435432097337 0.00190222275978058 0.00175681593792146 0.00159852537978592 0.0014278366643269 0.00124529939623188 0.00105153398032655 8.47243678747333e-4 6.33180470845124e-4 4.10182654032466e-4 1.79134409511786e-4 -5.90060425716582e-5 -3.03246569572555e-4 -5.52504441714844e-4 -8.05662799984435e-4 -0.00106155482217139 -0.00131898406132897 -0.00157669465967831 -0.00183340910297136 -0.00208780837793107 -0.00233856516182173 -0.00258431370577947 -0.00282368901281709 -0.00305532603599211 -0.00327782955235904 -0.00348982317700461 -0.00368994504305836 -0.00387684142913267 -0.00404917288620234 -0.00420563779140244 -0.00434495904267169 -0.00446589522922125 -0.00456726636733209 -0.0046479215365105 -0.00470677650973429 -0.00474281564445811 -0.00475506485728163 -0.00474262236885261 -0.00470469762343002 -0.00464054556498023 -0.00454951664806806 -0.00443104181074602 -0.0042846470727934 -0.00410997073193062 -0.00390671622712066 -0.00367472523350812 -0.00341390471257351 -0.00312428955884935 -0.0028060183794834 -0.00245932446744169 -0.00208454478573285 -0.00168215159474978 -0.00125270028130292 -7.96876227266184e-4 -3.15420122431397e-4 1.90771392553303e-4 7.20722841875099e-4 0.00127336018779148 0.00184749620984379 0.00244188239334642 0.00305516500721029 0.00368588762187621 0.00433255328849199 0.00499354206149272 0.00566720184348075 0.0063517971761537 0.00704553740219523 0.00774656770503074 0.00845301860954979 0.00916293528892598 0.00987436353423422 0.0105853002711883 0.0112937615141001 0.0119976912030812 0.0126950714702282 0.0133838628629058 0.0140620731478666 0.0147276747542291 0.015378682266711 0.0160131634096303 0.0166292108981782 0.0172249492566478 0.0177985839161102 0.0183483448715057 0.0188725570567793 0.019369603943763 0.0198379424297359 0.020276126356732 0.0206827991478066 0.0210566858163425 0.0213966117522584 0.0217015035994142 0.0219704341407132 0.0222025359487478 0.0223970968853833 0.0225534819131259 0.0226711961954482 0.0227498857420413 0.0227892926322558 0.0227892926322558 0.0227498857420413 0.0226711961954482 0.0225534819131259 0.0223970968853833 0.0222025359487478 0.0219704341407132 0.0217015035994142 0.0213966117522584 0.0210566858163425 0.0206827991478066 0.020276126356732 0.0198379424297359 0.019369603943763 0.0188725570567793 0.0183483448715057 0.0177985839161102 0.0172249492566478 0.0166292108981782 0.0160131634096303 0.015378682266711 0.0147276747542291 0.0140620731478666 0.0133838628629058 0.0126950714702282 0.0119976912030812 0.0112937615141001 0.0105853002711883 0.00987436353423422 0.00916293528892598 0.00845301860954979 0.00774656770503074 0.00704553740219523 0.0063517971761537 0.00566720184348075 0.00499354206149272 0.00433255328849199 0.00368588762187621 0.00305516500721029 0.00244188239334642 0.00184749620984379 0.00127336018779148 7.20722841875099e-4 1.90771392553303e-4 -3.15420122431397e-4 -7.96876227266184e-4 -0.00125270028130292 -0.00168215159474978 -0.00208454478573285 -0.00245932446744169 -0.0028060183794834 -0.00312428955884935 -0.00341390471257351 -0.00367472523350812 -0.00390671622712066 -0.00410997073193062 -0.0042846470727934 -0.00443104181074602 -0.00454951664806806 -0.00464054556498023 -0.00470469762343002 -0.00474262236885261 -0.00475506485728163 -0.00474281564445811 -0.00470677650973429 -0.0046479215365105 -0.00456726636733209 -0.00446589522922125 -0.00434495904267169 -0.00420563779140244 -0.00404917288620234 -0.00387684142913267 -0.00368994504305836 -0.00348982317700461 -0.00327782955235904 -0.00305532603599211 -0.00282368901281709 -0.00258431370577947 -0.00233856516182173 -0.00208780837793107 -0.00183340910297136 -0.00157669465967831 -0.00131898406132897 -0.00106155482217139 -8.05662799984435e-4 -5.52504441714844e-4 -3.03246569572555e-4 -5.90060425716582e-5 1.79134409511786e-4 4.10182654032466e-4 6.33180470845124e-4 8.47243678747333e-4 0.00105153398032655 0.00124529939623188 0.0014278366643269 0.00159852537978592 0.00175681593792146 0.00190222275978058 0.00203435432097337 0.00215285442473657 0.00225745930340907 0.00234800707561149 0.00242436415305489 0.0024864849067166 0.00253439944797282 0.0025681874145284 0.00258801693114338 0.00259411104319052 0.00258674212159455 0.00256626682234492 0.0025330698432872 0.00248762788988958 0.00243042754510312 0.00236200869351783 0.00228297968827271 0.0021939767567535 0.00209565287683832 0.00198871017104844 0.00187387246188932 0.00175189262820587 0.00162354046408344 0.00148959926942261 0.00135086874684724 0.00120813812086204 0.00106223039501543 9.13943516660458e-4 7.64065647645698e-4 6.13406073593611e-4 4.62729945674983e-4 3.12811847712545e-4 1.64393641166078e-4 1.81841346036177e-5 -1.25114221854341e-4 -2.64818077987588e-4 -4.00317796479334e-4 -5.31000918141328e-4 -6.56296891780576e-4 -7.75668795643321e-4 -8.8865052983109e-4 -9.94796296696515e-4 -0.00109369844655022 -0.00118498680408603 -0.00126835601060216 -0.00134354264387151 -0.00141032303015301 -0.00146852840940013 -0.00151802687039672 -0.00155873704279726 -0.001590627176841 -0.00161369463758679 -0.00162801106822713 -0.00163368043294617 -0.00163083428806327 -0.00161963448121335 -0.00160031824966766 -0.00157313252823261 -0.00153838019191627 -0.00149637609832828 -0.00144748189993549 -0.00139205895696274 -0.0013305487657181 -0.00126336405490239 -0.00119095339891772 -0.00111379514944025 -0.00103237718183087 -9.47196836410621e-4 -8.58757697345997e-4 -7.67559001801454e-4 -6.74149659110707e-4 -5.79040781433632e-4 -4.82744482577328e-4 -3.85790985377778e-4 -2.88666748710662e-4 -1.91891614650009e-4 -9.59647394963337e-5 -1.33605757547524e-6 9.15090743372197e-5 1.82143163521255e-4 2.70131130639128e-4 3.55077835414929e-4 4.36612788588694e-4 5.14363552961592e-4 5.88002310491308e-4 6.5723033289136e-4 7.21781542997729e-4 7.81415464948617e-4 8.35888033960542e-4 8.85038362639593e-4 9.28727841773456e-4 9.66796775092314e-4 9.99174270226947e-4 0.00102579422906041 0.00104663727550016 0.0010616907401631 0.00107099171776075 0.00107459393770505 0.00107259035326429 0.0010650850759155 0.00105223766601628 0.0010342034115958 0.00101117365679917 9.8335580172593e-4 9.50980660353665e-4 9.14292826672621e-4 8.73586107685454e-4 8.29133676742072e-4 7.81228789019675e-4 7.30187225165355e-4 6.76328791582876e-4 6.19978340175428e-4 5.61505630848618e-4 5.01208720002647e-4 4.39458057575329e-4 3.76586747195116e-4 3.12957694717443e-4 2.48893569837659e-4 1.84748121533308e-4 1.20840816301453e-4 5.75175579438193e-5 -4.9252546289175e-6 -6.61594042730277e-5 -1.2592231659735e-4 -1.83896811789197e-4 -2.3983421051813e-4 -2.9348321650997e-4 -3.44607011339858e-4 -3.92999331139588e-4 -4.38443435457234e-4 -4.80761718393648e-4 -5.19817664992314e-4 -5.5543054818097e-4 -5.87516953638343e-4 -6.15954503334807e-4 -6.40668301834071e-4 -6.61615877709466e-4 -6.78737292920809e-4 -6.92021891429721e-4 -7.01496865293485e-4 -7.07154827552179e-4 -7.09057753989528e-4 -7.07250228969443e-4 -7.01833451901113e-4 -6.92886060830722e-4 -6.8052501770588e-4 -6.64897970015276e-4 -6.46126331992769e-4 -6.24363710833356e-4 -5.99800201510281e-4 -5.72614695207158e-4 -5.42986611641292e-4 -5.11116556934743e-4 -4.77213532040263e-4 -4.41510228555032e-4 -4.04206100994041e-4 -3.65540766223455e-4 -3.25733846890315e-4 -2.8501090249108e-4 -2.4360492525437e-4 -2.01745572207549e-4 -1.59659853873827e-4 -1.17574026058653e-4 -7.5699448554351e-5 -3.42428951570416e-5 6.57031586978297e-6 4.65441005957331e-5 8.5510700519544e-5 1.23249634741989e-4 1.59617684118401e-4 1.94439484002676e-4 2.2755513753174e-4 2.58843348650986e-4 2.88188541554642e-4 3.15436084161991e-4 3.40524023663407e-4 3.63333748980151e-4 3.83832134824733e-4 4.01921059289583e-4 4.17571750776714e-4 4.30750173165062e-4 4.41429940481748e-4 4.49607814238691e-4 4.55297854632095e-4 4.5850639594641e-4 4.59289837761018e-4 4.57673475015079e-4 4.53732616193564e-4 4.47510063482399e-4 4.39097519078108e-4 4.28597839023261e-4 4.16086785395773e-4 4.01682103671787e-4 3.85499646838909e-4 3.6763827845558e-4 3.48269568065021e-4 3.27480832505477e-4 3.05421790075743e-4 2.82247208675082e-4 2.58109799089455e-4 2.33129240741297e-4 2.07459909036642e-4 1.81245925229617e-4 1.54673624437643e-4 1.27850827966983e-4 1.00930166818208e-4 7.40576789101123e-5 4.73692357955313e-5 2.10064626953057e-5 -4.9052508479435e-6 -3.02274887834648e-5 -5.48472741191755e-5 -7.86622769828866e-5 -1.01558928824961e-4 -1.23436201666099e-4 -1.44183596994227e-4 -1.63736603204964e-4 -1.8201715772697e-4 -1.9895360017079e-4 -2.14482121588247e-4 -2.28565411014119e-4 -2.41138311003691e-4 -2.52188089302722e-4 -2.61691007650807e-4 -2.69611626635144e-4 -2.75948247317517e-4 -2.80740799593234e-4 -2.83955117995654e-4 -2.85600433310225e-4 -2.85739766097855e-4 -2.84371752243438e-4 -2.81573581193851e-4 -2.77368381437469e-4 -2.71811293915514e-4 -2.64968427146944e-4 -2.56892753723085e-4 -2.47667060725941e-4 -2.37368218087728e-4 -2.26049064513734e-4 -2.13836321481426e-4 -2.0078755537738e-4 -1.86975264016647e-4 -1.72511116490329e-4 -1.57477825556515e-4 -1.41986602739464e-4 -1.26105817993473e-4 -1.09925493394208e-4 -9.35502837597759e-5 -7.70882672632681e-5 -6.06051695381194e-5 -4.41757419681384e-5 -2.79091174901399e-5 -1.18969312223288e-5 3.81291646780894e-6 1.91401658681103e-5 3.39882067477733e-5 4.83301074719599e-5 6.20524024461875e-5 7.51413396638277e-5 8.75139349992027e-5 9.91339782697809e-5 1.09972583377882e-4 1.19970934485128e-4 1.29095155164885e-4 1.3732499213528e-4 1.44638439288558e-4 1.5103863824127e-4 1.56489605383482e-4 1.60985251495646e-4 1.64531403910968e-4 1.67142961466588e-4 1.6881612357465e-4 1.69579877038768e-4 1.69442548025091e-4 1.68421511031107e-4 1.66539506236844e-4 1.63870537117991e-4 1.6038874820501e-4 1.56172084911138e-4 1.51259946463513e-4 1.45701107814038e-4 1.39503431050419e-4 1.32754230059236e-4 1.25489570576103e-4 1.17757486894641e-4 1.09631128039229e-4 1.0115262933884e-4 9.23584465403365e-5 8.33336809092267e-5 7.41091974779693e-5 6.47532841902274e-5 5.53120362349631e-5 4.58302978650995e-5 3.63935730200405e-5 2.70119909588562e-5 1.77326837630105e-5 8.65426060083348e-6 -2.36203952998983e-7 -8.85204247806303e-6 -1.72013052766137e-5 -2.52335267849121e-5 -3.28791381626816e-5 -4.01241085336933e-5 -4.70020380599523e-5 -5.3369300678592e-5 -5.93190057095397e-5 -6.47743915798445e-5 -6.97213148895689e-5 -7.4130290344153e-5 -7.80310589482434e-5 -8.1438947139124e-5 -8.42777636122367e-5 -8.65929014634202e-5 -8.83699462608486e-5 -8.96295019021089e-5 -9.0390962049786e-5 -9.06277650874391e-5 -9.03754273981505e-5 -8.96579831689903e-5 -8.847590640524e-5 -8.68637280156417e-5 -8.48145294498788e-5 -8.23723520198843e-5 -7.957469184604e-5 -7.64220773917906e-5 -7.29676421256746e-5 -6.92340008906634e-5 -6.52252080560519e-5 -6.09864135270981e-5 -5.65526133942226e-5 -5.19552722226438e-5 -4.71910843635185e-5 -4.23517165718808e-5 -3.74096430792575e-5 -3.2420323875298e-5 -2.74121537882667e-5 -2.24193699837587e-5 -1.74386499250263e-5 -1.25326516699612e-5 -7.69928040586833e-6 -2.97932202860966e-6 1.62938066833157e-6 6.06550691029756e-6 1.0347151946393e-5 1.44365831918759e-5 1.83235898190551e-5 2.19995003725315e-5 2.54397360410253e-5 2.86477428425672e-5 3.16108049585284e-5 3.42871968756067e-5 3.67371834848531e-5 3.88924305216162e-5 4.08053879668338e-5 4.24332940559181e-5 4.37716646911701e-5 4.48566415488991e-5 4.56999092246609e-5 4.61449042224772e-5 4.6623761079951e-5 4.66332273332272e-5 4.63912768895152e-5 4.5963991898548e-5 4.53754087968507e-5 4.45811599449272e-5 4.355182102547e-5 4.2335041675049e-5 4.09448701284991e-5 3.93896125185267e-5 3.77083338973254e-5 3.58854777832478e-5 3.39767566092725e-5 3.19813209008917e-5 2.98938550558335e-5 2.77448936592136e-5 2.553385658201e-5 2.32868013030244e-5 2.10193314554571e-5 1.87185665617164e-5 1.64486730093282e-5 1.41723759116143e-5 1.1925384533121e-5 9.73122206351426e-6 7.58454405677602e-6 5.50094513191646e-6 3.49335533222506e-6 1.56196204778674e-6 -3.07184084317173e-7 -2.05782362044426e-6 -3.70827372384805e-6 -5.26687936275949e-6 -6.71896085473064e-6 -8.04914399027275e-6 -9.28900860776593e-6 -1.03867032653885e-5 -1.13887071556529e-5 -1.22550097006306e-5 -1.30159730761761e-5 -1.3656619477754e-5 -1.41826804115075e-5 -1.46043232504438e-5 -1.4906159571695e-5 -1.50946540712042e-5 -1.51920174272043e-5 -1.51736783706926e-5 -1.50872358926362e-5 -1.48912662330057e-5 -1.46314856397791e-5 -1.42903486313313e-5 -1.38759188766186e-5 -1.33942943882967e-5 -1.2856649387849e-5 -1.22806738594947e-5 -1.09949811042225e-4 fceu-0.98.12/src/fir/c44100ntsc.h0000644000175000000620000000534510003562763015746 0ustar joestaff00000000000000116, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 8, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -4, -5, -7, -9, -10, -12, -14, -16, -18, -20, -22, -24, -25, -27, -29, -31, -33, -34, -36, -37, -39, -40, -41, -42, -43, -44, -44, -44, -45, -45, -44, -44, -43, -42, -41, -40, -39, -37, -35, -33, -30, -28, -25, -22, -18, -15, -11, -7, -3, 0, 4, 9, 13, 18, 22, 27, 32, 36, 41, 46, 50, 55, 59, 64, 68, 72, 76, 79, 82, 85, 88, 91, 93, 94, 96, 97, 97, 97, 97, 96, 95, 93, 91, 88, 85, 81, 77, 73, 68, 62, 56, 50, 43, 36, 28, 20, 12, 4, -4, -13, -22, -32, -41, -51, -60, -70, -79, -89, -98, -107, -116, -125, -133, -141, -148, -155, -162, -168, -173, -178, -182, -186, -188, -190, -192, -192, -191, -190, -188, -185, -181, -176, -170, -163, -156, -147, -138, -128, -117, -105, -93, -79, -66, -51, -36, -20, -4, 11, 28, 45, 63, 80, 98, 115, 133, 150, 167, 183, 200, 215, 231, 245, 259, 272, 284, 295, 305, 314, 322, 328, 334, 338, 340, 341, 341, 339, 336, 331, 324, 316, 307, 296, 283, 269, 253, 236, 218, 198, 176, 154, 131, 106, 80, 54, 26, -1, -29, -58, -88, -117, -147, -177, -207, -236, -265, -294, -321, -348, -374, -399, -423, -445, -466, -486, -503, -519, -533, -545, -554, -562, -567, -570, -570, -568, -564, -557, -547, -535, -520, -503, -483, -461, -436, -409, -379, -347, -314, -278, -240, -200, -159, -117, -72, -27, 18, 65, 113, 161, 210, 258, 306, 354, 402, 448, 494, 538, 581, 622, 661, 698, 733, 765, 795, 822, 846, 866, 883, 897, 907, 914, 916, 915, 910, 901, 887, 870, 848, 823, 793, 759, 722, 680, 635, 587, 534, 479, 420, 359, 295, 228, 159, 88, 15, -58, -134, -210, -287, -364, -441, -518, -593, -668, -741, -813, -882, -949, -1013, -1074, -1131, -1185, -1235, -1280, -1321, -1357, -1387, -1412, -1432, -1446, -1454, -1456, -1451, -1440, -1423, -1400, -1370, -1333, -1290, -1241, -1185, -1123, -1055, -981, -901, -816, -726, -631, -531, -427, -319, -208, -93, 24, 143, 265, 388, 511, 635, 759, 882, 1004, 1124, 1242, 1357, 1468, 1575, 1678, 1776, 1868, 1955, 2034, 2107, 2172, 2229, 2278, 2318, 2349, 2370, 2382, 2384, 2376, 2357, 2327, 2287, 2237, 2175, 2103, 2020, 1926, 1822, 1708, 1583, 1449, 1306, 1153, 992, 822, 645, 461, 270, 74, -127, -333, -543, -757, -972, -1189, -1406, -1623, -1839, -2052, -2263, -2469, -2670, -2866, -3055, -3235, -3407, -3569, -3721, -3861, -3988, -4102, -4201, -4286, -4355, -4407, -4441, -4458, -4456, -4434, -4393, -4331, -4249, -4145, -4020, -3873, -3704, -3512, -3299, -3063, -2806, -2526, -2224, -1900, -1556, -1190, -804, -398, 27, 471, 933, 1412, 1908, 2419, 2945, 3484, 4036, 4599, 5172, 5754, 6344, 6940, 7541, 8146, 8754, 9363, 9971, 10578, 11182, 11781, 12374, 12959, 13536, 14103, 14658, 15199, 15727, 16239, 16734, 17211, 17669, 18106, 18521, 18914, 19283, 19627, 19946, 20239, 20505, 20743, 20952, 21133, 21284, 21405, 21497, 21558, 21588, fceu-0.98.12/src/fir/c44100pal.h0000644000175000000620000000534410003562763015552 0ustar joestaff00000000000000-116, -8, -8, -8, -8, -8, -8, -8, -8, -7, -7, -6, -5, -5, -4, -3, -2, -1, 0, 1, 2, 4, 5, 7, 9, 10, 12, 14, 16, 18, 19, 21, 23, 25, 27, 28, 30, 32, 33, 34, 36, 37, 38, 38, 39, 40, 40, 40, 40, 39, 39, 38, 37, 36, 34, 33, 31, 29, 26, 24, 21, 18, 14, 11, 7, 4, 0, -3, -8, -12, -16, -21, -25, -29, -34, -38, -43, -47, -51, -55, -59, -62, -66, -69, -72, -75, -77, -79, -80, -81, -82, -83, -83, -82, -81, -80, -78, -75, -72, -69, -65, -61, -56, -51, -45, -39, -33, -26, -19, -11, -4, 3, 12, 20, 29, 37, 46, 55, 64, 72, 81, 89, 97, 105, 112, 119, 126, 132, 138, 143, 147, 151, 154, 156, 158, 159, 159, 158, 157, 154, 151, 146, 141, 135, 128, 121, 112, 103, 93, 82, 70, 58, 45, 31, 17, 3, -11, -26, -41, -57, -72, -88, -104, -119, -134, -149, -163, -177, -191, -203, -215, -226, -236, -246, -254, -261, -267, -271, -274, -276, -277, -276, -274, -270, -264, -258, -249, -240, -228, -216, -201, -186, -169, -151, -132, -111, -90, -68, -44, -20, 3, 28, 54, 80, 106, 132, 158, 184, 209, 234, 258, 281, 304, 325, 345, 364, 381, 397, 411, 423, 433, 441, 447, 451, 453, 452, 449, 444, 436, 426, 413, 399, 381, 362, 340, 316, 289, 261, 231, 199, 165, 130, 93, 55, 16, -23, -63, -104, -145, -187, -228, -269, -310, -349, -388, -425, -461, -495, -528, -558, -586, -612, -635, -655, -673, -687, -698, -705, -709, -710, -707, -700, -690, -675, -657, -636, -610, -581, -549, -513, -473, -431, -385, -336, -285, -232, -176, -118, -59, 1, 64, 127, 190, 254, 318, 381, 444, 505, 566, 624, 680, 734, 786, 834, 879, 920, 957, 990, 1019, 1043, 1062, 1076, 1085, 1088, 1086, 1079, 1065, 1046, 1022, 991, 955, 913, 866, 814, 756, 693, 626, 554, 478, 398, 314, 228, 138, 46, -47, -143, -240, -337, -435, -532, -628, -723, -817, -907, -995, -1080, -1161, -1237, -1309, -1375, -1436, -1490, -1538, -1579, -1612, -1639, -1657, -1667, -1669, -1662, -1647, -1623, -1590, -1548, -1498, -1439, -1372, -1296, -1212, -1120, -1020, -913, -800, -680, -553, -422, -286, -145, 0, 146, 296, 447, 599, 752, 904, 1054, 1203, 1348, 1490, 1627, 1759, 1885, 2004, 2115, 2218, 2312, 2396, 2470, 2533, 2584, 2623, 2650, 2664, 2665, 2652, 2625, 2584, 2529, 2460, 2376, 2278, 2167, 2041, 1902, 1750, 1585, 1407, 1218, 1018, 808, 588, 359, 123, -120, -369, -623, -881, -1142, -1403, -1665, -1926, -2184, -2439, -2688, -2931, -3166, -3392, -3607, -3810, -4000, -4176, -4335, -4478, -4602, -4706, -4790, -4852, -4891, -4906, -4897, -4862, -4801, -4713, -4598, -4454, -4283, -4082, -3853, -3595, -3308, -2992, -2647, -2274, -1873, -1445, -990, -509, -3, 527, 1081, 1657, 2254, 2870, 3505, 4156, 4823, 5504, 6196, 6898, 7609, 8326, 9048, 9773, 10498, 11222, 11943, 12658, 13366, 14065, 14753, 15427, 16086, 16728, 17351, 17953, 18533, 19088, 19616, 20118, 20590, 21032, 21441, 21818, 22160, 22467, 22738, 22971, 23167, 23324, 23443, 23522, 23561, fceu-0.98.12/src/fir/c44100ntsc.scm0000755000175000000620000000037510003562763016302 0ustar joestaff00000000000000(title "44100 NTSC") (verbose #t) (cosine-symmetry) (filter-length 1024) (sampling-frequency 1789772.727272727272) (limit-= (band 0 15000) 1) (limit-= (band 22050 894886.363636) 0 .5) (output-file "c44100ntsc.coef") (plot-file "c44100ntsc.plot") (go) fceu-0.98.12/src/fir/c48000ntsc.scm0000755000175000000620000000037510003562763016305 0ustar joestaff00000000000000(title "48000 NTSC") (verbose #t) (cosine-symmetry) (filter-length 1024) (sampling-frequency 1789772.727272727272) (limit-= (band 0 17000) 1) (limit-= (band 24000 894886.363636) 0 .5) (output-file "c48000ntsc.coef") (plot-file "c48000ntsc.plot") (go) fceu-0.98.12/src/fir/c96000ntsc.scm0000755000175000000620000000037510003562763016310 0ustar joestaff00000000000000(title "96000 NTSC") (verbose #t) (cosine-symmetry) (filter-length 1024) (sampling-frequency 1789772.727272727272) (limit-= (band 0 36850) 1) (limit-= (band 48000 894886.363636) 0 .5) (output-file "c96000ntsc.coef") (plot-file "c96000ntsc.plot") (go) fceu-0.98.12/src/fir/c96000ntsc.coef0000755000175000000620000005130010003562763016434 0ustar joestaff00000000000000;; ***** 96000 NTSC ***** ;; Filter length: 1024 ;; Symmetry: cosine ;; Sampling frequency: 1789772.72727273 ;; Grid density: 10257 ;; Deviation parameter: y=-3.41994150089587e-6 ;; ;; Specifications: ;; (limit > 48000 894886.363636 0 0.5) ;; (limit < 48000 894886.363636 0 0.5) ;; (limit > 0 36000 1 1) ;; (limit < 0 36000 1 1) ;; ;; Coefficients: 6.25765784406859e-7 -5.74349474884059e-7 -4.38563052056152e-7 -4.2275208095965e-7 -4.22986843582035e-7 -4.62591739880567e-7 -4.87548260748437e-7 -5.09702102203457e-7 -5.53575138212173e-7 -5.58776629837758e-7 -5.61504899335206e-7 -5.87512127558038e-7 -5.61361967225389e-7 -5.3712751262779e-7 -5.01344341031087e-7 -4.53511011468631e-7 -3.38624331418706e-7 -2.44517851394823e-7 -1.54707945258839e-7 -5.05264098238236e-9 1.44876241366308e-7 2.81681324083492e-7 4.3227430974949e-7 6.00075575484758e-7 7.75112423789865e-7 9.21520058445204e-7 1.09935217260167e-6 1.25500772923897e-6 1.34551951148203e-6 1.46860535142565e-6 1.55182559228546e-6 1.60770440406623e-6 1.6294811644839e-6 1.61363975974438e-6 1.53782569699597e-6 1.43132387640668e-6 1.28959869628182e-6 1.10621331781889e-6 8.5785768415765e-7 6.04567255230193e-7 2.96426729531177e-7 -5.24862218589967e-8 -4.3476366150865e-7 -8.17500360283736e-7 -1.21281774093872e-6 -1.6246903514035e-6 -2.03191995568737e-6 -2.42034886505034e-6 -2.77710918199585e-6 -3.08872255757467e-6 -3.34868062209883e-6 -3.54951933335568e-6 -3.67684205210421e-6 -3.75096178007138e-6 -3.73781668478926e-6 -3.62820827681515e-6 -3.40106555337159e-6 -3.10558378787101e-6 -2.73085981209485e-6 -2.23880629643428e-6 -1.66299764538256e-6 -1.01450351451109e-6 -2.9897580679925e-7 4.778230486617e-7 1.30134942732076e-6 2.15698996474846e-6 3.01139455704895e-6 3.83150595451006e-6 4.6486553085021e-6 5.39866854742161e-6 6.0633779344053e-6 6.64505288826461e-6 7.10620984925846e-6 7.42554420262448e-6 7.5921592957585e-6 7.59604323829658e-6 7.4322223638238e-6 7.07019338593616e-6 6.5530535251783e-6 5.81138982456196e-6 4.93125339021914e-6 3.84118987018593e-6 2.62399132900517e-6 1.28261796938256e-6 -1.84404808868073e-7 -1.73983144001699e-6 -3.33935604298266e-6 -4.96530162809768e-6 -6.55816909846896e-6 -8.09156481962559e-6 -9.54514698333832e-6 -1.08541688245874e-5 -1.19812039266178e-5 -1.29258356094021e-5 -1.35864741790705e-5 -1.40143363153509e-5 -1.41096581487199e-5 -1.39167543346076e-5 -1.33693589565357e-5 -1.25232516456216e-5 -1.12945331543608e-5 -9.75795645920384e-6 -7.94061043444157e-6 -5.82669848029968e-6 -3.46810975732889e-6 -8.98080427581192e-7 1.83157780808837e-6 4.65462384661346e-6 7.49499200727654e-6 1.03647465427585e-5 1.31179949559878e-5 1.57239303578456e-5 1.80905523657776e-5 2.0183001663178e-5 2.19109883335264e-5 2.3237064442004e-5 2.41135213673391e-5 2.44756148778194e-5 2.42814484952927e-5 2.35477964026005e-5 2.22346916834176e-5 2.03698259249784e-5 1.79397096215955e-5 1.49707237863667e-5 1.15270292808691e-5 7.67266645113299e-6 3.44948129599163e-6 -1.07237403409055e-6 -5.75008290742105e-6 -1.05566723150875e-5 -1.53239936200644e-5 -1.99867517520571e-5 -2.44092890499766e-5 -2.8476946106292e-5 -3.21077759116387e-5 -3.51664827487924e-5 -3.75869046571029e-5 -3.92567099728606e-5 -4.01135752080094e-5 -4.01278786536825e-5 -3.92125256039437e-5 -3.73919246991607e-5 -3.46200271022937e-5 -3.09755908244563e-5 -2.64479100675461e-5 -2.11542725315722e-5 -1.50963566347366e-5 -8.47653619728616e-6 -1.37057784993502e-6 6.08602710173464e-6 1.37140404419924e-5 2.13787482610813e-5 2.88933776644191e-5 3.60545970430637e-5 4.27456382286692e-5 4.87313166822799e-5 5.38887103915501e-5 5.8058617211836e-5 6.10944817720679e-5 6.28816258498489e-5 6.3320088392269e-5 6.2383362148182e-5 5.99917552478514e-5 5.61760181265976e-5 5.08935610500647e-5 4.42950092732983e-5 3.6439179398353e-5 2.74298095627849e-5 1.74547874668573e-5 6.66515424198749e-6 -4.68762174381739e-6 -1.63848253814674e-5 -2.8182112834728e-5 -3.98156943957032e-5 -5.10302848833116e-5 -6.15260332171321e-5 -7.10668055624751e-5 -7.9381160780839e-5 -8.6241178990473e-5 -9.14514657680923e-5 -9.48068546980327e-5 -9.61699375283378e-5 -9.54489884121157e-5 -9.25431334779362e-5 -8.74787550676798e-5 -8.02605459808726e-5 -7.09737795002089e-5 -5.97576234894939e-5 -4.67784017657438e-5 -3.22960637446588e-5 -1.65036203311736e-5 1.8211835731409e-7 1.75262241794632e-5 3.50927801023099e-5 5.25300164078023e-5 6.94390025027894e-5 8.53884090898411e-5 1.00039703633977e-4 1.12981102411937e-4 1.23877401105374e-4 1.32393120309911e-4 1.38242615396576e-4 1.41266585644598e-4 1.4121817567785e-4 1.38042535292926e-4 1.31649152408872e-4 1.22120271607441e-4 1.09537433110581e-4 9.40746256399753e-5 7.59553413177967e-5 5.55488335464633e-5 3.31799427308997e-5 9.3129309380048e-6 -1.55984918923049e-5 -4.10035600300493e-5 -6.63607029679837e-5 -9.11217498548619e-5 -1.14693160653602e-4 -1.3649515371509e-4 -1.56012871346288e-4 -1.72712890799109e-4 -1.86143587824593e-4 -1.95867813754568e-4 -2.01564656263033e-4 -2.02972759290336e-4 -1.99940581124459e-4 -1.92322259909184e-4 -1.80218777351567e-4 -1.63698996808348e-4 -1.43003280779161e-4 -1.18465320314384e-4 -9.04917696812033e-5 -5.95982432996934e-5 -2.64033774281263e-5 8.46197218886673e-6 4.42652590354071e-5 8.02019609117841e-5 1.15541252681312e-4 1.49425273628651e-4 1.81062455609401e-4 2.09683164935054e-4 2.34566545855999e-4 2.55025900468172e-4 2.70467901918912e-4 2.80406359763515e-4 2.84407406120996e-4 2.82264151028901e-4 2.73776828577359e-4 2.5895765641908e-4 2.37953443006062e-4 2.1102114984442e-4 1.78588106227681e-4 1.41212212859299e-4 9.95536562423676e-5 5.44472498542575e-5 6.75449572476166e-6 -4.25222554328811e-5 -9.23549576825794e-5 -1.41631593345759e-4 -1.89235824337239e-4 -2.34097670788864e-4 -2.75097479638622e-4 -3.11248660924794e-4 -3.41546210305275e-4 -3.6520512783402e-4 -3.81480006450086e-4 -3.89787045113193e-4 -3.89714320620699e-4 -3.80996818757606e-4 -3.63624442874326e-4 -3.37695073721237e-4 -3.03528513188856e-4 -2.61672595277376e-4 -2.12805216855414e-4 -1.5784688743622e-4 -9.77861652078604e-5 -3.38688510549031e-5 3.2648755958072e-5 1.0033481570486e-4 1.67733200025968e-4 2.33335865754758e-4 2.95634963180971e-4 3.53183000686343e-4 4.0453284744819e-4 4.48399130268426e-4 4.83572426498987e-4 5.09056494666997e-4 5.24013376631556e-4 5.27803269367299e-4 5.20044733952871e-4 5.00570452769771e-4 4.69520604910353e-4 4.27212976261102e-4 3.74332302277009e-4 3.11719405101292e-4 2.4049642873856e-4 1.62018623241135e-4 7.77972401313209e-5 -1.0421191823049e-5 -1.00812954839322e-4 -1.91461604856559e-4 -2.80316135283874e-4 -3.65416962259402e-4 -4.44738742737373e-4 -5.16388437211181e-4 -5.7857587894405e-4 -6.29661563116967e-4 -6.68237124788548e-4 -6.93099922163973e-4 -7.03317710030114e-4 -6.98306631998326e-4 -6.77769213150651e-4 -6.41708348696407e-4 -5.90559386915195e-4 -5.25007863899402e-4 -4.46146123054525e-4 -3.55373132320712e-4 -2.54360156353956e-4 -1.45071717361813e-4 -2.97162036859542e-5 8.93270297991375e-5 2.09526647266989e-4 3.28243937050044e-4 4.42825108572239e-4 5.50664563111469e-4 6.49142096052024e-4 7.35899347492255e-4 8.08678813372905e-4 8.65523171991587e-4 9.04777569323206e-4 9.25107116181618e-4 9.25552318316001e-4 9.05640042608797e-4 8.65234115911146e-4 8.0473337889979e-4 7.24942146452377e-4 6.27117586694952e-4 5.12950399686843e-4 3.84563786119676e-4 2.44411218574473e-4 9.52682661182032e-5 -5.97889332973182e-5 -2.17502222608939e-4 -3.7445891759764e-4 -5.27167441451825e-4 -6.72193393846827e-4 -8.06079651608051e-4 -9.25663256011369e-4 -0.00102787495695661 -0.00111008900761353 -0.00116992392499094 -0.00120551745886091 -0.00121548371811249 -0.0011989248218485 -0.0011555522393021 -0.00108561639886755 -9.9000582500186e-4 -8.70172856666792e-4 -7.28120340175158e-4 -5.66433876277261e-4 -3.88151392209041e-4 -1.96801980103244e-4 3.75093312325743e-6 2.09322095650866e-4 4.1549713716762e-4 6.17799794351121e-4 8.11620934737964e-4 9.92538248565781e-4 0.00115617378867886 0.00129855548399389 0.00141597287741981 0.0015052170871903 0.00156360378300213 0.00158905340455267 0.00158018090872272 0.00153629897219207 0.00145746643569152 0.00134453135703501 0.00119910939952723 0.00102353850722866 8.20937608545406e-4 5.95027095905744e-4 3.50205434101682e-4 9.13465860120201e-5 -1.7622097696941e-4 -4.46838493896153e-4 -7.14664538170732e-4 -9.73687424753197e-4 -0.00121805258911382 -0.00144196600754232 -0.0016399967811266 -0.00180713029567505 -0.001938830336207 -0.00203135511114057 -0.00208158044812268 -0.00208731796144981 -0.00204724366396365 -0.00196104442646158 -0.00182936323384608 -0.00165389169291624 -0.0014372985389836 -0.00118323635265763 -8.96271981083588e-4 -5.81806731072718e-4 -2.45983969131179e-4 1.04393268705522e-4 4.62058789535929e-4 8.19362766165076e-4 0.00116846046706454 0.00150147763859084 0.00181068622281172 0.00208861201086775 0.00232834378817504 0.00252349896511836 0.00266859591166639 0.00275902790411783 0.00279124340926817 0.00276288498825251 0.00267283848815515 0.00252129596374058 0.00230975956455204 0.00204114448975825 0.00171962024485907 0.00135067945010547 9.40962894913222e-4 4.98221383153697e-4 3.11253989827009e-5 -4.50834653780459e-4 -9.37594792361491e-4 -0.00141868069476593 -0.00188337795207629 -0.00232105491343088 -0.00272131689968742 -0.00307423050019428 -0.00337059265933034 -0.00360213033363967 -0.0037616846970991 -0.00384345278070074 -0.00384308253291384 -0.00375783644187481 -0.00358674852203873 -0.0033306360078639 -0.00299217530772653 -0.00257588667746325 -0.00208809554811269 -0.00153691651385721 -9.32052699698408e-4 -2.84731720800277e-4 3.92575824923933e-4 0.00108624395731248 0.00178184935779994 0.002464387302064 0.0031185876084081 0.003729182192749 0.00428124852326713 0.00476054551468834 0.00515380348662816 0.00544899423639641 0.00563571869175492 0.00570538540965876 0.00565150400549031 0.00546990291198768 0.00515881834238826 0.00471916302694636 0.00415449166195703 0.00347110481638838 0.00267799125626014 0.00178683880102889 8.11802943926725e-4 -2.30562873065775e-4 -0.00132153102743281 -0.00244054733990411 -0.00356539492058686 -0.00467268587078703 -0.00573814176089155 -0.00673696915030418 -0.00764439443252765 -0.00843600526449621 -0.00908818810332266 -0.00957862488505226 -0.00988665936971963 -0.0099937068885515 -0.00988371464077663 -0.00954336583418968 -0.00896253186591292 -0.00813442269973128 -0.00705586455196647 -0.00572741237854925 -0.00415349209382152 -0.00234233959454067 -3.06098977672814e-4 0.00193941933088424 0.00437477465814811 0.00697721762570139 0.00972087552164101 0.0125771999157822 0.0155152397694249 0.0185021810309104 0.021503710104957 0.0244845910618796 0.0274091350854231 0.0302417753259086 0.0329475282481102 0.0354926172612528 0.0378449140820321 0.039974473230549 0.0418539747756063 0.0434591523630184 0.0447691888654274 0.0457670156843866 0.046439581452649 0.0467780781663164 0.0467780781663164 0.046439581452649 0.0457670156843866 0.0447691888654274 0.0434591523630184 0.0418539747756063 0.039974473230549 0.0378449140820321 0.0354926172612528 0.0329475282481102 0.0302417753259086 0.0274091350854231 0.0244845910618796 0.021503710104957 0.0185021810309104 0.0155152397694249 0.0125771999157822 0.00972087552164101 0.00697721762570139 0.00437477465814811 0.00193941933088424 -3.06098977672814e-4 -0.00234233959454067 -0.00415349209382152 -0.00572741237854925 -0.00705586455196647 -0.00813442269973128 -0.00896253186591292 -0.00954336583418968 -0.00988371464077663 -0.0099937068885515 -0.00988665936971963 -0.00957862488505226 -0.00908818810332266 -0.00843600526449621 -0.00764439443252765 -0.00673696915030418 -0.00573814176089155 -0.00467268587078703 -0.00356539492058686 -0.00244054733990411 -0.00132153102743281 -2.30562873065775e-4 8.11802943926725e-4 0.00178683880102889 0.00267799125626014 0.00347110481638838 0.00415449166195703 0.00471916302694636 0.00515881834238826 0.00546990291198768 0.00565150400549031 0.00570538540965876 0.00563571869175492 0.00544899423639641 0.00515380348662816 0.00476054551468834 0.00428124852326713 0.003729182192749 0.0031185876084081 0.002464387302064 0.00178184935779994 0.00108624395731248 3.92575824923933e-4 -2.84731720800277e-4 -9.32052699698408e-4 -0.00153691651385721 -0.00208809554811269 -0.00257588667746325 -0.00299217530772653 -0.0033306360078639 -0.00358674852203873 -0.00375783644187481 -0.00384308253291384 -0.00384345278070074 -0.0037616846970991 -0.00360213033363967 -0.00337059265933034 -0.00307423050019428 -0.00272131689968742 -0.00232105491343088 -0.00188337795207629 -0.00141868069476593 -9.37594792361491e-4 -4.50834653780459e-4 3.11253989827009e-5 4.98221383153697e-4 9.40962894913222e-4 0.00135067945010547 0.00171962024485907 0.00204114448975825 0.00230975956455204 0.00252129596374058 0.00267283848815515 0.00276288498825251 0.00279124340926817 0.00275902790411783 0.00266859591166639 0.00252349896511836 0.00232834378817504 0.00208861201086775 0.00181068622281172 0.00150147763859084 0.00116846046706454 8.19362766165076e-4 4.62058789535929e-4 1.04393268705522e-4 -2.45983969131179e-4 -5.81806731072718e-4 -8.96271981083588e-4 -0.00118323635265763 -0.0014372985389836 -0.00165389169291624 -0.00182936323384608 -0.00196104442646158 -0.00204724366396365 -0.00208731796144981 -0.00208158044812268 -0.00203135511114057 -0.001938830336207 -0.00180713029567505 -0.0016399967811266 -0.00144196600754232 -0.00121805258911382 -9.73687424753197e-4 -7.14664538170732e-4 -4.46838493896153e-4 -1.7622097696941e-4 9.13465860120201e-5 3.50205434101682e-4 5.95027095905744e-4 8.20937608545406e-4 0.00102353850722866 0.00119910939952723 0.00134453135703501 0.00145746643569152 0.00153629897219207 0.00158018090872272 0.00158905340455267 0.00156360378300213 0.0015052170871903 0.00141597287741981 0.00129855548399389 0.00115617378867886 9.92538248565781e-4 8.11620934737964e-4 6.17799794351121e-4 4.1549713716762e-4 2.09322095650866e-4 3.75093312325743e-6 -1.96801980103244e-4 -3.88151392209041e-4 -5.66433876277261e-4 -7.28120340175158e-4 -8.70172856666792e-4 -9.9000582500186e-4 -0.00108561639886755 -0.0011555522393021 -0.0011989248218485 -0.00121548371811249 -0.00120551745886091 -0.00116992392499094 -0.00111008900761353 -0.00102787495695661 -9.25663256011369e-4 -8.06079651608051e-4 -6.72193393846827e-4 -5.27167441451825e-4 -3.7445891759764e-4 -2.17502222608939e-4 -5.97889332973182e-5 9.52682661182032e-5 2.44411218574473e-4 3.84563786119676e-4 5.12950399686843e-4 6.27117586694952e-4 7.24942146452377e-4 8.0473337889979e-4 8.65234115911146e-4 9.05640042608797e-4 9.25552318316001e-4 9.25107116181618e-4 9.04777569323206e-4 8.65523171991587e-4 8.08678813372905e-4 7.35899347492255e-4 6.49142096052024e-4 5.50664563111469e-4 4.42825108572239e-4 3.28243937050044e-4 2.09526647266989e-4 8.93270297991375e-5 -2.97162036859542e-5 -1.45071717361813e-4 -2.54360156353956e-4 -3.55373132320712e-4 -4.46146123054525e-4 -5.25007863899402e-4 -5.90559386915195e-4 -6.41708348696407e-4 -6.77769213150651e-4 -6.98306631998326e-4 -7.03317710030114e-4 -6.93099922163973e-4 -6.68237124788548e-4 -6.29661563116967e-4 -5.7857587894405e-4 -5.16388437211181e-4 -4.44738742737373e-4 -3.65416962259402e-4 -2.80316135283874e-4 -1.91461604856559e-4 -1.00812954839322e-4 -1.0421191823049e-5 7.77972401313209e-5 1.62018623241135e-4 2.4049642873856e-4 3.11719405101292e-4 3.74332302277009e-4 4.27212976261102e-4 4.69520604910353e-4 5.00570452769771e-4 5.20044733952871e-4 5.27803269367299e-4 5.24013376631556e-4 5.09056494666997e-4 4.83572426498987e-4 4.48399130268426e-4 4.0453284744819e-4 3.53183000686343e-4 2.95634963180971e-4 2.33335865754758e-4 1.67733200025968e-4 1.0033481570486e-4 3.2648755958072e-5 -3.38688510549031e-5 -9.77861652078604e-5 -1.5784688743622e-4 -2.12805216855414e-4 -2.61672595277376e-4 -3.03528513188856e-4 -3.37695073721237e-4 -3.63624442874326e-4 -3.80996818757606e-4 -3.89714320620699e-4 -3.89787045113193e-4 -3.81480006450086e-4 -3.6520512783402e-4 -3.41546210305275e-4 -3.11248660924794e-4 -2.75097479638622e-4 -2.34097670788864e-4 -1.89235824337239e-4 -1.41631593345759e-4 -9.23549576825794e-5 -4.25222554328811e-5 6.75449572476166e-6 5.44472498542575e-5 9.95536562423676e-5 1.41212212859299e-4 1.78588106227681e-4 2.1102114984442e-4 2.37953443006062e-4 2.5895765641908e-4 2.73776828577359e-4 2.82264151028901e-4 2.84407406120996e-4 2.80406359763515e-4 2.70467901918912e-4 2.55025900468172e-4 2.34566545855999e-4 2.09683164935054e-4 1.81062455609401e-4 1.49425273628651e-4 1.15541252681312e-4 8.02019609117841e-5 4.42652590354071e-5 8.46197218886673e-6 -2.64033774281263e-5 -5.95982432996934e-5 -9.04917696812033e-5 -1.18465320314384e-4 -1.43003280779161e-4 -1.63698996808348e-4 -1.80218777351567e-4 -1.92322259909184e-4 -1.99940581124459e-4 -2.02972759290336e-4 -2.01564656263033e-4 -1.95867813754568e-4 -1.86143587824593e-4 -1.72712890799109e-4 -1.56012871346288e-4 -1.3649515371509e-4 -1.14693160653602e-4 -9.11217498548619e-5 -6.63607029679837e-5 -4.10035600300493e-5 -1.55984918923049e-5 9.3129309380048e-6 3.31799427308997e-5 5.55488335464633e-5 7.59553413177967e-5 9.40746256399753e-5 1.09537433110581e-4 1.22120271607441e-4 1.31649152408872e-4 1.38042535292926e-4 1.4121817567785e-4 1.41266585644598e-4 1.38242615396576e-4 1.32393120309911e-4 1.23877401105374e-4 1.12981102411937e-4 1.00039703633977e-4 8.53884090898411e-5 6.94390025027894e-5 5.25300164078023e-5 3.50927801023099e-5 1.75262241794632e-5 1.8211835731409e-7 -1.65036203311736e-5 -3.22960637446588e-5 -4.67784017657438e-5 -5.97576234894939e-5 -7.09737795002089e-5 -8.02605459808726e-5 -8.74787550676798e-5 -9.25431334779362e-5 -9.54489884121157e-5 -9.61699375283378e-5 -9.48068546980327e-5 -9.14514657680923e-5 -8.6241178990473e-5 -7.9381160780839e-5 -7.10668055624751e-5 -6.15260332171321e-5 -5.10302848833116e-5 -3.98156943957032e-5 -2.8182112834728e-5 -1.63848253814674e-5 -4.68762174381739e-6 6.66515424198749e-6 1.74547874668573e-5 2.74298095627849e-5 3.6439179398353e-5 4.42950092732983e-5 5.08935610500647e-5 5.61760181265976e-5 5.99917552478514e-5 6.2383362148182e-5 6.3320088392269e-5 6.28816258498489e-5 6.10944817720679e-5 5.8058617211836e-5 5.38887103915501e-5 4.87313166822799e-5 4.27456382286692e-5 3.60545970430637e-5 2.88933776644191e-5 2.13787482610813e-5 1.37140404419924e-5 6.08602710173464e-6 -1.37057784993502e-6 -8.47653619728616e-6 -1.50963566347366e-5 -2.11542725315722e-5 -2.64479100675461e-5 -3.09755908244563e-5 -3.46200271022937e-5 -3.73919246991607e-5 -3.92125256039437e-5 -4.01278786536825e-5 -4.01135752080094e-5 -3.92567099728606e-5 -3.75869046571029e-5 -3.51664827487924e-5 -3.21077759116387e-5 -2.8476946106292e-5 -2.44092890499766e-5 -1.99867517520571e-5 -1.53239936200644e-5 -1.05566723150875e-5 -5.75008290742105e-6 -1.07237403409055e-6 3.44948129599163e-6 7.67266645113299e-6 1.15270292808691e-5 1.49707237863667e-5 1.79397096215955e-5 2.03698259249784e-5 2.22346916834176e-5 2.35477964026005e-5 2.42814484952927e-5 2.44756148778194e-5 2.41135213673391e-5 2.3237064442004e-5 2.19109883335264e-5 2.0183001663178e-5 1.80905523657776e-5 1.57239303578456e-5 1.31179949559878e-5 1.03647465427585e-5 7.49499200727654e-6 4.65462384661346e-6 1.83157780808837e-6 -8.98080427581192e-7 -3.46810975732889e-6 -5.82669848029968e-6 -7.94061043444157e-6 -9.75795645920384e-6 -1.12945331543608e-5 -1.25232516456216e-5 -1.33693589565357e-5 -1.39167543346076e-5 -1.41096581487199e-5 -1.40143363153509e-5 -1.35864741790705e-5 -1.29258356094021e-5 -1.19812039266178e-5 -1.08541688245874e-5 -9.54514698333832e-6 -8.09156481962559e-6 -6.55816909846896e-6 -4.96530162809768e-6 -3.33935604298266e-6 -1.73983144001699e-6 -1.84404808868073e-7 1.28261796938256e-6 2.62399132900517e-6 3.84118987018593e-6 4.93125339021914e-6 5.81138982456196e-6 6.5530535251783e-6 7.07019338593616e-6 7.4322223638238e-6 7.59604323829658e-6 7.5921592957585e-6 7.42554420262448e-6 7.10620984925846e-6 6.64505288826461e-6 6.0633779344053e-6 5.39866854742161e-6 4.6486553085021e-6 3.83150595451006e-6 3.01139455704895e-6 2.15698996474846e-6 1.30134942732076e-6 4.778230486617e-7 -2.9897580679925e-7 -1.01450351451109e-6 -1.66299764538256e-6 -2.23880629643428e-6 -2.73085981209485e-6 -3.10558378787101e-6 -3.40106555337159e-6 -3.62820827681515e-6 -3.73781668478926e-6 -3.75096178007138e-6 -3.67684205210421e-6 -3.54951933335568e-6 -3.34868062209883e-6 -3.08872255757467e-6 -2.77710918199585e-6 -2.42034886505034e-6 -2.03191995568737e-6 -1.6246903514035e-6 -1.21281774093872e-6 -8.17500360283736e-7 -4.3476366150865e-7 -5.24862218589967e-8 2.96426729531177e-7 6.04567255230193e-7 8.5785768415765e-7 1.10621331781889e-6 1.28959869628182e-6 1.43132387640668e-6 1.53782569699597e-6 1.61363975974438e-6 1.6294811644839e-6 1.60770440406623e-6 1.55182559228546e-6 1.46860535142565e-6 1.34551951148203e-6 1.25500772923897e-6 1.09935217260167e-6 9.21520058445204e-7 7.75112423789865e-7 6.00075575484758e-7 4.3227430974949e-7 2.81681324083492e-7 1.44876241366308e-7 -5.05264098238236e-9 -1.54707945258839e-7 -2.44517851394823e-7 -3.38624331418706e-7 -4.53511011468631e-7 -5.01344341031087e-7 -5.3712751262779e-7 -5.61361967225389e-7 -5.87512127558038e-7 -5.61504899335206e-7 -5.58776629837758e-7 -5.53575138212173e-7 -5.09702102203457e-7 -4.87548260748437e-7 -4.62591739880567e-7 -4.22986843582035e-7 -4.2275208095965e-7 -4.38563052056152e-7 -5.74349474884059e-7 6.25765784406859e-7 fceu-0.98.12/src/fir/c48000ntsc.h0000644000175000000620000000536510003562763015753 0ustar joestaff00000000000000-115, -12, -13, -14, -14, -14, -15, -15, -15, -15, -15, -15, -15, -15, -14, -14, -13, -12, -11, -10, -9, -8, -7, -5, -3, -2, 0, 1, 3, 5, 7, 10, 12, 14, 17, 19, 22, 24, 26, 29, 31, 33, 35, 37, 39, 41, 42, 44, 45, 46, 47, 48, 48, 48, 48, 48, 47, 47, 45, 44, 42, 40, 38, 35, 33, 30, 26, 23, 19, 15, 10, 6, 1, -3, -8, -13, -18, -23, -28, -33, -39, -44, -49, -54, -59, -63, -68, -72, -76, -80, -83, -86, -88, -91, -92, -94, -94, -95, -94, -93, -92, -90, -88, -85, -81, -77, -73, -67, -62, -55, -49, -42, -34, -26, -18, -9, 0, 9, 18, 28, 38, 48, 57, 67, 77, 87, 96, 106, 114, 123, 131, 139, 146, 152, 158, 163, 168, 171, 174, 176, 177, 177, 177, 175, 172, 168, 164, 158, 151, 143, 135, 125, 115, 103, 91, 78, 65, 50, 35, 20, 3, -12, -29, -46, -63, -80, -98, -115, -132, -148, -165, -180, -196, -210, -224, -237, -248, -259, -269, -277, -285, -290, -295, -298, -299, -299, -297, -294, -289, -282, -274, -264, -252, -239, -224, -208, -190, -171, -151, -129, -106, -82, -57, -31, -5, 22, 49, 77, 105, 134, 162, 190, 217, 244, 270, 295, 320, 343, 365, 385, 404, 421, 436, 449, 460, 469, 475, 479, 481, 480, 477, 471, 462, 451, 437, 421, 402, 380, 357, 330, 302, 271, 238, 203, 167, 129, 89, 48, 6, -35, -79, -123, -167, -211, -255, -298, -341, -383, -423, -462, -500, -535, -569, -600, -628, -654, -677, -697, -713, -726, -735, -741, -743, -741, -735, -725, -711, -693, -671, -645, -616, -582, -545, -504, -459, -412, -361, -307, -251, -192, -132, -69, -5, 60, 126, 193, 260, 328, 394, 460, 525, 588, 650, 709, 765, 819, 869, 916, 958, 997, 1031, 1060, 1084, 1103, 1116, 1124, 1126, 1123, 1113, 1097, 1075, 1047, 1013, 973, 928, 876, 819, 756, 689, 616, 539, 457, 372, 283, 190, 95, -1, -100, -201, -302, -404, -506, -607, -706, -804, -900, -993, -1082, -1167, -1248, -1324, -1395, -1459, -1517, -1569, -1613, -1649, -1678, -1698, -1710, -1713, -1707, -1692, -1667, -1634, -1591, -1539, -1478, -1408, -1329, -1242, -1146, -1043, -931, -813, -688, -556, -419, -277, -131, 19, 172, 328, 485, 643, 801, 958, 1113, 1266, 1416, 1561, 1702, 1836, 1964, 2085, 2197, 2300, 2393, 2476, 2548, 2608, 2656, 2690, 2712, 2720, 2713, 2692, 2657, 2607, 2542, 2462, 2367, 2257, 2133, 1994, 1842, 1676, 1497, 1305, 1102, 888, 663, 430, 187, -61, -317, -579, -844, -1113, -1383, -1653, -1922, -2189, -2452, -2709, -2960, -3203, -3437, -3659, -3869, -4065, -4245, -4409, -4556, -4682, -4789, -4873, -4935, -4973, -4986, -4972, -4933, -4865, -4770, -4646, -4492, -4309, -4096, -3853, -3579, -3276, -2942, -2578, -2185, -1763, -1313, -835, -330, 200, 755, 1335, 1937, 2560, 3203, 3864, 4543, 5236, 5942, 6660, 7387, 8122, 8863, 9608, 10354, 11099, 11842, 12580, 13311, 14033, 14745, 15443, 16125, 16791, 17436, 18061, 18663, 19239, 19789, 20310, 20801, 21261, 21687, 22079, 22435, 22755, 23037, 23281, 23485, 23649, 23772, 23854, 23896, fceu-0.98.12/src/fir/c44100ntsc.coef0000755000175000000620000005124410003562763016435 0ustar joestaff00000000000000;; ***** 44100 NTSC ***** ;; Filter length: 1024 ;; Symmetry: cosine ;; Sampling frequency: 1789772.72727273 ;; Grid density: 10257 ;; Deviation parameter: y=-4.26609210258497e-4 ;; ;; Specifications: ;; (limit > 22050 894886.363636 0 0.5) ;; (limit < 22050 894886.363636 0 0.5) ;; (limit > 0 15000 1 1) ;; (limit < 0 15000 1 1) ;; ;; Coefficients: 1.11262153794412e-4 9.1203952189514e-6 9.4094541490789e-6 9.63661279581735e-6 9.84815294136282e-6 9.96211856753532e-6 1.00189663896491e-5 1.00061013360251e-5 9.93435399969655e-6 9.78762126385669e-6 9.55321925729624e-6 9.24825080375786e-6 8.85255837386989e-6 8.3877114761375e-6 7.82178714333584e-6 7.1788229094432e-6 6.44522053069757e-6 5.62630847050353e-6 4.71582963040218e-6 3.72380169562418e-6 2.64841660044426e-6 1.49502905722044e-6 2.5217761121751e-7 -1.05186474836932e-6 -2.43551352329469e-6 -3.89295417250434e-6 -5.42664110084146e-6 -7.00566917418741e-6 -8.6368208569906e-6 -1.03114527925382e-5 -1.20443408108932e-5 -1.38216102337816e-5 -1.56130215867248e-5 -1.74276497066345e-5 -1.9254250127445e-5 -2.1098626694142e-5 -2.29097403788758e-5 -2.47248863743773e-5 -2.64998143086568e-5 -2.82478400091917e-5 -2.99318307877882e-5 -3.15778370419873e-5 -3.31419021725666e-5 -3.46367208626458e-5 -3.60349486303977e-5 -3.73560747385557e-5 -3.85602232740176e-5 -3.96502202312979e-5 -4.06110449657408e-5 -4.14368419481133e-5 -4.21090019281467e-5 -4.25993967830844e-5 -4.29068991904435e-5 -4.3025032131568e-5 -4.30140517026991e-5 -4.28433545718674e-5 -4.25296899490834e-5 -4.17374194914376e-5 -4.10040920794666e-5 -3.99666912810865e-5 -3.87371755083029e-5 -3.72607458775728e-5 -3.55874669626075e-5 -3.36986152823895e-5 -3.16000530912765e-5 -2.92767128040033e-5 -2.67371187168457e-5 -2.40039338911553e-5 -2.10604880457374e-5 -1.79335828101573e-5 -1.46133694055927e-5 -1.11253968130194e-5 -7.46614405238464e-6 -3.64613498607798e-6 3.02368354254293e-7 4.39158630158039e-6 8.58777072285901e-6 1.28879143039278e-5 1.72582028358521e-5 2.16969577994228e-5 2.61829629831333e-5 3.06979810398452e-5 3.52209058193995e-5 3.97300635833027e-5 4.42050962120303e-5 4.86055004649174e-5 5.29441057028915e-5 5.71712798076152e-5 6.1268495205598e-5 6.52195501855984e-5 6.90007266683825e-5 7.25913577445526e-5 7.59499489511726e-5 7.90918784345419e-5 8.19505156283039e-5 8.45470657873134e-5 8.68293263041973e-5 8.88086064198062e-5 9.041692946077e-5 9.16797599287126e-5 9.25599457920887e-5 9.30552765000977e-5 9.31313982341795e-5 9.27936061980597e-5 9.20420846305276e-5 9.08521132221629e-5 8.92085476183645e-5 8.71017975335516e-5 8.45414314948811e-5 8.15311641149105e-5 7.80711279919507e-5 7.41574998124299e-5 6.97895128455476e-5 6.4947479038247e-5 5.97479711603871e-5 5.40630354898453e-5 4.79856481353068e-5 4.15182368501593e-5 3.46802768321681e-5 2.74958585451822e-5 1.9976788603383e-5 1.21472923550567e-5 4.04120472382678e-6 -4.30770705476995e-6 -1.28821872779466e-5 -2.16320221744917e-5 -3.05324054839951e-5 -3.95504446928096e-5 -4.86452773517834e-5 -5.7776933929632e-5 -6.6888917187142e-5 -7.59839395688362e-5 -8.49770646155345e-5 -9.38485765943731e-5 -1.02535728955288e-4 -1.11020769697226e-4 -1.19224175025087e-4 -1.2712371399013e-4 -1.34677854331765e-4 -1.41855973321246e-4 -1.48585528294192e-4 -1.54823475008983e-4 -1.60563784962364e-4 -1.65737939175439e-4 -1.70324767136095e-4 -1.74273576399229e-4 -1.77562540511869e-4 -1.80153948404509e-4 -1.82017783412252e-4 -1.83125404333719e-4 -1.83446338947795e-4 -1.82987530180017e-4 -1.81703356594349e-4 -1.79590850554495e-4 -1.76619461091599e-4 -1.72815899566497e-4 -1.68147649678904e-4 -1.62620596029299e-4 -1.56237231040979e-4 -1.49008305143425e-4 -1.40957023196796e-4 -1.32072008950485e-4 -1.22389162483219e-4 -1.11934088499394e-4 -1.00737065257502e-4 -8.88160519212646e-5 -7.61930807071772e-5 -6.29496222727675e-5 -4.91050367300618e-5 -3.4718130025881e-5 -1.98160195514693e-5 -4.45731586994588e-6 1.12803144028591e-5 2.73309987906755e-5 4.36737905686176e-5 6.01909058617092e-5 7.68545149813897e-5 9.35675866162103e-5 1.10269459400764e-4 1.26883165335663e-4 1.43335855360237e-4 1.5954241113618e-4 1.7543332757703e-4 1.90940022499485e-4 2.05960757764001e-4 2.20430019515099e-4 2.34260760602835e-4 2.47409140535342e-4 2.59761075613858e-4 2.71275815558309e-4 2.81867857874407e-4 2.91473514559014e-4 3.00005851286105e-4 3.07432616093836e-4 3.136935557549e-4 3.18736128450691e-4 3.22478991985463e-4 3.24900573947518e-4 3.25973108476246e-4 3.25641186246162e-4 3.23884645760423e-4 3.20666060011718e-4 3.15989435094453e-4 3.09830843773395e-4 3.02185552345498e-4 2.93038759521248e-4 2.82430889955413e-4 2.70353445973182e-4 2.56830966886862e-4 2.41887536833496e-4 2.25571633496883e-4 2.07916002422089e-4 1.88968510710595e-4 1.68789504787793e-4 1.47443939450696e-4 1.24981317138686e-4 1.01499245340524e-4 7.70572862247137e-5 5.17676358522932e-5 2.57118134228229e-5 -1.01754062817161e-6 -2.83262175890525e-5 -5.60999252995387e-5 -8.41915010649744e-5 -1.1252906652508e-4 -1.40975352908305e-4 -1.69434579431538e-4 -1.97729073916177e-4 -2.25769653344743e-4 -2.53411042361576e-4 -2.80565122507133e-4 -3.07036438304828e-4 -3.32753626249541e-4 -3.57541896186656e-4 -3.81307666526521e-4 -4.0391150118367e-4 -4.25231243203619e-4 -4.45145780258752e-4 -4.63545025829737e-4 -4.80322675164487e-4 -4.95350782085733e-4 -5.08549438324035e-4 -5.1980265947403e-4 -5.29043766376402e-4 -5.36172525139055e-4 -5.41133538554177e-4 -5.43848643414634e-4 -5.44256723291212e-4 -5.42320002202435e-4 -5.37993404337165e-4 -5.3125334500245e-4 -5.22075219690071e-4 -5.10445445493085e-4 -4.96377734888716e-4 -4.79880717778625e-4 -4.60971283056312e-4 -4.39684651488982e-4 -4.16063905823169e-4 -3.90177619816529e-4 -3.62085220183381e-4 -3.31863091675268e-4 -2.99597107541406e-4 -2.65413754083361e-4 -2.29377222808396e-4 -1.91654451928034e-4 -1.52344557932817e-4 -1.11608104095083e-4 -6.95603957788035e-5 -2.64016442748731e-5 1.7724163386627e-5 6.26416184275484e-5 1.08189979248416e-4 1.54147272535691e-4 2.00349856093844e-4 2.46587459314576e-4 2.92670674130578e-4 3.38391411475662e-4 3.83540211401206e-4 4.27913576964888e-4 4.71300626361147e-4 5.13512876149826e-4 5.54323952929787e-4 5.93537470537219e-4 6.3093434662098e-4 6.66344965329304e-4 6.99565407441501e-4 7.30423799872388e-4 7.58708693685015e-4 7.8427979033147e-4 8.06945553271288e-4 8.26584756687851e-4 8.43031977801634e-4 8.56156258972257e-4 8.65836592594565e-4 8.71968746552343e-4 8.74461813660048e-4 8.73231202274345e-4 8.68218292668308e-4 8.59348624025311e-4 8.46612447774565e-4 8.29979222422541e-4 8.09446427744043e-4 7.85031357561925e-4 7.56766215319943e-4 7.2470699047867e-4 6.88883919685657e-4 6.49416331024001e-4 6.06391057283913e-4 5.59935330476022e-4 5.10167371200662e-4 4.57252072332643e-4 4.01354265598951e-4 3.42656496994208e-4 2.81355941136781e-4 2.17670656870967e-4 1.51832975264559e-4 8.40749859869234e-5 1.46584064604961e-5 -5.61496056174954e-5 -1.28086904625854e-4 -2.00818433548331e-4 -2.7409972137809e-4 -3.47601002332966e-4 -4.21031974632111e-4 -4.94030730396776e-4 -5.66317666429227e-4 -6.37548654873925e-4 -7.07408810891205e-4 -7.75547530396904e-4 -8.41675004612485e-4 -9.05453133996662e-4 -9.66558548716224e-4 -0.00102466993047469 -0.00107948243327616 -0.00113072204795905 -0.0011780892664915 -0.0012212925453813 -0.00126007236261203 -0.00129417936102408 -0.00132338623135961 -0.0013474534440369 -0.0013662023453885 -0.00137942837511788 -0.00138698055366682 -0.00138870045367779 -0.00138448957970039 -0.00137424428374859 -0.00135788629777192 -0.00133536298920924 -0.00130665165054127 -0.0012717543272168 -0.00123070624585239 -0.00118356717926831 -0.00113040319129687 -0.00107131700797982 -0.00100646498239645 -9.35995104217189e-4 -8.60096571782921e-4 -7.78998336060133e-4 -6.92940701872996e-4 -6.02182768095548e-4 -5.07003036815179e-4 -4.07757323218773e-4 -3.04760010372766e-4 -1.98383609989422e-4 -8.89918915329279e-5 2.29793702787778e-5 1.37122990345803e-4 2.5299360795038e-4 3.70143341115017e-4 4.88088953030987e-4 6.06342750948422e-4 7.24424959757904e-4 8.41821410938308e-4 9.58029848643689e-4 0.00107251650886565 0.00118475391682864 0.00129425308462396 0.00140047084052004 0.0015028980384223 0.00160100966703419 0.00169431442637767 0.00178229788006395 0.00186449094208792 0.00194041558775561 0.00200963542959276 0.00207169741768017 0.00212618334414435 0.00217270035390745 0.00221088750080458 0.00224042087255895 0.00226095514052231 0.00227220321739892 0.00227394132978118 0.00226594070088644 0.00224802424476919 0.00222001601735845 0.00218185426405224 0.00213342446297001 0.00207473710872034 0.00200576081219353 0.00192660143920357 0.00183730661827725 0.00173804987265467 0.00162899296733253 0.00151036806619154 0.00138244091224245 0.00124553715590493 0.00110001314361977 9.46246978211101e-4 7.84695240224382e-4 6.15844939874971e-4 4.4020774824205e-4 2.58345305088762e-4 7.08612579074651e-5 -1.21606350631308e-4 -3.18395388345862e-4 -5.1879155790156e-4 -7.22062937747848e-4 -9.27451114779463e-4 -0.00113416157741747 -0.00134138689888361 -0.00154827070291184 -0.00175397288566918 -0.0019576116273234 -0.00215831253617746 -0.00235515587055034 -0.00254724254904768 -0.00273366690374425 -0.00291350898429464 -0.00308585950693817 -0.00324979222163811 -0.00340441875730436 -0.00354884211798964 -0.00368218571253443 -0.00380358990740782 -0.00391221887526166 -0.00400723057140825 -0.00408785624750138 -0.004153333003793 -0.00420292395555919 -0.00423593387073267 -0.00425171118587346 -0.00424964450870412 -0.00422915907860119 -0.0041897356858097 -0.0041309026307971 -0.00405221509383098 -0.00395331866912401 -0.00383391116350846 -0.00369371631770201 -0.00353253640058538 -0.00335022403053123 -0.00314672640265953 -0.00292200117900966 -0.00267612720029126 -0.0024091787521236 -0.00212137053496313 -0.00181290180786275 -0.00148412961640828 -0.0011353892343628 -7.67128314412436e-4 -3.79839813513112e-4 2.59043686551276e-5 4.494860301294e-4 8.90225310173371e-4 0.00134736056332534 0.00182009665332689 0.00230757943767435 0.00280890399487952 0.00332310364103925 0.00384915066180797 0.00438599870804931 0.00493254091385408 0.00548765927782258 0.00605013603781409 0.00661878037036735 0.00719234109024943 0.00776954418385769 0.008349090387754 0.0089296683452915 0.00950994984323646 0.0100885721308606 0.0106641926633217 0.0112354494946774 0.0118009885819235 0.0123594520486416 0.0129094923924999 0.0134497740224004 0.0139789646616159 0.0144957819012448 0.0149989403071262 0.0154871953429542 0.0159593047296737 0.0164141332589184 0.0168504983748113 0.0172673032190162 0.0176634911539869 0.0180380745830505 0.018390088086466 0.0187186209562544 0.0190228378422047 0.0193019578242075 0.0195552647135139 0.0197821099505764 0.0199819035649561 0.0201541247940216 0.0202983267902526 0.0204141411144792 0.0205012617098339 0.0205594794331608 0.0205886274212954 0.0205886274212954 0.0205594794331608 0.0205012617098339 0.0204141411144792 0.0202983267902526 0.0201541247940216 0.0199819035649561 0.0197821099505764 0.0195552647135139 0.0193019578242075 0.0190228378422047 0.0187186209562544 0.018390088086466 0.0180380745830505 0.0176634911539869 0.0172673032190162 0.0168504983748113 0.0164141332589184 0.0159593047296737 0.0154871953429542 0.0149989403071262 0.0144957819012448 0.0139789646616159 0.0134497740224004 0.0129094923924999 0.0123594520486416 0.0118009885819235 0.0112354494946774 0.0106641926633217 0.0100885721308606 0.00950994984323646 0.0089296683452915 0.008349090387754 0.00776954418385769 0.00719234109024943 0.00661878037036735 0.00605013603781409 0.00548765927782258 0.00493254091385408 0.00438599870804931 0.00384915066180797 0.00332310364103925 0.00280890399487952 0.00230757943767435 0.00182009665332689 0.00134736056332534 8.90225310173371e-4 4.494860301294e-4 2.59043686551276e-5 -3.79839813513112e-4 -7.67128314412436e-4 -0.0011353892343628 -0.00148412961640828 -0.00181290180786275 -0.00212137053496313 -0.0024091787521236 -0.00267612720029126 -0.00292200117900966 -0.00314672640265953 -0.00335022403053123 -0.00353253640058538 -0.00369371631770201 -0.00383391116350846 -0.00395331866912401 -0.00405221509383098 -0.0041309026307971 -0.0041897356858097 -0.00422915907860119 -0.00424964450870412 -0.00425171118587346 -0.00423593387073267 -0.00420292395555919 -0.004153333003793 -0.00408785624750138 -0.00400723057140825 -0.00391221887526166 -0.00380358990740782 -0.00368218571253443 -0.00354884211798964 -0.00340441875730436 -0.00324979222163811 -0.00308585950693817 -0.00291350898429464 -0.00273366690374425 -0.00254724254904768 -0.00235515587055034 -0.00215831253617746 -0.0019576116273234 -0.00175397288566918 -0.00154827070291184 -0.00134138689888361 -0.00113416157741747 -9.27451114779463e-4 -7.22062937747848e-4 -5.1879155790156e-4 -3.18395388345862e-4 -1.21606350631308e-4 7.08612579074651e-5 2.58345305088762e-4 4.4020774824205e-4 6.15844939874971e-4 7.84695240224382e-4 9.46246978211101e-4 0.00110001314361977 0.00124553715590493 0.00138244091224245 0.00151036806619154 0.00162899296733253 0.00173804987265467 0.00183730661827725 0.00192660143920357 0.00200576081219353 0.00207473710872034 0.00213342446297001 0.00218185426405224 0.00222001601735845 0.00224802424476919 0.00226594070088644 0.00227394132978118 0.00227220321739892 0.00226095514052231 0.00224042087255895 0.00221088750080458 0.00217270035390745 0.00212618334414435 0.00207169741768017 0.00200963542959276 0.00194041558775561 0.00186449094208792 0.00178229788006395 0.00169431442637767 0.00160100966703419 0.0015028980384223 0.00140047084052004 0.00129425308462396 0.00118475391682864 0.00107251650886565 9.58029848643689e-4 8.41821410938308e-4 7.24424959757904e-4 6.06342750948422e-4 4.88088953030987e-4 3.70143341115017e-4 2.5299360795038e-4 1.37122990345803e-4 2.29793702787778e-5 -8.89918915329279e-5 -1.98383609989422e-4 -3.04760010372766e-4 -4.07757323218773e-4 -5.07003036815179e-4 -6.02182768095548e-4 -6.92940701872996e-4 -7.78998336060133e-4 -8.60096571782921e-4 -9.35995104217189e-4 -0.00100646498239645 -0.00107131700797982 -0.00113040319129687 -0.00118356717926831 -0.00123070624585239 -0.0012717543272168 -0.00130665165054127 -0.00133536298920924 -0.00135788629777192 -0.00137424428374859 -0.00138448957970039 -0.00138870045367779 -0.00138698055366682 -0.00137942837511788 -0.0013662023453885 -0.0013474534440369 -0.00132338623135961 -0.00129417936102408 -0.00126007236261203 -0.0012212925453813 -0.0011780892664915 -0.00113072204795905 -0.00107948243327616 -0.00102466993047469 -9.66558548716224e-4 -9.05453133996662e-4 -8.41675004612485e-4 -7.75547530396904e-4 -7.07408810891205e-4 -6.37548654873925e-4 -5.66317666429227e-4 -4.94030730396776e-4 -4.21031974632111e-4 -3.47601002332966e-4 -2.7409972137809e-4 -2.00818433548331e-4 -1.28086904625854e-4 -5.61496056174954e-5 1.46584064604961e-5 8.40749859869234e-5 1.51832975264559e-4 2.17670656870967e-4 2.81355941136781e-4 3.42656496994208e-4 4.01354265598951e-4 4.57252072332643e-4 5.10167371200662e-4 5.59935330476022e-4 6.06391057283913e-4 6.49416331024001e-4 6.88883919685657e-4 7.2470699047867e-4 7.56766215319943e-4 7.85031357561925e-4 8.09446427744043e-4 8.29979222422541e-4 8.46612447774565e-4 8.59348624025311e-4 8.68218292668308e-4 8.73231202274345e-4 8.74461813660048e-4 8.71968746552343e-4 8.65836592594565e-4 8.56156258972257e-4 8.43031977801634e-4 8.26584756687851e-4 8.06945553271288e-4 7.8427979033147e-4 7.58708693685015e-4 7.30423799872388e-4 6.99565407441501e-4 6.66344965329304e-4 6.3093434662098e-4 5.93537470537219e-4 5.54323952929787e-4 5.13512876149826e-4 4.71300626361147e-4 4.27913576964888e-4 3.83540211401206e-4 3.38391411475662e-4 2.92670674130578e-4 2.46587459314576e-4 2.00349856093844e-4 1.54147272535691e-4 1.08189979248416e-4 6.26416184275484e-5 1.7724163386627e-5 -2.64016442748731e-5 -6.95603957788035e-5 -1.11608104095083e-4 -1.52344557932817e-4 -1.91654451928034e-4 -2.29377222808396e-4 -2.65413754083361e-4 -2.99597107541406e-4 -3.31863091675268e-4 -3.62085220183381e-4 -3.90177619816529e-4 -4.16063905823169e-4 -4.39684651488982e-4 -4.60971283056312e-4 -4.79880717778625e-4 -4.96377734888716e-4 -5.10445445493085e-4 -5.22075219690071e-4 -5.3125334500245e-4 -5.37993404337165e-4 -5.42320002202435e-4 -5.44256723291212e-4 -5.43848643414634e-4 -5.41133538554177e-4 -5.36172525139055e-4 -5.29043766376402e-4 -5.1980265947403e-4 -5.08549438324035e-4 -4.95350782085733e-4 -4.80322675164487e-4 -4.63545025829737e-4 -4.45145780258752e-4 -4.25231243203619e-4 -4.0391150118367e-4 -3.81307666526521e-4 -3.57541896186656e-4 -3.32753626249541e-4 -3.07036438304828e-4 -2.80565122507133e-4 -2.53411042361576e-4 -2.25769653344743e-4 -1.97729073916177e-4 -1.69434579431538e-4 -1.40975352908305e-4 -1.1252906652508e-4 -8.41915010649744e-5 -5.60999252995387e-5 -2.83262175890525e-5 -1.01754062817161e-6 2.57118134228229e-5 5.17676358522932e-5 7.70572862247137e-5 1.01499245340524e-4 1.24981317138686e-4 1.47443939450696e-4 1.68789504787793e-4 1.88968510710595e-4 2.07916002422089e-4 2.25571633496883e-4 2.41887536833496e-4 2.56830966886862e-4 2.70353445973182e-4 2.82430889955413e-4 2.93038759521248e-4 3.02185552345498e-4 3.09830843773395e-4 3.15989435094453e-4 3.20666060011718e-4 3.23884645760423e-4 3.25641186246162e-4 3.25973108476246e-4 3.24900573947518e-4 3.22478991985463e-4 3.18736128450691e-4 3.136935557549e-4 3.07432616093836e-4 3.00005851286105e-4 2.91473514559014e-4 2.81867857874407e-4 2.71275815558309e-4 2.59761075613858e-4 2.47409140535342e-4 2.34260760602835e-4 2.20430019515099e-4 2.05960757764001e-4 1.90940022499485e-4 1.7543332757703e-4 1.5954241113618e-4 1.43335855360237e-4 1.26883165335663e-4 1.10269459400764e-4 9.35675866162103e-5 7.68545149813897e-5 6.01909058617092e-5 4.36737905686176e-5 2.73309987906755e-5 1.12803144028591e-5 -4.45731586994588e-6 -1.98160195514693e-5 -3.4718130025881e-5 -4.91050367300618e-5 -6.29496222727675e-5 -7.61930807071772e-5 -8.88160519212646e-5 -1.00737065257502e-4 -1.11934088499394e-4 -1.22389162483219e-4 -1.32072008950485e-4 -1.40957023196796e-4 -1.49008305143425e-4 -1.56237231040979e-4 -1.62620596029299e-4 -1.68147649678904e-4 -1.72815899566497e-4 -1.76619461091599e-4 -1.79590850554495e-4 -1.81703356594349e-4 -1.82987530180017e-4 -1.83446338947795e-4 -1.83125404333719e-4 -1.82017783412252e-4 -1.80153948404509e-4 -1.77562540511869e-4 -1.74273576399229e-4 -1.70324767136095e-4 -1.65737939175439e-4 -1.60563784962364e-4 -1.54823475008983e-4 -1.48585528294192e-4 -1.41855973321246e-4 -1.34677854331765e-4 -1.2712371399013e-4 -1.19224175025087e-4 -1.11020769697226e-4 -1.02535728955288e-4 -9.38485765943731e-5 -8.49770646155345e-5 -7.59839395688362e-5 -6.6888917187142e-5 -5.7776933929632e-5 -4.86452773517834e-5 -3.95504446928096e-5 -3.05324054839951e-5 -2.16320221744917e-5 -1.28821872779466e-5 -4.30770705476995e-6 4.04120472382678e-6 1.21472923550567e-5 1.9976788603383e-5 2.74958585451822e-5 3.46802768321681e-5 4.15182368501593e-5 4.79856481353068e-5 5.40630354898453e-5 5.97479711603871e-5 6.4947479038247e-5 6.97895128455476e-5 7.41574998124299e-5 7.80711279919507e-5 8.15311641149105e-5 8.45414314948811e-5 8.71017975335516e-5 8.92085476183645e-5 9.08521132221629e-5 9.20420846305276e-5 9.27936061980597e-5 9.31313982341795e-5 9.30552765000977e-5 9.25599457920887e-5 9.16797599287126e-5 9.041692946077e-5 8.88086064198062e-5 8.68293263041973e-5 8.45470657873134e-5 8.19505156283039e-5 7.90918784345419e-5 7.59499489511726e-5 7.25913577445526e-5 6.90007266683825e-5 6.52195501855984e-5 6.1268495205598e-5 5.71712798076152e-5 5.29441057028915e-5 4.86055004649174e-5 4.42050962120303e-5 3.97300635833027e-5 3.52209058193995e-5 3.06979810398452e-5 2.61829629831333e-5 2.16969577994228e-5 1.72582028358521e-5 1.28879143039278e-5 8.58777072285901e-6 4.39158630158039e-6 3.02368354254293e-7 -3.64613498607798e-6 -7.46614405238464e-6 -1.11253968130194e-5 -1.46133694055927e-5 -1.79335828101573e-5 -2.10604880457374e-5 -2.40039338911553e-5 -2.67371187168457e-5 -2.92767128040033e-5 -3.16000530912765e-5 -3.36986152823895e-5 -3.55874669626075e-5 -3.72607458775728e-5 -3.87371755083029e-5 -3.99666912810865e-5 -4.10040920794666e-5 -4.17374194914376e-5 -4.25296899490834e-5 -4.28433545718674e-5 -4.30140517026991e-5 -4.3025032131568e-5 -4.29068991904435e-5 -4.25993967830844e-5 -4.21090019281467e-5 -4.14368419481133e-5 -4.06110449657408e-5 -3.96502202312979e-5 -3.85602232740176e-5 -3.73560747385557e-5 -3.60349486303977e-5 -3.46367208626458e-5 -3.31419021725666e-5 -3.15778370419873e-5 -2.99318307877882e-5 -2.82478400091917e-5 -2.64998143086568e-5 -2.47248863743773e-5 -2.29097403788758e-5 -2.1098626694142e-5 -1.9254250127445e-5 -1.74276497066345e-5 -1.56130215867248e-5 -1.38216102337816e-5 -1.20443408108932e-5 -1.03114527925382e-5 -8.6368208569906e-6 -7.00566917418741e-6 -5.42664110084146e-6 -3.89295417250434e-6 -2.43551352329469e-6 -1.05186474836932e-6 2.5217761121751e-7 1.49502905722044e-6 2.64841660044426e-6 3.72380169562418e-6 4.71582963040218e-6 5.62630847050353e-6 6.44522053069757e-6 7.1788229094432e-6 7.82178714333584e-6 8.3877114761375e-6 8.85255837386989e-6 9.24825080375786e-6 9.55321925729624e-6 9.78762126385669e-6 9.93435399969655e-6 1.00061013360251e-5 1.00189663896491e-5 9.96211856753532e-6 9.84815294136282e-6 9.63661279581735e-6 9.4094541490789e-6 9.1203952189514e-6 1.11262153794412e-4 fceu-0.98.12/src/fir/c48000pal.h0000644000175000000620000000536610003562763015561 0ustar joestaff00000000000000113, 14, 15, 15, 16, 16, 17, 17, 18, 18, 18, 18, 18, 17, 17, 16, 16, 15, 14, 12, 11, 10, 8, 6, 4, 2, 0, -1, -3, -6, -8, -11, -13, -16, -18, -21, -24, -26, -29, -31, -33, -35, -37, -39, -41, -42, -44, -45, -46, -46, -47, -47, -46, -46, -45, -44, -42, -40, -38, -36, -33, -30, -26, -23, -19, -15, -10, -6, -1, 3, 8, 13, 19, 24, 29, 35, 40, 45, 50, 55, 60, 64, 68, 72, 75, 79, 81, 83, 85, 86, 87, 87, 87, 86, 84, 82, 79, 76, 72, 67, 62, 56, 50, 43, 36, 28, 20, 11, 2, -6, -15, -25, -34, -44, -54, -63, -73, -82, -91, -100, -109, -117, -124, -131, -137, -142, -147, -151, -154, -156, -158, -158, -157, -156, -153, -149, -145, -139, -132, -124, -115, -105, -95, -83, -71, -58, -44, -29, -14, 0, 16, 32, 48, 65, 81, 98, 114, 129, 145, 159, 174, 187, 199, 211, 221, 231, 239, 246, 251, 255, 257, 258, 257, 255, 251, 245, 237, 228, 217, 205, 191, 175, 158, 140, 120, 99, 77, 54, 30, 6, -19, -44, -70, -96, -123, -148, -174, -199, -223, -247, -269, -291, -311, -329, -346, -361, -374, -385, -393, -400, -404, -406, -405, -401, -395, -387, -376, -362, -346, -327, -306, -282, -256, -228, -198, -166, -133, -98, -61, -23, 14, 53, 93, 133, 173, 212, 251, 290, 327, 363, 397, 430, 461, 489, 515, 538, 558, 575, 589, 600, 607, 610, 609, 605, 597, 585, 569, 549, 526, 498, 467, 432, 395, 353, 309, 262, 213, 161, 107, 51, -5, -63, -122, -181, -240, -299, -357, -414, -469, -523, -575, -623, -669, -712, -751, -786, -817, -843, -865, -881, -893, -899, -899, -894, -884, -867, -845, -817, -784, -745, -701, -651, -597, -537, -474, -406, -334, -259, -181, -100, -17, 67, 152, 239, 325, 412, 497, 581, 663, 742, 818, 890, 959, 1022, 1081, 1133, 1180, 1220, 1254, 1280, 1299, 1310, 1313, 1308, 1295, 1273, 1243, 1205, 1159, 1104, 1042, 972, 894, 809, 718, 621, 517, 409, 296, 179, 58, -64, -190, -316, -443, -570, -696, -820, -941, -1059, -1173, -1281, -1384, -1480, -1569, -1649, -1722, -1785, -1838, -1881, -1912, -1933, -1942, -1939, -1924, -1897, -1858, -1806, -1741, -1665, -1576, -1476, -1365, -1243, -1110, -968, -816, -657, -490, -316, -136, 47, 235, 426, 619, 811, 1003, 1193, 1380, 1563, 1740, 1910, 2072, 2225, 2368, 2499, 2618, 2723, 2814, 2889, 2949, 2991, 3016, 3022, 3010, 2979, 2929, 2859, 2769, 2660, 2531, 2384, 2217, 2032, 1830, 1611, 1376, 1126, 862, 585, 297, 0, -307, -621, -940, -1262, -1586, -1910, -2232, -2550, -2862, -3165, -3459, -3740, -4007, -4258, -4491, -4703, -4893, -5059, -5200, -5313, -5396, -5449, -5470, -5457, -5409, -5326, -5206, -5048, -4853, -4618, -4345, -4032, -3681, -3290, -2861, -2393, -1888, -1347, -769, -158, 486, 1162, 1868, 2602, 3362, 4146, 4952, 5777, 6619, 7475, 8342, 9219, 10102, 10988, 11874, 12757, 13635, 14504, 15361, 16204, 17029, 17833, 18615, 19370, 20096, 20790, 21451, 22075, 22660, 23205, 23707, 24164, 24574, 24937, 25250, 25513, 25725, 25884, 25991, 26044, fceu-0.98.12/src/fir/c96000pal.scm0000755000175000000620000000035710003562763016115 0ustar joestaff00000000000000(title "96000 PAL") (verbose #t) (cosine-symmetry) (filter-length 1024) (sampling-frequency 1662607.125) (limit-= (band 0 33400) 1) (limit-= (band 48000 831303.5625) 0 .5) (output-file "c96000pal.coef") (plot-file "c96000pal.plot") (go) fceu-0.98.12/src/fir/c48000pal.scm0000755000175000000620000000035710003562763016112 0ustar joestaff00000000000000(title "48000 PAL") (verbose #t) (cosine-symmetry) (filter-length 1024) (sampling-frequency 1662607.125) (limit-= (band 0 17500) 1) (limit-= (band 24000 831303.5625) 0 .5) (output-file "c48000pal.coef") (plot-file "c48000pal.plot") (go) fceu-0.98.12/src/fir/c44100pal.scm0000755000175000000620000000035710003562763016107 0ustar joestaff00000000000000(title "44100 PAL") (verbose #t) (cosine-symmetry) (filter-length 1024) (sampling-frequency 1662607.125) (limit-= (band 0 15500) 1) (limit-= (band 22050 831303.5625) 0 .5) (output-file "c44100pal.coef") (plot-file "c44100pal.plot") (go) fceu-0.98.12/src/fir/c96000pal.coef0000755000175000000620000005124010003562763016244 0ustar joestaff00000000000000;; ***** 96000 PAL ***** ;; Filter length: 1024 ;; Symmetry: cosine ;; Sampling frequency: 1662607.125 ;; Grid density: 10257 ;; Deviation parameter: y=-1.67321403971065e-8 ;; ;; Specifications: ;; (limit > 48000 831303.5625 0 0.5) ;; (limit < 48000 831303.5625 0 0.5) ;; (limit > 0 33400 1 1) ;; (limit < 0 33400 1 1) ;; ;; Coefficients: 1.03151991819582e-8 8.38300275294078e-9 1.10906859282933e-8 1.03271192432242e-8 1.14333552786323e-8 1.30077482700426e-8 1.41716278773579e-8 1.74208569471553e-8 2.00800027395966e-8 2.09724315061768e-8 2.22929661801192e-8 1.95132650596489e-8 1.76960158618376e-8 1.3068715878392e-8 1.07557125018314e-8 6.05954400825878e-9 1.83985020585335e-9 -4.35513294668295e-9 -1.25339352914121e-8 -2.18251091115114e-8 -3.19847926493859e-8 -4.14587362468332e-8 -5.15215025811016e-8 -6.3122768061061e-8 -7.34212411189246e-8 -8.35519847400028e-8 -9.19816359673906e-8 -1.00062504114338e-7 -1.0581696028102e-7 -1.09342060902351e-7 -1.09899151121439e-7 -1.07199067922224e-7 -1.01333875812554e-7 -9.17625273815014e-8 -7.89956849981134e-8 -6.14126768147793e-8 -3.99528124923842e-8 -1.43267231105268e-8 1.51839061412207e-8 4.71079084065085e-8 8.33872247697555e-8 1.20450960766471e-7 1.6066011924682e-7 1.99015401296622e-7 2.3707190547137e-7 2.72939884477538e-7 3.05703733943038e-7 3.34271689565622e-7 3.57246917030831e-7 3.71753520789388e-7 3.80032136027046e-7 3.77007825091848e-7 3.65236448771379e-7 3.39343358482371e-7 3.02990066262988e-7 2.53431354500078e-7 1.93531346067046e-7 1.20312660464537e-7 3.83506638823491e-8 -5.50094412531977e-8 -1.55165787913079e-7 -2.62247401958816e-7 -3.72869415873669e-7 -4.85000602763094e-7 -5.9487324901853e-7 -7.00817920677767e-7 -7.96695832853341e-7 -8.83009467313344e-7 -9.516801687493e-7 -1.00406302340324e-6 -1.03355489807237e-6 -1.03946679063045e-6 -1.01783166180378e-6 -9.67049604607247e-7 -8.87746045951503e-7 -7.77649486859982e-7 -6.37499558026062e-7 -4.67089278916325e-7 -2.69324680211038e-7 -4.79481886690687e-8 1.95178720022609e-7 4.53619817534114e-7 7.23956612504e-7 9.97486152500784e-7 1.26826910787562e-6 1.53005288621509e-6 1.77357589639965e-6 1.99304439308787e-6 2.17833876701336e-6 2.32279469282784e-6 2.41942298528229e-6 2.46085469574341e-6 2.44371789997691e-6 2.36167902121603e-6 2.21343228064008e-6 1.99610535588337e-6 1.71076949967104e-6 1.35846743996931e-6 9.44346239710729e-7 4.73800121500147e-7 -4.49606767418064e-8 -6.0197624767097e-7 -1.18587637892365e-6 -1.78302023739655e-6 -2.38006119965271e-6 -2.96212165638707e-6 -3.51170040070893e-6 -4.01344340051503e-6 -4.44917701834718e-6 -4.80493586876171e-6 -5.063623966477e-6 -5.21373005767686e-6 -5.24183699733879e-6 -5.1394946501258e-6 -4.90048958017337e-6 -4.52057551249377e-6 -4.00121137621988e-6 -3.34381409235837e-6 -2.55698769776267e-6 -1.65168508479184e-6 -6.41630367682649e-7 4.5272033468355e-7 1.61065667346661e-6 2.80519025479194e-6 4.00982303462755e-6 5.19442047840389e-6 6.32696760641722e-6 7.37667453186873e-6 8.31026493121452e-6 9.09759867217571e-6 9.70730330637792e-6 1.01139238186566e-5 1.02939875082689e-5 1.0228657500937e-5 9.90357194955147e-6 9.31094999767115e-6 8.44836300475225e-6 7.32184325292062e-6 5.9411139708878e-6 4.32718679501898e-6 2.5045517191364e-6 5.08537844109541e-7 -1.62303718375881e-6 -3.84347493132933e-6 -6.10417289473804e-6 -8.34891011005015e-6 -1.05213195267016e-5 -1.25625562618188e-5 -1.44140306102446e-5 -1.60176157455328e-5 -1.73187930064226e-5 -1.82665081367835e-5 -1.88180884125302e-5 -1.89349221542663e-5 -1.85905030202489e-5 -1.77652468409902e-5 -1.64542644771625e-5 -1.46606892008227e-5 -1.24032950277693e-5 -9.71123313104019e-6 -6.62826926323268e-6 -3.20916832281648e-6 4.80912959878512e-7 4.36391659133863e-6 8.35431095023709e-6 1.23587745013029e-5 1.62776057022447e-5 2.00104633597274e-5 2.34525897473363e-5 2.6504113480356e-5 2.90669843834708e-5 3.10523292715376e-5 3.23801498345e-5 3.29827423119358e-5 3.28062497909458e-5 3.18141310912695e-5 2.99885330657398e-5 2.73307787009361e-5 2.3863596601089e-5 1.9630985529227e-5 1.46979062042561e-5 9.15102381017684e-6 3.09475951446394e-6 -3.34513850836547e-6 -1.00309472232173e-5 -1.68084780282784e-5 -2.35164419241063e-5 -2.99843308432599e-5 -3.60413748500087e-5 -4.15175966696302e-5 -4.62496011329744e-5 -5.00834846280012e-5 -5.2881756318201e-5 -5.45231256798723e-5 -5.49127392818389e-5 -5.39779986324577e-5 -5.1680740099127e-5 -4.80092456996724e-5 -4.29902880316882e-5 -3.66811426138427e-5 -2.91770944785758e-5 -2.06050398177054e-5 -1.1125982738189e-5 -9.29469045115252e-7 9.76750875584034e-6 2.07264139138749e-5 3.16889547008264e-5 4.23881612033781e-5 5.25469490585536e-5 6.18941440803559e-5 7.01613699670651e-5 7.70982488738663e-5 8.24733429562758e-5 8.60846255633886e-5 8.77652355990178e-5 8.73861281253179e-5 8.48651355449836e-5 8.01683770409635e-5 7.33144164498558e-5 6.43756190395851e-5 5.347813081375e-5 4.08032785217656e-5 2.65822878709086e-5 1.10959100456974e-5 -5.33248429467424e-6 -2.23418652788707e-5 -3.95425112453473e-5 -5.65228132450726e-5 -7.28580214960265e-5 -8.81236947188922e-5 -1.01900589865764e-4 -1.13790446423011e-4 -1.23423041654638e-4 -1.30468892775236e-4 -1.34648743318249e-4 -1.35739884161422e-4 -1.33588879261025e-4 -1.2811333539122e-4 -1.19309561896777e-4 -1.0725481963731e-4 -9.21093274384085e-5 -7.41158206776385e-5 -5.35961801579358e-5 -3.09472952504257e-5 -6.63430458187306e-6 1.88188660219006e-5 4.48385613205947e-5 7.0815621084536e-5 9.61160455879359e-5 1.20099004917142e-4 1.42129235004429e-4 1.61594559165767e-4 1.77921607229302e-4 1.90590736122456e-4 1.99151775086795e-4 2.03236949574574e-4 2.02573580216899e-4 1.96994293467081e-4 1.86445019398819e-4 1.70990903256481e-4 1.50819069616185e-4 1.26238358089726e-4 9.76776349699245e-5 6.56776045971978e-5 3.08848326050668e-5 -5.96356740813766e-6 -4.40513605910619e-5 -8.25032454022742e-5 -1.20401080500299e-4 -1.56806879798798e-4 -1.90783149605849e-4 -2.21419291675664e-4 -2.47848788110117e-4 -2.69279472445284e-4 -2.85009149126569e-4 -2.94450224275897e-4 -2.97145272500789e-4 -2.9278440100842e-4 -2.81218526412152e-4 -2.62467514354949e-4 -2.36726227379411e-4 -2.04367498164773e-4 -1.65935928106054e-4 -1.22144676611347e-4 -7.38611116469124e-5 -2.2092886327107e-5 3.20332747710491e-5 8.72935203677178e-5 1.4239311797007e-4 1.95996823059339e-4 2.46758430731207e-4 2.93354710149485e-4 3.34516779687324e-4 3.69063740137675e-4 3.95935025218761e-4 4.14218377731336e-4 4.23179220684935e-4 4.22282619148847e-4 4.11214766210894e-4 3.89896739795703e-4 3.58494957675319e-4 3.17425558178502e-4 2.67352241592445e-4 2.09178855148142e-4 1.44035366727157e-4 7.3257656515258e-5 -1.63779237740676e-6 -7.89848893170478e-5 -1.57002327126315e-4 -2.33835056002673e-4 -3.07594047026731e-4 -3.76404164136881e-4 -4.38446131068721e-4 -4.9200703290972e-4 -5.35520428249821e-4 -5.67613638239988e-4 -5.87143099888524e-4 -5.93232478671107e-4 -5.85300692351394e-4 -5.63086337917986e-4 -5.26663373800026e-4 -4.76451870743233e-4 -4.13216007201208e-4 -3.38060678040117e-4 -2.52409733078722e-4 -1.57988085254148e-4 -5.6784716422895e-5 4.89841731832692e-5 1.56922907604873e-4 2.64508461181843e-4 3.69146665341244e-4 4.68233075668834e-4 5.59215876696991e-4 6.39657748300381e-4 7.07299816040927e-4 7.6012020281837e-4 7.96391761417496e-4 8.14730777273661e-4 8.14142664644267e-4 7.94056446208742e-4 7.5435263217961e-4 6.9537963487656e-4 6.17959079267155e-4 5.23381496018073e-4 4.13387627487922e-4 2.90142907465985e-4 1.5619696018914e-4 1.44330402738205e-5 -1.31990568245096e-4 -2.79707337982926e-4 -4.25218148098678e-4 -5.6497087428213e-4 -6.95445072726885e-4 -8.13236256145513e-4 -9.15141775653344e-4 -9.98243562663091e-4 -0.0010599866628307 -0.00109825180635536 -0.00111141913270169 -0.00109842176590062 -0.00105878723152578 -9.92667960092833e-4 -9.00853865253174e-4 -7.84775133395688e-4 -6.46484210138539e-4 -4.8862706565045e-4 -3.14396237291812e-4 -1.27470456729415e-4 6.80586481779722e-5 2.67772482152798e-4 4.67021632594192e-4 6.61030288225903e-4 8.45007409820417e-4 0.00101425950405569 0.00116430673085702 0.00129099572518951 0.0013906093284534 0.0014599674225506 0.00149651846177726 0.00149841919645406 0.00146459939319946 0.00139480951060361 0.00128965157704395 0.00115058933642334 9.79937911476128e-4 7.80834826954757e-4 5.57187482764196e-4 3.13605594907024e-4 5.53078264280656e-5 -2.1198068576069e-4 -4.82152145309325e-4 -7.48849254545155e-4 -0.0010056096258098 -0.00124601613279792 -0.00146385027634117 -0.00165324714625177 -0.00180884426159716 -0.00192592281171168 -0.00200054079682649 -0.00202964706581313 -0.00201118336129597 -0.00194415758323169 -0.00182870407402118 -0.00166611043274461 -0.0014588228462092 -0.00121042184021843 -9.25571871008901e-4 -6.09943356897427e-4 -2.70108419498178e-4 8.65878287229843e-5 4.52176307534593e-4 8.18234381982771e-4 0.00117607035980743 0.00151692075161767 0.00183215385494268 0.00211347938372566 0.00235315096692847 0.00254416760290437 0.00268046014161941 0.00275706287455375 0.00277026461769735 0.00271773284742105 0.00259861436853517 0.00241359905001614 0.00216495311562251 0.00185651528950842 0.00149365620556701 0.0010832027611814 6.33323430643252e-4 1.5338150399634e-4 -3.46245873742672e-4 -8.54375818614214e-4 -0.00135925347644246 -0.00184880903364977 -0.00231092502530074 -0.0027337187227384 -0.00310582337372604 -0.00341666930468077 -0.00365675622328083 -0.00381790643652724 -0.00389350186222283 -0.00387868559008699 -0.00377053814671627 -0.00356820912785959 -0.00327301016165189 -0.0028884598696194 -0.00242028158028417 -0.0018763509819845 -0.00126659496546869 -6.02837209621259e-4 1.01397889009688e-4 8.31132315629842e-4 0.00157021607771463 0.00230165125086365 0.00300793964707363 0.00367145812920719 0.00427484711920302 0.00480141038410035 0.00523550974836302 0.00556295588482682 0.00577137823517525 0.00585057149230045 0.0057928072764395 0.00559310428736023 0.00524945134321352 0.00476297411539252 0.00413804459791576 0.00338232730758133 0.00250675668335827 0.00152545134396061 4.55555350931454e-4 -6.82980522572643e-4 -0.00186768708315042 -0.00307391993768759 -0.00427525920508468 -0.00544395757085389 -0.00655142415066617 -0.00756874635507542 -0.00846722496704464 -0.00921892960311577 -0.00979724946072329 -0.0101774361576858 -0.0103371277935579 -0.0102568377148858 -0.0099204091949967 -0.00931541332239757 -0.0084334894941071 -0.00727062096870851 -0.0058273332996356 -0.0041088188533721 -0.00212497423336652 1.09643059299226e-4 0.00257594505916577 0.0052505266785003 0.00810596046568048 0.0111111690166798 0.0142318659846858 0.0174310658866196 0.0206696428324693 0.0239069404409966 0.0271014128800568 0.0302112916385789 0.0331952625461897 0.0360131429726491 0.0386265459586327 0.0409995195603867 0.0430991464884573 0.0448960998991556 0.0463651374584695 0.0474855309975742 0.0482414158697416 0.0486220638091454 0.0486220638091454 0.0482414158697416 0.0474855309975742 0.0463651374584695 0.0448960998991556 0.0430991464884573 0.0409995195603867 0.0386265459586327 0.0360131429726491 0.0331952625461897 0.0302112916385789 0.0271014128800568 0.0239069404409966 0.0206696428324693 0.0174310658866196 0.0142318659846858 0.0111111690166798 0.00810596046568048 0.0052505266785003 0.00257594505916577 1.09643059299226e-4 -0.00212497423336652 -0.0041088188533721 -0.0058273332996356 -0.00727062096870851 -0.0084334894941071 -0.00931541332239757 -0.0099204091949967 -0.0102568377148858 -0.0103371277935579 -0.0101774361576858 -0.00979724946072329 -0.00921892960311577 -0.00846722496704464 -0.00756874635507542 -0.00655142415066617 -0.00544395757085389 -0.00427525920508468 -0.00307391993768759 -0.00186768708315042 -6.82980522572643e-4 4.55555350931454e-4 0.00152545134396061 0.00250675668335827 0.00338232730758133 0.00413804459791576 0.00476297411539252 0.00524945134321352 0.00559310428736023 0.0057928072764395 0.00585057149230045 0.00577137823517525 0.00556295588482682 0.00523550974836302 0.00480141038410035 0.00427484711920302 0.00367145812920719 0.00300793964707363 0.00230165125086365 0.00157021607771463 8.31132315629842e-4 1.01397889009688e-4 -6.02837209621259e-4 -0.00126659496546869 -0.0018763509819845 -0.00242028158028417 -0.0028884598696194 -0.00327301016165189 -0.00356820912785959 -0.00377053814671627 -0.00387868559008699 -0.00389350186222283 -0.00381790643652724 -0.00365675622328083 -0.00341666930468077 -0.00310582337372604 -0.0027337187227384 -0.00231092502530074 -0.00184880903364977 -0.00135925347644246 -8.54375818614214e-4 -3.46245873742672e-4 1.5338150399634e-4 6.33323430643252e-4 0.0010832027611814 0.00149365620556701 0.00185651528950842 0.00216495311562251 0.00241359905001614 0.00259861436853517 0.00271773284742105 0.00277026461769735 0.00275706287455375 0.00268046014161941 0.00254416760290437 0.00235315096692847 0.00211347938372566 0.00183215385494268 0.00151692075161767 0.00117607035980743 8.18234381982771e-4 4.52176307534593e-4 8.65878287229843e-5 -2.70108419498178e-4 -6.09943356897427e-4 -9.25571871008901e-4 -0.00121042184021843 -0.0014588228462092 -0.00166611043274461 -0.00182870407402118 -0.00194415758323169 -0.00201118336129597 -0.00202964706581313 -0.00200054079682649 -0.00192592281171168 -0.00180884426159716 -0.00165324714625177 -0.00146385027634117 -0.00124601613279792 -0.0010056096258098 -7.48849254545155e-4 -4.82152145309325e-4 -2.1198068576069e-4 5.53078264280656e-5 3.13605594907024e-4 5.57187482764196e-4 7.80834826954757e-4 9.79937911476128e-4 0.00115058933642334 0.00128965157704395 0.00139480951060361 0.00146459939319946 0.00149841919645406 0.00149651846177726 0.0014599674225506 0.0013906093284534 0.00129099572518951 0.00116430673085702 0.00101425950405569 8.45007409820417e-4 6.61030288225903e-4 4.67021632594192e-4 2.67772482152798e-4 6.80586481779722e-5 -1.27470456729415e-4 -3.14396237291812e-4 -4.8862706565045e-4 -6.46484210138539e-4 -7.84775133395688e-4 -9.00853865253174e-4 -9.92667960092833e-4 -0.00105878723152578 -0.00109842176590062 -0.00111141913270169 -0.00109825180635536 -0.0010599866628307 -9.98243562663091e-4 -9.15141775653344e-4 -8.13236256145513e-4 -6.95445072726885e-4 -5.6497087428213e-4 -4.25218148098678e-4 -2.79707337982926e-4 -1.31990568245096e-4 1.44330402738205e-5 1.5619696018914e-4 2.90142907465985e-4 4.13387627487922e-4 5.23381496018073e-4 6.17959079267155e-4 6.9537963487656e-4 7.5435263217961e-4 7.94056446208742e-4 8.14142664644267e-4 8.14730777273661e-4 7.96391761417496e-4 7.6012020281837e-4 7.07299816040927e-4 6.39657748300381e-4 5.59215876696991e-4 4.68233075668834e-4 3.69146665341244e-4 2.64508461181843e-4 1.56922907604873e-4 4.89841731832692e-5 -5.6784716422895e-5 -1.57988085254148e-4 -2.52409733078722e-4 -3.38060678040117e-4 -4.13216007201208e-4 -4.76451870743233e-4 -5.26663373800026e-4 -5.63086337917986e-4 -5.85300692351394e-4 -5.93232478671107e-4 -5.87143099888524e-4 -5.67613638239988e-4 -5.35520428249821e-4 -4.9200703290972e-4 -4.38446131068721e-4 -3.76404164136881e-4 -3.07594047026731e-4 -2.33835056002673e-4 -1.57002327126315e-4 -7.89848893170478e-5 -1.63779237740676e-6 7.3257656515258e-5 1.44035366727157e-4 2.09178855148142e-4 2.67352241592445e-4 3.17425558178502e-4 3.58494957675319e-4 3.89896739795703e-4 4.11214766210894e-4 4.22282619148847e-4 4.23179220684935e-4 4.14218377731336e-4 3.95935025218761e-4 3.69063740137675e-4 3.34516779687324e-4 2.93354710149485e-4 2.46758430731207e-4 1.95996823059339e-4 1.4239311797007e-4 8.72935203677178e-5 3.20332747710491e-5 -2.2092886327107e-5 -7.38611116469124e-5 -1.22144676611347e-4 -1.65935928106054e-4 -2.04367498164773e-4 -2.36726227379411e-4 -2.62467514354949e-4 -2.81218526412152e-4 -2.9278440100842e-4 -2.97145272500789e-4 -2.94450224275897e-4 -2.85009149126569e-4 -2.69279472445284e-4 -2.47848788110117e-4 -2.21419291675664e-4 -1.90783149605849e-4 -1.56806879798798e-4 -1.20401080500299e-4 -8.25032454022742e-5 -4.40513605910619e-5 -5.96356740813766e-6 3.08848326050668e-5 6.56776045971978e-5 9.76776349699245e-5 1.26238358089726e-4 1.50819069616185e-4 1.70990903256481e-4 1.86445019398819e-4 1.96994293467081e-4 2.02573580216899e-4 2.03236949574574e-4 1.99151775086795e-4 1.90590736122456e-4 1.77921607229302e-4 1.61594559165767e-4 1.42129235004429e-4 1.20099004917142e-4 9.61160455879359e-5 7.0815621084536e-5 4.48385613205947e-5 1.88188660219006e-5 -6.63430458187306e-6 -3.09472952504257e-5 -5.35961801579358e-5 -7.41158206776385e-5 -9.21093274384085e-5 -1.0725481963731e-4 -1.19309561896777e-4 -1.2811333539122e-4 -1.33588879261025e-4 -1.35739884161422e-4 -1.34648743318249e-4 -1.30468892775236e-4 -1.23423041654638e-4 -1.13790446423011e-4 -1.01900589865764e-4 -8.81236947188922e-5 -7.28580214960265e-5 -5.65228132450726e-5 -3.95425112453473e-5 -2.23418652788707e-5 -5.33248429467424e-6 1.10959100456974e-5 2.65822878709086e-5 4.08032785217656e-5 5.347813081375e-5 6.43756190395851e-5 7.33144164498558e-5 8.01683770409635e-5 8.48651355449836e-5 8.73861281253179e-5 8.77652355990178e-5 8.60846255633886e-5 8.24733429562758e-5 7.70982488738663e-5 7.01613699670651e-5 6.18941440803559e-5 5.25469490585536e-5 4.23881612033781e-5 3.16889547008264e-5 2.07264139138749e-5 9.76750875584034e-6 -9.29469045115252e-7 -1.1125982738189e-5 -2.06050398177054e-5 -2.91770944785758e-5 -3.66811426138427e-5 -4.29902880316882e-5 -4.80092456996724e-5 -5.1680740099127e-5 -5.39779986324577e-5 -5.49127392818389e-5 -5.45231256798723e-5 -5.2881756318201e-5 -5.00834846280012e-5 -4.62496011329744e-5 -4.15175966696302e-5 -3.60413748500087e-5 -2.99843308432599e-5 -2.35164419241063e-5 -1.68084780282784e-5 -1.00309472232173e-5 -3.34513850836547e-6 3.09475951446394e-6 9.15102381017684e-6 1.46979062042561e-5 1.9630985529227e-5 2.3863596601089e-5 2.73307787009361e-5 2.99885330657398e-5 3.18141310912695e-5 3.28062497909458e-5 3.29827423119358e-5 3.23801498345e-5 3.10523292715376e-5 2.90669843834708e-5 2.6504113480356e-5 2.34525897473363e-5 2.00104633597274e-5 1.62776057022447e-5 1.23587745013029e-5 8.35431095023709e-6 4.36391659133863e-6 4.80912959878512e-7 -3.20916832281648e-6 -6.62826926323268e-6 -9.71123313104019e-6 -1.24032950277693e-5 -1.46606892008227e-5 -1.64542644771625e-5 -1.77652468409902e-5 -1.85905030202489e-5 -1.89349221542663e-5 -1.88180884125302e-5 -1.82665081367835e-5 -1.73187930064226e-5 -1.60176157455328e-5 -1.44140306102446e-5 -1.25625562618188e-5 -1.05213195267016e-5 -8.34891011005015e-6 -6.10417289473804e-6 -3.84347493132933e-6 -1.62303718375881e-6 5.08537844109541e-7 2.5045517191364e-6 4.32718679501898e-6 5.9411139708878e-6 7.32184325292062e-6 8.44836300475225e-6 9.31094999767115e-6 9.90357194955147e-6 1.0228657500937e-5 1.02939875082689e-5 1.01139238186566e-5 9.70730330637792e-6 9.09759867217571e-6 8.31026493121452e-6 7.37667453186873e-6 6.32696760641722e-6 5.19442047840389e-6 4.00982303462755e-6 2.80519025479194e-6 1.61065667346661e-6 4.5272033468355e-7 -6.41630367682649e-7 -1.65168508479184e-6 -2.55698769776267e-6 -3.34381409235837e-6 -4.00121137621988e-6 -4.52057551249377e-6 -4.90048958017337e-6 -5.1394946501258e-6 -5.24183699733879e-6 -5.21373005767686e-6 -5.063623966477e-6 -4.80493586876171e-6 -4.44917701834718e-6 -4.01344340051503e-6 -3.51170040070893e-6 -2.96212165638707e-6 -2.38006119965271e-6 -1.78302023739655e-6 -1.18587637892365e-6 -6.0197624767097e-7 -4.49606767418064e-8 4.73800121500147e-7 9.44346239710729e-7 1.35846743996931e-6 1.71076949967104e-6 1.99610535588337e-6 2.21343228064008e-6 2.36167902121603e-6 2.44371789997691e-6 2.46085469574341e-6 2.41942298528229e-6 2.32279469282784e-6 2.17833876701336e-6 1.99304439308787e-6 1.77357589639965e-6 1.53005288621509e-6 1.26826910787562e-6 9.97486152500784e-7 7.23956612504e-7 4.53619817534114e-7 1.95178720022609e-7 -4.79481886690687e-8 -2.69324680211038e-7 -4.67089278916325e-7 -6.37499558026062e-7 -7.77649486859982e-7 -8.87746045951503e-7 -9.67049604607247e-7 -1.01783166180378e-6 -1.03946679063045e-6 -1.03355489807237e-6 -1.00406302340324e-6 -9.516801687493e-7 -8.83009467313344e-7 -7.96695832853341e-7 -7.00817920677767e-7 -5.9487324901853e-7 -4.85000602763094e-7 -3.72869415873669e-7 -2.62247401958816e-7 -1.55165787913079e-7 -5.50094412531977e-8 3.83506638823491e-8 1.20312660464537e-7 1.93531346067046e-7 2.53431354500078e-7 3.02990066262988e-7 3.39343358482371e-7 3.65236448771379e-7 3.77007825091848e-7 3.80032136027046e-7 3.71753520789388e-7 3.57246917030831e-7 3.34271689565622e-7 3.05703733943038e-7 2.72939884477538e-7 2.3707190547137e-7 1.99015401296622e-7 1.6066011924682e-7 1.20450960766471e-7 8.33872247697555e-8 4.71079084065085e-8 1.51839061412207e-8 -1.43267231105268e-8 -3.99528124923842e-8 -6.14126768147793e-8 -7.89956849981134e-8 -9.17625273815014e-8 -1.01333875812554e-7 -1.07199067922224e-7 -1.09899151121439e-7 -1.09342060902351e-7 -1.0581696028102e-7 -1.00062504114338e-7 -9.19816359673906e-8 -8.35519847400028e-8 -7.34212411189246e-8 -6.3122768061061e-8 -5.15215025811016e-8 -4.14587362468332e-8 -3.19847926493859e-8 -2.18251091115114e-8 -1.25339352914121e-8 -4.35513294668295e-9 1.83985020585335e-9 6.05954400825878e-9 1.07557125018314e-8 1.3068715878392e-8 1.76960158618376e-8 1.95132650596489e-8 2.22929661801192e-8 2.09724315061768e-8 2.00800027395966e-8 1.74208569471553e-8 1.41716278773579e-8 1.30077482700426e-8 1.14333552786323e-8 1.03271192432242e-8 1.10906859282933e-8 8.38300275294078e-9 1.03151991819582e-8 fceu-0.98.12/src/fir/c44100pal.coef0000755000175000000620000005116210003562763016241 0ustar joestaff00000000000000;; ***** 44100 PAL ***** ;; Filter length: 1024 ;; Symmetry: cosine ;; Sampling frequency: 1662607.125 ;; Grid density: 10257 ;; Deviation parameter: y=-4.28595835756995e-4 ;; ;; Specifications: ;; (limit > 22050 831303.5625 0 0.5) ;; (limit < 22050 831303.5625 0 0.5) ;; (limit > 0 15500 1 1) ;; (limit < 0 15500 1 1) ;; ;; Coefficients: -1.11200257011025e-4 -7.94996380288693e-6 -8.13285647140816e-6 -8.24614335450001e-6 -8.28726470313328e-6 -8.24897818906316e-6 -8.13579312269827e-6 -7.93678154525632e-6 -7.66363813247865e-6 -7.28830988147217e-6 -6.83300292562487e-6 -6.27926662890536e-6 -5.63180592699196e-6 -4.90087590625251e-6 -4.08336036205811e-6 -3.16293668294449e-6 -2.15293957076619e-6 -1.06608354010604e-6 1.17779154321068e-7 1.36339097208028e-6 2.70697389916737e-6 4.13545107510629e-6 5.6127107530343e-6 7.15216767756425e-6 8.76565171236067e-6 1.04110267491666e-5 1.209928683708e-5 1.3807553643137e-5 1.55498084717804e-5 1.73113519018396e-5 1.90726123593194e-5 2.08203230001769e-5 2.25533698766556e-5 2.42417431818782e-5 2.59088069682988e-5 2.75097685821301e-5 2.90529184467942e-5 3.05258134239308e-5 3.1906749021575e-5 3.31955898421991e-5 3.43727119744575e-5 3.54234983372247e-5 3.63431784582818e-5 3.71120880500224e-5 3.77205312917436e-5 3.81506665317904e-5 3.84008667836707e-5 3.84617902622245e-5 3.83356611921185e-5 3.80172027315447e-5 3.74882685294917e-5 3.67702946218063e-5 3.58419705572146e-5 3.46879785388071e-5 3.32641657027279e-5 3.14968254692446e-5 2.98205583919132e-5 2.77079444336199e-5 2.54270156775404e-5 2.29383213938169e-5 2.02427147104623e-5 1.73385589814633e-5 1.42538741163702e-5 1.0974704577089e-5 7.5345671480003e-6 3.92576081368077e-6 1.83369853607622e-7 -3.6781367339795e-6 -7.66697534902539e-6 -1.17479928711011e-5 -1.58899910541553e-5 -2.00875350281883e-5 -2.43269194651492e-5 -2.85687842714339e-5 -3.28189740432224e-5 -3.70047365577994e-5 -4.11243186584193e-5 -4.51827880544111e-5 -4.91366464792378e-5 -5.29228769501386e-5 -5.6577177841953e-5 -6.00407527379607e-5 -6.33015334642338e-5 -6.6321066975926e-5 -6.90803733771612e-5 -7.1551714886712e-5 -7.37245485134222e-5 -7.55586426528957e-5 -7.70803234827881e-5 -7.81982347188838e-5 -7.89408927811607e-5 -7.92941109743888e-5 -7.92348985225341e-5 -7.87415759361739e-5 -7.78153743941276e-5 -7.64300985875165e-5 -7.46031420059581e-5 -7.23191346398865e-5 -6.95708993868544e-5 -6.63607831282715e-5 -6.27086197063989e-5 -5.86124087120698e-5 -5.40735813007961e-5 -4.91146153453121e-5 -4.37274299935917e-5 -3.796629483321e-5 -3.17982121227615e-5 -2.52841084140995e-5 -1.84333267027672e-5 -1.13023888811976e-5 -3.91269277424297e-6 3.78856288808815e-6 1.16356826931571e-5 1.96757362744974e-5 2.78537134537647e-5 3.61195928120633e-5 4.44322494738248e-5 5.27623610515163e-5 6.1053941504231e-5 6.92572576428739e-5 7.7331248720778e-5 8.52344475900456e-5 9.2926888863339e-5 1.00334146579291e-4 1.07431425645115e-4 1.1416670963617e-4 1.20489431734329e-4 1.26354387911283e-4 1.31720166830177e-4 1.36538713088326e-4 1.40793996948262e-4 1.44431432682464e-4 1.47393924564116e-4 1.49667322189054e-4 1.51240640106038e-4 1.52049596360267e-4 1.52081469279039e-4 1.51330637705528e-4 1.49757451217301e-4 1.47362931428648e-4 1.44140529279305e-4 1.40080755562269e-4 1.35181216701032e-4 1.29425084953382e-4 1.22873714879804e-4 1.15510843581741e-4 1.07326364837661e-4 9.83786335794599e-5 8.86945777859818e-5 7.82876287061222e-5 6.7224812176488e-5 5.55089298390305e-5 4.32026588267973e-5 3.0365713255082e-5 1.70475989751417e-5 3.29372966720524e-6 -1.08241832988715e-5 -2.52343906526312e-5 -3.98841814115523e-5 -5.46823094969964e-5 -6.95847998647964e-5 -8.44762835454931e-5 -9.93135063167747e-5 -1.13988295988881e-4 -1.28441297371119e-4 -1.4257904039858e-4 -1.5632814652685e-4 -1.69596926160502e-4 -1.82304197147325e-4 -1.94375475955832e-4 -2.05729261288574e-4 -2.16294796061533e-4 -2.25986416409321e-4 -2.34733017787645e-4 -2.42489478192021e-4 -2.49164314249808e-4 -2.54710160797573e-4 -2.59055230879128e-4 -2.62163331622264e-4 -2.63980952682017e-4 -2.64483868515565e-4 -2.63625449149133e-4 -2.61381251495432e-4 -2.57733197100289e-4 -2.52658112953211e-4 -2.4615901828968e-4 -2.38226811903974e-4 -2.28884870924857e-4 -2.18140483365099e-4 -2.06019172507064e-4 -1.9254469774914e-4 -1.77785719247505e-4 -1.61739992805436e-4 -1.4451846040208e-4 -1.26149587549934e-4 -1.06709031104119e-4 -8.62669952337453e-5 -6.49336478463108e-5 -4.27728447441012e-5 -1.98970247861957e-5 3.61164973426469e-6 2.75939454346297e-5 5.19905050322827e-5 7.66611814451522e-5 1.01478414196256e-4 1.26339943357148e-4 1.51085348502373e-4 1.75595678238513e-4 1.99742079669349e-4 2.23388522276371e-4 2.46394584033161e-4 2.68636208374242e-4 2.89982341455338e-4 3.10294458286738e-4 3.29443424793821e-4 3.47313309870382e-4 3.6377364605836e-4 3.78710912554491e-4 3.9202650014604e-4 4.03608977052316e-4 4.13354985071458e-4 4.2116122650496e-4 4.26988609123688e-4 4.30738794863119e-4 4.32336229285393e-4 4.31759427084928e-4 4.2893275128775e-4 4.23845616813245e-4 4.16470263567494e-4 4.06783273414362e-4 3.94804321373921e-4 3.80535441649663e-4 3.6401636005173e-4 3.4529014942601e-4 3.24391189898946e-4 3.01376781077692e-4 2.76343301836257e-4 2.4936486879876e-4 2.20548944074394e-4 1.90007301298934e-4 1.57842659191524e-4 1.24220152772481e-4 8.92685161781954e-5 5.31339845287204e-5 1.59816963628024e-5 -2.19908840946184e-5 -6.06534567846234e-5 -9.97630661046562e-5 -1.39179726975758e-4 -1.78679270880486e-4 -2.1805919019443e-4 -2.57108546253423e-4 -2.95641094902746e-4 -3.33403666779113e-4 -3.70254587494631e-4 -4.05911568827225e-4 -4.4022838615012e-4 -4.72955839415529e-4 -5.0391796703662e-4 -5.32914238319358e-4 -5.59744514364898e-4 -5.84238077102726e-4 -6.06224526249333e-4 -6.25539846131288e-4 -6.42027789895408e-4 -6.5555230038567e-4 -6.65977498710118e-4 -6.7318950015647e-4 -6.77091605863607e-4 -6.77614237688126e-4 -6.74643387824144e-4 -6.681810692764e-4 -6.58148553515012e-4 -6.44548593096861e-4 -6.27372049258136e-4 -6.06651646698617e-4 -5.82419271110313e-4 -5.54718009495967e-4 -5.23626832014741e-4 -4.8926746405434e-4 -4.51699986733748e-4 -4.11106675639873e-4 -3.67606528939805e-4 -3.21382862239143e-4 -2.72607382898212e-4 -2.21497157339506e-4 -1.68258628656205e-4 -1.13130227471391e-4 -5.63383710913267e-5 1.82703643648985e-6 6.11059297587035e-5 1.21227953996855e-4 1.81881505870662e-4 2.42786733495668e-4 3.03615254629841e-4 3.64050987977855e-4 4.23804182290753e-4 4.82537070178806e-4 5.39916161965727e-4 5.95641281700095e-4 6.49402169641121e-4 7.00854505724994e-4 7.4971795695236e-4 7.95682703239628e-4 8.38445709493196e-4 8.77748678164893e-4 9.13311645337574e-4 9.44886650093644e-4 9.72247670017337e-4 9.95115178537146e-4 0.00101336913401633 0.00102677501507253 0.00103518648644738 0.00103846440012199 0.00103648919038668 0.00102917891064352 0.0010164716114175 9.98315800820138e-4 9.74705065755381e-4 9.45660726451063e-4 9.11220671795009e-4 8.71464226265813e-4 8.26493006790482e-4 7.76428186484775e-4 7.2141888229852e-4 6.61697436756462e-4 5.9741912245776e-4 5.28873675826444e-4 4.56291683005437e-4 3.79985318339895e-4 3.00269695262299e-4 2.17487142122525e-4 1.31991772965616e-4 4.41879631490349e-5 -4.55545140015219e-5 -1.36775307453412e-4 -2.29072500656193e-4 -3.21982815448816e-4 -4.15050766626564e-4 -5.0777980705733e-4 -5.99729527875493e-4 -6.90384622866925e-4 -7.79287829793652e-4 -8.65926265038561e-4 -9.49836926138828e-4 -0.00103052577700171 -0.0011075193071442 -0.00118036874439703 -0.00124859930815059 -0.00131180178646339 -0.00136953952393335 -0.00142140513653781 -0.00146703736814346 -0.00150608163518545 -0.00153818964747658 -0.00156307825078861 -0.0015804778819231 -0.0015901634714776 -0.00159189434514815 -0.00158555114709596 -0.00157096689703477 -0.00154807524691094 -0.00151680067268875 -0.00147716260085239 -0.001429198787489 -0.00137294453725215 -0.00130854205285008 -0.00123616307121754 -0.00115598693403096 -0.00106828307283493 -9.73328815012761e-4 -8.71455057796053e-4 -7.63043529919569e-4 -6.48499103297409e-4 -5.28275515871108e-4 -4.02868466889883e-4 -2.72797605270643e-4 -1.38620034875188e-4 -9.39779893315131e-7 1.39630165237839e-4 2.8245890419115e-4 4.26851878411663e-4 5.72128676056236e-4 7.17555283175031e-4 8.62419664123234e-4 0.00100599136178572 0.00114749964897685 0.00128619716461828 0.00142133896436276 0.00155215453934691 0.00167789165485006 0.00179782254312389 0.00191119051397053 0.00201730596666936 0.00211548603714526 0.00220503610710518 0.00228534178059485 0.00235576204962984 0.0024157435894097 0.00246475064259446 0.0025022831737163 0.00252789297770596 0.00254116769788057 0.00254176992461642 0.00252938841718385 0.00250379536745675 0.00246480413845626 0.00241227787677937 0.00234617618821264 0.00226649941700418 0.00217330314170672 0.00206673238197944 0.00194696407580016 0.0018143173361094 0.00166908671482331 0.00151170100656022 0.00134262363203965 0.00116240941365375 9.71632852686666e-4 7.70995591058202e-4 5.61217875060209e-4 3.43102377440826e-4 1.17486802048521e-4 -1.14695107246174e-4 -3.52499536963163e-4 -5.9490463003285e-4 -8.40850949031332e-4 -0.00108922785396699 -0.00133888418878215 -0.00158864742890517 -0.0018373063114507 -0.00208361779036314 -0.0023263150988098 -0.00256412644472558 -0.00279574533789046 -0.00301988207803446 -0.00323521397538706 -0.00344046688386521 -0.00363433985468964 -0.00381554830386696 -0.00398282823032301 -0.0041349694223421 -0.00427073396319018 -0.00438896904598832 -0.00448852839147268 -0.00456836880890372 -0.004627400257634 -0.00466470470414415 -0.00467932298600597 -0.00467041907819992 -0.00463720779225358 -0.00457898303537998 -0.00449512222942258 -0.00438507069238121 -0.00424834585547379 -0.00408459615492852 -0.0038935194962581 -0.0036749355234766 -0.00342874251403819 -0.00315493309153929 -0.00285361231552705 -0.00252496859694177 -0.00216931316953576 -0.0017870143203001 -0.00137859287897444 -9.44633240898953e-4 -4.85835090373757e-4 -2.9962514126255e-6 5.03012372252255e-4 0.0010312109513981 0.00158050717151511 0.00214976554763945 0.00273772736746413 0.00334306999099584 0.0039644076312235 0.00460023689832775 0.00524903833016921 0.00590919805593498 0.00657904898248033 0.00725688057525865 0.00794091363222304 0.00862934675318832 0.00932034748070898 0.0100120457135665 0.0107025377765967 0.011389916307798 0.0120722612532503 0.0127476582242783 0.0134141882202367 0.0140699467449269 0.0147130285913083 0.0153416010646532 0.0159537971993272 0.0165478416438899 0.0171219834943615 0.0176745067361407 0.018203769229927 0.0187082111673434 0.0191862910393147 0.0196366013582463 0.0200577339311999 0.0204484730566774 0.0208075842002215 0.021134001566882 0.0214267119717681 0.0216848382317027 0.0219075680887292 0.022094238422553 0.0222442604033734 0.0223571935299417 0.0224326657161866 0.0224704675290829 0.0224704675290829 0.0224326657161866 0.0223571935299417 0.0222442604033734 0.022094238422553 0.0219075680887292 0.0216848382317027 0.0214267119717681 0.021134001566882 0.0208075842002215 0.0204484730566774 0.0200577339311999 0.0196366013582463 0.0191862910393147 0.0187082111673434 0.018203769229927 0.0176745067361407 0.0171219834943615 0.0165478416438899 0.0159537971993272 0.0153416010646532 0.0147130285913083 0.0140699467449269 0.0134141882202367 0.0127476582242783 0.0120722612532503 0.011389916307798 0.0107025377765967 0.0100120457135665 0.00932034748070898 0.00862934675318832 0.00794091363222304 0.00725688057525865 0.00657904898248033 0.00590919805593498 0.00524903833016921 0.00460023689832775 0.0039644076312235 0.00334306999099584 0.00273772736746413 0.00214976554763945 0.00158050717151511 0.0010312109513981 5.03012372252255e-4 -2.9962514126255e-6 -4.85835090373757e-4 -9.44633240898953e-4 -0.00137859287897444 -0.0017870143203001 -0.00216931316953576 -0.00252496859694177 -0.00285361231552705 -0.00315493309153929 -0.00342874251403819 -0.0036749355234766 -0.0038935194962581 -0.00408459615492852 -0.00424834585547379 -0.00438507069238121 -0.00449512222942258 -0.00457898303537998 -0.00463720779225358 -0.00467041907819992 -0.00467932298600597 -0.00466470470414415 -0.004627400257634 -0.00456836880890372 -0.00448852839147268 -0.00438896904598832 -0.00427073396319018 -0.0041349694223421 -0.00398282823032301 -0.00381554830386696 -0.00363433985468964 -0.00344046688386521 -0.00323521397538706 -0.00301988207803446 -0.00279574533789046 -0.00256412644472558 -0.0023263150988098 -0.00208361779036314 -0.0018373063114507 -0.00158864742890517 -0.00133888418878215 -0.00108922785396699 -8.40850949031332e-4 -5.9490463003285e-4 -3.52499536963163e-4 -1.14695107246174e-4 1.17486802048521e-4 3.43102377440826e-4 5.61217875060209e-4 7.70995591058202e-4 9.71632852686666e-4 0.00116240941365375 0.00134262363203965 0.00151170100656022 0.00166908671482331 0.0018143173361094 0.00194696407580016 0.00206673238197944 0.00217330314170672 0.00226649941700418 0.00234617618821264 0.00241227787677937 0.00246480413845626 0.00250379536745675 0.00252938841718385 0.00254176992461642 0.00254116769788057 0.00252789297770596 0.0025022831737163 0.00246475064259446 0.0024157435894097 0.00235576204962984 0.00228534178059485 0.00220503610710518 0.00211548603714526 0.00201730596666936 0.00191119051397053 0.00179782254312389 0.00167789165485006 0.00155215453934691 0.00142133896436276 0.00128619716461828 0.00114749964897685 0.00100599136178572 8.62419664123234e-4 7.17555283175031e-4 5.72128676056236e-4 4.26851878411663e-4 2.8245890419115e-4 1.39630165237839e-4 -9.39779893315131e-7 -1.38620034875188e-4 -2.72797605270643e-4 -4.02868466889883e-4 -5.28275515871108e-4 -6.48499103297409e-4 -7.63043529919569e-4 -8.71455057796053e-4 -9.73328815012761e-4 -0.00106828307283493 -0.00115598693403096 -0.00123616307121754 -0.00130854205285008 -0.00137294453725215 -0.001429198787489 -0.00147716260085239 -0.00151680067268875 -0.00154807524691094 -0.00157096689703477 -0.00158555114709596 -0.00159189434514815 -0.0015901634714776 -0.0015804778819231 -0.00156307825078861 -0.00153818964747658 -0.00150608163518545 -0.00146703736814346 -0.00142140513653781 -0.00136953952393335 -0.00131180178646339 -0.00124859930815059 -0.00118036874439703 -0.0011075193071442 -0.00103052577700171 -9.49836926138828e-4 -8.65926265038561e-4 -7.79287829793652e-4 -6.90384622866925e-4 -5.99729527875493e-4 -5.0777980705733e-4 -4.15050766626564e-4 -3.21982815448816e-4 -2.29072500656193e-4 -1.36775307453412e-4 -4.55545140015219e-5 4.41879631490349e-5 1.31991772965616e-4 2.17487142122525e-4 3.00269695262299e-4 3.79985318339895e-4 4.56291683005437e-4 5.28873675826444e-4 5.9741912245776e-4 6.61697436756462e-4 7.2141888229852e-4 7.76428186484775e-4 8.26493006790482e-4 8.71464226265813e-4 9.11220671795009e-4 9.45660726451063e-4 9.74705065755381e-4 9.98315800820138e-4 0.0010164716114175 0.00102917891064352 0.00103648919038668 0.00103846440012199 0.00103518648644738 0.00102677501507253 0.00101336913401633 9.95115178537146e-4 9.72247670017337e-4 9.44886650093644e-4 9.13311645337574e-4 8.77748678164893e-4 8.38445709493196e-4 7.95682703239628e-4 7.4971795695236e-4 7.00854505724994e-4 6.49402169641121e-4 5.95641281700095e-4 5.39916161965727e-4 4.82537070178806e-4 4.23804182290753e-4 3.64050987977855e-4 3.03615254629841e-4 2.42786733495668e-4 1.81881505870662e-4 1.21227953996855e-4 6.11059297587035e-5 1.82703643648985e-6 -5.63383710913267e-5 -1.13130227471391e-4 -1.68258628656205e-4 -2.21497157339506e-4 -2.72607382898212e-4 -3.21382862239143e-4 -3.67606528939805e-4 -4.11106675639873e-4 -4.51699986733748e-4 -4.8926746405434e-4 -5.23626832014741e-4 -5.54718009495967e-4 -5.82419271110313e-4 -6.06651646698617e-4 -6.27372049258136e-4 -6.44548593096861e-4 -6.58148553515012e-4 -6.681810692764e-4 -6.74643387824144e-4 -6.77614237688126e-4 -6.77091605863607e-4 -6.7318950015647e-4 -6.65977498710118e-4 -6.5555230038567e-4 -6.42027789895408e-4 -6.25539846131288e-4 -6.06224526249333e-4 -5.84238077102726e-4 -5.59744514364898e-4 -5.32914238319358e-4 -5.0391796703662e-4 -4.72955839415529e-4 -4.4022838615012e-4 -4.05911568827225e-4 -3.70254587494631e-4 -3.33403666779113e-4 -2.95641094902746e-4 -2.57108546253423e-4 -2.1805919019443e-4 -1.78679270880486e-4 -1.39179726975758e-4 -9.97630661046562e-5 -6.06534567846234e-5 -2.19908840946184e-5 1.59816963628024e-5 5.31339845287204e-5 8.92685161781954e-5 1.24220152772481e-4 1.57842659191524e-4 1.90007301298934e-4 2.20548944074394e-4 2.4936486879876e-4 2.76343301836257e-4 3.01376781077692e-4 3.24391189898946e-4 3.4529014942601e-4 3.6401636005173e-4 3.80535441649663e-4 3.94804321373921e-4 4.06783273414362e-4 4.16470263567494e-4 4.23845616813245e-4 4.2893275128775e-4 4.31759427084928e-4 4.32336229285393e-4 4.30738794863119e-4 4.26988609123688e-4 4.2116122650496e-4 4.13354985071458e-4 4.03608977052316e-4 3.9202650014604e-4 3.78710912554491e-4 3.6377364605836e-4 3.47313309870382e-4 3.29443424793821e-4 3.10294458286738e-4 2.89982341455338e-4 2.68636208374242e-4 2.46394584033161e-4 2.23388522276371e-4 1.99742079669349e-4 1.75595678238513e-4 1.51085348502373e-4 1.26339943357148e-4 1.01478414196256e-4 7.66611814451522e-5 5.19905050322827e-5 2.75939454346297e-5 3.61164973426469e-6 -1.98970247861957e-5 -4.27728447441012e-5 -6.49336478463108e-5 -8.62669952337453e-5 -1.06709031104119e-4 -1.26149587549934e-4 -1.4451846040208e-4 -1.61739992805436e-4 -1.77785719247505e-4 -1.9254469774914e-4 -2.06019172507064e-4 -2.18140483365099e-4 -2.28884870924857e-4 -2.38226811903974e-4 -2.4615901828968e-4 -2.52658112953211e-4 -2.57733197100289e-4 -2.61381251495432e-4 -2.63625449149133e-4 -2.64483868515565e-4 -2.63980952682017e-4 -2.62163331622264e-4 -2.59055230879128e-4 -2.54710160797573e-4 -2.49164314249808e-4 -2.42489478192021e-4 -2.34733017787645e-4 -2.25986416409321e-4 -2.16294796061533e-4 -2.05729261288574e-4 -1.94375475955832e-4 -1.82304197147325e-4 -1.69596926160502e-4 -1.5632814652685e-4 -1.4257904039858e-4 -1.28441297371119e-4 -1.13988295988881e-4 -9.93135063167747e-5 -8.44762835454931e-5 -6.95847998647964e-5 -5.46823094969964e-5 -3.98841814115523e-5 -2.52343906526312e-5 -1.08241832988715e-5 3.29372966720524e-6 1.70475989751417e-5 3.0365713255082e-5 4.32026588267973e-5 5.55089298390305e-5 6.7224812176488e-5 7.82876287061222e-5 8.86945777859818e-5 9.83786335794599e-5 1.07326364837661e-4 1.15510843581741e-4 1.22873714879804e-4 1.29425084953382e-4 1.35181216701032e-4 1.40080755562269e-4 1.44140529279305e-4 1.47362931428648e-4 1.49757451217301e-4 1.51330637705528e-4 1.52081469279039e-4 1.52049596360267e-4 1.51240640106038e-4 1.49667322189054e-4 1.47393924564116e-4 1.44431432682464e-4 1.40793996948262e-4 1.36538713088326e-4 1.31720166830177e-4 1.26354387911283e-4 1.20489431734329e-4 1.1416670963617e-4 1.07431425645115e-4 1.00334146579291e-4 9.2926888863339e-5 8.52344475900456e-5 7.7331248720778e-5 6.92572576428739e-5 6.1053941504231e-5 5.27623610515163e-5 4.44322494738248e-5 3.61195928120633e-5 2.78537134537647e-5 1.96757362744974e-5 1.16356826931571e-5 3.78856288808815e-6 -3.91269277424297e-6 -1.13023888811976e-5 -1.84333267027672e-5 -2.52841084140995e-5 -3.17982121227615e-5 -3.796629483321e-5 -4.37274299935917e-5 -4.91146153453121e-5 -5.40735813007961e-5 -5.86124087120698e-5 -6.27086197063989e-5 -6.63607831282715e-5 -6.95708993868544e-5 -7.23191346398865e-5 -7.46031420059581e-5 -7.64300985875165e-5 -7.78153743941276e-5 -7.87415759361739e-5 -7.92348985225341e-5 -7.92941109743888e-5 -7.89408927811607e-5 -7.81982347188838e-5 -7.70803234827881e-5 -7.55586426528957e-5 -7.37245485134222e-5 -7.1551714886712e-5 -6.90803733771612e-5 -6.6321066975926e-5 -6.33015334642338e-5 -6.00407527379607e-5 -5.6577177841953e-5 -5.29228769501386e-5 -4.91366464792378e-5 -4.51827880544111e-5 -4.11243186584193e-5 -3.70047365577994e-5 -3.28189740432224e-5 -2.85687842714339e-5 -2.43269194651492e-5 -2.00875350281883e-5 -1.58899910541553e-5 -1.17479928711011e-5 -7.66697534902539e-6 -3.6781367339795e-6 1.83369853607622e-7 3.92576081368077e-6 7.5345671480003e-6 1.0974704577089e-5 1.42538741163702e-5 1.73385589814633e-5 2.02427147104623e-5 2.29383213938169e-5 2.54270156775404e-5 2.77079444336199e-5 2.98205583919132e-5 3.14968254692446e-5 3.32641657027279e-5 3.46879785388071e-5 3.58419705572146e-5 3.67702946218063e-5 3.74882685294917e-5 3.80172027315447e-5 3.83356611921185e-5 3.84617902622245e-5 3.84008667836707e-5 3.81506665317904e-5 3.77205312917436e-5 3.71120880500224e-5 3.63431784582818e-5 3.54234983372247e-5 3.43727119744575e-5 3.31955898421991e-5 3.1906749021575e-5 3.05258134239308e-5 2.90529184467942e-5 2.75097685821301e-5 2.59088069682988e-5 2.42417431818782e-5 2.25533698766556e-5 2.08203230001769e-5 1.90726123593194e-5 1.73113519018396e-5 1.55498084717804e-5 1.3807553643137e-5 1.209928683708e-5 1.04110267491666e-5 8.76565171236067e-6 7.15216767756425e-6 5.6127107530343e-6 4.13545107510629e-6 2.70697389916737e-6 1.36339097208028e-6 1.17779154321068e-7 -1.06608354010604e-6 -2.15293957076619e-6 -3.16293668294449e-6 -4.08336036205811e-6 -4.90087590625251e-6 -5.63180592699196e-6 -6.27926662890536e-6 -6.83300292562487e-6 -7.28830988147217e-6 -7.66363813247865e-6 -7.93678154525632e-6 -8.13579312269827e-6 -8.24897818906316e-6 -8.28726470313328e-6 -8.24614335450001e-6 -8.13285647140816e-6 -7.94996380288693e-6 -1.11200257011025e-4 fceu-0.98.12/src/fir/c96000ntsc.h0000644000175000000620000000505710003562763015754 0ustar joestaff000000000000000, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, -1, -1, -2, -2, -2, -3, -3, -3, -3, -3, -3, -3, -3, -3, -2, -2, -1, -1, 0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 7, 7, 7, 7, 7, 7, 6, 6, 5, 4, 2, 1, 0, -1, -3, -5, -6, -8, -10, -11, -12, -13, -14, -14, -14, -14, -14, -13, -11, -10, -8, -6, -3, 0, 1, 4, 7, 10, 13, 16, 18, 21, 22, 24, 25, 25, 25, 24, 23, 21, 18, 15, 12, 8, 3, -1, -6, -11, -16, -20, -25, -29, -33, -36, -39, -41, -42, -42, -41, -39, -36, -32, -27, -22, -15, -8, -1, 6, 14, 22, 30, 37, 44, 51, 56, 60, 64, 65, 66, 65, 62, 58, 53, 46, 38, 28, 18, 6, -4, -17, -29, -41, -53, -64, -74, -83, -90, -95, -99, -100, -100, -97, -91, -84, -74, -62, -49, -33, -17, 0, 18, 36, 55, 72, 89, 104, 118, 129, 138, 144, 148, 148, 144, 138, 128, 114, 98, 79, 58, 34, 9, -16, -42, -69, -95, -120, -143, -163, -181, -195, -205, -211, -212, -209, -201, -188, -171, -149, -124, -94, -62, -27, 8, 46, 84, 121, 156, 189, 219, 245, 267, 283, 294, 298, 295, 287, 271, 249, 221, 187, 148, 104, 57, 7, -44, -96, -148, -198, -245, -288, -326, -358, -382, -400, -408, -408, -399, -381, -354, -318, -274, -223, -165, -102, -35, 34, 105, 175, 244, 309, 370, 424, 470, 507, 533, 549, 553, 545, 524, 492, 447, 392, 326, 252, 169, 81, -10, -105, -200, -293, -383, -466, -541, -606, -660, -700, -726, -737, -732, -710, -672, -619, -550, -467, -372, -266, -152, -31, 93, 219, 344, 464, 577, 680, 771, 847, 907, 948, 970, 970, 949, 907, 843, 760, 657, 537, 403, 256, 99, -62, -228, -392, -552, -704, -845, -970, -1077, -1164, -1226, -1264, -1274, -1257, -1211, -1138, -1038, -912, -763, -593, -407, -206, 3, 219, 435, 647, 851, 1040, 1212, 1361, 1484, 1578, 1639, 1666, 1656, 1610, 1528, 1409, 1257, 1073, 860, 623, 367, 95, -184, -468, -749, -1020, -1277, -1512, -1719, -1894, -2033, -2130, -2182, -2188, -2146, -2056, -1918, -1734, -1507, -1240, -939, -610, -257, 109, 484, 859, 1225, 1574, 1898, 2190, 2441, 2646, 2798, 2893, 2926, 2897, 2802, 2643, 2421, 2140, 1803, 1416, 986, 522, 32, -472, -983, -1487, -1974, -2433, -2853, -3223, -3534, -3777, -3944, -4030, -4029, -3940, -3760, -3492, -3137, -2701, -2189, -1611, -977, -298, 411, 1139, 1868, 2584, 3270, 3910, 4489, 4991, 5404, 5713, 5909, 5982, 5926, 5735, 5409, 4948, 4356, 3639, 2808, 1873, 851, -241, -1385, -2559, -3738, -4899, -6016, -7064, -8015, -8845, -9529, -10043, -10366, -10479, -10363, -10006, -9397, -8529, -7398, -6005, -4355, -2456, -320, 2033, 4587, 7316, 10193, 13188, 16268, 19400, 22548, 25673, 28740, 31710, 34547, 37216, 39683, 41916, 43887, 45570, 46943, 47990, 48695, 49050, fceu-0.98.12/src/fir/c48000pal.coef0000755000175000000620000005114010003562763016240 0ustar joestaff00000000000000;; ***** 48000 PAL ***** ;; Filter length: 1024 ;; Symmetry: cosine ;; Sampling frequency: 1662607.125 ;; Grid density: 10257 ;; Deviation parameter: y=-4.04456123260461e-4 ;; ;; Specifications: ;; (limit > 24000 831303.5625 0 0.5) ;; (limit < 24000 831303.5625 0 0.5) ;; (limit > 0 17500 1 1) ;; (limit < 0 17500 1 1) ;; ;; Coefficients: 1.0783172932896e-4 1.3561475850253e-5 1.43150420416283e-5 1.49886363377349e-5 1.56015105099026e-5 1.61381192401086e-5 1.66025516801309e-5 1.69644855111871e-5 1.72420268548982e-5 1.74096049850514e-5 1.7466907549538e-5 1.74305599416104e-5 1.72624970620822e-5 1.69512561328662e-5 1.65342695578314e-5 1.59775197454088e-5 1.52766280693198e-5 1.44428101292738e-5 1.34684866379703e-5 1.23509418255071e-5 1.1081808312081e-5 9.68440865212042e-6 8.15580831379911e-6 6.49256056198478e-6 4.70330948990956e-6 2.7936406340967e-6 7.85613395286448e-7 -1.32808013796309e-6 -3.52876960484536e-6 -5.8080561629844e-6 -8.15813413487457e-6 -1.05512845558752e-5 -1.30105356059099e-5 -1.54617489968656e-5 -1.79517990398971e-5 -2.04397035642729e-5 -2.28952912040035e-5 -2.53180967028265e-5 -2.76813804395839e-5 -2.99602884421574e-5 -3.21440371766843e-5 -3.42144286692688e-5 -3.61550983136946e-5 -3.7936448702778e-5 -3.95673425206259e-5 -4.10009072283261e-5 -4.22696474647012e-5 -4.330258187421e-5 -4.41187219554721e-5 -4.46550647769792e-5 -4.49347491986505e-5 -4.49183030848856e-5 -4.46584800684937e-5 -4.41642416915663e-5 -4.33946068310562e-5 -4.20871716501139e-5 -4.07538528085648e-5 -3.89585839480776e-5 -3.69098747867203e-5 -3.45543123183317e-5 -3.18949347092464e-5 -2.89523632049071e-5 -2.57213276898428e-5 -2.22202644601619e-5 -1.84617206755275e-5 -1.44991867492458e-5 -1.02613766503818e-5 -5.85405894330665e-6 -1.27028212217224e-6 3.4875707995152e-6 8.36526659552602e-6 1.33338533249663e-5 1.8385703423788e-5 2.34769030974947e-5 2.85812390861387e-5 3.36580878548364e-5 3.86654975743835e-5 4.3578901034037e-5 4.83892064467925e-5 5.29979535540185e-5 5.74271144638819e-5 6.16215703975737e-5 6.55395388635905e-5 6.91595354640541e-5 7.24387952032281e-5 7.53549961562705e-5 7.78768810641327e-5 7.99367008803979e-5 8.15775690813463e-5 8.27210398644824e-5 8.336395615943e-5 8.34873471492661e-5 8.3069518826596e-5 8.20987920151301e-5 8.05698418267922e-5 7.84588588088235e-5 7.57790438357932e-5 7.25271257954213e-5 6.869107843266e-5 6.42839469147515e-5 5.93705790211257e-5 5.38840838876231e-5 4.7915115002444e-5 4.14264390433695e-5 3.44799673466393e-5 2.70923034925926e-5 1.93377097998663e-5 1.12230483582735e-5 2.77563609884032e-6 -5.95253220278385e-6 -1.48596469580734e-5 -2.39905698155697e-5 -3.31928444133421e-5 -4.24774078883453e-5 -5.17561952024819e-5 -6.09681170673795e-5 -7.00816711966441e-5 -7.89965327587163e-5 -8.76739937512259e-5 -9.60257665780481e-5 -1.040422410093e-4 -1.1158288385138e-4 -1.18671435004228e-4 -1.25189526359341e-4 -1.31095577074443e-4 -1.3633898735937e-4 -1.40872811972437e-4 -1.44637497417931e-4 -1.47604758781598e-4 -1.49721217177156e-4 -1.50937788247908e-4 -1.51260723345739e-4 -1.50640490277245e-4 -1.49027129666833e-4 -1.46478116043421e-4 -1.4290837237091e-4 -1.38355651240051e-4 -1.32821684691922e-4 -1.26301014847642e-4 -1.18832774313583e-4 -1.10412614981825e-4 -1.01079807360939e-4 -9.08863150937633e-5 -7.9855536779786e-5 -6.80420533998678e-5 -5.55036002160919e-5 -4.23070943880991e-5 -2.85100491723636e-5 -1.41910602190798e-5 5.74159896625749e-7 1.5685350087147e-5 3.10821961290075e-5 4.66746733164285e-5 6.23410430656923e-5 7.79838341733242e-5 9.35400846529469e-5 1.08858050814022e-4 1.23885745586263e-4 1.38490587292571e-4 1.52569798991098e-4 1.6602735554204e-4 1.78757451082868e-4 1.90662487656944e-4 2.0165164397247e-4 2.11641859228633e-4 2.20511364369255e-4 2.2822201475425e-4 2.34662780276811e-4 2.39770894383923e-4 2.43490345927973e-4 2.45765411178182e-4 2.46534390337095e-4 2.45775167592942e-4 2.43426392718766e-4 2.39499784238424e-4 2.33967252721536e-4 2.2684189259918e-4 2.18093865253775e-4 2.0779413468937e-4 1.95927141401289e-4 1.82552706187548e-4 1.67719946286442e-4 1.5149295655487e-4 1.33932663941035e-4 1.15116784735802e-4 9.51630411589421e-5 7.41353615298954e-5 5.21718190054817e-5 2.93810695999424e-5 5.86942660727624e-6 -1.81928117661243e-5 -4.26953547177328e-5 -6.74884760425993e-5 -9.24000620732457e-5 -1.17306452222934e-4 -1.42028053706926e-4 -1.6641748536327e-4 -1.90295327481145e-4 -2.13526648772877e-4 -2.35920378174742e-4 -2.57335540622496e-4 -2.77618149216888e-4 -2.96599532917617e-4 -3.14140693377271e-4 -3.30094800932447e-4 -3.44339603052102e-4 -3.56739336123611e-4 -3.67174212136651e-4 -3.75531849424532e-4 -3.81724589486029e-4 -3.85657939336761e-4 -3.87265732840677e-4 -3.86491839797252e-4 -3.83275416154692e-4 -3.7760973646446e-4 -3.69439578879e-4 -3.58799773629522e-4 -3.45691587198199e-4 -3.30143612933627e-4 -3.12196804269503e-4 -2.91948940195075e-4 -2.6941592693139e-4 -2.4475129607813e-4 -2.18033329216043e-4 -1.89400291263887e-4 -1.59001839727708e-4 -1.26964645968482e-4 -9.3468599675526e-5 -5.87099485768434e-5 -2.28718895559617e-5 1.38661453336005e-5 5.12504716648456e-5 8.90765541567582e-5 1.27141536384486e-4 1.6517131814265e-4 2.02945866294048e-4 2.40219213745026e-4 2.76746123957115e-4 3.12293133420806e-4 3.46593092375836e-4 3.79424363443158e-4 4.1054132937402e-4 4.39736117650459e-4 4.66739582083122e-4 4.91387907517869e-4 5.1345669379648e-4 5.32755361807803e-4 5.4909940710768e-4 5.62348662402172e-4 5.72345993122783e-4 5.7896654574189e-4 5.82090419479584e-4 5.81654406347142e-4 5.77562548184356e-4 5.69788762315823e-4 5.58298302006844e-4 5.43090048796913e-4 5.24193502963293e-4 5.0164051079223e-4 4.75510033518712e-4 4.45905690887374e-4 4.12931250800377e-4 3.76718492573694e-4 3.37454368210552e-4 2.95309158288872e-4 2.50487407773454e-4 2.03239263665977e-4 1.53785113286668e-4 1.02426054275038e-4 4.94039771196527e-5 -4.9436684286017e-6 -6.03298616514903e-5 -1.16406402480797e-4 -1.72843182266513e-4 -2.29302160827241e-4 -2.85424280783829e-4 -3.40849878416515e-4 -3.95231606514409e-4 -4.4818593119753e-4 -4.99366108188115e-4 -5.48439341418767e-4 -5.95017923651795e-4 -6.38796736934187e-4 -6.79430579536826e-4 -7.16620285053831e-4 -7.50034221495514e-4 -7.79437560472454e-4 -8.0454137082786e-4 -8.25108701083097e-4 -8.40934131367373e-4 -8.51820948123654e-4 -8.57609584970445e-4 -8.58175472793311e-4 -8.53390483100241e-4 -8.43209551079894e-4 -8.27590879655203e-4 -8.06510409502537e-4 -7.79995072230027e-4 -7.48155417238511e-4 -7.11020274128235e-4 -6.68770312317841e-4 -6.21544132125251e-4 -5.69560032134081e-4 -5.13047603992703e-4 -4.52260267743927e-4 -3.87511758268314e-4 -3.19128561449503e-4 -2.47461748174838e-4 -1.72891786174927e-4 -9.58451800481746e-5 -1.67437726740921e-5 6.39622864075221e-5 1.45802914515735e-4 2.28276969072054e-4 3.10881168326302e-4 3.931285095721e-4 4.74478553853189e-4 5.54406623481691e-4 6.32405031540309e-4 7.07946519860834e-4 7.80505190513501e-4 8.49580370607698e-4 9.14664923660729e-4 9.75306400682111e-4 0.00103102014646356 0.00108137261722973 0.00112594391364669 0.00116436209978936 0.00119625989249914 0.00122130266875817 0.00123924969043022 0.00124980344180312 0.00125278240951216 0.00124802165372955 0.00123540269762469 0.00121484756393481 0.0011863534276383 0.00114991049765994 0.00110562855369365 0.0010536068934269 9.94030202153522e-4 9.27120376158647e-4 8.53156860257162e-4 7.72454365212224e-4 6.85390250514192e-4 5.92375082207849e-4 4.9387876727933e-4 3.90393002098172e-4 2.82480107088887e-4 1.7070831244188e-4 5.56879005104824e-5 -6.1906284350905e-5 -1.81415283544607e-4 -3.02142730803428e-4 -4.2333875391934e-4 -5.44296445422888e-4 -6.64236400947683e-4 -7.82407565044765e-4 -8.98051026608098e-4 -0.00101038113005766 -0.00111866302268561 -0.0012221295410412 -0.0013200609608465 -0.00141171609738229 -0.00149643580490023 -0.00157354248105082 -0.00164240522652266 -0.00170243934737355 -0.00175309370471778 -0.00179387496858474 -0.00182430930810295 -0.00184402395447169 -0.00185266724915187 -0.00184997271570004 -0.00183570586409282 -0.00180972121663046 -0.00177195203127539 -0.00172237368010418 -0.00166105454652476 -0.00158811703816067 -0.00150378726049984 -0.00140832762076639 -0.0013020899508538 -0.00118551225223178 -0.00105910322772149 -9.23393236851473e-4 -7.79055327805226e-4 -6.26768212465557e-4 -4.67302931140705e-4 -3.01491270723501e-4 -1.30195855297908e-4 4.56401652766111e-5 2.25027067508283e-4 4.06972972690671e-4 5.90405019516109e-4 7.74216306706467e-4 9.57318662226946e-4 0.00113855626997318 0.00131678634527204 0.0014908552858621 0.00165959118483483 0.00182185835208505 0.00197650815267658 0.00212242280398454 0.00225851246246872 0.00238371539035943 0.00249702508323125 0.00259744117052929 0.0026840846677887 0.00275607645257497 0.00281263432325704 0.0028530403230186 0.0028766569205693 0.00288293135970344 0.00287140344532155 0.00284168448509905 0.00279352301691183 0.00272673120228367 0.00264124885341234 0.00253711261587615 0.00241447127968604 0.00227360193577821 0.00211485651002808 0.00193873386299929 0.00174582789013106 0.00153686167145326 0.00131264246333188 0.00107412717117761 8.22324668075117e-4 5.58399255126717e-4 2.83585936906761e-4 -7.91653518883316e-7 -2.93275867453424e-4 -5.92385560905748e-4 -8.96504293668282e-4 -0.0012039962137455 -0.00151310994118933 -0.00182206762040076 -0.00212903602637386 -0.00243213041621861 -0.00272944724644087 -0.00301904353935261 -0.0032989847822554 -0.00356729741889108 -0.00382205238995045 -0.0040612825745775 -0.00428310710833949 -0.0044856335950343 -0.00466702696411301 -0.00482550437652975 -0.0049593584042375 -0.00506692577218407 -0.00514666052596478 -0.0051970785659304 -0.00521680784237087 -0.0052045920045337 -0.00515926816288351 -0.00507981542203718 -0.00496534580148461 -0.00481509247434497 -0.00462843395985089 -0.00440489964062938 -0.00414419512168892 -0.0038461191704701 -0.00351070824147442 -0.00313809095768648 -0.00272861114037865 -0.00228275272798312 -0.0018011488246512 -0.00128463575154861 -7.34189492529516e-4 -1.50939392418879e-4 4.63827670998463e-4 0.001108634043237 0.00178191442074677 0.00248189327531725 0.00320672778303872 0.0039543772472654 0.00472272054027297 0.0055095123033422 0.00631238695466698 0.00712888111691215 0.00795646562805878 0.0087925100600243 0.00963433252114155 0.0104791770461524 0.0113242494156599 0.0121667411979553 0.0130037845552242 0.0138325371327049 0.0146501343342719 0.015453752838051 0.0162405643560213 0.0170077895549428 0.017752734005397 0.0184727026611722 0.0191651536375909 0.0198275436619083 0.0204575091596416 0.0210527297897325 0.021611049283905 0.0221303981307109 0.0226088947033753 0.0230447502475501 0.023436353984896 0.0237822666417811 0.0240811879818443 0.0243320190632054 0.0245338129670568 0.0246858223616 0.0247874779906384 0.0248384026328523 0.0248384026328523 0.0247874779906384 0.0246858223616 0.0245338129670568 0.0243320190632054 0.0240811879818443 0.0237822666417811 0.023436353984896 0.0230447502475501 0.0226088947033753 0.0221303981307109 0.021611049283905 0.0210527297897325 0.0204575091596416 0.0198275436619083 0.0191651536375909 0.0184727026611722 0.017752734005397 0.0170077895549428 0.0162405643560213 0.015453752838051 0.0146501343342719 0.0138325371327049 0.0130037845552242 0.0121667411979553 0.0113242494156599 0.0104791770461524 0.00963433252114155 0.0087925100600243 0.00795646562805878 0.00712888111691215 0.00631238695466698 0.0055095123033422 0.00472272054027297 0.0039543772472654 0.00320672778303872 0.00248189327531725 0.00178191442074677 0.001108634043237 4.63827670998463e-4 -1.50939392418879e-4 -7.34189492529516e-4 -0.00128463575154861 -0.0018011488246512 -0.00228275272798312 -0.00272861114037865 -0.00313809095768648 -0.00351070824147442 -0.0038461191704701 -0.00414419512168892 -0.00440489964062938 -0.00462843395985089 -0.00481509247434497 -0.00496534580148461 -0.00507981542203718 -0.00515926816288351 -0.0052045920045337 -0.00521680784237087 -0.0051970785659304 -0.00514666052596478 -0.00506692577218407 -0.0049593584042375 -0.00482550437652975 -0.00466702696411301 -0.0044856335950343 -0.00428310710833949 -0.0040612825745775 -0.00382205238995045 -0.00356729741889108 -0.0032989847822554 -0.00301904353935261 -0.00272944724644087 -0.00243213041621861 -0.00212903602637386 -0.00182206762040076 -0.00151310994118933 -0.0012039962137455 -8.96504293668282e-4 -5.92385560905748e-4 -2.93275867453424e-4 -7.91653518883316e-7 2.83585936906761e-4 5.58399255126717e-4 8.22324668075117e-4 0.00107412717117761 0.00131264246333188 0.00153686167145326 0.00174582789013106 0.00193873386299929 0.00211485651002808 0.00227360193577821 0.00241447127968604 0.00253711261587615 0.00264124885341234 0.00272673120228367 0.00279352301691183 0.00284168448509905 0.00287140344532155 0.00288293135970344 0.0028766569205693 0.0028530403230186 0.00281263432325704 0.00275607645257497 0.0026840846677887 0.00259744117052929 0.00249702508323125 0.00238371539035943 0.00225851246246872 0.00212242280398454 0.00197650815267658 0.00182185835208505 0.00165959118483483 0.0014908552858621 0.00131678634527204 0.00113855626997318 9.57318662226946e-4 7.74216306706467e-4 5.90405019516109e-4 4.06972972690671e-4 2.25027067508283e-4 4.56401652766111e-5 -1.30195855297908e-4 -3.01491270723501e-4 -4.67302931140705e-4 -6.26768212465557e-4 -7.79055327805226e-4 -9.23393236851473e-4 -0.00105910322772149 -0.00118551225223178 -0.0013020899508538 -0.00140832762076639 -0.00150378726049984 -0.00158811703816067 -0.00166105454652476 -0.00172237368010418 -0.00177195203127539 -0.00180972121663046 -0.00183570586409282 -0.00184997271570004 -0.00185266724915187 -0.00184402395447169 -0.00182430930810295 -0.00179387496858474 -0.00175309370471778 -0.00170243934737355 -0.00164240522652266 -0.00157354248105082 -0.00149643580490023 -0.00141171609738229 -0.0013200609608465 -0.0012221295410412 -0.00111866302268561 -0.00101038113005766 -8.98051026608098e-4 -7.82407565044765e-4 -6.64236400947683e-4 -5.44296445422888e-4 -4.2333875391934e-4 -3.02142730803428e-4 -1.81415283544607e-4 -6.1906284350905e-5 5.56879005104824e-5 1.7070831244188e-4 2.82480107088887e-4 3.90393002098172e-4 4.9387876727933e-4 5.92375082207849e-4 6.85390250514192e-4 7.72454365212224e-4 8.53156860257162e-4 9.27120376158647e-4 9.94030202153522e-4 0.0010536068934269 0.00110562855369365 0.00114991049765994 0.0011863534276383 0.00121484756393481 0.00123540269762469 0.00124802165372955 0.00125278240951216 0.00124980344180312 0.00123924969043022 0.00122130266875817 0.00119625989249914 0.00116436209978936 0.00112594391364669 0.00108137261722973 0.00103102014646356 9.75306400682111e-4 9.14664923660729e-4 8.49580370607698e-4 7.80505190513501e-4 7.07946519860834e-4 6.32405031540309e-4 5.54406623481691e-4 4.74478553853189e-4 3.931285095721e-4 3.10881168326302e-4 2.28276969072054e-4 1.45802914515735e-4 6.39622864075221e-5 -1.67437726740921e-5 -9.58451800481746e-5 -1.72891786174927e-4 -2.47461748174838e-4 -3.19128561449503e-4 -3.87511758268314e-4 -4.52260267743927e-4 -5.13047603992703e-4 -5.69560032134081e-4 -6.21544132125251e-4 -6.68770312317841e-4 -7.11020274128235e-4 -7.48155417238511e-4 -7.79995072230027e-4 -8.06510409502537e-4 -8.27590879655203e-4 -8.43209551079894e-4 -8.53390483100241e-4 -8.58175472793311e-4 -8.57609584970445e-4 -8.51820948123654e-4 -8.40934131367373e-4 -8.25108701083097e-4 -8.0454137082786e-4 -7.79437560472454e-4 -7.50034221495514e-4 -7.16620285053831e-4 -6.79430579536826e-4 -6.38796736934187e-4 -5.95017923651795e-4 -5.48439341418767e-4 -4.99366108188115e-4 -4.4818593119753e-4 -3.95231606514409e-4 -3.40849878416515e-4 -2.85424280783829e-4 -2.29302160827241e-4 -1.72843182266513e-4 -1.16406402480797e-4 -6.03298616514903e-5 -4.9436684286017e-6 4.94039771196527e-5 1.02426054275038e-4 1.53785113286668e-4 2.03239263665977e-4 2.50487407773454e-4 2.95309158288872e-4 3.37454368210552e-4 3.76718492573694e-4 4.12931250800377e-4 4.45905690887374e-4 4.75510033518712e-4 5.0164051079223e-4 5.24193502963293e-4 5.43090048796913e-4 5.58298302006844e-4 5.69788762315823e-4 5.77562548184356e-4 5.81654406347142e-4 5.82090419479584e-4 5.7896654574189e-4 5.72345993122783e-4 5.62348662402172e-4 5.4909940710768e-4 5.32755361807803e-4 5.1345669379648e-4 4.91387907517869e-4 4.66739582083122e-4 4.39736117650459e-4 4.1054132937402e-4 3.79424363443158e-4 3.46593092375836e-4 3.12293133420806e-4 2.76746123957115e-4 2.40219213745026e-4 2.02945866294048e-4 1.6517131814265e-4 1.27141536384486e-4 8.90765541567582e-5 5.12504716648456e-5 1.38661453336005e-5 -2.28718895559617e-5 -5.87099485768434e-5 -9.3468599675526e-5 -1.26964645968482e-4 -1.59001839727708e-4 -1.89400291263887e-4 -2.18033329216043e-4 -2.4475129607813e-4 -2.6941592693139e-4 -2.91948940195075e-4 -3.12196804269503e-4 -3.30143612933627e-4 -3.45691587198199e-4 -3.58799773629522e-4 -3.69439578879e-4 -3.7760973646446e-4 -3.83275416154692e-4 -3.86491839797252e-4 -3.87265732840677e-4 -3.85657939336761e-4 -3.81724589486029e-4 -3.75531849424532e-4 -3.67174212136651e-4 -3.56739336123611e-4 -3.44339603052102e-4 -3.30094800932447e-4 -3.14140693377271e-4 -2.96599532917617e-4 -2.77618149216888e-4 -2.57335540622496e-4 -2.35920378174742e-4 -2.13526648772877e-4 -1.90295327481145e-4 -1.6641748536327e-4 -1.42028053706926e-4 -1.17306452222934e-4 -9.24000620732457e-5 -6.74884760425993e-5 -4.26953547177328e-5 -1.81928117661243e-5 5.86942660727624e-6 2.93810695999424e-5 5.21718190054817e-5 7.41353615298954e-5 9.51630411589421e-5 1.15116784735802e-4 1.33932663941035e-4 1.5149295655487e-4 1.67719946286442e-4 1.82552706187548e-4 1.95927141401289e-4 2.0779413468937e-4 2.18093865253775e-4 2.2684189259918e-4 2.33967252721536e-4 2.39499784238424e-4 2.43426392718766e-4 2.45775167592942e-4 2.46534390337095e-4 2.45765411178182e-4 2.43490345927973e-4 2.39770894383923e-4 2.34662780276811e-4 2.2822201475425e-4 2.20511364369255e-4 2.11641859228633e-4 2.0165164397247e-4 1.90662487656944e-4 1.78757451082868e-4 1.6602735554204e-4 1.52569798991098e-4 1.38490587292571e-4 1.23885745586263e-4 1.08858050814022e-4 9.35400846529469e-5 7.79838341733242e-5 6.23410430656923e-5 4.66746733164285e-5 3.10821961290075e-5 1.5685350087147e-5 5.74159896625749e-7 -1.41910602190798e-5 -2.85100491723636e-5 -4.23070943880991e-5 -5.55036002160919e-5 -6.80420533998678e-5 -7.9855536779786e-5 -9.08863150937633e-5 -1.01079807360939e-4 -1.10412614981825e-4 -1.18832774313583e-4 -1.26301014847642e-4 -1.32821684691922e-4 -1.38355651240051e-4 -1.4290837237091e-4 -1.46478116043421e-4 -1.49027129666833e-4 -1.50640490277245e-4 -1.51260723345739e-4 -1.50937788247908e-4 -1.49721217177156e-4 -1.47604758781598e-4 -1.44637497417931e-4 -1.40872811972437e-4 -1.3633898735937e-4 -1.31095577074443e-4 -1.25189526359341e-4 -1.18671435004228e-4 -1.1158288385138e-4 -1.040422410093e-4 -9.60257665780481e-5 -8.76739937512259e-5 -7.89965327587163e-5 -7.00816711966441e-5 -6.09681170673795e-5 -5.17561952024819e-5 -4.24774078883453e-5 -3.31928444133421e-5 -2.39905698155697e-5 -1.48596469580734e-5 -5.95253220278385e-6 2.77563609884032e-6 1.12230483582735e-5 1.93377097998663e-5 2.70923034925926e-5 3.44799673466393e-5 4.14264390433695e-5 4.7915115002444e-5 5.38840838876231e-5 5.93705790211257e-5 6.42839469147515e-5 6.869107843266e-5 7.25271257954213e-5 7.57790438357932e-5 7.84588588088235e-5 8.05698418267922e-5 8.20987920151301e-5 8.3069518826596e-5 8.34873471492661e-5 8.336395615943e-5 8.27210398644824e-5 8.15775690813463e-5 7.99367008803979e-5 7.78768810641327e-5 7.53549961562705e-5 7.24387952032281e-5 6.91595354640541e-5 6.55395388635905e-5 6.16215703975737e-5 5.74271144638819e-5 5.29979535540185e-5 4.83892064467925e-5 4.3578901034037e-5 3.86654975743835e-5 3.36580878548364e-5 2.85812390861387e-5 2.34769030974947e-5 1.8385703423788e-5 1.33338533249663e-5 8.36526659552602e-6 3.4875707995152e-6 -1.27028212217224e-6 -5.85405894330665e-6 -1.02613766503818e-5 -1.44991867492458e-5 -1.84617206755275e-5 -2.22202644601619e-5 -2.57213276898428e-5 -2.89523632049071e-5 -3.18949347092464e-5 -3.45543123183317e-5 -3.69098747867203e-5 -3.89585839480776e-5 -4.07538528085648e-5 -4.20871716501139e-5 -4.33946068310562e-5 -4.41642416915663e-5 -4.46584800684937e-5 -4.49183030848856e-5 -4.49347491986505e-5 -4.46550647769792e-5 -4.41187219554721e-5 -4.330258187421e-5 -4.22696474647012e-5 -4.10009072283261e-5 -3.95673425206259e-5 -3.7936448702778e-5 -3.61550983136946e-5 -3.42144286692688e-5 -3.21440371766843e-5 -2.99602884421574e-5 -2.76813804395839e-5 -2.53180967028265e-5 -2.28952912040035e-5 -2.04397035642729e-5 -1.79517990398971e-5 -1.54617489968656e-5 -1.30105356059099e-5 -1.05512845558752e-5 -8.15813413487457e-6 -5.8080561629844e-6 -3.52876960484536e-6 -1.32808013796309e-6 7.85613395286448e-7 2.7936406340967e-6 4.70330948990956e-6 6.49256056198478e-6 8.15580831379911e-6 9.68440865212042e-6 1.1081808312081e-5 1.23509418255071e-5 1.34684866379703e-5 1.44428101292738e-5 1.52766280693198e-5 1.59775197454088e-5 1.65342695578314e-5 1.69512561328662e-5 1.72624970620822e-5 1.74305599416104e-5 1.7466907549538e-5 1.74096049850514e-5 1.72420268548982e-5 1.69644855111871e-5 1.66025516801309e-5 1.61381192401086e-5 1.56015105099026e-5 1.49886363377349e-5 1.43150420416283e-5 1.3561475850253e-5 1.0783172932896e-4 fceu-0.98.12/src/fir/c96000pal.h0000644000175000000620000000470510003562763015560 0ustar joestaff000000000000000, 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, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 0, 0, 0, 0, -1, -1, -2, -3, -3, -4, -4, -5, -5, -5, -5, -5, -5, -4, -4, -3, -2, -1, 0, 0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 10, 9, 8, 7, 6, 4, 2, 0, -1, -4, -6, -8, -11, -13, -15, -16, -18, -19, -19, -19, -19, -18, -17, -15, -13, -10, -6, -3, 0, 4, 8, 12, 17, 20, 24, 27, 30, 32, 33, 34, 34, 33, 31, 28, 25, 20, 15, 9, 3, -3, -10, -17, -24, -31, -37, -43, -48, -52, -55, -57, -57, -56, -54, -50, -45, -38, -30, -21, -11, 0, 10, 21, 33, 44, 55, 64, 73, 80, 86, 90, 92, 91, 88, 84, 76, 67, 56, 42, 27, 11, -5, -23, -41, -59, -76, -92, -106, -119, -129, -136, -141, -142, -140, -134, -125, -112, -96, -77, -56, -32, -6, 19, 47, 74, 100, 125, 149, 169, 186, 199, 208, 213, 212, 206, 195, 179, 158, 132, 102, 68, 32, -6, -46, -86, -126, -164, -200, -232, -259, -282, -298, -308, -311, -307, -294, -275, -248, -214, -173, -128, -77, -23, 33, 91, 149, 205, 258, 307, 350, 386, 415, 434, 443, 442, 431, 408, 375, 332, 280, 219, 151, 76, -1, -82, -164, -245, -322, -394, -459, -515, -561, -595, -615, -622, -613, -590, -552, -499, -433, -354, -264, -165, -59, 51, 164, 277, 387, 490, 586, 670, 741, 797, 835, 854, 853, 832, 790, 729, 647, 548, 433, 304, 163, 15, -138, -293, -445, -592, -729, -852, -959, -1046, -1111, -1151, -1165, -1151, -1110, -1040, -944, -822, -677, -512, -329, -133, 71, 280, 489, 693, 886, 1063, 1220, 1353, 1458, 1530, 1569, 1571, 1535, 1462, 1352, 1206, 1027, 818, 584, 328, 57, -222, -505, -785, -1054, -1306, -1534, -1733, -1896, -2019, -2097, -2128, -2108, -2038, -1917, -1747, -1529, -1269, -970, -639, -283, 90, 474, 857, 1233, 1590, 1921, 2216, 2467, 2667, 2810, 2890, 2904, 2849, 2724, 2530, 2270, 1946, 1566, 1135, 664, 160, -363, -895, -1425, -1938, -2423, -2866, -3256, -3582, -3834, -4003, -4082, -4067, -3953, -3741, -3431, -3028, -2537, -1967, -1328, -632, 106, 871, 1646, 2413, 3154, 3849, 4482, 5034, 5489, 5833, 6051, 6134, 6074, 5864, 5504, 4994, 4339, 3546, 2628, 1599, 477, -716, -1958, -3223, -4482, -5708, -6869, -7936, -8878, -9666, -10273, -10671, -10839, -10755, -10402, -9767, -8843, -7623, -6110, -4308, -2228, 114, 2701, 5505, 8499, 11650, 14923, 18277, 21673, 25068, 28417, 31678, 34807, 37762, 40502, 42991, 45192, 47076, 48617, 49792, 50584, 50983, fceu-0.98.12/src/fir/Makefile0000755000175000000620000000056710003562763015536 0ustar joestaff00000000000000CC = gcc %.h: %.coef cat $< | ./toh > $@ || true all: floogie c44100ntsc.h c48000ntsc.h c96000ntsc.h c44100pal.h c48000pal.h c96000pal.h #c44100ntsc.h: c44100ntsc.coef #c48000ntsc.h: c48000ntsc.coef #c96000ntsc.h: c96000ntsc.coef #c44100pal.h: c44100pal.coef #c48000pal.h: c48000pal.coef #c96000pal.h: c96000pal.coef floogie: toh.o gcc -o toh toh.o fceu-0.98.12/src/general.c0000644000175000000620000001522310047057745015076 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 #include #include #include #include #include "types.h" #include "fceu.h" #include "general.h" #include "state.h" #include "movie.h" #include "driver.h" #include "md5.h" static char BaseDirectory[2048]; static char FileBase[2048]; static char FileExt[2048]; /* Includes the . character, as in ".nes" */ static char FileBaseDirectory[2048]; void FCEUI_SetBaseDirectory(char *dir) { strncpy(BaseDirectory,dir,2047); BaseDirectory[2047]=0; } static char *odirs[FCEUIOD__COUNT]={0,0,0,0,0,0}; // odirs, odors. ^_^ void FCEUI_SetDirOverride(int which, char *n) { odirs[which]=n; if(FCEUGameInfo) /* Rebuild cache of present states/movies. */ { if(which==FCEUIOD_STATE) FCEUSS_CheckStates(); else if(which == FCEUIOD_MOVIE) FCEUMOV_CheckMovies(); } } #ifndef HAVE_ASPRINTF static int asprintf(char **strp, const char *fmt, ...) { va_list ap; int ret; va_start(ap,fmt); if(!(*strp=malloc(2048))) return(0); ret=vsnprintf(*strp,2048,fmt,ap); va_end(ap); return(ret); } #endif char *FCEU_MakeFName(int type, int id1, char *cd1) { char *ret=0; struct stat tmpstat; switch(type) { case FCEUMKF_NPTEMP: asprintf(&ret,"%s"PSS"m590plqd94fo.tmp",BaseDirectory);break; case FCEUMKF_MOVIE:if(odirs[FCEUIOD_STATE]) asprintf(&ret,"%s"PSS"%s.%d.fcm",odirs[FCEUIOD_STATE],FileBase,id1); else asprintf(&ret,"%s"PSS"fcs"PSS"%s.%d.fcm",BaseDirectory,FileBase,id1); if(stat(ret,&tmpstat)==-1) { if(odirs[FCEUIOD_STATE]) asprintf(&ret,"%s"PSS"%s.%s.%d.fcm",odirs[FCEUIOD_STATE],FileBase,md5_asciistr(FCEUGameInfo->MD5),id1); else asprintf(&ret,"%s"PSS"fcs"PSS"%s.%s.%d.fcm",BaseDirectory,FileBase,md5_asciistr(FCEUGameInfo->MD5),id1); } break; case FCEUMKF_STATE:if(odirs[FCEUIOD_STATE]) asprintf(&ret,"%s"PSS"%s.fc%d",odirs[FCEUIOD_STATE],FileBase,id1); else asprintf(&ret,"%s"PSS"fcs"PSS"%s.fc%d",BaseDirectory,FileBase,id1); if(stat(ret,&tmpstat)==-1) { if(odirs[FCEUIOD_STATE]) asprintf(&ret,"%s"PSS"%s.%s.fc%d",odirs[FCEUIOD_STATE],FileBase,md5_asciistr(FCEUGameInfo->MD5),id1); else asprintf(&ret,"%s"PSS"fcs"PSS"%s.%s.fc%d",BaseDirectory,FileBase,md5_asciistr(FCEUGameInfo->MD5),id1); } break; case FCEUMKF_SNAP: if(FSettings.SnapName) { if(odirs[FCEUIOD_SNAPS]) asprintf(&ret,"%s"PSS"%s-%d.%s",odirs[FCEUIOD_SNAPS],FileBase,id1,cd1); else asprintf(&ret,"%s"PSS"snaps"PSS"%s-%d.%s",BaseDirectory,FileBase,id1,cd1); } else { if(odirs[FCEUIOD_SNAPS]) asprintf(&ret,"%s"PSS"%d.%s",odirs[FCEUIOD_SNAPS],id1,cd1); else asprintf(&ret,"%s"PSS"snaps"PSS"%d.%s",BaseDirectory,id1,cd1); } break; case FCEUMKF_FDS:if(odirs[FCEUIOD_NV]) asprintf(&ret,"%s"PSS"%s.%s.fds",odirs[FCEUIOD_NV],FileBase,md5_asciistr(FCEUGameInfo->MD5)); else asprintf(&ret,"%s"PSS"sav"PSS"%s.%s.fds",BaseDirectory,FileBase,md5_asciistr(FCEUGameInfo->MD5)); break; case FCEUMKF_SAV:if(odirs[FCEUIOD_NV]) asprintf(&ret,"%s"PSS"%s.%s",odirs[FCEUIOD_NV],FileBase,cd1); else asprintf(&ret,"%s"PSS"sav"PSS"%s.%s",BaseDirectory,FileBase,cd1); if(stat(ret,&tmpstat)==-1) { if(odirs[FCEUIOD_NV]) asprintf(&ret,"%s"PSS"%s.%s.%s",odirs[FCEUIOD_NV],FileBase,md5_asciistr(FCEUGameInfo->MD5),cd1); else asprintf(&ret,"%s"PSS"sav"PSS"%s.%s.%s",BaseDirectory,FileBase,md5_asciistr(FCEUGameInfo->MD5),cd1); } break; case FCEUMKF_CHEAT: if(odirs[FCEUIOD_CHEATS]) asprintf(&ret,"%s"PSS"%s.cht",odirs[FCEUIOD_CHEATS],FileBase); else asprintf(&ret,"%s"PSS"cheats"PSS"%s.cht",BaseDirectory,FileBase); break; case FCEUMKF_IPS: asprintf(&ret,"%s"PSS"%s%s.ips",FileBaseDirectory,FileBase,FileExt); break; case FCEUMKF_GGROM:asprintf(&ret,"%s"PSS"gg.rom",BaseDirectory);break; case FCEUMKF_FDSROM:asprintf(&ret,"%s"PSS"disksys.rom",BaseDirectory);break; case FCEUMKF_PALETTE: if(odirs[FCEUIOD_MISC]) asprintf(&ret,"%s"PSS"%s.pal",odirs[FCEUIOD_MISC],FileBase); else asprintf(&ret,"%s"PSS"gameinfo"PSS"%s.pal",BaseDirectory,FileBase); break; } return(ret); } void GetFileBase(const char *f) { const char *tp1,*tp3; #if PSS_STYLE==4 tp1=((char *)strrchr(f,':')); #elif PSS_STYLE==1 tp1=((char *)strrchr(f,'/')); #else tp1=((char *)strrchr(f,'\\')); #if PSS_STYLE!=3 tp3=((char *)strrchr(f,'/')); if(tp1tp1)) { memcpy(FileBase,tp1,tp3-tp1); FileBase[tp3-tp1]=0; strcpy(FileExt,tp3); } else { strcpy(FileBase,tp1); FileExt[0]=0; } } uint32 uppow2(uint32 n) { int x; for(x=31;x>=0;x--) if(n&(1< #include #include #include "types.h" #include "x6502.h" #include "fceu.h" #include "cart.h" #include "ppu.h" #define INESPRIV #include "ines.h" #include "general.h" #include "state.h" #include "file.h" #include "memory.h" #include "crc32.h" #include "md5.h" #include "cheat.h" #include "vsuni.h" extern SFORMAT FCEUVSUNI_STATEINFO[]; static uint8 *trainerpoo=0; static uint8 *ROM=NULL; static uint8 *VROM=NULL; static CartInfo iNESCart; uint8 iNESMirroring; uint16 iNESCHRBankList[8]; int32 iNESIRQLatch,iNESIRQCount; uint8 iNESIRQa; uint32 ROM_size; uint32 VROM_size; static void iNESPower(void); static int NewiNES_Init(int num); void (*MapClose)(void); void (*MapperReset)(void); static int MapperNo; static iNES_HEADER head; /* MapperReset() is called when the NES is reset(with the reset button). Mapperxxx_init is called when the NES has been powered on. */ static DECLFR(TrainerRead) { return(trainerpoo[A&0x1FF]); } static void iNESGI(int h) { switch(h) { case GI_RESETM2: if(MapperReset) MapperReset(); if(iNESCart.Reset) iNESCart.Reset(); break; case GI_POWER: if(iNESCart.Power) iNESCart.Power(); if(trainerpoo) { int x; for(x=0;x<512;x++) { X6502_DMW(0x7000+x,trainerpoo[x]); if(X6502_DMR(0x7000+x)!=trainerpoo[x]) { SetReadHandler(0x7000,0x71FF,TrainerRead); break; } } } break; case GI_CLOSE: { FCEU_SaveGameSave(&iNESCart); if(iNESCart.Close) iNESCart.Close(); if(ROM) {free(ROM);ROM=0;} if(VROM) {free(VROM);VROM=0;} if(MapClose) MapClose(); if(trainerpoo) {FCEU_gfree(trainerpoo);trainerpoo=0;} } break; } } uint32 iNESGameCRC32; struct CRCMATCH { uint32 crc; char *name; }; struct INPSEL { uint32 crc32; int input1; int input2; int inputfc; }; /* This is mostly for my personal use. So HA. */ static void SetInput(void) { static struct INPSEL moo[]= { {0x3a1694f9,SI_GAMEPAD,SI_GAMEPAD,SIFC_4PLAYER}, /* Nekketsu Kakutou Densetsu */ {0xc3c0811d,SI_GAMEPAD,SI_GAMEPAD,SIFC_OEKAKIDS}, /* The two "Oeka Kids" games */ {0x9d048ea4,SI_GAMEPAD,SI_GAMEPAD,SIFC_OEKAKIDS}, /* */ {0xaf4010ea,SI_GAMEPAD,SI_POWERPADB,-1}, /* World Class Track Meet */ {0xd74b2719,SI_GAMEPAD,SI_POWERPADB,-1}, /* Super Team Games */ {0x61d86167,SI_GAMEPAD,SI_POWERPADB,-1}, /* Street Cop */ // Bad dump? {0x23040fc4,SI_GAMEPAD,SI_POWERPADB,-1}, /* Short Order/Eggsplode */ {0x47232739,SI_GAMEPAD,SI_GAMEPAD,SIFC_TOPRIDER}, /* Top Rider */ {0x48ca0ee1,SI_GAMEPAD,SI_GAMEPAD,SIFC_BWORLD}, /* Barcode World */ {0x9f8f200a,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERA}, /* Super Mogura Tataki!! - Pokkun Moguraa */ {0x9044550e,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERA}, /* Rairai Kyonshizu */ {0x2f128512,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERA}, /* Jogging Race */ {0x60ad090a,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERA}, /* Athletic World */ {0x8a12a7d9,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, /* Totsugeki Fuuun Takeshi Jou */ {0xea90f3e2,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, /* Running Stadium */ {0x370ceb65,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, /* Meiro Dai Sakusen */ // Bad dump? {0x69ffb014,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, /* Fuun Takeshi Jou 2 */ {0x6cca1c1f,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, /* Dai Undoukai */ {0x29de87af,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, /* Aerobics Studio */ {0xbba58be5,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, /* Family Trainer: Manhattan Police */ {0xea90f3e2,SI_GAMEPAD,SI_GAMEPAD,SIFC_FTRAINERB}, /* Family Trainer: Running Stadium */ {0xd9f45be9,SI_GAMEPAD,SI_GAMEPAD,SIFC_QUIZKING}, /* Gimme a Break ... */ {0x1545bd13,SI_GAMEPAD,SI_GAMEPAD,SIFC_QUIZKING}, /* Gimme a Break ... 2 */ {0x7b44fb2a,SI_GAMEPAD,SI_GAMEPAD,SIFC_MAHJONG}, /* Ide Yousuke Meijin no Jissen Mahjong 2 */ {0x9fae4d46,SI_GAMEPAD,SI_GAMEPAD,SIFC_MAHJONG}, /* Ide Yousuke Meijin no Jissen Mahjong */ {0x980be936,SI_GAMEPAD,SI_GAMEPAD,SIFC_HYPERSHOT}, /* Hyper Olympic */ {0x21f85681,SI_GAMEPAD,SI_GAMEPAD,SIFC_HYPERSHOT}, /* Hyper Olympic (Gentei Ban) */ {0x915a53a7,SI_GAMEPAD,SI_GAMEPAD,SIFC_HYPERSHOT}, /* Hyper Sports */ {0xad9c63e2,SI_GAMEPAD,-1,SIFC_SHADOW}, /* Space Shadow */ {0x24598791,-1,SI_ZAPPER,0}, /* Duck Hunt */ {0xff24d794,-1,SI_ZAPPER,0}, /* Hogan's Alley */ {0xbeb8ab01,-1,SI_ZAPPER,0}, /* Gumshoe */ {0xde8fd935,-1,SI_ZAPPER,0}, /* To the Earth */ {0xedc3662b,-1,SI_ZAPPER,0}, /* Operation Wolf */ {0x23d17f5e,SI_GAMEPAD,SI_ZAPPER,0}, /* The Lone Ranger */ {0xb8b9aca3,-1,SI_ZAPPER,0}, /* Wild Gunman */ {0x5112dc21,-1,SI_ZAPPER,0}, /* Wild Gunman */ {0x4318a2f8,-1,SI_ZAPPER,0}, /* Barker Bill's Trick Shooting */ {0x5ee6008e,-1,SI_ZAPPER,0}, /* Mechanized Attack */ {0x3e58a87e,-1,SI_ZAPPER,0}, /* Freedom Force */ {0x851eb9be,SI_GAMEPAD,SI_ZAPPER,0}, /* Shooting Range */ {0x74bea652,SI_GAMEPAD,SI_ZAPPER,0}, /* Supergun 3-in-1 */ {0x32fb0583,-1,SI_ARKANOID,0}, /* Arkanoid(NES) */ {0xd89e5a67,-1,-1,SIFC_ARKANOID}, /* Arkanoid (J) */ {0x0f141525,-1,-1,SIFC_ARKANOID}, /* Arkanoid 2(J) */ {0xf7606810,-1,-1,SIFC_FKB}, /* Family BASIC 2.0A */ {0x895037bc,-1,-1,SIFC_FKB}, /* Family BASIC 2.1a */ {0xb2530afc,-1,-1,SIFC_FKB}, /* Family BASIC 3.0 */ {0,-1,-1,-1} }; int x=0; while(moo[x].input1>=0 || moo[x].input2>=0 || moo[x].inputfc>=0) { if(moo[x].crc32==iNESGameCRC32) { FCEUGameInfo->input[0]=moo[x].input1; FCEUGameInfo->input[1]=moo[x].input2; FCEUGameInfo->inputfc=moo[x].inputfc; break; } x++; } } struct CHINF { uint32 crc32; int32 mapper; int32 mirror; }; static void CheckHInfo(void) { /* ROM images that have the battery-backed bit set in the header that really don't have battery-backed RAM is not that big of a problem, so I'll treat this differently by only listing games that should have battery-backed RAM. Lower 64 bits of the MD5 hash. */ static uint64 savie[]= { 0x498c10dc463cfe95LL, /* Battle Fleet */ 0x6917ffcaca2d8466LL, /* Famista '90 */ 0xd63dcc68c2b20adcLL, /* Final Fantasy J */ 0x012df596e2b31174LL, /* Final Fantasy 1+2 */ 0xf6b359a720549ecdLL, /* Final Fantasy 2 */ 0x5a30da1d9b4af35dLL, /* Final Fantasy 3 */ 0x2ee3417ba8b69706LL, /* Hydlide 3*/ 0xebbce5a54cf3ecc0LL, /* Justbreed */ 0x6a858da551ba239eLL, /* Kaijuu Monogatari */ 0xa40666740b7d22feLL, /* Mindseeker */ 0x77b811b2760104b9LL, /* Mouryou Senki Madara */ 0x11b69122efe86e8cLL, /* RPG Jinsei Game */ 0xa70b495314f4d075LL, /* Ys 3 */ 0xc04361e499748382LL, /* AD&D Heroes of the Lance */ 0xb72ee2337ced5792LL, /* AD&D Hillsfar */ 0x2b7103b7a27bd72fLL, /* AD&D Pool of Radiance */ 0x854d7947a3177f57LL, /* Crystalis */ 0xb0bcc02c843c1b79LL, /* DW */ 0x4a1f5336b86851b6LL, /* DW */ 0x2dcf3a98c7937c22LL, /* DW 2 */ 0x733026b6b72f2470LL, /* Dw 3 */ 0x98e55e09dfcc7533LL, /* DW 4*/ 0x8da46db592a1fcf4LL, /* Faria */ 0x91a6846d3202e3d6LL, /* Final Fantasy */ 0xedba17a2c4608d20LL, /* "" */ 0x94b9484862a26cbaLL, /* Legend of Zelda */ 0x04a31647de80fdabLL, /* "" */ 0x9aa1dc16c05e7de5LL, /* Startropics */ 0x1b084107d0878bd0LL, /* Startropics 2*/ 0x836c0ff4f3e06e45LL, /* Zelda 2 */ 0 /* Abandon all hope if the game has 0 in the lower 64-bits of its MD5 hash */ }; static struct CHINF moo[]= { {0x9cbadc25,5,8}, /* JustBreed */ // {0x5f6e8a07,66,0}, {0x983d8175,157,8}, /* Datach Battle Rush */ {0x894efdbc,157,8}, /* Datach Crayon Shin Chan */ {0x19e81461,157,8}, /* Datach DBZ */ {0xbe06853f,157,8}, /* Datach J-League */ {0x0be0a328,157,8}, /* Datach SD Gundam Wars */ {0x5b457641,157,8}, /* Datach Ultraman Club */ {0xf51a7f46,157,8}, /* Datach Yuu Yuu Hakusho */ {0x60bfeb0c,90,-1}, /* MK 2*/ {0xe62e3382,71,-1}, /* Mig-29 Soviet Fighter */ {0x21a653c7,4,-1}, /* Super Sky Kid */ {0xdd4d9a62,209,-1}, /* Shin Samurai Spirits 2 */ {0x063b1151,209,-1}, /* Power Rangers 4 */ {0xdd8ced31,209,-1}, /* Power Rangers 3 */ {0x0c47946d,210,-1}, /* Chibi Maruko Chan */ {0xbd523011,210,-1}, /* Dream Master */ {0xc247cc80,210,-1}, /* Family Circuit '91 */ {0x6ec51de5,210,-1}, /* Famista '92 */ {0xadffd64f,210,-1}, /* Famista '93 */ {0x429103c9,210,-1}, /* Famista '94 */ {0x81b7f1a8,210,-1}, /* Heisei Tensai Bakabon */ {0x2447e03b,210,-1}, /* Top Striker */ {0x1dc0f740,210,-1}, /* Wagyan Land 2 */ {0xd323b806,210,-1}, /* Wagyan Land 3 */ {0x07eb2c12,208,-1}, /* Street Fighter IV */ {0x96ce586e,189,8}, /* Street Fighter 2 YOKO */ {0x7678f1d5,207,8}, /* Fudou Myouou Den */ {0x276237b3,206,0}, /* Karnov */ {0x4e1c1e3c,206,0}, /* Karnov */ /* Some entries to sort out the minor 33/48 mess. */ {0x40c0ad47,48,8}, /* Flintstones 2 */ {0xa7b0536c,48,8}, /* Don Doko Don 2 */ {0x99c395f9,48,8}, /* Captain Saver */ {0x637134e8,193,1}, /* Fighting Hero */ {0xcbf4366f,158,8}, /* Alien Syndrome (U.S. unlicensed) */ {0xb19a55dd,64,8}, /* Road Runner */ //{0x3eafd012,116,-1}, /* AV Girl Fighting */ {0x1d0f4d6b,2,1}, /* Black Bass thinging */ {0xf92be3ec,64,-1}, /* Rolling Thunder */ {0x345ee51a,245,-1}, /* DQ4c */ {0xf518dd58,7,8}, /* Captain Skyhawk */ {0x7ccb12a3,43,-1}, /* SMB2j */ {0x6f12afc5,235,-1}, /* Golden Game 150-in-1 */ {0xccc03440,156,-1}, {0xc9ee15a7,3,-1}, /* 3 is probably best. 41 WILL NOT WORK. */ {0x3e1271d5,79,1}, /* Tiles of Fate */ {0x8eab381c,113,1}, /* Death Bots */ {0xd4a76b07,79,0}, /* F-15 City Wars*/ {0xa4fbb438,79,0}, {0x1eb4a920,79,1}, /* Double Strike */ {0x345d3a1a,11,1}, /* Castle of Deceit */ {0x62ef6c79,232,8}, /* Quattro Sports -Aladdin */ {0x5caa3e61,144,1}, /* Death Race */ {0xd2699893,88,0}, /* Dragon Spirit */ {0x2f27cdef,155,8}, /* Tatakae!! Rahmen Man */ {0xcfd4a281,155,8}, /* Money Game. Yay for money! */ {0xd1691028,154,8}, /* Devil Man */ {0xc68363f6,180,0}, /* Crazy Climber */ {0xbe939fce,9,1}, /* Punchout*/ {0x5e66eaea,13,1}, /* Videomation */ {0xaf5d7aa2,-1,0}, /* Clu Clu Land */ {0xc2730c30,34,0}, /* Deadly Towers */ {0x932ff06e,34,1}, /* Classic Concentration */ {0x4c7c1af3,34,1}, /* Caesar's Palace */ {0x9ea1dc76,2,0}, /* Rainbow Islands */ {0x9eefb4b4,4,8}, /* Pachi Slot Adventure 2 */ {0x5337f73c,4,8}, /* Niji no Silk Road */ {0x7474ac92,4,8}, /* Kabuki: Quantum Fighter */ {0x970bd9c2,1,8}, /* Hanjuku Hero */ {0xbb7c5f7a,89,8}, /* Mito Koumon or something similar */ /* Probably a Namco MMC3-workalike */ {0xa5e6baf9,4,1|4}, /* Dragon Slayer 4 */ {0xe40b4973,4,1|4}, /* Metro Cross */ {0xd97c31b0,4,1|4}, /* Rasaaru Ishii no Childs Quest */ {0x84382231,9,0}, /* Punch Out (J) */ {0xfcdaca80,0,0}, /* Elevator Action */ {0xe492d45a,0,0}, /* Zippy Race */ {0x32fa246f,0,0}, /* Tag Team Pro Wrestling */ {0x6d65cac6,2,0}, /* Terra Cresta */ {0x28c11d24,2,1}, /* Sukeban Deka */ {0x02863604,2,1}, /* Sukeban Deka */ {0x2bb6a0f8,2,1}, /* Sherlock Holmes */ {0x55773880,2,1}, /* Gilligan's Island */ {0x419461d0,2,1}, /* Super Cars */ {0x6e0eb43e,2,1}, /* Puss n Boots */ {0x291bcd7d,1,8}, /* Pachio Kun 2 */ {0xf74dfc91,1,-1}, /* Win, Lose, or Draw */ {0x59280bec,4,8}, /* Jackie Chan */ {0xfe364be5,1,8}, /* Deep Dungeon 4 */ {0xd8ee7669,1,8}, /* Adventures of Rad Gravity */ {0xa5e8d2cd,1,8}, /* Breakthru */ {0xf6fa4453,1,8}, /* Bigfoot */ {0x37ba3261,1,8}, /* Back to the Future 2 and 3 */ {0x934db14a,1,-1}, /* All-Pro Basketball */ {0xe94d5181,1,8}, /* Mirai Senshi - Lios */ {0x7156cb4d,1,8}, /* Muppet Adventure Carnival thingy */ {0x5b6ca654,1,8}, /* Barbie rev X*/ {0x57c12280,1,8}, /* Demon Sword */ {0xdbf90772,3,0}, /* Alpha Mission */ {0xd858033d,3,0}, /* Armored Scrum Object */ {0xcf322bb3,3,1}, /* John Elway's Quarterback */ {0x9bde3267,3,1}, /* Adventures of Dino Riki */ {0x02cc3973,3,1}, /* Ninja Kid */ {0xb5d28ea2,3,1}, /* Mystery Quest - mapper 3?*/ {0xbc065fc3,3,1}, /* Pipe Dream */ {0x5b837e8d,1,8}, /* Alien Syndrome */ {0x283ad224,32,8}, /* Ai Sensei no Oshiete */ {0x5555fca3,32,8}, /* "" "" */ {0x243a8735,32,0x10|4}, /* Major League */ {0x6bc65d7e,66,1}, /* Youkai Club*/ {0xc2df0a00,66,1}, /* Bio Senshi Dan(hacked) */ {0xbde3ae9b,66,1}, /* Doraemon */ {0xd26efd78,66,1}, /* SMB Duck Hunt */ {0x811f06d9,66,1}, /* Dragon Power */ {0x3293afea,66,1}, /* Mississippi Satsujin Jiken */ {0xe84274c5,66,1}, /* "" "" */ {0x9552e8df,66,1}, /* Dragon Ball */ {0x6e68e31a,16,8}, /* Dragon Ball 3*/ {0xba51ac6f,78,2}, {0x3d1c3137,78,8}, /* Uchuusen - Cosmo Carrier */ {0xbda8f8e4,152,8}, /* Gegege no Kitarou 2 */ {0x026c5fca,152,8}, /* Saint Seiya Ougon Densetsu */ {0x0f141525,152,8}, /* Arkanoid 2 (Japanese) */ {0xb1a94b82,152,8}, /* Pocket Zaurus */ {0x3f15d20d,153,8}, /* Famicom Jump 2 */ {0xbba58be5,70,-1}, /* Family Trainer - Manhattan Police */ {0x370ceb65,70,-1}, /* Family Trainer - Meiro Dai Sakusen */ {0xdd8ed0f7,70,1}, /* Kamen Rider Club */ {0x90c773c1,118,-1}, /* Goal! 2 */ {0xb9b4d9e0,118,-1}, /* NES Play Action Football */ {0x78b657ac,118,-1}, /* Armadillo */ {0x37b62d04,118,-1}, /* Ys 3 */ {0x07d92c31,118,-1}, /* RPG Jinsei Game */ {0x2705eaeb,234,-1}, /* Maxi 15 */ {0x404b2e8b,4,2}, /* Rad Racer 2 */ {0xa912b064,51|0x800,8}, /* 11-in-1 Ball Games(has CHR ROM when it shouldn't) */ {0,-1,-1} }; int tofix=0; int x; uint64 partialmd5=0; for(x=0;x<8;x++) { partialmd5 |= (uint64)iNESCart.MD5[15-x] << (x*8); //printf("%16llx\n",partialmd5); } x=0; do { if(moo[x].crc32==iNESGameCRC32) { if(moo[x].mapper>=0) { if(moo[x].mapper&0x800 && VROM_size) { VROM_size=0; free(VROM); VROM=0; tofix|=8; } if(MapperNo!=(moo[x].mapper&0xFF)) { tofix|=1; MapperNo=moo[x].mapper&0xFF; } } if(moo[x].mirror>=0) { if(moo[x].mirror==8) { if(Mirroring==2) /* Anything but hard-wired(four screen). */ { tofix|=2; Mirroring=0; } } else if(Mirroring!=moo[x].mirror) { if(Mirroring!=(moo[x].mirror&~4)) if((moo[x].mirror&~4)<=2) /* Don't complain if one-screen mirroring needs to be set(the iNES header can't hold this information). */ tofix|=2; Mirroring=moo[x].mirror; } } break; } x++; } while(moo[x].mirror>=0 || moo[x].mapper>=0); x=0; while(savie[x] != 0) { if(savie[x] == partialmd5) { if(!(head.ROM_type&2)) { tofix|=4; head.ROM_type|=2; } } x++; } /* Games that use these iNES mappers tend to have the four-screen bit set when it should not be. */ if((MapperNo==118 || MapperNo==24 || MapperNo==26) && (Mirroring==2)) { Mirroring=0; tofix|=2; } /* Four-screen mirroring implicitly set. */ if(MapperNo==99) Mirroring=2; if(tofix) { char gigastr[768]; strcpy(gigastr,"The iNES header contains incorrect information. For now, the information will be corrected in RAM. "); if(tofix&1) sprintf(gigastr+strlen(gigastr),"The mapper number should be set to %d. ",MapperNo); if(tofix&2) { char *mstr[3]={"Horizontal","Vertical","Four-screen"}; sprintf(gigastr+strlen(gigastr),"Mirroring should be set to \"%s\". ",mstr[Mirroring&3]); } if(tofix&4) strcat(gigastr,"The battery-backed bit should be set. "); if(tofix&8) strcat(gigastr,"This game should not have any CHR ROM. "); strcat(gigastr,"\n"); FCEU_printf("%s",gigastr); } } typedef struct { int mapper; void (*init)(CartInfo *); } NewMI; int iNESLoad(const char *name, FCEUFILE *fp) { struct md5_context md5; if(FCEU_fread(&head,1,16,fp)!=16) return 0; if(memcmp(&head,"NES\x1a",4)) return 0; memset(&iNESCart,0,sizeof(iNESCart)); if(!memcmp((char *)(&head)+0x7,"DiskDude",8)) { memset((char *)(&head)+0x7,0,0x9); } if(!memcmp((char *)(&head)+0x7,"demiforce",9)) { memset((char *)(&head)+0x7,0,0x9); } if(!memcmp((char *)(&head)+0xA,"Ni03",4)) { if(!memcmp((char *)(&head)+0x7,"Dis",3)) memset((char *)(&head)+0x7,0,0x9); else memset((char *)(&head)+0xA,0,0x6); } if(!head.ROM_size) { FCEU_PrintError("No PRG ROM!"); return(0); //head.ROM_size++; } ROM_size = head.ROM_size; VROM_size = head.VROM_size; ROM_size=uppow2(ROM_size); if(VROM_size) VROM_size=uppow2(VROM_size); MapperNo = (head.ROM_type>>4); MapperNo|=(head.ROM_type2&0xF0); Mirroring = (head.ROM_type&1); if(head.ROM_type&8) Mirroring=2; if(!(ROM=(uint8 *)FCEU_malloc(ROM_size<<14))) return 0; if (VROM_size) if(!(VROM=(uint8 *)FCEU_malloc(VROM_size<<13))) { free(ROM); return 0; } memset(ROM,0xFF,ROM_size<<14); if(VROM_size) memset(VROM,0xFF,VROM_size<<13); if(head.ROM_type&4) /* Trainer */ { trainerpoo=(uint8 *)FCEU_gmalloc(512); FCEU_fread(trainerpoo,512,1,fp); } ResetCartMapping(); ResetExState(0,0); SetupCartPRGMapping(0,ROM,ROM_size*0x4000,0); SetupCartPRGMapping(1,WRAM,8192,1); FCEU_fread(ROM,0x4000,head.ROM_size,fp); if(VROM_size) FCEU_fread(VROM,0x2000,head.VROM_size,fp); md5_starts(&md5); md5_update(&md5,ROM,ROM_size<<14); iNESGameCRC32=CalcCRC32(0,ROM,ROM_size<<14); if(VROM_size) { iNESGameCRC32=CalcCRC32(iNESGameCRC32,VROM,VROM_size<<13); md5_update(&md5,VROM,VROM_size<<13); } md5_finish(&md5,iNESCart.MD5); memcpy(FCEUGameInfo->MD5,iNESCart.MD5,sizeof(iNESCart.MD5)); iNESCart.CRC32=iNESGameCRC32; FCEU_printf(" PRG ROM: %3d x 16KiB\n CHR ROM: %3d x 8KiB\n ROM CRC32: 0x%08lx\n", head.ROM_size,head.VROM_size,iNESGameCRC32); { int x; FCEU_printf(" ROM MD5: 0x"); for(x=0;x<16;x++) FCEU_printf("%02x",iNESCart.MD5[x]); FCEU_printf("\n"); } FCEU_printf(" Mapper: %d\n Mirroring: %s\n", MapperNo,Mirroring==2?"None(Four-screen)":Mirroring?"Vertical":"Horizontal"); if(head.ROM_type&2) FCEU_printf(" Battery-backed.\n"); if(head.ROM_type&4) FCEU_printf(" Trained.\n"); SetInput(); CheckHInfo(); { int x; uint64 partialmd5=0; for(x=0;x<8;x++) { partialmd5 |= (uint64)iNESCart.MD5[7-x] << (x*8); } FCEU_VSUniCheck(partialmd5, &MapperNo, &Mirroring); } /* Must remain here because above functions might change value of VROM_size and free(VROM). */ if(VROM_size) SetupCartCHRMapping(0,VROM,VROM_size*0x2000,0); if(Mirroring==2) SetupCartMirroring(4,1,ExtraNTARAM); else if(Mirroring>=0x10) SetupCartMirroring(2+(Mirroring&1),1,0); else SetupCartMirroring(Mirroring&1,(Mirroring&4)>>2,0); iNESCart.battery=(head.ROM_type&2)?1:0; iNESCart.mirror=Mirroring; //if(MapperNo != 18) { // if(ROM) free(ROM); // if(VROM) free(VROM); // ROM=VROM=0; // return(0); // } if(NewiNES_Init(MapperNo)) { } else { iNESCart.Power=iNESPower; if(head.ROM_type&2) { iNESCart.SaveGame[0]=WRAM; iNESCart.SaveGameLen[0]=8192; } } FCEU_LoadGameSave(&iNESCart); GameInterface=iNESGI; FCEU_printf("\n"); return 1; } void FASTAPASS(2) VRAM_BANK1(uint32 A, uint8 V) { V&=7; PPUCHRRAM|=(1<<(A>>10)); CHRBankList[(A)>>10]=V; VPage[(A)>>10]=&CHRRAM[V<<10]-(A); } void FASTAPASS(2) VRAM_BANK4(uint32 A, uint32 V) { V&=1; PPUCHRRAM|=(0xF<<(A>>10)); CHRBankList[(A)>>10]=(V<<2); CHRBankList[((A)>>10)+1]=(V<<2)+1; CHRBankList[((A)>>10)+2]=(V<<2)+2; CHRBankList[((A)>>10)+3]=(V<<2)+3; VPage[(A)>>10]=&CHRRAM[V<<10]-(A); } void FASTAPASS(2) VROM_BANK1(uint32 A,uint32 V) { setchr1(A,V); CHRBankList[(A)>>10]=V; } void FASTAPASS(2) VROM_BANK2(uint32 A,uint32 V) { setchr2(A,V); CHRBankList[(A)>>10]=(V<<1); CHRBankList[((A)>>10)+1]=(V<<1)+1; } void FASTAPASS(2) VROM_BANK4(uint32 A, uint32 V) { setchr4(A,V); CHRBankList[(A)>>10]=(V<<2); CHRBankList[((A)>>10)+1]=(V<<2)+1; CHRBankList[((A)>>10)+2]=(V<<2)+2; CHRBankList[((A)>>10)+3]=(V<<2)+3; } void FASTAPASS(1) VROM_BANK8(uint32 V) { setchr8(V); CHRBankList[0]=(V<<3); CHRBankList[1]=(V<<3)+1; CHRBankList[2]=(V<<3)+2; CHRBankList[3]=(V<<3)+3; CHRBankList[4]=(V<<3)+4; CHRBankList[5]=(V<<3)+5; CHRBankList[6]=(V<<3)+6; CHRBankList[7]=(V<<3)+7; } void FASTAPASS(2) ROM_BANK8(uint32 A, uint32 V) { setprg8(A,V); if(A>=0x8000) PRGBankList[((A-0x8000)>>13)]=V; } void FASTAPASS(2) ROM_BANK16(uint32 A, uint32 V) { setprg16(A,V); if(A>=0x8000) { PRGBankList[((A-0x8000)>>13)]=V<<1; PRGBankList[((A-0x8000)>>13)+1]=(V<<1)+1; } } void FASTAPASS(1) ROM_BANK32(uint32 V) { setprg32(0x8000,V); PRGBankList[0]=V<<2; PRGBankList[1]=(V<<2)+1; PRGBankList[2]=(V<<2)+2; PRGBankList[3]=(V<<2)+3; } void FASTAPASS(1) onemir(uint8 V) { if(Mirroring==2) return; if(V>1) V=1; Mirroring=0x10|V; setmirror(MI_0+V); } void FASTAPASS(1) MIRROR_SET2(uint8 V) { if(Mirroring==2) return; Mirroring=V; setmirror(V); } void FASTAPASS(1) MIRROR_SET(uint8 V) { if(Mirroring==2) return; V^=1; Mirroring=V; setmirror(V); } static void NONE_init(void) { ROM_BANK16(0x8000,0); ROM_BANK16(0xC000,~0); if(VROM_size) VROM_BANK8(0); else setvram8(CHRRAM); } void (*MapInitTab[256])(void)= { 0, 0,Mapper2_init,Mapper3_init,0, 0,Mapper6_init,Mapper7_init,Mapper8_init, Mapper9_init,Mapper10_init,Mapper11_init,0, Mapper13_init,0,Mapper15_init,Mapper16_init, Mapper17_init,Mapper18_init,0,0, Mapper21_init,Mapper22_init,Mapper23_init,Mapper24_init, Mapper25_init,Mapper26_init,0,0, 0,0,0,Mapper32_init, Mapper33_init,Mapper34_init,0,0, 0,0,0,Mapper40_init, Mapper41_init,Mapper42_init,Mapper43_init,0, 0,Mapper46_init,0,Mapper48_init,0,Mapper50_init,Mapper51_init,0, 0,0,0,0,Mapper57_init,Mapper58_init,Mapper59_init,Mapper60_init, Mapper61_init,Mapper62_init,0,Mapper64_init, Mapper65_init,Mapper66_init,Mapper67_init,Mapper68_init, Mapper69_init,Mapper70_init,Mapper71_init,Mapper72_init, Mapper73_init,0,Mapper75_init,Mapper76_init, Mapper77_init,Mapper78_init,Mapper79_init,Mapper80_init, 0,Mapper82_init,Mapper83_init,0, Mapper85_init,Mapper86_init,Mapper87_init,Mapper88_init, Mapper89_init,0,Mapper91_init,Mapper92_init, Mapper93_init,Mapper94_init,0,Mapper96_init, Mapper97_init,0,Mapper99_init,0, 0,0,0,0,0,0,Mapper107_init,0, 0,0,0,Mapper112_init,Mapper113_init,Mapper114_init,0,0, Mapper117_init,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,Mapper140_init, 0,0,0,Mapper144_init,0,0,0,0, 0,0,Mapper151_init,Mapper152_init,Mapper153_init,Mapper154_init,0,Mapper156_init, Mapper157_init,Mapper158_init,Mapper159_init,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,Mapper180_init, 0,Mapper182_init,0,Mapper184_init,Mapper185_init,0,0,0, Mapper189_init,0,0,0,Mapper193_init,0,0,0, 0,0,0,Mapper200_init,Mapper201_init,Mapper202_init,Mapper203_init,0, 0,0,Mapper207_init,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,Mapper225_init,Mapper226_init,Mapper227_init,Mapper228_init, Mapper229_init,Mapper230_init,Mapper231_init,Mapper232_init,0,Mapper234_init,Mapper235_init,0, 0,0,0,Mapper240_init,Mapper241_init,Mapper242_init,0,Mapper244_init, 0,Mapper246_init,0,Mapper248_init,0,0,0,0,0,0,Mapper255_init }; static DECLFW(BWRAM) { WRAM[A-0x6000]=V; } static DECLFR(AWRAM) { return WRAM[A-0x6000]; } void (*MapStateRestore)(int version); void iNESStateRestore(int version) { int x; if(!MapperNo) return; for(x=0;x<4;x++) setprg8(0x8000+x*8192,PRGBankList[x]); if(VROM_size) for(x=0;x<8;x++) setchr1(0x400*x,CHRBankList[x]); if(0) switch(Mirroring) { case 0:setmirror(MI_H);break; case 1:setmirror(MI_V);break; case 0x12: case 0x10:setmirror(MI_0);break; case 0x13: case 0x11:setmirror(MI_1);break; } if(MapStateRestore) MapStateRestore(version); } static void iNESPower(void) { int x; int type=MapperNo; SetReadHandler(0x8000,0xFFFF,CartBR); GameStateRestore=iNESStateRestore; MapClose=0; MapperReset=0; MapStateRestore=0; setprg8r(1,0x6000,0); SetReadHandler(0x6000,0x7FFF,AWRAM); SetWriteHandler(0x6000,0x7FFF,BWRAM); FCEU_CheatAddRAM(8,0x6000,WRAM); /* This statement represents atrocious code. I need to rewrite all of the iNES mapper code... */ IRQCount=IRQLatch=IRQa=0; if(head.ROM_type&2) memset(GameMemBlock+8192,0,sizeof(GameMemBlock)-8192); else memset(GameMemBlock,0,sizeof(GameMemBlock)); NONE_init(); ResetExState(0,0); if(FCEUGameInfo->type == GIT_VSUNI) AddExState(FCEUVSUNI_STATEINFO, ~0, 0, 0); AddExState(WRAM, 8192, 0, "WRAM"); if(type==19 || type==6 || type==69 || type==85 || type==96) AddExState(MapperExRAM, 32768, 0, "MEXR"); if((!VROM_size || type==6 || type==19) && (type!=13 && type!=96)) AddExState(CHRRAM, 8192, 0, "CHRR"); if(head.ROM_type&8) AddExState(ExtraNTARAM, 2048, 0, "EXNR"); /* Exclude some mappers whose emulation code handle save state stuff themselves. */ if(type && type!=13 && type!=96) { AddExState(mapbyte1, 32, 0, "MPBY"); AddExState(&Mirroring, 1, 0, "MIRR"); AddExState(&IRQCount, 4, 1, "IRQC"); AddExState(&IRQLatch, 4, 1, "IQL1"); AddExState(&IRQa, 1, 0, "IRQA"); AddExState(PRGBankList, 4, 0, "PBL"); for(x=0;x<8;x++) { char tak[8]; sprintf(tak,"CBL%d",x); AddExState(&CHRBankList[x], 2, 1,tak); } } if(MapInitTab[type]) MapInitTab[type](); else if(type) { FCEU_PrintError("iNES mapper #%d is not supported at all.",type); } } typedef struct { int number; void (*init)(CartInfo *); } BMAPPING; static BMAPPING bmap[] = { {1, Mapper1_Init}, {4, Mapper4_Init}, {5, Mapper5_Init}, {12, Mapper12_Init}, {19, Mapper19_Init}, {44, Mapper44_Init}, {45, Mapper45_Init}, {47, Mapper47_Init}, {49, Mapper49_Init}, {52, Mapper52_Init}, {74, Mapper74_Init}, {90, Mapper90_Init}, {160, Mapper90_Init}, {165, Mapper165_Init}, {209, Mapper209_Init}, {95, Mapper95_Init}, {105, Mapper105_Init}, {115, Mapper115_Init}, {116, Mapper116_Init}, {118, Mapper118_Init}, {119, Mapper119_Init}, /* Has CHR ROM and CHR RAM by default. Hmm. */ {155, Mapper155_Init}, {164, Mapper164_Init}, {187, Mapper187_Init}, {206, Mapper206_Init}, {208, Mapper208_Init}, {210, Mapper210_Init}, {245, Mapper245_Init}, {249, Mapper249_Init}, {250, Mapper250_Init}, {0,0} }; static int NewiNES_Init(int num) { BMAPPING *tmp=bmap; if(FCEUGameInfo->type == GIT_VSUNI) AddExState(FCEUVSUNI_STATEINFO, ~0, 0, 0); while(tmp->init) { if(num==tmp->number) { if(!VROM_size) { VROM=(uint8 *)malloc(8192); SetupCartCHRMapping(0x0,VROM,8192,1); AddExState(VROM, 8192, 0, "CHRR"); } if(head.ROM_type&8) AddExState(ExtraNTARAM, 2048, 0, "EXNR"); tmp->init(&iNESCart); return(1); } tmp++; } return(0); } fceu-0.98.12/src/ines.h0000644000175000000620000002446110106050711014406 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 1998 Bero * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ #ifdef INESPRIV void iNESStateRestore(int version); extern uint32 iNESGameCRC32; extern uint32 VROM_size; extern uint32 ROM_size; extern void (*MapStateRestore)(int version); extern void (*MapClose)(void); extern void (*MapperReset)(void); /* This order is necessary */ #define WRAM (GameMemBlock) #define sizeofWRAM 8192 #define MapperExRAM (GameMemBlock+sizeofWRAM) #define sizeofMapperExRAM 32768 /* for the MMC5 code to work properly. It might be fixed later... */ #define CHRRAM (GameMemBlock+sizeofWRAM+sizeofMapperExRAM) #define sizeofCHRRAM 8192 #define ExtraNTARAM (GameMemBlock+sizeofWRAM+sizeofMapperExRAM+sizeofCHRRAM) #define sizeofExtraNTARAM 2048 #define PRGBankList (ExtraNTARAM+sizeofExtraNTARAM) #define mapbyte1 (PRGBankList+4) #define mapbyte2 (mapbyte1+8) #define mapbyte3 (mapbyte2+8) #define mapbyte4 (mapbyte3+8) extern uint16 iNESCHRBankList[8]; extern int32 iNESIRQLatch,iNESIRQCount; extern uint8 iNESMirroring; extern uint8 iNESIRQa; #define IRQa iNESIRQa #define Mirroring iNESMirroring #define IRQCount iNESIRQCount #define IRQLatch iNESIRQLatch #define CHRBankList iNESCHRBankList #else #endif typedef struct { char ID[4]; /*NES^Z*/ uint8 ROM_size; uint8 VROM_size; uint8 ROM_type; uint8 ROM_type2; uint8 reserve[8]; } iNES_HEADER; void FASTAPASS(2) VRAM_BANK1(uint32 A, uint8 V); void FASTAPASS(2) VRAM_BANK4(uint32 A,uint32 V); void FASTAPASS(2) VROM_BANK1(uint32 A,uint32 V); void FASTAPASS(2) VROM_BANK2(uint32 A,uint32 V); void FASTAPASS(2) VROM_BANK4(uint32 A, uint32 V); void FASTAPASS(1) VROM_BANK8(uint32 V); void FASTAPASS(2) ROM_BANK8(uint32 A, uint32 V); void FASTAPASS(2) ROM_BANK16(uint32 A, uint32 V); void FASTAPASS(1) ROM_BANK32(uint32 V); extern uint8 vmask; extern uint32 vmask1; extern uint32 vmask2; extern uint32 vmask4; extern uint32 pmask8; extern uint8 pmask16; extern uint8 pmask32; void FASTAPASS(1) onemir(uint8 V); void FASTAPASS(1) MIRROR_SET2(uint8 V); void FASTAPASS(1) MIRROR_SET(uint8 V); void Mapper0_init(void); void Mapper1_init(void); void Mapper2_init(void); void Mapper3_init(void); void Mapper6_init(void); void Mapper7_init(void); void Mapper8_init(void); void Mapper9_init(void); void Mapper10_init(void); void Mapper11_init(void); void Mapper12_init(void); void Mapper13_init(void); void Mapper14_init(void); void Mapper15_init(void); void Mapper16_init(void); void Mapper17_init(void); void Mapper18_init(void); void Mapper19_init(void); void Mapper20_init(void); void Mapper21_init(void); void Mapper22_init(void); void Mapper23_init(void); void Mapper24_init(void); void Mapper25_init(void); void Mapper26_init(void); void Mapper27_init(void); void Mapper28_init(void); void Mapper29_init(void); void Mapper30_init(void); void Mapper31_init(void); void Mapper32_init(void); void Mapper33_init(void); void Mapper34_init(void); void Mapper35_init(void); void Mapper36_init(void); void Mapper37_init(void); void Mapper38_init(void); void Mapper39_init(void); void Mapper40_init(void); void Mapper41_init(void); void Mapper42_init(void); void Mapper43_init(void); void Mapper44_init(void); void Mapper45_init(void); void Mapper46_init(void); void Mapper47_init(void); void Mapper48_init(void); void Mapper49_init(void); void Mapper50_init(void); void Mapper51_init(void); void Mapper52_init(void); void Mapper53_init(void); void Mapper54_init(void); void Mapper55_init(void); void Mapper56_init(void); void Mapper57_init(void); void Mapper58_init(void); void Mapper59_init(void); void Mapper60_init(void); void Mapper61_init(void); void Mapper62_init(void); void Mapper63_init(void); void Mapper64_init(void); void Mapper65_init(void); void Mapper66_init(void); void Mapper67_init(void); void Mapper68_init(void); void Mapper69_init(void); void Mapper70_init(void); void Mapper71_init(void); void Mapper72_init(void); void Mapper73_init(void); void Mapper74_init(void); void Mapper75_init(void); void Mapper76_init(void); void Mapper77_init(void); void Mapper78_init(void); void Mapper79_init(void); void Mapper80_init(void); void Mapper81_init(void); void Mapper82_init(void); void Mapper83_init(void); void Mapper84_init(void); void Mapper85_init(void); void Mapper86_init(void); void Mapper87_init(void); void Mapper88_init(void); void Mapper89_init(void); void Mapper91_init(void); void Mapper92_init(void); void Mapper93_init(void); void Mapper94_init(void); void Mapper96_init(void); void Mapper97_init(void); void Mapper98_init(void); void Mapper99_init(void); void Mapper100_init(void); void Mapper101_init(void); void Mapper102_init(void); void Mapper103_init(void); void Mapper104_init(void); void Mapper106_init(void); void Mapper107_init(void); void Mapper108_init(void); void Mapper109_init(void); void Mapper110_init(void); void Mapper111_init(void); void Mapper112_init(void); void Mapper113_init(void); void Mapper114_init(void); void Mapper115_init(void); void Mapper116_init(void); void Mapper117_init(void); void Mapper120_init(void); void Mapper121_init(void); void Mapper122_init(void); void Mapper123_init(void); void Mapper124_init(void); void Mapper125_init(void); void Mapper126_init(void); void Mapper127_init(void); void Mapper128_init(void); void Mapper129_init(void); void Mapper130_init(void); void Mapper131_init(void); void Mapper132_init(void); void Mapper133_init(void); void Mapper134_init(void); void Mapper135_init(void); void Mapper136_init(void); void Mapper137_init(void); void Mapper138_init(void); void Mapper139_init(void); void Mapper140_init(void); void Mapper141_init(void); void Mapper142_init(void); void Mapper143_init(void); void Mapper144_init(void); void Mapper145_init(void); void Mapper146_init(void); void Mapper147_init(void); void Mapper148_init(void); void Mapper149_init(void); void Mapper150_init(void); void Mapper151_init(void); void Mapper152_init(void); void Mapper153_init(void); void Mapper154_init(void); void Mapper156_init(void); void Mapper157_init(void); void Mapper158_init(void); void Mapper159_init(void); void Mapper160_init(void); void Mapper161_init(void); void Mapper162_init(void); void Mapper163_init(void); void Mapper165_init(void); void Mapper166_init(void); void Mapper167_init(void); void Mapper168_init(void); void Mapper169_init(void); void Mapper170_init(void); void Mapper171_init(void); void Mapper172_init(void); void Mapper173_init(void); void Mapper174_init(void); void Mapper175_init(void); void Mapper176_init(void); void Mapper177_init(void); void Mapper178_init(void); void Mapper179_init(void); void Mapper180_init(void); void Mapper181_init(void); void Mapper182_init(void); void Mapper183_init(void); void Mapper184_init(void); void Mapper185_init(void); void Mapper188_init(void); void Mapper189_init(void); void Mapper190_init(void); void Mapper191_init(void); void Mapper192_init(void); void Mapper193_init(void); void Mapper194_init(void); void Mapper195_init(void); void Mapper196_init(void); void Mapper197_init(void); void Mapper198_init(void); void Mapper199_init(void); void Mapper200_init(void); void Mapper201_init(void); void Mapper202_init(void); void Mapper203_init(void); void Mapper204_init(void); void Mapper205_init(void); void Mapper207_init(void); void Mapper208_init(void); void Mapper209_init(void); void Mapper210_init(void); void Mapper212_init(void); void Mapper213_init(void); void Mapper214_init(void); void Mapper215_init(void); void Mapper216_init(void); void Mapper217_init(void); void Mapper218_init(void); void Mapper219_init(void); void Mapper220_init(void); void Mapper221_init(void); void Mapper222_init(void); void Mapper223_init(void); void Mapper224_init(void); void Mapper225_init(void); void Mapper226_init(void); void Mapper227_init(void); void Mapper228_init(void); void Mapper229_init(void); void Mapper230_init(void); void Mapper231_init(void); void Mapper232_init(void); void Mapper233_init(void); void Mapper234_init(void); void Mapper235_init(void); void Mapper236_init(void); void Mapper237_init(void); void Mapper238_init(void); void Mapper239_init(void); void Mapper240_init(void); void Mapper241_init(void); void Mapper242_init(void); void Mapper243_init(void); void Mapper244_init(void); void Mapper245_init(void); void Mapper246_init(void); void Mapper247_init(void); void Mapper248_init(void); void Mapper249_init(void); void Mapper250_init(void); void Mapper251_init(void); void Mapper252_init(void); void Mapper253_init(void); void Mapper254_init(void); void Mapper255_init(void); void NSFVRC6_Init(void); void NSFMMC5_Init(void); void NSFAY_Init(void); void NSFN106_Init(void); void NSFVRC7_Init(void); void Mapper19_ESI(void); void Mapper1_Init(CartInfo *); void Mapper4_Init(CartInfo *); void Mapper5_Init(CartInfo *); void Mapper12_Init(CartInfo *); void Mapper19_Init(CartInfo *); void Mapper44_Init(CartInfo *); void Mapper45_Init(CartInfo *); void Mapper47_Init(CartInfo *); void Mapper49_Init(CartInfo *); void Mapper52_Init(CartInfo *); void Mapper74_Init(CartInfo *); void Mapper90_Init(CartInfo *); void Mapper165_Init(CartInfo *); void Mapper209_Init(CartInfo *); void Mapper95_Init(CartInfo *); void Mapper105_Init(CartInfo *); void Mapper115_Init(CartInfo *); void Mapper116_Init(CartInfo *); void Mapper118_Init(CartInfo *); void Mapper119_Init(CartInfo *); void Mapper155_Init(CartInfo *); void Mapper164_Init(CartInfo *); void Mapper187_Init(CartInfo *); void Mapper206_Init(CartInfo *); void Mapper208_Init(CartInfo *); void Mapper209_Init(CartInfo *); void Mapper210_Init(CartInfo *); void Mapper245_Init(CartInfo *); void Mapper249_Init(CartInfo *); void Mapper250_Init(CartInfo *); fceu-0.98.12/src/input/0002755000175000000620000000000010111545623014440 5ustar joestaff00000000000000fceu-0.98.12/src/input/arkanoid.c0000644000175000000620000000443210003562763016401 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "share.h" typedef struct { uint32 mzx,mzb; uint32 readbit; } ARK; static ARK NESArk[2]; static ARK FCArk; static void StrobeARKFC(void) { FCArk.readbit=0; } static uint8 FP_FASTAPASS(2) ReadARKFC(int w,uint8 ret) { ret&=~2; if(w) { if(FCArk.readbit>=8) ret|=2; else { ret|=((FCArk.mzx>>(7-FCArk.readbit))&1)<<1; if(!fceuindbg) FCArk.readbit++; } } else ret|=FCArk.mzb<<1; return(ret); } static uint32 FixX(uint32 x) { x=98+x*144/240; if(x>242) x=242; x=~x; return(x); } static void FP_FASTAPASS(2) UpdateARKFC(void *data, int arg) { uint32 *ptr=(uint32 *)data; FCArk.mzx=FixX(ptr[0]); FCArk.mzb=ptr[2]?1:0; } static INPUTCFC ARKCFC={ReadARKFC,0,StrobeARKFC,UpdateARKFC,0,0}; INPUTCFC *FCEU_InitArkanoidFC(void) { FCArk.mzx=98; FCArk.mzb=0; return(&ARKCFC); } static uint8 FP_FASTAPASS(1) ReadARK(int w) { uint8 ret=0; if(NESArk[w].readbit>=8) ret|=1<<4; else { ret|=((NESArk[w].mzx>>(7-NESArk[w].readbit))&1)<<4; if(!fceuindbg) NESArk[w].readbit++; } ret|=(NESArk[w].mzb&1)<<3; return(ret); } static void FP_FASTAPASS(1) StrobeARK(int w) { NESArk[w].readbit=0; } static void FP_FASTAPASS(3) UpdateARK(int w, void *data, int arg) { uint32 *ptr=(uint32*)data; NESArk[w].mzx=FixX(ptr[0]); NESArk[w].mzb=ptr[2]?1:0; } static INPUTC ARKC={ReadARK, 0, StrobeARK, UpdateARK, 0, 0}; INPUTC *FCEU_InitArkanoid(int w) { NESArk[w].mzx=98; NESArk[w].mzb=0; return(&ARKC); } fceu-0.98.12/src/input/cursor.c0000644000175000000620000000317410004123722016115 0ustar joestaff00000000000000#include "share.h" static uint8 GunSight[]={ 0,0,0,0,0,0,1,0,0,0,0,0,0, 0,0,0,0,0,0,2,0,0,0,0,0,0, 0,0,0,0,0,0,1,0,0,0,0,0,0, 0,0,0,0,0,0,2,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,3,0,0,0,0,0,0, 1,2,1,2,0,3,3,3,0,2,1,2,1, 0,0,0,0,0,0,3,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,2,0,0,0,0,0,0, 0,0,0,0,0,0,1,0,0,0,0,0,0, 0,0,0,0,0,0,2,0,0,0,0,0,0, 0,0,0,0,0,0,1,0,0,0,0,0,0, }; static uint8 FCEUcursor[11*19]= { 1,0,0,0,0,0,0,0,0,0,0, 1,1,0,0,0,0,0,0,0,0,0, 1,2,1,0,0,0,0,0,0,0,0, 1,2,2,1,0,0,0,0,0,0,0, 1,2,2,2,1,0,0,0,0,0,0, 1,2,2,2,2,1,0,0,0,0,0, 1,2,2,2,2,2,1,0,0,0,0, 1,2,2,2,2,2,2,1,0,0,0, 1,2,2,2,2,2,2,2,1,0,0, 1,2,2,2,2,2,2,2,2,1,0, 1,2,2,2,2,2,1,1,1,1,1, 1,2,2,1,2,2,1,0,0,0,0, 1,2,1,0,1,2,2,1,0,0,0, 1,1,0,0,1,2,2,1,0,0,0, 1,0,0,0,0,1,2,2,1,0,0, 0,0,0,0,0,1,2,2,1,0,0, 0,0,0,0,0,0,1,2,2,1,0, 0,0,0,0,0,0,1,2,2,1,0, 0,0,0,0,0,0,0,1,1,0,0, }; void FCEU_DrawGunSight(uint8 *buf, int xc, int yc) { int x,y; int c,d; for(y=0;y<13;y++) for(x=0;x<13;x++) { uint8 a; a=GunSight[y*13+x]; if(a) { c=(yc+y-7); d=(xc+x-7); if(c>=0 && d>=0 && d<256 && c<240) { if(a==3) buf[c*256+d]=0xBF-(buf[c*256+d]&0x3F); else buf[c*256+d]=a-1; } } } } void FCEU_DrawCursor(uint8 *buf, int xc, int yc) { int x,y; int c,d; if(xc<256 && yc<240) for(y=0;y<19;y++) for(x=0;x<11;x++) { uint8 a; a=FCEUcursor[y*11+x]; if(a) { c=(yc+y); d=(xc+x); if(d<256 && c<240) buf[c*256+d]=a+127; } } } fceu-0.98.12/src/input/fkb.c0000644000175000000620000000500110003562763015344 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "share.h" #include "fkb.h" #define AK2(x,y) ( (FKB_##x) | (FKB_##y <<8) ) #define AK(x) FKB_##x static uint8 bufit[0x49]; static uint8 ksmode; static uint8 ksindex; static uint16 matrix[9][2][4]= { {{AK(F8),AK(RETURN),AK(BRACKETLEFT),AK(BRACKETRIGHT)}, {AK(KANA),AK(RIGHTSHIFT),AK(BACKSLASH),AK(STOP)}}, {{AK(F7),AK(AT),AK(COLON),AK(SEMICOLON)}, {AK(UNDERSCORE),AK(SLASH),AK(MINUS),AK(CARET)}}, {{AK(F6),AK(O),AK(L),AK(K)}, {AK(PERIOD),AK(COMMA),AK(P),AK(0)}}, {{AK(F5),AK(I),AK(U),AK(J)}, {AK(M),AK(N),AK(9),AK(8)}}, {{AK(F4),AK(Y),AK(G),AK(H)}, {AK(B),AK(V),AK(7),AK(6)}}, {{AK(F3),AK(T),AK(R),AK(D)}, {AK(F),AK(C),AK(5),AK(4)}}, {{AK(F2),AK(W),AK(S),AK(A)}, {AK(X),AK(Z),AK(E),AK(3)}}, {{AK(F1),AK(ESCAPE),AK(Q),AK(CONTROL)}, {AK(LEFTSHIFT),AK(GRAPH),AK(1),AK(2)}}, {{AK(CLEAR),AK(UP),AK(RIGHT),AK(LEFT)}, {AK(DOWN),AK(SPACE),AK(DELETE),AK(INSERT)}}, }; static void FP_FASTAPASS(1) FKB_Write(uint8 v) { v>>=1; if(v&2) { if((ksmode&1) && !(v&1)) ksindex=(ksindex+1)%9; } ksmode=v; } static uint8 FP_FASTAPASS(2) FKB_Read(int w, uint8 ret) { //printf("$%04x, %d, %d\n",w+0x4016,ksindex,ksmode&1); if(w) { int x; ret&=~0x1E; for(x=0;x<4;x++) if(bufit[ matrix[ksindex][ksmode&1][x]&0xFF ] || bufit[ matrix[ksindex][ksmode&1][x]>>8]) { ret|=1<<(x+1); } ret^=0x1E; } return(ret); } static void FKB_Strobe(void) { ksmode=0; ksindex=0; //printf("strobe\n"); } static void FP_FASTAPASS(2) FKB_Update(void *data, int arg) { memcpy(bufit+1,data,0x48); } static INPUTCFC FKB={FKB_Read,FKB_Write,FKB_Strobe,FKB_Update,0,0}; INPUTCFC *FCEU_InitFKB(void) { memset(bufit,0,sizeof(bufit)); ksmode=ksindex=0; return(&FKB); } fceu-0.98.12/src/input/fkb.h0000644000175000000620000000355210003562763015362 0ustar joestaff00000000000000#define FKB_F1 0x01 #define FKB_F2 0x02 #define FKB_F3 0x03 #define FKB_F4 0x04 #define FKB_F5 0x05 #define FKB_F6 0x06 #define FKB_F7 0x07 #define FKB_F8 0x08 #define FKB_1 0x09 #define FKB_2 0x0A #define FKB_3 0x0B #define FKB_4 0x0C #define FKB_5 0x0D #define FKB_6 0x0E #define FKB_7 0x0F #define FKB_8 0x10 #define FKB_9 0x11 #define FKB_0 0x12 #define FKB_MINUS 0x13 #define FKB_CARET 0x14 #define FKB_BACKSLASH 0x15 #define FKB_STOP 0x16 #define FKB_ESCAPE 0x17 #define FKB_Q 0x18 #define FKB_W 0x19 #define FKB_E 0x1A #define FKB_R 0x1B #define FKB_T 0x1C #define FKB_Y 0x1D #define FKB_U 0x1E #define FKB_I 0x1F #define FKB_O 0x20 #define FKB_P 0x21 #define FKB_AT 0x22 #define FKB_BRACKETLEFT 0x23 #define FKB_RETURN 0x24 #define FKB_CONTROL 0x25 #define FKB_A 0x26 #define FKB_S 0x27 #define FKB_D 0x28 #define FKB_F 0x29 #define FKB_G 0x2A #define FKB_H 0x2B #define FKB_J 0x2C #define FKB_K 0x2D #define FKB_L 0x2E #define FKB_SEMICOLON 0x2F #define FKB_COLON 0x30 #define FKB_BRACKETRIGHT 0x31 #define FKB_KANA 0x32 #define FKB_LEFTSHIFT 0x33 #define FKB_Z 0x34 #define FKB_X 0x35 #define FKB_C 0x36 #define FKB_V 0x37 #define FKB_B 0x38 #define FKB_N 0x39 #define FKB_M 0x3A #define FKB_COMMA 0x3B #define FKB_PERIOD 0x3C #define FKB_SLASH 0x3D #define FKB_UNDERSCORE 0x3E #define FKB_RIGHTSHIFT 0x3F #define FKB_GRAPH 0x40 #define FKB_SPACE 0x41 #define FKB_CLEAR 0x42 #define FKB_INSERT 0x43 #define FKB_DELETE 0x44 #define FKB_UP 0x45 #define FKB_LEFT 0x46 #define FKB_RIGHT 0x47 #define FKB_DOWN 0x48 fceu-0.98.12/src/input/powerpad.c0000644000175000000620000000402510003562763016430 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "share.h" static char side; static uint32 pprsb[2]; static uint32 pprdata[2]; static uint8 FP_FASTAPASS(1) ReadPP(int w) { uint8 ret=0; ret|=((pprdata[w]>>pprsb[w])&1)<<3; ret|=((pprdata[w]>>(pprsb[w]+8))&1)<<4; if(pprsb[w]>=4) { ret|=0x10; if(pprsb[w]>=8) ret|=0x08; } if(!fceuindbg) pprsb[w]++; return ret; } static void FP_FASTAPASS(1) StrobePP(int w) { pprsb[w]=0; } void FP_FASTAPASS(3) UpdatePP(int w, void *data, int arg) { static const char shifttableA[12]={8,9,0,1,11,7,4,2,10,6,5,3}; static const char shifttableB[12]={1,0,9,8,2,4,7,11,3,5,6,10}; int x; pprdata[w]=0; if(side=='A') for(x=0;x<12;x++) pprdata[w]|=(((*(uint32 *)data)>>x)&1)<>x)&1)< #include #include "share.h" typedef struct { uint32 mzx,mzy,mzb; int zap_readbit; int bogo; int zappo; uint64 zaphit; } ZAPPER; static ZAPPER ZD; static void FP_FASTAPASS(3) ZapperFrapper(uint8 *bg, uint8 *spr, uint32 linets, int final) { int xs,xe; int zx,zy; if(!bg) // New line, so reset stuff. { ZD.zappo=0; return; } xs=ZD.zappo; xe=final; zx=ZD.mzx; zy=ZD.mzy; if(xe>256) xe=256; if(scanline>=(zy-4) && scanline<=(zy+4)) { while(xs=(zx-4)) { a1=bg[xs]; if(spr) { a2=spr[xs]; if(!(a2&0x80)) if(!(a2&0x40) || (a1&64)) a1=a2; } a1&=63; sum=palo[a1].r+palo[a1].g+palo[a1].b; if(sum>=100*3) { ZD.zaphit=((uint64)linets+(xs+16)*(PAL?15:16))/48+timestampbase; goto endo; } } xs++; } } endo: ZD.zappo=final; } static INLINE int CheckColor(void) { FCEUPPU_LineUpdate(); if((ZD.zaphit+10)>=(timestampbase+timestamp)) return(0); return(1); } static uint8 FP_FASTAPASS(2) ReadZapper(int w, uint8 ret) { if(w) { ret&=~0x18; if(ZD.bogo) ret|=0x10; if(CheckColor()) ret|=0x8; } else { //printf("Kayo: %d\n",ZD.zap_readbit); ret&=~2; //if(ZD.zap_readbit==4) ret|=ZD.mzb&2; ret|=(ret&1)<<1; //ZD.zap_readbit++; } return ret; } static void FP_FASTAPASS(2) DrawZapper(uint8 *buf, int arg) { if(arg) FCEU_DrawCursor(buf, ZD.mzx, ZD.mzy); } static void FP_FASTAPASS(2) UpdateZapper(void *data, int arg) { uint32 *ptr=(uint32*)data; if(ZD.bogo) ZD.bogo--; if(ptr[2]&1 && (!(ZD.mzb&1))) ZD.bogo=5; ZD.mzx=ptr[0]; ZD.mzy=ptr[1]; ZD.mzb=ptr[2]; } static void StrobeShadow(void) { ZD.zap_readbit=0; } static INPUTCFC SHADOWC={ReadZapper,0,StrobeShadow,UpdateZapper,ZapperFrapper,DrawZapper}; INPUTCFC *FCEU_InitSpaceShadow(void) { memset(&ZD,0,sizeof(ZAPPER)); return(&SHADOWC); } fceu-0.98.12/src/input/share.h0000644000175000000620000000035210003562763015715 0ustar joestaff00000000000000#include "../types.h" #include "../input.h" #include "../fceu.h" #include "../ppu.h" #include "../x6502.h" #include "../palette.h" void FCEU_DrawCursor(uint8 *buf, int xc, int yc); void FCEU_DrawGunSight(uint8 *buf, int xc, int yc); fceu-0.98.12/src/input/zapper.c0000644000175000000620000000677510110502070016106 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "share.h" typedef struct { uint32 mzx,mzy,mzb; int zap_readbit; int bogo; int zappo; uint64 zaphit; } ZAPPER; static ZAPPER ZD[2]; static void FP_FASTAPASS(3) ZapperFrapper(int w, uint8 *bg, uint8 *spr, uint32 linets, int final) { int xs,xe; int zx,zy; if(!bg) // New line, so reset stuff. { ZD[w].zappo=0; return; } xs=ZD[w].zappo; xe=final; zx=ZD[w].mzx; zy=ZD[w].mzy; if(xe>256) xe=256; if(scanline>=(zy-4) && scanline<=(zy+4)) { while(xs=(zx-4)) { a1=bg[xs]; if(spr) { a2=spr[xs]; if(!(a2&0x80)) if(!(a2&0x40) || (a1&64)) a1=a2; } a1&=63; sum=palo[a1].r+palo[a1].g+palo[a1].b; if(sum>=100*3) { ZD[w].zaphit=((uint64)linets+(xs+16)*(PAL?15:16))/48+timestampbase; goto endo; } } xs++; } } endo: ZD[w].zappo=final; } static INLINE int CheckColor(int w) { FCEUPPU_LineUpdate(); if((ZD[w].zaphit+100)>=(timestampbase+timestamp) && !(ZD[w].mzb&2)) return(0); return(1); } static uint8 FP_FASTAPASS(1) ReadZapperVS(int w) { uint8 ret=0; if(ZD[w].zap_readbit==4) ret=1; if(ZD[w].zap_readbit==7) { if(ZD[w].bogo) ret|=0x1; } if(ZD[w].zap_readbit==6) { if(!CheckColor(w)) ret|=0x1; } if(!fceuindbg) ZD[w].zap_readbit++; return ret; } static void FP_FASTAPASS(1) StrobeZapperVS(int w) { ZD[w].zap_readbit=0; } static uint8 FP_FASTAPASS(1) ReadZapper(int w) { uint8 ret=0; if(ZD[w].bogo) ret|=0x10; if(CheckColor(w)) ret|=0x8; return ret; } static void FASTAPASS(3) DrawZapper(int w, uint8 *buf, int arg) { if(arg) FCEU_DrawGunSight(buf, ZD[w].mzx,ZD[w].mzy); } static void FP_FASTAPASS(3) UpdateZapper(int w, void *data, int arg) { uint32 *ptr=(uint32 *)data; //FCEU_DispMessage("%3d:%3d",ZD[w].mzx,ZD[w].mzy); if(ZD[w].bogo) ZD[w].bogo--; if(ptr[2]&3 && (!(ZD[w].mzb&3))) ZD[w].bogo=5; ZD[w].mzx=ptr[0]; ZD[w].mzy=ptr[1]; ZD[w].mzb=ptr[2]; } static INPUTC ZAPC={ReadZapper,0,0,UpdateZapper,ZapperFrapper,DrawZapper}; static INPUTC ZAPVSC={ReadZapperVS,0,StrobeZapperVS,UpdateZapper,ZapperFrapper,DrawZapper}; INPUTC *FCEU_InitZapper(int w) { memset(&ZD[w],0,sizeof(ZAPPER)); if(FCEUGameInfo->type == GIT_VSUNI) return(&ZAPVSC); else return(&ZAPC); } fceu-0.98.12/src/input/hypershot.c0000644000175000000620000000235610003562763016641 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "share.h" static uint8 HSVal,HSValR; static uint8 FP_FASTAPASS(2) HS_Read(int w, uint8 ret) { if(w) ret|=HSValR; return(ret); } static void HS_Strobe(void) { HSValR=HSVal<<1; } static void FP_FASTAPASS(2) HS_Update(void *data, int arg) { HSVal=*(uint8*)data; } static INPUTCFC HyperShot={HS_Read,0,HS_Strobe,HS_Update,0,0}; INPUTCFC *FCEU_InitHS(void) { HSVal=HSValR=0; return(&HyperShot); } fceu-0.98.12/src/input/mahjong.c0000644000175000000620000000341310003562763016232 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "share.h" static uint32 MReal,MRet; static uint8 FP_FASTAPASS(2) MJ_Read(int w, uint8 ret) { if(w) { // ret|=(MRet&1)<<1; ret|=((MRet&0x80)>>6)&2; // MRet>>=1; if(!fceuindbg) MRet<<=1; } return(ret); } static void FP_FASTAPASS(1) MJ_Write(uint8 v) { /* 1: I-D7, J-D6, K-D5, L-D4, M-D3, Big Red-D2 2: A-D7, B-D6, C-D5, D-D4, E-D3, F-D2, G-D1, H-D0 3: Sel-D6, Start-D7, D5, D4, D3, D2, D1 */ MRet=0; v>>=1; v&=3; if(v==3) { MRet=(MReal>>14)&0x7F; //MRet=((MRet&0x1F) |((MRet&0x40)>>1)|((MRet&0x20)<<1)) <<1; //(MReal>>13)&0x7F; } else if(v==2) { MRet=MReal&0xFF; } else if(v==1) { MRet=(MReal>>8)&0x3F; } // HSValR=HSVal<<1; } static void FP_FASTAPASS(2) MJ_Update(void *data, int arg) { MReal=*(uint32*)data; //printf("%08x\n",MReal>>13); //HSVal=*(uint8*)data; } static INPUTCFC Mahjong={MJ_Read,MJ_Write,0,MJ_Update,0,0}; INPUTCFC *FCEU_InitMahjong(void) { MReal=MRet=0; return(&Mahjong); } fceu-0.98.12/src/input/ftrainer.c0000644000175000000620000000325410003562763016424 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "share.h" static uint32 FTVal,FTValR; static char side; static uint8 FP_FASTAPASS(2) FT_Read(int w, uint8 ret) { if(w) { ret|=FTValR; } return(ret); } static void FP_FASTAPASS(1) FT_Write(uint8 V) { FTValR=0; //printf("%08x\n",FTVal); if(!(V&0x1)) FTValR=(FTVal>>8); else if(!(V&0x2)) FTValR=(FTVal>>4); else if(!(V&0x4)) FTValR=FTVal; FTValR=(~FTValR)&0xF; if(side=='B') FTValR=((FTValR&0x8)>>3) | ((FTValR&0x4)>>1) | ((FTValR&0x2)<<1) | ((FTValR&0x1)<<3); FTValR<<=1; } static void FP_FASTAPASS(2) FT_Update(void *data, int arg) { FTVal=*(uint32 *)data; } static INPUTCFC FamilyTrainer={FT_Read,FT_Write,0,FT_Update,0,0}; INPUTCFC *FCEU_InitFamilyTrainerA(void) { side='A'; FTVal=FTValR=0; return(&FamilyTrainer); } INPUTCFC *FCEU_InitFamilyTrainerB(void) { side='B'; FTVal=FTValR=0; return(&FamilyTrainer); } fceu-0.98.12/src/input/quiz.c0000644000175000000620000000317710003562763015606 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "share.h" static uint8 QZVal,QZValR; static uint8 FunkyMode; static uint8 FP_FASTAPASS(2) QZ_Read(int w, uint8 ret) { if(w) { //if(X.PC==0xdc7d) return(0xFF); //printf("Blah: %04x\n",X.PC); //FCEUI_DumpMem("dmp2",0xc000,0xffff); ret|=(QZValR&0x7)<<2; QZValR=QZValR>>3; if(FunkyMode) { //ret=0x14; //puts("Funky"); QZValR|=0x28; } else { QZValR|=0x38; } } return(ret); } static void QZ_Strobe(void) { QZValR=QZVal; //puts("Strobe"); } static void FP_FASTAPASS(1) QZ_Write(uint8 V) { //printf("Wr: %02x\n",V); FunkyMode=V&4; } static void FP_FASTAPASS(2) QZ_Update(void *data, int arg) { QZVal=*(uint8 *)data; } static INPUTCFC QuizKing={QZ_Read,QZ_Write,QZ_Strobe,QZ_Update,0,0}; INPUTCFC *FCEU_InitQuizKing(void) { QZVal=QZValR=0; return(&QuizKing); } fceu-0.98.12/src/input/oekakids.c0000644000175000000620000000366410003562763016411 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "share.h" static uint8 OKValR,LastWR; static uint32 OKData; static uint32 OKX,OKY,OKB; static uint8 FP_FASTAPASS(2) OK_Read(int w, uint8 ret) { if(w) { ret|=OKValR; } return(ret); } static void FP_FASTAPASS(1) OK_Write(uint8 V) { if(!(V&0x1)) { int32 vx,vy; //puts("Redo"); OKValR=OKData=0; if(OKB) OKData|=1; if(OKY >= 48) OKData|=2; else if(OKB) OKData|=3; vx=OKX*240/256+8; vy=OKY*256/240-12; if(vy<0) vy=0; if(vy>255) vy=255; if(vx<0) vx=0; if(vx>255) vx=255; OKData |= (vx<<10) | (vy<<2); } else { if((~LastWR)&V&0x02) OKData<<=1; if(!(V&0x2)) OKValR=0x4; else { if(OKData&0x40000) OKValR=0; else OKValR=0x8; } } LastWR=V; } static void FP_FASTAPASS(2) OK_Update(void *data, int arg) { //puts("Sync"); OKX=((uint32*)data)[0]; OKY=((uint32*)data)[1]; OKB=((uint32*)data)[2]; } static void FP_FASTAPASS(2) DrawOeka(uint8 *buf, int arg) { if(arg && OKY<44) FCEU_DrawCursor(buf, OKX, OKY); } static INPUTCFC OekaKids={OK_Read,OK_Write,0,OK_Update,0,DrawOeka}; INPUTCFC *FCEU_InitOekaKids(void) { OKValR=0; return(&OekaKids); } fceu-0.98.12/src/input/Makefile.am.inc0000755000175000000620000000035010003562763017247 0ustar joestaff00000000000000fceu_SOURCES += input/cursor.c input/zapper.c input/powerpad.c input/arkanoid.c input/shadow.c input/fkb.c input/fkb.h input/hypershot.c input/mahjong.c input/oekakids.c input/ftrainer.c input/quiz.c input/toprider.c input/bworld.c fceu-0.98.12/src/input/toprider.c0000644000175000000620000000260310003562764016440 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "share.h" static uint32 bs,bss; static uint32 boop; static uint8 FP_FASTAPASS(2) Read(int w, uint8 ret) { if(w) { ret|=(bs&1)<<3; ret|=(boop&1)<<4; bs>>=1; boop>>=1; // puts("Read"); } return(ret); } static void FP_FASTAPASS(1) Write(uint8 V) { // if(V&0x2) bs=bss; printf("Write: %02x\n",V); // boop=0xC0; } static void FP_FASTAPASS(2) Update(void *data, int arg) { bss=*(uint8*)data; bss|=bss<<8; bss|=bss<<8; } static INPUTCFC TopRider={Read,Write,0,Update,0,0}; INPUTCFC *FCEU_InitTopRider(void) { return(&TopRider); } fceu-0.98.12/src/input/bworld.c0000644000175000000620000000326210003562764016103 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "share.h" static int seq,ptr,bit,cnt,have; static uint8 bdata[20]; static uint8 FP_FASTAPASS(2) Read(int w, uint8 ret) { if(w && have) { switch(seq) { case 0: seq++; ptr=0; ret|=0x4; break; case 1: seq++; bit=bdata[ptr]; cnt=0; ret|=0x4; break; case 2: ret|=((bit&0x01)^0x01)<<2; bit>>=1; if(++cnt > 7) seq++; break; case 3: if(++ptr > 19) { seq=-1; have=0; } else seq=1; default: break; } } return(ret); } static void FP_FASTAPASS(1) Write(uint8 V) { //printf("%02x\n",V); } static void FP_FASTAPASS(2) Update(void *data, int arg) { if(*(uint8 *)data) { *(uint8 *)data=0; seq=ptr=0; have=1; strcpy(bdata,(uint8 *)data+1); strcpy(&bdata[13],"SUNSOFT"); } } static INPUTCFC BarcodeWorld={Read,Write,0,Update,0,0}; INPUTCFC *FCEU_InitBarcodeWorld(void) { return(&BarcodeWorld); } fceu-0.98.12/src/input.c0000644000175000000620000002351210052031765014606 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 1998 BERO * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "types.h" #include "x6502.h" #include "fceu.h" #include "sound.h" #include "netplay.h" #include "movie.h" #include "state.h" #include "input.h" #include "vsuni.h" #include "fds.h" extern INPUTC *FCEU_InitZapper(int w); extern INPUTC *FCEU_InitPowerpadA(int w); extern INPUTC *FCEU_InitPowerpadB(int w); extern INPUTC *FCEU_InitArkanoid(int w); extern INPUTCFC *FCEU_InitArkanoidFC(void); extern INPUTCFC *FCEU_InitSpaceShadow(void); extern INPUTCFC *FCEU_InitFKB(void); extern INPUTCFC *FCEU_InitHS(void); extern INPUTCFC *FCEU_InitMahjong(void); extern INPUTCFC *FCEU_InitQuizKing(void); extern INPUTCFC *FCEU_InitFamilyTrainerA(void); extern INPUTCFC *FCEU_InitFamilyTrainerB(void); extern INPUTCFC *FCEU_InitOekaKids(void); extern INPUTCFC *FCEU_InitTopRider(void); extern INPUTCFC *FCEU_InitBarcodeWorld(void); static uint8 joy_readbit[2]; static uint8 joy[4]={0,0,0,0}; static uint8 LastStrobe; /* This function is a quick hack to get the NSF player to use emulated gamepad input. */ uint8 FCEU_GetJoyJoy(void) { return(joy[0]|joy[1]|joy[2]|joy[3]); } extern uint8 coinon; static int FSDisable=0; /* Set to 1 if NES-style four-player adapter is disabled. */ static int JPAttrib[2]={0,0}; static int JPType[2]={0,0}; static void *InputDataPtr[2]; static int JPAttribFC=0; static int JPTypeFC=0; static void *InputDataPtrFC; void (*InputScanlineHook)(uint8 *bg, uint8 *spr, uint32 linets, int final); static INPUTC DummyJPort={0,0,0,0,0}; static INPUTC *JPorts[2]={&DummyJPort,&DummyJPort}; static INPUTCFC *FCExp=0; static uint8 FP_FASTAPASS(1) ReadGPVS(int w) { uint8 ret=0; if(joy_readbit[w]>=8) ret=1; else { ret = ((joy[w]>>(joy_readbit[w]))&1); if(!fceuindbg) joy_readbit[w]++; } return ret; } static uint8 FP_FASTAPASS(1) ReadGP(int w) { uint8 ret; if(joy_readbit[w]>=8) ret = ((joy[2+w]>>(joy_readbit[w]&7))&1); else ret = ((joy[w]>>(joy_readbit[w]))&1); if(joy_readbit[w]>=16) ret=0; if(FSDisable) { if(joy_readbit[w]>=8) ret|=1; } else { if(joy_readbit[w]==19-w) ret|=1; } if(!fceuindbg) joy_readbit[w]++; return ret; } static DECLFR(JPRead) { uint8 ret=0; if(JPorts[A&1]->Read) ret|=JPorts[A&1]->Read(A&1); if(FCExp) if(FCExp->Read) ret=FCExp->Read(A&1,ret); ret|=X.DB&0xC0; return(ret); } static DECLFW(B4016) { if(FCExp) if(FCExp->Write) FCExp->Write(V&7); if(JPorts[0]->Write) JPorts[0]->Write(V&1); if(JPorts[1]->Write) JPorts[1]->Write(V&1); if((LastStrobe&1) && (!(V&1))) { /* This strobe code is just for convenience. If it were with the code in input / *.c, it would more accurately represent what's really going on. But who wants accuracy? ;) Seriously, though, this shouldn't be a problem. */ if(JPorts[0]->Strobe) JPorts[0]->Strobe(0); if(JPorts[1]->Strobe) JPorts[1]->Strobe(1); if(FCExp) if(FCExp->Strobe) FCExp->Strobe(); } LastStrobe=V&0x1; } static void FP_FASTAPASS(1) StrobeGP(int w) { joy_readbit[w]=0; } static INPUTC GPC={ReadGP,0,StrobeGP,0,0,0}; static INPUTC GPCVS={ReadGPVS,0,StrobeGP,0,0,0}; void FCEU_DrawInput(uint8 *buf) { int x; for(x=0;x<2;x++) if(JPorts[x]->Draw) JPorts[x]->Draw(x,buf,JPAttrib[x]); if(FCExp) if(FCExp->Draw) FCExp->Draw(buf,JPAttribFC); } void FCEU_UpdateInput(void) { int x; for(x=0;x<2;x++) { switch(JPType[x]) { case SI_GAMEPAD: if(!x) { joy[0]=*(uint32 *)InputDataPtr[0]; joy[2]=*(uint32 *)InputDataPtr[0] >> 16; } else { joy[1]=*(uint32 *)InputDataPtr[1] >>8; joy[3]=*(uint32 *)InputDataPtr[1] >>24; } break; default: if(JPorts[x]->Update) JPorts[x]->Update(x,InputDataPtr[x],JPAttrib[x]); break; } } if(FCExp) if(FCExp->Update) FCExp->Update(InputDataPtrFC,JPAttribFC); if(FCEUGameInfo->type==GIT_VSUNI) if(coinon) coinon--; if(FCEUnetplay) NetplayUpdate(joy); FCEUMOV_AddJoy(joy); if(FCEUGameInfo->type==GIT_VSUNI) FCEU_VSUniSwap(&joy[0],&joy[1]); } static DECLFR(VSUNIRead0) { uint8 ret=0; if(JPorts[0]->Read) ret|=(JPorts[0]->Read(0))&1; ret|=(vsdip&3)<<3; if(coinon) ret|=0x4; return ret; } static DECLFR(VSUNIRead1) { uint8 ret=0; if(JPorts[1]->Read) ret|=(JPorts[1]->Read(1))&1; ret|=vsdip&0xFC; return ret; } static void SLHLHook(uint8 *bg, uint8 *spr, uint32 linets, int final) { int x; for(x=0;x<2;x++) if(JPorts[x]->SLHook) JPorts[x]->SLHook(x,bg,spr,linets,final); if(FCExp) if(FCExp->SLHook) FCExp->SLHook(bg,spr,linets,final); } static void CheckSLHook(void) { InputScanlineHook=0; if(JPorts[0]->SLHook || JPorts[1]->SLHook) InputScanlineHook=SLHLHook; if(FCExp) if(FCExp->SLHook) InputScanlineHook=SLHLHook; } static void FASTAPASS(1) SetInputStuff(int x) { switch(JPType[x]) { case SI_GAMEPAD: if(FCEUGameInfo->type==GIT_VSUNI) JPorts[x] = &GPCVS; else JPorts[x]=&GPC; break; case SI_ARKANOID:JPorts[x]=FCEU_InitArkanoid(x);break; case SI_ZAPPER:JPorts[x]=FCEU_InitZapper(x);break; case SI_POWERPADA:JPorts[x]=FCEU_InitPowerpadA(x);break; case SI_POWERPADB:JPorts[x]=FCEU_InitPowerpadB(x);break; case SI_NONE:JPorts[x]=&DummyJPort;break; } CheckSLHook(); } static uint8 F4ReadBit[2]; static void StrobeFami4(void) { F4ReadBit[0]=F4ReadBit[1]=0; } static uint8 FP_FASTAPASS(2) ReadFami4(int w, uint8 ret) { ret&=1; ret |= ((joy[2+w]>>(F4ReadBit[w]))&1)<<1; if(F4ReadBit[w]>=8) ret|=2; else F4ReadBit[w]++; return(ret); } static INPUTCFC FAMI4C={ReadFami4,0,StrobeFami4,0,0,0}; static void SetInputStuffFC(void) { switch(JPTypeFC) { case SIFC_NONE:FCExp=0;break; case SIFC_ARKANOID:FCExp=FCEU_InitArkanoidFC();break; case SIFC_SHADOW:FCExp=FCEU_InitSpaceShadow();break; case SIFC_OEKAKIDS:FCExp=FCEU_InitOekaKids();break; case SIFC_4PLAYER:FCExp=&FAMI4C;memset(&F4ReadBit,0,sizeof(F4ReadBit));break; case SIFC_FKB:FCExp=FCEU_InitFKB();break; case SIFC_HYPERSHOT:FCExp=FCEU_InitHS();break; case SIFC_MAHJONG:FCExp=FCEU_InitMahjong();break; case SIFC_QUIZKING:FCExp=FCEU_InitQuizKing();break; case SIFC_FTRAINERA:FCExp=FCEU_InitFamilyTrainerA();break; case SIFC_FTRAINERB:FCExp=FCEU_InitFamilyTrainerB();break; case SIFC_BWORLD:FCExp=FCEU_InitBarcodeWorld();break; case SIFC_TOPRIDER:FCExp=FCEU_InitTopRider();break; } CheckSLHook(); } void InitializeInput(void) { memset(joy_readbit,0,sizeof(joy_readbit)); memset(joy,0,sizeof(joy)); LastStrobe = 0; if(FCEUGameInfo->type==GIT_VSUNI) { SetReadHandler(0x4016,0x4016,VSUNIRead0); SetReadHandler(0x4017,0x4017,VSUNIRead1); } else SetReadHandler(0x4016,0x4017,JPRead); SetWriteHandler(0x4016,0x4016,B4016); SetInputStuff(0); SetInputStuff(1); SetInputStuffFC(); } void FCEUI_SetInput(int port, int type, void *ptr, int attrib) { JPAttrib[port]=attrib; JPType[port]=type; InputDataPtr[port]=ptr; SetInputStuff(port); } void FCEUI_DisableFourScore(int s) { FSDisable=s; } void FCEUI_SetInputFC(int type, void *ptr, int attrib) { JPAttribFC=attrib; JPTypeFC=type; InputDataPtrFC=ptr; SetInputStuffFC(); } SFORMAT FCEUCTRL_STATEINFO[]={ { joy_readbit, 2, "JYRB"}, { joy, 4, "JOYS"}, { &LastStrobe, 1, "LSTS"}, { 0 } }; void FCEU_DoSimpleCommand(int cmd) { switch(cmd) { case FCEUNPCMD_FDSINSERT: FCEU_FDSInsert(-1);break; case FCEUNPCMD_FDSSELECT: FCEU_FDSSelect();break; case FCEUNPCMD_FDSEJECT: FCEU_FDSEject();break; case FCEUNPCMD_VSUNICOIN: FCEU_VSUniCoin(); break; case FCEUNPCMD_VSUNIDIP0 ... (FCEUNPCMD_VSUNIDIP0 + 7): FCEU_VSUniToggleDIP(cmd - FCEUNPCMD_VSUNIDIP0);break; case FCEUNPCMD_POWER: PowerNES();break; case FCEUNPCMD_RESET: ResetNES();break; } } void FCEU_QSimpleCommand(int cmd) { if(FCEUnetplay) FCEUNET_SendCommand(cmd, 0); else { if(!FCEUMOV_IsPlaying()) FCEU_DoSimpleCommand(cmd); else FCEUMOV_AddCommand(cmd); } } void FCEUI_FDSSelect(void) { FCEU_QSimpleCommand(FCEUNPCMD_FDSSELECT); } int FCEUI_FDSInsert(int oride) { FCEU_QSimpleCommand(FCEUNPCMD_FDSINSERT); return(1); } int FCEUI_FDSEject(void) { FCEU_QSimpleCommand(FCEUNPCMD_FDSEJECT); return(1); } void FCEUI_VSUniToggleDIP(int w) { FCEU_QSimpleCommand(FCEUNPCMD_VSUNIDIP0 + w); } void FCEUI_VSUniCoin(void) { FCEU_QSimpleCommand(FCEUNPCMD_VSUNICOIN); } void FCEUI_ResetNES(void) { FCEU_QSimpleCommand(FCEUNPCMD_RESET); } void FCEUI_PowerNES(void) { FCEU_QSimpleCommand(FCEUNPCMD_POWER); } fceu-0.98.12/src/input.h0000644000175000000620000000171010052012115014573 0ustar joestaff00000000000000typedef struct { uint8 FP_FASTAPASS(1) (*Read)(int w); void FP_FASTAPASS(1) (*Write)(uint8 v); void FP_FASTAPASS(1) (*Strobe)(int w); void FP_FASTAPASS(3) (*Update)(int w, void *data, int arg); void FP_FASTAPASS(3) (*SLHook)(int w, uint8 *bg, uint8 *spr, uint32 linets, int final); void FP_FASTAPASS(3) (*Draw)(int w, uint8 *buf, int arg); } INPUTC; typedef struct { uint8 FP_FASTAPASS(2) (*Read)(int w, uint8 ret); void FP_FASTAPASS(1) (*Write)(uint8 v); void (*Strobe)(void); void FP_FASTAPASS(2) (*Update)(void *data, int arg); void FP_FASTAPASS(3) (*SLHook)(uint8 *bg, uint8 *spr, uint32 linets, int final); void FP_FASTAPASS(2) (*Draw)(uint8 *buf, int arg); } INPUTCFC; void FCEU_DrawInput(uint8 *buf); void FCEU_UpdateInput(void); void InitializeInput(void); extern void (*PStrobe[2])(void); extern void (*InputScanlineHook)(uint8 *bg, uint8 *spr, uint32 linets, int final); void FCEU_DoSimpleCommand(int cmd); fceu-0.98.12/src/mappers/0002755000175000000620000000000010111545623014750 5ustar joestaff00000000000000fceu-0.98.12/src/mappers/112.c0000644000175000000620000000312110003562764015417 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" DECLFW(Mapper112_write) { switch(A) { case 0xe000:MIRROR_SET(V&1);break; case 0x8000:mapbyte1[0]=V;break; case 0xa000:switch(mapbyte1[0]) { case 0:ROM_BANK8(0x8000,V);break; case 1:ROM_BANK8(0xA000,V);break; case 2: V&=0xFE;VROM_BANK1(0,V); VROM_BANK1(0x400,(V+1));break; case 3: V&=0xFE;VROM_BANK1(0x800,V); VROM_BANK1(0xC00,(V+1));break; case 4:VROM_BANK1(0x1000,V);break; case 5:VROM_BANK1(0x1400,V);break; case 6:VROM_BANK1(0x1800,V);break; case 7:VROM_BANK1(0x1c00,V);break; } break; } } void Mapper112_init(void) { SetWriteHandler(0x8000,0xffff,Mapper112_write); } fceu-0.98.12/src/mappers/113.c0000644000175000000620000000257110003562764015430 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" /* I'm getting the feeling this is another "jam two different bank switching hardwares into one mapper". */ /* HES 4-in-1 */ DECLFW(Mapper113_write) { ROM_BANK32((V>>3)&7); VROM_BANK8(V&7); //printf("$%04x:$%02x\n",A,V); } /* Deathbots */ DECLFW(Mapper113_writeh) { //printf("$%04x:$%02x\n",A,V); ROM_BANK32(V&0x7); //VROM_BANK8((V>>4)&0x7); } void Mapper113_init(void) { ROM_BANK32(0); SetWriteHandler(0x4020,0x7fff,Mapper113_write); SetWriteHandler(0x8000,0xffff,Mapper113_writeh); } fceu-0.98.12/src/mappers/117.c0000644000175000000620000000367510003562764015442 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" DECLFW(Mapper117_write) { //if(A>=0xc000) //printf("$%04x:$%02x, %d,%d\n",A,V,scanline,timestamp); switch(A) { case 0xc001:IRQLatch=V;break; case 0xc003:IRQCount=IRQLatch;IRQa|=2;break; case 0xe000:IRQa&=~1;IRQa|=V&1;X6502_IRQEnd(FCEU_IQEXT);break; case 0xc002:X6502_IRQEnd(FCEU_IQEXT);break; case 0xa000:VROM_BANK1(0x0000,V);break; case 0xa001:VROM_BANK1(0x0400,V);break; case 0xa002:VROM_BANK1(0x0800,V);break; case 0xa003:VROM_BANK1(0x0c00,V);break; case 0xa004:VROM_BANK1(0x1000,V);break; case 0xa005:VROM_BANK1(0x1400,V);break; case 0xa006:VROM_BANK1(0x1800,V);break; case 0xa007:VROM_BANK1(0x1c00,V);break; case 0x8000:ROM_BANK8(0x8000,V);break; case 0x8001:ROM_BANK8(0xa000,V);break; case 0x8002:ROM_BANK8(0xc000,V);break; case 0x8003:ROM_BANK8(0xe000,V);break; } } static void Mapper117_hb(void) { //if(scanline==0x40) X6502_IRQBegin(FCEU_IQEXT); //return; if(IRQa==3 && IRQCount) { IRQCount--; if(!IRQCount) { IRQa&=1; X6502_IRQBegin(FCEU_IQEXT); } } } void Mapper117_init(void) { GameHBIRQHook=Mapper117_hb; SetWriteHandler(0x8000,0xffff,Mapper117_write); } fceu-0.98.12/src/mappers/15.c0000644000175000000620000000326610003562764015353 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static void Sync(void) { int x; setmirror(((mapbyte1[0]>>6)&1)^1); switch(mapbyte1[1]&0x3) { case 0x0: for(x=0;x<4;x++) setprg8(0x8000+x*8192,(((mapbyte1[0]&0x7F)<<1)+x)^(mapbyte1[0]>>7)); break; case 0x2: for(x=0;x<4;x++) setprg8(0x8000+x*8192,((mapbyte1[0]&0x7F)<<1)+(mapbyte1[0]>>7)); break; case 0x1: case 0x3: for(x=0;x<4;x++) { unsigned int b; b=mapbyte1[0]&0x7F; if(x>=2 && !(mapbyte1[1]&0x2)) b=0x7F; setprg8(0x8000+x*8192,(x&1)+((b<<1)^(mapbyte1[0]>>7))); } break; } } static DECLFW(Mapper15_write) { mapbyte1[0]=V; mapbyte1[1]=A&3; Sync(); } static void StateRestore(int version) { Sync(); } void Mapper15_init(void) { mapbyte1[0]=mapbyte1[1]=0; Sync(); GameStateRestore=StateRestore; SetWriteHandler(0x8000,0xFFFF,Mapper15_write); } fceu-0.98.12/src/mappers/151.c0000644000175000000620000000224710003562764015432 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" DECLFW(Mapper151_write) { switch(A&0xF000) { case 0x8000:ROM_BANK8(0x8000,V);break; case 0xA000:ROM_BANK8(0xA000,V);break; case 0xC000:ROM_BANK8(0xC000,V);break; case 0xe000:VROM_BANK4(0x0000,V);break; case 0xf000:VROM_BANK4(0x1000,V);break; } } void Mapper151_init(void) { SetWriteHandler(0x8000,0xffff,Mapper151_write); } fceu-0.98.12/src/mappers/16.c0000644000175000000620000001547610030417404015350 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 1998 BERO * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static void FP_FASTAPASS(1) BandaiIRQHook(int a) { if(IRQa) { IRQCount-=a; if(IRQCount<0) { X6502_IRQBegin(FCEU_IQEXT); //printf("IRQ: %d, %d\n",scanline,timestamp); IRQa=0; IRQCount=0xFFFF; } } } static DECLFW(Mapper16_write) { A&=0xF; if(A<=0x7) VROM_BANK1(A<<10,V); else if(A==0x8) ROM_BANK16(0x8000,V); else switch(A) { case 0x9: switch(V&3) { case 0x00:MIRROR_SET2(1);break; case 0x01:MIRROR_SET2(0);break; case 0x02:onemir(0);break; case 0x03:onemir(1);break; } break; case 0xA:X6502_IRQEnd(FCEU_IQEXT); IRQa=V&1; IRQCount=IRQLatch; break; case 0xB:IRQLatch&=0xFF00; IRQLatch|=V; break; case 0xC:IRQLatch&=0xFF; IRQLatch|=V<<8; break; case 0xD: break;/* Serial EEPROM control port */ } } // Famicom jump 2: // 0-7: Lower bit of data selects which 256KB PRG block is in use. // This seems to be a hack on the developers' part, so I'll make emulation // of it a hack(I think the current PRG block would depend on whatever the // lowest bit of the CHR bank switching register that corresponds to the // last CHR address read). static void PRGO(void) { uint32 base=(mapbyte1[0]&1)<<4; ROM_BANK16(0x8000,(mapbyte2[0]&0xF)|base); ROM_BANK16(0xC000,base|0xF); } static DECLFW(Mapper153_write) { A&=0xF; if(A<=0x7) { mapbyte1[A&7]=V; PRGO(); } else if(A==0x8) { mapbyte2[0]=V; PRGO(); } else switch(A) { case 0x9: switch(V&3) { case 0x00:MIRROR_SET2(1);break; case 0x01:MIRROR_SET2(0);break; case 0x02:onemir(0);break; case 0x03:onemir(1);break; } break; case 0xA:X6502_IRQEnd(FCEU_IQEXT); IRQa=V&1; IRQCount=IRQLatch; break; case 0xB:IRQLatch&=0xFF00; IRQLatch|=V; break; case 0xC:IRQLatch&=0xFF; IRQLatch|=V<<8; break; } } void Mapper16_init(void) { MapIRQHook=BandaiIRQHook; SetWriteHandler(0x6000,0xFFFF,Mapper16_write); } void Mapper153_init(void) { MapIRQHook=BandaiIRQHook; SetWriteHandler(0x8000,0xFFFF,Mapper153_write); /* This mapper/board seems to have WRAM at $6000-$7FFF, so I'll let the main ines code take care of that memory region. */ } static uint8 BarcodeData[256]; static int BarcodeReadPos; static int BarcodeCycleCount; static uint32 BarcodeOut; int FCEUI_DatachSet(const uint8 *rcode) { int prefix_parity_type[10][6] = { {0,0,0,0,0,0}, {0,0,1,0,1,1}, {0,0,1,1,0,1}, {0,0,1,1,1,0}, {0,1,0,0,1,1}, {0,1,1,0,0,1}, {0,1,1,1,0,0}, {0,1,0,1,0,1}, {0,1,0,1,1,0}, {0,1,1,0,1,0} }; int data_left_odd[10][7] = { {0,0,0,1,1,0,1}, {0,0,1,1,0,0,1}, {0,0,1,0,0,1,1}, {0,1,1,1,1,0,1}, {0,1,0,0,0,1,1}, {0,1,1,0,0,0,1}, {0,1,0,1,1,1,1}, {0,1,1,1,0,1,1}, {0,1,1,0,1,1,1}, {0,0,0,1,0,1,1} }; int data_left_even[10][7] = { {0,1,0,0,1,1,1}, {0,1,1,0,0,1,1}, {0,0,1,1,0,1,1}, {0,1,0,0,0,0,1}, {0,0,1,1,1,0,1}, {0,1,1,1,0,0,1}, {0,0,0,0,1,0,1}, {0,0,1,0,0,0,1}, {0,0,0,1,0,0,1}, {0,0,1,0,1,1,1} }; int data_right[10][7] = { {1,1,1,0,0,1,0}, {1,1,0,0,1,1,0}, {1,1,0,1,1,0,0}, {1,0,0,0,0,1,0}, {1,0,1,1,1,0,0}, {1,0,0,1,1,1,0}, {1,0,1,0,0,0,0}, {1,0,0,0,1,0,0}, {1,0,0,1,0,0,0}, {1,1,1,0,1,0,0} }; uint8 code[13+1]; uint32 tmp_p=0; int i, j; int len; for(i=len=0;i<13;i++) { if(!rcode[i]) break; if((code[i]=rcode[i]-'0') > 9) return(0); len++; } if(len!=13 && len!=12 && len!=8 && len!=7) return(0); #define BS(x) BarcodeData[tmp_p]=x;tmp_p++ for(j=0;j<32;j++) { BS(0x00); } /* Left guard bars */ BS(1); BS(0); BS(1); if(len==13 || len==12) { uint32 csum; for(i=0;i<6;i++) if(prefix_parity_type[code[0]][i]) { for(j=0;j<7;j++) { BS(data_left_even[code[i+1]][j]); } } else for(j=0;j<7;j++) { BS(data_left_odd[code[i+1]][j]); } /* Center guard bars */ BS(0); BS(1); BS(0); BS(1); BS(0); for(i=7;i<12;i++) for(j=0;j<7;j++) { BS(data_right[code[i]][j]); } csum=0; for(i=0;i<12;i++) csum+=code[i]*((i&1)?3:1); csum=(10-(csum%10))%10; //printf("%d\n",csum); for(j=0;j<7;j++) { BS(data_right[csum][j]); } } else if(len==8 || len==7) { uint32 csum=0; for(i=0;i<7;i++) csum+=(i&1)?code[i]:(code[i]*3); csum=(10-(csum%10))%10; for(i=0;i<4;i++) for(j=0;j<7;j++) { BS(data_left_odd[code[i]][j]); } /* Center guard bars */ BS(0); BS(1); BS(0); BS(1); BS(0); for(i=4;i<7;i++) for(j=0;j<7;j++) { BS(data_right[code[i]][j]); } for(j=0;j<7;j++) { BS(data_right[csum][j]);} } /* Right guard bars */ BS(1); BS(0); BS(1); for(j=0;j<32;j++) { BS(0x00); } BS(0xFF); #undef BS BarcodeReadPos=0; BarcodeOut=0x8; BarcodeCycleCount=0; return(1); } static void FP_FASTAPASS(1) BarcodeIRQHook(int a) { BandaiIRQHook(a); BarcodeCycleCount+=a; if(BarcodeCycleCount >= 1000) { BarcodeCycleCount -= 1000; if(BarcodeData[BarcodeReadPos]==0xFF) { BarcodeOut=0; } else { BarcodeOut=(BarcodeData[BarcodeReadPos]^1)<<3; BarcodeReadPos++; } } } static DECLFR(Mapper157_read) { uint8 ret; ret=BarcodeOut; return(ret); } void Mapper157_init(void) { FCEUGameInfo->cspecial = SIS_DATACH; MapIRQHook=BarcodeIRQHook; SetWriteHandler(0x6000,0xFFFF,Mapper16_write); SetReadHandler(0x6000,0x7FFF,Mapper157_read); BarcodeData[0]=0xFF; BarcodeReadPos=0; BarcodeOut=0; BarcodeCycleCount=0; } fceu-0.98.12/src/mappers/17.c0000644000175000000620000000423710003562764015354 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static void FP_FASTAPASS(1) FFEIRQHook(int a) { if(IRQa) { IRQCount+=a; if(IRQCount>=0x10000) { X6502_IRQBegin(FCEU_IQEXT); IRQa=0; IRQCount=0; } } } DECLFW(Mapper17_write) { switch(A){ default: break; case 0x42FE: onemir((V>>4)&1); break; case 0x42FF: MIRROR_SET((V>>4)&1); break; case 0x4501:IRQa=V&1;X6502_IRQEnd(FCEU_IQEXT);break; case 0x4502:IRQCount&=0xFF00;IRQCount|=V;X6502_IRQEnd(FCEU_IQEXT);break; case 0x4503:IRQCount&=0x00FF;IRQCount|=V<<8;IRQa=1;X6502_IRQEnd(FCEU_IQEXT);break; case 0x4504: ROM_BANK8(0x8000,V);break; case 0x4505: ROM_BANK8(0xA000,V);break; case 0x4506: ROM_BANK8(0xC000,V);break; case 0x4507: ROM_BANK8(0xE000,V);break; case 0x4510: VROM_BANK1(0x0000,V);break; case 0x4511: VROM_BANK1(0x0400,V);break; case 0x4512: VROM_BANK1(0x0800,V);break; case 0x4513: VROM_BANK1(0x0C00,V);break; case 0x4514: VROM_BANK1(0x1000,V);break; case 0x4515: VROM_BANK1(0x1400,V);break; case 0x4516: VROM_BANK1(0x1800,V);break; case 0x4517: VROM_BANK1(0x1C00,V);break; } } void Mapper17_init(void) { MapIRQHook=FFEIRQHook; SetWriteHandler(0x4020,0x5fff,Mapper17_write); } fceu-0.98.12/src/mappers/18.c0000644000175000000620000000407710003562764015357 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define K4buf mapbyte2 #define K4buf2 mapbyte3 void FP_FASTAPASS(1) JalecoIRQHook(int a) { if(IRQa && IRQCount) { IRQCount-=a; if(IRQCount<=0) { X6502_IRQBegin(FCEU_IQEXT); IRQCount=0; IRQa=0; } } } DECLFW(Mapper18_write) { A&=0xF003; if(A>=0x8000 && A<=0x9001) { int x=((A>>1)&1)|((A-0x8000)>>11); K4buf2[x]&=(0xF0)>>((A&1)<<2); K4buf2[x]|=(V&0xF)<<((A&1)<<2); ROM_BANK8(0x8000+(x<<13),K4buf2[x]); } else if(A>=0xa000 && A<=0xd003) { int x=((A>>1)&1)|((A-0xA000)>>11); K4buf[x]&=(0xF0)>>((A&1)<<2); K4buf[x]|=(V&0xF)<<((A&1)<<2); VROM_BANK1(x<<10,K4buf[x]); } else switch(A) { case 0xe000:IRQLatch&=0xFFF0;IRQLatch|=(V&0x0f);break; case 0xe001:IRQLatch&=0xFF0F;IRQLatch|=(V&0x0f)<<4;break; case 0xe002:IRQLatch&=0xF0FF;IRQLatch|=(V&0x0f)<<8;break; case 0xe003:IRQLatch&=0x0FFF;IRQLatch|=(V&0x0f)<<12;break; case 0xf000:IRQCount=IRQLatch; break; case 0xf001:IRQa=V&1; X6502_IRQEnd(FCEU_IQEXT); break; case 0xf002:MIRROR_SET2(V&1); if(V&2) onemir(0); break; } } void Mapper18_init(void) { SetWriteHandler(0x8000,0xffff,Mapper18_write); MapIRQHook=JalecoIRQHook; } fceu-0.98.12/src/mappers/180.c0000644000175000000620000000023310003562764015425 0ustar joestaff00000000000000#include "mapinc.h" DECLFW(Mapper180_write) { ROM_BANK16(0xC000,V); } void Mapper180_init(void) { SetWriteHandler(0x8000,0xffff,Mapper180_write); } fceu-0.98.12/src/mappers/182.c0000644000175000000620000000174310003562764015436 0ustar joestaff00000000000000#include "mapinc.h" static DECLFW(Mapper182_write) { switch(A&0xf003) { case 0xe003:IRQCount=V;IRQa=1;X6502_IRQEnd(FCEU_IQEXT);break; case 0x8001:MIRROR_SET(V&1);break; case 0xA000:mapbyte1[0]=V;break; case 0xC000: switch(mapbyte1[0]&7) { case 0:VROM_BANK2(0x0000,V>>1);break; case 1:VROM_BANK1(0x1400,V);break; case 2:VROM_BANK2(0x0800,V>>1);break; case 3:VROM_BANK1(0x1c00,V);break; case 4:ROM_BANK8(0x8000,V);break; case 5:ROM_BANK8(0xA000,V);break; case 6:VROM_BANK1(0x1000,V);break; case 7:VROM_BANK1(0x1800,V);break; } break; } } void blop(void) { if(IRQa) { if(IRQCount) { IRQCount--; if(!IRQCount) { IRQa=0; X6502_IRQBegin(FCEU_IQEXT); } } } } void Mapper182_init(void) { SetWriteHandler(0x8000,0xFFFF,Mapper182_write); GameHBIRQHook=blop; } fceu-0.98.12/src/mappers/184.c0000644000175000000620000000026610003562764015437 0ustar joestaff00000000000000#include "mapinc.h" DECLFW(Mapper184_write) { VROM_BANK4(0x0000,V); VROM_BANK4(0x1000,(V>>4)); } void Mapper184_init(void) { SetWriteHandler(0x6000,0xffff,Mapper184_write); } fceu-0.98.12/src/mappers/189.c0000644000175000000620000000252610003562764015445 0ustar joestaff00000000000000/* Is this an MMC3 workalike piece of hardware, with the addition of a register at $4120 or does it have only partial MMC3 functionality? A good test would be to see if commands 6 and 7 can change PRG banks and of course test the regs >=$c000, on the real cart. */ #include "mapinc.h" #define cmd mapbyte1[0] static DECLFW(Mapper189_write) { //if(A>=0xc000) printf("$%04x:$%02x\n",A,V); if((A&0xF100)==0x4100) ROM_BANK32(V>>4); else if((A&0xF100)==0x6100) ROM_BANK32(V&3); else switch(A&0xE001) { case 0xa000:MIRROR_SET(V&1);break; case 0x8000:cmd=V;break; case 0x8001:switch(cmd&7) { case 0:VROM_BANK2(0x0000,V>>1);break; case 1:VROM_BANK2(0x0800,V>>1);break; case 2:VROM_BANK1(0x1000,V);break; case 3:VROM_BANK1(0x1400,V);break; case 4:VROM_BANK1(0x1800,V);break; case 5:VROM_BANK1(0x1C00,V);break; } case 0xc000:IRQLatch=V;break; case 0xc001:IRQCount=IRQLatch;break; case 0xe000:IRQa=0;X6502_IRQEnd(FCEU_IQEXT);break; case 0xe001:IRQa=1;break; break; } } void m189irq(void) { if(IRQa) { if(IRQCount) { IRQCount--; if(!IRQCount) X6502_IRQBegin(FCEU_IQEXT); } } } void Mapper189_init(void) { GameHBIRQHook=m189irq; SetWriteHandler(0x4120,0xFFFF,Mapper189_write); SetReadHandler(0x6000,0x7FFF,0); ROM_BANK32(0); } fceu-0.98.12/src/mappers/21.c0000644000175000000620000000532010003562764015341 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define K4buf mapbyte2 #define K4IRQ mapbyte1[1] #define K4sel mapbyte1[0] static int acount=0; DECLFW(Mapper21_write) { A|=((A>>5)&0xF); if((A&0xF000)==0xA000) ROM_BANK8(0xA000,V); else if((A&0xF000)==0x8000) { if(K4sel&2) ROM_BANK8(0xC000,V); else ROM_BANK8(0x8000,V); } else if(A>=0xb000 && A<=0xefff) { A&=0xF006; { int x=((A>>2)&1)|((A-0xB000)>>11); K4buf[x]&=(0xF0)>>((A&2)<<1); K4buf[x]|=(V&0xF)<<((A&2)<<1); VROM_BANK1(x<<10,K4buf[x]); } } else switch(A&0xF006) { case 0x9000: switch(V&0x3) { case 0:MIRROR_SET(0);break; case 1:MIRROR_SET(1);break; case 2:onemir(0);break; case 3:onemir(1);break; } break; case 0x9006: case 0x9004: case 0x9002:if((K4sel&2)!=(V&2)) { uint8 swa; swa=PRGBankList[0]; ROM_BANK8(0x8000,PRGBankList[2]); ROM_BANK8(0xc000,swa); } K4sel=V; break; case 0xf000:IRQLatch&=0xF0;IRQLatch|=V&0xF;break; case 0xf002:IRQLatch&=0x0F;IRQLatch|=V<<4;break; case 0xf004:IRQCount=IRQLatch;acount=0; IRQa=V&2;K4IRQ=V&1; X6502_IRQEnd(FCEU_IQEXT); break; case 0xf006:IRQa=K4IRQ;X6502_IRQEnd(FCEU_IQEXT);break; } } static void FP_FASTAPASS(1) KonamiIRQHook(int a) { #define LCYCS ((227*2)+1) //#define LCYCS 341 if(IRQa) { // acount+=a*3; acount+=a*4; if(acount>=LCYCS) { doagainbub:acount-=LCYCS;IRQCount++; if(IRQCount&0x100) {X6502_IRQBegin(FCEU_IQEXT);IRQCount=IRQLatch;} if(acount>=LCYCS) goto doagainbub; } } } void Mapper21_init(void) { SetWriteHandler(0x8000,0xffff,Mapper21_write); MapIRQHook=KonamiIRQHook; } fceu-0.98.12/src/mappers/22.c0000644000175000000620000000325210003562764015344 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define K4buf mapbyte2 DECLFW(Mapper22_write) { if(A<=0xAFFF) { switch(A&0xF000) { case 0x8000:ROM_BANK8(0x8000,V);break; case 0xa000:ROM_BANK8(0xA000,V);break; case 0x9000:switch(V&3) { case 0x00:MIRROR_SET2(1);break; case 0x01:MIRROR_SET2(0);break; case 0x02:onemir(0);break; case 0x03:onemir(1);break; } break; } } else { A&=0xF003; if(A>=0xb000 && A<=0xe003) { int x=(A&1)|((A-0xB000)>>11); K4buf[x]&=(0xF0)>>((A&2)<<1); K4buf[x]|=(V&0xF)<<((A&2)<<1); VROM_BANK1(x<<10,K4buf[x]>>1); } } } void Mapper22_init(void) { SetWriteHandler(0x8000,0xffff,Mapper22_write); } fceu-0.98.12/src/mappers/225.c0000644000175000000620000000366110003562764015435 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define reg1 mapbyte1[0] #define reg2 mapbyte1[1] #define reg3 mapbyte1[2] #define reg4 mapbyte1[3] DECLFR(A110in1read) { switch(A&0x3) { case 0:return reg1;break; case 1:return reg2;break; case 2:return reg3;break; case 3:return reg4;break; } return 0xF; } DECLFW(A110in1regwr) { switch(A&0x3) { case 0:reg1=V&0xF;break; case 1:reg2=V&0xF;break; case 2:reg3=V&0xF;break; case 3:reg4=V&0xF;break; } } DECLFW(Mapper225_write) { int banks=0; MIRROR_SET((A>>13)&1); if(A&0x4000) banks=1; else banks=0; VROM_BANK8(((A&0x003f)+(banks<<6))); if(A&0x1000) { if(A&0x40) { ROM_BANK16(0x8000,((((((A>>7)&0x1F)+(banks<<5)))<<1)+1)); ROM_BANK16(0xC000,((((((A>>7)&0x1F)+(banks<<5)))<<1)+1)); } else { ROM_BANK16(0x8000,(((((A>>7)&0x1F)+(banks<<5)))<<1)); ROM_BANK16(0xC000,(((((A>>7)&0x1F)+(banks<<5)))<<1)); } } else { ROM_BANK32(((((A>>7)&0x1F)+(banks<<5)))); } } void Mapper225_init(void) { SetWriteHandler(0x8000,0xffff,Mapper225_write); SetReadHandler(0x5800,0x5fff,A110in1read); SetWriteHandler(0x5800,0x5fff,A110in1regwr); } fceu-0.98.12/src/mappers/226.c0000644000175000000620000000422710003562764015435 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define rg mapbyte1 static void DoPRG(void) { int32 b=((rg[0]>>1)&0xF) | ((rg[0]>>3)&0x10) | ((rg[1]&1)<<5); if(rg[0]&0x20) // 16 KB { ROM_BANK16(0x8000,(b<<1)|(rg[0]&1)); ROM_BANK16(0xC000,(b<<1)|(rg[0]&1)); } else ROM_BANK32(b); } static DECLFW(Mapper226_write) { rg[A&1]=V; DoPRG(); if(A&1) { if(rg[1]&2) PPUCHRRAM=0; // Write protected. else PPUCHRRAM=0xFF; // Not write protected. } else MIRROR_SET2((rg[0]>>6)&1); } static void M26Reset(void) { rg[0]=rg[1]=0; DoPRG(); PPUCHRRAM=0xFF; MIRROR_SET2(0); } static void M26Restore(int version) { DoPRG(); if(rg[1]&2) PPUCHRRAM=0; // Write protected. else PPUCHRRAM=0xFF; // Not write protected. MIRROR_SET2((rg[0]>>6)&1); } void Mapper226_init(void) { SetWriteHandler(0x8000,0xffff,Mapper226_write); MapperReset=M26Reset; GameStateRestore=M26Restore; M26Reset(); } #ifdef OLD // What the heck is this?? DECLFW(Mapper226_write) { MIRROR_SET((A>>13)&1); VROM_BANK8(A&0x7F); if(A&0x1000) { if(A&0x40) { ROM_BANK16(0x8000,(((A>>7))<<1)+1); ROM_BANK16(0xC000,(((A>>7))<<1)+1); } else { ROM_BANK16(0x8000,(((A>>7))<<1)); ROM_BANK16(0xC000,(((A>>7))<<1)); } } else { ROM_BANK32(A>>7); } } void Mapper226_init(void) { SetWriteHandler(0x8000,0xffff,Mapper226_write); } #endif fceu-0.98.12/src/mappers/227.c0000644000175000000620000000313010003562764015426 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define rg mapbyte1 static void DoSync(uint32 A) { int32 p=((A>>3)&0xF) | ((A>>4)&0x10); rg[0]=A; rg[1]=A>>8; MIRROR_SET((A>>1)&1); if(A&1) //32 KB { ROM_BANK32(p); } else //16 KB { ROM_BANK16(0x8000,(p<<1)|((A&4)>>2)); ROM_BANK16(0xc000,(p<<1)|((A&4)>>2)); } if(A&0x80) { PPUCHRRAM=0; } else { PPUCHRRAM=0xFF; if(A&0x200) ROM_BANK16(0xC000,(p<<1)|7); else ROM_BANK16(0xC000,(p<<1)&(~7)); } } static DECLFW(Mapper227_write) { rg[A&1]=V; DoSync(A); } static void M227Reset(void) { rg[0]=rg[1]=0; DoSync(0); } static void M227Restore(int version) { DoSync(rg[0]|(rg[1]<<8)); } void Mapper227_init(void) { SetWriteHandler(0x8000,0xffff,Mapper227_write); MapperReset=M227Reset; GameStateRestore=M227Restore; M227Reset(); } fceu-0.98.12/src/mappers/228.c0000644000175000000620000000251510003562764015435 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(Mapper228_write) { uint32 page,pagel,pageh; MIRROR_SET((A>>13)&1); page=(A>>7)&0x3F; //printf("%04x\n",A); if((page&0x30)==0x30) page-=0x10; pagel=pageh=(page<<1) + (((A>>6)&1)&((A>>5)&1)); pageh+=((A>>5)&1)^1; ROM_BANK16(0x8000,pagel); ROM_BANK16(0xC000,pageh); VROM_BANK8( (V&0x3) | ((A&0xF)<<2) ); } static void A52Reset(void) { Mapper228_write(0,0); } void Mapper228_init(void) { MapperReset=A52Reset; A52Reset(); SetWriteHandler(0x8000,0xffff,Mapper228_write); } fceu-0.98.12/src/mappers/229.c0000644000175000000620000000214010003562764015430 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" DECLFW(Mapper229_write) { if(A>=0x8000) { MIRROR_SET((A>>5)&1); if(!(A&0x1e)) { ROM_BANK32(0); } else { ROM_BANK16(0x8000,A&0x1f); ROM_BANK16(0xC000,A&0x1f); } VROM_BANK8(A); } } void Mapper229_init(void) { SetWriteHandler(0x8000,0xffff,Mapper229_write); } fceu-0.98.12/src/mappers/23.c0000644000175000000620000000523310003562764015346 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define K4buf mapbyte2 #define K4IRQ mapbyte1[1] #define K4sel mapbyte1[0] static int acount=0; static DECLFW(Mapper23_write) { if((A&0xF000)==0x8000) { if(K4sel&2) ROM_BANK8(0xC000,V); else ROM_BANK8(0x8000,V); } else if((A&0xF000)==0xA000) ROM_BANK8(0xA000,V); else { A|=((A>>2)&0x3)|((A>>4)&0x3)|((A>>6)&0x3); A&=0xF003; if(A>=0xb000 && A<=0xe003) { int x=((A>>1)&1)|((A-0xB000)>>11); K4buf[x]&=(0xF0)>>((A&1)<<2); K4buf[x]|=(V&0xF)<<((A&1)<<2); VROM_BANK1(x<<10,K4buf[x]); } else switch(A) { case 0xf000:X6502_IRQEnd(FCEU_IQEXT);IRQLatch&=0xF0;IRQLatch|=V&0xF;break; case 0xf001:X6502_IRQEnd(FCEU_IQEXT);IRQLatch&=0x0F;IRQLatch|=V<<4;break; case 0xf002:X6502_IRQEnd(FCEU_IQEXT);acount=0;IRQCount=IRQLatch;IRQa=V&2;K4IRQ=V&1;break; case 0xf003:X6502_IRQEnd(FCEU_IQEXT);IRQa=K4IRQ;break; case 0x9001: case 0x9002: case 0x9003: if((K4sel&2)!=(V&2)) { uint8 swa; swa=PRGBankList[0]; ROM_BANK8(0x8000,PRGBankList[2]); ROM_BANK8(0xc000,swa); } K4sel=V; break; case 0x9000: switch(V&0x3) { case 0:MIRROR_SET(0);break; case 1:MIRROR_SET(1);break; case 2:onemir(0);break; case 3:onemir(1);break; } break; } } } void FP_FASTAPASS(1) KonamiIRQHook2(int a) { #define LCYCS 341 if(IRQa) { acount+=a*3; if(acount>=LCYCS) { doagainbub:acount-=LCYCS;IRQCount++; if(IRQCount&0x100) {X6502_IRQBegin(FCEU_IQEXT);IRQCount=IRQLatch;} if(acount>=LCYCS) goto doagainbub; } } } void Mapper23_init(void) { SetWriteHandler(0x8000,0xffff,Mapper23_write); MapIRQHook=KonamiIRQHook2; } fceu-0.98.12/src/mappers/232.c0000644000175000000620000000236710003562764015435 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static void DoIt(void) { ROM_BANK16(0x8000,(mapbyte1[1]&3) | ((mapbyte1[0]&0x18)>>1)); ROM_BANK16(0xc000,3|(((mapbyte1[0])&0x18)>>1)); } DECLFW(Mapper232_write) { if(A<=0x9FFF) mapbyte1[0]=V; else mapbyte1[1]=V; DoIt(); } static void QuattroReset(void) { mapbyte1[0]=0x18; DoIt(); } void Mapper232_init(void) { SetWriteHandler(0x6000,0xffff,Mapper232_write); MapperReset=QuattroReset; QuattroReset(); } fceu-0.98.12/src/mappers/234.c0000644000175000000620000000351010003562764015426 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define r1 mapbyte1[0] #define r2 mapbyte1[1] static void DoBS(void) { if(r1&0x40) { ROM_BANK32((r1&0xE)|(r2&1)); VROM_BANK8( ((r1&0xE)<<2) | ((r2>>4)&7) ); } else { ROM_BANK32(r1&0xF); VROM_BANK8( ((r1&0xF)<<2) | ((r2>>4)&3) ); } } static void R1Set(uint8 V) { if(r1) return; r1=V; MIRROR_SET(V>>7); DoBS(); } static void R2Set(uint8 V) { r2=V; DoBS(); } DECLFW(R1W) { R1Set(V); } DECLFR(R1R) { uint8 r=CartBR(A); R1Set(r); return r; } DECLFW(R2W) { R2Set(V); } DECLFR(R2R) { uint8 r=CartBR(A); R2Set(r); return r; } static void M15Restore(int version) { DoBS(); MIRROR_SET(r1>>7); } static void M15Reset(void) { r1=r2=0; DoBS(); MIRROR_SET(0); } void Mapper234_init(void) { SetWriteHandler(0xff80,0xff9f,R1W); SetReadHandler(0xff80,0xff9f,R1R); SetWriteHandler(0xffe8,0xfff7,R2W); SetReadHandler(0xffe8,0xfff7,R2R); SetReadHandler(0x6000,0x7FFF,0); SetWriteHandler(0x6000,0x7FFF,0); M15Reset(); GameStateRestore=M15Restore; MapperReset=M15Reset; } fceu-0.98.12/src/mappers/240.c0000644000175000000620000000205710003562764015430 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" DECLFW(Mapper240_write) { if(A<0x8000) { ROM_BANK32(V>>4); VROM_BANK8(V&0xF); } } void Mapper240_init(void) { SetWriteHandler(0x4020,0x5fff,Mapper240_write); SetWriteHandler(0x8000,0xffff,Mapper240_write); } fceu-0.98.12/src/mappers/242.c0000644000175000000620000000216610003562764015433 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" DECLFW(Mapper242_write) { ROM_BANK32((A>>3)&0xF); switch(V&3) { case 0:MIRROR_SET(0);break; case 1:MIRROR_SET(1);break; case 2:onemir(0);break; case 3:onemir(1);break; } } void Mapper242_init(void) { ROM_BANK32(0); SetWriteHandler(0x8000,0xffff,Mapper242_write); } fceu-0.98.12/src/mappers/246.c0000644000175000000620000000251510003562764015435 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" DECLFW(Mapper246_write) { switch(A&0xF007) { case 0x6000:ROM_BANK8(0x8000,V);break; case 0x6001:ROM_BANK8(0xA000,V);break; case 0x6002:ROM_BANK8(0xC000,V);break; case 0x6003:ROM_BANK8(0xE000,V);break; case 0x6004:VROM_BANK2(0x0000,V);break; case 0x6005:VROM_BANK2(0x0800,V);break; case 0x6006:VROM_BANK2(0x1000,V);break; case 0x6007:VROM_BANK2(0x1800,V);break; } } void Mapper246_init(void) { SetWriteHandler(0x4020,0x67ff,Mapper246_write); SetWriteHandler(0x8000,0xffff,Mapper246_write); } fceu-0.98.12/src/mappers/248.c0000644000175000000620000000425710003562764015444 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define cmd mapbyte1[0] #define lpa mapbyte1[1] #define prgl mapbyte2 static void PRGSynco(void) { if(lpa&0x80) { ROM_BANK16(0x8000,lpa&0xF); } else { ROM_BANK8(0x8000,prgl[0]&0x1F); ROM_BANK8(0xa000,prgl[1]&0x1F); } } static DECLFW(Mapper248_writelow) { lpa=V; PRGSynco(); } static DECLFW(Mapper248_write) { switch(A&0xF001) { case 0xa000:MIRROR_SET(V&1);break; // Not sure if this is right. Mirroring may be hard wired... case 0xc000:IRQLatch=V;break; case 0xc001:IRQCount=IRQLatch;break; case 0xe000:IRQa=0;X6502_IRQEnd(FCEU_IQEXT);break; case 0xe001:IRQa=1;break; case 0x8000:cmd=V;break; case 0x8001:switch(cmd&7) { case 0:VROM_BANK2(0x000,V>>1);break; case 1:VROM_BANK2(0x800,V>>1);break; case 2:VROM_BANK1(0x1000,V);break; case 3:VROM_BANK1(0x1400,V);break; case 4:VROM_BANK1(0x1800,V);break; case 5:VROM_BANK1(0x1c00,V);break; case 6:prgl[0]=V;PRGSynco();break; case 7:prgl[1]=V;PRGSynco();break; } break; } } static void Mapper248_hb(void) { if(IRQa) { IRQCount--; if(IRQCount<0) { X6502_IRQBegin(FCEU_IQEXT); IRQCount=IRQLatch; } } } void Mapper248_init(void) { SetWriteHandler(0x6000,0x6fff,Mapper248_writelow); SetWriteHandler(0x8000,0xffff,Mapper248_write); GameHBIRQHook=Mapper248_hb; } fceu-0.98.12/src/mappers/25.c0000644000175000000620000000512410003562764015347 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define K4buf mapbyte2 #define K4IRQ mapbyte1[1] #define K4sel mapbyte1[0] static int acount=0; static DECLFW(Mapper25_write) { A=(A&0xF003)|((A&0xC)>>2); if((A&0xF000)==0xA000) ROM_BANK8(0xA000,V); else if(A>=0xB000 && A<=0xEFFF) { int x=(A&1)|((A-0xB000)>>11); K4buf[x]&=(0xF0)>>((A&2)<<1); K4buf[x]|=(V&0xF)<<((A&2)<<1); VROM_BANK1(x<<10,K4buf[x]); } else if((A&0xF000)==0x8000) { if(K4sel&2) ROM_BANK8(0xC000,V); else ROM_BANK8(0x8000,V); } else switch(A) { case 0x9000:switch(V&0x3) { case 0:MIRROR_SET(0);break; case 1:MIRROR_SET(1);break; case 2:onemir(0);break; case 3:onemir(1);break; } break; case 0x9001:if((K4sel&2)!=(V&2)) { uint8 swa; swa=PRGBankList[0]; ROM_BANK8(0x8000,PRGBankList[2]); ROM_BANK8(0xc000,swa); } K4sel=V; break; case 0xf000:IRQLatch&=0xF0;IRQLatch|=V&0xF;break; case 0xf002:IRQLatch&=0x0F;IRQLatch|=V<<4;break; case 0xf001:IRQCount=IRQLatch;IRQa=V&2;K4IRQ=V&1;acount=0;X6502_IRQEnd(FCEU_IQEXT);break; case 0xf003:IRQa=K4IRQ;X6502_IRQEnd(FCEU_IQEXT);break; } } static void FP_FASTAPASS(1) KonamiIRQHook(int a) { // #define LCYCS ((227*2)) #define LCYCS 341 if(IRQa) { acount+=a*3; // acount+=a*4; if(acount>=LCYCS) { doagainbub:acount-=LCYCS;IRQCount++; if(IRQCount&0x100) {//acount=0; X6502_IRQBegin(FCEU_IQEXT);IRQCount=IRQLatch; } if(acount>=LCYCS) goto doagainbub; } } } void Mapper25_init(void) { SetWriteHandler(0x8000,0xffff,Mapper25_write); MapIRQHook=KonamiIRQHook; } fceu-0.98.12/src/mappers/32.c0000644000175000000620000000303410003562764015343 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define IREMCon mapbyte1[0] static DECLFW(Mapper32_write) { switch(A>>12) { case 0x8: mapbyte1[1]=V; if(IREMCon) {ROM_BANK8(0xc000,V);ROM_BANK8(0x8000,~1);} else {ROM_BANK8(0x8000,V);ROM_BANK8(0xc000,~1);} break; case 0x9:IREMCon=(V>>1)&1; if(IREMCon) {ROM_BANK8(0xc000,mapbyte1[1]);ROM_BANK8(0x8000,~1);} else {ROM_BANK8(0x8000,mapbyte1[1]); ROM_BANK8(0xc000,~1);} MIRROR_SET(V&1); break; case 0xa:ROM_BANK8(0xA000,V); break; } if((A&0xF000)==0xb000) VROM_BANK1((A&0x7)<<10,V); } void Mapper32_init(void) { ROM_BANK16(0x8000,0); ROM_BANK16(0xc000,~0); SetWriteHandler(0x8000,0xffff,Mapper32_write); } fceu-0.98.12/src/mappers/33.c0000644000175000000620000000366310003562764015354 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static int is48; static DECLFW(Mapper33_write) { A&=0xF003; if(A>=0xA000 && A<=0xA003) VROM_BANK1(0x1000+((A&3)<<10),V); else switch(A) { case 0x8000:if(!is48) MIRROR_SET((V>>6)&1); ROM_BANK8(0x8000,V); break; case 0x8001:ROM_BANK8(0xA000,V); break; case 0x8002:VROM_BANK2(0x0000,V);break; case 0x8003:VROM_BANK2(0x0800,V);break; } } static DECLFW(Mapper48_HiWrite) { switch(A&0xF003) { case 0xc000:IRQLatch=V;break; case 0xc001:IRQCount=IRQLatch;break; case 0xc003:IRQa=0;X6502_IRQEnd(FCEU_IQEXT);break; case 0xc002:IRQa=1;break; case 0xe000:MIRROR_SET((V>>6)&1);break; } } static void heho(void) { if(IRQa) { IRQCount++; if(IRQCount==0x100) { X6502_IRQBegin(FCEU_IQEXT); IRQa=0; } } } void Mapper33_init(void) { SetWriteHandler(0x8000,0xffff,Mapper33_write); is48=0; } void Mapper48_init(void) { SetWriteHandler(0x8000,0xffff,Mapper33_write); SetWriteHandler(0xc000,0xffff,Mapper48_HiWrite); GameHBIRQHook=heho; is48=1; } fceu-0.98.12/src/mappers/40.c0000644000175000000620000000266010003562764015346 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(Mapper40_write) { switch(A&0xe000) { case 0x8000:IRQa=0;IRQCount=0;X6502_IRQEnd(FCEU_IQEXT);break; case 0xa000:IRQa=1;break; case 0xe000:ROM_BANK8(0xc000,V&7);break; } } static void FP_FASTAPASS(1) Mapper40IRQ(int a) { if(IRQa) { if(IRQCount<4096) IRQCount+=a; else { IRQa=0; X6502_IRQBegin(FCEU_IQEXT); } } } void Mapper40_init(void) { ROM_BANK8(0x6000,(~0)-1); ROM_BANK8(0x8000,(~0)-3); ROM_BANK8(0xa000,(~0)-2); SetWriteHandler(0x8000,0xffff,Mapper40_write); SetReadHandler(0x6000,0x7fff,CartBR); MapIRQHook=Mapper40IRQ; } fceu-0.98.12/src/mappers/41.c0000644000175000000620000000251710003562764015350 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define calreg mapbyte1[0] #define calchr mapbyte1[1] DECLFW(Mapper41_write) { if(A<0x8000) { ROM_BANK32(A&7); MIRROR_SET((A>>5)&1); calreg=A; calchr&=0x3; calchr|=(A>>1)&0xC; VROM_BANK8(calchr); } else if(calreg&0x4) { calchr&=0xC; calchr|=A&3; VROM_BANK8(calchr); } } static void M41Reset(void) { calreg=calchr=0; } void Mapper41_init(void) { MapperReset=M41Reset; ROM_BANK32(0); SetWriteHandler(0x8000,0xffff,Mapper41_write); SetWriteHandler(0x6000,0x67ff,Mapper41_write); } fceu-0.98.12/src/mappers/42.c0000644000175000000620000000312110003562764015341 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(Mapper42_write) { switch(A&0xe003) { case 0xe000:mapbyte1[0]=V;ROM_BANK8(0x6000,V&0xF);break; case 0xe001:MIRROR_SET((V>>3)&1);break; case 0xe002:IRQa=V&2;if(!IRQa) IRQCount=0;X6502_IRQEnd(FCEU_IQEXT);break; } } static void FP_FASTAPASS(1) Mapper42IRQ(int a) { if(IRQa) { IRQCount+=a; if(IRQCount>=32768) IRQCount-=32768; if(IRQCount>=24576) X6502_IRQBegin(FCEU_IQEXT); else X6502_IRQEnd(FCEU_IQEXT); } } static void Mapper42_StateRestore(int version) { ROM_BANK8(0x6000,mapbyte1[0]&0xF); } void Mapper42_init(void) { ROM_BANK8(0x6000,0); ROM_BANK32(~0); SetWriteHandler(0x6000,0xffff,Mapper42_write); SetReadHandler(0x6000,0x7fff,CartBR); MapStateRestore=Mapper42_StateRestore; MapIRQHook=Mapper42IRQ; } fceu-0.98.12/src/mappers/43.c0000644000175000000620000000331010003562764015342 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(Mapper43_write) { //printf("$%04x:$%02x\n",A,V); if((A&0x8122)==0x8122) { X6502_IRQEnd(FCEU_IQEXT); if(V&2) IRQa=1; else IRQCount=IRQa=0; } } static DECLFW(M43Low) { int transo[8]={4,3,4,4,4,7,5,6}; A&=0xF0FF; if(A==0x4022) setprg8(0x6000,transo[V&7]); //printf("$%04x:$%02x\n",A,V); } static void FP_FASTAPASS(1) M43Ho(int a) { IRQCount+=a; if(IRQa) if(IRQCount>=4096) { X6502_IRQBegin(FCEU_IQEXT); } } //static DECLFR(boo) //{ // printf("$%04x\n",A); // return( ROM[0x2000*8 +0x1000 +(A-0x5000)]); //} void Mapper43_init(void) { setprg4(0x5000,16); setprg8(0x6000,2); setprg8(0x8000,1); setprg8(0xa000,0); setprg8(0xc000,4); setprg8(0xe000,9); SetWriteHandler(0x8000,0xffff,Mapper43_write); SetWriteHandler(0x4020,0x7fff,M43Low); //SetReadHandler(0x5000,0x5fff,boo); SetReadHandler(0x6000,0xffff,CartBR); MapIRQHook=M43Ho; } fceu-0.98.12/src/mappers/46.c0000644000175000000620000000245110003562764015352 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define A64reg mapbyte1[0] #define A64wr mapbyte1[1] DECLFW(Mapper46_writel) { A64reg=V; ROM_BANK32((A64wr&1)+((A64reg&0xF)<<1)); VROM_BANK8(((A64wr>>4)&7)+((A64reg&0xF0)>>1)); } DECLFW(Mapper46_write) { A64wr=V; ROM_BANK32((V&1)+((A64reg&0xF)<<1)); VROM_BANK8(((V>>4)&7)+((A64reg&0xF0)>>1)); } void Mapper46_init(void) { MIRROR_SET(0); ROM_BANK32(0); SetWriteHandler(0x8000,0xffff,Mapper46_write); SetWriteHandler(0x6000,0x7fff,Mapper46_writel); } fceu-0.98.12/src/mappers/51.c0000644000175000000620000000306210003562764015345 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define mode mapbyte1[0] #define page mapbyte1[1] static uint32 Get8K(uint32 A) { uint32 bank; bank=(page<<2)|((A>>13)&1); if(A&0x4000 && !(mode&1)) bank|=0xC; if(!(A&0x8000)) bank|=0x20; if(mode==2) bank|=2; else bank|=(A>>13)&2; return(bank); } static void Synco(void) { uint32 x; if(mapbyte1[0]<=2) MIRROR_SET2(1); else MIRROR_SET2(0); for(x=0x6000;x<0x10000;x+=8192) ROM_BANK8(x,Get8K(x)); } static DECLFW(Write) { if(A&0x8000) mapbyte1[1]=V&0xF; else mapbyte1[0]=(mapbyte1[0]&2)|((V>>1)&1); if(A&0x4000) mapbyte1[0]=(mapbyte1[0]&1)|((V>>3)&2); Synco(); } void Mapper51_init(void) { SetWriteHandler(0x6000,0xFFFF,Write); SetReadHandler(0x6000,0xFFFF,CartBR); mapbyte1[0]=1; mapbyte1[1]=0; Synco(); } fceu-0.98.12/src/mappers/6.c0000644000175000000620000000447210003562764015273 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define FVRAM_BANK8(A,V) {VPage[0]=VPage[1]=VPage[2]=VPage[3]=VPage[4]=VPage[5]=VPage[6]=VPage[7]=V?&MapperExRAM[(V)<<13]-(A):&CHRRAM[(V)<<13]-(A);CHRBankList[0]=((V)<<3);CHRBankList[1]=((V)<<3)+1;CHRBankList[2]=((V)<<3)+2;CHRBankList[3]=((V)<<3)+3;CHRBankList[4]=((V)<<3)+4;CHRBankList[5]=((V)<<3)+5;CHRBankList[6]=((V)<<3)+6;CHRBankList[7]=((V)<<3)+7;PPUCHRRAM=0xFF;} static void FP_FASTAPASS(1) FFEIRQHook(int a) { if(IRQa) { IRQCount+=a; if(IRQCount>=0x10000) { X6502_IRQBegin(FCEU_IQEXT); IRQa=0; IRQCount=0; } } } DECLFW(Mapper6_write) { if(A<0x8000) { switch(A){ case 0x42FF:MIRROR_SET((V>>4)&1);break; case 0x42FE:onemir((V>>3)&2);break; case 0x4501:IRQa=0;X6502_IRQEnd(FCEU_IQEXT);break; case 0x4502:IRQCount&=0xFF00;IRQCount|=V;break; case 0x4503:IRQCount&=0xFF;IRQCount|=V<<8;IRQa=1;break; } } else { ROM_BANK16(0x8000,V>>2); FVRAM_BANK8(0x0000,V&3); } } void Mapper6_StateRestore(int version) { int x; for(x=0;x<8;x++) if(PPUCHRRAM&(1<7) VPage[x]=&MapperExRAM[(CHRBankList[x]&31)*0x400]-(x*0x400); else VPage[x]=&CHRRAM[(CHRBankList[x]&7)*0x400]-(x*0x400); } } void Mapper6_init(void) { MapIRQHook=FFEIRQHook; ROM_BANK16(0xc000,7); SetWriteHandler(0x4020,0x5fff,Mapper6_write); SetWriteHandler(0x8000,0xffff,Mapper6_write); MapStateRestore=Mapper6_StateRestore; } fceu-0.98.12/src/mappers/65.c0000644000175000000620000000421710003562764015355 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" void FP_FASTAPASS(1) IREMIRQHook(int a) { if(IRQa) { IRQCount-=a; if(IRQCount<-4) { X6502_IRQBegin(FCEU_IQEXT); IRQa=0; IRQCount=0xFFFF; } } } static DECLFW(Mapper65_write) { //if(A>=0x9000 && A<=0x9006) // printf("$%04x:$%02x, %d\n",A,V,scanline); switch(A) { //default: printf("$%04x:$%02x\n",A,V); // break; case 0x8000:ROM_BANK8(0x8000,V);break; // case 0x9000:printf("$%04x:$%02x\n",A,V);MIRROR_SET2((V>>6)&1);break; case 0x9001:MIRROR_SET(V>>7);break; case 0x9003:IRQa=V&0x80;X6502_IRQEnd(FCEU_IQEXT);break; case 0x9004:IRQCount=IRQLatch;break; case 0x9005: IRQLatch&=0x00FF; IRQLatch|=V<<8; break; case 0x9006: IRQLatch&=0xFF00;IRQLatch|=V; break; case 0xB000:VROM_BANK1(0x0000,V);break; case 0xB001:VROM_BANK1(0x0400,V);break; case 0xB002:VROM_BANK1(0x0800,V);break; case 0xB003:VROM_BANK1(0x0C00,V);break; case 0xB004:VROM_BANK1(0x1000,V);break; case 0xB005:VROM_BANK1(0x1400,V);break; case 0xB006:VROM_BANK1(0x1800,V);break; case 0xB007:VROM_BANK1(0x1C00,V);break; case 0xa000:ROM_BANK8(0xA000,V);break; case 0xC000:ROM_BANK8(0xC000,V);break; } //MIRROR_SET2(1); } void Mapper65_init(void) { MapIRQHook=IREMIRQHook; SetWriteHandler(0x8000,0xffff,Mapper65_write); } fceu-0.98.12/src/mappers/67.c0000644000175000000620000000360010003562764015352 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define suntoggle mapbyte1[0] static DECLFW(Mapper67_write) { A&=0xF800; if((A&0x800) && A<=0xb800) { VROM_BANK2((A-0x8800)>>1,V); } else switch(A) { case 0xc800: case 0xc000:if(!suntoggle) { IRQCount&=0xFF; IRQCount|=V<<8; } else { IRQCount&=0xFF00; IRQCount|=V; } suntoggle^=1; break; case 0xd800:suntoggle=0;IRQa=V&0x10;X6502_IRQEnd(FCEU_IQEXT);break; case 0xe800:switch(V&3) { case 0:MIRROR_SET2(1);break; case 1:MIRROR_SET2(0);break; case 2:onemir(0);break; case 3:onemir(1);break; } break; case 0xf800:ROM_BANK16(0x8000,V);break; } } static void FP_FASTAPASS(1) SunIRQHook(int a) { if(IRQa) { IRQCount-=a; if(IRQCount<=0) { X6502_IRQBegin(FCEU_IQEXT); IRQa=0; IRQCount=0xFFFF; } } } void Mapper67_init(void) { SetWriteHandler(0x8000,0xffff,Mapper67_write); MapIRQHook=SunIRQHook; } fceu-0.98.12/src/mappers/68.c0000644000175000000620000000552610003562764015364 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static void Fixerit(void) { switch(mapbyte2[0]&3) { case 0:vnapage[0]=vnapage[2]=CHRptr[0]+(((mapbyte1[0]|128)&CHRmask1[0])<<10); vnapage[1]=vnapage[3]=CHRptr[0]+(((mapbyte1[1]|128)&CHRmask1[0])<<10); break; case 1:vnapage[0]=vnapage[1]=CHRptr[0]+(((mapbyte1[0]|128)&CHRmask1[0])<<10); vnapage[2]=vnapage[3]=CHRptr[0]+(((mapbyte1[1]|128)&CHRmask1[0])<<10); break; case 2:vnapage[0]=vnapage[1]=vnapage[2]=vnapage[3]=CHRptr[0]+(((mapbyte1[0]|128)&CHRmask1[0])<<10); break; case 3:vnapage[0]=vnapage[1]=vnapage[2]=vnapage[3]=CHRptr[0]+(((mapbyte1[1]|128)&CHRmask1[0])<<10); break; } } DECLFW(Mapper68_write) { A&=0xF000; if(A>=0x8000 && A<=0xB000) { VROM_BANK2((A-0x8000)>>1,V); } else switch(A) { case 0xc000:mapbyte1[0]=V; if(VROM_size && mapbyte2[0]&0x10) Fixerit(); break; case 0xd000:mapbyte1[1]=V; if(VROM_size && mapbyte2[0]&0x10) Fixerit(); break; case 0xe000: mapbyte2[0]=V; if(!(V&0x10)) { switch(V&3) { case 0:MIRROR_SET2(1);break; case 1:MIRROR_SET2(0);break; case 2:onemir(0);break; case 3:onemir(1);break; } } else if(VROM_size) { Fixerit(); PPUNTARAM=0; } break; case 0xf000: ROM_BANK16(0x8000,V);break; } } static void Mapper68_StateRestore(int version) { if(!(mapbyte2[0]&0x10)) { switch(mapbyte2[0]&3) { case 0:MIRROR_SET(0);break; case 1:MIRROR_SET(1);break; case 2:onemir(0);break; case 3:onemir(1);break; } } else if(VROM_size) { Fixerit(); PPUNTARAM=0; } } void Mapper68_init(void) { SetWriteHandler(0x8000,0xffff,Mapper68_write); MapStateRestore=Mapper68_StateRestore; } fceu-0.98.12/src/mappers/71.c0000644000175000000620000000211210003562764015342 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" DECLFW(Mapper71_write) { switch(A&0xF000) { case 0xF000: case 0xE000: case 0xD000: case 0xC000:ROM_BANK16(0x8000,V);break; case 0x9000:onemir((V>>3)&2);break; } } void Mapper71_init(void) { SetWriteHandler(0x4020,0xffff,Mapper71_write); } fceu-0.98.12/src/mappers/72.c0000644000175000000620000000202410003562764015345 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" DECLFW(Mapper72_write) { mapbyte1[0]=V; if(V&0x80) ROM_BANK16(0x8000,V&0xF); if(V&0x40) VROM_BANK8(V&0xF); } void Mapper72_init(void) { SetWriteHandler(0x6000,0xffff,Mapper72_write); } fceu-0.98.12/src/mappers/73.c0000644000175000000620000000317010003562764015351 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(Mapper73_write) { //if(A>=0xd000 && A<=0xdfff) X6502_IRQEnd(FCEU_IQEXT); /* How are IRQs acknowledged on this chip? */ switch(A&0xF000) { //default: printf("$%04x:$%02x\n",A,V);break; case 0x8000:IRQCount&=0xFFF0;IRQCount|=(V&0xF);break; case 0x9000:IRQCount&=0xFF0F;IRQCount|=(V&0xF)<<4;break; case 0xa000:IRQCount&=0xF0FF;IRQCount|=(V&0xF)<<8;break; case 0xb000:IRQCount&=0x0FFF;IRQCount|=(V&0xF)<<12;break; case 0xc000:IRQa=V&2;break; case 0xf000:ROM_BANK16(0x8000,V);break; } } static void FP_FASTAPASS(1) Mapper73IRQHook(int a) { if(IRQa) { IRQCount+=a; if(IRQCount>=0xFFFF) { IRQCount&=0xFFFF; IRQa=0; X6502_IRQBegin(FCEU_IQEXT); } } } void Mapper73_init(void) { SetWriteHandler(0x8000,0xffff,Mapper73_write); MapIRQHook=Mapper73IRQHook; } fceu-0.98.12/src/mappers/75.c0000644000175000000620000000271410003562764015356 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define map75sel mapbyte1[0] #define map75ar mapbyte2 DECLFW(Mapper75_write) { switch(A&0xF000) { case 0x8000:ROM_BANK8(0x8000,V);break; case 0x9000: VROM_BANK4(0x0000,map75ar[0]|((V&2)<<3)); VROM_BANK4(0x1000,map75ar[1]|((V&4)<<2)); map75sel=V;MIRROR_SET(V&1);break; case 0xa000:ROM_BANK8(0xa000,V);break; case 0xc000:ROM_BANK8(0xc000,V);break; case 0xe000:V&=0xF;map75ar[0]=V;V|=(map75sel&2)<<3;VROM_BANK4(0x0000,V);break; case 0xf000:V&=0xF;map75ar[1]=V;V|=(map75sel&4)<<2;VROM_BANK4(0x1000,V);break; } } void Mapper75_init(void) { SetWriteHandler(0x8000,0xffff,Mapper75_write); } fceu-0.98.12/src/mappers/76.c0000644000175000000620000000317610003562764015362 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(Mapper76_write) { switch(A&0xE001){ case 0x8000: MMC3_cmd = V; break; case 0x8001: switch(MMC3_cmd&0x07){ case 2: VROM_BANK2(0x000,V);break; case 3: VROM_BANK2(0x800,V);break; case 4: VROM_BANK2(0x1000,V);break; case 5: VROM_BANK2(0x1800,V);break; case 6: if (MMC3_cmd&0x40) ROM_BANK8(0xC000,V); else ROM_BANK8(0x8000,V); break; case 7: ROM_BANK8(0xA000,V); break; } break; case 0xA000: MIRROR_SET(V&1); break; } } void Mapper76_init(void) { SetWriteHandler(0x8000,0xffff,Mapper76_write); } fceu-0.98.12/src/mappers/77.c0000644000175000000620000000254610051213437015354 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" /* Original code provided by LULU */ static DECLFW(Mapper77_write) { mapbyte1[0]=V; ROM_BANK32(V&0x7); VROM_BANK2(0x0000, (V&0xf0)>>4); } static void Mapper77_StateRestore(int version) { int x; if(version>=7200) { ROM_BANK32(mapbyte1[0]&0x7); VROM_BANK2(0x0000, (mapbyte1[0]&0xf0)>>4); } for(x=2;x<8;x++) VRAM_BANK1(x*0x400,x); } void Mapper77_init(void) { int x; ROM_BANK32(0); for(x=2;x<8;x++) VRAM_BANK1(x*0x400,x); SetWriteHandler(0x6000,0xffff,Mapper77_write); MapStateRestore=Mapper77_StateRestore; } fceu-0.98.12/src/mappers/79.c0000644000175000000620000000211410003562764015354 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" DECLFW(Mapper79_write) { if(A<0x8000 && ((A^0x4100)==0)) { ROM_BANK32((V>>3)&1); } VROM_BANK8(V); } void Mapper79_init(void) { ROM_BANK32(~0); SetWriteHandler(0x8000,0xffff,Mapper79_write); SetWriteHandler(0x4020,0x5fff,Mapper79_write); } fceu-0.98.12/src/mappers/8.c0000644000175000000620000000201710003562764015266 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(Mapper8_write) { ROM_BANK16(0x8000,V>>3); VROM_BANK8(V&7); } void Mapper8_init(void) { ROM_BANK32(0); SetWriteHandler(0x8000,0xFFFF,Mapper8_write); } fceu-0.98.12/src/mappers/80.c0000644000175000000620000000431210003562764015346 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static uint32 lastA; static int isfu; static uint8 CCache[8]; static void FP_FASTAPASS(1) Fudou_PPU(uint32 A) { static int last=-1; static uint8 z; if(A>=0x2000) return; A>>=10; lastA=A; z=CCache[A]; if(z!=last) { onemir(z); last=z; } } static void mira() { if(isfu) { int x; CCache[0]=CCache[1]=mapbyte2[0]>>7; CCache[2]=CCache[3]=mapbyte2[1]>>7; for(x=0;x<4;x++) CCache[4+x]=mapbyte2[2+x]>>7; onemir(CCache[lastA]); } else MIRROR_SET2(mapbyte1[0]&1); } static DECLFW(Mapper80_write) { switch(A) { case 0x7ef0: mapbyte2[0]=V;VROM_BANK2(0x0000,(V>>1)&0x3F);mira();break; case 0x7ef1: mapbyte2[1]=V;VROM_BANK2(0x0800,(V>>1)&0x3f);mira();break; case 0x7ef2: mapbyte2[2]=V;VROM_BANK1(0x1000,V);mira();break; case 0x7ef3: mapbyte2[3]=V;VROM_BANK1(0x1400,V);mira();break; case 0x7ef4: mapbyte2[4]=V;VROM_BANK1(0x1800,V);mira();break; case 0x7ef5: mapbyte2[5]=V;VROM_BANK1(0x1c00,V);mira();break; case 0x7ef6: mapbyte1[0]=V;mira();break; case 0x7efa: case 0x7efb: ROM_BANK8(0x8000,V);break; case 0x7efd: case 0x7efc: ROM_BANK8(0xA000,V);break; case 0x7efe: case 0x7eff: ROM_BANK8(0xC000,V);break; } } static void booga(int version) { mira(); } void Mapper80_init(void) { SetWriteHandler(0x4020,0x7fff,Mapper80_write); MapStateRestore=booga; isfu=0; } void Mapper207_init(void) { Mapper80_init(); isfu=1; PPU_hook=Fudou_PPU; } fceu-0.98.12/src/mappers/82.c0000644000175000000620000000306110003562764015350 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define ctrl mapbyte1[6] static void DoCHR(void) { int x; for(x=0;x<2;x++) VROM_BANK2((x<<11)|((ctrl&2)<<11),mapbyte1[x]>>1); for(x=0;x<4;x++) VROM_BANK1((x<<10) | (((ctrl&2)^2)<<11),mapbyte1[2+x]); } static DECLFW(Mapper82_write) { if(A<=0x7EF5) { mapbyte1[A&7]=V; DoCHR(); } else switch(A) { case 0x7ef6:ctrl=V&3; MIRROR_SET2(V&1); DoCHR(); break; case 0x7efa:V>>=2;mapbyte2[0]=V;ROM_BANK8(0x8000,V);break; case 0x7efb:V>>=2;mapbyte2[1]=V;ROM_BANK8(0xa000,V);break; case 0x7efc:V>>=2;mapbyte2[2]=V;ROM_BANK8(0xc000,V);break; } } void Mapper82_init(void) { ROM_BANK8(0xE000,~0); /* external WRAM might end at $73FF */ SetWriteHandler(0x7ef0,0x7efc,Mapper82_write); } fceu-0.98.12/src/mappers/83.c0000644000175000000620000000550110110477063015346 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" void Mapper83_init(void) { } #ifdef MOOCOW static void FP_FASTAPASS(1) m83IRQHook(int a) { if(IRQa) { IRQCount-=a; if(IRQCount<0) { X6502_IRQBegin(FCEU_IQEXT); IRQa=0; IRQCount=0xFFFF; } } } static DECLFW(wrlow) { mapbyte4[A&3]=V; } static DECLFR(rdlow) { return mapbyte4[A&3]; } static void m83prg(void) { ROM_BANK16(0x8000,(mapbyte1[0]&0x3F)); ROM_BANK16(0xC000,(mapbyte1[0]&0x30)|0xF); } static void m83chr(void) { int x; for(x=0;x<8;x++) VROM_BANK1(x*0x400,mapbyte2[x]|((mapbyte1[0]&0x30)<<4)); } static DECLFW(Mapper83_write) { //printf("$%04x:$%02x\n",A,V); switch(A) { case 0x8000: case 0xB000: case 0xB0FF: case 0xB1FF: { mapbyte1[0]=V; m83prg(); m83chr(); } break; case 0x8100: switch(V&0x3) { case 0x00:MIRROR_SET2(1);break; case 0x01:MIRROR_SET2(0);break; case 0x02:onemir(0);break; case 0x03:onemir(1);break; } break; case 0x8200:IRQCount&=0xFF00;IRQCount|=V;X6502_IRQEnd(FCEU_IQEXT);break; case 0x8201:IRQa=1;IRQCount&=0xFF;IRQCount|=V<<8;break; case 0x8300:ROM_BANK8(0x8000,V);break; case 0x8301:ROM_BANK8(0xA000,V);break; case 0x8302:ROM_BANK8(0xC000,V);break; case 0x8310:mapbyte2[0]=V;m83chr();break; case 0x8311:mapbyte2[1]=V;m83chr();break; case 0x8312:mapbyte2[2]=V;m83chr();break; case 0x8313:mapbyte2[3]=V;m83chr();break; case 0x8314:mapbyte2[4]=V;m83chr();break; case 0x8315:mapbyte2[5]=V;m83chr();break; case 0x8316:mapbyte2[6]=V;m83chr();break; case 0x8317:mapbyte2[7]=V;m83chr();break; case 0x8318:mapbyte1[1]=V;m83prg();break; } // printf("$%04x:$%02x, $%04x\n",A,V,X.PC.W); } void Mapper83_init(void) { ROM_BANK8(0xc000,0x1e); ROM_BANK8(0xe000,0x1f); // MapIRQHook=m83IRQHook; // SetReadHandler(0x5100,0x5103,rdlow); // SetWriteHandler(0x5100,0x5103,wrlow); SetWriteHandler(0x8000,0xffff,Mapper83_write); mapbyte1[1]=0xF; } #endif fceu-0.98.12/src/mappers/85.c0000644000175000000620000001024010105557612015347 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define vrctemp mapbyte1[0] static uint8 indox; #include "emu2413.h" static int acount=0; static OPLL *VRC7Sound=NULL; static int dwave=0; void DoVRC7Sound(void) { int32 z,a; if(FSettings.soundq>=1) return; z=((SOUNDTS<<16)/soundtsinc)>>4; a=z-dwave; moocow(VRC7Sound, &Wave[dwave], a, 1); dwave+=a; } void UpdateOPLNEO(int32 *Wave, int Count) { moocow(VRC7Sound, Wave, Count, 4); } void UpdateOPL(int Count) { int32 z,a; z=((SOUNDTS<<16)/soundtsinc)>>4; a=z-dwave; if(VRC7Sound && a) moocow(VRC7Sound, &Wave[dwave], a, 1); dwave=0; } static INLINE void DaMirror(int V) { int salpo[4]={MI_V,MI_H,MI_0,MI_1}; setmirror(salpo[V&3]); } DECLFW(Mapper85_write) { A|=(A&8)<<1; if(A>=0xa000 && A<=0xDFFF) { // printf("$%04x, $%04x\n",X.PC,A); A&=0xF010; { int x=((A>>4)&1)|((A-0xA000)>>11); mapbyte3[x]=V; setchr1(x<<10,V); } } else if(A==0x9030) { if(FSettings.SndRate) { OPLL_writeReg(VRC7Sound, indox, V); GameExpSound.Fill=UpdateOPL; GameExpSound.NeoFill=UpdateOPLNEO; } } else switch(A&0xF010) { case 0x8000:mapbyte2[0]=V;setprg8(0x8000,V);break; case 0x8010:mapbyte2[1]=V;setprg8(0xa000,V);break; case 0x9000:mapbyte2[2]=V;setprg8(0xc000,V);break; case 0x9010:indox=V;break; case 0xe000:mapbyte2[3]=V;DaMirror(V);break; case 0xE010:IRQLatch=V; X6502_IRQEnd(FCEU_IQEXT); break; case 0xF000:IRQa=V&2; vrctemp=V&1; if(V&2) {IRQCount=IRQLatch;} acount=0; X6502_IRQEnd(FCEU_IQEXT); break; case 0xf010:if(vrctemp) IRQa=1; else IRQa=0; X6502_IRQEnd(FCEU_IQEXT); break; } } static void FP_FASTAPASS(1) KonamiIRQHook(int a) { #define ACBOO 341 // #define ACBOO ((227*2)+1) if(IRQa) { acount+=a*3; if(acount>=ACBOO) { doagainbub:acount-=ACBOO; IRQCount++; if(IRQCount&0x100) {X6502_IRQBegin(FCEU_IQEXT);IRQCount=IRQLatch;} if(acount>=ACBOO) goto doagainbub; } } } void Mapper85_StateRestore(int version) { int x; if(version<7200) { for(x=0;x<8;x++) mapbyte3[x]=CHRBankList[x]; for(x=0;x<3;x++) mapbyte2[x]=PRGBankList[x]; mapbyte2[3]=(Mirroring<0x10)?Mirroring:Mirroring-0xE; } for(x=0;x<8;x++) setchr1(x*0x400,mapbyte3[x]); for(x=0;x<3;x++) setprg8(0x8000+x*8192,mapbyte2[x]); DaMirror(mapbyte2[3]); //LoadOPL(); } static void M85SC(void) { if(VRC7Sound) OPLL_set_rate(VRC7Sound, FSettings.SndRate); } static void M85SKill(void) { if(VRC7Sound) OPLL_delete(VRC7Sound); VRC7Sound=NULL; } static void VRC7SI(void) { GameExpSound.RChange=M85SC; GameExpSound.Kill=M85SKill; VRC7Sound=OPLL_new(3579545, FSettings.SndRate?FSettings.SndRate:44100); OPLL_reset(VRC7Sound); OPLL_reset(VRC7Sound); } void NSFVRC7_Init(void) { SetWriteHandler(0x9010,0x901F,Mapper85_write); SetWriteHandler(0x9030,0x903F,Mapper85_write); VRC7SI(); } void Mapper85_init(void) { MapIRQHook=KonamiIRQHook; SetWriteHandler(0x8000,0xffff,Mapper85_write); GameStateRestore=Mapper85_StateRestore; if(!VROM_size) SetupCartCHRMapping(0, CHRRAM, 8192, 1); //AddExState(VRC7Instrument, 16, 0, "VC7I"); //AddExState(VRC7Chan, sizeof(VRC7Chan), 0, "V7CH"); VRC7SI(); } fceu-0.98.12/src/mappers/86.c0000644000175000000620000000217010012344156015345 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" DECLFW(Mapper86_write) { if(A>=0x6000 && A<=0x6fFF) { VROM_BANK8((V&3)|((V>>4)&4)); ROM_BANK32((V>>4)&3); } else //if(A!=0x6000) printf("$%04x:$%02x\n",A,V); } void Mapper86_init(void) { SetWriteHandler(0x6000,0x6fff,Mapper86_write); SetWriteHandler(0x4020,0xffff,Mapper86_write); } fceu-0.98.12/src/mappers/88.c0000644000175000000620000000325210003562764015360 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static int mn; static DECLFW(Mapper88_write) { //if(A>=0x8002 || A<0x8000) //if(A==0xc000) // printf("$%04x:$%02x\n",A,V); switch(A&0x8001) //&0xc001) { case 0x8000:mapbyte1[0]=V; if(mn) onemir((V>>6)&1); break; case 0x8001: switch(mapbyte1[0]&7) { case 0:VROM_BANK2(0,V>>1);break; case 1:VROM_BANK2(0x800,V>>1);break; case 2:VROM_BANK1(0x1000,V|0x40);break; case 3:VROM_BANK1(0x1400,V|0x40);break; case 4:VROM_BANK1(0x1800,V|0x40);break; case 5:VROM_BANK1(0x1c00,V|0x40);break; case 6:ROM_BANK8(0x8000,V);break; case 7:ROM_BANK8(0xA000,V);break; } break; } } void Mapper88_init(void) { mn=0; SetWriteHandler(0x8000,0xffff,Mapper88_write); } void Mapper154_init(void) { mn=1; SetWriteHandler(0x8000,0xffff,Mapper88_write); } fceu-0.98.12/src/mappers/89.c0000644000175000000620000000202710003562764015360 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" DECLFW(Mapper89_write) { VROM_BANK8((V&7)|((V>>4)&8)); ROM_BANK16(0x8000,(V>>4)&7); onemir((V>>3)&1); } void Mapper89_init(void) { Mirroring=0; SetWriteHandler(0x8000,0xffff,Mapper89_write); } fceu-0.98.12/src/mappers/92.c0000644000175000000620000000231710003562764015354 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" /* Original code provided by LULU */ static DECLFW(Mapper92_write) { uint8 reg=(A&0xF0)>>4; uint8 bank=A&0xF; if(A>=0x9000) { if(reg==0xD) ROM_BANK16(0xc000,bank); else if(reg==0xE) VROM_BANK8(bank); } else { if(reg==0xB) ROM_BANK16(0xc000,bank); else if(reg==0x7) VROM_BANK8(bank); } } void Mapper92_init(void) { SetWriteHandler(0x8000,0xFFFF,Mapper92_write); } fceu-0.98.12/src/mappers/95.c0000644000175000000620000000575110003562764015364 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static uint8 lastA; static uint8 DRegs[8]; static uint8 cmd; static uint8 MirCache[8]; static SFORMAT DB_StateRegs[]={ {DRegs, 8, "DREG"}, {&cmd, 1, "CMD"}, {&lastA, 1, "LAST"}, {0} }; static void FP_FASTAPASS(1) dragonbust_ppu(uint32 A) { static int last=-1; static uint8 z; if(A>=0x2000) return; A>>=10; lastA=A; z=MirCache[A]; if(z!=last) { onemir(z); last=z; } } static void toot(void) { int x; MirCache[0]=MirCache[1]=(DRegs[0]>>4)&1; MirCache[2]=MirCache[3]=(DRegs[1]>>4)&1; for(x=0;x<4;x++) MirCache[4+x]=(DRegs[2+x]>>5)&1; onemir(MirCache[lastA]); } static DECLFW(Mapper95_write) { switch(A&0xF001) { case 0x8000: cmd = V; break; case 0x8001: switch(cmd&0x07) { case 0: DRegs[0]=(V&0x3F)>>1;toot();V>>=1;setchr2(0x0000,V&0x1F);break; case 1: DRegs[1]=(V&0x3F)>>1;toot();V>>=1;setchr2(0x0800,V&0x1F);break; case 2: DRegs[2]=V&0x3F;toot();setchr1(0x1000,V&0x1F); break; case 3: DRegs[3]=V&0x3F;toot();setchr1(0x1400,V&0x1F); break; case 4: DRegs[4]=V&0x3F;toot();setchr1(0x1800,V&0x1F); break; case 5: DRegs[5]=V&0x3F;toot();setchr1(0x1C00,V&0x1F); break; case 6: DRegs[6]=V&0x3F; setprg8(0x8000,V); break; case 7: DRegs[7]=V&0x3F; setprg8(0xA000,V); break; } break; } } static void DBSync() { int x; setchr2(0x0000,DRegs[0]); setchr2(0x0800,DRegs[1]); for(x=0;x<4;x++) setchr1(0x1000+x*0x400,DRegs[2+x]); setprg8(0x8000,DRegs[6]); setprg8(0xa000,DRegs[7]); toot(); } static void DBPower(void) { memset(DRegs,0x3F,8); DRegs[0]=DRegs[1]=0x1F; DBSync(); setprg8(0xc000,0x3E); setprg8(0xe000,0x3F); SetReadHandler(0x8000,0xffff,CartBR); SetWriteHandler(0x8000,0xffff,Mapper95_write); } static void StateRestore(int version) { DBSync(); } void Mapper95_Init(CartInfo *info) { info->Power=DBPower; AddExState(DB_StateRegs, ~0, 0, 0); PPU_hook=dragonbust_ppu; GameStateRestore=StateRestore; } fceu-0.98.12/src/mappers/97.c0000644000175000000620000000213410003562764015356 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" DECLFW(Mapper97_write) { ROM_BANK16(0xC000,V&15); switch(V>>6) { case 0:break; case 1:MIRROR_SET2(0);break; case 2:MIRROR_SET2(1);break; case 3:break; } } void Mapper97_init(void) { ROM_BANK16(0x8000,~0); SetWriteHandler(0x8000,0xffff,Mapper97_write); } fceu-0.98.12/src/mappers/99.c0000644000175000000620000000213110051774446015362 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static writefunc oldmorko; static DECLFW(morko) { VROM_BANK8((V>>2)&1); oldmorko(A,V); setprg8(0x8000,V&0x4); /* Special for VS Gumshoe */ } void Mapper99_init(void) { ROM_BANK32(0); oldmorko=GetWriteHandler(0x4016); SetWriteHandler(0x4016,0x4016,morko); } fceu-0.98.12/src/mappers/mapinc.h0000644000175000000620000000044010004315524016360 0ustar joestaff00000000000000#include "../types.h" #include "../x6502.h" #include "../fceu.h" #include "../ppu.h" #define INESPRIV #include "../cart.h" #include "../ines.h" #include "../memory.h" #include "../sound.h" #include "../state.h" #include "mapshare.h" #include fceu-0.98.12/src/mappers/emu2413.c0000644000175000000620000007164710036574145016240 0ustar joestaff00000000000000/*********************************************************************************** emu2413.c -- YM2413 emulator written by Mitsutaka Okazaki 2001 2001 01-08 : Version 0.10 -- 1st version. 2001 01-15 : Version 0.20 -- semi-public version. 2001 01-16 : Version 0.30 -- 1st public version. 2001 01-17 : Version 0.31 -- Fixed bassdrum problem. : Version 0.32 -- LPF implemented. 2001 01-18 : Version 0.33 -- Fixed the drum problem, refine the mix-down method. -- Fixed the LFO bug. 2001 01-24 : Version 0.35 -- Fixed the drum problem, support undocumented EG behavior. 2001 02-02 : Version 0.38 -- Improved the performance. Fixed the hi-hat and cymbal model. Fixed the default percussive datas. Noise reduction. Fixed the feedback problem. 2001 03-03 : Version 0.39 -- Fixed some drum bugs. Improved the performance. 2001 03-04 : Version 0.40 -- Improved the feedback. Change the default table size. Clock and Rate can be changed during play. 2001 06-24 : Version 0.50 -- Improved the hi-hat and the cymbal tone. Added VRC7 patch (OPLL_reset_patch is changed). Fixed OPLL_reset() bug. Added OPLL_setMask, OPLL_getMask and OPLL_toggleMask. Added OPLL_writeIO. 2001 09-28 : Version 0.51 -- Removed the noise table. 2002 01-28 : Version 0.52 -- Added Stereo mode. 2002 02-07 : Version 0.53 -- Fixed some drum bugs. 2002 02-20 : Version 0.54 -- Added the best quality mode. 2002 03-02 : Version 0.55 -- Removed OPLL_init & OPLL_close. 2002 05-30 : Version 0.60 -- Fixed HH&CYM generator and all voice datas. 2004 01-24 : Modified by xodnizel to remove code not needed for the VRC7, among other things. References: fmopl.c -- 1999,2000 written by Tatsuyuki Satoh (MAME development). fmopl.c(fixed) -- (C) 2002 Jarek Burczynski. s_opl.c -- 2001 written by Mamiya (NEZplug development). fmgen.cpp -- 1999,2000 written by cisc. fmpac.ill -- 2000 created by NARUTO. MSX-Datapack YMU757 data sheet YM2143 data sheet **************************************************************************************/ #include #include #include #include #include "emu2413.h" static const unsigned char default_inst[15][8] = { #include "vrc7tone.h" }; /* Size of Sintable ( 8 -- 18 can be used. 9 recommended.)*/ #define PG_BITS 9 #define PG_WIDTH (1<>(b)) /* Leave the lower b bit(s). */ #define LOWBITS(c,b) ((c)&((1<<(b))-1)) /* Expand x which is s bits to d bits. */ #define EXPAND_BITS(x,s,d) ((x)<<((d)-(s))) /* Expand x which is s bits to d bits and fill expanded bits '1' */ #define EXPAND_BITS_X(x,s,d) (((x)<<((d)-(s)))|((1<<((d)-(s)))-1)) /* Adjust envelope speed which depends on sampling rate. */ #define rate_adjust(x) (rate==49716?x:(e_uint32)((double)(x)*clk/72/rate + 0.5)) /* added 0.5 to round the value*/ #define MOD(o,x) (&(o)->slot[(x)<<1]) #define CAR(o,x) (&(o)->slot[((x)<<1)|1]) #define BIT(s,b) (((s)>>(b))&1) /* Input clock */ static e_uint32 clk = 844451141; /* Sampling rate */ static e_uint32 rate = 3354932; /* WaveTable for each envelope amp */ static e_uint16 fullsintable[PG_WIDTH]; static e_uint16 halfsintable[PG_WIDTH]; static e_uint16 *waveform[2] = { fullsintable, halfsintable }; /* LFO Table */ static e_int32 pmtable[PM_PG_WIDTH]; static e_int32 amtable[AM_PG_WIDTH]; /* Phase delta for LFO */ static e_uint32 pm_dphase; static e_uint32 am_dphase; /* dB to Liner table */ static e_int16 DB2LIN_TABLE[(DB_MUTE + DB_MUTE) * 2]; /* Liner to Log curve conversion table (for Attack rate). */ static e_uint16 AR_ADJUST_TABLE[1 << EG_BITS]; /* Definition of envelope mode */ enum { SETTLE, ATTACK, DECAY, SUSHOLD, SUSTINE, RELEASE, FINISH }; /* Phase incr table for Attack */ static e_uint32 dphaseARTable[16][16]; /* Phase incr table for Decay and Release */ static e_uint32 dphaseDRTable[16][16]; /* KSL + TL Table */ static e_uint32 tllTable[16][8][1 << TL_BITS][4]; static e_int32 rksTable[2][8][2]; /* Phase incr table for PG */ static e_uint32 dphaseTable[512][8][16]; /*************************************************** Create tables ****************************************************/ INLINE static e_int32 Min (e_int32 i, e_int32 j) { if (i < j) return i; else return j; } /* Table for AR to LogCurve. */ static void makeAdjustTable (void) { e_int32 i; AR_ADJUST_TABLE[0] = (1 << EG_BITS); for (i = 1; i < 128; i++) AR_ADJUST_TABLE[i] = (e_uint16) ((double) (1 << EG_BITS) - 1 - (1 << EG_BITS) * log (i) / log (128)); } /* Table for dB(0 -- (1<= DB_MUTE) DB2LIN_TABLE[i] = 0; DB2LIN_TABLE[i + DB_MUTE + DB_MUTE] = (e_int16) (-DB2LIN_TABLE[i]); } } /* Liner(+0.0 - +1.0) to dB((1<> (20 - DP_BITS)); } static void makeTllTable (void) { #define dB2(x) ((x)*2) static double kltable[16] = { dB2 (0.000), dB2 (9.000), dB2 (12.000), dB2 (13.875), dB2 (15.000), dB2 (16.125), dB2 (16.875), dB2 (17.625), dB2 (18.000), dB2 (18.750), dB2 (19.125), dB2 (19.500), dB2 (19.875), dB2 (20.250), dB2 (20.625), dB2 (21.000) }; e_int32 tmp; e_int32 fnum, block, TL, KL; for (fnum = 0; fnum < 16; fnum++) for (block = 0; block < 8; block++) for (TL = 0; TL < 64; TL++) for (KL = 0; KL < 4; KL++) { if (KL == 0) { tllTable[fnum][block][TL][KL] = TL2EG (TL); } else { tmp = (e_int32) (kltable[fnum] - dB2 (3.000) * (7 - block)); if (tmp <= 0) tllTable[fnum][block][TL][KL] = TL2EG (TL); else tllTable[fnum][block][TL][KL] = (e_uint32) ((tmp >> (3 - KL)) / EG_STEP) + TL2EG (TL); } } } #ifdef USE_SPEC_ENV_SPEED static double attacktime[16][4] = { {0, 0, 0, 0}, {1730.15, 1400.60, 1153.43, 988.66}, {865.08, 700.30, 576.72, 494.33}, {432.54, 350.15, 288.36, 247.16}, {216.27, 175.07, 144.18, 123.58}, {108.13, 87.54, 72.09, 61.79}, {54.07, 43.77, 36.04, 30.90}, {27.03, 21.88, 18.02, 15.45}, {13.52, 10.94, 9.01, 7.72}, {6.76, 5.47, 4.51, 3.86}, {3.38, 2.74, 2.25, 1.93}, {1.69, 1.37, 1.13, 0.97}, {0.84, 0.70, 0.60, 0.54}, {0.50, 0.42, 0.34, 0.30}, {0.28, 0.22, 0.18, 0.14}, {0.00, 0.00, 0.00, 0.00} }; static double decaytime[16][4] = { {0, 0, 0, 0}, {20926.60, 16807.20, 14006.00, 12028.60}, {10463.30, 8403.58, 7002.98, 6014.32}, {5231.64, 4201.79, 3501.49, 3007.16}, {2615.82, 2100.89, 1750.75, 1503.58}, {1307.91, 1050.45, 875.37, 751.79}, {653.95, 525.22, 437.69, 375.90}, {326.98, 262.61, 218.84, 187.95}, {163.49, 131.31, 109.42, 93.97}, {81.74, 65.65, 54.71, 46.99}, {40.87, 32.83, 27.36, 23.49}, {20.44, 16.41, 13.68, 11.75}, {10.22, 8.21, 6.84, 5.87}, {5.11, 4.10, 3.42, 2.94}, {2.55, 2.05, 1.71, 1.47}, {1.27, 1.27, 1.27, 1.27} }; #endif /* Rate Table for Attack */ static void makeDphaseARTable (void) { e_int32 AR, Rks, RM, RL; #ifdef USE_SPEC_ENV_SPEED e_uint32 attacktable[16][4]; for (RM = 0; RM < 16; RM++) for (RL = 0; RL < 4; RL++) { if (RM == 0) attacktable[RM][RL] = 0; else if (RM == 15) attacktable[RM][RL] = EG_DP_WIDTH; else attacktable[RM][RL] = (e_uint32) ((double) (1 << EG_DP_BITS) / (attacktime[RM][RL] * 3579545 / 72000)); } #endif for (AR = 0; AR < 16; AR++) for (Rks = 0; Rks < 16; Rks++) { RM = AR + (Rks >> 2); RL = Rks & 3; if (RM > 15) RM = 15; switch (AR) { case 0: dphaseARTable[AR][Rks] = 0; break; case 15: dphaseARTable[AR][Rks] = 0;/*EG_DP_WIDTH;*/ break; default: #ifdef USE_SPEC_ENV_SPEED dphaseARTable[AR][Rks] = rate_adjust (attacktable[RM][RL]); #else dphaseARTable[AR][Rks] = rate_adjust ((3 * (RL + 4) << (RM + 1))); #endif break; } } } /* Rate Table for Decay and Release */ static void makeDphaseDRTable (void) { e_int32 DR, Rks, RM, RL; #ifdef USE_SPEC_ENV_SPEED e_uint32 decaytable[16][4]; for (RM = 0; RM < 16; RM++) for (RL = 0; RL < 4; RL++) if (RM == 0) decaytable[RM][RL] = 0; else decaytable[RM][RL] = (e_uint32) ((double) (1 << EG_DP_BITS) / (decaytime[RM][RL] * 3579545 / 72000)); #endif for (DR = 0; DR < 16; DR++) for (Rks = 0; Rks < 16; Rks++) { RM = DR + (Rks >> 2); RL = Rks & 3; if (RM > 15) RM = 15; switch (DR) { case 0: dphaseDRTable[DR][Rks] = 0; break; default: #ifdef USE_SPEC_ENV_SPEED dphaseDRTable[DR][Rks] = rate_adjust (decaytable[RM][RL]); #else dphaseDRTable[DR][Rks] = rate_adjust ((RL + 4) << (RM - 1)); #endif break; } } } static void makeRksTable (void) { e_int32 fnum8, block, KR; for (fnum8 = 0; fnum8 < 2; fnum8++) for (block = 0; block < 8; block++) for (KR = 0; KR < 2; KR++) { if (KR != 0) rksTable[fnum8][block][KR] = (block << 1) + fnum8; else rksTable[fnum8][block][KR] = block >> 1; } } /************************************************************ Calc Parameters ************************************************************/ INLINE static e_uint32 calc_eg_dphase (OPLL_SLOT * slot) { switch (slot->eg_mode) { case ATTACK: return dphaseARTable[slot->patch.AR][slot->rks]; case DECAY: return dphaseDRTable[slot->patch.DR][slot->rks]; case SUSHOLD: return 0; case SUSTINE: return dphaseDRTable[slot->patch.RR][slot->rks]; case RELEASE: if (slot->sustine) return dphaseDRTable[5][slot->rks]; else if (slot->patch.EG) return dphaseDRTable[slot->patch.RR][slot->rks]; else return dphaseDRTable[7][slot->rks]; case FINISH: return 0; default: return 0; } } /************************************************************* OPLL internal interfaces *************************************************************/ #define UPDATE_PG(S) (S)->dphase = dphaseTable[(S)->fnum][(S)->block][(S)->patch.ML] #define UPDATE_TLL(S)\ (((S)->type==0)?\ ((S)->tll = tllTable[((S)->fnum)>>5][(S)->block][(S)->patch.TL][(S)->patch.KL]):\ ((S)->tll = tllTable[((S)->fnum)>>5][(S)->block][(S)->volume][(S)->patch.KL])) #define UPDATE_RKS(S) (S)->rks = rksTable[((S)->fnum)>>8][(S)->block][(S)->patch.KR] #define UPDATE_WF(S) (S)->sintbl = waveform[(S)->patch.WF] #define UPDATE_EG(S) (S)->eg_dphase = calc_eg_dphase(S) #define UPDATE_ALL(S)\ UPDATE_PG(S);\ UPDATE_TLL(S);\ UPDATE_RKS(S);\ UPDATE_WF(S); \ UPDATE_EG(S) /* EG should be updated last. */ /* Slot key on */ INLINE static void slotOn (OPLL_SLOT * slot) { slot->eg_mode = ATTACK; slot->eg_phase = 0; slot->phase = 0; } /* Slot key on without reseting the phase */ INLINE static void slotOn2 (OPLL_SLOT * slot) { slot->eg_mode = ATTACK; slot->eg_phase = 0; } /* Slot key off */ INLINE static void slotOff (OPLL_SLOT * slot) { if (slot->eg_mode == ATTACK) slot->eg_phase = EXPAND_BITS (AR_ADJUST_TABLE[HIGHBITS (slot->eg_phase, EG_DP_BITS - EG_BITS)], EG_BITS, EG_DP_BITS); slot->eg_mode = RELEASE; } /* Channel key on */ INLINE static void keyOn (OPLL * opll, e_int32 i) { if (!opll->slot_on_flag[i * 2]) slotOn (MOD(opll,i)); if (!opll->slot_on_flag[i * 2 + 1]) slotOn (CAR(opll,i)); opll->key_status[i] = 1; } /* Channel key off */ INLINE static void keyOff (OPLL * opll, e_int32 i) { if (opll->slot_on_flag[i * 2 + 1]) slotOff (CAR(opll,i)); opll->key_status[i] = 0; } /* Set sustine parameter */ INLINE static void setSustine (OPLL * opll, e_int32 c, e_int32 sustine) { CAR(opll,c)->sustine = sustine; if (MOD(opll,c)->type) MOD(opll,c)->sustine = sustine; } /* Volume : 6bit ( Volume register << 2 ) */ INLINE static void setVolume (OPLL * opll, e_int32 c, e_int32 volume) { CAR(opll,c)->volume = volume; } INLINE static void setSlotVolume (OPLL_SLOT * slot, e_int32 volume) { slot->volume = volume; } /* Set F-Number ( fnum : 9bit ) */ INLINE static void setFnumber (OPLL * opll, e_int32 c, e_int32 fnum) { CAR(opll,c)->fnum = fnum; MOD(opll,c)->fnum = fnum; } /* Set Block data (block : 3bit ) */ INLINE static void setBlock (OPLL * opll, e_int32 c, e_int32 block) { CAR(opll,c)->block = block; MOD(opll,c)->block = block; } INLINE static void update_key_status (OPLL * opll) { int ch; for (ch = 0; ch < 6; ch++) opll->slot_on_flag[ch * 2] = opll->slot_on_flag[ch * 2 + 1] = (opll->HiFreq[ch]) & 0x10; } /*********************************************************** Initializing ***********************************************************/ static void OPLL_SLOT_reset (OPLL_SLOT * slot, int type) { slot->type = type; slot->sintbl = waveform[0]; slot->phase = 0; slot->dphase = 0; slot->output[0] = 0; slot->output[1] = 0; slot->feedback = 0; slot->eg_mode = SETTLE; slot->eg_phase = EG_DP_WIDTH; slot->eg_dphase = 0; slot->rks = 0; slot->tll = 0; slot->sustine = 0; slot->fnum = 0; slot->block = 0; slot->volume = 0; slot->pgout = 0; slot->egout = 0; } static void internal_refresh (void) { makeDphaseTable (); makeDphaseARTable (); makeDphaseDRTable (); pm_dphase = (e_uint32) rate_adjust (PM_SPEED * PM_DP_WIDTH / (clk / 72)); am_dphase = (e_uint32) rate_adjust (AM_SPEED * AM_DP_WIDTH / (clk / 72)); } static void maketables (e_uint32 c, e_uint32 r) { if (c != clk) { clk = c; makePmTable (); makeAmTable (); makeDB2LinTable (); makeAdjustTable (); makeTllTable (); makeRksTable (); makeSinTable (); //makeDefaultPatch (); } if (r != rate) { rate = r; internal_refresh (); } } OPLL *OPLL_new (e_uint32 clk, e_uint32 rate) { OPLL *opll; maketables (clk, rate); opll = (OPLL *) calloc (sizeof (OPLL), 1); if (opll == NULL) return NULL; opll->mask = 0; OPLL_reset (opll); return opll; } void OPLL_delete (OPLL * opll) { free (opll); } /* Reset whole of OPLL except patch datas. */ void OPLL_reset (OPLL * opll) { e_int32 i; if (!opll) return; opll->adr = 0; opll->out = 0; opll->pm_phase = 0; opll->am_phase = 0; opll->mask = 0; for (i = 0; i < 12; i++) OPLL_SLOT_reset(&opll->slot[i], i%2); for (i = 0; i < 6; i++) { opll->key_status[i] = 0; //setPatch (opll, i, 0); } for (i = 0; i < 0x40; i++) OPLL_writeReg (opll, i, 0); #ifndef EMU2413_COMPACTION opll->realstep = (e_uint32) ((1 << 31) / rate); opll->opllstep = (e_uint32) ((1 << 31) / (clk / 72)); opll->oplltime = 0; #endif } /* Force Refresh (When external program changes some parameters). */ void OPLL_forceRefresh (OPLL * opll) { e_int32 i; if (opll == NULL) return; for (i = 0; i < 12; i++) { UPDATE_PG (&opll->slot[i]); UPDATE_RKS (&opll->slot[i]); UPDATE_TLL (&opll->slot[i]); UPDATE_WF (&opll->slot[i]); UPDATE_EG (&opll->slot[i]); } } void OPLL_set_rate (OPLL * opll, e_uint32 r) { if (opll->quality) rate = 49716; else rate = r; internal_refresh (); rate = r; } void OPLL_set_quality (OPLL * opll, e_uint32 q) { opll->quality = q; OPLL_set_rate (opll, rate); } /********************************************************* Generate wave data *********************************************************/ /* Convert Amp(0 to EG_HEIGHT) to Phase(0 to 2PI). */ #if ( SLOT_AMP_BITS - PG_BITS ) > 0 #define wave2_2pi(e) ( (e) >> ( SLOT_AMP_BITS - PG_BITS )) #else #define wave2_2pi(e) ( (e) << ( PG_BITS - SLOT_AMP_BITS )) #endif /* Convert Amp(0 to EG_HEIGHT) to Phase(0 to 4PI). */ #if ( SLOT_AMP_BITS - PG_BITS - 1 ) == 0 #define wave2_4pi(e) (e) #elif ( SLOT_AMP_BITS - PG_BITS - 1 ) > 0 #define wave2_4pi(e) ( (e) >> ( SLOT_AMP_BITS - PG_BITS - 1 )) #else #define wave2_4pi(e) ( (e) << ( 1 + PG_BITS - SLOT_AMP_BITS )) #endif /* Convert Amp(0 to EG_HEIGHT) to Phase(0 to 8PI). */ #if ( SLOT_AMP_BITS - PG_BITS - 2 ) == 0 #define wave2_8pi(e) (e) #elif ( SLOT_AMP_BITS - PG_BITS - 2 ) > 0 #define wave2_8pi(e) ( (e) >> ( SLOT_AMP_BITS - PG_BITS - 2 )) #else #define wave2_8pi(e) ( (e) << ( 2 + PG_BITS - SLOT_AMP_BITS )) #endif /* Update AM, PM unit */ static void update_ampm (OPLL * opll) { opll->pm_phase = (opll->pm_phase + pm_dphase) & (PM_DP_WIDTH - 1); opll->am_phase = (opll->am_phase + am_dphase) & (AM_DP_WIDTH - 1); opll->lfo_am = amtable[HIGHBITS (opll->am_phase, AM_DP_BITS - AM_PG_BITS)]; opll->lfo_pm = pmtable[HIGHBITS (opll->pm_phase, PM_DP_BITS - PM_PG_BITS)]; } /* PG */ INLINE static void calc_phase (OPLL_SLOT * slot, e_int32 lfo) { if (slot->patch.PM) slot->phase += (slot->dphase * lfo) >> PM_AMP_BITS; else slot->phase += slot->dphase; slot->phase &= (DP_WIDTH - 1); slot->pgout = HIGHBITS (slot->phase, DP_BASE_BITS); } /* EG */ static void calc_envelope (OPLL_SLOT * slot, e_int32 lfo) { #define S2E(x) (SL2EG((e_int32)(x/SL_STEP))<<(EG_DP_BITS-EG_BITS)) static e_uint32 SL[16] = { S2E (0.0), S2E (3.0), S2E (6.0), S2E (9.0), S2E (12.0), S2E (15.0), S2E (18.0), S2E (21.0), S2E (24.0), S2E (27.0), S2E (30.0), S2E (33.0), S2E (36.0), S2E (39.0), S2E (42.0), S2E (48.0) }; e_uint32 egout; switch (slot->eg_mode) { case ATTACK: egout = AR_ADJUST_TABLE[HIGHBITS (slot->eg_phase, EG_DP_BITS - EG_BITS)]; slot->eg_phase += slot->eg_dphase; if((EG_DP_WIDTH & slot->eg_phase)||(slot->patch.AR==15)) { egout = 0; slot->eg_phase = 0; slot->eg_mode = DECAY; UPDATE_EG (slot); } break; case DECAY: egout = HIGHBITS (slot->eg_phase, EG_DP_BITS - EG_BITS); slot->eg_phase += slot->eg_dphase; if (slot->eg_phase >= SL[slot->patch.SL]) { if (slot->patch.EG) { slot->eg_phase = SL[slot->patch.SL]; slot->eg_mode = SUSHOLD; UPDATE_EG (slot); } else { slot->eg_phase = SL[slot->patch.SL]; slot->eg_mode = SUSTINE; UPDATE_EG (slot); } } break; case SUSHOLD: egout = HIGHBITS (slot->eg_phase, EG_DP_BITS - EG_BITS); if (slot->patch.EG == 0) { slot->eg_mode = SUSTINE; UPDATE_EG (slot); } break; case SUSTINE: case RELEASE: egout = HIGHBITS (slot->eg_phase, EG_DP_BITS - EG_BITS); slot->eg_phase += slot->eg_dphase; if (egout >= (1 << EG_BITS)) { slot->eg_mode = FINISH; egout = (1 << EG_BITS) - 1; } break; case FINISH: egout = (1 << EG_BITS) - 1; break; default: egout = (1 << EG_BITS) - 1; break; } if (slot->patch.AM) egout = EG2DB (egout + slot->tll) + lfo; else egout = EG2DB (egout + slot->tll); if (egout >= DB_MUTE) egout = DB_MUTE - 1; slot->egout = egout; } /* CARRIOR */ INLINE static e_int32 calc_slot_car (OPLL_SLOT * slot, e_int32 fm) { slot->output[1] = slot->output[0]; if (slot->egout >= (DB_MUTE - 1)) { slot->output[0] = 0; } else { slot->output[0] = DB2LIN_TABLE[slot->sintbl[(slot->pgout+wave2_8pi(fm))&(PG_WIDTH-1)] + slot->egout]; } return (slot->output[1] + slot->output[0]) >> 1; } /* MODULATOR */ INLINE static e_int32 calc_slot_mod (OPLL_SLOT * slot) { e_int32 fm; slot->output[1] = slot->output[0]; if (slot->egout >= (DB_MUTE - 1)) { slot->output[0] = 0; } else if (slot->patch.FB != 0) { fm = wave2_4pi (slot->feedback) >> (7 - slot->patch.FB); slot->output[0] = DB2LIN_TABLE[slot->sintbl[(slot->pgout + fm)&(PG_WIDTH-1)] + slot->egout]; } else { slot->output[0] = DB2LIN_TABLE[slot->sintbl[slot->pgout] + slot->egout]; } slot->feedback = (slot->output[1] + slot->output[0]) >> 1; return slot->feedback; } static INLINE e_int16 calc (OPLL * opll) { e_int32 inst = 0, out = 0; e_int32 i; update_ampm (opll); for (i = 0; i < 12; i++) { calc_phase(&opll->slot[i],opll->lfo_pm); calc_envelope(&opll->slot[i],opll->lfo_am); } for (i = 0; i < 6; i++) if (!(opll->mask & OPLL_MASK_CH (i)) && (CAR(opll,i)->eg_mode != FINISH)) inst += calc_slot_car (CAR(opll,i), calc_slot_mod(MOD(opll,i))); out = inst; return (e_int16) out; } void moocow(OPLL* opll, e_int32 *buf, e_int32 len, int shift) { while(len > 0) { *buf+=(calc(opll)+32768)<quality) return calc (opll); while (opll->realstep > opll->oplltime) { opll->oplltime += opll->opllstep; opll->prev = opll->next; opll->next = calc (opll); } opll->oplltime -= opll->realstep; opll->out = (e_int16) (((double) opll->next * (opll->opllstep - opll->oplltime) + (double) opll->prev * opll->oplltime) / opll->opllstep); return (e_int16) opll->out; } #endif e_uint32 OPLL_setMask (OPLL * opll, e_uint32 mask) { e_uint32 ret; if (opll) { ret = opll->mask; opll->mask = mask; return ret; } else return 0; } e_uint32 OPLL_toggleMask (OPLL * opll, e_uint32 mask) { e_uint32 ret; if (opll) { ret = opll->mask; opll->mask ^= mask; return ret; } else return 0; } /**************************************************** I/O Ctrl *****************************************************/ static void setInstrument(OPLL * opll, e_uint i, e_uint inst) { const e_uint8 *src; OPLL_PATCH *modp, *carp; opll->patch_number[i]=inst; if(inst) src=default_inst[inst-1]; else src=opll->CustInst; modp=&MOD(opll,i)->patch; carp=&CAR(opll,i)->patch; modp->AM=(src[0]>>7)&1; modp->PM=(src[0]>>6)&1; modp->EG=(src[0]>>5)&1; modp->KR=(src[0]>>4)&1; modp->ML=(src[0]&0xF); carp->AM=(src[1]>>7)&1; carp->PM=(src[1]>>6)&1; carp->EG=(src[1]>>5)&1; carp->KR=(src[1]>>4)&1; carp->ML=(src[1]&0xF); modp->KL=(src[2]>>6)&3; modp->TL=(src[2]&0x3F); carp->KL = (src[3] >> 6) & 3; carp->WF = (src[3] >> 4) & 1; modp->WF = (src[3] >> 3) & 1; modp->FB = (src[3]) & 7; modp->AR = (src[4]>>4)&0xF; modp->DR = (src[4]&0xF); carp->AR = (src[5]>>4)&0xF; carp->DR = (src[5]&0xF); modp->SL = (src[6]>>4)&0xF; modp->RR = (src[6]&0xF); carp->SL = (src[7]>>4)&0xF; carp->RR = (src[7]&0xF); } void OPLL_writeReg (OPLL * opll, e_uint32 reg, e_uint32 data) { e_int32 i, v, ch; data = data & 0xff; reg = reg & 0x3f; switch (reg) { case 0x00: opll->CustInst[0]=data; for (i = 0; i < 6; i++) { if (opll->patch_number[i] == 0) { setInstrument(opll, i, 0); UPDATE_PG (MOD(opll,i)); UPDATE_RKS (MOD(opll,i)); UPDATE_EG (MOD(opll,i)); } } break; case 0x01: opll->CustInst[1]=data; for (i = 0; i < 6; i++) { if (opll->patch_number[i] == 0) { setInstrument(opll, i, 0); UPDATE_PG (CAR(opll,i)); UPDATE_RKS (CAR(opll,i)); UPDATE_EG (CAR(opll,i)); } } break; case 0x02: opll->CustInst[2]=data; for (i = 0; i < 6; i++) { if (opll->patch_number[i] == 0) { setInstrument(opll, i, 0); UPDATE_TLL(MOD(opll,i)); } } break; case 0x03: opll->CustInst[3]=data; for (i = 0; i < 6; i++) { if (opll->patch_number[i] == 0) { setInstrument(opll, i, 0); UPDATE_WF(MOD(opll,i)); UPDATE_WF(CAR(opll,i)); } } break; case 0x04: opll->CustInst[4]=data; for (i = 0; i < 6; i++) { if (opll->patch_number[i] == 0) { setInstrument(opll, i, 0); UPDATE_EG (MOD(opll,i)); } } break; case 0x05: opll->CustInst[5]=data; for (i = 0; i < 6; i++) { if (opll->patch_number[i] == 0) { setInstrument(opll, i, 0); UPDATE_EG(CAR(opll,i)); } } break; case 0x06: opll->CustInst[6]=data; for (i = 0; i < 6; i++) { if (opll->patch_number[i] == 0) { setInstrument(opll, i, 0); UPDATE_EG (MOD(opll,i)); } } break; case 0x07: opll->CustInst[7]=data; for (i = 0; i < 6; i++) { if (opll->patch_number[i] == 0) { setInstrument(opll, i, 0); UPDATE_EG (CAR(opll,i)); } } break; case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: ch = reg - 0x10; opll->LowFreq[ch]=data; setFnumber (opll, ch, data + ((opll->HiFreq[ch] & 1) << 8)); UPDATE_ALL (MOD(opll,ch)); UPDATE_ALL (CAR(opll,ch)); break; case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: ch = reg - 0x20; opll->HiFreq[ch]=data; setFnumber (opll, ch, ((data & 1) << 8) + opll->LowFreq[ch]); setBlock (opll, ch, (data >> 1) & 7); setSustine (opll, ch, (data >> 5) & 1); if (data & 0x10) keyOn (opll, ch); else keyOff (opll, ch); UPDATE_ALL (MOD(opll,ch)); UPDATE_ALL (CAR(opll,ch)); update_key_status (opll); break; case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: opll->InstVol[reg-0x30]=data; i = (data >> 4) & 15; v = data & 15; setInstrument(opll, reg-0x30, i); setVolume (opll, reg - 0x30, v << 2); UPDATE_ALL (MOD(opll,reg - 0x30)); UPDATE_ALL (CAR(opll,reg - 0x30)); break; default: break; } } void OPLL_writeIO (OPLL * opll, e_uint32 adr, e_uint32 val) { if (adr & 1) OPLL_writeReg (opll, opll->adr, val); else opll->adr = val; } fceu-0.98.12/src/mappers/mapshare.h0000644000175000000620000000012110003562764016716 0ustar joestaff00000000000000void MMC3_hb(void); #define resetmode mapbyte1[0] #define MMC3_cmd mapbyte1[1] fceu-0.98.12/src/mappers/mmc2and4.c0000644000175000000620000000534410003562764016532 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define MMC4reg mapbyte1 #define latcha1 mapbyte2[0] #define latcha2 mapbyte2[1] static void FP_FASTAPASS(1) latchcheck(uint32 VAddr) { uint8 l,h; h=VAddr>>8; if(h>=0x20 || ((h&0xF)!=0xF)) return; l=VAddr&0xF0; if(h<0x10) { if(l==0xD0) { VROM_BANK4(0x0000,MMC4reg[0]); latcha1=0xFD; } else if(l==0xE0) { VROM_BANK4(0x0000,MMC4reg[1]); latcha1=0xFE; } } else { if(l==0xD0) { VROM_BANK4(0x1000,MMC4reg[2]); latcha2=0xFD; } else if(l==0xE0) { VROM_BANK4(0x1000,MMC4reg[3]); latcha2=0xFE; } } } DECLFW(Mapper9_write) // $Axxx { ROM_BANK8(0x8000,V); } DECLFW(Mapper10_write) { ROM_BANK16(0x8000,V); } DECLFW(Mapper9and10_write) { switch(A&0xF000) { case 0xB000: if (latcha1==0xFD) { VROM_BANK4(0x0000,V);} MMC4reg[0]=V; break; case 0xC000: if (latcha1==0xFE) {VROM_BANK4(0x0000,V);} MMC4reg[1]=V; break; case 0xD000: if (latcha2==0xFD) {VROM_BANK4(0x1000,V);} MMC4reg[2]=V; break; case 0xE000: if (latcha2==0xFE) {VROM_BANK4(0x1000,V);} MMC4reg[3]=V; break; case 0xF000: MIRROR_SET(V&1); break; } } void Mapper9_init(void) { latcha1=0xFE; latcha2=0xFE; ROM_BANK8(0xA000,~2); ROM_BANK8(0x8000,0); SetWriteHandler(0xA000,0xAFFF,Mapper9_write); SetWriteHandler(0xB000,0xFFFF,Mapper9and10_write); PPU_hook=latchcheck; } void Mapper10_init(void) { latcha1=latcha2=0xFE; SetWriteHandler(0xA000,0xAFFF,Mapper10_write); SetWriteHandler(0xB000,0xFFFF,Mapper9and10_write); PPU_hook=latchcheck; } fceu-0.98.12/src/mappers/emu2413.h0000644000175000000620000000543310036574132016227 0ustar joestaff00000000000000#ifndef _EMU2413_H_ #define _EMU2413_H_ #include "emutypes.h" #ifdef EMU2413_DLL_EXPORTS #define EMU2413_API __declspec(dllexport) #elif defined(EMU2413_DLL_IMPORTS) #define EMU2413_API __declspec(dllimport) #else #define EMU2413_API #endif #ifdef __cplusplus extern "C" { #endif #define PI 3.14159265358979323846 enum {OPLL_VRC7_TONE=0} ; /* voice data */ typedef struct { e_uint32 TL,FB,EG,ML,AR,DR,SL,RR,KR,KL,AM,PM,WF ; } OPLL_PATCH ; /* slot */ typedef struct { OPLL_PATCH patch; e_int32 type ; /* 0 : modulator 1 : carrier */ /* OUTPUT */ e_int32 feedback ; e_int32 output[2] ; /* Output value of slot */ /* for Phase Generator (PG) */ e_uint16 *sintbl ; /* Wavetable */ e_uint32 phase ; /* Phase */ e_uint32 dphase ; /* Phase increment amount */ e_uint32 pgout ; /* output */ /* for Envelope Generator (EG) */ e_int32 fnum ; /* F-Number */ e_int32 block ; /* Block */ e_int32 volume ; /* Current volume */ e_int32 sustine ; /* Sustine 1 = ON, 0 = OFF */ e_uint32 tll ; /* Total Level + Key scale level*/ e_uint32 rks ; /* Key scale offset (Rks) */ e_int32 eg_mode ; /* Current state */ e_uint32 eg_phase ; /* Phase */ e_uint32 eg_dphase ; /* Phase increment amount */ e_uint32 egout ; /* output */ } OPLL_SLOT ; /* Mask */ #define OPLL_MASK_CH(x) (1<<(x)) /* opll */ typedef struct { e_uint32 adr ; e_int32 out ; #ifndef EMU2413_COMPACTION e_uint32 realstep ; e_uint32 oplltime ; e_uint32 opllstep ; e_int32 prev, next ; #endif /* Register */ e_uint8 LowFreq[6]; e_uint8 HiFreq[6]; e_uint8 InstVol[6]; e_uint8 CustInst[8]; e_int32 slot_on_flag[6 * 2] ; /* Pitch Modulator */ e_uint32 pm_phase ; e_int32 lfo_pm ; /* Amp Modulator */ e_int32 am_phase ; e_int32 lfo_am ; e_uint32 quality; /* Channel Data */ e_int32 patch_number[6]; e_int32 key_status[6] ; /* Slot */ OPLL_SLOT slot[6 * 2] ; e_uint32 mask ; } OPLL ; /* Create Object */ EMU2413_API OPLL *OPLL_new(e_uint32 clk, e_uint32 rate) ; EMU2413_API void OPLL_delete(OPLL *) ; /* Setup */ EMU2413_API void OPLL_reset(OPLL *) ; EMU2413_API void OPLL_set_rate(OPLL *opll, e_uint32 r) ; EMU2413_API void OPLL_set_quality(OPLL *opll, e_uint32 q) ; /* Port/Register access */ EMU2413_API void OPLL_writeIO(OPLL *, e_uint32 reg, e_uint32 val) ; EMU2413_API void OPLL_writeReg(OPLL *, e_uint32 reg, e_uint32 val) ; /* Synthsize */ EMU2413_API e_int16 OPLL_calc(OPLL *) ; /* Misc */ EMU2413_API void OPLL_forceRefresh(OPLL *) ; /* Channel Mask */ EMU2413_API e_uint32 OPLL_setMask(OPLL *, e_uint32 mask) ; EMU2413_API e_uint32 OPLL_toggleMask(OPLL *, e_uint32 mask) ; void moocow(OPLL* opll, e_int32 *buf, e_int32 len, int shift); #ifdef __cplusplus } #endif #endif fceu-0.98.12/src/mappers/91.c0000644000175000000620000000306510003562764015354 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(Mapper91_write) { //if(A>=0x7001) //printf("$%04x:$%02x, %d\n",A,V,scanline); A&=0xF007; if(A>=0x6000 && A<=0x6003) VROM_BANK2((A&3)*2048,V); else switch(A&0xF003) { case 0x7000: case 0x7001:ROM_BANK8(0x8000+(A&1)*8192,V);break; case 0x7002:IRQa=IRQCount=0;X6502_IRQEnd(FCEU_IQEXT);break; case 0x7003:IRQa=1;X6502_IRQEnd(FCEU_IQEXT);break; // default: printf("Iyee: $%04x:$%02x\n",A,V);break; } //if(A>=0x7000) // printf("$%04x:$%02x, %d\n",A,V,scanline); } static void Mapper91_hb(void) { if(IRQCount<8 && IRQa) { IRQCount++; if(IRQCount>=8) { X6502_IRQBegin(FCEU_IQEXT); } } } void Mapper91_init(void) { SetWriteHandler(0x4020,0xFFFF,Mapper91_write); GameHBIRQHook=Mapper91_hb; } fceu-0.98.12/src/mappers/114.c0000644000175000000620000000414310003562764015426 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define master mapbyte3[0] #define incmd mapbyte3[1] static void dochr(void) { VROM_BANK2(0x0000,(mapbyte2[0]>>1)); VROM_BANK2(0x0800,(mapbyte2[2]>>1)); VROM_BANK1(0x1000,mapbyte2[6]); VROM_BANK1(0x1400,mapbyte2[1]); VROM_BANK1(0x1800,mapbyte2[7]); VROM_BANK1(0x1c00,mapbyte2[3]); } void doprg() { if(master&0x80) { ROM_BANK16(0x8000,master&0x1F); } else { ROM_BANK8(0x8000,mapbyte2[4]); ROM_BANK8(0xa000,mapbyte2[5]); } } static DECLFW(Mapper114_write) { if(A<=0x7FFF) { master=V; doprg(); } else if(A==0xe003) IRQCount=V; else if(A==0xe002) X6502_IRQEnd(FCEU_IQEXT); else switch(A&0xE000) { case 0x8000:MIRROR_SET(V&1);break; case 0xa000:mapbyte1[0]=V;incmd=1;break; case 0xc000: if(!incmd) break; mapbyte2[mapbyte1[0]&0x7]=V; switch(mapbyte1[0]&0x7) { case 0x0: case 1: case 2: case 3: case 6: case 7: dochr();break; case 0x4: case 0x5:doprg();break; } incmd=0; break; } } static void Mapper114_hb(void) { if(IRQCount) { IRQCount--; if(!IRQCount) { X6502_IRQBegin(FCEU_IQEXT); //printf("IRQ: %d\n",scanline); } } } void Mapper114_init(void) { GameHBIRQHook=Mapper114_hb; SetWriteHandler(0x6000,0xffff,Mapper114_write); SetReadHandler(0x4020,0x7fff,0); } fceu-0.98.12/src/mappers/241.c0000644000175000000620000000064010003562764015425 0ustar joestaff00000000000000#include "mapinc.h" static DECLFW(M241wr) { if(A<0x8000) { // printf("$%04x:$%02x, $%04x\n",A,V,X.PC); } else ROM_BANK32(V); } static DECLFR(M241rd) { //DumpMem("out",0x8000,0xffff); //printf("Rd: $%04x, $%04x\n",A,X.PC); return(0x50); } void Mapper241_init(void) { ROM_BANK32(0); SetWriteHandler(0x5000,0x5fff,M241wr); SetWriteHandler(0x8000,0xFFFF,M241wr); SetReadHandler(0x4020,0x5fff,M241rd); } fceu-0.98.12/src/mappers/simple.c0000644000175000000620000001533410030454712016407 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 1998 BERO * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static uint8 latche; static DECLFW(Mapper2_write) { latche=V; ROM_BANK16(0x8000,V); } void Mapper2_init(void) { SetWriteHandler(0x8000,0xFFFF,Mapper2_write); AddExState(&latche, 1, 0, "LATC"); } static DECLFW(Mapper3_write) { VROM_BANK8(V); latche=V; } void Mapper3_init(void) { SetWriteHandler(0x8000,0xFFFF,Mapper3_write); AddExState(&latche, 1, 0, "LATC"); } static DECLFW(Mapper7_write) { ROM_BANK32(V&0xF); onemir((V>>4)&1); latche=V; } void Mapper7_init(void) { onemir(0); ROM_BANK32(0); SetWriteHandler(0x8000,0xFFFF,Mapper7_write); AddExState(&latche, 1, 0, "LATC"); } void Mapper243_init(void) { } static DECLFW(Mapper11_write) { ROM_BANK32(V&0xF); VROM_BANK8(V>>4); latche=V; } void Mapper11_init(void) { ROM_BANK32(0); SetWriteHandler(0x8000,0xFFFF,Mapper11_write); AddExState(&latche, 1, 0, "LATC"); } void Mapper144_init(void) { ROM_BANK32(0); SetWriteHandler(0x8001,0xFFFF,Mapper11_write); AddExState(&latche, 1, 0, "LATC"); } static DECLFW(Mapper13_write) { setchr4r(0x10,0x1000,V&3); setprg32(0x8000,(V>>4)&3); latche=V; } static void Mapper13_StateRestore(int version) { setchr4r(0x10,0x0000,0); setchr4r(0x10,0x1000,latche&3); setprg32(0x8000,(latche>>4)&3); } void Mapper13_init(void) { SetWriteHandler(0x8000,0xFFFF,Mapper13_write); GameStateRestore=Mapper13_StateRestore; AddExState(&latche, 1, 0, "LATC"); AddExState(MapperExRAM, 16384, 0, "CHRR"); SetupCartCHRMapping(0x10, MapperExRAM, 16384, 1); latche=0; Mapper13_StateRestore(FCEU_VERSION_NUMERIC); } static DECLFW(Mapper34_write) { switch(A) { case 0x7FFD:ROM_BANK32(V);break; case 0x7FFE:VROM_BANK4(0x0000,V);break; case 0x7fff:VROM_BANK4(0x1000,V);break; } if(A>=0x8000) ROM_BANK32(V); } void Mapper34_init(void) { ROM_BANK32(0); SetWriteHandler(0x7ffd,0xffff,Mapper34_write); } DECLFW(Mapper66_write) { VROM_BANK8(V&0xF); ROM_BANK32((V>>4)); latche=V; } void Mapper66_init(void) { ROM_BANK32(0); SetWriteHandler(0x6000,0xffff,Mapper66_write); AddExState(&latche, 1, 0, "LATC"); } DECLFW(Mapper152_write) { ROM_BANK16(0x8000,(V>>4)&0x7); VROM_BANK8(V&0xF); onemir((V>>7)&1); /* Saint Seiya...hmm. */ latche=V; } void Mapper152_init(void) { onemir(0); SetWriteHandler(0x6000,0xffff,Mapper152_write); AddExState(&latche, 1, 0, "LATC"); } static DECLFW(Mapper70_write) { ROM_BANK16(0x8000,V>>4); VROM_BANK8(V&0xF); latche=V; } void Mapper70_init(void) { SetWriteHandler(0x6000,0xffff,Mapper70_write); AddExState(&latche, 1, 0, "LATC"); } /* Should be two separate emulation functions for this "mapper". Sigh. URGE TO KILL RISING. */ static DECLFW(Mapper78_write) { //printf("$%04x:$%02x\n",A,V&0x8); ROM_BANK16(0x8000,V&0x7); VROM_BANK8(V>>4); onemir((V>>3)&1); latche=V; } void Mapper78_init(void) { SetWriteHandler(0x8000,0xffff,Mapper78_write); AddExState(&latche, 1, 0, "LATC"); } DECLFW(Mapper87_write) { VROM_BANK8(V>>1); latche=V; } void Mapper87_init(void) { SetWriteHandler(0x6000,0xffff,Mapper87_write); AddExState(&latche, 1, 0, "LATC"); } DECLFW(Mapper93_write) { ROM_BANK16(0x8000,V>>4); MIRROR_SET(V&1); latche=V; } void Mapper93_init(void) { SetWriteHandler(0x8000,0xffff,Mapper93_write); AddExState(&latche, 1, 0, "LATC"); } DECLFW(Mapper94_write) { ROM_BANK16(0x8000,V>>2); latche=V; } void Mapper94_init(void) { SetWriteHandler(0x8000,0xffff,Mapper94_write); AddExState(&latche, 1, 0, "LATC"); } /* I might want to add some code to the mapper 96 PPU hook function to not change CHR banks if the attribute table is being accessed, if I make emulation a little more accurate in the future. */ static uint8 M96LA; static DECLFW(Mapper96_write) { latche=V; setprg32(0x8000,V&3); setchr4r(0x10,0x0000,(latche&4)|M96LA); setchr4r(0x10,0x1000,(latche&4)|3); } static void FP_FASTAPASS(1) M96Hook(uint32 A) { if((A&0x3000)!=0x2000) return; //if((A&0x3ff)>=0x3c0) return; M96LA=(A>>8)&3; setchr4r(0x10,0x0000,(latche&4)|M96LA); } static void M96Sync(int v) { setprg32(0x8000,latche&3); setchr4r(0x10,0x0000,(latche&4)|M96LA); setchr4r(0x10,0x1000,(latche&4)|3); } void Mapper96_init(void) { SetWriteHandler(0x8000,0xffff,Mapper96_write); PPU_hook=M96Hook; AddExState(&latche, 1, 0, "LATC"); AddExState(&M96LA, 1, 0, "LAVA"); SetupCartCHRMapping(0x10, MapperExRAM, 32768, 1); latche=M96LA=0; M96Sync(0); setmirror(MI_0); GameStateRestore=M96Sync; } static DECLFW(Mapper140_write) { VROM_BANK8(V&0xF); ROM_BANK32((V>>4)&0xF); } void Mapper140_init(void) { ROM_BANK32(0); SetWriteHandler(0x6000,0x7FFF,Mapper140_write); } static void M185Sync(int version) { int x; // DumpMem("out",0x8000,0xFFFF); // exit(1); // if(mapbyte1[0]==0x15) if(!(mapbyte1[0]&3)) // if(!(mapbyte1[0]==0x21)) { for(x=0;x<8;x++) setchr1r(0x10,x<<10,0); } else setchr8(0); } static DECLFW(Mapper185_write) { mapbyte1[0]=V; M185Sync(0); //printf("Wr: $%04x:$%02x, $%04x\n",A,V,X.PC); } void Mapper185_init(void) { memset(MapperExRAM,0xFF,1024); MapStateRestore=M185Sync; mapbyte1[0]=0; M185Sync(0); SetupCartCHRMapping(0x10,MapperExRAM,1024,0); SetWriteHandler(0x8000,0xFFFF,Mapper185_write); } static DECLFW(M156Write) { if(A>=0xc000 && A<=0xC003) VROM_BANK1((A&3)*1024,V); else if(A>=0xc008 && A<=0xc00b) VROM_BANK1(0x1000+(A&3)*1024,V); if(A==0xc010) ROM_BANK16(0x8000,V); // printf("$%04x:$%02x\n",A,V); } void Mapper156_init(void) { onemir(0); SetWriteHandler(0xc000,0xc010,M156Write); } #ifdef moo static DECLFW(Mapper157_write) { printf("$%04x:$%02x\n",A,V); if(A<0xc000) setprg16(0xc000,V); } static DECLFR(m157rd) { printf("Rd: $%04x\n",A); } void Mapper157_init(void) { SetWriteHandler(0x4020,0xffff,Mapper157_write); SetReadHandler(0x4020,0x7fff,m157rd); } #endif static DECLFW(m107w) { ROM_BANK32((V>>1)&0x3); VROM_BANK8(V&0x7); } void Mapper107_init(void) { SetWriteHandler(0x8000,0xffff,m107w); } fceu-0.98.12/src/mappers/69.c0000644000175000000620000001323010027653757015365 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static void AYSound(int Count); static void AYSoundHQ(void); static void DoAYSQ(int x); static void DoAYSQHQ(int x); #define sunselect mapbyte1[0] #define sungah mapbyte1[1] static uint8 sunindex; static DECLFW(SUN5BWRAM) { if((sungah&0xC0)==0xC0) (WRAM-0x6000)[A]=V; } static DECLFR(SUN5AWRAM) { if((sungah&0xC0)==0x40) return X.DB; return CartBR(A); } static DECLFW(Mapper69_SWL) { sunindex=V%14; } static DECLFW(Mapper69_SWH) { int x; GameExpSound.Fill=AYSound; GameExpSound.HiFill=AYSoundHQ; if(FSettings.SndRate); switch(sunindex) { case 0: case 1: case 8:if(FSettings.soundq>=1) DoAYSQHQ(0); else DoAYSQ(0);break; case 2: case 3: case 9:if(FSettings.soundq>=1) DoAYSQHQ(1); else DoAYSQ(1);break; case 4: case 5: case 10:if(FSettings.soundq>=1) DoAYSQHQ(2); else DoAYSQ(2);break; case 7: for(x=0;x<2;x++) if(FSettings.soundq>=1) DoAYSQHQ(x); else DoAYSQ(x); break; } MapperExRAM[sunindex]=V; } static DECLFW(Mapper69_write) { switch(A&0xE000) { case 0x8000:sunselect=V;break; case 0xa000: sunselect&=0xF; if(sunselect<=7) VROM_BANK1(sunselect<<10,V); else switch(sunselect&0x0f) { case 8: sungah=V; if(V&0x40) { if(V&0x80) // Select WRAM setprg8r(0x10,0x6000,0); } else setprg8(0x6000,V); break; case 9:ROM_BANK8(0x8000,V);break; case 0xa:ROM_BANK8(0xa000,V);break; case 0xb:ROM_BANK8(0xc000,V);break; case 0xc: switch(V&3) { case 0:MIRROR_SET2(1);break; case 1:MIRROR_SET2(0);break; case 2:onemir(0);break; case 3:onemir(1);break; } break; case 0xd:IRQa=V;X6502_IRQEnd(FCEU_IQEXT);break; case 0xe:IRQCount&=0xFF00;IRQCount|=V;X6502_IRQEnd(FCEU_IQEXT);break; case 0xf:IRQCount&=0x00FF;IRQCount|=V<<8;X6502_IRQEnd(FCEU_IQEXT);break; } break; } } static int32 vcount[3]; static int32 dcount[3]; static int CAYBC[3]; static void DoAYSQ(int x) { int32 freq=((MapperExRAM[x<<1]|((MapperExRAM[(x<<1)+1]&15)<<8))+1)<<(4+17); int32 amp=(MapperExRAM[0x8+x]&15)<<2; int32 start,end; int V; amp+=amp>>1; start=CAYBC[x]; end=(SOUNDTS<<16)/soundtsinc; if(end<=start) return; CAYBC[x]=end; if(amp) for(V=start;V>4]+=amp; vcount[x]-=nesincsize; while(vcount[x]<=0) { dcount[x]^=1; vcount[x]+=freq; } } } static void DoAYSQHQ(int x) { int32 V; int32 freq=((MapperExRAM[x<<1]|((MapperExRAM[(x<<1)+1]&15)<<8))+1)<<4; int32 amp=(MapperExRAM[0x8+x]&15)<<6; amp+=amp>>1; if(!(MapperExRAM[0x7]&(1<>6)); else { ROM_BANK16(0x8000,(V>>5)&3); ROM_BANK16(0xc000,(V>>5)&3); } MIRROR_SET((V&0x8)>>3); } else mapbyte1[1]=V; VROM_BANK8((mapbyte1[1]&3)|(mapbyte1[0]&7)|((mapbyte1[0]&0x10)>>1)); //printf("$%04x:$%02x\n",A,V); } void Mapper57_init(void) { SetWriteHandler(0x8000,0xffff,Mapper57_write); } fceu-0.98.12/src/mappers/235.c0000644000175000000620000000267210003562764015437 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(Mapper235_write) { uint32 m; int z; if(A&0x400) onemir(0); else setmirror(((A>>13)&1)^1); m=A&0x1f; z=(A>>8)&3; if(A&0x800) { setprg16r(0x10|z,0x8000,(m<<1)|((A>>12)&1)); setprg16r(0x10|z,0xC000,(m<<1)|((A>>12)&1)); } else setprg32r(0x10|z,0x8000,m); } void Mapper235_init(void) { /* Fixme: Possible crashy bug if header is bad. */ SetupCartPRGMapping(0x10,PRGptr[0],1024*1024,0); SetupCartPRGMapping(0x12,PRGptr[0]+1024*1024,1024,0); setprg32r(0x10,0x8000,0); SetReadHandler(0x8000,0xffff,CartBROB); SetWriteHandler(0x8000,0xffff,Mapper235_write); } fceu-0.98.12/src/mappers/255.c0000644000175000000620000000327410003562764015440 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(Mapper255_write) { uint32 pbank=(A>>7)&0x1F; uint32 cbank=A&0x3F; uint32 rbank=(A>>14)&1; // printf("$%04x:$%02x\n",A,V); // printf("%2x:%2x:%2x,%2x\n",pbank,cbank,rbank,(A&0x40)>>6); if(A&0x1000) { ROM_BANK16(0x8000,((pbank|(rbank<<5))<<1)|((A&0x40)>>6)); ROM_BANK16(0xc000,((pbank|(rbank<<5))<<1)|((A&0x40)>>6)); } else { ROM_BANK32(pbank|(rbank<<5)); } MIRROR_SET((A>>13)&1); VROM_BANK8((rbank<<6)|cbank); } static DECLFW(Mapper255_wl) { // printf("Wr: $%04x:$%02x\n",A,V); mapbyte1[A&3]=V&0xF; } static DECLFR(Mapper255_read) { //printf("Rd: $%04x\n",A); return(mapbyte1[A&3]); //|(X.DB&0xF0)); } void Mapper255_init(void) { mapbyte1[0]=mapbyte1[1]=0xF; ROM_BANK32(0); VROM_BANK8(0); SetWriteHandler(0x5800,0x5FFF,Mapper255_wl); SetWriteHandler(0x8000,0xffff,Mapper255_write); SetReadHandler(0x5800,0x5FFF,Mapper255_read); } fceu-0.98.12/src/mappers/61.c0000644000175000000620000000261510003562764015351 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(Mapper61_write) { // printf("$%04x:$%02x\n",A,V); switch(A&0x30) { case 0x00: case 0x30: ROM_BANK32(A&0xF); break; case 0x20: case 0x10: ROM_BANK16(0x8000,((A&0xF)<<1)| (((A&0x20)>>4)) ); ROM_BANK16(0xC000,((A&0xF)<<1)| (((A&0x20)>>4)) ); break; } #ifdef moo if(!(A&0x10)) ROM_BANK32(A&0xF); else { ROM_BANK16(0x8000,((A&0xF)<<1)| (((A&0x10)>>4)^1) ); ROM_BANK16(0xC000,((A&0xF)<<1)| (((A&0x10)>>4)^1) ); } #endif MIRROR_SET((A&0x80)>>7); } void Mapper61_init(void) { SetWriteHandler(0x8000,0xffff,Mapper61_write); } fceu-0.98.12/src/mappers/59.c0000644000175000000620000000236610003562764015363 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static int ay; static DECLFW(Mapper59_write) { //printf("$%04x:$%02x\n",A,V); setprg32(0x8000,(A&0x70)>>4); setchr8(A&0x7); //if(A&0x100) // setprg32r(0x10,0x8000,0); ay=A; MIRROR_SET2((A&0x8)>>3); } static DECLFR(m59rd) { if(ay&0x100) return(0); else return(CartBR(A)); } void Mapper59_init(void) { setprg32(0x8000,0); SetReadHandler(0x8000,0xffff,m59rd); SetWriteHandler(0x8000,0xffff,Mapper59_write); } fceu-0.98.12/src/mappers/193.c0000644000175000000620000000056710003562764015443 0ustar joestaff00000000000000#include "mapinc.h" static DECLFW(m193w) { //printf("$%04x:$%02x\n",A,V); switch(A&3) { case 0:VROM_BANK4(0x0000,V>>2);break; case 1:VROM_BANK2(0x1000,V>>1);break; case 2:VROM_BANK2(0x1800,V>>1);break; case 3:ROM_BANK8(0x8000,V);break; } } void Mapper193_init(void) { ROM_BANK32(~0); SetWriteHandler(0x4018,0x7fff,m193w); SetReadHandler(0x4018,0x7fff,0); } fceu-0.98.12/src/mappers/50.c0000644000175000000620000000315110003562764015343 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static void FP_FASTAPASS(1) Mapper50IRQ(int a) { if(IRQa) { if(IRQCount<4096) IRQCount+=a; else { IRQa=0; X6502_IRQBegin(FCEU_IQEXT); } } } static void M50Restore(int version) { setprg8(0xc000,mapbyte1[0]); } static DECLFW(M50W) { if((A&0xD060)==0x4020) { if(A&0x100) { IRQa=V&1; if(!IRQa) IRQCount=0; X6502_IRQEnd(FCEU_IQEXT); } else { V=((V&1)<<2)|((V&2)>>1)|((V&4)>>1)|(V&8); mapbyte1[0]=V; setprg8(0xc000,V); } } } void Mapper50_init(void) { SetWriteHandler(0x4020,0x5fff,M50W); SetReadHandler(0x6000,0xffff,CartBR); MapStateRestore=M50Restore; MapIRQHook=Mapper50IRQ; setprg8(0x6000,0xF); setprg8(0x8000,0x8); setprg8(0xa000,0x9); setprg8(0xc000,0x0); setprg8(0xe000,0xB); } fceu-0.98.12/src/mappers/200.c0000644000175000000620000000212310003562764015416 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 CaH4e3 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(Mapper200_write) { // FCEU_printf("%04x, %02x\n",A,V); ROM_BANK16(0x8000,A&0x07); ROM_BANK16(0xC000,A&0x07); VROM_BANK8(A&0x07); MIRROR_SET((A&0x08)>>3); } void Mapper200_init(void) { SetWriteHandler(0x8000,0xffff,Mapper200_write); } fceu-0.98.12/src/mappers/60.c0000644000175000000620000000216710003562764015352 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 CaH4e3 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define mCount mapbyte1[0] static DECLFW(Mapper60_write) { VROM_BANK8(mCount); ROM_BANK16(0x8000,mCount); ROM_BANK16(0xc000,mCount); mCount++; mCount&=0x03; } void Mapper60_init(void) { mCount=0; SetWriteHandler(0x8000,0xFFFF,Mapper60_write); } fceu-0.98.12/src/mappers/62.c0000644000175000000620000000230010003562764015341 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 CaH4e3 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(Mapper62_write) { VROM_BANK8(((A&0x1F)<<2)|(V&0x03)); if ((A&0x20)>>5) { ROM_BANK16(0x8000,(A&0x40)|((A>>8)&0x3F)); ROM_BANK16(0xc000,(A&0x40)|((A>>8)&0x3F)); } else ROM_BANK32(((A&0x40)|((A>>8)&0x3F))>>1); MIRROR_SET((A&0x80)>>7); } void Mapper62_init(void) { SetWriteHandler(0x8000,0xffff, Mapper62_write); ROM_BANK32(0); } fceu-0.98.12/src/mappers/244.c0000644000175000000620000000215710003562764015435 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 CaH4e3 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(Mapper244_write_1) { ROM_BANK32((A-0x8065)&0x03); } static DECLFW(Mapper244_write_2) { VROM_BANK8((A-0x80A5)&0x07); } void Mapper244_init(void) { ROM_BANK32(0); SetWriteHandler(0x8065,0x80a4,Mapper244_write_1); SetWriteHandler(0x80a5,0x80e4,Mapper244_write_2); } fceu-0.98.12/src/mappers/230.c0000644000175000000620000000277210003562764015433 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 CaH4e3 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" #define rom_sw mapbyte1[0] void Mapper230_Reset(void) { rom_sw ^= 1; //1 - rom_sw; if( rom_sw ) { ROM_BANK16(0x8000,0); ROM_BANK16(0xc000,7); } else { ROM_BANK16(0x8000,8); ROM_BANK16(0xc000,39); } MIRROR_SET2(1); } static DECLFW(Mapper230_write) { if( rom_sw ) { ROM_BANK16( 0x8000, V&0x07 ); } else { if( V & 0x20 ) { ROM_BANK16( 0x8000, (V&0x1F)+8 ); ROM_BANK16( 0xc000, (V&0x1F)+8 ); } else { ROM_BANK32( ((V&0x1E) >> 1) + 4 ); } MIRROR_SET2( ((V & 0x40) >> 6) ); } } void Mapper230_init(void) { ROM_BANK16(0x8000,0); ROM_BANK16(0xc000,7); SetWriteHandler(0x8000, 0xffff, Mapper230_write); MapperReset = Mapper230_Reset; rom_sw = 1; } fceu-0.98.12/src/mappers/201.c0000644000175000000620000000221110003562764015415 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 CaH4e3 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(Mapper201_write) { // FCEU_printf("%04x, %02x\n",A,V); if (A&0x08) { ROM_BANK32(A&0x03); VROM_BANK8(A&0x03); } else { ROM_BANK32(0); VROM_BANK8(0); } } void Mapper201_init(void) { ROM_BANK32(0); VROM_BANK8(0); SetWriteHandler(0x8000,0xffff,Mapper201_write); } fceu-0.98.12/src/mappers/24and26.c0000644000175000000620000001573410027653725016215 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static void (*sfun[3])(void); #define vrctemp mapbyte1[0] #define VPSG2 mapbyte3 #define VPSG mapbyte2 static void DoSQV1(void); static void DoSQV2(void); static void DoSawV(void); static int swaparoo; static int acount=0; static void FP_FASTAPASS(1) KonamiIRQHook(int a) { #define LCYCS 341 // #define LCYCS ((227*2)+1) if(IRQa) { acount+=a*3; if(acount>=LCYCS) { doagainbub:acount-=LCYCS;IRQCount++; if(IRQCount==0x100) { X6502_IRQBegin(FCEU_IQEXT); IRQCount=IRQLatch; } if(acount>=LCYCS) goto doagainbub; } } } static DECLFW(VRC6SW) { A&=0xF003; if(A>=0x9000 && A<=0x9002) { VPSG[A&3]=V; if(sfun[0]) sfun[0](); } else if(A>=0xa000 && A<=0xa002) { VPSG[4|(A&3)]=V; if(sfun[1]) sfun[1](); } else if(A>=0xb000 && A<=0xb002) { VPSG2[A&3]=V; if(sfun[2]) sfun[2](); } } static DECLFW(Mapper24_write) { if(swaparoo) A=(A&0xFFFC)|((A>>1)&1)|((A<<1)&2); if(A>=0x9000 && A<=0xb002) { VRC6SW(A,V); return; } A&=0xF003; // if(A>=0xF000) printf("%d, %d, $%04x:$%02x\n",scanline,timestamp,A,V); switch(A&0xF003) { case 0x8000:ROM_BANK16(0x8000,V);break; case 0xB003: switch(V&0xF) { case 0x0:MIRROR_SET2(1);break; case 0x4:MIRROR_SET2(0);break; case 0x8:onemir(0);break; case 0xC:onemir(1);break; } break; case 0xC000:ROM_BANK8(0xC000,V);break; case 0xD000:VROM_BANK1(0x0000,V);break; case 0xD001:VROM_BANK1(0x0400,V);break; case 0xD002:VROM_BANK1(0x0800,V);break; case 0xD003:VROM_BANK1(0x0c00,V);break; case 0xE000:VROM_BANK1(0x1000,V);break; case 0xE001:VROM_BANK1(0x1400,V);break; case 0xE002:VROM_BANK1(0x1800,V);break; case 0xE003:VROM_BANK1(0x1c00,V);break; case 0xF000:IRQLatch=V; //acount=0; break; case 0xF001:IRQa=V&2; vrctemp=V&1; if(V&2) { IRQCount=IRQLatch; acount=0; } X6502_IRQEnd(FCEU_IQEXT); break; case 0xf002:IRQa=vrctemp; X6502_IRQEnd(FCEU_IQEXT);break; case 0xF003:break; } } static int32 CVBC[3]; static int32 vcount[3]; static int32 dcount[2]; static INLINE void DoSQV(int x) { int32 V; int32 amp=(((VPSG[x<<2]&15)<<8)*6/8)>>4; int32 start,end; start=CVBC[x]; end=(SOUNDTS<<16)/soundtsinc; if(end<=start) return; CVBC[x]=end; if(VPSG[(x<<2)|0x2]&0x80) { if(VPSG[x<<2]&0x80) { for(V=start;V>4]+=amp; } else { int32 thresh=(VPSG[x<<2]>>4)&7; int32 freq=((VPSG[(x<<2)|0x1]|((VPSG[(x<<2)|0x2]&15)<<8))+1)<<17; for(V=start;Vthresh) /* Greater than, not >=. Important. */ Wave[V>>4]+=amp; vcount[x]-=nesincsize; while(vcount[x]<=0) /* Should only be <0 in a few circumstances. */ { vcount[x]+=freq; dcount[x]=(dcount[x]+1)&15; } } } } } static void DoSQV1(void) { DoSQV(0); } static void DoSQV2(void) { DoSQV(1); } static void DoSawV(void) { int V; int32 start,end; start=CVBC[2]; end=(SOUNDTS<<16)/soundtsinc; if(end<=start) return; CVBC[2]=end; if(VPSG2[2]&0x80) { static int32 saw1phaseacc=0; uint32 freq3; static uint8 b3=0; static int32 phaseacc=0; static uint32 duff=0; freq3=(VPSG2[1]+((VPSG2[2]&15)<<8)+1); for(V=start;V>3)&0x1f)<<4)*6/8; } Wave[V>>4]+=duff; } } } static INLINE void DoSQVHQ(int x) { int32 V; int32 amp=((VPSG[x<<2]&15)<<8)*6/8; if(VPSG[(x<<2)|0x2]&0x80) { if(VPSG[x<<2]&0x80) { for(V=CVBC[x];V>4)&7; for(V=CVBC[x];Vthresh) /* Greater than, not >=. Important. */ WaveHi[V]+=amp; vcount[x]--; if(vcount[x]<=0) /* Should only be <0 in a few circumstances. */ { vcount[x]=(VPSG[(x<<2)|0x1]|((VPSG[(x<<2)|0x2]&15)<<8))+1; dcount[x]=(dcount[x]+1)&15; } } } } CVBC[x]=SOUNDTS; } static void DoSQV1HQ(void) { DoSQVHQ(0); } static void DoSQV2HQ(void) { DoSQVHQ(1); } static void DoSawVHQ(void) { static uint8 b3=0; static int32 phaseacc=0; int32 V; if(VPSG2[2]&0x80) { for(V=CVBC[2];V>3)&0x1f)<<8)*6/8; vcount[2]--; if(vcount[2]<=0) { vcount[2]=(VPSG2[1]+((VPSG2[2]&15)<<8)+1)<<1; phaseacc+=VPSG2[0]&0x3f; b3++; if(b3==7) { b3=0; phaseacc=0; } } } } CVBC[2]=SOUNDTS; } void VRC6Sound(int Count) { int x; DoSQV1(); DoSQV2(); DoSawV(); for(x=0;x<3;x++) CVBC[x]=Count; } void VRC6SoundHQ(void) { DoSQV1HQ(); DoSQV2HQ(); DoSawVHQ(); } void VRC6SyncHQ(int32 ts) { int x; for(x=0;x<3;x++) CVBC[x]=ts; } static void VRC6_ESI(void) { GameExpSound.RChange=VRC6_ESI; GameExpSound.Fill=VRC6Sound; GameExpSound.HiFill=VRC6SoundHQ; GameExpSound.HiSync=VRC6SyncHQ; memset(CVBC,0,sizeof(CVBC)); memset(vcount,0,sizeof(vcount)); memset(dcount,0,sizeof(dcount)); if(FSettings.SndRate) { if(FSettings.soundq>=1) { sfun[0]=DoSQV1HQ; sfun[1]=DoSQV2HQ; sfun[2]=DoSawVHQ; } else { sfun[0]=DoSQV1; sfun[1]=DoSQV2; sfun[2]=DoSawV; } } else memset(sfun,0,sizeof(sfun)); } void Mapper24_init(void) { SetWriteHandler(0x8000,0xffff,Mapper24_write); VRC6_ESI(); MapIRQHook=KonamiIRQHook; swaparoo=0; } void Mapper26_init(void) { SetWriteHandler(0x8000,0xffff,Mapper24_write); VRC6_ESI(); MapIRQHook=KonamiIRQHook; swaparoo=1; } void NSFVRC6_Init(void) { VRC6_ESI(); SetWriteHandler(0x8000,0xbfff,VRC6SW); } fceu-0.98.12/src/mappers/203.c0000644000175000000620000000211710003562764015424 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(Mapper203_write) { ROM_BANK16(0x8000,(V>>2)&3); ROM_BANK16(0xc000,(V>>2)&3); VROM_BANK8(V&3); } void Mapper203_init(void) { ROM_BANK16(0x8000,0); ROM_BANK16(0xc000,0); VROM_BANK8(0); SetWriteHandler(0x8000,0xFFFF,Mapper203_write); } fceu-0.98.12/src/mappers/202.c0000644000175000000620000000220410003562764015420 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(Mapper202_write) { int tmp=(A>>1)&0x7; MIRROR_SET(A&1); ROM_BANK16(0x8000,tmp); ROM_BANK16(0xc000,tmp+(((tmp&0x6)==0x6)?1:0)); VROM_BANK8(tmp); } void Mapper202_init(void) { ROM_BANK16(0x8000,0); ROM_BANK16(0xc000,0); VROM_BANK8(0); SetWriteHandler(0x8000,0xFFFF,Mapper202_write); } fceu-0.98.12/src/mappers/208.c0000644000175000000620000000753610003562765015444 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static uint8 PRGSel; static uint8 PBuf[4],PSel; static uint8 cmd; static uint8 DRegs[8]; static uint32 count=0; static uint32 last=0; static DECLFW(M208Write1) { PRGSel=(V&0x1)|((V>>3)&0x2); setprg32(0x8000,PRGSel); } static DECLFW(M208Write2) { static uint8 lut[256]={ 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59,0x59, 0x49, 0x19, 0x09, 0x59, 0x49, 0x19, 0x09, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59,0x51, 0x41, 0x11, 0x01, 0x51, 0x41, 0x11, 0x01, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59,0x59, 0x49, 0x19, 0x09, 0x59, 0x49, 0x19, 0x09, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59,0x51, 0x41, 0x11, 0x01, 0x51, 0x41, 0x11, 0x01, 0x00, 0x10, 0x40, 0x50, 0x00, 0x10, 0x40, 0x50,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x18, 0x48, 0x58, 0x08, 0x18, 0x48, 0x58,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40, 0x50, 0x00, 0x10, 0x40, 0x50,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x18, 0x48, 0x58, 0x08, 0x18, 0x48, 0x58,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59,0x58, 0x48, 0x18, 0x08, 0x58, 0x48, 0x18, 0x08, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59,0x50, 0x40, 0x10, 0x00, 0x50, 0x40, 0x10, 0x00, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59,0x58, 0x48, 0x18, 0x08, 0x58, 0x48, 0x18, 0x08, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59,0x50, 0x40, 0x10, 0x00, 0x50, 0x40, 0x10, 0x00, 0x01, 0x11, 0x41, 0x51, 0x01, 0x11, 0x41, 0x51,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x19, 0x49, 0x59, 0x09, 0x19, 0x49, 0x59,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x41, 0x51, 0x01, 0x11, 0x41, 0x51,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x19, 0x49, 0x59, 0x09, 0x19, 0x49, 0x59,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; if(A<=0x57FF) PSel=V; else PBuf[(A&0x03)]=V^lut[PSel]; } static DECLFR(M208Read) { return(PBuf[(A&0x3)]); } static void Sync(void) { int x; setchr2(0x0000,DRegs[0]>>1); setchr2(0x0800,DRegs[1]>>1); for(x=0;x<4;x++) setchr1(0x1000+x*0x400,DRegs[2+x]); } static DECLFW(M208HWrite) { switch(A&0xe001) { case 0xc000:IRQLatch=IRQCount=V;break; case 0xc001:IRQCount=IRQLatch;last=count=0;break; case 0xe000:IRQa=0;X6502_IRQEnd(FCEU_IQEXT);break; case 0xe001:IRQa=1;break; case 0x8000:cmd=V;break; case 0x8001:DRegs[cmd&7]=V; Sync(); break; } } static void M208Power(void) { PRGSel=3; setprg32(0x8000,3); SetWriteHandler(0x4800,0x4FFF,M208Write1); SetWriteHandler(0x5000,0x5fff,M208Write2); SetWriteHandler(0x8000,0xFFFF,M208HWrite); SetReadHandler(0x5800,0x5FFF,M208Read); SetReadHandler(0x8000,0xffff,CartBR); } static void sl(void) { if(IRQa) { if(IRQCount>=0) { IRQCount--; if(IRQCount<0) { X6502_IRQBegin(FCEU_IQEXT); } } } } static void FP_FASTAPASS(1) foo(uint32 A) { if((A&0x2000) && !(last&0x2000)) { count++; if(count==42) { sl(); count=0; } } last=A; } void Mapper208_Init(CartInfo *info) { info->Power=M208Power; //GameHBIRQHook=sl; PPU_hook=foo; } fceu-0.98.12/src/mappers/231.c0000644000175000000620000000221210003562765015422 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(Mapper231_write) { if(A&0x20) ROM_BANK32((A>>1)&0xF); else { ROM_BANK16(0x8000,(A&0x1E)); ROM_BANK16(0xc000,(A&0x1E)); } MIRROR_SET((A>>7)&1); } void Mapper231_init(void) { ROM_BANK16(0x8000,0); ROM_BANK16(0xc000,0); SetWriteHandler(0x8000,0xffff,Mapper231_write); } fceu-0.98.12/src/mappers/58.c0000644000175000000620000000223010003562765015351 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static DECLFW(M58Write) { //printf("$%04x:$%02x\n",A,V); if(A&0x40) { ROM_BANK16(0x8000,(A&0x07)); ROM_BANK16(0xc000,(A&0x07)); } else ROM_BANK32((A&0x06)>>1); VROM_BANK8((A&0x38)>>3); MIRROR_SET2((V&2)>>1); } void Mapper58_init(void) { ROM_BANK32(0); VROM_BANK8(0); SetWriteHandler(0x8000,0xFFFF,M58Write); } fceu-0.98.12/src/mappers/187.c0000644000175000000620000000610210003562765015436 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static uint8 LastWr; static uint8 ExtMode; static uint8 cmd; static uint8 DRegs[8]; static uint32 count=0; static uint32 last=0; static int safe=0; static uint8 poofish; static void Sync(void) { int x; uint32 base=0; if(cmd&0x80) base=0x1000; setchr2(0x0000^base,(0x100|DRegs[0])>>1); setchr2(0x0800^base,(0x100|DRegs[1])>>1); for(x=0;x<4;x++) setchr1((0x1000^base)+x*0x400,DRegs[2+x]); if(ExtMode&0x80) { if(ExtMode&0x20) setprg32(0x8000,(ExtMode&0x1F)>>1); else { setprg16(0x8000,(ExtMode&0x1F)); setprg16(0xc000,(ExtMode&0x1F)); } } else { setprg8(0x8000,DRegs[6]); setprg8(0xc000,~1); setprg8(0xa000,DRegs[7]); setprg8(0xe000,~0); } } static DECLFW(M187Write) { LastWr=V; if(A==0x5000) ExtMode=V; Sync(); } static DECLFW(M187HWrite) { //if(A==0x8003 && X.PC<0x800) FCEUI_DumpMem("dmp",0x0000,0xFFFF); //printf("$%04x:$%02x, %04x\n",A,V,X.PC); LastWr=V; if(A==0x8003) { if(V==0x28 || V==0x2A) poofish=V; } else if(A==0x8000) poofish=0; switch(A) { case 0xc000:IRQLatch=IRQCount=V;break; case 0xc001:IRQCount=IRQLatch;last=count=0;break; case 0xe000:IRQa=0;X6502_IRQEnd(FCEU_IQEXT);break; case 0xe001:IRQa=1;break; case 0xa000:MIRROR_SET(V&1);break; case 0x8000:cmd=V;safe=1;break; case 0x8001: if(safe) { //printf("Cmd: %d, %02x, %04x\n",cmd&0x7,V,X.PC); DRegs[cmd&7]=V; Sync(); safe=0; } if(poofish==0x28) setprg8(0xc000,0x17); break; } } static DECLFR(ProtRead) { switch(LastWr&0x3) { case 0x1: case 0x0: return(0x80); case 0x2: return(0x42); } return(0); } static void M187Power(void) { SetWriteHandler(0x5000,0x5fff,M187Write); SetWriteHandler(0x8000,0xFFFF,M187HWrite); SetReadHandler(0x5000,0x5FFF,ProtRead); SetWriteHandler(0x6000,0x7FFF,M187Write); SetReadHandler(0x8000,0xffff,CartBR); Sync(); } static void sl(void) { if(IRQa) { if(IRQCount>=0) { IRQCount--; if(IRQCount<0) { X6502_IRQBegin(FCEU_IQEXT); } } } } static void FP_FASTAPASS(1) foo(uint32 A) { if((A&0x2000) && !(last&0x2000)) { count++; if(count==42) { sl(); count=0; } } last=A; } void Mapper187_Init(CartInfo *info) { info->Power=M187Power; //GameHBIRQHook=sl; PPU_hook=foo; } fceu-0.98.12/src/mappers/Makefile.in0000644000175000000620000001211010003562765017014 0ustar joestaff00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AWK = @AWK@ CC = @CC@ CXX = @CXX@ DEPDIR = @DEPDIR@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ PACKAGE = @PACKAGE@ STRIP = @STRIP@ VERSION = @VERSION@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ fceu_SOURCES = *.c subdir = src/mappers mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = DIST_SOURCES = DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/mappers/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) uninstall-info-am: tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fceu-0.98.12/src/mappers/Makefile.am.inc0000644000175000000620000000222510106034715017552 0ustar joestaff00000000000000fceu_SOURCES += mappers/mmc2and4.c mappers/simple.c mappers/112.c mappers/117.c mappers/15.c mappers/151.c mappers/16.c mappers/17.c mappers/18.c mappers/180.c mappers/184.c mappers/21.c mappers/22.c mappers/225.c mappers/226.c mappers/228.c mappers/229.c mappers/23.c mappers/24and26.c mappers/240.c mappers/246.c mappers/25.c mappers/32.c mappers/33.c mappers/40.c mappers/41.c mappers/6.c mappers/65.c mappers/67.c mappers/68.c mappers/69.c mappers/71.c mappers/73.c mappers/75.c mappers/76.c mappers/79.c mappers/8.c mappers/80.c mappers/85.c mappers/95.c mappers/97.c mappers/99.c mappers/182.c mappers/46.c mappers/43.c mappers/42.c mappers/113.c mappers/86.c mappers/89.c mappers/83.c mappers/77.c mappers/92.c mappers/88.c mappers/248.c mappers/emu2413.c mappers/242.c mappers/232.c mappers/72.c mappers/234.c mappers/227.c mappers/82.c mappers/189.c mappers/51.c mappers/91.c mappers/114.c mappers/241.c mappers/235.c mappers/57.c mappers/255.c mappers/61.c mappers/59.c mappers/193.c mappers/50.c mappers/60.c mappers/62.c mappers/244.c mappers/230.c mappers/200.c mappers/201.c mappers/202.c mappers/203.c mappers/231.c mappers/208.c mappers/58.c mappers/187.c fceu-0.98.12/src/mappers/emutypes.h0000644000175000000620000000134510004532325016771 0ustar joestaff00000000000000#ifndef _EMUTYPES_H_ #define _EMUTYPES_H_ #ifndef INLINE #if defined(_MSC_VER) #define INLINE __forceinline #elif defined(__GNUC__) #define INLINE __inline__ #elif defined(_MWERKS_) #define INLINE inline #else #define INLINE #endif #endif #if defined(EMU_DLL_IMPORTS) #define EMU2149_DLL_IMPORTS #define EMU2212_DLL_IMPORTS #define EMU2413_DLL_IMPORTS #define EMU8950_DLL_IMPORTS #define EMU76489_DLL_IMPORTS #endif #ifdef __cplusplus extern "C" { #endif typedef unsigned int e_uint; typedef signed int e_int; typedef unsigned char e_uint8 ; typedef signed char e_int8 ; typedef unsigned short e_uint16 ; typedef signed short e_int16 ; typedef unsigned int e_uint32 ; typedef signed int e_int32 ; #ifdef __cplusplus } #endif #endif fceu-0.98.12/src/mappers/vrc7tone.h0000644000175000000620000000165510004603467016677 0ustar joestaff00000000000000/* VRC7 instruments, January 17, 2004 update -Xodnizel */ {0x03, 0x21, 0x04, 0x06, 0x8D, 0xF2, 0x42, 0x17}, {0x13, 0x41, 0x05, 0x0E, 0x99, 0x96, 0x63, 0x12}, {0x31, 0x11, 0x10, 0x0A, 0xF0, 0x9C, 0x32, 0x02}, {0x21, 0x61, 0x1D, 0x07, 0x9F, 0x64, 0x20, 0x27}, {0x22, 0x21, 0x1E, 0x06, 0xF0, 0x76, 0x08, 0x28}, {0x02, 0x01, 0x06, 0x00, 0xF0, 0xF2, 0x03, 0x95}, {0x21, 0x61, 0x1C, 0x07, 0x82, 0x81, 0x16, 0x07}, {0x23, 0x21, 0x1A, 0x17, 0xEF, 0x82, 0x25, 0x15}, {0x25, 0x11, 0x1F, 0x00, 0x86, 0x41, 0x20, 0x11}, {0x85, 0x01, 0x1F, 0x0F, 0xE4, 0xA2, 0x11, 0x12}, {0x07, 0xC1, 0x2B, 0x45, 0xB4, 0xF1, 0x24, 0xF4}, {0x61, 0x23, 0x11, 0x06, 0x96, 0x96, 0x13, 0x16}, {0x01, 0x02, 0xD3, 0x05, 0x82, 0xA2, 0x31, 0x51}, {0x61, 0x22, 0x0D, 0x02, 0xC3, 0x7F, 0x24, 0x05}, {0x21, 0x62, 0x0E, 0x00, 0xA1, 0xA0, 0x44, 0x17}, fceu-0.98.12/src/mbshare/0002755000175000000620000000000010111545623014722 5ustar joestaff00000000000000fceu-0.98.12/src/mbshare/mapinc.h0000644000175000000620000000037210004315530016333 0ustar joestaff00000000000000#include "../types.h" #include "../x6502.h" #include "../fceu.h" #include "../ppu.h" #include "../cart.h" #include "../memory.h" #include "../sound.h" #include "../state.h" #include "../cheat.h" #include fceu-0.98.12/src/mbshare/mmc1.c0000644000175000000620000002232510036574237015736 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 1998 BERO * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static void GenMMC1Power(void); static void GenMMC1Init(CartInfo *info, int prg, int chr, int wram, int battery); static uint8 DRegs[4]; static uint8 Buffer,BufferShift; static int mmc1opts; static void (*MMC1CHRHook4)(uint32 A, uint8 V); static void (*MMC1PRGHook16)(uint32 A, uint8 V); static uint8 *WRAM=NULL; static uint8 *CHRRAM=NULL; static int is155; static DECLFW(MBWRAM) { if(!(DRegs[3]&0x10) || is155) Page[A>>11][A]=V; // WRAM is enabled. } static DECLFR(MAWRAM) { if((DRegs[3]&0x10) && !is155) return X.DB; // WRAM is disabled return(Page[A>>11][A]); } static void MMC1CHR(void) { if(mmc1opts&4) { if(DRegs[0]&0x10) setprg8r(0x10,0x6000,(DRegs[1]>>4)&1); else setprg8r(0x10,0x6000,(DRegs[1]>>3)&1); } if(MMC1CHRHook4) { if(DRegs[0]&0x10) { MMC1CHRHook4(0x0000,DRegs[1]); MMC1CHRHook4(0x1000,DRegs[2]); } else { MMC1CHRHook4(0x0000,(DRegs[1]&0xFE)); MMC1CHRHook4(0x1000,DRegs[1]|1); } } else { if(DRegs[0]&0x10) { setchr4(0x0000,DRegs[1]); setchr4(0x1000,DRegs[2]); } else setchr8(DRegs[1]>>1); } } static void MMC1PRG(void) { uint8 offs; offs=DRegs[1]&0x10; if(MMC1PRGHook16) { switch(DRegs[0]&0xC) { case 0xC: MMC1PRGHook16(0x8000,(DRegs[3]+offs)); MMC1PRGHook16(0xC000,0xF+offs); break; case 0x8: MMC1PRGHook16(0xC000,(DRegs[3]+offs)); MMC1PRGHook16(0x8000,offs); break; case 0x0: case 0x4: MMC1PRGHook16(0x8000,((DRegs[3]&~1)+offs)); MMC1PRGHook16(0xc000,((DRegs[3]&~1)+offs+1)); break; } } else switch(DRegs[0]&0xC) { case 0xC: setprg16(0x8000,(DRegs[3]+offs)); setprg16(0xC000,0xF+offs); break; case 0x8: setprg16(0xC000,(DRegs[3]+offs)); setprg16(0x8000,offs); break; case 0x0: case 0x4: setprg16(0x8000,((DRegs[3]&~1)+offs)); setprg16(0xc000,((DRegs[3]&~1)+offs+1)); break; } } static void MMC1MIRROR(void) { switch(DRegs[0]&3) { case 2: setmirror(MI_V);break; case 3: setmirror(MI_H);break; case 0: setmirror(MI_0);break; case 1: setmirror(MI_1);break; } } static uint64 lreset; static DECLFW(MMC1_write) { int n=(A>>13)-4; //FCEU_DispMessage("%016x",timestampbase+timestamp); //printf("$%04x:$%02x, $%04x\n",A,V,X.PC); //DumpMem("out",0xe000,0xffff); /* The MMC1 is busy so ignore the write. */ /* As of version FCE Ultra 0.81, the timestamp is only increased before each instruction is executed(in other words precision isn't that great), but this should still work to deal with 2 writes in a row from a single RMW instruction. */ if( (timestampbase+timestamp)<(lreset+2)) return; if (V&0x80) { DRegs[0]|=0xC; BufferShift=Buffer=0; MMC1PRG(); lreset=timestampbase+timestamp; return; } Buffer|=(V&1)<<(BufferShift++); if (BufferShift==5) { DRegs[n] = Buffer; BufferShift = Buffer = 0; switch(n){ case 0: MMC1MIRROR(); MMC1CHR(); MMC1PRG(); break; case 1: MMC1CHR(); MMC1PRG(); break; case 2: MMC1CHR(); break; case 3: MMC1PRG(); break; } } } static void MMC1_Restore(int version) { MMC1MIRROR(); MMC1CHR(); MMC1PRG(); lreset=0; /* timestamp(base) is not stored in save states. */ } static void MMC1CMReset(void) { int i; for(i=0;i<4;i++) DRegs[i]=0; Buffer = BufferShift = 0; DRegs[0]=0x1F; DRegs[1]=0; DRegs[2]=0; // Should this be something other than 0? DRegs[3]=0; MMC1MIRROR(); MMC1CHR(); MMC1PRG(); } static int DetectMMC1WRAMSize(uint32 crc32) { switch(crc32) { default:return(8); case 0xc6182024: /* Romance of the 3 Kingdoms */ case 0x2225c20f: /* Genghis Khan */ case 0x4642dda6: /* Nobunaga's Ambition */ case 0x29449ba9: /* "" "" (J) */ case 0x2b11e0b0: /* "" "" (J) */ FCEU_printf(" >8KB external WRAM present. Use UNIF if you hack the ROM image.\n"); return(16); } } static uint32 NWCIRQCount; static uint8 NWCRec; #define NWCDIP 0xE static void FP_FASTAPASS(1) NWCIRQHook(int a) { if(!(NWCRec&0x10)) { NWCIRQCount+=a; if((NWCIRQCount|(NWCDIP<<25))>=0x3e000000) { NWCIRQCount=0; X6502_IRQBegin(FCEU_IQEXT); } } } static void NWCCHRHook(uint32 A, uint8 V) { if((V&0x10)) // && !(NWCRec&0x10)) { NWCIRQCount=0; X6502_IRQEnd(FCEU_IQEXT); } NWCRec=V; if(V&0x08) MMC1PRG(); else setprg32(0x8000,(V>>1)&3); } static void NWCPRGHook(uint32 A, uint8 V) { if(NWCRec&0x8) setprg16(A,8|(V&0x7)); else setprg32(0x8000,(NWCRec>>1)&3); } static void NWCPower(void) { GenMMC1Power(); setchr8r(0,0); } void Mapper105_Init(CartInfo *info) { GenMMC1Init(info, 256, 256, 8, 0); MMC1CHRHook4=NWCCHRHook; MMC1PRGHook16=NWCPRGHook; MapIRQHook=NWCIRQHook; info->Power=NWCPower; } static void GenMMC1Power(void) { lreset=0; if(mmc1opts&1) { FCEU_CheatAddRAM(8,0x6000,WRAM); if(mmc1opts&4) FCEU_dwmemset(WRAM,0,8192) else if(!(mmc1opts&2)) FCEU_dwmemset(WRAM,0,8192); } SetWriteHandler(0x8000,0xFFFF,MMC1_write); SetReadHandler(0x8000,0xFFFF,CartBR); if(mmc1opts&1) { SetReadHandler(0x6000,0x7FFF,MAWRAM); SetWriteHandler(0x6000,0x7FFF,MBWRAM); setprg8r(0x10,0x6000,0); } MMC1CMReset(); } static void GenMMC1Close(void) { if(CHRRAM) FCEU_gfree(CHRRAM); if(WRAM) FCEU_gfree(WRAM); CHRRAM=WRAM=NULL; } static void GenMMC1Init(CartInfo *info, int prg, int chr, int wram, int battery) { is155=0; info->Close=GenMMC1Close; MMC1PRGHook16=MMC1CHRHook4=0; mmc1opts=0; PRGmask16[0]&=(prg>>14)-1; CHRmask4[0]&=(chr>>12)-1; CHRmask8[0]&=(chr>>13)-1; if(wram) { WRAM=(uint8*)FCEU_gmalloc(wram*1024); mmc1opts|=1; if(wram>8) mmc1opts|=4; SetupCartPRGMapping(0x10,WRAM,wram*1024,1); AddExState(WRAM, wram*1024, 0, "WRAM"); if(battery) { mmc1opts|=2; info->SaveGame[0]=WRAM+((mmc1opts&4)?8192:0); info->SaveGameLen[0]=8192; } } if(!chr) { CHRRAM=(uint8*)FCEU_gmalloc(8192); SetupCartCHRMapping(0, CHRRAM, 8192, 1); AddExState(CHRRAM, 8192, 0, "CHRR"); } AddExState(DRegs, 4, 0, "DREG"); info->Power=GenMMC1Power; GameStateRestore=MMC1_Restore; AddExState(&lreset, 8, 1, "LRST"); } void Mapper1_Init(CartInfo *info) { int ws=DetectMMC1WRAMSize(info->CRC32); GenMMC1Init(info, 512, 256, ws, info->battery); } /* Same as mapper 1, without respect for WRAM enable bit. */ void Mapper155_Init(CartInfo *info) { GenMMC1Init(info,512,256,8,info->battery); is155=1; } //static void GenMMC1Init(int prg, int chr, int wram, int battery) void SAROM_Init(CartInfo *info) { GenMMC1Init(info, 128, 64, 8, info->battery); } void SBROM_Init(CartInfo *info) { GenMMC1Init(info, 128, 64, 0, 0); } void SCROM_Init(CartInfo *info) { GenMMC1Init(info, 128, 128, 0, 0); } void SEROM_Init(CartInfo *info) { GenMMC1Init(info, 32, 64, 0, 0); } void SGROM_Init(CartInfo *info) { GenMMC1Init(info, 256, 0, 0, 0); } void SKROM_Init(CartInfo *info) { GenMMC1Init(info, 256, 64, 8, info->battery); } void SLROM_Init(CartInfo *info) { GenMMC1Init(info, 256, 128, 0, 0); } void SL1ROM_Init(CartInfo *info) { GenMMC1Init(info, 128, 128, 0, 0); } /* Begin unknown - may be wrong - perhaps they use different MMC1s from the similarly functioning boards? */ void SL2ROM_Init(CartInfo *info) { GenMMC1Init(info, 256, 256, 0, 0); } void SFROM_Init(CartInfo *info) { GenMMC1Init(info, 256, 256, 0, 0); } void SHROM_Init(CartInfo *info) { GenMMC1Init(info, 256, 256, 0, 0); } /* End unknown */ /* */ /* */ void SNROM_Init(CartInfo *info) { GenMMC1Init(info, 256, 0, 8, info->battery); } void SOROM_Init(CartInfo *info) { GenMMC1Init(info, 256, 0, 16, info->battery); } fceu-0.98.12/src/mbshare/mmc3.c0000644000175000000620000004633110110477114015730 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 1998 BERO * Copyright (C) 2003 Xodnizel * Mapper 12 code Copyright (C) 2003 CaH4e3 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ /* Code for emulating iNES mappers 4, 118,119 */ #include "mapinc.h" static uint8 resetmode,MMC3_cmd,A000B,A001B; static uint8 DRegBuf[8]; static uint8 *WRAM; static uint8 *CHRRAM; static uint32 CHRRAMSize; static uint8 PPUCHRBus; static uint8 TKSMIR[8]; static uint8 EXPREGS[8]; /* For bootleg games, mostly. */ #undef IRQCount #undef IRQLatch #undef IRQa static uint8 IRQCount,IRQLatch,IRQa; static uint8 IRQReload; static SFORMAT MMC3_StateRegs[]={ {DRegBuf, 8, "REGS"}, {&resetmode, 1, "RMOD"}, {&MMC3_cmd, 1, "CMD"}, {&A000B, 1, "A000"}, {&A001B, 1, "A001"}, {&IRQReload, 1, "IRQR"}, {&IRQCount, 1, "IRQC"}, {&IRQLatch, 1, "IRQL"}, {&IRQa, 1, "IRQA"}, {0} }; static void (*pwrap)(uint32 A, uint8 V); static void (*cwrap)(uint32 A, uint8 V); static void (*mwrap)(uint8 V); static int mmc3opts=0; void GenMMC3_Init(CartInfo *info, int prg, int chr, int wram, int battery); static void GenMMC3Power(void); static void FixMMC3PRG(int V); static void FixMMC3CHR(int V); static void FixMMC3PRG(int V) { if(V&0x40) { pwrap(0xC000,DRegBuf[6]); pwrap(0x8000,~1); } else { pwrap(0x8000,DRegBuf[6]); pwrap(0xC000,~1); } pwrap(0xA000,DRegBuf[7]); pwrap(0xE000,~0); } static void FixMMC3CHR(int V) { int cbase=(V&0x80)<<5; cwrap((cbase^0x000),DRegBuf[0]&(~1)); cwrap((cbase^0x400),DRegBuf[0]|1); cwrap((cbase^0x800),DRegBuf[1]&(~1)); cwrap((cbase^0xC00),DRegBuf[1]|1); cwrap(cbase^0x1000,DRegBuf[2]); cwrap(cbase^0x1400,DRegBuf[3]); cwrap(cbase^0x1800,DRegBuf[4]); cwrap(cbase^0x1c00,DRegBuf[5]); } static void MMC3RegReset(void) { IRQCount=IRQLatch=IRQa=MMC3_cmd=0; DRegBuf[0]=0; DRegBuf[1]=2; DRegBuf[2]=4; DRegBuf[3]=5; DRegBuf[4]=6; DRegBuf[5]=7; DRegBuf[6]=0; DRegBuf[7]=1; FixMMC3PRG(0); FixMMC3CHR(0); } static DECLFW(Mapper4_write) { switch(A&0xE001) { case 0x8000: if((V&0x40) != (MMC3_cmd&0x40)) FixMMC3PRG(V); if((V&0x80) != (MMC3_cmd&0x80)) FixMMC3CHR(V); MMC3_cmd = V; break; case 0x8001: { int cbase=(MMC3_cmd&0x80)<<5; DRegBuf[MMC3_cmd&0x7]=V; switch(MMC3_cmd&0x07) { case 0: cwrap((cbase^0x000),V&(~1)); cwrap((cbase^0x400),V|1); break; case 1: cwrap((cbase^0x800),V&(~1)); cwrap((cbase^0xC00),V|1); break; case 2: cwrap(cbase^0x1000,V); break; case 3: cwrap(cbase^0x1400,V); break; case 4: cwrap(cbase^0x1800,V); break; case 5: cwrap(cbase^0x1C00,V); break; case 6: if (MMC3_cmd&0x40) pwrap(0xC000,V); else pwrap(0x8000,V); break; case 7: pwrap(0xA000,V); break; } } break; case 0xA000: if(mwrap) mwrap(V&1); break; case 0xA001: A001B=V; break; } } static DECLFW(MMC3_IRQWrite) { switch(A&0xE001) { case 0xc000:IRQLatch=V;break; case 0xc001:IRQReload = 1;break; case 0xE000:X6502_IRQEnd(FCEU_IQEXT);IRQa=0;break; case 0xE001:IRQa=1;break; } } static void ClockMMC3Counter(void) { int count = IRQCount; if(!count || IRQReload) { IRQCount = IRQLatch; IRQReload = 0; } else IRQCount--; if(count && !IRQCount) { if(IRQa) { X6502_IRQBegin(FCEU_IQEXT); } } } static void MMC3_hb(void) { ClockMMC3Counter(); } static void MMC3_hb_KickMasterHack(void) { if(scanline==238) ClockMMC3Counter(); ClockMMC3Counter(); } static void MMC3_hb_PALStarWarsHack(void) { if(scanline==240) ClockMMC3Counter(); ClockMMC3Counter(); } /* static void ClockMMC6Counter(void) { unsigned int count = IRQCount; if(!count || IRQReload) { IRQCount = IRQLatch; IRQReload = 0; } else IRQCount--; if(!IRQCount) { if(IRQa) X6502_IRQBegin(FCEU_IQEXT); } } */ /* static uint32 lasta; static void FP_FASTAPASS(1) MMC3_PPUIRQ(uint32 A) { if(A&0x2000) return; if((A&0x1000) && !(lasta&0x1000)) ClockMMC3Counter(); lasta = A; } */ static void genmmc3restore(int version) { mwrap(A000B&1); FixMMC3PRG(MMC3_cmd); FixMMC3CHR(MMC3_cmd); } static void GENCWRAP(uint32 A, uint8 V) { setchr1(A,V); } static void GENPWRAP(uint32 A, uint8 V) { setprg8(A,V&0x3F); } static void GENMWRAP(uint8 V) { A000B=V; setmirror(V^1); } static void GENNOMWRAP(uint8 V) { A000B=V; } static void M12CW(uint32 A, uint8 V) { setchr1(A,(EXPREGS[(A&0x1000)>>12]<<8)+V); } static DECLFW(M12Write) { EXPREGS[0]= V&0x01; EXPREGS[1]= (V&0x10)>>4; } static void M12_Power(void) { EXPREGS[0]=EXPREGS[1]=0; GenMMC3Power(); SetWriteHandler(0x4100,0x5FFF,M12Write); } void Mapper12_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 8, info->battery); cwrap=M12CW; info->Power=M12_Power; AddExState(EXPREGS, 2, 0, "EXPR"); } static void M47PW(uint32 A, uint8 V) { V&=0xF; V|=EXPREGS[0]<<4; setprg8(A,V); } static void M47CW(uint32 A, uint8 V) { uint32 NV=V; NV&=0x7F; NV|=EXPREGS[0]<<7; setchr1(A,NV); } static DECLFW(M47Write) { EXPREGS[0]=V&1; FixMMC3PRG(MMC3_cmd); FixMMC3CHR(MMC3_cmd); } static void M47_Power(void) { EXPREGS[0]=0; GenMMC3Power(); SetWriteHandler(0x6000,0x7FFF,M47Write); SetReadHandler(0x6000,0x7FFF,0); } void Mapper47_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 8, info->battery); pwrap=M47PW; cwrap=M47CW; info->Power=M47_Power; AddExState(EXPREGS, 1, 0, "EXPR"); } static void M44PW(uint32 A, uint8 V) { uint32 NV=V; if(EXPREGS[0]>=6) NV&=0x1F; else NV&=0x0F; NV|=EXPREGS[0]<<4; setprg8(A,NV); } static void M44CW(uint32 A, uint8 V) { uint32 NV=V; if(EXPREGS[0]<6) NV&=0x7F; NV|=EXPREGS[0]<<7; setchr1(A,NV); } static DECLFW(Mapper44_write) { if(A&1) { EXPREGS[0]=V&7; FixMMC3PRG(MMC3_cmd); FixMMC3CHR(MMC3_cmd); } else Mapper4_write(A,V); } static void M44_Power(void) { EXPREGS[0]=0; GenMMC3Power(); SetWriteHandler(0xA000,0xBFFF,Mapper44_write); } void Mapper44_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 8, info->battery); cwrap=M44CW; pwrap=M44PW; info->Power=M44_Power; AddExState(EXPREGS, 1, 0, "EXPR"); } static void M52PW(uint32 A, uint8 V) { uint32 NV=V; NV&=0x1F^((EXPREGS[0]&8)<<1); NV|=((EXPREGS[0]&6)|((EXPREGS[0]>>3)&EXPREGS[0]&1))<<4; setprg8(A,NV); } static void M52CW(uint32 A, uint8 V) { uint32 NV=V; NV&=0xFF^((EXPREGS[0]&0x40)<<1); NV|=(((EXPREGS[0]>>3)&4)|((EXPREGS[0]>>1)&2)|((EXPREGS[0]>>6)&(EXPREGS[0]>>4)&1))<<7; setchr1(A,NV); } static DECLFW(Mapper52_write) { if(EXPREGS[1]) { WRAM[A-0x6000]=V; return; } EXPREGS[1]=1; EXPREGS[0]=V; FixMMC3PRG(MMC3_cmd); FixMMC3CHR(MMC3_cmd); } static void M52Reset(void) { EXPREGS[0]=EXPREGS[1]=0; MMC3RegReset(); } static void M52Power(void) { M52Reset(); GenMMC3Power(); SetWriteHandler(0x6000,0x7FFF,Mapper52_write); } void Mapper52_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 8, info->battery); cwrap=M52CW; pwrap=M52PW; info->Reset=M52Reset; info->Power=M52Power; AddExState(EXPREGS, 2, 0, "EXPR"); } static void M45CW(uint32 A, uint8 V) { uint32 NV=V; if(EXPREGS[2]&8) NV&=(1<<( (EXPREGS[2]&7)+1 ))-1; else NV&=0; NV|=EXPREGS[0]|((EXPREGS[2]&0xF0)<<4); // &0x10(not 0xf0) is valid given the original // description of mapper 45 by kevtris, // but this fixes Super 8 in 1. setchr1(A,NV); } static void M45PW(uint32 A, uint8 V) { //V=((V&(EXPREGS[3]^0xFF))&0x3f)|EXPREGS[1]; V&=(EXPREGS[3]&0x3F)^0x3F; V|=EXPREGS[1]; //printf("$%04x, $%02x\n",A,V); setprg8(A,V); } static DECLFW(Mapper45_write) { //printf("$%02x, %d\n",V,EXPREGS[4]); if(EXPREGS[3]&0x40) { WRAM[A-0x6000]=V; return; } EXPREGS[EXPREGS[4]]=V; EXPREGS[4]=(EXPREGS[4]+1)&3; FixMMC3PRG(MMC3_cmd); FixMMC3CHR(MMC3_cmd); } static void M45Reset(void) { FCEU_dwmemset(EXPREGS,0,5); MMC3RegReset(); } static void M45Power(void) { M45Reset(); GenMMC3Power(); SetWriteHandler(0x6000,0x7FFF,Mapper45_write); } void Mapper45_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 8, info->battery); cwrap=M45CW; pwrap=M45PW; info->Reset=M45Reset; info->Power=M45Power; AddExState(EXPREGS, 5, 0, "EXPR"); } static void M49PW(uint32 A, uint8 V) { if(EXPREGS[0]&1) { V&=0xF; V|=(EXPREGS[0]&0xC0)>>2; setprg8(A,V); } else setprg32(0x8000,(EXPREGS[0]>>4)&3); } static void M49CW(uint32 A, uint8 V) { uint32 NV=V; NV&=0x7F; NV|=(EXPREGS[0]&0xC0)<<1; setchr1(A,NV); } static DECLFW(M49Write) { //printf("$%04x:$%02x\n",A,V); if(A001B&0x80) { EXPREGS[0]=V; FixMMC3PRG(MMC3_cmd); FixMMC3CHR(MMC3_cmd); } } static void M49Reset(void) { EXPREGS[0]=0; MMC3RegReset(); } static void M49Power(void) { M49Reset(); GenMMC3Power(); SetWriteHandler(0x6000,0x7FFF,M49Write); SetReadHandler(0x6000,0x7FFF,0); } void Mapper49_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 0, 0); cwrap=M49CW; pwrap=M49PW; info->Reset=M49Reset; info->Power=M49Power; AddExState(EXPREGS, 1, 0, "EXPR"); } static void M115PW(uint32 A, uint8 V) { setprg8(A,V); if(EXPREGS[0]&0x80) { setprg16(0x8000,EXPREGS[0]&7); } } static void M115CW(uint32 A, uint8 V) { setchr1(A,(uint32)V|((EXPREGS[1]&1)<<8)); } static DECLFW(M115Write) { if(A==0x6000) EXPREGS[0]=V; else if(A==0x6001) EXPREGS[1]=V; FixMMC3PRG(MMC3_cmd); } static void M115Power(void) { GenMMC3Power(); SetWriteHandler(0x6000,0x7FFF,M115Write); SetReadHandler(0x6000,0x7FFF,0); } void Mapper115_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 0, 0); cwrap=M115CW; pwrap=M115PW; info->Power=M115Power; AddExState(EXPREGS, 2, 0, "EXPR"); } static void M116PW(uint32 A, uint8 V) { // setprg8(A,(V&0xF)|((EXPREGS[1]&0x2)<<3)); // setprg8(A,(V&7)|(<<3)); setprg8(A,V); if(!(EXPREGS[1]&2)) { setprg16(0x8000,1); //EXPREGS[2]); } } static void M116CW(uint32 A, uint8 V) { //if(EXPREGS[1]&2) setchr1(A,V|((EXPREGS[0]&0x4)<<6)); //else //{ // setchr1(A,(V&7)|((EXPREGS[2])<<3)); //} } static DECLFW(M116Write) { if(A==0x4100) {EXPREGS[0]=V;setmirror(V&1);} else if(A==0x4141) EXPREGS[1]=V; else if(A==0xa000) EXPREGS[2]=V; else if(A==0x4106) EXPREGS[3]=V; FixMMC3PRG(MMC3_cmd); FixMMC3CHR(MMC3_cmd); // MIRROR_SET(0); //printf("Wr: $%04x:$%02x, $%04x, %d, %d\n",A,V,X.PC,timestamp,scanline); } static DECLFW(M116Write2) { //printf("Wr2: %04x:%02x\n",A,V); } static void M116Power(void) { EXPREGS[0]=0; EXPREGS[1]=2; EXPREGS[2]=0; EXPREGS[3]=0; GenMMC3Power(); SetWriteHandler(0x4020,0x7fff,M116Write); SetWriteHandler(0xa000,0xbfff,M116Write2); } void Mapper116_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 0, 0); cwrap=M116CW; pwrap=M116PW; info->Power=M116Power; AddExState(EXPREGS, 4, 0, "EXPR"); } static void M165CW(uint32 A, uint8 V) { //printf("%04x:%02x\n",A,V); if(V < 0x4) setchr1r(0x10, A, V); else setchr1(A,V); } void Mapper165_Init(CartInfo *info) { GenMMC3_Init(info, 512, 128, 8, info->battery); cwrap=M165CW; CHRRAM = (uint8*)FCEU_gmalloc(8192); CHRRAMSize = 8192; AddExState(CHRRAM, 8192, 0, "chrr"); SetupCartCHRMapping(0x10, CHRRAM, 8192, 1); } static DECLFW(Mapper250_write) { Mapper4_write((A&0xE000)|((A&0x400)>>10),A&0xFF); } static DECLFW(M250_IRQWrite) { MMC3_IRQWrite((A&0xE000)|((A&0x400)>>10),A&0xFF); } static void M250_Power(void) { GenMMC3Power(); SetWriteHandler(0x8000,0xBFFF,Mapper250_write); SetWriteHandler(0xC000,0xFFFF,M250_IRQWrite); } void Mapper250_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 8, info->battery); info->Power=M250_Power; } static void M249PW(uint32 A, uint8 V) { if(EXPREGS[0]&0x2) { if(V<0x20) V=(V&1)|((V>>3)&2)|((V>>1)&4)|((V<<2)&8)|((V<<2)&0x10); else { V-=0x20; V=(V&3)|((V>>1)&4)|((V>>4)&8)|((V>>2)&0x10)|((V<<3)&0x20)|((V<<2)&0xC0); } } setprg8(A,V); } static void M249CW(uint32 A, uint8 V) { if(EXPREGS[0]&0x2) V=(V&3)|((V>>1)&4)|((V>>4)&8)|((V>>2)&0x10)|((V<<3)&0x20)|((V<<2)&0xC0); setchr1(A,V); } static DECLFW(Mapper249_write) { EXPREGS[0]=V; FixMMC3PRG(MMC3_cmd); FixMMC3CHR(MMC3_cmd); } static void M249Power(void) { EXPREGS[0]=0; GenMMC3Power(); SetWriteHandler(0x5000,0x5000,Mapper249_write); } void Mapper249_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 8, info->battery); cwrap=M249CW; pwrap=M249PW; info->Power=M249Power; AddExState(EXPREGS, 1, 0, "EXPR"); } static void M245CW(uint32 A, uint8 V) { //printf("$%04x:$%02x\n",A,V); //setchr1(A,V); // EXPREGS[0]=V; FixMMC3PRG(MMC3_cmd); } static void M245PW(uint32 A, uint8 V) { setprg8(A,(V&0x3F)|((EXPREGS[0]&2)<<5)); //printf("%d\n",(V&0x3F)|((EXPREGS[0]&2)<<5)); } static void M245Power(void) { EXPREGS[0]=0; GenMMC3Power(); } void Mapper245_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 8, info->battery); info->Power=M245Power; cwrap=M245CW; pwrap=M245PW; AddExState(EXPREGS, 1, 0, "EXPR"); } void m74p(uint32 a, uint8 v) { setprg8(a,v&0x3f); } static void m74kie(uint32 a, uint8 v) { if(v==((PRGsize[0]>>16)&0x08) || v==1+((PRGsize[0]>>16)&0x08)) setchr1r(0x10,a,v); else setchr1r(0x0,a,v); } void Mapper74_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 8, info->battery); cwrap=m74kie; pwrap=m74p; CHRRAM=(uint8*)FCEU_gmalloc(2048); CHRRAMSize=2048; SetupCartCHRMapping(0x10, CHRRAM, 2048, 1); AddExState(CHRRAM, 2048, 0, "CHRR"); } static void m148kie(uint32 a, uint8 v) { if(v==128 || v==129) setchr1r(0x10,a,v); else setchr1r(0x0,a,v); } void Mapper148_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 8, info->battery); cwrap=m148kie; pwrap=m74p; CHRRAM=(uint8*)FCEU_gmalloc(2048); CHRRAMSize=2048; SetupCartCHRMapping(0x10, CHRRAM, 2048, 1); AddExState(CHRRAM, 2048, 0, "CHRR"); } static void FP_FASTAPASS(1) TKSPPU(uint32 A) { //static uint8 z; //if(A>=0x2000 || type<0) return; //if(type<0) return; A&=0x1FFF; //if(scanline>=140 && scanline<=200) {setmirror(MI_1);return;} //if(scanline>=140 && scanline<=200) // if(scanline>=190 && scanline<=200) {setmirror(MI_1);return;} // setmirror(MI_1); //printf("$%04x\n",A); A>>=10; PPUCHRBus=A; setmirror(MI_0+TKSMIR[A]); } static void TKSWRAP(uint32 A, uint8 V) { TKSMIR[A>>10]=V>>7; setchr1(A,V&0x7F); if(PPUCHRBus==(A>>10)) setmirror(MI_0+(V>>7)); } static void TQWRAP(uint32 A, uint8 V) { setchr1r((V&0x40)>>2,A,V&0x3F); } static int wrams; static DECLFW(MBWRAM) { WRAM[A-0x6000]=V; } static DECLFR(MAWRAM) { return(WRAM[A-0x6000]); } static DECLFW(MBWRAMMMC6) { WRAM[A&0x3ff]=V; } static DECLFR(MAWRAMMMC6) { return(WRAM[A&0x3ff]); } static void GenMMC3Power(void) { SetWriteHandler(0x8000,0xBFFF,Mapper4_write); SetReadHandler(0x8000,0xFFFF,CartBR); SetWriteHandler(0xC000,0xFFFF,MMC3_IRQWrite); A001B=A000B=0; setmirror((A000B&1)^1); if(mmc3opts&1) { if(wrams==1024) { FCEU_CheatAddRAM(1,0x7000,WRAM); SetReadHandler(0x7000,0x7FFF,MAWRAMMMC6); SetWriteHandler(0x7000,0x7FFF,MBWRAMMMC6); } else { FCEU_CheatAddRAM(wrams/1024,0x6000,WRAM); SetReadHandler(0x6000,0x6000+wrams-1,MAWRAM); SetWriteHandler(0x6000,0x6000+wrams-1,MBWRAM); } if(!(mmc3opts&2)) FCEU_dwmemset(WRAM,0,wrams); } MMC3RegReset(); if(CHRRAM) FCEU_dwmemset(CHRRAM,0,CHRRAMSize); } static void GenMMC3Close(void) { if(CHRRAM) FCEU_gfree(CHRRAM); if(WRAM) FCEU_gfree(WRAM); CHRRAM=WRAM=NULL; } void GenMMC3_Init(CartInfo *info, int prg, int chr, int wram, int battery) { pwrap=GENPWRAP; cwrap=GENCWRAP; mwrap=GENMWRAP; wrams=wram*1024; PRGmask8[0]&=(prg>>13)-1; CHRmask1[0]&=(chr>>10)-1; CHRmask2[0]&=(chr>>11)-1; if(wram) { mmc3opts|=1; WRAM=(uint8*)FCEU_gmalloc(wram*1024); AddExState(WRAM, wram*1024, 0, "WRAM"); } if(battery) { mmc3opts|=2; info->SaveGame[0]=WRAM; info->SaveGameLen[0]=wram*1024; } if(!chr) { CHRRAM=(uint8*)FCEU_gmalloc(8192); CHRRAMSize=8192; SetupCartCHRMapping(0, CHRRAM, 8192, 1); AddExState(CHRRAM, 8192, 0, "CHRR"); } AddExState(MMC3_StateRegs, ~0, 0, 0); info->Power=GenMMC3Power; info->Reset=MMC3RegReset; info->Close=GenMMC3Close; //PPU_hook=MMC3_PPUIRQ; if(info->CRC32 == 0x5104833e) // Kick Master GameHBIRQHook = MMC3_hb_KickMasterHack; else if(info->CRC32 == 0xfcd772eb) // PAL Star Wars, similar problem as Kick Master. GameHBIRQHook = MMC3_hb_PALStarWarsHack; else GameHBIRQHook=MMC3_hb; GameStateRestore=genmmc3restore; } static int hackm4=0; /* For Karnov, maybe others. BLAH. Stupid iNES format.*/ static void Mapper4Power(void) { GenMMC3Power(); A000B=(hackm4^1)&1; setmirror(hackm4); } void Mapper4_Init(CartInfo *info) { int ws=8; if((info->CRC32==0x93991433 || info->CRC32==0xaf65aa84)) { FCEU_printf("Low-G-Man can not work normally in the iNES format.\nThis game has been recognized by its CRC32 value, and the appropriate changes will be made so it will run.\nIf you wish to hack this game, you should use the UNIF format for your hack.\n\n"); ws=0; } GenMMC3_Init(info,512,256,ws,info->battery); info->Power=Mapper4Power; hackm4=info->mirror; } void Mapper118_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 8, info->battery); cwrap=TKSWRAP; mwrap=GENNOMWRAP; PPU_hook=TKSPPU; AddExState(&PPUCHRBus, 1, 0, "PPUC"); } void Mapper119_Init(CartInfo *info) { GenMMC3_Init(info, 512, 64, 0, 0); cwrap=TQWRAP; CHRRAM=(uint8*)FCEU_gmalloc(8192); CHRRAMSize=8192; SetupCartCHRMapping(0x10, CHRRAM, 8192, 1); } void TEROM_Init(CartInfo *info) { GenMMC3_Init(info, 32, 32, 0, 0); } void TFROM_Init(CartInfo *info) { GenMMC3_Init(info, 512, 64, 0, 0); } void TGROM_Init(CartInfo *info) { GenMMC3_Init(info, 512, 0, 0, 0); } void TKROM_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 8, info->battery); } void TLROM_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 0, 0); } void TSROM_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 8, 0); } void TLSROM_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 8, 0); cwrap=TKSWRAP; mwrap=GENNOMWRAP; PPU_hook=TKSPPU; AddExState(&PPUCHRBus, 1, 0, "PPUC"); } void TKSROM_Init(CartInfo *info) { GenMMC3_Init(info, 512, 256, 8, info->battery); cwrap=TKSWRAP; mwrap=GENNOMWRAP; PPU_hook=TKSPPU; AddExState(&PPUCHRBus, 1, 0, "PPUC"); } void TQROM_Init(CartInfo *info) { GenMMC3_Init(info, 512, 64, 0, 0); cwrap=TQWRAP; CHRRAM=(uint8*)FCEU_gmalloc(8192); CHRRAMSize=8192; SetupCartCHRMapping(0x10, CHRRAM, 8192, 1); } /* MMC6 board */ void HKROM_Init(CartInfo *info) { GenMMC3_Init(info, 512, 512, 1, info->battery); } fceu-0.98.12/src/mbshare/mmc5.c0000644000175000000620000004671510110502654015736 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ /* None of this code should use any of the iNES bank switching wrappers. */ #include "mapinc.h" static void (*sfun)(int P); static void (*psfun)(void); void MMC5RunSound(int Count); void MMC5RunSoundHQ(void); static INLINE void MMC5SPRVROM_BANK1(uint32 A,uint32 V) { if(CHRptr[0]) { V&=CHRmask1[0]; MMC5SPRVPage[(A)>>10]=&CHRptr[0][(V)<<10]-(A); } } static INLINE void MMC5BGVROM_BANK1(uint32 A,uint32 V) {if(CHRptr[0]){V&=CHRmask1[0];MMC5BGVPage[(A)>>10]=&CHRptr[0][(V)<<10]-(A);}} static INLINE void MMC5SPRVROM_BANK2(uint32 A,uint32 V) {if(CHRptr[0]){V&=CHRmask2[0];MMC5SPRVPage[(A)>>10]=MMC5SPRVPage[((A)>>10)+1]=&CHRptr[0][(V)<<11]-(A);}} static INLINE void MMC5BGVROM_BANK2(uint32 A,uint32 V) {if(CHRptr[0]){V&=CHRmask2[0];MMC5BGVPage[(A)>>10]=MMC5BGVPage[((A)>>10)+1]=&CHRptr[0][(V)<<11]-(A);}} static INLINE void MMC5SPRVROM_BANK4(uint32 A,uint32 V) {if(CHRptr[0]){V&=CHRmask4[0];MMC5SPRVPage[(A)>>10]=MMC5SPRVPage[((A)>>10)+1]= MMC5SPRVPage[((A)>>10)+2]=MMC5SPRVPage[((A)>>10)+3]=&CHRptr[0][(V)<<12]-(A);}} static INLINE void MMC5BGVROM_BANK4(uint32 A,uint32 V) {if(CHRptr[0]){V&=CHRmask4[0];MMC5BGVPage[(A)>>10]=MMC5BGVPage[((A)>>10)+1]=MMC5BGVPage[((A)>>10)+2]=MMC5BGVPage[((A)>>10)+3]=&CHRptr[0][(V)<<12]-(A);}} static INLINE void MMC5SPRVROM_BANK8(uint32 V) {if(CHRptr[0]){V&=CHRmask8[0];MMC5SPRVPage[0]=MMC5SPRVPage[1]=MMC5SPRVPage[2]=MMC5SPRVPage[3]=MMC5SPRVPage[4]=MMC5SPRVPage[5]=MMC5SPRVPage[6]=MMC5SPRVPage[7]=&CHRptr[0][(V)<<13];}} static INLINE void MMC5BGVROM_BANK8(uint32 V) {if(CHRptr[0]){V&=CHRmask8[0];MMC5BGVPage[0]=MMC5BGVPage[1]=MMC5BGVPage[2]=MMC5BGVPage[3]=MMC5BGVPage[4]=MMC5BGVPage[5]=MMC5BGVPage[6]=MMC5BGVPage[7]=&CHRptr[0][(V)<<13];}} static uint8 PRGBanks[4]; static uint8 WRAMPage; static uint8 CHRBanksA[8], CHRBanksB[4]; static uint8 WRAMMaskEnable[2]; static uint8 ABMode; /* A=0, B=1 */ static uint8 IRQScanline,IRQEnable; static uint8 CHRMode, NTAMirroring, NTFill, ATFill; static uint8 MMC5IRQR; static uint8 MMC5LineCounter; static uint8 mmc5psize, mmc5vsize; static uint8 mul[2]; static uint8 *WRAM=NULL; static uint8 *MMC5fill=NULL; static uint8 *ExRAM=NULL; static uint8 MMC5WRAMsize; static uint8 MMC5WRAMIndex[8]; static uint8 MMC5ROMWrProtect[4]; static uint8 MMC5MemIn[5]; static void MMC5CHRA(void); static void MMC5CHRB(void); typedef struct __cartdata { uint32 crc32; uint8 size; } cartdata; // ETROM seems to have 16KB of WRAM, ELROM seems to have 8KB // EWROM seems to have 32KB of WRAM #define MMC5_NOCARTS 14 cartdata MMC5CartList[MMC5_NOCARTS]= { {0x9c18762b,2}, /* L'Empereur */ {0x26533405,2}, {0x6396b988,2}, {0xaca15643,2}, /* Uncharted Waters */ {0xfe3488d1,2}, /* Dai Koukai Jidai */ {0x15fe6d0f,2}, /* BKAC */ {0x39f2ce4b,2}, /* Suikoden */ {0x8ce478db,2}, /* Nobunaga's Ambition 2 */ {0xeee9a682,2}, {0x1ced086f,2}, /* Ishin no Arashi */ {0xf540677b,4}, /* Nobunaga...Bushou Fuuun Roku */ {0x6f4e4312,4}, /* Aoki Ookami..Genchou */ {0xf011e490,4}, /* Romance of the 3 Kingdoms 2 */ {0x184c2124,4}, /* Sangokushi 2 */ }; int DetectMMC5WRAMSize(uint32 crc32) { int x; for(x=0;x8KB external WRAM present. Use UNIF if you hack the ROM image.\n"); return(MMC5CartList[x].size*8); } return(8); } static void BuildWRAMSizeTable(void) { int x; for(x=0;x<8;x++) { switch(MMC5WRAMsize) { case 0:MMC5WRAMIndex[x]=255;break; case 1:MMC5WRAMIndex[x]=(x>3)?255:0;break; case 2:MMC5WRAMIndex[x]=(x&4)>>2;break; case 4:MMC5WRAMIndex[x]=(x>3)?255:(x&3);break; } } } static void MMC5CHRA(void) { int x; switch(mmc5vsize&3) { case 0:setchr8(CHRBanksA[7]); MMC5SPRVROM_BANK8(CHRBanksA[7]); break; case 1:setchr4(0x0000,CHRBanksA[3]); setchr4(0x1000,CHRBanksA[7]); MMC5SPRVROM_BANK4(0x0000,CHRBanksA[3]); MMC5SPRVROM_BANK4(0x1000,CHRBanksA[7]); break; case 2:setchr2(0x0000,CHRBanksA[1]); setchr2(0x0800,CHRBanksA[3]); setchr2(0x1000,CHRBanksA[5]); setchr2(0x1800,CHRBanksA[7]); MMC5SPRVROM_BANK2(0x0000,CHRBanksA[1]); MMC5SPRVROM_BANK2(0x0800,CHRBanksA[3]); MMC5SPRVROM_BANK2(0x1000,CHRBanksA[5]); MMC5SPRVROM_BANK2(0x1800,CHRBanksA[7]); break; case 3: for(x=0;x<8;x++) { setchr1(x<<10,CHRBanksA[x]); MMC5SPRVROM_BANK1(x<<10,CHRBanksA[x]); } break; } } static void MMC5CHRB(void) { int x; switch(mmc5vsize&3) { case 0: setchr8(CHRBanksB[3]); MMC5BGVROM_BANK8(CHRBanksB[3]); break; case 1: setchr4(0x0000,CHRBanksB[3]); setchr4(0x1000,CHRBanksB[3]); MMC5BGVROM_BANK4(0x0000,CHRBanksB[3]); MMC5BGVROM_BANK4(0x1000,CHRBanksB[3]); break; case 2: setchr2(0x0000,CHRBanksB[1]); setchr2(0x0800,CHRBanksB[3]); setchr2(0x1000,CHRBanksB[1]); setchr2(0x1800,CHRBanksB[3]); MMC5BGVROM_BANK2(0x0000,CHRBanksB[1]); MMC5BGVROM_BANK2(0x0800,CHRBanksB[3]); MMC5BGVROM_BANK2(0x1000,CHRBanksB[1]); MMC5BGVROM_BANK2(0x1800,CHRBanksB[3]); break; case 3: for(x=0;x<8;x++) { setchr1(x<<10,CHRBanksB[x&3]); MMC5BGVROM_BANK1(x<<10,CHRBanksB[x&3]); } break; } } static void FASTAPASS(2) MMC5WRAM(uint32 A, uint32 V) { //printf("%02x\n",V); V=MMC5WRAMIndex[V&7]; if(V!=255) { setprg8r(0x10,A,V); MMC5MemIn[(A-0x6000)>>13]=1; } else MMC5MemIn[(A-0x6000)>>13]=0; } static void MMC5PRG(void) { int x; switch(mmc5psize&3) { case 0: MMC5ROMWrProtect[0]=MMC5ROMWrProtect[1]= MMC5ROMWrProtect[2]=MMC5ROMWrProtect[3]=1; setprg32(0x8000,((PRGBanks[1]&0x7F)>>2)); for(x=0;x<4;x++) MMC5MemIn[1+x]=1; break; case 1: if(PRGBanks[1]&0x80) { MMC5ROMWrProtect[0]=MMC5ROMWrProtect[1]=1; setprg16(0x8000,(PRGBanks[1]>>1)); MMC5MemIn[1]=MMC5MemIn[2]=1; } else { MMC5ROMWrProtect[0]=MMC5ROMWrProtect[1]=0; MMC5WRAM(0x8000,PRGBanks[1]&7&0xFE); MMC5WRAM(0xA000,(PRGBanks[1]&7&0xFE)+1); } MMC5MemIn[3]=MMC5MemIn[4]=1; MMC5ROMWrProtect[2]=MMC5ROMWrProtect[3]=1; setprg16(0xC000,(PRGBanks[3]&0x7F)>>1); break; case 2: if(PRGBanks[1]&0x80) { MMC5MemIn[1]=MMC5MemIn[2]=1; MMC5ROMWrProtect[0]=MMC5ROMWrProtect[1]=1; setprg16(0x8000,(PRGBanks[1]&0x7F)>>1); } else { MMC5ROMWrProtect[0]=MMC5ROMWrProtect[1]=0; MMC5WRAM(0x8000,PRGBanks[1]&7&0xFE); MMC5WRAM(0xA000,(PRGBanks[1]&7&0xFE)+1); } if(PRGBanks[2]&0x80) {MMC5ROMWrProtect[2]=1;MMC5MemIn[3]=1;setprg8(0xC000,PRGBanks[2]&0x7F);} else {MMC5ROMWrProtect[2]=0;MMC5WRAM(0xC000,PRGBanks[2]&7);} MMC5MemIn[4]=1; MMC5ROMWrProtect[3]=1; setprg8(0xE000,PRGBanks[3]&0x7F); break; case 3: for(x=0;x<3;x++) if(PRGBanks[x]&0x80) { MMC5ROMWrProtect[x]=1; setprg8(0x8000+(x<<13),PRGBanks[x]&0x7F); MMC5MemIn[1+x]=1; } else { MMC5ROMWrProtect[x]=0; MMC5WRAM(0x8000+(x<<13),PRGBanks[x]&7); } MMC5MemIn[4]=1; MMC5ROMWrProtect[3]=1; setprg8(0xE000,PRGBanks[3]&0x7F); break; } } static DECLFW(Mapper5_write) { if(A >= 0x5120 && A<=0x5127) { ABMode = 0; CHRBanksA[A&7]=V; MMC5CHRA(); } else switch(A) { default: //printf("$%04x, $%02x\n",A,V); break; case 0x5105: { int x; for(x=0;x<4;x++) { switch((V>>(x<<1))&3) { case 0:PPUNTARAM|=1<>3)&0x1F;break; case 0x5202:MMC5HackSPPage=V&0x3F;break; case 0x5203:X6502_IRQEnd(FCEU_IQEXT);IRQScanline=V;break; case 0x5204:X6502_IRQEnd(FCEU_IQEXT);IRQEnable=V&0x80;break; case 0x5205:mul[0]=V;break; case 0x5206:mul[1]=V;break; } } static DECLFR(MMC5_ReadROMRAM) { if(MMC5MemIn[(A-0x6000)>>13]) return Page[A>>11][A]; else return X.DB; } static DECLFW(MMC5_WriteROMRAM) { if(A>=0x8000) if(MMC5ROMWrProtect[(A-0x8000)>>13]) return; if(MMC5MemIn[(A-0x6000)>>13]) if(((WRAMMaskEnable[0]&3)|((WRAMMaskEnable[1]&3)<<2)) == 6) Page[A>>11][A]=V; } static DECLFW(MMC5_ExRAMWr) { if(MMC5HackCHRMode!=3) ExRAM[A&0x3ff]=V; } static DECLFR(MMC5_ExRAMRd) { /* Not sure if this is correct, so I'll comment it out for now. */ //if(MMC5HackCHRMode>=2) return ExRAM[A&0x3ff]; //else // return(X.DB); } static DECLFR(MMC5_read) { switch(A) { //default:printf("$%04x\n",A);break; case 0x5204:X6502_IRQEnd(FCEU_IQEXT); { uint8 x; x=MMC5IRQR; if(!fceuindbg) MMC5IRQR&=0x40; return x; } case 0x5205:return (mul[0]*mul[1]); case 0x5206:return ((mul[0]*mul[1])>>8); } return(X.DB); } void MMC5Synco(void) { int x; MMC5PRG(); for(x=0;x<4;x++) { switch((NTAMirroring>>(x<<1))&3) { case 0:PPUNTARAM|=1<>4]+=MMC5Sound.raw<<1; } static void Do5PCMHQ() { int32 V; if(!(MMC5Sound.rawcontrol&0x40) && MMC5Sound.raw) for(V=MMC5Sound.BC[2];V>2); MMC5Sound.env[A>>2]=V; break; case 0x2: case 0x6:if(sfun) sfun(A>>2); MMC5Sound.wl[A>>2]&=~0x00FF; MMC5Sound.wl[A>>2]|=V&0xFF; break; case 0x3: case 0x7://printf("%04x:$%02x\n",A,V>>3); MMC5Sound.wl[A>>2]&=~0x0700; MMC5Sound.wl[A>>2]|=(V&0x07)<<8; MMC5Sound.running|=1<<(A>>2); break; case 0x15:if(sfun) { sfun(0); sfun(1); } MMC5Sound.running&=V; MMC5Sound.enable=V; //printf("%02x\n",V); break; } } static void Do5SQ(int P) { static int tal[4]={1,2,4,6}; int32 V,amp,rthresh,wl; int32 start,end; start=MMC5Sound.BC[P]; end=(SOUNDTS<<16)/soundtsinc; if(end<=start) return; MMC5Sound.BC[P]=end; wl=MMC5Sound.wl[P]+1; amp=(MMC5Sound.env[P]&0xF)<<4; rthresh=tal[(MMC5Sound.env[P]&0xC0)>>6]; if(wl>=8 && (MMC5Sound.running&(P+1))) { int dc,vc; wl<<=18; dc=MMC5Sound.dcount[P]; vc=MMC5Sound.vcount[P]; for(V=start;V>4]+=amp; vc-=nesincsize; while(vc<=0) { vc+=wl; dc=(dc+1)&7; } } MMC5Sound.dcount[P]=dc; MMC5Sound.vcount[P]=vc; } } static void Do5SQHQ(int P) { static int tal[4]={1,2,4,6}; int32 V,amp,rthresh,wl; wl=MMC5Sound.wl[P]+1; amp=((MMC5Sound.env[P]&0xF)<<8); rthresh=tal[(MMC5Sound.env[P]&0xC0)>>6]; if(wl>=8 && (MMC5Sound.running&(P+1))) { int dc,vc; wl<<=1; dc=MMC5Sound.dcount[P]; vc=MMC5Sound.vcount[P]; for(V=MMC5Sound.BC[P];V=1) { sfun=Do5SQHQ; psfun=Do5PCMHQ; } else { sfun=Do5SQ; psfun=Do5PCM; } } else { sfun=0; psfun=0; } memset(MMC5Sound.BC,0,sizeof(MMC5Sound.BC)); memset(MMC5Sound.vcount,0,sizeof(MMC5Sound.vcount)); GameExpSound.HiSync=MMC5HiSync; } void NSFMMC5_Init(void) { memset(&MMC5Sound,0,sizeof(MMC5Sound)); mul[0]=mul[1]=0; ExRAM=(uint8*)FCEU_gmalloc(1024); Mapper5_ESI(); SetWriteHandler(0x5c00,0x5fef,MMC5_ExRAMWr); SetReadHandler(0x5c00,0x5fef,MMC5_ExRAMRd); MMC5HackCHRMode=2; SetWriteHandler(0x5000,0x5015,Mapper5_SW); SetWriteHandler(0x5205,0x5206,Mapper5_write); SetReadHandler(0x5205,0x5206,MMC5_read); } void NSFMMC5_Close(void) { FCEU_gfree(ExRAM); ExRAM=0; } static void GenMMC5Reset(void) { int x; for(x=0;x<4;x++) PRGBanks[x]=~0; for(x=0;x<8;x++) CHRBanksA[x]=~0; for(x=0;x<4;x++) CHRBanksB[x]=~0; WRAMMaskEnable[0]=WRAMMaskEnable[1]=~0; mmc5psize=mmc5vsize=3; CHRMode=0; NTAMirroring=NTFill=ATFill=0xFF; MMC5Synco(); SetWriteHandler(0x4020,0x5bff,Mapper5_write); SetReadHandler(0x4020,0x5bff,MMC5_read); SetWriteHandler(0x5c00,0x5fff,MMC5_ExRAMWr); SetReadHandler(0x5c00,0x5fff,MMC5_ExRAMRd); SetWriteHandler(0x6000,0xFFFF,MMC5_WriteROMRAM); SetReadHandler(0x6000,0xFFFF,MMC5_ReadROMRAM); SetWriteHandler(0x5000,0x5015,Mapper5_SW); SetWriteHandler(0x5205,0x5206,Mapper5_write); SetReadHandler(0x5205,0x5206,MMC5_read); //GameHBIRQHook=MMC5_hb; FCEU_CheatAddRAM(8,0x6000,WRAM); FCEU_CheatAddRAM(1,0x5c00,ExRAM); } static SFORMAT MMC5_StateRegs[]={ { PRGBanks, 4, "PRGB"}, { CHRBanksA, 8, "CHRA"}, { CHRBanksB, 4, "CHRB"}, { &WRAMPage, 1, "WRMP"}, { WRAMMaskEnable, 2, "WRME"}, { &ABMode, 1, "ABMD"}, { &IRQScanline, 1, "IRQS"}, { &IRQEnable, 1, "IRQE"}, { &CHRMode, 1, "CHRM"}, { &NTAMirroring, 1, "NTAM"}, { &NTFill, 1, "NTFL"}, { &ATFill, 1, "ATFL"}, { &MMC5Sound.wl[0], 2|FCEUSTATE_RLSB, "SDW0"}, { &MMC5Sound.wl[1], 2|FCEUSTATE_RLSB, "SDW1"}, { MMC5Sound.env, 2, "SDEV"}, { &MMC5Sound.enable, 1, "SDEN"}, { &MMC5Sound.running, 1, "SDRU"}, { &MMC5Sound.raw, 1, "SDRW"}, { &MMC5Sound.rawcontrol, 1, "SDRC"}, {0} }; static void GenMMC5_Init(CartInfo *info, int wsize, int battery) { if(wsize) { WRAM=(uint8*)FCEU_gmalloc(wsize*1024); SetupCartPRGMapping(0x10,WRAM,wsize*1024,1); AddExState(WRAM, wsize*1024, 0, "WRAM"); } MMC5fill=(uint8*)FCEU_gmalloc(1024); ExRAM=(uint8*)FCEU_gmalloc(1024); AddExState(MMC5_StateRegs, ~0, 0, 0); AddExState(WRAM, wsize*1024, 0, "WRAM"); AddExState(ExRAM, 1024, 0, "ERAM"); AddExState(&MMC5HackSPMode, 1, 0, "SPLM"); AddExState(&MMC5HackSPScroll, 1, 0, "SPLS"); AddExState(&MMC5HackSPPage, 1, 0, "SPLP"); MMC5WRAMsize=wsize/8; BuildWRAMSizeTable(); GameStateRestore=MMC5_StateRestore; info->Power=GenMMC5Reset; if(battery) { info->SaveGame[0]=WRAM; if(wsize<=16) info->SaveGameLen[0]=8192; else info->SaveGameLen[0]=32768; } MMC5HackVROMMask=CHRmask4[0]; MMC5HackExNTARAMPtr=ExRAM; MMC5Hack=1; MMC5HackVROMPTR=CHRptr[0]; MMC5HackCHRMode=0; MMC5HackSPMode=MMC5HackSPScroll=MMC5HackSPPage=0; Mapper5_ESI(); } void Mapper5_Init(CartInfo *info) { GenMMC5_Init(info, DetectMMC5WRAMSize(info->CRC32), info->battery); } // ELROM seems to have 0KB of WRAM // EKROM seems to have 8KB of WRAM // ETROM seems to have 16KB of WRAM // EWROM seems to have 32KB of WRAM // ETROM and EWROM are battery-backed, EKROM isn't. void ETROM_Init(CartInfo *info) { GenMMC5_Init(info, 16,info->battery); } void ELROM_Init(CartInfo *info) { GenMMC5_Init(info,0,0); } void EWROM_Init(CartInfo *info) { GenMMC5_Init(info,32,info->battery); } void EKROM_Init(CartInfo *info) { GenMMC5_Init(info,8,info->battery); } fceu-0.98.12/src/mbshare/maxicart.c0000644000175000000620000000352410003562765016706 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 1998 BERO * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapsafe.h" typedef struct { uint8 PRGSelect; uint8 RAMSelect; } M125Data; static M125Data Mapper125; static DECLFW(M125w) { if(A==0x5000) { Mapper125.PRGSelect=V&0xF; setprg32(0x8000,V&0xF); } else if(A==0x5001) { Mapper125.RAMSelect=V&0x33; setchr8(V&3); setprg8r(0x10,0x6000,(V>>4)&3); } } static void M125_Reset(void) { } static void M125_Power(void) { SetReadHandler(0x6000,0xFFFF,CartBR); SetWriteHandler(0x5000,0x5001,M125w); SetWriteHandler(0x6000,0x7FFF,CartBW); setprg32(0x8000,~0); } static void M125_Restore(int version) { setprg32(0x8000,Mapper125.PRGSelect&0xF); setchr8(Mapper125.RAMSelect&3); setprg8r(0x10,0x6000,(Mapper125.RAMSelect>>4)&3); } int Mapper125_init(void) { info->Reset=M125_Reset; info->Power=M125_Power; info->StateRestore=M125_Restore; AddExState(&Mapper125.RAMSelect, 1, 0, "RAMS"); AddExState(&Mapper125.PRGSelect, 1, 0, "PRGS"); if(battery) { info->SaveGame[0]=Mapper125->WRAM; info->SaveGameLen[0]=32768; } return(1); } fceu-0.98.12/src/mbshare/tengen.c0000644000175000000620000001077410003562765016363 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static uint8 cmd,mir,rmode,IRQmode; static uint8 DRegs[11]; static uint8 IRQCount,IRQa,IRQLatch; static SFORMAT Rambo_StateRegs[]={ {&cmd, 1, "CMD"}, {&mir, 1, "MIR"}, {&rmode, 1, "RMOD"}, {&IRQmode, 1, "IRQM"}, {&IRQCount, 1, "IRQC"}, {&IRQa, 1, "IRQA"}, {&IRQLatch, 1, "IRQL"}, {DRegs, 11, "DREG"}, {0} }; static void FP_FASTAPASS(2) (*setchr1wrap)(unsigned int A, unsigned int V); static int nomirror; static void FP_FASTAPASS(1) RAMBO1_IRQHook(int a) { static int smallcount; if(!IRQmode) return; smallcount+=a; while(smallcount>=4) { smallcount-=4; IRQCount--; if(IRQCount==0xFF) { if(IRQa) { //printf("IRQ: %d\n",scanline); //rmode = 1; X6502_IRQBegin(FCEU_IQEXT); } } } } static void RAMBO1_hb(void) { if(IRQmode) return; if(scanline==240) return; /* hmm. Maybe that should be an mmc3-only call in fce.c. */ rmode=0; IRQCount--; if(IRQCount==0xFF) { if(IRQa) { rmode = 1; X6502_IRQBegin(FCEU_IQEXT); } } } static void Synco(void) { int x; if(cmd&0x20) { setchr1wrap(0x0000,DRegs[0]); setchr1wrap(0x0800,DRegs[1]); setchr1wrap(0x0400,DRegs[8]); setchr1wrap(0x0c00,DRegs[9]); } else { setchr1wrap(0x0000,(DRegs[0]&0xFE)); setchr1wrap(0x0400,(DRegs[0]&0xFE)|1); setchr1wrap(0x0800,(DRegs[1]&0xFE)); setchr1wrap(0x0C00,(DRegs[1]&0xFE)|1); } for(x=0;x<4;x++) setchr1wrap(0x1000+x*0x400,DRegs[2+x]); setprg8(0x8000,DRegs[6]); setprg8(0xA000,DRegs[7]); setprg8(0xC000,DRegs[10]); } static DECLFW(RAMBO1_write) { //if(A>=0xC000 && A<=0xFFFF) printf("$%04x:$%02x, %d, %d\n",A,V,scanline,timestamp); switch(A&0xF001) { case 0xa000:mir=V&1; if(!nomirror) setmirror(mir^1); break; case 0x8000:cmd = V; break; case 0x8001: if((cmd&0xF)<10) DRegs[cmd&0xF]=V; else if((cmd&0xF)==0xF) DRegs[10]=V; Synco(); break; case 0xc000:IRQLatch=V; if(rmode==1) { IRQCount=IRQLatch; } break; case 0xc001:rmode=1; IRQCount=IRQLatch; IRQmode=V&1; break; case 0xE000:IRQa=0;X6502_IRQEnd(FCEU_IQEXT); if(rmode==1) {IRQCount=IRQLatch;} break; case 0xE001:IRQa=1; if(rmode==1) {IRQCount=IRQLatch;} break; } } static void RAMBO1_Restore(int version) { Synco(); if(!nomirror) setmirror(mir^1); } static void RAMBO1_init(void) { int x; for(x=0;x<11;x++) DRegs[x]=~0; cmd=0; mir=0; if(!nomirror) setmirror(1); Synco(); GameHBIRQHook=RAMBO1_hb; MapIRQHook=RAMBO1_IRQHook; GameStateRestore=RAMBO1_Restore; SetWriteHandler(0x8000,0xffff,RAMBO1_write); AddExState(Rambo_StateRegs, ~0, 0, 0); } static void FP_FASTAPASS(2) CHRWrap(unsigned int A, unsigned int V) { setchr1(A,V); } void Mapper64_init(void) { setchr1wrap=CHRWrap; nomirror=0; RAMBO1_init(); } static int MirCache[8]; static unsigned int PPUCHRBus; static void FP_FASTAPASS(2) MirWrap(unsigned int A, unsigned int V) { MirCache[A>>10]=(V>>7)&1; if(PPUCHRBus==(A>>10)) setmirror(MI_0+((V>>7)&1)); setchr1(A,V); } static void FP_FASTAPASS(1) MirrorFear(uint32 A) { A&=0x1FFF; A>>=10; PPUCHRBus=A; setmirror(MI_0+MirCache[A]); } void Mapper158_init(void) { setchr1wrap=MirWrap; PPU_hook=MirrorFear; nomirror=1; RAMBO1_init(); } static DECLFW(MIMIC1_Write) { } void Mapper159_init(void) { SetWriteHandler(0x8000,0xFFFF,MIMIC1_Write); } fceu-0.98.12/src/mbshare/90.c0000644000175000000620000001546210106037620015321 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static int is209; static uint8 IRQMode; // from $c001 static uint8 IRQPre; // from $c004 static uint8 IRQPreSize; // from $c007 static uint8 IRQCount; // from $c005 static uint8 IRQXOR; // Loaded from $C006 static uint8 IRQa; // $c002, $c003, and $c000 static uint8 mul[2]; static uint8 regie; static uint8 tkcom[4]; static uint8 prgb[4]; static uint8 chrlow[8]; static uint8 chrhigh[8]; static uint16 names[4]; static uint8 tekker; static SFORMAT Tek_StateRegs[]={ {&IRQCount, 1, "IRQC"}, {&IRQa, 1, "IRQa"}, {mul, 2, "MUL"}, {®ie, 1, "REGI"}, {tkcom, 4, "TKCO"}, {prgb, 4, "PRGB"}, {chrlow, 4, "CHRL"}, {chrhigh, 8, "CHRH"}, {&names[0], 2|FCEUSTATE_RLSB, "NMS0"}, {&names[1], 2|FCEUSTATE_RLSB, "NMS1"}, {&names[2], 2|FCEUSTATE_RLSB, "NMS2"}, {&names[3], 2|FCEUSTATE_RLSB, "NMS3"}, {&tekker, 1, "TEKR"}, {0} }; static DECLFR(tekread) { //FCEU_printf("READ READ READ: $%04x, $%04x\n",A,X.PC); switch(A) { case 0x5000:return(tekker); case 0x5800:return(mul[0]*mul[1]); case 0x5801:return((mul[0]*mul[1])>>8); case 0x5803:return(regie); default:break; } return(X.DB); } static void mira(void) { if(tkcom[0]&0x20 && is209) { int x; if(tkcom[0] & 0x40) // Name tables are ROM-only { for(x=0;x<4;x++) setntamem(CHRptr[0]+(((names[x])&CHRmask1[0])<<10), 0, x); } else // Name tables can be RAM or ROM. { for(x=0;x<4;x++) { if((tkcom[2]&0x80) == (names[x]&0x80)) // RAM selected. setntamem(NTARAM + ((names[x]&0x1)<<10),1,x); else setntamem(CHRptr[0]+(((names[x])&CHRmask1[0])<<10), 0, x); } } } else { switch(tkcom[1]&3){ case 0:setmirror(MI_V);break; case 1:setmirror(MI_H);break; case 2:setmirror(MI_0);break; case 3:setmirror(MI_1);break; } } } static void tekprom(void) { switch(tkcom[0]&3) { case 1: // 16 KB setprg16(0x8000,prgb[0]); setprg16(0xC000,prgb[2]); break; case 2: //2 = 8 KB ?? if(tkcom[0]&0x4) { setprg8(0x8000,prgb[0]); setprg8(0xa000,prgb[1]); setprg8(0xc000,prgb[2]); setprg8(0xe000,prgb[3]); } else { if(tkcom[0]&0x80) setprg8(0x6000,prgb[3]); setprg8(0x8000,prgb[0]); setprg8(0xa000,prgb[1]); setprg8(0xc000,prgb[2]); setprg8(0xe000,~0); } break; case 0: case 3: setprg8(0x8000,prgb[0]); setprg8(0xa000,prgb[1]); setprg8(0xc000,prgb[2]); setprg8(0xe000,prgb[3]); break; } } static void tekvrom(void) { int x; switch(tkcom[0]&0x18) { case 0x00: // 8KB setchr8(chrlow[0]|(chrhigh[0]<<8)); break; case 0x08: // 4KB for(x=0;x<8;x+=4) setchr4(x<<10,chrlow[x]|(chrhigh[x]<<8)); break; case 0x10: // 2KB for(x=0;x<8;x+=2) setchr2(x<<10,chrlow[x]|(chrhigh[x]<<8)); break; case 0x18: // 1KB for(x=0;x<8;x++) setchr1(x<<10,(chrlow[x]|(chrhigh[x]<<8))); break; } } static DECLFW(Mapper90_write) { //printf("$%04x:$%02x\n",A,V); if(A==0x5800) mul[0]=V; else if(A==0x5801) mul[1]=V; else if(A==0x5803) regie=V; //if(A>=0xc000 && A<=0xc007) // FCEU_printf("$%04x:$%02x $%04x, %d, %d\n",A,V,X.PC,scanline,timestamp); A&=0xF007; if(A>=0x8000 && A<=0x8003) { prgb[A&3]=V; tekprom(); } else if(A>=0x9000 && A<=0x9007) { chrlow[A&7]=V; tekvrom(); } else if(A>=0xa000 && A<=0xa007) { chrhigh[A&7]=V; tekvrom(); } else if(A>=0xb000 && A<=0xb007) { //printf("$%04x:$%02x\n",A,V); if(A&4) { names[A&3]&=0x00FF; names[A&3]|=V<<8; } else { names[A&3]&=0xFF00; names[A&3]|=V; } mira(); } else if(A>=0xd000 && A<=0xdfff) { tkcom[A&3]=V; tekprom(); tekvrom(); mira(); } else switch(A) { case 0xc000: IRQa=V&1;if(!(V&1)) X6502_IRQEnd(FCEU_IQEXT);break; case 0xc002: IRQa=0;X6502_IRQEnd(FCEU_IQEXT);break; case 0xc003: IRQa=1;break; case 0xc001: IRQMode=V;break; case 0xc004: IRQPre=V^IRQXOR;break; case 0xc005: IRQCount=V^IRQXOR;break; case 0xc006: IRQXOR=V;break; case 0xc007: IRQPreSize=V;break; } } static void CCL(void) { if((IRQMode>>6) == 1) // Count Up { IRQCount++; if((IRQCount == 0) && IRQa) X6502_IRQBegin(FCEU_IQEXT); } else if((IRQMode>>6) == 2) // Count down { IRQCount--; if((IRQCount == 0xFF) && IRQa) X6502_IRQBegin(FCEU_IQEXT); } } static void ClockCounter(void) { uint8 premask; if(IRQMode & 0x4) premask = 0x7; else premask = 0xFF; if((IRQMode>>6) == 1) // Count up { IRQPre++; if((IRQPre & premask) == 0) CCL(); } else if((IRQMode>>6) == 2) // Count down { IRQPre--; //printf("%d\n",IRQPre); if((IRQPre & premask) == premask) CCL(); } } static void SLWrap(void) { int x; for(x=0;x<8;x++) ClockCounter(); // 8 PPU A10 0->1 transitions per scanline(usually) } /* static uint32 lasta; static void FP_FASTAPASS(1) YARGH(uint32 A) { if((A&0x1000) && !(lasta & 0x1000)) ClockCounter(); lasta = A; } */ static void togglie() { tekker^=0xFF; } static void m90rest(int version) { mira(); } static void M90Power(void) { SetWriteHandler(0x5000,0xffff,Mapper90_write); SetReadHandler(0x5000,0x5fff,tekread); SetReadHandler(0x6000,0xffff,CartBR); mul[0]=mul[1]=regie=0xFF; tkcom[0]=tkcom[1]=tkcom[2]=tkcom[3]=0xFF; memset(prgb,0xff,sizeof(prgb)); memset(chrlow,0xff,sizeof(chrlow)); memset(chrhigh,0xff,sizeof(chrhigh)); memset(names,0x00,sizeof(names)); tekker=0; prgb[0]=0xFF; prgb[1]=0xFF; prgb[2]=0xFF; prgb[3]=0xFF; tekprom(); tekvrom(); } void Mapper90_Init(CartInfo *info) { is209=0; info->Reset=togglie; info->Power=M90Power; //PPU_hook = YARGH; GameHBIRQHook2 = SLWrap; GameStateRestore=m90rest; AddExState(Tek_StateRegs, ~0, 0, 0); } void Mapper209_Init(CartInfo *info) { is209=1; info->Reset=togglie; info->Power=M90Power; //PPU_hook = YARGH; GameHBIRQHook2 = SLWrap; GameStateRestore=m90rest; AddExState(Tek_StateRegs, ~0, 0, 0); } fceu-0.98.12/src/mbshare/deirom.c0000644000175000000620000000345610003562765016361 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static uint8 cmd; static uint8 DRegs[8]; static SFORMAT DEI_StateRegs[]= { {&cmd, 1, "CMD"}, {DRegs, 8, "DREG"}, {0} }; static void Sync(void) { int x; setchr2(0x0000,DRegs[0]); setchr2(0x0800,DRegs[1]); for(x=0;x<4;x++) setchr1(0x1000+(x<<10),DRegs[2+x]); setprg8(0x8000,DRegs[6]); setprg8(0xa000,DRegs[7]); } static void StateRestore(int version) { Sync(); } static DECLFW(DEIWrite) { switch(A&0x8001) { case 0x8000:cmd=V&0x07;break; case 0x8001:if(cmd<=0x05) V&=0x3F; else V&=0x0F; if(cmd<=0x01) V>>=1; DRegs[cmd&0x07]=V; Sync(); break; } } static void DEIPower(void) { setprg8(0xc000,0xE); setprg8(0xe000,0xF); cmd=0; memset(DRegs,0,8); Sync(); SetReadHandler(0x8000,0xFFFF,CartBR); SetWriteHandler(0x8000,0xFFFF,DEIWrite); } void DEIROM_Init(CartInfo *info) { info->Power=DEIPower; GameStateRestore=StateRestore; AddExState(&DEI_StateRegs, ~0, 0, 0); } void Mapper206_Init(CartInfo *info) { DEIROM_Init(info); } fceu-0.98.12/src/mbshare/Makefile.am.inc0000755000175000000620000000021710003562765017535 0ustar joestaff00000000000000fceu_SOURCES += mbshare/mmc5.c mbshare/mmc3.c mbshare/mmc1.c mbshare/tengen.c mbshare/90.c mbshare/deirom.c mbshare/n106.c mbshare/164.c fceu-0.98.12/src/mbshare/n106.c0000644000175000000620000002372210106042031015543 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static uint16 IRQCount; static uint8 IRQa; static uint8 WRAM[8192]; static uint8 IRAM[128]; static DECLFR(AWRAM) { return(WRAM[A-0x6000]); } static DECLFW(BWRAM) { WRAM[A-0x6000]=V; } void Mapper19_ESI(void); static uint8 NTAPage[4]; static uint8 dopol; static uint8 gorfus; static uint8 gorko; static void NamcoSound(int Count); static void NamcoSoundHack(void); static void DoNamcoSound(int32 *Wave, int Count); static void DoNamcoSoundHQ(void); static void SyncHQ(int32 ts); static int is210; /* Lesser mapper. */ static uint8 PRG[3]; static uint8 CHR[8]; static SFORMAT N106_StateRegs[]={ {PRG,3,"PRG"}, {CHR,8,"CHR"}, {NTAPage,4,"NTA"}, {0} }; static void SyncPRG(void) { setprg8(0x8000,PRG[0]); setprg8(0xa000,PRG[1]); setprg8(0xc000,PRG[2]); setprg8(0xe000,0x3F); } static void FP_FASTAPASS(1) NamcoIRQHook(int a) { if(IRQa) { IRQCount+=a; if(IRQCount>=0x7FFF) { X6502_IRQBegin(FCEU_IQEXT); IRQa=0; IRQCount=0x7FFF; //7FFF; } } } static DECLFR(Namco_Read4800) { uint8 ret=IRAM[dopol&0x7f]; //printf("Read: %02x, %02x\n",dopol&0x7f,IRAM[dopol&0x7f]); /* Maybe I should call NamcoSoundHack() here? */ if(!fceuindbg) if(dopol&0x80) dopol=(dopol&0x80)|((dopol+1)&0x7f); return ret; } static DECLFR(Namco_Read5000) { return(IRQCount); } static DECLFR(Namco_Read5800) { return(IRQCount>>8); } static void FASTAPASS(2) DoNTARAMROM(int w, uint8 V) { NTAPage[w]=V; //if(V>=0xE0) // setntamem(NTARAM+((V&1)<<10), 1, w); //printf("%d, %02x\n",w,V); //printf("%02x, %02x\n",((gorko>>(6+(w>>1)))&1),V); if(V>=0xE0) setntamem(NTARAM+((V&1)<<10), 1, w); else { V&=CHRmask1[0]; setntamem(CHRptr[0]+(V<<10), 0, w); } } static void FixNTAR(void) { int x; for(x=0;x<4;x++) DoNTARAMROM(x,NTAPage[x]); } static void FASTAPASS(2) DoCHRRAMROM(int x, uint8 V) { CHR[x]=V; if(!is210 && !((gorfus>>((x>>2)+6))&1) && (V>=0xE0)) { // printf("BLAHAHA: %d, %02x\n",x,V); //setchr1r(0x10,x<<10,V&7); } else { // printf("Noha: %d, %02x\n",x,V); setchr1(x<<10,V); } } static void FixCRR(void) { int x; for(x=0;x<8;x++) DoCHRRAMROM(x,CHR[x]); } static DECLFW(Mapper19C0D8_write) { DoNTARAMROM((A-0xC000)>>11,V); } static uint32 FreqCache[8]; static uint32 EnvCache[8]; static uint32 LengthCache[8]; static void FixCache(int a,int V) { int w=(a>>3)&0x7; switch(a&0x07) { case 0x00:FreqCache[w]&=~0x000000FF;FreqCache[w]|=V;break; case 0x02:FreqCache[w]&=~0x0000FF00;FreqCache[w]|=V<<8;break; case 0x04:FreqCache[w]&=~0x00030000;FreqCache[w]|=(V&3)<<16; LengthCache[w]=(8-((V>>2)&7))<<2; break; case 0x07:EnvCache[w]=(double)(V&0xF)*576716;break; } } static DECLFW(Mapper19_write) { A&=0xF800; if(A>=0x8000 && A<=0xb800) DoCHRRAMROM((A-0x8000)>>11,V); else switch(A) { case 0x4800: //printf("Yahaoo: %02x, %02x\n",dopol&0x7F,V); //puts("Hmm"); if(dopol&0x40) { if(FSettings.SndRate) { NamcoSoundHack(); GameExpSound.Fill=NamcoSound; //GameExpSound.NeoFill=DoNamcoSound; GameExpSound.HiFill=DoNamcoSoundHQ; GameExpSound.HiSync=SyncHQ; } FixCache(dopol,V); } IRAM[dopol&0x7f]=V; if(dopol&0x80) dopol=(dopol&0x80)|((dopol+1)&0x7f); break; case 0xf800: dopol=V;break; case 0x5000: IRQCount&=0xFF00;IRQCount|=V;X6502_IRQEnd(FCEU_IQEXT);break; case 0x5800: IRQCount&=0x00ff;IRQCount|=(V&0x7F)<<8; IRQa=V&0x80; X6502_IRQEnd(FCEU_IQEXT); //puts("IRQe"); break; case 0xE000:gorko=V&0xC0; PRG[0]=V&0x3F; SyncPRG(); break; case 0xE800:gorfus=V&0xC0; FixCRR(); PRG[1]=V&0x3F; SyncPRG(); break; case 0xF000:PRG[2]=V&0x3F; SyncPRG(); break; } } static int dwave=0; static void NamcoSoundHack(void) { int32 z,a; if(FSettings.soundq>=1) { DoNamcoSoundHQ(); return; } z=((SOUNDTS<<16)/soundtsinc)>>4; a=z-dwave; if(a) DoNamcoSound(&Wave[dwave], a); dwave+=a; } static void NamcoSound(int Count) { int32 z,a; z=((SOUNDTS<<16)/soundtsinc)>>4; a=z-dwave; if(a) DoNamcoSound(&Wave[dwave], a); dwave=0; } static uint32 PlayIndex[8]; static int32 vcount[8]; static int32 CVBC; #define TOINDEX (16+1) // 16:15 static void SyncHQ(int32 ts) { CVBC=ts; } /* Things to do: 1 Read freq low 2 Read freq mid 3 Read freq high 4 Read envelope ...? */ static INLINE uint32 FetchDuff(uint32 P, uint32 envelope) { uint32 duff; duff=IRAM[((IRAM[0x46+(P<<3)]+(PlayIndex[P]>>TOINDEX))&0xFF)>>1]; if((IRAM[0x46+(P<<3)]+(PlayIndex[P]>>TOINDEX))&1) duff>>=4; duff&=0xF; duff=(duff*envelope)>>16; return(duff); } static void DoNamcoSoundHQ(void) { int32 P,V; int32 cyclesuck=(((IRAM[0x7F]>>4)&7)+1)*15; for(P=7;P>=(7-((IRAM[0x7F]>>4)&7));P--) { if((IRAM[0x44+(P<<3)]&0xE0) && (IRAM[0x47+(P<<3)]&0xF)) { uint32 freq; int32 vco; uint32 duff2,lengo,envelope; vco=vcount[P]; freq=FreqCache[P]; envelope=EnvCache[P]; lengo=LengthCache[P]; duff2=FetchDuff(P,envelope); for(V=CVBC<<1;V>1]+=duff2; if(!vco) { PlayIndex[P]+=freq; while((PlayIndex[P]>>TOINDEX)>=lengo) PlayIndex[P]-=lengo<>4); for(P=7;P>=7-((IRAM[0x7F]>>4)&7);P--) { if((IRAM[0x44+(P<<3)]&0xE0) && (IRAM[0x47+(P<<3)]&0xF)) { int32 inc; uint32 freq; int32 vco; uint32 duff,duff2,lengo,envelope; //uint64 ta; vco=vcount[P]; freq=FreqCache[P]; envelope=EnvCache[P]; lengo=LengthCache[P]; if(!freq) {/*printf("Ack");*/ continue;} { int c=((IRAM[0x7F]>>4)&7)+1; inc=(long double)(FSettings.SndRate<<15)/((long double)freq* 21477272/((long double)0x400000*c*45)); } duff=IRAM[(((IRAM[0x46+(P<<3)]+PlayIndex[P])&0xFF)>>1)]; if((IRAM[0x46+(P<<3)]+PlayIndex[P])&1) duff>>=4; duff&=0xF; duff2=(duff*envelope)>>19; for(V=0;V=inc) { PlayIndex[P]++; if(PlayIndex[P]>=lengo) PlayIndex[P]=0; vco-=inc; duff=IRAM[(((IRAM[0x46+(P<<3)]+PlayIndex[P])&0xFF)>>1)]; if((IRAM[0x46+(P<<3)]+PlayIndex[P])&1) duff>>=4; duff&=0xF; duff2=(duff*envelope)>>19; } Wave[V>>4]+=duff2; vco+=0x8000; } vcount[P]=vco; } } } static void Mapper19_StateRestore(int version) { int x; SyncPRG(); FixNTAR(); FixCRR(); for(x=0x40;x<0x80;x++) FixCache(x,IRAM[x]); } static void M19SC(void) { if(FSettings.SndRate) Mapper19_ESI(); } void Mapper19_ESI(void) { GameExpSound.RChange=M19SC; memset(vcount,0,sizeof(vcount)); memset(PlayIndex,0,sizeof(PlayIndex)); CVBC=0; } void NSFN106_Init(void) { SetWriteHandler(0xf800,0xffff,Mapper19_write); SetWriteHandler(0x4800,0x4fff,Mapper19_write); SetReadHandler(0x4800,0x4fff,Namco_Read4800); Mapper19_ESI(); } static int battery=0; static void N106_Power(void) { int x; SetReadHandler(0x8000,0xFFFF,CartBR); SetWriteHandler(0x8000,0xffff,Mapper19_write); SetWriteHandler(0x4020,0x5fff,Mapper19_write); if(!is210) { SetWriteHandler(0xc000,0xdfff,Mapper19C0D8_write); SetReadHandler(0x4800,0x4fff,Namco_Read4800); SetReadHandler(0x5000,0x57ff,Namco_Read5000); SetReadHandler(0x5800,0x5fff,Namco_Read5800); NTAPage[0]=NTAPage[1]=NTAPage[2]=NTAPage[3]=0xFF; FixNTAR(); } SetReadHandler(0x6000,0x7FFF,AWRAM); SetWriteHandler(0x6000,0x7FFF,BWRAM); FCEU_CheatAddRAM(8,0x6000,WRAM); gorfus=0xFF; SyncPRG(); FixCRR(); if(!battery) { FCEU_dwmemset(WRAM,0,8192); FCEU_dwmemset(IRAM,0,128); } for(x=0x40;x<0x80;x++) FixCache(x,IRAM[x]); } void Mapper19_Init(CartInfo *info) { is210=0; battery=info->battery; info->Power=N106_Power; MapIRQHook=NamcoIRQHook; GameStateRestore=Mapper19_StateRestore; GameExpSound.RChange=M19SC; if(FSettings.SndRate) Mapper19_ESI(); AddExState(WRAM, 8192, 0, "WRAM"); AddExState(IRAM, 128, 0, "WRAM"); AddExState(N106_StateRegs, ~0, 0, 0); if(info->battery) { info->SaveGame[0]=WRAM; info->SaveGameLen[0]=8192; info->SaveGame[1]=IRAM; info->SaveGameLen[1]=128; } } static void Mapper210_StateRestore(int version) { SyncPRG(); FixCRR(); } void Mapper210_Init(CartInfo *info) { is210=1; GameStateRestore=Mapper210_StateRestore; info->Power=N106_Power; AddExState(WRAM, 8192, 0, "WRAM"); } fceu-0.98.12/src/mbshare/164.c0000644000175000000620000000322610003562765015407 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "mapinc.h" static uint8 cmd; static uint8 DRegs[8]; static SFORMAT StateRegs[]= { {&cmd, 1, "CMD"}, {DRegs, 8, "DREG"}, {0} }; static void Sync(void) { } static void StateRestore(int version) { Sync(); } static DECLFW(Write) { if((A&0x7300)==0x5000) setprg32(0x8000,V); //else //if(A==0x5200) // printf("$%04x:$%02x\n",A,V); } static uint8 WRAM[8192]; static DECLFR(AWRAM) { return(WRAM[A-0x6000]); } static DECLFW(BWRAM) { WRAM[A-0x6000]=V; } static void Power(void) { setchr8(0); setprg32(0x8000,~0); cmd=0; memset(DRegs,0,8); Sync(); SetReadHandler(0x8000,0xFFFF,CartBR); SetWriteHandler(0x4020,0xFFFF,Write); SetReadHandler(0x6000,0x7FFF,AWRAM); SetWriteHandler(0x6000,0x7FFF,BWRAM); } void Mapper164_Init(CartInfo *info) { info->Power=Power; GameStateRestore=StateRestore; AddExState(&StateRegs, ~0, 0, 0); } fceu-0.98.12/src/md5.c0000644000175000000620000001553210030421131014121 0ustar joestaff00000000000000/* * RFC 1321 compliant MD5 implementation, * by Christophe Devine ; * this program is licensed under the GPL. */ /* Modified October 3, 2003, to remove testing code, and add include of "types.h". Added simple MD5 to ASCII string conversion function. -Xodnizel */ #include #include "types.h" #include "md5.h" #define GET_UINT32(n,b,i) \ { \ (n) = ( (uint32) (b)[(i) + 3] << 24 ) \ | ( (uint32) (b)[(i) + 2] << 16 ) \ | ( (uint32) (b)[(i) + 1] << 8 ) \ | ( (uint32) (b)[(i) ] ); \ } #define PUT_UINT32(n,b,i) \ { \ (b)[(i) ] = (uint8) ( (n) ); \ (b)[(i) + 1] = (uint8) ( (n) >> 8 ); \ (b)[(i) + 2] = (uint8) ( (n) >> 16 ); \ (b)[(i) + 3] = (uint8) ( (n) >> 24 ); \ } void md5_starts( struct md5_context *ctx ) { ctx->total[0] = 0; ctx->total[1] = 0; ctx->state[0] = 0x67452301; ctx->state[1] = 0xEFCDAB89; ctx->state[2] = 0x98BADCFE; ctx->state[3] = 0x10325476; } void md5_process( struct md5_context *ctx, uint8 data[64] ) { uint32 A, B, C, D, X[16]; GET_UINT32( X[0], data, 0 ); GET_UINT32( X[1], data, 4 ); GET_UINT32( X[2], data, 8 ); GET_UINT32( X[3], data, 12 ); GET_UINT32( X[4], data, 16 ); GET_UINT32( X[5], data, 20 ); GET_UINT32( X[6], data, 24 ); GET_UINT32( X[7], data, 28 ); GET_UINT32( X[8], data, 32 ); GET_UINT32( X[9], data, 36 ); GET_UINT32( X[10], data, 40 ); GET_UINT32( X[11], data, 44 ); GET_UINT32( X[12], data, 48 ); GET_UINT32( X[13], data, 52 ); GET_UINT32( X[14], data, 56 ); GET_UINT32( X[15], data, 60 ); #define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) #define P(a,b,c,d,k,s,t) \ { \ a += F(b,c,d) + X[k] + t; a = S(a,s) + b; \ } A = ctx->state[0]; B = ctx->state[1]; C = ctx->state[2]; D = ctx->state[3]; #define F(x,y,z) (z ^ (x & (y ^ z))) P( A, B, C, D, 0, 7, 0xD76AA478 ); P( D, A, B, C, 1, 12, 0xE8C7B756 ); P( C, D, A, B, 2, 17, 0x242070DB ); P( B, C, D, A, 3, 22, 0xC1BDCEEE ); P( A, B, C, D, 4, 7, 0xF57C0FAF ); P( D, A, B, C, 5, 12, 0x4787C62A ); P( C, D, A, B, 6, 17, 0xA8304613 ); P( B, C, D, A, 7, 22, 0xFD469501 ); P( A, B, C, D, 8, 7, 0x698098D8 ); P( D, A, B, C, 9, 12, 0x8B44F7AF ); P( C, D, A, B, 10, 17, 0xFFFF5BB1 ); P( B, C, D, A, 11, 22, 0x895CD7BE ); P( A, B, C, D, 12, 7, 0x6B901122 ); P( D, A, B, C, 13, 12, 0xFD987193 ); P( C, D, A, B, 14, 17, 0xA679438E ); P( B, C, D, A, 15, 22, 0x49B40821 ); #undef F #define F(x,y,z) (y ^ (z & (x ^ y))) P( A, B, C, D, 1, 5, 0xF61E2562 ); P( D, A, B, C, 6, 9, 0xC040B340 ); P( C, D, A, B, 11, 14, 0x265E5A51 ); P( B, C, D, A, 0, 20, 0xE9B6C7AA ); P( A, B, C, D, 5, 5, 0xD62F105D ); P( D, A, B, C, 10, 9, 0x02441453 ); P( C, D, A, B, 15, 14, 0xD8A1E681 ); P( B, C, D, A, 4, 20, 0xE7D3FBC8 ); P( A, B, C, D, 9, 5, 0x21E1CDE6 ); P( D, A, B, C, 14, 9, 0xC33707D6 ); P( C, D, A, B, 3, 14, 0xF4D50D87 ); P( B, C, D, A, 8, 20, 0x455A14ED ); P( A, B, C, D, 13, 5, 0xA9E3E905 ); P( D, A, B, C, 2, 9, 0xFCEFA3F8 ); P( C, D, A, B, 7, 14, 0x676F02D9 ); P( B, C, D, A, 12, 20, 0x8D2A4C8A ); #undef F #define F(x,y,z) (x ^ y ^ z) P( A, B, C, D, 5, 4, 0xFFFA3942 ); P( D, A, B, C, 8, 11, 0x8771F681 ); P( C, D, A, B, 11, 16, 0x6D9D6122 ); P( B, C, D, A, 14, 23, 0xFDE5380C ); P( A, B, C, D, 1, 4, 0xA4BEEA44 ); P( D, A, B, C, 4, 11, 0x4BDECFA9 ); P( C, D, A, B, 7, 16, 0xF6BB4B60 ); P( B, C, D, A, 10, 23, 0xBEBFBC70 ); P( A, B, C, D, 13, 4, 0x289B7EC6 ); P( D, A, B, C, 0, 11, 0xEAA127FA ); P( C, D, A, B, 3, 16, 0xD4EF3085 ); P( B, C, D, A, 6, 23, 0x04881D05 ); P( A, B, C, D, 9, 4, 0xD9D4D039 ); P( D, A, B, C, 12, 11, 0xE6DB99E5 ); P( C, D, A, B, 15, 16, 0x1FA27CF8 ); P( B, C, D, A, 2, 23, 0xC4AC5665 ); #undef F #define F(x,y,z) (y ^ (x | ~z)) P( A, B, C, D, 0, 6, 0xF4292244 ); P( D, A, B, C, 7, 10, 0x432AFF97 ); P( C, D, A, B, 14, 15, 0xAB9423A7 ); P( B, C, D, A, 5, 21, 0xFC93A039 ); P( A, B, C, D, 12, 6, 0x655B59C3 ); P( D, A, B, C, 3, 10, 0x8F0CCC92 ); P( C, D, A, B, 10, 15, 0xFFEFF47D ); P( B, C, D, A, 1, 21, 0x85845DD1 ); P( A, B, C, D, 8, 6, 0x6FA87E4F ); P( D, A, B, C, 15, 10, 0xFE2CE6E0 ); P( C, D, A, B, 6, 15, 0xA3014314 ); P( B, C, D, A, 13, 21, 0x4E0811A1 ); P( A, B, C, D, 4, 6, 0xF7537E82 ); P( D, A, B, C, 11, 10, 0xBD3AF235 ); P( C, D, A, B, 2, 15, 0x2AD7D2BB ); P( B, C, D, A, 9, 21, 0xEB86D391 ); #undef F ctx->state[0] += A; ctx->state[1] += B; ctx->state[2] += C; ctx->state[3] += D; } void md5_update( struct md5_context *ctx, uint8 *input, uint32 length ) { uint32 left, fill; if( ! length ) return; left = ( ctx->total[0] >> 3 ) & 0x3F; fill = 64 - left; ctx->total[0] += length << 3; ctx->total[1] += length >> 29; ctx->total[0] &= 0xFFFFFFFF; ctx->total[1] += ctx->total[0] < ( length << 3 ); if( left && length >= fill ) { memcpy( (void *) (ctx->buffer + left), (void *) input, fill ); md5_process( ctx, ctx->buffer ); length -= fill; input += fill; left = 0; } while( length >= 64 ) { md5_process( ctx, input ); length -= 64; input += 64; } if( length ) { memcpy( (void *) (ctx->buffer + left), (void *) input, length ); } } static uint8 md5_padding[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 }; void md5_finish( struct md5_context *ctx, uint8 digest[16] ) { uint32 last, padn; uint8 msglen[8]; PUT_UINT32( ctx->total[0], msglen, 0 ); PUT_UINT32( ctx->total[1], msglen, 4 ); last = ( ctx->total[0] >> 3 ) & 0x3F; padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last ); md5_update( ctx, md5_padding, padn ); md5_update( ctx, msglen, 8 ); PUT_UINT32( ctx->state[0], digest, 0 ); PUT_UINT32( ctx->state[1], digest, 4 ); PUT_UINT32( ctx->state[2], digest, 8 ); PUT_UINT32( ctx->state[3], digest, 12 ); } /* Uses a static buffer, so beware of how it's used. */ char *md5_asciistr(uint8 digest[16]) { static char str[33]; static char trans[16]={'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}; int x; for(x=0;x<16;x++) { str[x*2]=trans[digest[x]&0x0F]; str[x*2+1]=trans[digest[x]>>4]; } return(str); } fceu-0.98.12/src/md5.h0000644000175000000620000000063610003562765014150 0ustar joestaff00000000000000#ifndef _MD5_H #define _MD5_H struct md5_context { uint32 total[2]; uint32 state[4]; uint8 buffer[64]; }; void md5_starts( struct md5_context *ctx ); void md5_update( struct md5_context *ctx, uint8 *input, uint32 length ); void md5_finish( struct md5_context *ctx, uint8 digest[16] ); /* Uses a static buffer, so beware of how it's used. */ char *md5_asciistr(uint8 digest[16]); #endif /* md5.h */ fceu-0.98.12/src/memory.c0000644000175000000620000000365510036573310014764 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "types.h" #include "fceu.h" #include "memory.h" #include "general.h" void *FCEU_gmalloc(uint32 size) { void *ret; ret=malloc(size); if(!ret) { FCEU_PrintError("Error allocating memory! Doing a hard exit."); exit(1); } return ret; } void *FCEU_malloc(uint32 size) { void *ret; ret=malloc(size); if(!ret) { FCEU_PrintError("Error allocating memory!"); return(0); } return ret; } void FCEU_free(void *ptr) // Might do something with this and FCEU_malloc later... { free(ptr); } void FCEU_gfree(void *ptr) { free(ptr); } void FASTAPASS(3) FCEU_memmove(void *d, void *s, uint32 l) { uint32 x; int t; /* Type really doesn't matter. */ t=(int)d; t|=(int)s; t|=(int)l; if(t&3) // Not 4-byte aligned and/or length is not a multiple of 4. { uint8 *tmpd, *tmps; tmpd = d; tmps = s; for(x=l;x;x--) // This could be optimized further, though(more tests could be performed). { *tmpd=*tmps; tmpd++; tmps++; } } else { uint32 *tmpd, *tmps; tmpd = d; tmps = s; for(x=l>>2;x;x--) { *tmpd=*tmps; tmpd++; tmps++; } } } fceu-0.98.12/src/memory.h0000644000175000000620000000224010003562765014764 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ /* Various macros for faster memory stuff (at least that's the idea) */ #define FCEU_dwmemset(d,c,n) {int _x; for(_x=n-4;_x>=0;_x-=4) *(uint32 *)&(d)[_x]=c;} void *FCEU_malloc(uint32 size); void *FCEU_gmalloc(uint32 size); void FCEU_gfree(void *ptr); void FCEU_free(void *ptr); void FASTAPASS(3) FCEU_memmove(void *d, void *s, uint32 l); fceu-0.98.12/src/netplay.c0000644000175000000620000001677410052032104015123 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 #include #include #include #include #include "types.h" #include "netplay.h" #include "fceu.h" #include "general.h" #include "state.h" #include "cheat.h" #include "input.h" #include "endian.h" int FCEUnetplay=0; static uint8 netjoy[4]; /* Controller cache. */ static int numlocal; static int netdivisor; static int netdcount; /* NetError should only be called after a FCEUD_*Data function returned 0, in the function that called FCEUD_*Data, to prevent it from being called twice. */ static void NetError(void) { FCEU_DispMessage("Network error/connection lost!"); FCEUD_NetworkClose(); } void FCEUI_NetplayStop(void) { if(FCEUnetplay) { FCEUnetplay = 0; FCEU_FlushGameCheats(0,1); /* Don't save netplay cheats. */ FCEU_LoadGameCheats(0); /* Reload our original cheats. */ } else puts("Check your code!"); } int FCEUI_NetplayStart(int nlocal, int divisor) { FCEU_FlushGameCheats(0, 0); /* Save our pre-netplay cheats. */ FCEU_LoadGameCheats(0); /* Load them again, for pre-multiplayer action. */ FCEUnetplay = 1; memset(netjoy,0,sizeof(netjoy)); numlocal = nlocal; netdivisor = divisor; netdcount = 0; return(1); } int FCEUNET_SendCommand(uint8 cmd, uint32 len) { uint8 buf[numlocal + 1 + 4]; buf[0] = 0xFF; FCEU_en32lsb(&buf[numlocal], len); buf[numlocal + 4] = cmd; #ifdef NETWORK if(!FCEUD_SendData(buf,numlocal + 1 + 4)) { NetError(); return(0); } #endif return(1); } void FCEUI_NetplayText(uint8 *text) { uint32 len; len = strlen(text); if(!FCEUNET_SendCommand(FCEUNPCMD_TEXT,len)) return; if(!FCEUD_SendData(text,len)) NetError(); } int FCEUNET_SendFile(uint8 cmd, char *fn) { uint32 len; uLongf clen; char *buf, *cbuf; FILE *fp; struct stat sb; if(!(fp=FCEUD_UTF8fopen(fn,"rb"))) return(0); fstat(fileno(fp),&sb); len = sb.st_size; buf = malloc(len); fread(buf, 1, len, fp); fclose(fp); cbuf = malloc(4 + len + len / 1000 + 12); FCEU_en32lsb(cbuf, len); compress2(cbuf + 4, &clen, buf, len, 7); free(buf); //printf("Sending file: %s, %d, %d\n",fn,len,clen); len = clen + 4; #ifdef NETWORK if(!FCEUNET_SendCommand(cmd,len)) { free(cbuf); return(0); } if(!FCEUD_SendData(cbuf, len)) { NetError(); free(cbuf); return(0); } #endif free(cbuf); return(1); } static FILE *FetchFile(uint32 remlen) { uint32 clen = remlen; char *cbuf; uLongf len; char *buf; FILE *fp; char *fn; if(clen > 500000) // Sanity check { NetError(); return(0); } //printf("Receiving file: %d...\n",clen); fn = FCEU_MakeFName(FCEUMKF_NPTEMP,0,0); if((fp = fopen(fn,"w+b"))) { cbuf = malloc(clen); if(!FCEUD_RecvData(cbuf, clen)) { NetError(); unlink(fn); fclose(fp); free(cbuf); free(fn); return(0); } len = FCEU_de32lsb(cbuf); if(len > 500000) // Another sanity check { NetError(); unlink(fn); fclose(fp); free(cbuf); free(fn); return(0); } buf = malloc(len); uncompress(buf, &len, cbuf + 4, clen - 4); fwrite(buf, 1, len, fp); free(buf); fseek(fp, 0, SEEK_SET); unlink(fn); free(fn); return(fp); } free(fn); return(0); } void NetplayUpdate(uint8 *joyp) { static uint8 buf[5]; /* 4 play states, + command/extra byte */ static uint8 joypb[4]; memcpy(joypb,joyp,4); /* This shouldn't happen, but just in case. 0xFF is used as a command escape elsewhere. */ if(joypb[0] == 0xFF) joypb[0] = 0xF; #ifdef NETWORK if(!netdcount) if(!FCEUD_SendData(joypb,numlocal)) { NetError(); return; } if(!netdcount) do { if(!FCEUD_RecvData(buf,5)) { NetError(); return; } switch(buf[4]) { default: FCEU_DoSimpleCommand(buf[4]);break; case FCEUNPCMD_TEXT: { uint8 *tbuf; uint32 len = FCEU_de32lsb(buf); if(len > 100000) // Insanity check! { NetError(); return; } tbuf = malloc(len + 1); tbuf[len] = 0; if(!FCEUD_RecvData(tbuf, len)) { NetError(); free(tbuf); return; } FCEUD_NetplayText(tbuf); free(tbuf); } break; case FCEUNPCMD_SAVESTATE: { char *fn; FILE *fp; /* Send the cheats first, then the save state, since there might be a frame or two in between the two sendfile commands on the server side. */ fn = FCEU_MakeFName(FCEUMKF_CHEAT,0,0); //if(! FCEUNET_SendFile(FCEUNPCMD_LOADCHEATS,fn); // { // free(fn); // return; // } free(fn); if(!FCEUnetplay) return; fn = FCEU_MakeFName(FCEUMKF_NPTEMP,0,0); fp = fopen(fn, "wb"); if(FCEUSS_SaveFP(fp)) { fclose(fp); if(!FCEUNET_SendFile(FCEUNPCMD_LOADSTATE, fn)) { unlink(fn); free(fn); return; } unlink(fn); free(fn); } else { fclose(fp); FCEUD_PrintError("File error. (K)ill, (M)aim, (D)estroy? Now!"); unlink(fn); free(fn); return; } } break; case FCEUNPCMD_LOADCHEATS: { FILE *fp = FetchFile(FCEU_de32lsb(buf)); if(!fp) return; FCEU_FlushGameCheats(0,1); FCEU_LoadGameCheats(fp); } break; case FCEUNPCMD_LOADSTATE: { FILE *fp = FetchFile(FCEU_de32lsb(buf)); if(!fp) return; if(FCEUSS_LoadFP(fp)) { fclose(fp); FCEU_DispMessage("Remote state loaded."); } else FCEUD_PrintError("File error. (K)ill, (M)aim, (D)estroy?"); } break; } } while(buf[4]); #endif netdcount=(netdcount+1)%netdivisor; memcpy(netjoy,buf,4); *(uint32 *)joyp=*(uint32 *)netjoy; } fceu-0.98.12/src/netplay.h0000644000175000000620000000113010052031572015114 0ustar joestaff00000000000000int InitNetplay(void); void NetplayUpdate(uint8 *joyp); extern int FCEUnetplay; #define FCEUNPCMD_RESET 0x01 #define FCEUNPCMD_POWER 0x02 #define FCEUNPCMD_VSUNICOIN 0x07 #define FCEUNPCMD_VSUNIDIP0 0x08 #define FCEUNPCMD_FDSINSERTx 0x10 #define FCEUNPCMD_FDSINSERT 0x18 #define FCEUNPCMD_FDSEJECT 0x19 #define FCEUNPCMD_FDSSELECT 0x1A #define FCEUNPCMD_LOADSTATE 0x80 #define FCEUNPCMD_SAVESTATE 0x81 /* Sent from server to client. */ #define FCEUNPCMD_LOADCHEATS 0x82 #define FCEUNPCMD_TEXT 0x90 int FCEUNET_SendCommand(uint8, uint32); int FCEUNET_SendFile(uint8 cmd, char *); fceu-0.98.12/src/nsf.c0000644000175000000620000003073610030421131014225 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 #include #include "types.h" #include "x6502.h" #include "fceu.h" #include "video.h" #include "sound.h" #include "nsf.h" #include "general.h" #include "memory.h" #include "file.h" #include "fds.h" #include "cart.h" #include "input.h" #ifndef M_PI #define M_PI 3.14159265358979323846 #endif static uint8 SongReload; static int CurrentSong; static DECLFW(NSF_write); static DECLFR(NSF_read); static int vismode=1; static uint8 NSFROM[0x30+6]= { /* 0x00 - NMI */ 0x8D,0xF4,0x3F, /* Stop play routine NMIs. */ 0xA2,0xFF,0x9A, /* Initialize the stack pointer. */ 0xAD,0xF0,0x3F, /* See if we need to init. */ 0xF0,0x09, /* If 0, go to play routine playing. */ 0xAD,0xF1,0x3F, /* Confirm and load A */ 0xAE,0xF3,0x3F, /* Load X with PAL/NTSC byte */ 0x20,0x00,0x00, /* JSR to init routine */ 0xA9,0x00, 0xAA, 0xA8, 0x20,0x00,0x00, /* JSR to play routine */ 0x8D,0xF5,0x3F, /* Start play routine NMIs. */ 0x90,0xFE, /* Loopie time. */ /* 0x20 */ 0x8D,0xF3,0x3F, /* Init init NMIs */ 0x18, 0x90,0xFE /* Loopie time. */ }; static DECLFR(NSFROMRead) { return (NSFROM-0x3800)[A]; } static int doreset=0; static int NSFNMIFlags; static uint8 *NSFDATA=0; static int NSFMaxBank; static int NSFSize; static uint8 BSon; static uint16 PlayAddr; static uint16 InitAddr; static uint16 LoadAddr; static NSF_HEADER NSFHeader; void NSFMMC5_Close(void); static uint8 *ExWRAM=0; void NSFGI(int h) { switch(h) { case GI_CLOSE: if(NSFDATA) {free(NSFDATA);NSFDATA=0;} if(ExWRAM) {free(ExWRAM);ExWRAM=0;} if(NSFHeader.SoundChip&1) { // NSFVRC6_Init(); } else if (NSFHeader.SoundChip&2) { // NSFVRC7_Init(); } else if (NSFHeader.SoundChip&4) { // FDSSoundReset(); } else if (NSFHeader.SoundChip&8) { NSFMMC5_Close(); } else if (NSFHeader.SoundChip&0x10) { // NSFN106_Init(); } else if (NSFHeader.SoundChip&0x20) { // NSFAY_Init(); } break; case GI_RESETM2: case GI_POWER: NSF_init();break; } } // First 32KB is reserved for sound chip emulation in the iNES mapper code. static INLINE void BANKSET(uint32 A, uint32 bank) { bank&=NSFMaxBank; if(NSFHeader.SoundChip&4) memcpy(ExWRAM+(A-0x6000),NSFDATA+(bank<<12),4096); else setprg4(A,bank); } int NSFLoad(FCEUFILE *fp) { int x; FCEU_fseek(fp,0,SEEK_SET); FCEU_fread(&NSFHeader,1,0x80,fp); if (memcmp(NSFHeader.ID,"NESM\x1a",5)) return 0; NSFHeader.SongName[31]=NSFHeader.Artist[31]=NSFHeader.Copyright[31]=0; LoadAddr=NSFHeader.LoadAddressLow; LoadAddr|=NSFHeader.LoadAddressHigh<<8; if(LoadAddr<0x6000) { FCEUD_PrintError("Invalid load address."); return(0); } InitAddr=NSFHeader.InitAddressLow; InitAddr|=NSFHeader.InitAddressHigh<<8; PlayAddr=NSFHeader.PlayAddressLow; PlayAddr|=NSFHeader.PlayAddressHigh<<8; NSFSize=FCEU_fgetsize(fp)-0x80; NSFMaxBank=((NSFSize+(LoadAddr&0xfff)+4095)/4096); NSFMaxBank=uppow2(NSFMaxBank); if(!(NSFDATA=(uint8 *)FCEU_malloc(NSFMaxBank*4096))) return 0; FCEU_fseek(fp,0x80,SEEK_SET); memset(NSFDATA,0x00,NSFMaxBank*4096); FCEU_fread(NSFDATA+(LoadAddr&0xfff),1,NSFSize,fp); NSFMaxBank--; BSon=0; for(x=0;x<8;x++) BSon|=NSFHeader.BankSwitch[x]; FCEUGameInfo->type=GIT_NSF; FCEUGameInfo->input[0]=FCEUGameInfo->input[1]=SI_GAMEPAD; FCEUGameInfo->cspecial=SIS_NSF; for(x=0;;x++) { if(NSFROM[x]==0x20) { NSFROM[x+1]=InitAddr&0xFF; NSFROM[x+2]=InitAddr>>8; NSFROM[x+8]=PlayAddr&0xFF; NSFROM[x+9]=PlayAddr>>8; break; } } if(NSFHeader.VideoSystem==0) FCEUGameInfo->vidsys=GIV_NTSC; else if(NSFHeader.VideoSystem==1) FCEUGameInfo->vidsys=GIV_PAL; GameInterface=NSFGI; FCEU_printf("NSF Loaded. File information:\n\n"); FCEU_printf(" Name: %s\n Artist: %s\n Copyright: %s\n\n",NSFHeader.SongName,NSFHeader.Artist,NSFHeader.Copyright); if(NSFHeader.SoundChip) { static char *tab[6]={"Konami VRCVI","Konami VRCVII","Nintendo FDS","Nintendo MMC5","Namco 106","Sunsoft FME-07"}; for(x=0;x<6;x++) if(NSFHeader.SoundChip&(1<=6) BANKSET(0x6000+(x-6)*4096,NSFHeader.BankSwitch[x]); BANKSET(0x8000+x*4096,NSFHeader.BankSwitch[x]); } } else { int32 x; for(x=(LoadAddr&0xF000);x<0x10000;x+=0x1000) BANKSET(x,((x-(LoadAddr&0x7000))>>12)); } SetReadHandler(0xFFFA,0xFFFD,NSFVectorRead); SetWriteHandler(0x2000,0x3fff,0); SetReadHandler(0x2000,0x37ff,0); SetReadHandler(0x3836,0x3FFF,0); SetReadHandler(0x3800,0x3835,NSFROMRead); SetWriteHandler(0x5ff6,0x5fff,NSF_write); SetWriteHandler(0x3ff0,0x3fff,NSF_write); SetReadHandler(0x3ff0,0x3fff,NSF_read); if(NSFHeader.SoundChip&1) { NSFVRC6_Init(); } else if (NSFHeader.SoundChip&2) { NSFVRC7_Init(); } else if (NSFHeader.SoundChip&4) { FDSSoundReset(); } else if (NSFHeader.SoundChip&8) { NSFMMC5_Init(); } else if (NSFHeader.SoundChip&0x10) { NSFN106_Init(); } else if (NSFHeader.SoundChip&0x20) { NSFAY_Init(); } CurrentSong=NSFHeader.StartingSong; SongReload=0xFF; NSFNMIFlags=0; } static DECLFW(NSF_write) { switch(A) { case 0x3FF3:NSFNMIFlags|=1;break; case 0x3FF4:NSFNMIFlags&=~2;break; case 0x3FF5:NSFNMIFlags|=2;break; case 0x5FF6: case 0x5FF7:if(!(NSFHeader.SoundChip&4)) return; case 0x5FF8: case 0x5FF9: case 0x5FFA: case 0x5FFB: case 0x5FFC: case 0x5FFD: case 0x5FFE: case 0x5FFF:if(!BSon) return; A&=0xF; BANKSET((A*4096),V); break; } } static DECLFR(NSF_read) { int x; switch(A) { case 0x3ff0:x=SongReload; if(!fceuindbg) SongReload=0; return x; case 0x3ff1: if(!fceuindbg) { memset(RAM,0x00,0x800); BWrite[0x4015](0x4015,0x0); for(x=0;x<0x14;x++) BWrite[0x4000+x](0x4000+x,0); BWrite[0x4015](0x4015,0xF); if(NSFHeader.SoundChip&4) { BWrite[0x4017](0x4017,0xC0); /* FDS BIOS writes $C0 */ BWrite[0x4089](0x4089,0x80); BWrite[0x408A](0x408A,0xE8); } else { memset(ExWRAM,0x00,8192); BWrite[0x4017](0x4017,0xC0); BWrite[0x4017](0x4017,0xC0); BWrite[0x4017](0x4017,0x40); } if(BSon) { for(x=0;x<8;x++) BANKSET(0x8000+x*4096,NSFHeader.BankSwitch[x]); } return (CurrentSong-1); } case 0x3FF3:return PAL; } return 0; } uint8 FCEU_GetJoyJoy(void); static int special=0; void DrawNSF(uint8 *XBuf) { char snbuf[16]; int x; if(vismode==0) return; memset(XBuf,0,256*240); { int32 *Bufpl; int32 mul=0; int l; l=GetSoundBuffer(&Bufpl); if(special==0) { if(FSettings.SoundVolume) mul=8192*240/(16384*FSettings.SoundVolume/50); for(x=0;x<256;x++) { uint32 y; y=142+((Bufpl[(x*l)>>8]*mul)>>14); if(y<240) XBuf[x+y*256]=3; } } else if(special==1) { if(FSettings.SoundVolume) mul=8192*240/(8192*FSettings.SoundVolume/50); for(x=0;x<256;x++) { double r; uint32 xp,yp; r=(Bufpl[(x*l)>>8]*mul)>>14; xp=128+r*cos(x*M_PI*2/256); yp=120+r*sin(x*M_PI*2/256); xp&=255; yp%=240; XBuf[xp+yp*256]=3; } } else if(special==2) { static double theta=0; if(FSettings.SoundVolume) mul=8192*240/(16384*FSettings.SoundVolume/50); for(x=0;x<128;x++) { double xc,yc; double r,t; uint32 m,n; xc=(double)128-x; yc=0-((double)( ((Bufpl[(x*l)>>8]) *mul)>>14)); t=M_PI+atan(yc/xc); r=sqrt(xc*xc+yc*yc); t+=theta; m=128+r*cos(t); n=120+r*sin(t); if(m<256 && n<240) XBuf[m+n*256]=3; } for(x=128;x<256;x++) { double xc,yc; double r,t; uint32 m,n; xc=(double)x-128; yc=(double)((Bufpl[(x*l)>>8]*mul)>>14); t=atan(yc/xc); r=sqrt(xc*xc+yc*yc); t+=theta; m=128+r*cos(t); n=120+r*sin(t); if(m<256 && n<240) XBuf[m+n*256]=3; } theta+=(double)M_PI/256; } } DrawTextTrans(XBuf+10*256+4+(((31-strlen((char*)NSFHeader.SongName))<<2)), 256, NSFHeader.SongName, 6); DrawTextTrans(XBuf+26*256+4+(((31-strlen((char*)NSFHeader.Artist))<<2)), 256,NSFHeader.Artist, 6); DrawTextTrans(XBuf+42*256+4+(((31-strlen((char*)NSFHeader.Copyright))<<2)), 256,NSFHeader.Copyright, 6); DrawTextTrans(XBuf+70*256+4+(((31-strlen("Song:"))<<2)), 256, (uint8*)"Song:", 6); sprintf(snbuf,"<%d/%d>",CurrentSong,NSFHeader.TotalSongs); DrawTextTrans(XBuf+82*256+4+(((31-strlen(snbuf))<<2)), 256, (uint8*)snbuf, 6); { static uint8 last=0; uint8 tmp; tmp=FCEU_GetJoyJoy(); if((tmp&JOY_RIGHT) && !(last&JOY_RIGHT)) { if(CurrentSong1) { CurrentSong--; SongReload=0xFF; } } else if((tmp&JOY_UP) && !(last&JOY_UP)) { CurrentSong+=10; if(CurrentSong>NSFHeader.TotalSongs) CurrentSong=NSFHeader.TotalSongs; SongReload=0xFF; } else if((tmp&JOY_DOWN) && !(last&JOY_DOWN)) { CurrentSong-=10; if(CurrentSong<1) CurrentSong=1; SongReload=0xFF; } else if((tmp&JOY_START) && !(last&JOY_START)) SongReload=0xFF; else if((tmp&JOY_A) && !(last&JOY_A)) { special=(special+1)%3; } last=tmp; } } void DoNSFFrame(void) { if(((NSFNMIFlags&1) && SongReload) || (NSFNMIFlags&2)) TriggerNMI(); } void FCEUI_NSFSetVis(int mode) { vismode=mode; } int FCEUI_NSFChange(int amount) { CurrentSong+=amount; if(CurrentSong<1) CurrentSong=1; else if(CurrentSong>NSFHeader.TotalSongs) CurrentSong=NSFHeader.TotalSongs; SongReload=0xFF; return(CurrentSong); } /* Returns total songs */ int FCEUI_NSFGetInfo(uint8 *name, uint8 *artist, uint8 *copyright, int maxlen) { strncpy(name,NSFHeader.SongName,maxlen); strncpy(artist,NSFHeader.Artist,maxlen); strncpy(copyright,NSFHeader.Copyright,maxlen); return(NSFHeader.TotalSongs); } fceu-0.98.12/src/nsf.h0000644000175000000620000000332710003562765014251 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ typedef struct { char ID[5]; /*NESM^Z*/ uint8 Version; uint8 TotalSongs; uint8 StartingSong; uint8 LoadAddressLow; uint8 LoadAddressHigh; uint8 InitAddressLow; uint8 InitAddressHigh; uint8 PlayAddressLow; uint8 PlayAddressHigh; uint8 SongName[32]; uint8 Artist[32]; uint8 Copyright[32]; uint8 NTSCspeed[2]; // Unused uint8 BankSwitch[8]; uint8 PALspeed[2]; // Unused uint8 VideoSystem; uint8 SoundChip; uint8 Expansion[4]; uint8 reserve[8]; } NSF_HEADER; void NSF_init(void); void DrawNSF(uint8 *XBuf); void NSFDealloc(void); void NSFDodo(void); void DoNSFFrame(void); fceu-0.98.12/src/ops.h0000644000175000000620000002313610030466356014263 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ case 0x00: /* BRK */ _PC++; PUSH(_PC>>8); PUSH(_PC); PUSH(_P|U_FLAG|B_FLAG); _P|=I_FLAG; _PI|=I_FLAG; _PC=RdMem(0xFFFE); _PC|=RdMem(0xFFFF)<<8; break; case 0x40: /* RTI */ _P=POP(); /* _PI=_P; This is probably incorrect, so it's commented out. */ _PI = _P; _PC=POP(); _PC|=POP()<<8; break; case 0x60: /* RTS */ _PC=POP(); _PC|=POP()<<8; _PC++; break; case 0x48: /* PHA */ PUSH(_A); break; case 0x08: /* PHP */ PUSH(_P|U_FLAG|B_FLAG); break; case 0x68: /* PLA */ _A=POP(); X_ZN(_A); break; case 0x28: /* PLP */ _P=POP(); break; case 0x4C: { uint16 ptmp=_PC; unsigned int npc; npc=RdMem(ptmp); ptmp++; npc|=RdMem(ptmp)<<8; _PC=npc; } break; /* JMP ABSOLUTE */ case 0x6C: { uint32 tmp; GetAB(tmp); _PC=RdMem(tmp); _PC|=RdMem( ((tmp+1)&0x00FF) | (tmp&0xFF00))<<8; } break; case 0x20: /* JSR */ { uint8 npc; npc=RdMem(_PC); _PC++; PUSH(_PC>>8); PUSH(_PC); _PC=RdMem(_PC)<<8; _PC|=npc; } break; case 0xAA: /* TAX */ _X=_A; X_ZN(_A); break; case 0x8A: /* TXA */ _A=_X; X_ZN(_A); break; case 0xA8: /* TAY */ _Y=_A; X_ZN(_A); break; case 0x98: /* TYA */ _A=_Y; X_ZN(_A); break; case 0xBA: /* TSX */ _X=_S; X_ZN(_X); break; case 0x9A: /* TXS */ _S=_X; break; case 0xCA: /* DEX */ _X--; X_ZN(_X); break; case 0x88: /* DEY */ _Y--; X_ZN(_Y); break; case 0xE8: /* INX */ _X++; X_ZN(_X); break; case 0xC8: /* INY */ _Y++; X_ZN(_Y); break; case 0x18: /* CLC */ _P&=~C_FLAG; break; case 0xD8: /* CLD */ _P&=~D_FLAG; break; case 0x58: /* CLI */ _P&=~I_FLAG; break; case 0xB8: /* CLV */ _P&=~V_FLAG; break; case 0x38: /* SEC */ _P|=C_FLAG; break; case 0xF8: /* SED */ _P|=D_FLAG; break; case 0x78: /* SEI */ _P|=I_FLAG; break; case 0xEA: /* NOP */ break; case 0x0A: RMW_A(ASL); case 0x06: RMW_ZP(ASL); case 0x16: RMW_ZPX(ASL); case 0x0E: RMW_AB(ASL); case 0x1E: RMW_ABX(ASL); case 0xC6: RMW_ZP(DEC); case 0xD6: RMW_ZPX(DEC); case 0xCE: RMW_AB(DEC); case 0xDE: RMW_ABX(DEC); case 0xE6: RMW_ZP(INC); case 0xF6: RMW_ZPX(INC); case 0xEE: RMW_AB(INC); case 0xFE: RMW_ABX(INC); case 0x4A: RMW_A(LSR); case 0x46: RMW_ZP(LSR); case 0x56: RMW_ZPX(LSR); case 0x4E: RMW_AB(LSR); case 0x5E: RMW_ABX(LSR); case 0x2A: RMW_A(ROL); case 0x26: RMW_ZP(ROL); case 0x36: RMW_ZPX(ROL); case 0x2E: RMW_AB(ROL); case 0x3E: RMW_ABX(ROL); case 0x6A: RMW_A(ROR); case 0x66: RMW_ZP(ROR); case 0x76: RMW_ZPX(ROR); case 0x6E: RMW_AB(ROR); case 0x7E: RMW_ABX(ROR); case 0x69: LD_IM(ADC); case 0x65: LD_ZP(ADC); case 0x75: LD_ZPX(ADC); case 0x6D: LD_AB(ADC); case 0x7D: LD_ABX(ADC); case 0x79: LD_ABY(ADC); case 0x61: LD_IX(ADC); case 0x71: LD_IY(ADC); case 0x29: LD_IM(AND); case 0x25: LD_ZP(AND); case 0x35: LD_ZPX(AND); case 0x2D: LD_AB(AND); case 0x3D: LD_ABX(AND); case 0x39: LD_ABY(AND); case 0x21: LD_IX(AND); case 0x31: LD_IY(AND); case 0x24: LD_ZP(BIT); case 0x2C: LD_AB(BIT); case 0xC9: LD_IM(CMP); case 0xC5: LD_ZP(CMP); case 0xD5: LD_ZPX(CMP); case 0xCD: LD_AB(CMP); case 0xDD: LD_ABX(CMP); case 0xD9: LD_ABY(CMP); case 0xC1: LD_IX(CMP); case 0xD1: LD_IY(CMP); case 0xE0: LD_IM(CPX); case 0xE4: LD_ZP(CPX); case 0xEC: LD_AB(CPX); case 0xC0: LD_IM(CPY); case 0xC4: LD_ZP(CPY); case 0xCC: LD_AB(CPY); case 0x49: LD_IM(EOR); case 0x45: LD_ZP(EOR); case 0x55: LD_ZPX(EOR); case 0x4D: LD_AB(EOR); case 0x5D: LD_ABX(EOR); case 0x59: LD_ABY(EOR); case 0x41: LD_IX(EOR); case 0x51: LD_IY(EOR); case 0xA9: LD_IM(LDA); case 0xA5: LD_ZP(LDA); case 0xB5: LD_ZPX(LDA); case 0xAD: LD_AB(LDA); case 0xBD: LD_ABX(LDA); case 0xB9: LD_ABY(LDA); case 0xA1: LD_IX(LDA); case 0xB1: LD_IY(LDA); case 0xA2: LD_IM(LDX); case 0xA6: LD_ZP(LDX); case 0xB6: LD_ZPY(LDX); case 0xAE: LD_AB(LDX); case 0xBE: LD_ABY(LDX); case 0xA0: LD_IM(LDY); case 0xA4: LD_ZP(LDY); case 0xB4: LD_ZPX(LDY); case 0xAC: LD_AB(LDY); case 0xBC: LD_ABX(LDY); case 0x09: LD_IM(ORA); case 0x05: LD_ZP(ORA); case 0x15: LD_ZPX(ORA); case 0x0D: LD_AB(ORA); case 0x1D: LD_ABX(ORA); case 0x19: LD_ABY(ORA); case 0x01: LD_IX(ORA); case 0x11: LD_IY(ORA); case 0xEB: /* (undocumented) */ case 0xE9: LD_IM(SBC); case 0xE5: LD_ZP(SBC); case 0xF5: LD_ZPX(SBC); case 0xED: LD_AB(SBC); case 0xFD: LD_ABX(SBC); case 0xF9: LD_ABY(SBC); case 0xE1: LD_IX(SBC); case 0xF1: LD_IY(SBC); case 0x85: ST_ZP(_A); case 0x95: ST_ZPX(_A); case 0x8D: ST_AB(_A); case 0x9D: ST_ABX(_A); case 0x99: ST_ABY(_A); case 0x81: ST_IX(_A); case 0x91: ST_IY(_A); case 0x86: ST_ZP(_X); case 0x96: ST_ZPY(_X); case 0x8E: ST_AB(_X); case 0x84: ST_ZP(_Y); case 0x94: ST_ZPX(_Y); case 0x8C: ST_AB(_Y); /* BCC */ case 0x90: JR(!(_P&C_FLAG)); break; /* BCS */ case 0xB0: JR(_P&C_FLAG); break; /* BEQ */ case 0xF0: JR(_P&Z_FLAG); break; /* BNE */ case 0xD0: JR(!(_P&Z_FLAG)); break; /* BMI */ case 0x30: JR(_P&N_FLAG); break; /* BPL */ case 0x10: JR(!(_P&N_FLAG)); break; /* BVC */ case 0x50: JR(!(_P&V_FLAG)); break; /* BVS */ case 0x70: JR(_P&V_FLAG); break; //default: printf("Bad %02x at $%04x\n",b1,X.PC);break; //ifdef moo /* Here comes the undocumented instructions block. Note that this implementation may be "wrong". If so, please tell me. */ /* AAC */ case 0x2B: case 0x0B: LD_IM(AND;_P&=~C_FLAG;_P|=_A>>7); /* AAX */ case 0x87: ST_ZP(_A&_X); case 0x97: ST_ZPY(_A&_X); case 0x8F: ST_AB(_A&_X); case 0x83: ST_IX(_A&_X); /* ARR - ARGH, MATEY! */ case 0x6B: { uint8 arrtmp; LD_IM(AND;_P&=~V_FLAG;_P|=(_A^(_A>>1))&0x40;arrtmp=_A>>7;_A>>=1;_A|=(_P&C_FLAG)<<7;_P&=~C_FLAG;_P|=arrtmp;X_ZN(_A)); } /* ASR */ case 0x4B: LD_IM(AND;LSRA); /* ATX(OAL) Is this(OR with $EE) correct? */ case 0xAB: LD_IM(_A|=0xEE;AND;_X=_A); /* AXS */ case 0xCB: LD_IM(AXS); /* DCP */ case 0xC7: LD_ZP(DEC;CMP); case 0xD7: LD_ZPX(DEC;CMP); case 0xCF: LD_AB(DEC;CMP); case 0xDF: LD_ABX(DEC;CMP); case 0xDB: LD_ABY(DEC;CMP); case 0xC3: LD_IX(DEC;CMP); case 0xD3: LD_IY(DEC;CMP); /* ISC */ case 0xE7: LD_ZP(INC;SBC); case 0xF7: LD_ZPX(INC;SBC); case 0xEF: LD_AB(INC;SBC); case 0xFF: LD_ABX(INC;SBC); case 0xFB: LD_ABY(INC;SBC); case 0xE3: LD_IX(INC;SBC); case 0xF3: LD_IY(INC;SBC); /* DOP */ case 0x04: _PC++;break; case 0x14: _PC++;break; case 0x34: _PC++;break; case 0x44: _PC++;break; case 0x54: _PC++;break; case 0x64: _PC++;break; case 0x74: _PC++;break; case 0x80: _PC++;break; case 0x82: _PC++;break; case 0x89: _PC++;break; case 0xC2: _PC++;break; case 0xD4: _PC++;break; case 0xE2: _PC++;break; case 0xF4: _PC++;break; /* KIL */ case 0x02: case 0x12: case 0x22: case 0x32: case 0x42: case 0x52: case 0x62: case 0x72: case 0x92: case 0xB2: case 0xD2: case 0xF2:ADDCYC(0xFF); _jammed=1; _PC--; break; /* LAR */ case 0xBB: RMW_ABY(_S&=x;_A=_X=_S;X_ZN(_X)); /* LAX */ case 0xA7: LD_ZP(LDA;LDX); case 0xB7: LD_ZPY(LDA;LDX); case 0xAF: LD_AB(LDA;LDX); case 0xBF: LD_ABY(LDA;LDX); case 0xA3: LD_IX(LDA;LDX); case 0xB3: LD_IY(LDA;LDX); /* NOP */ case 0x1A: case 0x3A: case 0x5A: case 0x7A: case 0xDA: case 0xFA: break; /* RLA */ case 0x27: RMW_ZP(ROL;AND); case 0x37: RMW_ZPX(ROL;AND); case 0x2F: RMW_AB(ROL;AND); case 0x3F: RMW_ABX(ROL;AND); case 0x3B: RMW_ABY(ROL;AND); case 0x23: RMW_IX(ROL;AND); case 0x33: RMW_IY(ROL;AND); /* RRA */ case 0x67: RMW_ZP(ROR;ADC); case 0x77: RMW_ZPX(ROR;ADC); case 0x6F: RMW_AB(ROR;ADC); case 0x7F: RMW_ABX(ROR;ADC); case 0x7B: RMW_ABY(ROR;ADC); case 0x63: RMW_IX(ROR;ADC); case 0x73: RMW_IY(ROR;ADC); /* SLO */ case 0x07: RMW_ZP(ASL;ORA); case 0x17: RMW_ZPX(ASL;ORA); case 0x0F: RMW_AB(ASL;ORA); case 0x1F: RMW_ABX(ASL;ORA); case 0x1B: RMW_ABY(ASL;ORA); case 0x03: RMW_IX(ASL;ORA); case 0x13: RMW_IY(ASL;ORA); /* SRE */ case 0x47: RMW_ZP(LSR;EOR); case 0x57: RMW_ZPX(LSR;EOR); case 0x4F: RMW_AB(LSR;EOR); case 0x5F: RMW_ABX(LSR;EOR); case 0x5B: RMW_ABY(LSR;EOR); case 0x43: RMW_IX(LSR;EOR); case 0x53: RMW_IY(LSR;EOR); /* AXA - SHA */ case 0x93: ST_IY(_A&_X&(((A-_Y)>>8)+1)); case 0x9F: ST_ABY(_A&_X&(((A-_Y)>>8)+1)); /* SYA */ case 0x9C: ST_ABX(_Y&(((A-_X)>>8)+1)); /* SXA */ case 0x9E: ST_ABY(_X&(((A-_Y)>>8)+1)); /* XAS */ case 0x9B: _S=_A&_X;ST_ABY(_S& (((A-_Y)>>8)+1) ); /* TOP */ case 0x0C: LD_AB(;); case 0x1C: case 0x3C: case 0x5C: case 0x7C: case 0xDC: case 0xFC: LD_ABX(;); /* XAA - BIG QUESTION MARK HERE */ case 0x8B: _A|=0xEE; _A&=_X; LD_IM(AND); //endif fceu-0.98.12/src/palette.c0000644000175000000620000001734210051463463015114 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002,2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 #include "types.h" #include "fceu.h" #include "general.h" #include "driver.h" #include "palette.h" #include "palettes/palettes.h" #ifndef M_PI #define M_PI 3.14159265358979323846 #endif static int ntsccol=0; static int ntsctint=46+10; static int ntschue=72; /* These are dynamically filled/generated palettes: */ pal palettei[64]; // Custom palette for an individual game. pal palettec[64]; // Custom "global" palette. pal paletten[64]; // Mathematically generated palette. static void CalculatePalette(void); static void ChoosePalette(void); static void WritePalette(void); uint8 pale=0; pal *palo; static pal *palpoint[8]= { palette, rp2c04001, rp2c04002, rp2c04003, rp2c05004, }; void FCEUI_SetPaletteArray(uint8 *pal) { if(!pal) palpoint[0]=palette; else { int x; palpoint[0]=palettec; for(x=0;x<64;x++) { palpoint[0][x].r=*((uint8 *)pal+x+x+x); palpoint[0][x].g=*((uint8 *)pal+x+x+x+1); palpoint[0][x].b=*((uint8 *)pal+x+x+x+2); } } FCEU_ResetPalette(); } void FCEUI_SetNTSCTH(int n, int tint, int hue) { ntsctint=tint; ntschue=hue; ntsccol=n; FCEU_ResetPalette(); } static uint8 lastd=0; void SetNESDeemph(uint8 d, int force) { static uint16 rtmul[7]={32768*1.239,32768*.794,32768*1.019,32768*.905,32768*1.023,32768*.741,32768*.75}; static uint16 gtmul[7]={32768*.915,32768*1.086,32768*.98,32768*1.026,32768*.908,32768*.987,32768*.75}; static uint16 btmul[7]={32768*.743,32768*.882,32768*.653,32768*1.277,32768*.979,32768*.101,32768*.75}; uint32 r,g,b; int x; /* If it's not forced(only forced when the palette changes), don't waste cpu time if the same deemphasis bits are set as the last call. */ if(!force) { if(d==lastd) return; } else /* Only set this when palette has changed. */ { r=rtmul[6]; g=rtmul[6]; b=rtmul[6]; for(x=0;x<0x40;x++) { uint32 m,n,o; m=palo[x].r; n=palo[x].g; o=palo[x].b; m=(m*r)>>15; n=(n*g)>>15; o=(o*b)>>15; if(m>0xff) m=0xff; if(n>0xff) n=0xff; if(o>0xff) o=0xff; FCEUD_SetPalette(x|0xC0,m,n,o); } } if(!d) return; /* No deemphasis, so return. */ r=rtmul[d-1]; g=gtmul[d-1]; b=btmul[d-1]; for(x=0;x<0x40;x++) { uint32 m,n,o; m=palo[x].r; n=palo[x].g; o=palo[x].b; m=(m*r)>>15; n=(n*g)>>15; o=(o*b)>>15; if(m>0xff) m=0xff; if(n>0xff) n=0xff; if(o>0xff) o=0xff; FCEUD_SetPalette(x|0x40,m,n,o); } lastd=d; } /* Converted from Kevin Horton's qbasic palette generator. */ static void CalculatePalette(void) { int x,z; int r,g,b; double s,luma,theta; static uint8 cols[16]={0,24,21,18,15,12,9,6,3,0,33,30,27,0,0,0}; static uint8 br1[4]={6,9,12,12}; static double br2[4]={.29,.45,.73,.9}; static double br3[4]={0,.24,.47,.77}; for(x=0;x<=3;x++) for(z=0;z<16;z++) { s=(double)ntsctint/128; luma=br2[x]; if(z==0) {s=0;luma=((double)br1[x])/12;} if(z>=13) { s=luma=0; if(z==13) luma=br3[x]; } theta=(double)M_PI*(double)(((double)cols[z]*10+ (((double)ntschue/2)+300) )/(double)180); r=(int)((luma+s*sin(theta))*256); g=(int)((luma-(double)27/53*s*sin(theta)+(double)10/53*s*cos(theta))*256); b=(int)((luma-s*cos(theta))*256); if(r>255) r=255; if(g>255) g=255; if(b>255) b=255; if(r<0) r=0; if(g<0) g=0; if(b<0) b=0; paletten[(x<<4)+z].r=r; paletten[(x<<4)+z].g=g; paletten[(x<<4)+z].b=b; } WritePalette(); } static int ipalette=0; void FCEU_LoadGamePalette(void) { uint8 ptmp[192]; FILE *fp; char *fn; ipalette=0; fn=FCEU_MakeFName(FCEUMKF_PALETTE,0,0); if((fp=FCEUD_UTF8fopen(fn,"rb"))) { int x; fread(ptmp,1,192,fp); fclose(fp); for(x=0;x<64;x++) { palettei[x].r=ptmp[x+x+x]; palettei[x].g=ptmp[x+x+x+1]; palettei[x].b=ptmp[x+x+x+2]; } ipalette=1; } free(fn); } void FCEU_ResetPalette(void) { if(FCEUGameInfo) { ChoosePalette(); WritePalette(); } } static void ChoosePalette(void) { if(FCEUGameInfo->type==GIT_NSF) palo=0; else if(ipalette) palo=palettei; else if(ntsccol && !PAL && FCEUGameInfo->type!=GIT_VSUNI) { palo=paletten; CalculatePalette(); } else palo=palpoint[pale]; } void WritePalette(void) { int x; for(x=0;x<7;x++) FCEUD_SetPalette(x,unvpalette[x].r,unvpalette[x].g,unvpalette[x].b); if(FCEUGameInfo->type==GIT_NSF) { //for(x=0;x<128;x++) // FCEUD_SetPalette(x,x,0,x); } else { for(x=0;x<64;x++) FCEUD_SetPalette(128+x,palo[x].r,palo[x].g,palo[x].b); SetNESDeemph(lastd,1); } } void FCEUI_GetNTSCTH(int *tint, int *hue) { *tint=ntsctint; *hue=ntschue; } static int controlselect=0; static int controllength=0; void FCEUI_NTSCDEC(void) { if(ntsccol && FCEUGameInfo->type!=GIT_VSUNI &&!PAL && FCEUGameInfo->type!=GIT_NSF) { int which; if(controlselect) { if(controllength) { which=controlselect==1?ntschue:ntsctint; which--; if(which<0) which=0; if(controlselect==1) ntschue=which; else ntsctint=which; CalculatePalette(); } controllength=360; } } } void FCEUI_NTSCINC(void) { if(ntsccol && FCEUGameInfo->type!=GIT_VSUNI && !PAL && FCEUGameInfo->type!=GIT_NSF) if(controlselect) { if(controllength) { switch(controlselect) { case 1:ntschue++; if(ntschue>128) ntschue=128; CalculatePalette(); break; case 2:ntsctint++; if(ntsctint>128) ntsctint=128; CalculatePalette(); break; } } controllength=360; } } void FCEUI_NTSCSELHUE(void) { if(ntsccol && FCEUGameInfo->type!=GIT_VSUNI && !PAL && FCEUGameInfo->type!=GIT_NSF){controlselect=1;controllength=360;} } void FCEUI_NTSCSELTINT(void) { if(ntsccol && FCEUGameInfo->type!=GIT_VSUNI && !PAL && FCEUGameInfo->type!=GIT_NSF){controlselect=2;controllength=360;} } void FCEU_DrawNTSCControlBars(uint8 *XBuf) { uint8 *XBaf; int which=0; int x,x2; if(!controllength) return; controllength--; if(!XBuf) return; if(controlselect==1) { DrawTextTrans(XBuf+128-12+180*256, 256, (uint8 *)"Hue", 0x85); which=ntschue<<1; } else if(controlselect==2) { DrawTextTrans(XBuf+128-16+180*256, 256, (uint8 *)"Tint", 0x85); which=ntsctint<<1; } XBaf=XBuf+200*256; for(x=0;x=-6;x2--) { XBaf[x-256*x2]=0x85; } } for(;x<256;x+=2) { for(x2=2;x2>=-2;x2--) XBaf[x-256*x2]=0x85; } } fceu-0.98.12/src/palette.h0000644000175000000620000000033610003562765015116 0ustar joestaff00000000000000typedef struct { uint8 r,g,b; } pal; extern pal *palo; void FCEU_ResetPalette(void); void FCEU_ResetPalette(void); void FCEU_ResetMessages(); void FCEU_LoadGamePalette(void); void FCEU_DrawNTSCControlBars(uint8 *XBuf); fceu-0.98.12/src/palettes/0002755000175000000620000000000010052171110015110 5ustar joestaff00000000000000fceu-0.98.12/src/palettes/rp2c04001.h0000644000175000000620000000240010051750106016515 0ustar joestaff00000000000000{0xfc, 0xc4, 0xd8}, {0x40, 0x88, 0xfc}, {0xd8, 0x28, 0x00}, {0x5c, 0x94, 0xfc}, {0x00, 0x80, 0x88}, {0x00, 0x44, 0x00}, {0x00, 0x00, 0x00}, {0xe4, 0x00, 0x58}, {0xfc, 0xfc, 0xfc}, {0x74, 0x74, 0x74}, {0xfc, 0x98, 0x38}, {0xa8, 0x00, 0x10}, {0x8c, 0x00, 0x74}, {0xfc, 0x98, 0x38}, {0x40, 0x2c, 0x00}, {0xfc, 0xfc, 0xfc}, {0x3c, 0xbc, 0xfc}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x80, 0xd0, 0x10}, {0x9c, 0xfc, 0xf0}, {0xc4, 0xd4, 0xfc}, {0xfc, 0xbc, 0xb0}, {0x20, 0x38, 0xec}, {0x00, 0x00, 0x00}, {0x58, 0xf8, 0x98}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0xfc, 0xfc, 0xfc}, {0xbc, 0xbc, 0xbc}, {0xf4, 0x78, 0xfc}, {0x24, 0x18, 0x8c}, {0x00, 0x00, 0x00}, {0xa8, 0xe4, 0xfc}, {0x00, 0x00, 0x00}, {0x4c, 0xdc, 0x48}, {0x00, 0xe8, 0xd8}, {0x18, 0x3c, 0x5c}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x7c, 0x08, 0x00}, {0xfc, 0xc4, 0xfc}, {0xa4, 0x00, 0x00}, {0x80, 0x00, 0xf0}, {0x00, 0x00, 0xa8}, {0xfc, 0x74, 0x60}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x94, 0x00}, {0xbc, 0xbc, 0xbc}, {0x00, 0x50, 0x00}, {0xe0, 0xfc, 0xa0}, {0x00, 0x00, 0x00}, {0xfc, 0xd8, 0xa8}, {0xc8, 0x4c, 0x0c}, {0x00, 0x00, 0x00}, {0x00, 0x70, 0xec}, {0x00, 0x44, 0x00}, {0x00, 0x00, 0x00}, {0xe0, 0xfc, 0xa0}, {0xfc, 0x74, 0xb4}, {0x88, 0x70, 0x00}, {0x00, 0x00, 0x00}, fceu-0.98.12/src/palettes/palettes.h0000644000175000000620000000754310051504171017117 0ustar joestaff00000000000000pal rp2c04001[64] = { #include "rp2c04001.h" }; pal rp2c04002[64] = { #include "rp2c04002.h" }; pal rp2c04003[64] = { #include "rp2c04003.h" }; pal rp2c05004[64] = { #include "rp2c05004.h" }; pal unvpalette[7] = { { 0x00<<2,0x00<<2,0x00<<2}, // Black { 0x3F<<2,0x3F<<2,0x34<<2}, // White { 0x00<<2,0x00<<2,0x00<<2}, // Black { 0x1d<<2,0x1d<<2,0x24<<2}, // Greyish { 190,0,0 }, // Redish { 51,255,51}, // Bright green { 49,14,200}, }; /* Default palette */ pal palette[64] = { { 0x1D<<2, 0x1D<<2, 0x1D<<2 }, /* Value 0 */ { 0x09<<2, 0x06<<2, 0x23<<2 }, /* Value 1 */ { 0x00<<2, 0x00<<2, 0x2A<<2 }, /* Value 2 */ { 0x11<<2, 0x00<<2, 0x27<<2 }, /* Value 3 */ { 0x23<<2, 0x00<<2, 0x1D<<2 }, /* Value 4 */ { 0x2A<<2, 0x00<<2, 0x04<<2 }, /* Value 5 */ { 0x29<<2, 0x00<<2, 0x00<<2 }, /* Value 6 */ { 0x1F<<2, 0x02<<2, 0x00<<2 }, /* Value 7 */ { 0x10<<2, 0x0B<<2, 0x00<<2 }, /* Value 8 */ { 0x00<<2, 0x11<<2, 0x00<<2 }, /* Value 9 */ { 0x00<<2, 0x14<<2, 0x00<<2 }, /* Value 10 */ { 0x00<<2, 0x0F<<2, 0x05<<2 }, /* Value 11 */ { 0x06<<2, 0x0F<<2, 0x17<<2 }, /* Value 12 */ { 0x00<<2, 0x00<<2, 0x00<<2 }, /* Value 13 */ { 0x00<<2, 0x00<<2, 0x00<<2 }, /* Value 14 */ { 0x00<<2, 0x00<<2, 0x00<<2 }, /* Value 15 */ { 0x2F<<2, 0x2F<<2, 0x2F<<2 }, /* Value 16 */ { 0x00<<2, 0x1C<<2, 0x3B<<2 }, /* Value 17 */ { 0x08<<2, 0x0E<<2, 0x3B<<2 }, /* Value 18 */ { 0x20<<2, 0x00<<2, 0x3C<<2 }, /* Value 19 */ { 0x2F<<2, 0x00<<2, 0x2F<<2 }, /* Value 20 */ { 0x39<<2, 0x00<<2, 0x16<<2 }, /* Value 21 */ { 0x36<<2, 0x0A<<2, 0x00<<2 }, /* Value 22 */ { 0x32<<2, 0x13<<2, 0x03<<2 }, /* Value 23 */ { 0x22<<2, 0x1C<<2, 0x00<<2 }, /* Value 24 */ { 0x00<<2, 0x25<<2, 0x00<<2 }, /* Value 25 */ { 0x00<<2, 0x2A<<2, 0x00<<2 }, /* Value 26 */ { 0x00<<2, 0x24<<2, 0x0E<<2 }, /* Value 27 */ { 0x00<<2, 0x20<<2, 0x22<<2 }, /* Value 28 */ { 0x00<<2, 0x00<<2, 0x00<<2 }, /* Value 29 */ { 0x00<<2, 0x00<<2, 0x00<<2 }, /* Value 30 */ { 0x00<<2, 0x00<<2, 0x00<<2 }, /* Value 31 */ { 0x3F<<2, 0x3F<<2, 0x3F<<2 }, /* Value 32 */ { 0x0F<<2, 0x2F<<2, 0x3F<<2 }, /* Value 33 */ { 0x17<<2, 0x25<<2, 0x3F<<2 }, /* Value 34 */ { 0x10<<2, 0x22<<2, 0x3F<<2 }, /* Value 35 */ { 0x3D<<2, 0x1E<<2, 0x3F<<2 }, /* Value 36 */ { 0x3F<<2, 0x1D<<2, 0x2D<<2 }, /* Value 37 */ { 0x3F<<2, 0x1D<<2, 0x18<<2 }, /* Value 38 */ { 0x3F<<2, 0x26<<2, 0x0E<<2 }, /* Value 39 */ { 0x3C<<2, 0x2F<<2, 0x0F<<2 }, /* Value 40 */ { 0x20<<2, 0x34<<2, 0x04<<2 }, /* Value 41 */ { 0x13<<2, 0x37<<2, 0x12<<2 }, /* Value 42 */ { 0x16<<2, 0x3E<<2, 0x26<<2 }, /* Value 43 */ { 0x00<<2, 0x3A<<2, 0x36<<2 }, /* Value 44 */ { 0x1E<<2, 0x1E<<2, 0x1E<<2 }, /* Value 45 */ { 0x00<<2, 0x00<<2, 0x00<<2 }, /* Value 46 */ { 0x00<<2, 0x00<<2, 0x00<<2 }, /* Value 47 */ { 0x3F<<2, 0x3F<<2, 0x3F<<2 }, /* Value 48 */ { 0x2A<<2, 0x39<<2, 0x3F<<2 }, /* Value 49 */ { 0x31<<2, 0x35<<2, 0x3F<<2 }, /* Value 50 */ { 0x35<<2, 0x32<<2, 0x3F<<2 }, /* Value 51 */ { 0x3F<<2, 0x31<<2, 0x3F<<2 }, /* Value 52 */ { 0x3F<<2, 0x31<<2, 0x36<<2 }, /* Value 53 */ { 0x3F<<2, 0x2F<<2, 0x2C<<2 }, /* Value 54 */ { 0x3F<<2, 0x36<<2, 0x2A<<2 }, /* Value 55 */ { 0x3F<<2, 0x39<<2, 0x28<<2 }, /* Value 56 */ { 0x38<<2, 0x3F<<2, 0x28<<2 }, /* Value 57 */ { 0x2A<<2, 0x3C<<2, 0x2F<<2 }, /* Value 58 */ { 0x2C<<2, 0x3F<<2, 0x33<<2 }, /* Value 59 */ { 0x27<<2, 0x3F<<2, 0x3C<<2 }, /* Value 60 */ { 0x31<<2, 0x31<<2, 0x31<<2 }, /* Value 61 */ { 0x00<<2, 0x00<<2, 0x00<<2 }, /* Value 62 */ { 0x00<<2, 0x00<<2, 0x00<<2 }, /* Value 63 */ }; fceu-0.98.12/src/palettes/conv.c0000644000175000000620000000606510051750106016235 0ustar joestaff00000000000000/* Quick conversion stuff for MAME->FCE Ultra */ #include #include "../types.h" #include "../palette.h" #include "palettes.h" /* check 0x08 */ static uint8 rp2c04001_colortable[] = { 0x35, 0x23, 0x16, 0x22, 0x1c, 0x09, 0xff, 0x15, /* 0x00 - 0x07 */ 0x20, 0x00, 0x27, 0x05, 0x04, 0x27, 0x08, 0x30, /* 0x08 - 0x0f */ 0x21, 0xff, 0xff, 0x29, 0x3c, 0x32, 0x36, 0x12, /* 0x10 - 0x17 */ 0xff, 0x2b, 0x0f, 0xff, 0x20, 0x10, 0x24, 0x01, /* 0x18 - 0x1f */ 0xff, 0x31, 0xff, 0x2a, 0x2c, 0x0c, 0xff, 0xff, /* 0x20 - 0x27 */ 0xff, 0x07, 0x34, 0x06, 0x13, 0x02, 0x26, 0x0f, /* 0x28 - 0x2f */ 0xff, 0x19, 0x10, 0x0a, 0x39, 0xff, 0x37, 0x17, /* 0x30 - 0x37 */ 0xff, 0x11, 0x09, 0xff, 0x39, 0x25, 0x18, 0xff /* 0x38 - 0x3f */ }; /* RP2C04-002 */ static uint8 rp2c04002_colortable[] = { 0x0f, 0x27, 0x18, 0xff, 0x3a, 0x25, 0xff, 0x31, /* 0x00 - 0x07 */ 0x16, 0x13, 0x38, 0x34, 0x20, 0x23, 0xff, 0x0b, /* 0x08 - 0x0f */ 0xff, 0x21, 0x06, 0xff, 0x1b, 0x29, 0xff, 0x22, /* 0x10 - 0x17 */ 0xff, 0x24, 0xff, 0x2b, 0xff, 0x08, 0xff, 0x03, /* 0x18 - 0x1f */ 0xff, 0x36, 0x26, 0x33, 0x11, 0xff, 0x10, 0x02, /* 0x20 - 0x27 */ 0x14, 0xff, 0x00, 0x09, 0x12, 0x0f, 0x37, 0x30, /* 0x28 - 0x2f */ 0xff, 0xff, 0x2a, 0x17, 0x0c, 0x01, 0x15, 0x19, /* 0x30 - 0x37 */ 0xff, 0x2c, 0x07, 0x37, 0xff, 0x05, 0x0a, 0x00 /* 0x38 - 0x3f */ }; /* RP2C04-003 */ /* Check 0x00. Used in Dr Mario. */ static uint8 rp2c04003_colortable[] = { 0x03, 0xff, 0xff, 0x00, 0x1a, 0x30, 0x31, 0x09, /* 0x00 - 0x07 */ 0x01, 0x0f, 0x36, 0x08, 0x15, 0xff, 0xff, 0x30, /* 0x08 - 0x0f */ 0x22, 0x1c, 0xff, 0x12, 0x19, 0x18, 0x17, 0x1b, /* 0x10 - 0x17 */ 0x00, 0xff, 0xff, 0x02, 0x16, 0x06, 0xff, 0x35, /* 0x18 - 0x1f */ 0x23, 0xff, 0x0f, 0x37, 0xff, 0x27, 0x26, 0x30, /* 0x20 - 0x27 */ 0x29, 0xff, 0x21, 0x24, 0x11, 0xff, 0x0f, 0xff, /* 0x28 - 0x2f */ 0x2c, 0xff, 0xff, 0xff, 0x07, 0x2a, 0x28, 0xff, /* 0x30 - 0x37 */ 0x0a, 0xff, 0x32, 0x37, 0x13, 0xff, 0xff, 0x0c /* 0x38 - 0x3f */ }; /* RP2C05-004 */ /* check 0x1d, 0x38 */ static uint8 rp2c05004_colortable[] = { 0x18, 0xff, 0x1c, 0x28, 0xff, 0xff, 0x01, 0x17, /* 0x00 - 0x07 */ 0x10, 0x0f, 0x2a, 0x0f, 0x36, 0x37, 0x1a, 0xff, /* 0x08 - 0x0f */ 0x25, 0xff, 0x12, 0xff, 0x0f, 0xff, 0xff, 0x26, /* 0x10 - 0x17 */ 0xff, 0xff, 0x22, 0x19, 0xff, 0x0f, 0x3a, 0x21, /* 0x18 - 0x1f */ 0x05, 0x0a, 0x07, 0x01, 0x13, 0xff, 0x00, 0x15, /* 0x20 - 0x27 */ 0x0c, 0xff, 0x11, 0xff, 0xff, 0x38, 0xff, 0xff, /* 0x28 - 0x2f */ 0xff, 0xff, 0x08, 0x16, 0xff, 0xff, 0x30, 0x3c, /* 0x30 - 0x37 */ 0x0f, 0x27, 0xff, 0x31, 0x29, 0xff, 0x30, 0x09 /* 0x38 - 0x3f */ }; main() { int x; for(x=0;x<64;x++) { // if(x <= 0x20) // if(rp2c04002_colortable[x] == 0xFF) rp2c04002_colortable[x]= 0x30; printf("{0x%02x, 0x%02x, 0x%02x},\n",palette[rp2c04001_colortable[x]&0x3F].r, palette[rp2c04001_colortable[x]&0x3F].g, palette[rp2c04001_colortable[x]&0x3F].b); } } fceu-0.98.12/src/palettes/rp2c04002.h0000644000175000000620000000240010051574465016532 0ustar joestaff00000000000000{0x00, 0x00, 0x00}, {0xfc, 0x98, 0x38}, {0x88, 0x70, 0x00}, {0x00, 0x00, 0x00}, {0xa8, 0xf0, 0xbc}, {0xfc, 0x74, 0xb4}, {0x00, 0x00, 0x00}, {0xa8, 0xe4, 0xfc}, {0xd8, 0x28, 0x00}, {0x80, 0x00, 0xf0}, {0xfc, 0xe4, 0xa0}, {0xfc, 0xc4, 0xfc}, {0xfc, 0xfc, 0xfc}, {0x40, 0x88, 0xfc}, {0x00, 0x00, 0x00}, {0x00, 0x3c, 0x14}, {0x00, 0x00, 0x00}, {0x3c, 0xbc, 0xfc}, {0xa4, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x90, 0x38}, {0x80, 0xd0, 0x10}, {0x00, 0x00, 0x00}, {0x5c, 0x94, 0xfc}, {0x00, 0x00, 0x00}, {0xf4, 0x78, 0xfc}, {0x00, 0x00, 0x00}, {0x58, 0xf8, 0x98}, {0x00, 0x00, 0x00}, {0x40, 0x2c, 0x00}, {0x00, 0x00, 0x00}, {0x44, 0x00, 0x9c}, {0x00, 0x00, 0x00}, {0xfc, 0xbc, 0xb0}, {0xfc, 0x74, 0x60}, {0xd4, 0xc8, 0xfc}, {0x00, 0x70, 0xec}, {0x00, 0x00, 0x00}, {0xbc, 0xbc, 0xbc}, {0x00, 0x00, 0xa8}, {0xbc, 0x00, 0xbc}, {0x00, 0x00, 0x00}, {0x74, 0x74, 0x74}, {0x00, 0x44, 0x00}, {0x20, 0x38, 0xec}, {0x00, 0x00, 0x00}, {0xfc, 0xd8, 0xa8}, {0xfc, 0xfc, 0xfc}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x4c, 0xdc, 0x48}, {0xc8, 0x4c, 0x0c}, {0x18, 0x3c, 0x5c}, {0x24, 0x18, 0x8c}, {0xe4, 0x00, 0x58}, {0x00, 0x94, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0xe8, 0xd8}, {0x7c, 0x08, 0x00}, {0xfc, 0xd8, 0xa8}, {0x00, 0x00, 0x00}, {0xa8, 0x00, 0x10}, {0x00, 0x50, 0x00}, {0x74, 0x74, 0x74}, fceu-0.98.12/src/palettes/rp2c04003.h0000644000175000000620000000240010051742404016521 0ustar joestaff00000000000000{0x44, 0x00, 0x9c}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x74, 0x74, 0x74}, {0x00, 0xa8, 0x00}, {0xfc, 0xfc, 0xfc}, {0xa8, 0xe4, 0xfc}, {0x00, 0x44, 0x00}, {0x24, 0x18, 0x8c}, {0x00, 0x00, 0x00}, {0xfc, 0xbc, 0xb0}, {0x40, 0x2c, 0x00}, {0xe4, 0x00, 0x58}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0xfc, 0xfc, 0xfc}, {0x5c, 0x94, 0xfc}, {0x00, 0x80, 0x88}, {0x00, 0x00, 0x00}, {0x20, 0x38, 0xec}, {0x00, 0x94, 0x00}, {0x88, 0x70, 0x00}, {0xc8, 0x4c, 0x0c}, {0x00, 0x90, 0x38}, {0x74, 0x74, 0x74}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0xa8}, {0xd8, 0x28, 0x00}, {0xa4, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0xfc, 0xc4, 0xd8}, {0x40, 0x88, 0xfc}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0xfc, 0xd8, 0xa8}, {0x00, 0x00, 0x00}, {0xfc, 0x98, 0x38}, {0xfc, 0x74, 0x60}, {0xfc, 0xfc, 0xfc}, {0x80, 0xd0, 0x10}, {0x00, 0x00, 0x00}, {0x3c, 0xbc, 0xfc}, {0xf4, 0x78, 0xfc}, {0x00, 0x70, 0xec}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0xe8, 0xd8}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x7c, 0x08, 0x00}, {0x4c, 0xdc, 0x48}, {0xf0, 0xbc, 0x3c}, {0x00, 0x00, 0x00}, {0x00, 0x50, 0x00}, {0x00, 0x00, 0x00}, {0xc4, 0xd4, 0xfc}, {0xfc, 0xd8, 0xa8}, {0x80, 0x00, 0xf0}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x18, 0x3c, 0x5c}, fceu-0.98.12/src/palettes/rp2c05004.h0000644000175000000620000000240010051736266016534 0ustar joestaff00000000000000{0x88, 0x70, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x80, 0x88}, {0xf0, 0xbc, 0x3c}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x24, 0x18, 0x8c}, {0xc8, 0x4c, 0x0c}, {0xbc, 0xbc, 0xbc}, {0x00, 0x00, 0x00}, {0x4c, 0xdc, 0x48}, {0x00, 0x00, 0x00}, {0xfc, 0xbc, 0xb0}, {0xfc, 0xd8, 0xa8}, {0x00, 0xa8, 0x00}, {0x00, 0x00, 0x00}, {0xfc, 0x74, 0xb4}, {0x00, 0x00, 0x00}, {0x20, 0x38, 0xec}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0xfc, 0x74, 0x60}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x5c, 0x94, 0xfc}, {0x00, 0x94, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0xa8, 0xf0, 0xbc}, {0x3c, 0xbc, 0xfc}, {0xa8, 0x00, 0x10}, {0x00, 0x50, 0x00}, {0x7c, 0x08, 0x00}, {0x00, 0x00, 0xa8}, {0x80, 0x00, 0xf0}, {0x00, 0x00, 0x00}, {0x74, 0x74, 0x74}, {0xe4, 0x00, 0x58}, {0x18, 0x3c, 0x5c}, {0x00, 0x00, 0x00}, {0x00, 0x70, 0xec}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0xfc, 0xe4, 0xa0}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x40, 0x2c, 0x00}, {0xd8, 0x28, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0xfc, 0xfc, 0xfc}, {0x9c, 0xfc, 0xf0}, {0x00, 0x00, 0x00}, {0xfc, 0x98, 0x38}, {0x00, 0x00, 0x00}, {0xa8, 0xe4, 0xfc}, {0x80, 0xd0, 0x10}, {0x00, 0x00, 0x00}, {0xfc, 0xfc, 0xfc}, {0x00, 0x44, 0x00}, fceu-0.98.12/src/ppu.c0000644000175000000620000010030710110502113014232 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 1998 BERO * Copyright (C) 2003 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 #include "types.h" #include "x6502.h" #include "fceu.h" #include "ppu.h" #include "nsf.h" #include "sound.h" #include "general.h" #include "endian.h" #include "memory.h" #include "cart.h" #include "palette.h" #include "state.h" #include "video.h" #include "input.h" #define VBlankON (PPU[0]&0x80) /* Generate VBlank NMI */ #define Sprite16 (PPU[0]&0x20) /* Sprites 8x16/8x8 */ #define BGAdrHI (PPU[0]&0x10) /* BG pattern adr $0000/$1000 */ #define SpAdrHI (PPU[0]&0x08) /* Sprite pattern adr $0000/$1000 */ #define INC32 (PPU[0]&0x04) /* auto increment 1/32 */ #define SpriteON (PPU[1]&0x10) /* Show Sprite */ #define ScreenON (PPU[1]&0x08) /* Show screen */ #define PPU_status (PPU[2]) #define Pal (PALRAM) static void FetchSpriteData(void); static void FASTAPASS(1) RefreshLine(int lastpixel); static void RefreshSprites(void); static void CopySprites(uint8 *target); static void Fixit1(void); static uint32 ppulut1[256]; static uint32 ppulut2[256]; static uint32 ppulut3[128]; static void makeppulut(void) { int x; int y; for(x=0;x<256;x++) { ppulut1[x]=0; for(y=0;y<8;y++) ppulut1[x]|=((x>>(7-y))&1)<<(y*4); ppulut2[x]=ppulut1[x]<<1; } { int cc,xo,pixel; for(cc=0;cc<16;cc++) { for(xo=0;xo<8;xo++) { ppulut3[xo|(cc<<3)]=0; for(pixel=0;pixel<8;pixel++) { int shiftr; shiftr=(pixel+xo)/8; shiftr*=2; ppulut3[xo|(cc<<3)]|=(( cc>>shiftr )&3)<<(2+pixel*4); } // printf("%08x\n",ppulut3[xo|(cc<<3)]); } } } } static int ppudead; static int kook = 0; int fceuindbg=0; int MMC5Hack; uint32 MMC5HackVROMMask; uint8 *MMC5HackExNTARAMPtr; uint8 *MMC5HackVROMPTR; uint8 MMC5HackCHRMode=0; uint8 MMC5HackSPMode; uint8 MMC5HackSPScroll; uint8 MMC5HackSPPage; uint8 VRAMBuffer,PPUGenLatch; uint8 *vnapage[4]; uint8 PPUNTARAM; uint8 PPUCHRRAM; /* Color deemphasis emulation. Joy... */ static uint8 deemp=0; static int deempcnt[8]; void (*GameHBIRQHook)(void), (*GameHBIRQHook2)(void); void FP_FASTAPASS(1) (*PPU_hook)(uint32 A); uint8 vtoggle=0; uint8 XOffset=0; uint32 TempAddr,RefreshAddr; static int maxsprites=8; /* scanline is equal to the current visible scanline we're on. */ int scanline; static uint32 scanlines_per_frame; uint8 PPU[4]; uint8 PPUSPL; uint8 NTARAM[0x800],PALRAM[0x20],SPRAM[0x100],SPRBUF[0x100]; #define MMC5SPRVRAMADR(V) &MMC5SPRVPage[(V)>>10][(V)] #define MMC5BGVRAMADR(V) &MMC5BGVPage[(V)>>10][(V)] #define VRAMADR(V) &VPage[(V)>>10][(V)] static DECLFR(A2002) { uint8 ret; FCEUPPU_LineUpdate(); ret = PPU_status; ret|=PPUGenLatch&0x1F; if(!fceuindbg) { vtoggle=0; PPU_status&=0x7F; PPUGenLatch=ret; } return ret; } static DECLFR(A200x) /* Not correct for $2004 reads. */ { FCEUPPU_LineUpdate(); return PPUGenLatch; } /* static DECLFR(A2004) { uint8 ret; FCEUPPU_LineUpdate(); ret = SPRAM[PPU[3]]; if(PPUSPL>=8) { if(PPU[3]>=8) ret = SPRAM[PPU[3]]; } else { //printf("$%02x:$%02x\n",PPUSPL,V); ret = SPRAM[PPUSPL]; } PPU[3]++; PPUSPL++; PPUGenLatch = ret; printf("%d, %02x\n",scanline,ret); return(ret); } */ static DECLFR(A2007) { uint8 ret; uint32 tmp=RefreshAddr&0x3FFF; FCEUPPU_LineUpdate(); ret=VRAMBuffer; if(!fceuindbg) { if(PPU_hook) PPU_hook(tmp); PPUGenLatch=VRAMBuffer; if(tmp<0x2000) { VRAMBuffer=VPage[tmp>>10][tmp]; } else { VRAMBuffer=vnapage[(tmp>>10)&0x3][tmp&0x3FF]; } } if(!fceuindbg) { if (INC32) RefreshAddr+=32; else RefreshAddr++; if(PPU_hook) PPU_hook(RefreshAddr&0x3fff); } return ret; } static DECLFW(B2000) { //printf("%04x:$%02x, %d\n",A,V&0x38,scanline); FCEUPPU_LineUpdate(); PPUGenLatch=V; if(!(PPU[0]&0x80) && (V&0x80) && (PPU_status&0x80)) { //printf("Trigger NMI, %d, %d\n",timestamp,ppudead); TriggerNMI2(); } PPU[0]=V; TempAddr&=0xF3FF; TempAddr|=(V&3)<<10; } static DECLFW(B2001) { //printf("%04x:$%02x, %d\n",A,V,scanline); FCEUPPU_LineUpdate(); PPUGenLatch=V; PPU[1]=V; if(V&0xE0) deemp=V>>5; } static DECLFW(B2002) { PPUGenLatch=V; } static DECLFW(B2003) { //printf("$%04x:$%02x, %d, %d\n",A,V,timestamp,scanline); PPUGenLatch=V; PPU[3]=V; PPUSPL=V&0x7; } static DECLFW(B2004) { //printf("Wr: %04x:$%02x\n",A,V); PPUGenLatch=V; if(PPUSPL>=8) { if(PPU[3]>=8) SPRAM[PPU[3]]=V; } else { //printf("$%02x:$%02x\n",PPUSPL,V); SPRAM[PPUSPL]=V; } PPU[3]++; PPUSPL++; } static DECLFW(B2005) { uint32 tmp=TempAddr; FCEUPPU_LineUpdate(); PPUGenLatch=V; if (!vtoggle) { tmp&=0xFFE0; tmp|=V>>3; XOffset=V&7; } else { tmp&=0x8C1F; tmp|=((V&~0x7)<<2); tmp|=(V&7)<<12; } TempAddr=tmp; vtoggle^=1; } static DECLFW(B2006) { FCEUPPU_LineUpdate(); PPUGenLatch=V; if(!vtoggle) { TempAddr&=0x00FF; TempAddr|=(V&0x3f)<<8; } else { TempAddr&=0xFF00; TempAddr|=V; RefreshAddr=TempAddr; if(PPU_hook) PPU_hook(RefreshAddr); //printf("%d, %04x\n",scanline,RefreshAddr); } vtoggle^=1; } static DECLFW(B2007) { uint32 tmp=RefreshAddr&0x3FFF; PPUGenLatch=V; if(tmp>=0x3F00) { // hmmm.... if(!(tmp&0xf)) PALRAM[0x00]=PALRAM[0x04]=PALRAM[0x08]=PALRAM[0x0C]=V&0x3F; else if(tmp&3) PALRAM[(tmp&0x1f)]=V&0x3f; } else if(tmp<0x2000) { if(PPUCHRRAM&(1<<(tmp>>10))) VPage[tmp>>10][tmp]=V; } else { if(PPUNTARAM&(1<<((tmp&0xF00)>>10))) vnapage[((tmp&0xF00)>>10)][tmp&0x3FF]=V; } if (INC32) RefreshAddr+=32; else RefreshAddr++; if(PPU_hook) PPU_hook(RefreshAddr&0x3fff); } static DECLFW(B4014) { uint32 t=V<<8; int x; for(x=0;x<256;x++) X6502_DMW(0x2004,X6502_DMR(t+x)); } #define PAL(c) ((c)+cc) #define GETLASTPIXEL (PAL?((timestamp*48-linestartts)/15) : ((timestamp*48-linestartts)>>4) ) static uint8 *Pline,*Plinef; static int firsttile; static int linestartts; static int tofix=0; static void ResetRL(uint8 *target) { if(InputScanlineHook) InputScanlineHook(0,0,0,0); Plinef=target; Pline=target; firsttile=0; linestartts=timestamp*48+X.count; tofix=0; FCEUPPU_LineUpdate(); tofix=1; } static uint8 sprlinebuf[256+8]; void FCEUPPU_LineUpdate(void) { if(Pline && !fceuindbg) { int l=GETLASTPIXEL; RefreshLine(l); } } static int tileview=0; static int rendis = 0; void FCEUI_ToggleTileView(void) { tileview^=1; } void FCEUI_SetRenderDisable(int sprites, int bg) { //printf("%d, %d\n",sprites,bg); if(sprites >= 0) { if(sprites == 2) rendis ^= 1; else rendis = (rendis &~1) | sprites?1:0; } if(bg >= 0) { if(bg == 2) rendis ^= 2; else rendis = (rendis &~2) | bg?2:0; } } /* static void TileView(void) { uint8 *P=XBuf+16*256; int bgh; int y; int X1; for(bgh=0;bgh<2;bgh++) for(y=0;y<16*8;y++) for(P=XBuf+bgh*128+(16+y)*256,X1=16;X1;X1--,P+=8) { uint8 *C; register uint8 cc; uint32 vadr; vadr=((((16-X1)|((y>>3)<<4))<<4)|(y&7))+bgh*0x1000; //C= ROM+vadr+turt*8192; C = VRAMADR(vadr); //if((vadr+turt*8192)>=524288) //printf("%d ",vadr+turt*8192); cc=0; //#include "pputile.h" } } */ static void CheckSpriteHit(int p); static void EndRL(void) { RefreshLine(272); if(tofix) Fixit1(); CheckSpriteHit(272); Pline=0; } static int32 sphitx; static uint8 sphitdata; static void CheckSpriteHit(int p) { int l=p-16; int x; if(sphitx==0x100) return; for(x=sphitx;x<(sphitx+8) && x>(x-sphitx))) && !(Plinef[x]&64)) { PPU_status|=0x40; //printf("Ha: %d, %d, Hita: %d, %d, %d, %d, %d\n",p,p&~7,scanline,GETLASTPIXEL-16,&Plinef[x],Pline,Pline-Plinef); sphitx=0x100; break; } } static int spork=0; /* spork the world. Any sprites on this line? Then this will be set to 1. Needed for zapper emulation and *gasp* sprite emulation. */ // lasttile is really "second to last tile." static void FASTAPASS(1) RefreshLine(int lastpixel) { static uint32 pshift[2]; static uint32 atlatch; uint32 smorkus=RefreshAddr; #define RefreshAddr smorkus uint32 vofs; int X1; register uint8 *P=Pline; int lasttile=lastpixel>>3; int numtiles; static int norecurse=0; /* Yeah, recursion would be bad. PPU_hook() functions can call mirroring/chr bank switching functions, which call FCEUPPU_LineUpdate, which call this function. */ if(norecurse) return; if(lasttile>34) lasttile=34; numtiles=lasttile-firsttile; if(numtiles<=0) return; P=Pline; vofs=0; vofs=((PPU[0]&0x10)<<8) | ((RefreshAddr>>12)&7); if(!ScreenON && !SpriteON) { uint32 tem; tem=Pal[0]|(Pal[0]<<8)|(Pal[0]<<16)|(Pal[0]<<24); tem|=0x40404040; FCEU_dwmemset(Pline,tem,numtiles*8); P+=numtiles*8; Pline=P; firsttile=lasttile; #define TOFIXNUM (272-0x4) if(lastpixel>=TOFIXNUM && tofix) { Fixit1(); tofix=0; } if(InputScanlineHook && (lastpixel-16)>=0) { InputScanlineHook(Plinef,spork?sprlinebuf:0,linestartts,lasttile*8-16); } return; } /* Priority bits, needed for sprite emulation. */ Pal[0]|=64; Pal[4]|=64; Pal[8]|=64; Pal[0xC]|=64; /* This high-level graphics MMC5 emulation code was written for MMC5 carts in "CL" mode. It's probably not totally correct for carts in "SL" mode. */ #define PPUT_MMC5 if(MMC5Hack && geniestage!=1) { if(MMC5HackCHRMode==0 && (MMC5HackSPMode&0x80)) { int tochange=MMC5HackSPMode&0x1F; tochange-=firsttile; for(X1=firsttile;X10 && !(MMC5HackSPMode&0x40))) { #define PPUT_MMC5SP #include "pputile.h" #undef PPUT_MMC5SP } else { #include "pputile.h" } tochange--; } } else if(MMC5HackCHRMode==1 && (MMC5HackSPMode&0x80)) { int tochange=MMC5HackSPMode&0x1F; tochange-=firsttile; #define PPUT_MMC5SP #define PPUT_MMC5CHR1 for(X1=firsttile;X10) FCEU_dwmemset(Plinef+tstart*8,tem,tcount*8); } if(lastpixel>=TOFIXNUM && tofix) { //puts("Fixed"); Fixit1(); tofix=0; } CheckSpriteHit(lasttile*8); //lasttile*8); //lastpixel); if(InputScanlineHook && (lastpixel-16)>=0) { InputScanlineHook(Plinef,spork?sprlinebuf:0,linestartts,lasttile*8-16); } Pline=P; firsttile=lasttile; } static INLINE void Fixit2(void) { if(ScreenON || SpriteON) { uint32 rad=RefreshAddr; rad&=0xFBE0; rad|=TempAddr&0x041f; RefreshAddr=rad; //PPU_hook(RefreshAddr); //PPU_hook(RefreshAddr,-1); } } static void Fixit1(void) { if(ScreenON || SpriteON) { uint32 rad=RefreshAddr; if((rad&0x7000)==0x7000) { rad^=0x7000; if((rad&0x3E0)==0x3A0) { rad^=0x3A0; rad^=0x800; } else { if((rad&0x3E0)==0x3e0) rad^=0x3e0; else rad+=0x20; } } else rad+=0x1000; RefreshAddr=rad; //PPU_hook(RefreshAddr); //,-1); } } void MMC5_hb(int); /* Ugh ugh ugh. */ static void DoLine(void) { int x; uint8 *target=XBuf+(scanline<<8); if(MMC5Hack && (ScreenON || SpriteON)) MMC5_hb(scanline); X6502_Run(256); EndRL(); if(rendis & 2) /* User asked to not display background data. */ { uint32 tem; tem=Pal[0]|(Pal[0]<<8)|(Pal[0]<<16)|(Pal[0]<<24); tem|=0x40404040; FCEU_dwmemset(target,tem,256); } if(SpriteON) CopySprites(target); if(ScreenON || SpriteON) // Yes, very el-cheapo. { if(PPU[1]&0x01) { for(x=63;x>=0;x--) *(uint32 *)&target[x<<2]=(*(uint32*)&target[x<<2])&0x30303030; } } if((PPU[1]>>5)==0x7) { for(x=63;x>=0;x--) *(uint32 *)&target[x<<2]=((*(uint32*)&target[x<<2])&0x3f3f3f3f)|0xc0c0c0c0; } else if(PPU[1]&0xE0) for(x=63;x>=0;x--) *(uint32 *)&target[x<<2]=(*(uint32*)&target[x<<2])|0x40404040; else for(x=63;x>=0;x--) *(uint32 *)&target[x<<2]=((*(uint32*)&target[x<<2])&0x3f3f3f3f)|0x80808080; sphitx=0x100; if(ScreenON || SpriteON) FetchSpriteData(); if(GameHBIRQHook && (ScreenON || SpriteON) && ((PPU[0]&0x38)!=0x18)) { X6502_Run(6); Fixit2(); X6502_Run(4); GameHBIRQHook(); X6502_Run(85-16-10); } else { X6502_Run(6); // Tried 65, caused problems with Slalom(maybe others) Fixit2(); X6502_Run(85-6-16); // A semi-hack for Star Trek: 25th Anniversary if(GameHBIRQHook && (ScreenON || SpriteON) && ((PPU[0]&0x38)!=0x18)) GameHBIRQHook(); } if(SpriteON) RefreshSprites(); if(GameHBIRQHook2 && (ScreenON || SpriteON)) GameHBIRQHook2(); scanline++; if(scanline<240) { ResetRL(XBuf+(scanline<<8)); } X6502_Run(16); } #define V_FLIP 0x80 #define H_FLIP 0x40 #define SP_BACK 0x20 typedef struct { uint8 y,no,atr,x; } SPR; typedef struct { uint8 ca[2],atr,x; } SPRB; void FCEUI_DisableSpriteLimitation(int a) { maxsprites=a?64:8; } static uint8 numsprites,SpriteBlurp; static void FetchSpriteData(void) { uint8 ns,sb; SPR *spr; uint8 H; int n; int vofs; uint8 P0=PPU[0]; spr=(SPR *)SPRAM; H=8; ns=sb=0; vofs=(unsigned int)(P0&0x8&(((P0&0x20)^0x20)>>2))<<9; H+=(P0&0x20)>>2; if(!PPU_hook) for(n=63;n>=0;n--,spr++) { if((unsigned int)(scanline-spr->y)>=H) continue; //printf("%d, %u\n",scanline,(unsigned int)(scanline-spr->y)); if(nsy); if (Sprite16) vadr = ((spr->no&1)<<12) + ((spr->no&0xFE)<<4); else vadr = (spr->no<<4)+vofs; if (spr->atr&V_FLIP) { vadr+=7; vadr-=t; vadr+=(P0&0x20)>>1; vadr-=t&8; } else { vadr+=t; vadr+=t&8; } /* Fix this geniestage hack */ if(MMC5Hack && geniestage!=1) C = MMC5SPRVRAMADR(vadr); else C = VRAMADR(vadr); dst.ca[0]=C[0]; dst.ca[1]=C[8]; dst.x=spr->x; dst.atr=spr->atr; *(uint32 *)&SPRBUF[ns<<2]=*(uint32 *)&dst; } ns++; } else { PPU_status|=0x20; break; } } else for(n=63;n>=0;n--,spr++) { if((unsigned int)(scanline-spr->y)>=H) continue; if(nsy); if (Sprite16) vadr = ((spr->no&1)<<12) + ((spr->no&0xFE)<<4); else vadr = (spr->no<<4)+vofs; if (spr->atr&V_FLIP) { vadr+=7; vadr-=t; vadr+=(P0&0x20)>>1; vadr-=t&8; } else { vadr+=t; vadr+=t&8; } if(MMC5Hack) C = MMC5SPRVRAMADR(vadr); else C = VRAMADR(vadr); dst.ca[0]=C[0]; if(ns<8) { PPU_hook(0x2000); PPU_hook(vadr); } dst.ca[1]=C[8]; dst.x=spr->x; dst.atr=spr->atr; *(uint32 *)&SPRBUF[ns<<2]=*(uint32 *)&dst; } ns++; } else { PPU_status|=0x20; break; } } //if(ns>=7) //printf("%d %d\n",scanline,ns); if(ns>8) PPU_status|=0x20; /* Handle case when >8 sprites per scanline option is enabled. */ else if(PPU_hook) { for(n=0;n<(8-ns);n++) { PPU_hook(0x2000); PPU_hook(vofs); } } numsprites=ns; SpriteBlurp=sb; } static void RefreshSprites(void) { int n; SPRB *spr; spork=0; if(!numsprites) return; FCEU_dwmemset(sprlinebuf,0x80808080,256); numsprites--; spr = (SPRB*)SPRBUF+numsprites; for(n=numsprites;n>=0;n--,spr--) { register uint32 pixdata; register uint8 J,atr; int x=spr->x; uint8 *C; uint8 *VB; pixdata=ppulut1[spr->ca[0]]|ppulut2[spr->ca[1]]; J=spr->ca[0]|spr->ca[1]; atr=spr->atr; if(J) { if(n==0 && SpriteBlurp && !(PPU_status&0x40)) { sphitx=x; sphitdata=J; if(atr&H_FLIP) sphitdata= ((J<<7)&0x80) | ((J<<5)&0x40) | ((J<<3)&0x20) | ((J<<1)&0x10) | ((J>>1)&0x08) | ((J>>3)&0x04) | ((J>>5)&0x02) | ((J>>7)&0x01); } C = sprlinebuf+x; VB = (PALRAM+0x10)+((atr&3)<<2); if(atr&SP_BACK) { if (atr&H_FLIP) { if(J&0x80) C[7]=VB[pixdata&3]|0x40; pixdata>>=4; if(J&0x40) C[6]=VB[pixdata&3]|0x40; pixdata>>=4; if(J&0x20) C[5]=VB[pixdata&3]|0x40; pixdata>>=4; if(J&0x10) C[4]=VB[pixdata&3]|0x40; pixdata>>=4; if(J&0x08) C[3]=VB[pixdata&3]|0x40; pixdata>>=4; if(J&0x04) C[2]=VB[pixdata&3]|0x40; pixdata>>=4; if(J&0x02) C[1]=VB[pixdata&3]|0x40; pixdata>>=4; if(J&0x01) C[0]=VB[pixdata]|0x40; } else { if(J&0x80) C[0]=VB[pixdata&3]|0x40; pixdata>>=4; if(J&0x40) C[1]=VB[pixdata&3]|0x40; pixdata>>=4; if(J&0x20) C[2]=VB[pixdata&3]|0x40; pixdata>>=4; if(J&0x10) C[3]=VB[pixdata&3]|0x40; pixdata>>=4; if(J&0x08) C[4]=VB[pixdata&3]|0x40; pixdata>>=4; if(J&0x04) C[5]=VB[pixdata&3]|0x40; pixdata>>=4; if(J&0x02) C[6]=VB[pixdata&3]|0x40; pixdata>>=4; if(J&0x01) C[7]=VB[pixdata]|0x40; } } else { if (atr&H_FLIP) { if(J&0x80) C[7]=VB[pixdata&3]; pixdata>>=4; if(J&0x40) C[6]=VB[pixdata&3]; pixdata>>=4; if(J&0x20) C[5]=VB[pixdata&3]; pixdata>>=4; if(J&0x10) C[4]=VB[pixdata&3]; pixdata>>=4; if(J&0x08) C[3]=VB[pixdata&3]; pixdata>>=4; if(J&0x04) C[2]=VB[pixdata&3]; pixdata>>=4; if(J&0x02) C[1]=VB[pixdata&3]; pixdata>>=4; if(J&0x01) C[0]=VB[pixdata]; }else{ if(J&0x80) C[0]=VB[pixdata&3]; pixdata>>=4; if(J&0x40) C[1]=VB[pixdata&3]; pixdata>>=4; if(J&0x20) C[2]=VB[pixdata&3]; pixdata>>=4; if(J&0x10) C[3]=VB[pixdata&3]; pixdata>>=4; if(J&0x08) C[4]=VB[pixdata&3]; pixdata>>=4; if(J&0x04) C[5]=VB[pixdata&3]; pixdata>>=4; if(J&0x02) C[6]=VB[pixdata&3]; pixdata>>=4; if(J&0x01) C[7]=VB[pixdata]; } } } } SpriteBlurp=0; spork=1; } static void CopySprites(uint8 *target) { uint8 n=((PPU[1]&4)^4)<<1; uint8 *P=target; if(!spork) return; spork=0; if(rendis & 1) return; /* User asked to not display sprites. */ loopskie: { uint32 t=*(uint32 *)(sprlinebuf+n); if(t!=0x80808080) { #ifdef LSB_FIRST if(!(t&0x80)) { if(!(t&0x40) || (P[n]&64)) // Normal sprite || behind bg sprite P[n]=sprlinebuf[n]; } if(!(t&0x8000)) { if(!(t&0x4000) || (P[n+1]&64)) // Normal sprite || behind bg sprite P[n+1]=(sprlinebuf+1)[n]; } if(!(t&0x800000)) { if(!(t&0x400000) || (P[n+2]&64)) // Normal sprite || behind bg sprite P[n+2]=(sprlinebuf+2)[n]; } if(!(t&0x80000000)) { if(!(t&0x40000000) || (P[n+3]&64)) // Normal sprite || behind bg sprite P[n+3]=(sprlinebuf+3)[n]; } #else /* TODO: Simplify */ if(!(t&0x80000000)) { if(!(t&0x40000000)) // Normal sprite P[n]=sprlinebuf[n]; else if(P[n]&64) // behind bg sprite P[n]=sprlinebuf[n]; } if(!(t&0x800000)) { if(!(t&0x400000)) // Normal sprite P[n+1]=(sprlinebuf+1)[n]; else if(P[n+1]&64) // behind bg sprite P[n+1]=(sprlinebuf+1)[n]; } if(!(t&0x8000)) { if(!(t&0x4000)) // Normal sprite P[n+2]=(sprlinebuf+2)[n]; else if(P[n+2]&64) // behind bg sprite P[n+2]=(sprlinebuf+2)[n]; } if(!(t&0x80)) { if(!(t&0x40)) // Normal sprite P[n+3]=(sprlinebuf+3)[n]; else if(P[n+3]&64) // behind bg sprite P[n+3]=(sprlinebuf+3)[n]; } #endif } } n+=4; if(n) goto loopskie; } void FCEUPPU_SetVideoSystem(int w) { if(w) { scanlines_per_frame=312; FSettings.FirstSLine=FSettings.UsrFirstSLine[1]; FSettings.LastSLine=FSettings.UsrLastSLine[1]; } else { scanlines_per_frame=262; FSettings.FirstSLine=FSettings.UsrFirstSLine[0]; FSettings.LastSLine=FSettings.UsrLastSLine[0]; } } void FCEUPPU_Init(void) { makeppulut(); } void FCEUPPU_Reset(void) { VRAMBuffer=PPU[0]=PPU[1]=PPU_status=PPU[3]=0; PPUSPL=0; PPUGenLatch=0; RefreshAddr=TempAddr=0; vtoggle = 0; ppudead = 2; kook = 0; } void FCEUPPU_Power(void) { int x; memset(NTARAM,0x00,0x800); memset(PALRAM,0x00,0x20); memset(SPRAM,0x00,0x100); FCEUPPU_Reset(); for(x=0x2000;x<0x4000;x+=8) { ARead[x]=A200x; BWrite[x]=B2000; ARead[x+1]=A200x; BWrite[x+1]=B2001; ARead[x+2]=A2002; BWrite[x+2]=B2002; ARead[x+3]=A200x; BWrite[x+3]=B2003; ARead[x+4]=A200x; //A2004; BWrite[x+4]=B2004; ARead[x+5]=A200x; BWrite[x+5]=B2005; ARead[x+6]=A200x; BWrite[x+6]=B2006; ARead[x+7]=A2007; BWrite[x+7]=B2007; } BWrite[0x4014]=B4014; } int FCEUPPU_Loop(int skip) { if(ppudead) /* Needed for Knight Rider, possibly others. */ { memset(XBuf, 0x80, 256*240); X6502_Run(scanlines_per_frame*(256+85)); ppudead--; } else { X6502_Run(256+85); PPU_status |= 0x80; PPU[3]=PPUSPL=0; /* Not sure if this is correct. According to Matt Conte and my own tests, it is. Timing is probably off, though. NOTE: Not having this here breaks a Super Donkey Kong game. */ /* I need to figure out the true nature and length of this delay. */ X6502_Run(12); if(FCEUGameInfo->type==GIT_NSF) DoNSFFrame(); else { if(VBlankON) TriggerNMI(); } X6502_Run((scanlines_per_frame-242)*(256+85)-12); //-12); PPU_status&=0x1f; X6502_Run(256); { int x; if(ScreenON || SpriteON) { if(GameHBIRQHook && ((PPU[0]&0x38)!=0x18)) GameHBIRQHook(); if(PPU_hook) for(x=0;x<42;x++) {PPU_hook(0x2000); PPU_hook(0);} if(GameHBIRQHook2) GameHBIRQHook2(); } X6502_Run(85-16); if(ScreenON || SpriteON) { RefreshAddr=TempAddr; if(PPU_hook) PPU_hook(RefreshAddr&0x3fff); } /* Clean this stuff up later. */ spork=numsprites=0; ResetRL(XBuf); X6502_Run(16-kook); kook ^= 1; } if(FCEUGameInfo->type==GIT_NSF) X6502_Run((256+85)*240); #ifdef FRAMESKIP else if(skip) { int y; y=SPRAM[0]; y++; PPU_status|=0x20; // Fixes "Bee 52". Does it break anything? if(GameHBIRQHook) { X6502_Run(256); for(scanline=0;scanline<240;scanline++) { if(ScreenON || SpriteON) GameHBIRQHook(); if(scanline==y && SpriteON) PPU_status|=0x40; X6502_Run((scanline==239)?85:(256+85)); } } else if(y<240) { X6502_Run((256+85)*y); if(SpriteON) PPU_status|=0x40; // Quick and very dirty hack. X6502_Run((256+85)*(240-y)); } else X6502_Run((256+85)*240); } #endif else { int x,max,maxref; deemp=PPU[1]>>5; for(scanline=0;scanline<240;) //scanline is incremented in DoLine. Evil. :/ { deempcnt[deemp]++; DoLine(); } if(MMC5Hack && (ScreenON || SpriteON)) MMC5_hb(scanline); for(x=1,max=0,maxref=0;x<7;x++) { if(deempcnt[x]>max) { max=deempcnt[x]; maxref=x; } deempcnt[x]=0; } //FCEU_DispMessage("%2x:%2x:%2x:%2x:%2x:%2x:%2x:%2x %d",deempcnt[0],deempcnt[1],deempcnt[2],deempcnt[3],deempcnt[4],deempcnt[5],deempcnt[6],deempcnt[7],maxref); //memset(deempcnt,0,sizeof(deempcnt)); SetNESDeemph(maxref,0); } } /* else... to if(ppudead) */ #ifdef FRAMESKIP if(skip) { FCEU_PutImageDummy(); return(0); } else #endif { //if(tileview) TileView(); FCEU_PutImage(); return(1); } } static uint16 TempAddrT,RefreshAddrT; void FCEUPPU_LoadState(int version) { TempAddr=TempAddrT; RefreshAddr=RefreshAddrT; } SFORMAT FCEUPPU_STATEINFO[]={ { NTARAM, 0x800, "NTAR"}, { PALRAM, 0x20, "PRAM"}, { SPRAM, 0x100, "SPRA"}, { PPU, 0x4, "PPUR"}, { &kook, 1, "KOOK"}, { &ppudead, 1, "DEAD"}, { &PPUSPL, 1, "PSPL"}, { &XOffset, 1, "XOFF"}, { &vtoggle, 1, "VTOG"}, { &RefreshAddrT, 2|FCEUSTATE_RLSB, "RADD"}, { &TempAddrT, 2|FCEUSTATE_RLSB, "TADD"}, { &VRAMBuffer, 1, "VBUF"}, { &PPUGenLatch, 1, "PGEN"}, { 0 } }; void FCEUPPU_SaveState(void) { TempAddrT=TempAddr; RefreshAddrT=RefreshAddr; } fceu-0.98.12/src/ppu.h0000644000175000000620000000076310110501702014247 0ustar joestaff00000000000000void FCEUPPU_Init(void); void FCEUPPU_Reset(void); void FCEUPPU_Power(void); int FCEUPPU_Loop(int skip); void FCEUPPU_LineUpdate(); void FCEUPPU_SetVideoSystem(int w); extern void FP_FASTAPASS(1) (*PPU_hook)(uint32 A); extern void (*GameHBIRQHook)(void), (*GameHBIRQHook2)(void); /* For cart.c and banksw.h, mostly */ extern uint8 NTARAM[0x800],*vnapage[4]; extern uint8 PPUNTARAM; extern uint8 PPUCHRRAM; void FCEUPPU_SaveState(void); void FCEUPPU_LoadState(int version); extern int scanline; fceu-0.98.12/src/pputile.h0000644000175000000620000000455210003562765015146 0ustar joestaff00000000000000 uint8 *C; register uint8 cc; uint32 vadr; #ifndef PPUT_MMC5SP register uint8 zz; #else uint8 xs,ys; xs=X1; ys=((scanline>>3)+MMC5HackSPScroll)&0x1F; if(ys>=0x1E) ys-=0x1E; #endif if(X1>=2) { uint8 *S=PALRAM; uint32 pixdata; pixdata=ppulut1[(pshift[0]>>(8-XOffset))&0xFF]|ppulut2[(pshift[1]>>(8-XOffset))&0xFF]; pixdata|=ppulut3[XOffset|(atlatch<<3)]; //printf("%02x ",ppulut3[XOffset|(atlatch<<3)]); P[0]=S[pixdata&0xF]; pixdata>>=4; P[1]=S[pixdata&0xF]; pixdata>>=4; P[2]=S[pixdata&0xF]; pixdata>>=4; P[3]=S[pixdata&0xF]; pixdata>>=4; P[4]=S[pixdata&0xF]; pixdata>>=4; P[5]=S[pixdata&0xF]; pixdata>>=4; P[6]=S[pixdata&0xF]; pixdata>>=4; P[7]=S[pixdata&0xF]; P+=8; } #ifdef PPUT_MMC5SP vadr=(MMC5HackExNTARAMPtr[xs|(ys<<5)]<<4)+(vofs&7); #else zz=RefreshAddr&0x1F; C=vnapage[(RefreshAddr>>10)&3]; vadr=(C[RefreshAddr&0x3ff]<<4)+vofs; /* Fetch name table byte. */ #endif #ifdef PPUT_HOOK PPU_hook(0x2000|(RefreshAddr&0xfff)); #endif #ifdef PPUT_MMC5SP cc=MMC5HackExNTARAMPtr[0x3c0+(xs>>2)+((ys&0x1C)<<1)]; cc=((cc >> ((xs&2) + ((ys&0x2)<<1))) &3); #else #ifdef PPUT_MMC5CHR1 cc=(MMC5HackExNTARAMPtr[RefreshAddr & 0x3ff] & 0xC0)>>6; #else cc=C[0x3c0+(zz>>2)+((RefreshAddr&0x380)>>4)]; /* Fetch attribute table byte. */ cc=((cc >> ((zz&2) + ((RefreshAddr&0x40)>>4))) &3); #endif #endif atlatch>>=2; atlatch|=cc<<2; pshift[0]<<=8; pshift[1]<<=8; #ifdef PPUT_MMC5SP C = MMC5HackVROMPTR+vadr; C += ((MMC5HackSPPage & 0x3f & MMC5HackVROMMask) << 12); #else #ifdef PPUT_MMC5CHR1 C = MMC5HackVROMPTR; C += (((MMC5HackExNTARAMPtr[RefreshAddr & 0x3ff]) & 0x3f & MMC5HackVROMMask) << 12) + (vadr & 0xfff); #elif defined(PPUT_MMC5) C=MMC5BGVRAMADR(vadr); #else C = VRAMADR(vadr); #endif #endif #ifdef PPUT_HOOK PPU_hook(vadr); #endif pshift[0]|=C[0]; pshift[1]|=C[8]; if((RefreshAddr&0x1f)==0x1f) RefreshAddr^=0x41F; else RefreshAddr++; #ifdef PPUT_HOOK PPU_hook(0x2000|(RefreshAddr&0xfff)); #endif fceu-0.98.12/src/sound.c0000644000175000000620000005410610106050663014600 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 #include "types.h" #include "x6502.h" #include "fceu.h" #include "sound.h" #include "filter.h" #include "state.h" #include "wave.h" static uint32 wlookup1[32]; static uint32 wlookup2[203]; int32 Wave[2048+512]; int32 WaveHi[40000]; int32 WaveFinal[2048+512]; EXPSOUND GameExpSound={0,0,0}; static uint8 TriCount; static uint8 TriMode; static int32 tristep; static int32 wlcount[4]; /* Wave length counters. */ static uint8 IRQFrameMode; /* $4017 / xx000000 */ static uint8 PSG[0x10]; static uint8 RawDALatch; /* $4011 0xxxxxxx */ uint8 EnabledChannels; /* Byte written to $4015 */ typedef struct { uint8 Speed; uint8 Mode; /* Fixed volume(1), and loop(2) */ uint8 DecCountTo1; uint8 decvolume; int reloaddec; } ENVUNIT; static ENVUNIT EnvUnits[3]; static const int RectDuties[4]={1,2,4,6}; static int32 RectDutyCount[2]; static uint8 sweepon[2]; static int32 curfreq[2]; static uint8 SweepCount[2]; static uint16 nreg; static uint8 fcnt; static int32 fhcnt; static int32 fhinc; uint32 soundtsoffs; /* Variables exclusively for low-quality sound. */ int32 nesincsize; uint32 soundtsinc; uint32 soundtsi; static int32 sqacc[2]; /* LQ variables segment ends. */ static int32 lengthcount[4]; static const uint8 lengthtable[0x20]= { 0x5*2,0x7f*2,0xA*2,0x1*2,0x14*2,0x2*2,0x28*2,0x3*2,0x50*2,0x4*2,0x1E*2,0x5*2,0x7*2,0x6*2,0x0E*2,0x7*2, 0x6*2,0x08*2,0xC*2,0x9*2,0x18*2,0xa*2,0x30*2,0xb*2,0x60*2,0xc*2,0x24*2,0xd*2,0x8*2,0xe*2,0x10*2,0xf*2 }; static const uint32 NoiseFreqTable[0x10]= { 2,4,8,0x10,0x20,0x30,0x40,0x50,0x65,0x7f,0xbe,0xfe,0x17d,0x1fc,0x3f9,0x7f2 }; static const uint32 NTSCDMCTable[0x10]= { 428,380,340,320,286,254,226,214, 190,160,142,128,106, 84 ,72,54 }; static const uint32 PALDMCTable[0x10]= { 397, 353, 315, 297, 265, 235, 209, 198, 176, 148, 131, 118, 98, 78, 66, 50, }; // $4010 - Frequency // $4011 - Actual data outputted // $4012 - Address register: $c000 + V*64 // $4013 - Size register: Size in bytes = (V+1)*64 static int32 DMCacc=1; static int32 DMCPeriod; static uint8 DMCBitCount=0; static uint8 DMCAddressLatch,DMCSizeLatch; /* writes to 4012 and 4013 */ static uint8 DMCFormat; /* Write to $4010 */ static uint32 DMCAddress=0; static int32 DMCSize=0; static uint8 DMCShift=0; static uint8 SIRQStat=0; static char DMCHaveDMA=0; static uint8 DMCDMABuf=0; static char DMCHaveSample=0; static void Dummyfunc(void) {}; static void (*DoNoise)(void)=Dummyfunc; static void (*DoTriangle)(void)=Dummyfunc; static void (*DoPCM)(void)=Dummyfunc; static void (*DoSQ1)(void)=Dummyfunc; static void (*DoSQ2)(void)=Dummyfunc; static uint32 ChannelBC[5]; static void LoadDMCPeriod(uint8 V) { if(PAL) DMCPeriod=PALDMCTable[V]; else DMCPeriod=NTSCDMCTable[V]; } static void PrepDPCM() { DMCAddress=0x4000+(DMCAddressLatch<<6); DMCSize=(DMCSizeLatch<<4)+1; } /* Instantaneous? Maybe the new freq value is being calculated all of the time... */ static int FASTAPASS(2) CheckFreq(uint32 cf, uint8 sr) { uint32 mod; if(!(sr&0x8)) { mod=cf>>(sr&7); if((mod+cf)&0x800) return(0); } return(1); } static void SQReload(int x, uint8 V) { if(EnabledChannels&(1<>3)&0x1f]; } sweepon[x]=PSG[(x<<2)|1]&0x80; curfreq[x]=PSG[(x<<2)|0x2]|((V&7)<<8); SweepCount[x]=((PSG[(x<<2)|0x1]>>4)&7)+1; RectDutyCount[x]=7; EnvUnits[x].reloaddec=1; //reloadfreq[x]=1; } static DECLFW(Write_PSG) { A&=0x1F; switch(A) { case 0x0:DoSQ1(); EnvUnits[0].Mode=(V&0x30)>>4; EnvUnits[0].Speed=(V&0xF); break; case 0x1: sweepon[0]=V&0x80; break; case 0x2: DoSQ1(); curfreq[0]&=0xFF00; curfreq[0]|=V; break; case 0x3: SQReload(0,V); break; case 0x4: DoSQ2(); EnvUnits[1].Mode=(V&0x30)>>4; EnvUnits[1].Speed=(V&0xF); break; case 0x5: sweepon[1]=V&0x80; break; case 0x6:DoSQ2(); curfreq[1]&=0xFF00; curfreq[1]|=V; break; case 0x7: SQReload(1,V); break; case 0xa:DoTriangle(); break; case 0xb: DoTriangle(); if(EnabledChannels&0x4) lengthcount[2]=lengthtable[(V>>3)&0x1f]; TriMode=1; // Load mode break; case 0xC:DoNoise(); EnvUnits[2].Mode=(V&0x30)>>4; EnvUnits[2].Speed=(V&0xF); break; case 0xE:DoNoise(); break; case 0xF: DoNoise(); if(EnabledChannels&0x8) lengthcount[3]=lengthtable[(V>>3)&0x1f]; EnvUnits[2].reloaddec=1; break; case 0x10:DoPCM(); LoadDMCPeriod(V&0xF); if(SIRQStat&0x80) { if(!(V&0x80)) { X6502_IRQEnd(FCEU_IQDPCM); SIRQStat&=~0x80; } else X6502_IRQBegin(FCEU_IQDPCM); } break; } PSG[A]=V; } static DECLFW(Write_DMCRegs) { A&=0xF; switch(A) { case 0x00:DoPCM(); LoadDMCPeriod(V&0xF); if(SIRQStat&0x80) { if(!(V&0x80)) { X6502_IRQEnd(FCEU_IQDPCM); SIRQStat&=~0x80; } else X6502_IRQBegin(FCEU_IQDPCM); } DMCFormat=V; break; case 0x01:DoPCM(); RawDALatch=V&0x7F; break; case 0x02:DMCAddressLatch=V;break; case 0x03:DMCSizeLatch=V;break; } } static DECLFW(StatusWrite) { int x; DoSQ1(); DoSQ2(); DoTriangle(); DoNoise(); DoPCM(); for(x=0;x<4;x++) if(!(V&(1<0) lengthcount[2]--; if(!(PSG[0xC]&0x20)) /* Make sure loop flag is not set. */ if(lengthcount[3]>0) lengthcount[3]--; for(P=0;P<2;P++) { if(!(PSG[P<<2]&0x20)) /* Make sure loop flag is not set. */ if(lengthcount[P]>0) lengthcount[P]--; /* Frequency Sweep Code Here */ /* xxxx 0000 */ /* xxxx = hz. 120/(x+1)*/ if(sweepon[P]) { int32 mod=0; if(SweepCount[P]>0) SweepCount[P]--; if(SweepCount[P]<=0) { SweepCount[P]=((PSG[(P<<2)+0x1]>>4)&7)+1; //+1; if(PSG[(P<<2)+0x1]&0x8) { mod-=(P^1)+((curfreq[P])>>(PSG[(P<<2)+0x1]&7)); if(curfreq[P] && (PSG[(P<<2)+0x1]&7)/* && sweepon[P]&0x80*/) { curfreq[P]+=mod; } } else { mod=curfreq[P]>>(PSG[(P<<2)+0x1]&7); if((mod+curfreq[P])&0x800) { sweepon[P]=0; curfreq[P]=0; } else { if(curfreq[P] && (PSG[(P<<2)+0x1]&7)/* && sweepon[P]&0x80*/) { curfreq[P]+=mod; } } } } } else /* Sweeping is disabled: */ { //curfreq[P]&=0xFF00; //curfreq[P]|=PSG[(P<<2)|0x2]; //|((PSG[(P<<2)|3]&7)<<8); } } } /* Now do envelope decay + linear counter. */ if(TriMode) // In load mode? TriCount=PSG[0x8]&0x7F; else if(TriCount) TriCount--; if(!(PSG[0x8]&0x80)) TriMode=0; for(P=0;P<3;P++) { if(EnvUnits[P].reloaddec) { EnvUnits[P].decvolume=0xF; EnvUnits[P].DecCountTo1=EnvUnits[P].Speed+1; EnvUnits[P].reloaddec=0; continue; } if(EnvUnits[P].DecCountTo1>0) EnvUnits[P].DecCountTo1--; if(EnvUnits[P].DecCountTo1==0) { EnvUnits[P].DecCountTo1=EnvUnits[P].Speed+1; if(EnvUnits[P].decvolume || (EnvUnits[P].Mode&0x2)) { EnvUnits[P].decvolume--; EnvUnits[P].decvolume&=0xF; } } } } void FrameSoundUpdate(void) { // Linear counter: Bit 0-6 of $4008 // Length counter: Bit 4-7 of $4003, $4007, $400b, $400f if(!fcnt && !(IRQFrameMode&0x3)) { SIRQStat|=0x40; X6502_IRQBegin(FCEU_IQFCOUNT); } if(fcnt==3) { if(IRQFrameMode&0x2) fhcnt+=fhinc; } FrameSoundStuff(fcnt); fcnt=(fcnt+1)&3; } static INLINE void tester(void) { if(DMCBitCount==0) { if(!DMCHaveDMA) DMCHaveSample=0; else { DMCHaveSample=1; DMCShift=DMCDMABuf; DMCHaveDMA=0; } } } static INLINE void DMCDMA(void) { if(DMCSize && !DMCHaveDMA) { X6502_DMR(0x8000+DMCAddress); X6502_DMR(0x8000+DMCAddress); X6502_DMR(0x8000+DMCAddress); DMCDMABuf=X6502_DMR(0x8000+DMCAddress); DMCHaveDMA=1; DMCAddress=(DMCAddress+1)&0x7fff; DMCSize--; if(!DMCSize) { if(DMCFormat&0x40) PrepDPCM(); else { SIRQStat|=0x80; if(DMCFormat&0x80) X6502_IRQBegin(FCEU_IQDPCM); } } } } void FASTAPASS(1) FCEU_SoundCPUHook(int cycles) { fhcnt-=cycles*48; if(fhcnt<=0) { FrameSoundUpdate(); fhcnt+=fhinc; } DMCDMA(); DMCacc-=cycles; while(DMCacc<=0) { if(DMCHaveSample) { uint8 bah=RawDALatch; int t=((DMCShift&1)<<2)-2; /* Unbelievably ugly hack */ if(FSettings.SndRate) { soundtsoffs+=DMCacc; DoPCM(); soundtsoffs-=DMCacc; } RawDALatch+=t; if(RawDALatch&0x80) RawDALatch=bah; } DMCacc+=DMCPeriod; DMCBitCount=(DMCBitCount+1)&7; DMCShift>>=1; tester(); } } void RDoPCM(void) { int32 V; for(V=ChannelBC[4];V0x7ff) goto endit; if(!CheckFreq(curfreq[x],PSG[(x<<2)|0x1])) goto endit; if(!lengthcount[x]) goto endit; if(EnvUnits[x].Mode&0x1) amp=EnvUnits[x].Speed; else amp=EnvUnits[x].decvolume; // printf("%d\n",amp); amp<<=24; rthresh=RectDuties[(PSG[(x<<2)]&0xC0)>>6]; D=&WaveHi[ChannelBC[x]]; V=SOUNDTS-ChannelBC[x]; currdc=RectDutyCount[x]; cf=(curfreq[x]+1)*2; rc=wlcount[x]; while(V>0) { if(currdc0x7ff) inie[x]=0; if(!CheckFreq(curfreq[x],PSG[(x<<2)|0x1])) inie[x]=0; if(!lengthcount[x]) inie[x]=0; if(EnvUnits[x].Mode&0x1) amp[x]=EnvUnits[x].Speed; else amp[x]=EnvUnits[x].decvolume; if(!inie[x]) amp[x]=0; /* Correct? Buzzing in MM2, others otherwise... */ rthresh[x]=RectDuties[(PSG[x*4]&0xC0)>>6]; freq[x]=(curfreq[x]+1)<<1; freq[x]<<=17; } for(V=start;V>4]+=tmpamp; sqacc[0]-=inie[0]; sqacc[1]-=inie[1]; if(sqacc[0]<=0) { rea: sqacc[0]+=freq[0]; RectDutyCount[0]=(RectDutyCount[0]+1)&7; if(sqacc[0]<=0) goto rea; } if(sqacc[1]<=0) { rea2: sqacc[1]+=freq[1]; RectDutyCount[1]=(RectDutyCount[1]+1)&7; if(sqacc[1]<=0) goto rea2; } } } static void RDoTriangle(void) { int32 V; int32 tcout; tcout=(tristep&0xF); if(!(tristep&0x10)) tcout^=0xF; tcout=(tcout*3) << 16; //(tcout<<1); if(!lengthcount[2] || !TriCount) { /* Counter is halted, but we still need to output. */ int32 *start = &WaveHi[ChannelBC[2]]; int32 count = SOUNDTS - ChannelBC[2]; while(count--) { *start += tcout; start++; } //for(V=ChannelBC[2];V>0xe)&1]; if(PSG[0xE]&0x80) nshift=8; else nshift=13; for(V=start;V>4]+=wlookup2[tcout+noiseout+RawDALatch]; triacc-=inie[0]; noiseacc-=inie[1]; if(triacc<=0) { rea: triacc+=freq[0]; //t; tristep=(tristep+1)&0x1F; if(triacc<=0) goto rea; tcout=(tristep&0xF); if(!(tristep&0x10)) tcout^=0xF; tcout=tcout*3; } if(noiseacc<=0) { rea2: noiseacc+=NoiseFreqTable[PSG[0xE]&0xF]<<(16+2); nreg=(nreg<<1)+(((nreg>>nshift)^(nreg>>14))&1); nreg&=0x7fff; noiseout=amptab[(nreg>>0xe)]; if(noiseacc<=0) goto rea2; } /* noiseacc<=0 */ } /* for(V=... */ } static void RDoNoise(void) { int32 V; int32 outo; uint32 amptab[2]; if(EnvUnits[2].Mode&0x1) amptab[0]=EnvUnits[2].Speed; else amptab[0]=EnvUnits[2].decvolume; amptab[0]<<=16; amptab[1]=0; amptab[0]<<=1; outo=amptab[nreg&1]; //(nreg>>0xe)&1]; if(!lengthcount[3]) { outo=amptab[0]=0; } if(PSG[0xE]&0x80) // "short" noise for(V=ChannelBC[3];V>8)&1)^((nreg>>14)&1); nreg=(nreg<<1)+feedback; nreg&=0x7fff; outo=amptab[(nreg>>0xe)&1]; } } else for(V=ChannelBC[3];V>13)&1)^((nreg>>14)&1); nreg=(nreg<<1)+feedback; nreg&=0x7fff; outo=amptab[(nreg>>0xe)&1]; } } ChannelBC[3]=SOUNDTS; } static DECLFW(Write_IRQFM) { V=(V&0xC0)>>6; fcnt=0; if(V&0x2) FrameSoundUpdate(); fcnt=1; fhcnt=fhinc; X6502_IRQEnd(FCEU_IQFCOUNT); SIRQStat&=~0x40; IRQFrameMode=V; } void SetNESSoundMap(void) { SetWriteHandler(0x4000,0x400F,Write_PSG); SetWriteHandler(0x4010,0x4013,Write_DMCRegs); SetWriteHandler(0x4017,0x4017,Write_IRQFM); SetWriteHandler(0x4015,0x4015,StatusWrite); SetReadHandler(0x4015,0x4015,StatusRead); } static int32 inbuf=0; int FlushEmulateSound(void) { int x; int32 end,left; if(!timestamp) return(0); if(!FSettings.SndRate) { left=0; end=0; goto nosoundo; } DoSQ1(); DoSQ2(); DoTriangle(); DoNoise(); DoPCM(); if(FSettings.soundq>=1) { int32 *tmpo=&WaveHi[soundtsoffs]; if(GameExpSound.HiFill) GameExpSound.HiFill(); for(x=timestamp;x;x--) { uint32 b=*tmpo; *tmpo=(b&65535)+wlookup2[(b>>16)&255]+wlookup1[b>>24]; tmpo++; } end=NeoFilterSound(WaveHi,WaveFinal,SOUNDTS,&left); memmove(WaveHi,WaveHi+SOUNDTS-left,left*sizeof(uint32)); memset(WaveHi+left,0,sizeof(WaveHi)-left*sizeof(uint32)); if(GameExpSound.HiSync) GameExpSound.HiSync(left); for(x=0;x<5;x++) ChannelBC[x]=left; } else { end=(SOUNDTS<<16)/soundtsinc; if(GameExpSound.Fill) GameExpSound.Fill(end&0xF); SexyFilter(Wave,WaveFinal,end>>4); //if(FSettings.lowpass) // SexyFilter2(WaveFinal,end>>4); if(end&0xF) Wave[0]=Wave[(end>>4)]; Wave[end>>4]=0; } nosoundo: if(FSettings.soundq>=1) { soundtsoffs=left; } else { for(x=0;x<5;x++) ChannelBC[x]=end&0xF; soundtsoffs = (soundtsinc*(end&0xF))>>16; end>>=4; } inbuf=end; FCEU_WriteWaveData(WaveFinal, end); /* This function will just return if sound recording is off. */ return(end); } int GetSoundBuffer(int32 **W) { *W=WaveFinal; return(inbuf); } /* FIXME: Find out what sound registers get reset on reset. I know $4001/$4005 don't, due to that whole MegaMan 2 Game Genie thing. */ void FCEUSND_Reset(void) { int x; IRQFrameMode=0x0; fhcnt=fhinc; fcnt=0; nreg=1; for(x=0;x<2;x++) { wlcount[x]=2048; if(nesincsize) // lq mode sqacc[x]=((uint32)2048<<17)/nesincsize; else sqacc[x]=1; sweepon[x]=0; curfreq[x]=0; } wlcount[2]=1; //2048; wlcount[3]=2048; DMCHaveDMA=DMCHaveSample=0; SIRQStat=0x00; RawDALatch=0x00; TriCount=0; TriMode=0; tristep=0; EnabledChannels=0; for(x=0;x<4;x++) lengthcount[x]=0; DMCAddressLatch=0; DMCSizeLatch=0; DMCFormat=0; DMCAddress=0; DMCSize=0; DMCShift=0; } void FCEUSND_Power(void) { int x; SetNESSoundMap(); memset(PSG,0x00,sizeof(PSG)); FCEUSND_Reset(); memset(Wave,0,sizeof(Wave)); memset(WaveHi,0,sizeof(WaveHi)); memset(&EnvUnits,0,sizeof(EnvUnits)); for(x=0;x<5;x++) ChannelBC[x]=0; soundtsoffs=0; LoadDMCPeriod(DMCFormat&0xF); } void SetSoundVariables(void) { int x; fhinc=PAL?16626:14915; // *2 CPU clock rate fhinc*=24; if(FSettings.SndRate) { wlookup1[0]=0; for(x=1;x<32;x++) { wlookup1[x]=(double)16*16*16*4*95.52/((double)8128/(double)x+100); if(!FSettings.soundq) wlookup1[x]>>=4; } wlookup2[0]=0; for(x=1;x<203;x++) { wlookup2[x]=(double)16*16*16*4*163.67/((double)24329/(double)x+100); if(!FSettings.soundq) wlookup2[x]>>=4; } if(FSettings.soundq>=1) { DoNoise=RDoNoise; DoTriangle=RDoTriangle; DoPCM=RDoPCM; DoSQ1=RDoSQ1; DoSQ2=RDoSQ2; } else { DoNoise=DoTriangle=DoPCM=DoSQ1=DoSQ2=Dummyfunc; DoSQ1=RDoSQLQ; DoSQ2=RDoSQLQ; DoTriangle=RDoTriangleNoisePCMLQ; DoNoise=RDoTriangleNoisePCMLQ; DoPCM=RDoTriangleNoisePCMLQ; } } else { DoNoise=DoTriangle=DoPCM=DoSQ1=DoSQ2=Dummyfunc; return; } MakeFilters(FSettings.SndRate); if(GameExpSound.RChange) GameExpSound.RChange(); nesincsize=(int64)(((int64)1<<17)*(double)(PAL?PAL_CPU:NTSC_CPU)/(FSettings.SndRate * 16)); memset(sqacc,0,sizeof(sqacc)); memset(ChannelBC,0,sizeof(ChannelBC)); LoadDMCPeriod(DMCFormat&0xF); // For changing from PAL to NTSC soundtsinc=(uint32)((uint64)(PAL?(long double)PAL_CPU*65536:(long double)NTSC_CPU*65536)/(FSettings.SndRate * 16)); } void FCEUI_Sound(int Rate) { FSettings.SndRate=Rate; SetSoundVariables(); } void FCEUI_SetLowPass(int q) { FSettings.lowpass=q; } void FCEUI_SetSoundQuality(int quality) { FSettings.soundq=quality; SetSoundVariables(); } void FCEUI_SetSoundVolume(uint32 volume) { FSettings.SoundVolume=volume; } SFORMAT FCEUSND_STATEINFO[]={ { &fhcnt, 4|FCEUSTATE_RLSB,"FHCN"}, { &fcnt, 1, "FCNT"}, { PSG, 0x10, "PSG"}, { &EnabledChannels, 1, "ENCH"}, { &IRQFrameMode, 1, "IQFM"}, { &nreg, 2|FCEUSTATE_RLSB, "NREG"}, { &TriMode, 1, "TRIM"}, { &TriCount, 1, "TRIC"}, { &EnvUnits[0].Speed, 1, "E0SP"}, { &EnvUnits[1].Speed, 1, "E1SP"}, { &EnvUnits[2].Speed, 1, "E2SP"}, { &EnvUnits[0].Mode, 1, "E0MO"}, { &EnvUnits[1].Mode, 1, "E1MO"}, { &EnvUnits[2].Mode, 1, "E2MO"}, { &EnvUnits[0].DecCountTo1, 1, "E0D1"}, { &EnvUnits[1].DecCountTo1, 1, "E1D1"}, { &EnvUnits[2].DecCountTo1, 1, "E2D1"}, { &EnvUnits[0].decvolume, 1, "E0DV"}, { &EnvUnits[1].decvolume, 1, "E1DV"}, { &EnvUnits[2].decvolume, 1, "E2DV"}, { &lengthcount[0], 4|FCEUSTATE_RLSB, "LEN0"}, { &lengthcount[1], 4|FCEUSTATE_RLSB, "LEN1"}, { &lengthcount[2], 4|FCEUSTATE_RLSB, "LEN2"}, { &lengthcount[3], 4|FCEUSTATE_RLSB, "LEN3"}, { sweepon, 2, "SWEE"}, { &curfreq[0], 4|FCEUSTATE_RLSB,"CRF1"}, { &curfreq[1], 4|FCEUSTATE_RLSB,"CRF2"}, { SweepCount, 2,"SWCT"}, { &SIRQStat, 1, "SIRQ"}, { &DMCacc, 4|FCEUSTATE_RLSB, "5ACC"}, { &DMCBitCount, 1, "5BIT"}, { &DMCAddress, 4|FCEUSTATE_RLSB, "5ADD"}, { &DMCSize, 4|FCEUSTATE_RLSB, "5SIZ"}, { &DMCShift, 1, "5SHF"}, { &DMCHaveDMA, 1, "5HVDM"}, { &DMCHaveSample, 1, "5HVSP"}, { &DMCSizeLatch, 1, "5SZL"}, { &DMCAddressLatch, 1, "5ADL"}, { &DMCFormat, 1, "5FMT"}, { &RawDALatch, 1, "RWDA"}, { 0 } }; void FCEUSND_SaveState(void) { } void FCEUSND_LoadState(int version) { LoadDMCPeriod(DMCFormat&0xF); RawDALatch&=0x7F; DMCAddress&=0x7FFF; } fceu-0.98.12/src/sound.h0000644000175000000620000000357710027653630014620 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ typedef struct { void (*Fill)(int Count); /* Low quality ext sound. */ /* NeoFill is for sound devices that are emulated in a more high-level manner(VRC7) in HQ mode. Interestingly, this device has slightly better sound quality(updated more often) in lq mode than in high-quality mode. Maybe that should be fixed. :) */ void (*NeoFill)(int32 *Wave, int Count); void (*HiFill)(void); void (*HiSync)(int32 ts); void (*RChange)(void); void (*Kill)(void); } EXPSOUND; extern EXPSOUND GameExpSound; extern int32 nesincsize; void SetSoundVariables(void); int GetSoundBuffer(int32 **W); int FlushEmulateSound(void); extern int32 Wave[2048+512]; extern int32 WaveFinal[2048+512]; extern int32 WaveHi[]; extern uint32 soundtsinc; extern uint32 soundtsoffs; #define SOUNDTS (timestamp + soundtsoffs) void SetNESSoundMap(void); void FrameSoundUpdate(void); void FCEUSND_Power(void); void FCEUSND_Reset(void); void FCEUSND_SaveState(void); void FCEUSND_LoadState(int version); void FASTAPASS(1) FCEU_SoundCPUHook(int); fceu-0.98.12/src/state.c0000644000175000000620000002237510051256537014602 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ /* TODO: Add (better) file io error checking */ /* TODO: Change save state file format. */ #include #include #include #include #include "types.h" #include "x6502.h" #include "fceu.h" #include "sound.h" #include "endian.h" #include "fds.h" #include "general.h" #include "state.h" #include "movie.h" #include "memory.h" #include "ppu.h" #include "netplay.h" #include "video.h" static void (*SPreSave)(void); static void (*SPostSave)(void); static int SaveStateStatus[10]; static int StateShow; static SFORMAT SFMDATA[64]; static int SFEXINDEX; #define RLSB FCEUSTATE_RLSB //0x80000000 extern SFORMAT FCEUPPU_STATEINFO[]; extern SFORMAT FCEUSND_STATEINFO[]; extern SFORMAT FCEUCTRL_STATEINFO[]; SFORMAT SFCPU[]={ { &X.PC, 2|RLSB, "PC\0"}, { &X.A, 1, "A\0\0"}, { &X.P, 1, "P\0\0"}, { &X.X, 1, "X\0\0"}, { &X.Y, 1, "Y\0\0"}, { &X.S, 1, "S\0\0"}, { RAM, 0x800, "RAM"}, { 0 } }; SFORMAT SFCPUC[]={ { &X.jammed, 1, "JAMM"}, { &X.IRQlow, 4|RLSB, "IQLB"}, { &X.tcount, 4|RLSB, "ICoa"}, { &X.count, 4|RLSB, "ICou"}, { ×tampbase, sizeof(timestampbase) | RLSB, "TSBS"}, { 0 } }; static int SubWrite(FILE *st, SFORMAT *sf) { uint32 acc=0; while(sf->v) { if(sf->s==~0) /* Link to another struct. */ { uint32 tmp; if(!(tmp=SubWrite(st,(SFORMAT *)sf->v))) return(0); acc+=tmp; sf++; continue; } acc+=8; /* Description + size */ acc+=sf->s&(~RLSB); if(st) /* Are we writing or calculating the size of this block? */ { fwrite(sf->desc,1,4,st); write32le(sf->s&(~RLSB),st); #ifndef LSB_FIRST if(sf->s&RLSB) FlipByteOrder(sf->v,sf->s&(~RLSB)); #endif fwrite((uint8 *)sf->v,1,sf->s&(~RLSB),st); /* Now restore the original byte order. */ #ifndef LSB_FIRST if(sf->s&RLSB) FlipByteOrder(sf->v,sf->s&(~RLSB)); #endif } sf++; } return(acc); } static int WriteStateChunk(FILE *st, int type, SFORMAT *sf) { int bsize; fputc(type,st); bsize=SubWrite(0,sf); write32le(bsize,st); if(!SubWrite(st,sf)) return(0); return (bsize+5); } static SFORMAT *CheckS(SFORMAT *sf, uint32 tsize, char *desc) { while(sf->v) { if(sf->s==~0) /* Link to another SFORMAT structure. */ { SFORMAT *tmp; if((tmp= CheckS((SFORMAT *)sf->v, tsize, desc) )) return(tmp); sf++; continue; } if(!memcmp(desc,sf->desc,4)) { if(tsize!=(sf->s&(~RLSB))) return(0); return(sf); } sf++; } return(0); } static int ReadStateChunk(FILE *st, SFORMAT *sf, int size) { SFORMAT *tmp; int temp; temp=ftell(st); while(ftell(st)v,1,tmp->s&(~RLSB),st); #ifndef LSB_FIRST if(tmp->s&RLSB) FlipByteOrder(tmp->v,tmp->s&(~RLSB)); #endif } else fseek(st,tsize,SEEK_CUR); } // while(...) return 1; } static int ReadStateChunks(FILE *st, int32 totalsize) { int t; uint32 size; int ret=1; while(totalsize > 0) { t=fgetc(st); if(t==EOF) break; if(!read32le(&size,st)) break; totalsize -= size + 5; switch(t) { case 1:if(!ReadStateChunk(st,SFCPU,size)) ret=0;break; case 2:if(!ReadStateChunk(st,SFCPUC,size)) ret=0; else { X.mooPI=X.P; // Quick and dirty hack. } break; case 3:if(!ReadStateChunk(st,FCEUPPU_STATEINFO,size)) ret=0;break; case 4:if(!ReadStateChunk(st,FCEUCTRL_STATEINFO,size)) ret=0;break; case 5:if(!ReadStateChunk(st,FCEUSND_STATEINFO,size)) ret=0;break; case 0x10:if(!ReadStateChunk(st,SFMDATA,size)) ret=0; break; default: if(fseek(st,size,SEEK_CUR)<0) goto endo;break; } } endo: return ret; } int CurrentState=0; extern int geniestage; int FCEUSS_SaveFP(FILE *st) { static uint32 totalsize; static uint8 header[16]="FCS"; memset(header+4,0,13); header[3]=0xFF; FCEU_en32lsb(header + 8, FCEU_VERSION_NUMERIC); fwrite(header,1,16,st); FCEUPPU_SaveState(); FCEUSND_SaveState(); totalsize=WriteStateChunk(st,1,SFCPU); totalsize+=WriteStateChunk(st,2,SFCPUC); totalsize+=WriteStateChunk(st,3,FCEUPPU_STATEINFO); totalsize+=WriteStateChunk(st,4,FCEUCTRL_STATEINFO); totalsize+=WriteStateChunk(st,5,FCEUSND_STATEINFO); if(SPreSave) SPreSave(); totalsize+=WriteStateChunk(st,0x10,SFMDATA); if(SPreSave) SPostSave(); fseek(st,4,SEEK_SET); write32le(totalsize,st); return(1); } void FCEUSS_Save(char *fname) { FILE *st=NULL; char *fn; if(geniestage==1) { FCEU_DispMessage("Cannot save FCS in GG screen."); return; } if(fname) st=FCEUD_UTF8fopen(fname, "wb"); else { st=FCEUD_UTF8fopen(fn=FCEU_MakeFName(FCEUMKF_STATE,CurrentState,0),"wb"); free(fn); } if(st == NULL) { FCEU_DispMessage("State %d save error.",CurrentState); return; } FCEUSS_SaveFP(st); SaveStateStatus[CurrentState]=1; fclose(st); FCEU_DispMessage("State %d saved.",CurrentState); } int FCEUSS_LoadFP(FILE *st) { int x; uint8 header[16]; int stateversion; fread(&header,1,16,st); if(memcmp(header,"FCS",3)) return(0); if(header[3] == 0xFF) stateversion = FCEU_de32lsb(header + 8); else stateversion=header[3] * 100; x=ReadStateChunks(st,*(uint32*)(header+4)); if(stateversion<9500) X.IRQlow=0; if(GameStateRestore) GameStateRestore(stateversion); if(x) { FCEUPPU_LoadState(stateversion); FCEUSND_LoadState(stateversion); } return(x); } int FCEUSS_Load(char *fname) { FILE *st; char *fn; if(geniestage==1) { FCEU_DispMessage("Cannot load FCS in GG screen."); return(0); } if(fname) st=FCEUD_UTF8fopen(fname, "rb"); else { st=FCEUD_UTF8fopen(fn=FCEU_MakeFName(FCEUMKF_STATE,CurrentState,fname),"rb"); free(fn); } if(st == NULL) { FCEU_DispMessage("State %d load error.",CurrentState); SaveStateStatus[CurrentState]=0; return(0); } if(FCEUSS_LoadFP(st)) { SaveStateStatus[CurrentState]=1; FCEU_DispMessage("State %d loaded.",CurrentState); SaveStateStatus[CurrentState]=1; fclose(st); return(1); } else { SaveStateStatus[CurrentState]=1; FCEU_DispMessage("Error(s) reading state %d!",CurrentState); fclose(st); return(0); } } void FCEUSS_CheckStates(void) { FILE *st=NULL; char *fn; int ssel; for(ssel=0;ssel<10;ssel++) { st=FCEUD_UTF8fopen(fn=FCEU_MakeFName(FCEUMKF_STATE,ssel,0),"rb"); free(fn); if(st) { SaveStateStatus[ssel]=1; fclose(st); } else SaveStateStatus[ssel]=0; } CurrentState=0; StateShow=0; } void ResetExState(void (*PreSave)(void), void (*PostSave)(void)) { int x; for(x=0;x void FCEUSS_Save(char *); int FCEUSS_Load(char *); int FCEUSS_SaveFP(FILE *); int FCEUSS_LoadFP(FILE *); extern int CurrentState; void FCEUSS_CheckStates(void); typedef struct { void *v; uint32 s; char *desc; } SFORMAT; void ResetExState(void (*PreSave)(void),void (*PostSave)(void)); void AddExState(void *v, uint32 s, int type, char *desc); #define FCEUSTATE_RLSB 0x80000000 void FCEU_DrawSaveStates(uint8 *XBuf); fceu-0.98.12/src/types.h0000644000175000000620000000432210003562765014623 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2001 Aaron Oneal * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 __FCEU_TYPES #define __FCEU_TYPES #include typedef int8_t int8; typedef int16_t int16; typedef int32_t int32; typedef uint8_t uint8; typedef uint16_t uint16; typedef uint32_t uint32; //typedef unsigned char uint8; //typedef unsigned short uint16; //typedef unsigned long uint32; #ifdef __GNUC__ typedef unsigned long long uint64; typedef long long int64; #define INLINE inline #define GINLINE inline #elif MSVC typedef __int64 int64; typedef unsigned __int64 uint64; #define INLINE __inline #define GINLINE /* Can't declare a function INLINE and global in MSVC. Bummer. */ #define PSS_STYLE 2 /* Does MSVC compile for anything other than Windows/DOS targets? */ #endif #if PSS_STYLE==2 #define PSS "\\" #define PS '\\' #elif PSS_STYLE==1 #define PSS "/" #define PS '/' #elif PSS_STYLE==3 #define PSS "\\" #define PS '\\' #elif PSS_STYLE==4 #define PSS ":" #define PS ':' #endif #ifdef __GNUC__ #ifdef C80x86 #define FASTAPASS(x) __attribute__((regparm(x))) #define FP_FASTAPASS FASTAPASS #else #define FASTAPASS(x) #define FP_FASTAPASS(x) #endif #elif MSVC #define FP_FASTAPASS(x) #define FASTAPASS(x) __fastcall #else #define FP_FASTAPASS(x) #define FASTAPASS(x) #endif typedef void (FP_FASTAPASS(2) *writefunc)(uint32 A, uint8 V); typedef uint8 (FP_FASTAPASS(1) *readfunc)(uint32 A); #endif fceu-0.98.12/src/unif.c0000644000175000000620000002641510051063607014414 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ /* TODO: Battery backup file saving, mirror force */ /* **INCOMPLETE** */ /* Override stuff: CHR RAM instead of CHR ROM, mirroring. */ #include #include #include #include "types.h" #include "fceu.h" #include "cart.h" #include "unif.h" #include "general.h" #include "state.h" #include "endian.h" #include "file.h" #include "memory.h" #include "input.h" #include "md5.h" typedef struct { char ID[4]; uint32 info; } UNIF_HEADER; typedef struct { char *name; void (*init)(CartInfo *); int flags; } BMAPPING; typedef struct { char *name; int (*init)(FCEUFILE *fp); } BFMAPPING; static CartInfo UNIFCart; static int vramo; static int mirrortodo; static uint8 *boardname; static uint8 *sboardname; uint8 *UNIFchrrama=0; static UNIF_HEADER unhead; static UNIF_HEADER uchead; static uint8 *malloced[32]; static uint32 mallocedsizes[32]; //static uint32 checksums[32]; static int FixRomSize(uint32 size, uint32 minimum) { int x=1; if(size0) if(index<99) namebuf[index++]=t; namebuf[index]=0; FCEU_printf("%s\n",namebuf); if(!FCEUGameInfo->name) { FCEUGameInfo->name=malloc(strlen(namebuf)+1); strcpy(FCEUGameInfo->name,namebuf); } return(1); } static int DINF(FCEUFILE *fp) { char name[100], method[100]; uint8 d, m; uint16 y; int t; if(FCEU_fread(name,1,100,fp)!=100) return(0); if((t=FCEU_fgetc(fp))==EOF) return(0); d=t; if((t=FCEU_fgetc(fp))==EOF) return(0); m=t; if((t=FCEU_fgetc(fp))==EOF) return(0); y=t; if((t=FCEU_fgetc(fp))==EOF) return(0); y|=t<<8; if(FCEU_fread(method,1,100,fp)!=100) return(0); name[99]=method[99]=0; FCEU_printf(" Dumped by: %s\n",name); FCEU_printf(" Dumped with: %s\n",method); { char *months[12]={"January","February","March","April","May","June","July", "August","September","October","November","December"}; FCEU_printf(" Dumped on: %s %d, %d\n",months[(m-1)%12],d,y); } return(1); } static int CTRL(FCEUFILE *fp) { int t; if((t=FCEU_fgetc(fp))==EOF) return(0); /* The information stored in this byte isn't very helpful, but it's better than nothing...maybe. */ if(t&1) FCEUGameInfo->input[0]=FCEUGameInfo->input[1]=SI_GAMEPAD; else FCEUGameInfo->input[0]=FCEUGameInfo->input[1]=SI_NONE; if(t&2) FCEUGameInfo->input[1]=SI_ZAPPER; //else if(t&0x10) FCEUGameInfo->input[1]=SI_POWERPAD; return(1); } static int TVCI(FCEUFILE *fp) { int t; if( (t=FCEU_fgetc(fp)) ==EOF) return(0); if(t<=2) { char *stuffo[3]={"NTSC","PAL","NTSC and PAL"}; if(t==0) FCEUGameInfo->vidsys=GIV_NTSC; else if(t==1) FCEUGameInfo->vidsys=GIV_PAL; FCEU_printf(" TV Standard Compatibility: %s\n",stuffo[t]); } return(1); } static int EnableBattery(FCEUFILE *fp) { FCEU_printf(" Battery-backed.\n"); if(FCEU_fgetc(fp)==EOF) return(0); UNIFCart.battery=1; return(1); } #ifdef moo static int PCK(FCEUFILE *fp) { int z; z=uchead.ID[3]-'0'; if(z<0 || z>15) return(0); } #endif static int LoadPRG(FCEUFILE *fp) { int z,t; z=uchead.ID[3]-'0'; if(z<0 || z>15) return(0); FCEU_printf(" PRG ROM %d size: %d",z,(int) uchead.info); if(malloced[z]) free(malloced[z]); t=FixRomSize(uchead.info,2048); if(!(malloced[z]=(uint8 *)FCEU_malloc(t))) return(0); mallocedsizes[z]=t; memset(malloced[z]+uchead.info,0xFF,t-uchead.info); if(FCEU_fread(malloced[z],1,uchead.info,fp)!=uchead.info) { FCEU_printf("Read Error!\n"); return(0); } else FCEU_printf("\n"); SetupCartPRGMapping(z,malloced[z],t,0); return(1); } static int SetBoardName(FCEUFILE *fp) { if(!(boardname=(uint8 *)FCEU_malloc(uchead.info+1))) return(0); FCEU_fread(boardname,1,uchead.info,fp); boardname[uchead.info]=0; FCEU_printf(" Board name: %s\n",boardname); sboardname=boardname; if(!memcmp(boardname,"NES-",4) || !memcmp(boardname,"UNL-",4) || !memcmp(boardname,"HVC-",4) || !memcmp(boardname,"BTL-",4) || !memcmp(boardname,"BMC-",4)) sboardname+=4; return(1); } static int LoadCHR(FCEUFILE *fp) { int z,t; z=uchead.ID[3]-'0'; if(z<0 || z>15) return(0); FCEU_printf(" CHR ROM %d size: %d",z,(int) uchead.info); if(malloced[16+z]) free(malloced[16+z]); t=FixRomSize(uchead.info,8192); if(!(malloced[16+z]=(uint8 *)FCEU_malloc(t))) return(0); mallocedsizes[16+z]=t; memset(malloced[16+z]+uchead.info,0xFF,t-uchead.info); if(FCEU_fread(malloced[16+z],1,uchead.info,fp)!=uchead.info) { FCEU_printf("Read Error!\n"); return(0); } else FCEU_printf("\n"); SetupCartCHRMapping(z,malloced[16+z],t,0); return(1); } #define BMCFLAG_FORCE4 1 #define BMCFLAG_CHRROK 2 // Ok for generic UNIF code to make available // 8KB of CHR RAM if no CHR ROM is present. static BMAPPING bmap[] = { /* Sachen Carts */ { "TC-U01-1.5M", TCU01_Init,0}, { "Sachen-8259B", S8259B_Init,BMCFLAG_CHRROK}, { "Sachen-8259A", S8259A_Init,BMCFLAG_CHRROK}, { "Sachen-74LS374N", S74LS374N_Init,0}, { "SA-016-1M", SA0161M_Init,0}, { "SA-72007", SA72007_Init,0}, { "SA-72008", SA72008_Init,0}, { "SA-0036", SA0036_Init,0}, { "SA-0037", SA0037_Init,0}, { "H2288", H2288_Init,0}, { "8237", UNL8237_Init,0}, // /* AVE carts. */ // { "MB-91", MB91_Init,0}, // DeathBots // { "NINA-06", NINA06_Init,0}, // F-15 City War // { "NINA-03", NINA03_Init,0}, // Tiles of Fate // { "NINA-001", NINA001_Init,0}, // Impossible Mission 2 { "HKROM", HKROM_Init,0}, { "EWROM", EWROM_Init,0}, { "EKROM", EKROM_Init,0}, { "ELROM", ELROM_Init,0}, { "ETROM", ETROM_Init,0}, { "SAROM", SAROM_Init,0}, { "SBROM", SBROM_Init,0}, { "SCROM", SCROM_Init,0}, { "SEROM", SEROM_Init,0}, { "SGROM", SGROM_Init,0}, { "SKROM", SKROM_Init,0}, { "SLROM", SLROM_Init,0}, { "SL1ROM", SL1ROM_Init,0}, { "SNROM", SNROM_Init,0}, { "SOROM", SOROM_Init,0}, { "TGROM", TGROM_Init,0}, { "TR1ROM", TFROM_Init,BMCFLAG_FORCE4}, { "TEROM", TEROM_Init,0}, { "TFROM", TFROM_Init,0}, { "TLROM", TLROM_Init,0}, { "TKROM", TKROM_Init,0}, { "TSROM", TSROM_Init,0}, { "TLSROM", TLSROM_Init,0}, { "TKSROM", TKSROM_Init,0}, { "TQROM", TQROM_Init,0}, { "TVROM", TLROM_Init,BMCFLAG_FORCE4}, { "CPROM", CPROM_Init,0}, { "CNROM", CNROM_Init,0}, { "GNROM", GNROM_Init,0}, { "NROM", NROM256_Init,0 }, { "RROM", NROM128_Init,0 }, { "RROM-128", NROM128_Init,0 }, { "NROM-128", NROM128_Init,0 }, { "NROM-256", NROM256_Init,0 }, { "MHROM", MHROM_Init,0}, { "UNROM", UNROM_Init,0}, { "MARIO1-MALEE2", MALEE_Init,0}, { "Supervision16in1", Supervision16_Init,0}, { "NovelDiamond9999999in1", Novel_Init,0}, { "Super24in1SC03", Super24_Init,0}, {0,0,0} }; static BFMAPPING bfunc[] = { { "CTRL", CTRL }, { "TVCI", TVCI }, { "BATR", EnableBattery }, { "MIRR", DoMirroring }, { "PRG", LoadPRG }, { "CHR", LoadCHR }, //{ "CCK", CCK }, //{ "PCK", PCK }, { "NAME", NAME }, { "MAPR", SetBoardName }, { "DINF", DINF }, { 0, 0 } }; int LoadUNIFChunks(FCEUFILE *fp) { int x; int t; for(;;) { t=FCEU_fread(&uchead,1,4,fp); if(t<4) { if(t>0) return 0; return 1; } if(!(FCEU_read32le(&uchead.info,fp))) return 0; t=0; x=0; //printf("Funky: %s\n",((uint8 *)&uchead)); while(bfunc[x].name) { if(!memcmp(&uchead,bfunc[x].name,strlen(bfunc[x].name))) { if(!bfunc[x].init(fp)) return 0; t=1; break; } x++; } if(!t) if(FCEU_fseek(fp,uchead.info,SEEK_CUR)) return(0); } } static int InitializeBoard(void) { int x=0; if(!sboardname) return(0); while(bmap[x].name) { if(!strcmp((char *)sboardname,(char *)bmap[x].name)) { if(!malloced[16] && (bmap[x].flags&BMCFLAG_CHRROK)) { if((UNIFchrrama=(uint8 *)FCEU_malloc(8192))) { SetupCartCHRMapping(0,UNIFchrrama,8192,1); AddExState(UNIFchrrama, 8192, 0,"CHRR"); } else return(-1); } if(bmap[x].flags&BMCFLAG_FORCE4) mirrortodo=4; MooMirroring(); bmap[x].init(&UNIFCart); return(1); } x++; } FCEU_PrintError("Board type not supported."); return(0); } static void UNIFGI(int h) { switch(h) { case GI_RESETM2: if(UNIFCart.Reset) UNIFCart.Reset(); break; case GI_POWER: if(UNIFCart.Power) UNIFCart.Power(); if(UNIFchrrama) memset(UNIFchrrama,0,8192); break; case GI_CLOSE: FCEU_SaveGameSave(&UNIFCart); if(UNIFCart.Close) UNIFCart.Close(); FreeUNIF(); break; } } int UNIFLoad(const char *name, FCEUFILE *fp) { FCEU_fseek(fp,0,SEEK_SET); FCEU_fread(&unhead,1,4,fp); if(memcmp(&unhead,"UNIF",4)) return 0; ResetCartMapping(); ResetExState(0,0); ResetUNIF(); if(!FCEU_read32le(&unhead.info,fp)) goto aborto; if(FCEU_fseek(fp,0x20,SEEK_SET)<0) goto aborto; if(!LoadUNIFChunks(fp)) goto aborto; { int x; struct md5_context md5; md5_starts(&md5); for(x=0;x<32;x++) if(malloced[x]) { md5_update(&md5,malloced[x],mallocedsizes[x]); } md5_finish(&md5,UNIFCart.MD5); FCEU_printf(" ROM MD5: 0x"); for(x=0;x<16;x++) FCEU_printf("%02x",UNIFCart.MD5[x]); FCEU_printf("\n"); memcpy(FCEUGameInfo->MD5,UNIFCart.MD5,sizeof(UNIFCart.MD5)); } if(!InitializeBoard()) goto aborto; FCEU_LoadGameSave(&UNIFCart); GameInterface=UNIFGI; return 1; aborto: FreeUNIF(); ResetUNIF(); return 0; } fceu-0.98.12/src/unif.h0000644000175000000620000000505310003562765014422 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 */ void TCU01_Init(CartInfo *info); void S8259B_Init(CartInfo *info); void S8259A_Init(CartInfo *info); void S74LS374N_Init(CartInfo *info); void SA0161M_Init(CartInfo *info); void SA72007_Init(CartInfo *info); void SA72008_Init(CartInfo *info); void SA0036_Init(CartInfo *info); void SA0037_Init(CartInfo *info); void H2288_Init(CartInfo *info); void UNL8237_Init(CartInfo *info); void HKROM_Init(CartInfo *info); void ETROM_Init(CartInfo *info); void EKROM_Init(CartInfo *info); void ELROM_Init(CartInfo *info); void EWROM_Init(CartInfo *info); void SAROM_Init(CartInfo *info); void SBROM_Init(CartInfo *info); void SCROM_Init(CartInfo *info); void SEROM_Init(CartInfo *info); void SGROM_Init(CartInfo *info); void SKROM_Init(CartInfo *info); void SLROM_Init(CartInfo *info); void SL1ROM_Init(CartInfo *info); void SNROM_Init(CartInfo *info); void SOROM_Init(CartInfo *info); void NROM_Init(CartInfo *info); void NROM256_Init(CartInfo *info); void NROM128_Init(CartInfo *info); void MHROM_Init(CartInfo *info); void UNROM_Init(CartInfo *info); void MALEE_Init(CartInfo *info); void Supervision16_Init(CartInfo *info); void Super24_Init(CartInfo *info); void Novel_Init(CartInfo *info); void CNROM_Init(CartInfo *info); void CPROM_Init(CartInfo *info); void GNROM_Init(CartInfo *info); void TEROM_Init(CartInfo *info); void TFROM_Init(CartInfo *info); void TGROM_Init(CartInfo *info); void TKROM_Init(CartInfo *info); void TSROM_Init(CartInfo *info); void TLROM_Init(CartInfo *info); void TLSROM_Init(CartInfo *info); void TKSROM_Init(CartInfo *info); void TQROM_Init(CartInfo *info); void TQROM_Init(CartInfo *info); #define UNIFMemBlock (GameMemBlock+32768) extern uint8 *UNIFchrrama; // Meh. So I can stop CHR RAM // bank switcherooing with certain boards... fceu-0.98.12/src/video.c0000644000175000000620000001422110112240361014541 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 #include #include #include "types.h" #include "video.h" #include "fceu.h" #include "general.h" #include "memory.h" #include "crc32.h" #include "state.h" #include "movie.h" #include "palette.h" #include "nsf.h" #include "input.h" #include "vsuni.h" uint8 *XBuf=NULL; static uint8 *xbsave=NULL; void FCEU_KillVirtualVideo(void) { if(xbsave) { free(xbsave); xbsave=0; } } int FCEU_InitVirtualVideo(void) { if(!XBuf) /* Some driver code may allocate XBuf externally. */ /* 256 bytes per scanline, * 240 scanline maximum, +8 for alignment, */ if(!(XBuf= (uint8*) (FCEU_malloc(256 * 256 + 8)))) return 0; xbsave=XBuf; if(sizeof(uint8*)==4) { uint32 m; m=(uint32)XBuf; m=(4-m)&3; XBuf+=m; } memset(XBuf,128,256*256); //*240); return 1; } static int howlong; static char errmsg[65]; #include "drawing.h" #ifdef FRAMESKIP //#define SHOWFPS void ShowFPS(void); void FCEU_PutImageDummy(void) { #ifdef SHOWFPS ShowFPS(); #endif if(FCEUGameInfo->type!=GIT_NSF) { FCEU_DrawNTSCControlBars(XBuf); FCEU_DrawSaveStates(XBuf); FCEU_DrawMovies(XBuf); } if(howlong) howlong--; /* DrawMessage() */ } #endif static int dosnapsave=0; void FCEUI_SaveSnapshot(void) { dosnapsave=1; } static void ReallySnap(void) { int x=SaveSnapshot(); if(!x) FCEU_DispMessage("Error saving screen snapshot."); else FCEU_DispMessage("Screen snapshot %d saved.",x-1); } void FCEU_PutImage(void) { #ifdef SHOWFPS ShowFPS(); #endif if(FCEUGameInfo->type==GIT_NSF) { DrawNSF(XBuf); /* Save snapshot after NSF screen is drawn. Why would we want to do it before? */ if(dosnapsave) { ReallySnap(); dosnapsave=0; } } else { /* Save snapshot before overlay stuff is written. */ if(dosnapsave) { ReallySnap(); dosnapsave=0; } if(FCEUGameInfo->type==GIT_VSUNI) FCEU_VSUniDraw(XBuf); FCEU_DrawSaveStates(XBuf); FCEU_DrawMovies(XBuf); FCEU_DrawNTSCControlBars(XBuf); } DrawMessage(); FCEU_DrawInput(XBuf); } void FCEU_DispMessage(char *format, ...) { va_list ap; va_start(ap,format); vsprintf(errmsg,format,ap); va_end(ap); howlong=180; } void FCEU_ResetMessages(void) { howlong=0; } static int WritePNGChunk(FILE *fp, uint32 size, char *type, uint8 *data) { uint32 crc; uint8 tempo[4]; tempo[0]=size>>24; tempo[1]=size>>16; tempo[2]=size>>8; tempo[3]=size; if(fwrite(tempo,4,1,fp)!=1) return 0; if(fwrite(type,4,1,fp)!=1) return 0; if(size) if(fwrite(data,1,size,fp)!=size) return 0; crc=CalcCRC32(0,(uint8 *)type,4); if(size) crc=CalcCRC32(crc,data,size); tempo[0]=crc>>24; tempo[1]=crc>>16; tempo[2]=crc>>8; tempo[3]=crc; if(fwrite(tempo,4,1,fp)!=1) return 0; return 1; } int SaveSnapshot(void) { static unsigned int lastu=0; char *fn=0; int totallines=FSettings.LastSLine-FSettings.FirstSLine+1; int x,u,y; FILE *pp=NULL; uint8 *compmem=NULL; uLongf compmemsize=totallines*263+12; if(!(compmem=(uint8 *)FCEU_malloc(compmemsize))) return 0; for(u=lastu;u<99999;u++) { pp=FCEUD_UTF8fopen((fn=FCEU_MakeFName(FCEUMKF_SNAP,u,"png")),"rb"); if(pp==NULL) break; fclose(pp); } lastu=u; if(!(pp=FCEUD_UTF8fopen(fn,"wb"))) { free(fn); return 0; } free(fn); { static uint8 header[8]={137,80,78,71,13,10,26,10}; if(fwrite(header,8,1,pp)!=1) goto PNGerr; } { uint8 chunko[13]; chunko[0]=chunko[1]=chunko[3]=0; chunko[2]=0x1; // Width of 256 chunko[4]=chunko[5]=chunko[6]=0; chunko[7]=totallines; // Height chunko[8]=8; // bit depth chunko[9]=3; // Color type; indexed 8-bit chunko[10]=0; // compression: deflate chunko[11]=0; // Basic adapative filter set(though none are used). chunko[12]=0; // No interlace. if(!WritePNGChunk(pp,13,"IHDR",chunko)) goto PNGerr; } { uint8 pdata[256*3]; for(x=0;x<256;x++) FCEUD_GetPalette(x,pdata+x*3,pdata+x*3+1,pdata+x*3+2); if(!WritePNGChunk(pp,256*3,"PLTE",pdata)) goto PNGerr; } { uint8 *tmp=XBuf+FSettings.FirstSLine*256; uint8 *dest,*mal,*mork; if(!(mal=mork=dest=(uint8 *)malloc((totallines<<8)+totallines))) goto PNGerr; // mork=dest=XBuf; for(y=0;y #include #include "types.h" #include "x6502.h" #include "fceu.h" #include "input.h" #include "netplay.h" #include "vsuni.h" #include "state.h" #define IOPTION_GUN 0x1 #define IOPTION_SWAPDIRAB 0x2 #define IOPTION_PREDIP 0x10 typedef struct { char *name; uint64 md5partial; int mapper; int mirroring; int ppu; int ioption; int predip; } VSUNIENTRY; VSUNIENTRY *curvs; static uint8 DIPS=0; uint8 vsdip=0; void FCEUI_VSUniToggleDIPView(void) { DIPS=!DIPS; } void FCEU_VSUniToggleDIP(int w) { vsdip^=1<> w) & 1) != state) FCEUI_VSUniToggleDIP(w); } uint8 FCEUI_VSUniGetDIPs(void) { return(vsdip); } static uint8 secdata[2][32]= { { 0xff, 0xbf, 0xb7, 0x97, 0x97, 0x17, 0x57, 0x4f, 0x6f, 0x6b, 0xeb, 0xa9, 0xb1, 0x90, 0x94, 0x14, 0x56, 0x4e, 0x6f, 0x6b, 0xeb, 0xa9, 0xb1, 0x90, 0xd4, 0x5c, 0x3e, 0x26, 0x87, 0x83, 0x13, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x6F, 0x00, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }; static uint8 *secptr; static uint8 VSindex; static DECLFR(VSSecRead) { switch(A) { case 0x5e00: VSindex=0;return X.DB; case 0x5e01: return(secptr[(VSindex++)&0x1F]); } return(0x00); } uint8 coinon=0; void FCEU_VSUniCoin(void) { coinon=6; } static int curppu; static int64 curmd5; #define RP2C04_001 1 #define RP2C04_002 2 #define RP2C04_003 3 #define RP2C05_004 4 #define RCP2C03B 5 #define RC2C05_01 6 #define RC2C05_02 7 #define RC2C05_03 8 #define RC2C05_04 9 static readfunc OldReadPPU; static writefunc OldWritePPU[2]; static DECLFR(A2002_Gumshoe) { return( (OldReadPPU(A)&~0x3F) | 0x1C); } static DECLFR(A2002_Topgun) { return( (OldReadPPU(A)&~0x3F) | 0x1B); } static DECLFR(A2002_MBJ) // Mighty Bomb Jack { return( (OldReadPPU(A)&~0x3F) | 0x3D); } static DECLFW(B2000_2001_2C05) { OldWritePPU[(A&1)^1](A ^ 1, V); } static uint8 xevselect = 0; static DECLFR(XevRead) { //printf("%04x\n",A); if(A == 0x54FF) { return(0x5); } else if(A == 0x5678) { return(xevselect?0:1); } else if(A == 0x578F) { return(xevselect?0xd1:0x89); } else if(A == 0x5567) { xevselect ^=1; return(xevselect?0x37:0x3E); } return(X.DB); } void FCEU_VSUniSwap(uint8 *j0, uint8 *j1) { if(curvs->ioption & IOPTION_SWAPDIRAB) { uint16 t=*j0; *j0=(*j0&0xC)|(*j1&0xF3); *j1=(*j1&0xC)|(t&0xF3); } } void FCEU_VSUniPower(void) { coinon = 0; VSindex = 0; if(secptr) SetReadHandler(0x5e00,0x5e01,VSSecRead); if(curppu == RC2C05_04) { OldReadPPU = GetReadHandler(0x2002); SetReadHandler(0x2002, 0x2002, A2002_Topgun); } else if(curppu == RC2C05_03) { OldReadPPU = GetReadHandler(0x2002); SetReadHandler(0x2002, 0x2002, A2002_Gumshoe); } else if(curppu == RC2C05_02) { OldReadPPU = GetReadHandler(0x2002); SetReadHandler(0x2002, 0x2002, A2002_MBJ); } if(curppu == RC2C05_04 || curppu == RC2C05_01 || curppu == RC2C05_03 || curppu == RC2C05_02) { OldWritePPU[0] = GetWriteHandler(0x2000); OldWritePPU[1] = GetWriteHandler(0x2001); SetWriteHandler(0x2000, 0x2001, B2000_2001_2C05); } if(curmd5 == 0x2d396247cf58f9faLL) /* Super Xevious */ { SetReadHandler(0x5400,0x57FF,XevRead); } } /* Games that will probably not be supported ever(or for a long time), since they require dual-system: Balloon Fight VS Mahjong VS Tennis Wrecking Crew */ /* Games/PPU list. Information copied from MAME. ROMs are exchangable, so don't take this list as "this game must use this PPU". RP2C04-001: - Baseball - Freedom Force - Gradius - Hogan's Alley - Mach Rider (Japan, Fighting Course) - Pinball - Platoon - Super Xevious RP2C04-002: - Castlevania - Ladies golf - Mach Rider (Endurance Course) - Raid on Bungeling Bay (Japan) - Slalom - Stroke N' Match Golf - Wrecking Crew RP2C04-003: - Dr mario - Excite Bike - Goonies - Soccer - TKO Boxing RP2c05-004: - Clu Clu Land - Excite Bike (Japan) - Ice Climber - Ice Climber Dual (Japan) - Super Mario Bros. Rcp2c03b: - Battle City - Duck Hunt - Mahjang - Pinball (Japan) - Rbi Baseball - Star Luster - Stroke and Match Golf (Japan) - Super Skykid - Tennis - Tetris RC2C05-01: - Ninja Jajamaru Kun (Japan) RC2C05-02: - Mighty Bomb Jack (Japan) RC2C05-03: - Gumshoe RC2C05-04: - Top Gun */ VSUNIENTRY VSUniGames[] = { {"Baseball", 0x691d4200ea42be45LL, 99, 2,RP2C04_001,0}, {"Battle City", 0x8540949d74c4d0ebLL, 99, 2,RP2C04_001,0}, {"Battle City(Bootleg)",0x8093cbe7137ac031LL, 99, 2,RP2C04_001,0}, {"Clu Clu Land", 0x1b8123218f62b1eeLL, 99, 2,RP2C05_004,IOPTION_SWAPDIRAB}, {"Dr Mario", 0xe1af09c477dc0081LL, 1, 0,RP2C04_003,IOPTION_SWAPDIRAB}, {"Duck Hunt", 0x47735d1e5f1205bbLL, 99, 2,RCP2C03B ,IOPTION_GUN}, {"Excitebike", 0x3dcd1401bcafde77LL, 99, 2,RP2C04_003,0}, {"Excitebike (J)", 0x7ea51c9d007375f0LL, 99, 2,RP2C05_004,0}, {"Freedom Force", 0xed96436bd1b5e688LL, 4, 0,RP2C04_001,IOPTION_GUN}, /* Wrong color in game select screen? */ {"Stroke and Match Golf",0x612325606e82bc66LL, 99, 2,RP2C04_002,IOPTION_SWAPDIRAB|IOPTION_PREDIP,0x01}, {"Goonies", 0x3b0085c4ff29098eLL, 151,1,RP2C04_003,0}, {"Gradius", 0x50687ae63bdad976LL,151, 1,RP2C04_001,IOPTION_SWAPDIRAB}, {"Gumshoe", 0xb8500780bf69ce29LL, 99, 2,RC2C05_03,IOPTION_GUN}, {"Hogan's Alley", 0xd78b7f0bb621fb45LL, 99, 2,RP2C04_001,IOPTION_GUN}, {"Ice Climber", 0xd21e999513435e2aLL, 99, 2,RP2C05_004,IOPTION_SWAPDIRAB}, {"Ladies Golf", 0x781b24be57ef6785LL, 99, 2,RP2C04_002,IOPTION_SWAPDIRAB|IOPTION_PREDIP,0x1}, {"Mach Rider", 0x015672618af06441LL, 99, 2, RP2C04_002,0}, {"Mach Rider (J)", 0xa625afb399811a8aLL, 99, 2, RP2C04_001,0}, {"Mighty Bomb Jack", 0xe6a89f4873fac37bLL, 0, 2, RC2C05_02,0}, {"Ninja Jajamaru Kun", 0xb26a2c31474099c0LL, 99, 2,RC2C05_01 ,IOPTION_SWAPDIRAB}, {"Pinball", 0xc5f49d3de7f2e9b8LL, 99, 2,RP2C04_001,IOPTION_PREDIP,0x01}, {"Pinball (J)", 0x66ab1a3828cc901cLL, 99, 2,RCP2C03B,IOPTION_PREDIP,0x1}, {"Platoon", 0x160f237351c19f1fLL, 68, 1,RP2C04_001,0}, {"RBI Baseball", 0x6a02d345812938afLL, 4, 1,RP2C04_001 ,IOPTION_SWAPDIRAB}, {"Soccer", 0xd4e7a9058780eda3LL, 99, 2,RP2C04_003,IOPTION_SWAPDIRAB}, {"Star Luster", 0x8360e134b316d94cLL, 99, 2,RCP2C03B ,0}, {"Stroke and Match Golf (J)",0x869bb83e02509747LL, 99, 2,RCP2C03B,IOPTION_SWAPDIRAB|IOPTION_PREDIP,0x1}, {"Super Sky Kid", 0x78d04c1dd4ec0101LL, 4, 1,RCP2C03B ,IOPTION_SWAPDIRAB | IOPTION_PREDIP,0x20}, {"Super Xevious", 0x2d396247cf58f9faLL, 206, 0,RP2C04_001,0}, {"Tetris", 0x531a5e8eea4ce157LL, 99, 2,RCP2C03B ,IOPTION_PREDIP,0x20}, {"Top Gun", 0xf1dea36e6a7b531dLL, 2, 0,RC2C05_04 ,0}, {"VS Castlevania", 0x92fd6909c81305b9LL, 2, 1,RP2C04_002,0}, {"VS Slalom", 0x4889b5a50a623215LL, 0, 1,RP2C04_002,0}, {"VS Super Mario Bros",0x39d8cfa788e20b6cLL, 99, 2,RP2C05_004,0}, {"VS TKO Boxing", 0x6e1ee06171d8ce3aLL,4, 1,RP2C04_003,IOPTION_PREDIP,0x00}, {0} }; void FCEU_VSUniCheck(uint64 md5partial, int *MapperNo, uint8 *Mirroring) { VSUNIENTRY *vs = VSUniGames; while(vs->name) { if(md5partial == vs->md5partial) { if(vs->ppu < RCP2C03B) pale = vs->ppu; //puts(vs->name); *MapperNo = vs->mapper; *Mirroring = vs->mirroring; FCEUGameInfo->type = GIT_VSUNI; FCEUGameInfo->cspecial = SIS_VSUNISYSTEM; FCEUGameInfo->inputfc = SIFC_NONE; curppu = vs->ppu; curmd5 = md5partial; secptr = 0; { static int64 tko=0x6e1ee06171d8ce3aULL, rbi=0x6a02d345812938afULL; if(md5partial == tko) secptr=secdata[0]; if(md5partial == rbi) secptr = secdata[1]; } vsdip = 0x0; if(vs->ioption & IOPTION_PREDIP) { vsdip= vs->predip; } if(vs->ioption & IOPTION_GUN) { FCEUGameInfo->input[0] = SI_ZAPPER; FCEUGameInfo->input[1] = SI_NONE; } else { FCEUGameInfo->input[0] = FCEUGameInfo->input[1] = SI_GAMEPAD; } curvs = vs; return; } vs++; } } void FCEU_VSUniDraw(uint8 *XBuf) { uint32 *dest; int y,x; if(!DIPS) return; dest=(uint32 *)(XBuf+256*12+164); for(y=24;y;y--,dest+=(256-72)>>2) { for(x=72>>2;x;x--,dest++) *dest=0; } dest=(uint32 *)(XBuf+256*(12+4)+164+6 ); for(y=16;y;y--,dest+=(256>>2)-16) for(x=8;x;x--) { *dest=0x01010101; dest+=2; } dest=(uint32 *)(XBuf+256*(12+4)+164+6 ); for(x=0;x<8;x++,dest+=2) { uint32 *da=dest+(256>>2); if(!((vsdip>>x)&1)) da+=(256>>2)*10; for(y=4;y;y--,da+=256>>2) *da=0; } } SFORMAT FCEUVSUNI_STATEINFO[]={ { &vsdip, 1, "vsdp"}, { &coinon, 1, "vscn"}, { &VSindex, 1, "vsin"}, { 0} }; fceu-0.98.12/src/vsuni.h0000644000175000000620000000037210052032007014605 0ustar joestaff00000000000000void FCEU_VSUniPower(void); void FCEU_VSUniCheck(uint64 md5partial, int *, uint8 *); void FCEU_VSUniDraw(uint8 *XBuf); void FCEU_VSUniToggleDIP(int); /* For movies and netplay */ void FCEU_VSUniCoin(void); void FCEU_VSUniSwap(uint8 *j0, uint8 *j1); fceu-0.98.12/src/wave.c0000644000175000000620000000415010030421131014370 0ustar joestaff00000000000000#include #include "types.h" #include "fceu.h" #include "driver.h" #include "sound.h" #include "wave.h" static FILE *soundlog=0; static long wsize; /* Checking whether the file exists before wiping it out is left up to the reader..err...I mean, the driver code, if it feels so inclined(I don't feel so). */ void FCEU_WriteWaveData(int32 *Buffer, int Count) { int16 temp[Count]; /* Yay. Is this the first use of this "feature" of C in FCE Ultra? */ int16 *dest; int x; if(!soundlog) return; dest=temp; x=Count; while(x--) { int16 tmp=*Buffer; *(uint8 *)dest=(((uint16)tmp)&255); *(((uint8 *)dest)+1)=(((uint16)tmp)>>8); dest++; Buffer++; } wsize+=fwrite(temp,1,Count*sizeof(int16),soundlog); } int FCEUI_EndWaveRecord(void) { long s; if(!soundlog) return 0; s=ftell(soundlog)-8; fseek(soundlog,4,SEEK_SET); fputc(s&0xFF,soundlog); fputc((s>>8)&0xFF,soundlog); fputc((s>>16)&0xFF,soundlog); fputc((s>>24)&0xFF,soundlog); fseek(soundlog,0x28,SEEK_SET); s=wsize; fputc(s&0xFF,soundlog); fputc((s>>8)&0xFF,soundlog); fputc((s>>16)&0xFF,soundlog); fputc((s>>24)&0xFF,soundlog); fclose(soundlog); soundlog=0; return 1; } int FCEUI_BeginWaveRecord(char *fn) { int r; if(!(soundlog=FCEUD_UTF8fopen(fn,"wb"))) return 0; wsize=0; /* Write the header. */ fputs("RIFF",soundlog); fseek(soundlog,4,SEEK_CUR); // Skip size fputs("WAVEfmt ",soundlog); fputc(0x10,soundlog); fputc(0,soundlog); fputc(0,soundlog); fputc(0,soundlog); fputc(1,soundlog); // PCM fputc(0,soundlog); fputc(1,soundlog); // Monophonic fputc(0,soundlog); r=FSettings.SndRate; fputc(r&0xFF,soundlog); fputc((r>>8)&0xFF,soundlog); fputc((r>>16)&0xFF,soundlog); fputc((r>>24)&0xFF,soundlog); r<<=1; fputc(r&0xFF,soundlog); fputc((r>>8)&0xFF,soundlog); fputc((r>>16)&0xFF,soundlog); fputc((r>>24)&0xFF,soundlog); fputc(2,soundlog); fputc(0,soundlog); fputc(16,soundlog); fputc(0,soundlog); fputs("data",soundlog); fseek(soundlog,4,SEEK_CUR); return(1); } fceu-0.98.12/src/wave.h0000644000175000000620000000006310003562765014417 0ustar joestaff00000000000000void FCEU_WriteWaveData(int32 *Buffer, int Count); fceu-0.98.12/src/x6502.c0000644000175000000620000003602410111544663014237 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "types.h" #include "x6502.h" #include "fceu.h" #include "sound.h" X6502 X; void (*X6502_Run)(int32 cycles); uint32 timestamp; void FP_FASTAPASS(1) (*MapIRQHook)(int a); #define _PC X.PC #define _A X.A #define _X X.X #define _Y X.Y #define _S X.S #define _P X.P #define _PI X.mooPI #define _DB X.DB #define _count X.count #define _tcount X.tcount #define _IRQlow X.IRQlow #define _jammed X.jammed #define ADDCYC(x) \ { \ int __x=x; \ _tcount+=__x; \ _count-=__x*48; \ timestamp+=__x; \ } static INLINE uint8 RdMemNorm(unsigned int A) { return(_DB=ARead[A](A)); } static INLINE void WrMemNorm(unsigned int A, uint8 V) { BWrite[A](A,V); } X6502 XSave; /* This is getting ugly. */ //#define RdMemHook(A) ( X.ReadHook?(_DB=X.ReadHook(&X,A)):(_DB=ARead[A](A)) ) //#define WrMemHook(A,V) { if(X.WriteHook) X.WriteHook(&X,A,V); else BWrite[A](A,V); } static INLINE uint8 RdMemHook(unsigned int A) { if(X.ReadHook) return(_DB = X.ReadHook(&X,A) ); else return(_DB=ARead[A](A)); } static INLINE void WrMemHook(unsigned int A, uint8 V) { if(X.WriteHook) X.WriteHook(&X,A,V); else BWrite[A](A,V); } //#define RdRAMFast(A) (_DB=RAM[(A)]) //#define WrRAMFast(A,V) RAM[(A)]=(V) static INLINE uint8 RdRAMFast(unsigned int A) { return(_DB=RAM[A]); } static INLINE void WrRAMFast(unsigned int A, uint8 V) { RAM[A]=V; } uint8 FASTAPASS(1) X6502_DMR(uint32 A) { ADDCYC(1); return(X.DB=ARead[A](A)); } void FASTAPASS(2) X6502_DMW(uint32 A, uint8 V) { ADDCYC(1); BWrite[A](A,V); } #define PUSH(V) \ { \ uint8 VTMP=V; \ WrRAM(0x100+_S,VTMP); \ _S--; \ } #define POP() RdRAM(0x100+(++_S)) static uint8 ZNTable[256]; /* Some of these operations will only make sense if you know what the flag constants are. */ #define X_ZN(zort) _P&=~(Z_FLAG|N_FLAG);_P|=ZNTable[zort] #define X_ZNT(zort) _P|=ZNTable[zort] #define JR(cond); \ { \ if(cond) \ { \ uint32 tmp; \ int8 disp; \ disp=RdMem(_PC); \ _PC++; \ ADDCYC(1); \ tmp=_PC; \ _PC+=disp; \ if((tmp^_PC)&0x100) \ ADDCYC(1); \ } \ else _PC++; \ } #define LDA _A=x;X_ZN(_A) #define LDX _X=x;X_ZN(_X) #define LDY _Y=x;X_ZN(_Y) /* All of the freaky arithmetic operations. */ #define AND _A&=x;X_ZN(_A) #define BIT _P&=~(Z_FLAG|V_FLAG|N_FLAG);_P|=ZNTable[x&_A]&Z_FLAG;_P|=x&(V_FLAG|N_FLAG) #define EOR _A^=x;X_ZN(_A) #define ORA _A|=x;X_ZN(_A) #define ADC { \ uint32 l=_A+x+(_P&1); \ _P&=~(Z_FLAG|C_FLAG|N_FLAG|V_FLAG); \ _P|=((((_A^x)&0x80)^0x80) & ((_A^l)&0x80))>>1; \ _P|=(l>>8)&C_FLAG; \ _A=l; \ X_ZNT(_A); \ } #define SBC { \ uint32 l=_A-x-((_P&1)^1); \ _P&=~(Z_FLAG|C_FLAG|N_FLAG|V_FLAG); \ _P|=((_A^l)&(_A^x)&0x80)>>1; \ _P|=((l>>8)&C_FLAG)^C_FLAG; \ _A=l; \ X_ZNT(_A); \ } #define CMPL(a1,a2) { \ uint32 t=a1-a2; \ X_ZN(t&0xFF); \ _P&=~C_FLAG; \ _P|=((t>>8)&C_FLAG)^C_FLAG; \ } /* Special undocumented operation. Very similar to CMP. */ #define AXS { \ uint32 t=(_A&_X)-x; \ X_ZN(t&0xFF); \ _P&=~C_FLAG; \ _P|=((t>>8)&C_FLAG)^C_FLAG; \ _X=t; \ } #define CMP CMPL(_A,x) #define CPX CMPL(_X,x) #define CPY CMPL(_Y,x) /* The following operations modify the byte being worked on. */ #define DEC x--;X_ZN(x) #define INC x++;X_ZN(x) #define ASL _P&=~C_FLAG;_P|=x>>7;x<<=1;X_ZN(x) #define LSR _P&=~(C_FLAG|N_FLAG|Z_FLAG);_P|=x&1;x>>=1;X_ZNT(x) /* For undocumented instructions, maybe for other things later... */ #define LSRA _P&=~(C_FLAG|N_FLAG|Z_FLAG);_P|=_A&1;_A>>=1;X_ZNT(_A) #define ROL { \ uint8 l=x>>7; \ x<<=1; \ x|=_P&C_FLAG; \ _P&=~(Z_FLAG|N_FLAG|C_FLAG); \ _P|=l; \ X_ZNT(x); \ } #define ROR { \ uint8 l=x&1; \ x>>=1; \ x|=(_P&C_FLAG)<<7; \ _P&=~(Z_FLAG|N_FLAG|C_FLAG); \ _P|=l; \ X_ZNT(x); \ } /* Icky icky thing for some undocumented instructions. Can easily be broken if names of local variables are changed. */ /* Absolute */ #define GetAB(target) \ { \ target=RdMem(_PC); \ _PC++; \ target|=RdMem(_PC)<<8; \ _PC++; \ } /* Absolute Indexed(for reads) */ #define GetABIRD(target, i) \ { \ unsigned int tmp; \ GetAB(tmp); \ target=tmp; \ target+=i; \ if((target^tmp)&0x100) \ { \ target&=0xFFFF; \ RdMem(target^0x100); \ ADDCYC(1); \ } \ } /* Absolute Indexed(for writes and rmws) */ #define GetABIWR(target, i) \ { \ unsigned int rt; \ GetAB(rt); \ target=rt; \ target+=i; \ target&=0xFFFF; \ RdMem((target&0x00FF)|(rt&0xFF00)); \ } /* Zero Page */ #define GetZP(target) \ { \ target=RdMem(_PC); \ _PC++; \ } /* Zero Page Indexed */ #define GetZPI(target,i) \ { \ target=i+RdMem(_PC); \ _PC++; \ } /* Indexed Indirect */ #define GetIX(target) \ { \ uint8 tmp; \ tmp=RdMem(_PC); \ _PC++; \ tmp+=_X; \ target=RdRAM(tmp); \ tmp++; \ target|=RdRAM(tmp)<<8; \ } /* Indirect Indexed(for reads) */ #define GetIYRD(target) \ { \ unsigned int rt; \ uint8 tmp; \ tmp=RdMem(_PC); \ _PC++; \ rt=RdRAM(tmp); \ tmp++; \ rt|=RdRAM(tmp)<<8; \ target=rt; \ target+=_Y; \ if((target^rt)&0x100) \ { \ target&=0xFFFF; \ RdMem(target^0x100); \ ADDCYC(1); \ } \ } /* Indirect Indexed(for writes and rmws) */ #define GetIYWR(target) \ { \ unsigned int rt; \ uint8 tmp; \ tmp=RdMem(_PC); \ _PC++; \ rt=RdRAM(tmp); \ tmp++; \ rt|=RdRAM(tmp)<<8; \ target=rt; \ target+=_Y; \ target&=0xFFFF; \ RdMem((target&0x00FF)|(rt&0xFF00)); \ } /* Now come the macros to wrap up all of the above stuff addressing mode functions and operation macros. Note that operation macros will always operate(redundant redundant) on the variable "x". */ #define RMW_A(op) {uint8 x=_A; op; _A=x; break; } /* Meh... */ #define RMW_AB(op) {unsigned int A; uint8 x; GetAB(A); x=RdMem(A); WrMem(A,x); op; WrMem(A,x); break; } #define RMW_ABI(reg,op) {unsigned int A; uint8 x; GetABIWR(A,reg); x=RdMem(A); WrMem(A,x); op; WrMem(A,x); break; } #define RMW_ABX(op) RMW_ABI(_X,op) #define RMW_ABY(op) RMW_ABI(_Y,op) #define RMW_IX(op) {unsigned int A; uint8 x; GetIX(A); x=RdMem(A); WrMem(A,x); op; WrMem(A,x); break; } #define RMW_IY(op) {unsigned int A; uint8 x; GetIYWR(A); x=RdMem(A); WrMem(A,x); op; WrMem(A,x); break; } #define RMW_ZP(op) {uint8 A; uint8 x; GetZP(A); x=RdRAM(A); op; WrRAM(A,x); break; } #define RMW_ZPX(op) {uint8 A; uint8 x; GetZPI(A,_X); x=RdRAM(A); op; WrRAM(A,x); break;} #define LD_IM(op) {uint8 x; x=RdMem(_PC); _PC++; op; break;} #define LD_ZP(op) {uint8 A; uint8 x; GetZP(A); x=RdRAM(A); op; break;} #define LD_ZPX(op) {uint8 A; uint8 x; GetZPI(A,_X); x=RdRAM(A); op; break;} #define LD_ZPY(op) {uint8 A; uint8 x; GetZPI(A,_Y); x=RdRAM(A); op; break;} #define LD_AB(op) {unsigned int A; uint8 x; GetAB(A); x=RdMem(A); op; break; } #define LD_ABI(reg,op) {unsigned int A; uint8 x; GetABIRD(A,reg); x=RdMem(A); op; break;} #define LD_ABX(op) LD_ABI(_X,op) #define LD_ABY(op) LD_ABI(_Y,op) #define LD_IX(op) {unsigned int A; uint8 x; GetIX(A); x=RdMem(A); op; break;} #define LD_IY(op) {unsigned int A; uint8 x; GetIYRD(A); x=RdMem(A); op; break;} #define ST_ZP(r) {uint8 A; GetZP(A); WrRAM(A,r); break;} #define ST_ZPX(r) {uint8 A; GetZPI(A,_X); WrRAM(A,r); break;} #define ST_ZPY(r) {uint8 A; GetZPI(A,_Y); WrRAM(A,r); break;} #define ST_AB(r) {unsigned int A; GetAB(A); WrMem(A,r); break;} #define ST_ABI(reg,r) {unsigned int A; GetABIWR(A,reg); WrMem(A,r); break; } #define ST_ABX(r) ST_ABI(_X,r) #define ST_ABY(r) ST_ABI(_Y,r) #define ST_IX(r) {unsigned int A; GetIX(A); WrMem(A,r); break; } #define ST_IY(r) {unsigned int A; GetIYWR(A); WrMem(A,r); break; } static uint8 CycTable[256] = { /*0x00*/ 7,6,2,8,3,3,5,5,3,2,2,2,4,4,6,6, /*0x10*/ 2,5,2,8,4,4,6,6,2,4,2,7,4,4,7,7, /*0x20*/ 6,6,2,8,3,3,5,5,4,2,2,2,4,4,6,6, /*0x30*/ 2,5,2,8,4,4,6,6,2,4,2,7,4,4,7,7, /*0x40*/ 6,6,2,8,3,3,5,5,3,2,2,2,3,4,6,6, /*0x50*/ 2,5,2,8,4,4,6,6,2,4,2,7,4,4,7,7, /*0x60*/ 6,6,2,8,3,3,5,5,4,2,2,2,5,4,6,6, /*0x70*/ 2,5,2,8,4,4,6,6,2,4,2,7,4,4,7,7, /*0x80*/ 2,6,2,6,3,3,3,3,2,2,2,2,4,4,4,4, /*0x90*/ 2,6,2,6,4,4,4,4,2,5,2,5,5,5,5,5, /*0xA0*/ 2,6,2,6,3,3,3,3,2,2,2,2,4,4,4,4, /*0xB0*/ 2,5,2,5,4,4,4,4,2,4,2,4,4,4,4,4, /*0xC0*/ 2,6,2,8,3,3,5,5,2,2,2,2,4,4,6,6, /*0xD0*/ 2,5,2,8,4,4,6,6,2,4,2,7,4,4,7,7, /*0xE0*/ 2,6,3,8,3,3,5,5,2,2,2,2,4,4,6,6, /*0xF0*/ 2,5,2,8,4,4,6,6,2,4,2,7,4,4,7,7, }; void FASTAPASS(1) X6502_IRQBegin(int w) { _IRQlow|=w; } void FASTAPASS(1) X6502_IRQEnd(int w) { _IRQlow&=~w; } void TriggerNMI(void) { _IRQlow|=FCEU_IQNMI; } void TriggerNMI2(void) { _IRQlow|=FCEU_IQNMI2; } /* Called from debugger. */ void FCEUI_NMI(void) { _IRQlow|=FCEU_IQNMI; } void FCEUI_IRQ(void) { _IRQlow|=FCEU_IQTEMP; } void X6502_Reset(void) { _IRQlow=FCEU_IQRESET; } void FCEUI_GetIVectors(uint16 *reset, uint16 *irq, uint16 *nmi) { fceuindbg=1; *reset=RdMemNorm(0xFFFC); *reset|=RdMemNorm(0xFFFD)<<8; *nmi=RdMemNorm(0xFFFA); *nmi|=RdMemNorm(0xFFFB)<<8; *irq=RdMemNorm(0xFFFE); *irq|=RdMemNorm(0xFFFF)<<8; fceuindbg=0; } static int debugmode; void X6502_Init(void) { int x; memset((void *)&X,0,sizeof(X)); for(x=0;x<256;x++) if(!x) ZNTable[x]=Z_FLAG; else if (x&0x80) ZNTable[x]=N_FLAG; else ZNTable[x]=0; X6502_Debug(0,0,0); } void X6502_Power(void) { _count=_tcount=_IRQlow=_PC=_A=_X=_Y=_S=_P=_PI=_DB=_jammed=0; timestamp=0; X6502_Reset(); } static void X6502_RunDebug(int32 cycles) { #define RdRAM RdMemHook #define WrRAM WrMemHook #define RdMem RdMemHook #define WrMem WrMemHook if(PAL) cycles*=15; // 15*4=60 else cycles*=16; // 16*4=64 _count+=cycles; while(_count>0) { int32 temp; uint8 b1; if(_IRQlow) { if(_IRQlow&FCEU_IQRESET) { _PC=RdMem(0xFFFC); _PC|=RdMem(0xFFFD)<<8; _jammed=0; _PI=_P=I_FLAG; _IRQlow&=~FCEU_IQRESET; } else if(_IRQlow&FCEU_IQNMI2) { _IRQlow&=~FCEU_IQNMI2; _IRQlow|=FCEU_IQNMI; } else if(_IRQlow&FCEU_IQNMI) { if(!_jammed) { ADDCYC(7); PUSH(_PC>>8); PUSH(_PC); PUSH((_P&~B_FLAG)|(U_FLAG)); _P|=I_FLAG; _PC=RdMem(0xFFFA); _PC|=RdMem(0xFFFB)<<8; _IRQlow&=~FCEU_IQNMI; } } else { if(!(_PI&I_FLAG) && !_jammed) { ADDCYC(7); PUSH(_PC>>8); PUSH(_PC); PUSH((_P&~B_FLAG)|(U_FLAG)); _P|=I_FLAG; _PC=RdMem(0xFFFE); _PC|=RdMem(0xFFFF)<<8; } } _IRQlow&=~(FCEU_IQTEMP); if(_count<=0) { _PI=_P; return; } /* Should increase accuracy without a */ /* major speed hit. */ } if(X.CPUHook) X.CPUHook(&X); /* Ok, now the real fun starts. */ /* Do the pre-exec voodoo. */ if(X.ReadHook || X.WriteHook) { uint32 tsave=timestamp; XSave=X; fceuindbg=1; X.preexec=1; b1=RdMem(_PC); _PC++; switch(b1) { #include "ops.h" } timestamp=tsave; /* In case an NMI/IRQ/RESET was triggered by the debugger. */ /* Should we also copy over the other hook variables? */ XSave.IRQlow=X.IRQlow; XSave.ReadHook=X.ReadHook; XSave.WriteHook=X.WriteHook; XSave.CPUHook=X.CPUHook; X=XSave; fceuindbg=0; } _PI=_P; b1=RdMem(_PC); ADDCYC(CycTable[b1]); temp=_tcount; _tcount=0; if(MapIRQHook) MapIRQHook(temp); FCEU_SoundCPUHook(temp); _PC++; switch(b1) { #include "ops.h" } } #undef RdRAM #undef WrRAM #undef RdMem #undef WrMem } static void X6502_RunNormal(int32 cycles) { #define RdRAM RdRAMFast #define WrRAM WrRAMFast #define RdMem RdMemNorm #define WrMem WrMemNorm #if(defined(C80x86) && defined(__GNUC__)) /* Gives a nice little speed boost. */ register uint16 pbackus asm ("edi"); #else uint16 pbackus; #endif pbackus=_PC; #undef _PC #define _PC pbackus if(PAL) cycles*=15; // 15*4=60 else cycles*=16; // 16*4=64 _count+=cycles; while(_count>0) { int32 temp; uint8 b1; // XI.PC=pbackus; if(_IRQlow) { if(_IRQlow&FCEU_IQRESET) { _PC=RdMem(0xFFFC); _PC|=RdMem(0xFFFD)<<8; _jammed=0; _PI=_P=I_FLAG; _IRQlow&=~FCEU_IQRESET; } else if(_IRQlow&FCEU_IQNMI2) { _IRQlow&=~FCEU_IQNMI2; _IRQlow|=FCEU_IQNMI; } else if(_IRQlow&FCEU_IQNMI) { if(!_jammed) { ADDCYC(7); PUSH(_PC>>8); PUSH(_PC); PUSH((_P&~B_FLAG)|(U_FLAG)); _P|=I_FLAG; _PC=RdMem(0xFFFA); _PC|=RdMem(0xFFFB)<<8; _IRQlow&=~FCEU_IQNMI; } } else { if(!(_PI&I_FLAG) && !_jammed) { ADDCYC(7); PUSH(_PC>>8); PUSH(_PC); PUSH((_P&~B_FLAG)|(U_FLAG)); _P|=I_FLAG; _PC=RdMem(0xFFFE); _PC|=RdMem(0xFFFF)<<8; } } _IRQlow&=~(FCEU_IQTEMP); if(_count<=0) { _PI=_P; X.PC=pbackus; return; } /* Should increase accuracy without a */ /* major speed hit. */ } _PI=_P; b1=RdMem(_PC); //printf("$%04x, $%02x\n",_PC,b1); ADDCYC(CycTable[b1]); //PPUHack(); temp=_tcount; _tcount=0; if(MapIRQHook) MapIRQHook(temp); FCEU_SoundCPUHook(temp); //printf("%04x\n",X.PC); X.PC=pbackus; _PC++; switch(b1) { #include "ops.h" } } #undef _PC #define _PC X.PC _PC=pbackus; #undef RdRAM #undef WrRAM } void X6502_Debug(void (*CPUHook)(X6502 *), uint8 (*ReadHook)(X6502 *, unsigned int), void (*WriteHook)(X6502 *, unsigned int, uint8)) { debugmode=(ReadHook || WriteHook || CPUHook)?1:0; X.ReadHook=ReadHook; X.WriteHook=WriteHook; X.CPUHook=CPUHook; if(!debugmode) X6502_Run=X6502_RunNormal; else X6502_Run=X6502_RunDebug; } fceu-0.98.12/src/x6502.h0000644000175000000620000000373110047027541014242 0ustar joestaff00000000000000/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 _X6502H #include "x6502struct.h" void X6502_Debug(void (*CPUHook)(X6502 *), uint8 (*ReadHook)(X6502 *, unsigned int), void (*WriteHook)(X6502 *, unsigned int, uint8)); extern uint32 timestamp; extern X6502 X; extern void (*X6502_Run)(int32 cycles); #define N_FLAG 0x80 #define V_FLAG 0x40 #define U_FLAG 0x20 #define B_FLAG 0x10 #define D_FLAG 0x08 #define I_FLAG 0x04 #define Z_FLAG 0x02 #define C_FLAG 0x01 extern void FP_FASTAPASS(1) (*MapIRQHook)(int a); #define NTSC_CPU 1789772.7272727272727272 #define PAL_CPU 1662607.125 #define FCEU_IQEXT 0x001 #define FCEU_IQEXT2 0x002 /* ... */ #define FCEU_IQRESET 0x020 #define FCEU_IQNMI2 0x040 // Delayed NMI, gets converted to *_IQNMI #define FCEU_IQNMI 0x080 #define FCEU_IQDPCM 0x100 #define FCEU_IQFCOUNT 0x200 #define FCEU_IQTEMP 0x800 void X6502_Init(void); void X6502_Reset(void); void X6502_Power(void); void TriggerNMI(void); void TriggerNMI2(void); uint8 FASTAPASS(1) X6502_DMR(uint32 A); void FASTAPASS(2) X6502_DMW(uint32 A, uint8 V); void FASTAPASS(1) X6502_IRQBegin(int w); void FASTAPASS(1) X6502_IRQEnd(int w); #define _X6502H #endif fceu-0.98.12/src/x6502struct.h0000644000175000000620000000166010047027536015512 0ustar joestaff00000000000000#ifndef _X6502STRUCTH typedef struct __X6502 { int32 tcount; /* Temporary cycle counter */ uint16 PC; /* I'll change this to uint32 later... */ /* I'll need to AND PC after increments to 0xFFFF */ /* when I do, though. Perhaps an IPC() macro? */ uint8 A,X,Y,S,P,mooPI; uint8 jammed; int32 count; uint32 IRQlow; /* Simulated IRQ pin held low(or is it high?). And other junk hooked on for speed reasons.*/ uint8 DB; /* Data bus "cache" for reads from certain areas */ int preexec; /* Pre-exec'ing for debug breakpoints. */ void (*CPUHook)(struct __X6502 *); uint8 (*ReadHook)(struct __X6502 *, unsigned int); void (*WriteHook)(struct __X6502 *, unsigned int, uint8); } X6502; #define _X6502STRUCTH #endif fceu-0.98.12/src/unzip.c0000644000175000000620000010353310036574053014622 0ustar joestaff00000000000000/* unzip.c -- IO on .zip files using zlib Version 0.15 beta, Mar 19th, 1998, Read unzip.h for more info */ #include #include #include #include "zlib.h" #include "unzip.h" #ifdef STDC # include # include # include #endif #ifdef NO_ERRNO_H extern int errno; #else # include #endif #include "driver.h" #ifndef local # define local static #endif /* compile with -Dlocal if your debugger can't find static symbols */ #if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) && \ !defined(CASESENSITIVITYDEFAULT_NO) #define CASESENSITIVITYDEFAULT_NO #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) /* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ #ifndef SEEK_CUR #define SEEK_CUR 1 #endif #ifndef SEEK_END #define SEEK_END 2 #endif #ifndef SEEK_SET #define SEEK_SET 0 #endif const char unz_copyright[] = " unzip 0.15 Copyright 1998 Gilles Vollant "; /* unz_file_info_interntal contain internal info about a file in zipfile*/ typedef struct unz_file_info_internal_s { uLong offset_curfile;/* relative offset of local header 4 bytes */ } unz_file_info_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 */ uLong pos_in_zipfile; /* position in byte on the zipfile, for fseek*/ uLong stream_initialised; /* flag set if stream structure is initialised*/ uLong offset_local_extrafield;/* offset of the local extra field */ uInt size_local_extrafield;/* size of the local extra field */ uLong pos_local_extrafield; /* position in the local extra field in read*/ uLong crc32; /* crc32 of all data uncompressed */ uLong crc32_wait; /* crc32 we must obtain after decompress all */ uLong rest_read_compressed; /* number of byte to be decompressed */ uLong rest_read_uncompressed;/*number of byte to be obtained after decomp*/ FILE* file; /* io structore of the zipfile */ uLong compression_method; /* compression method (0==store) */ uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ } file_in_zip_read_info_s; /* unz_s contain internal information about the zipfile */ typedef struct { FILE* file; /* io structore of the zipfile */ unz_global_info gi; /* public global information */ uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ uLong num_file; /* number of the current file in the zipfile*/ uLong pos_in_central_dir; /* pos of the current file in the central dir*/ uLong current_file_ok; /* flag about the usability of the current file*/ uLong central_pos; /* position of the beginning of the central dir*/ uLong size_central_dir; /* size of the central directory */ uLong offset_central_dir; /* offset of start of central directory with respect to the starting disk number */ unz_file_info cur_file_info; /* public info about the current file in zip*/ unz_file_info_internal cur_file_info_internal; /* private info about it*/ file_in_zip_read_info_s* pfile_in_zip_read; /* structure about the current file if we are decompressing it */ } unz_s; /* =========================================================================== 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 unzlocal_getByte(fin,pi) FILE *fin; int *pi; { unsigned char c; int err = fread(&c, 1, 1, fin); if (err==1) { *pi = (int)c; return UNZ_OK; } else { if (ferror(fin)) return UNZ_ERRNO; else return UNZ_EOF; } } /* =========================================================================== Reads a long in LSB order from the given gz_stream. Sets */ local int unzlocal_getShort (fin,pX) FILE* fin; uLong *pX; { uLong x ; int i; int err; err = unzlocal_getByte(fin,&i); x = (uLong)i; if (err==UNZ_OK) err = unzlocal_getByte(fin,&i); x += ((uLong)i)<<8; if (err==UNZ_OK) *pX = x; else *pX = 0; return err; } local int unzlocal_getLong (fin,pX) FILE* fin; uLong *pX; { uLong x ; int i; int err; err = unzlocal_getByte(fin,&i); x = (uLong)i; if (err==UNZ_OK) err = unzlocal_getByte(fin,&i); x += ((uLong)i)<<8; if (err==UNZ_OK) err = unzlocal_getByte(fin,&i); x += ((uLong)i)<<16; if (err==UNZ_OK) err = unzlocal_getByte(fin,&i); x += ((uLong)i)<<24; if (err==UNZ_OK) *pX = x; else *pX = 0; return err; } /* My own strcmpi / strcasecmp */ local int strcmpcasenosensitive_internal (fileName1,fileName2) 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 (fileName1,fileName2,iCaseSensitivity) const char* fileName1; const char* fileName2; int iCaseSensitivity; { if (iCaseSensitivity==0) iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; if (iCaseSensitivity==1) return strcmp(fileName1,fileName2); return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2); } #define BUFREADCOMMENT (0x400) /* Locate the Central directory of a zipfile (at the end, just before the global comment) */ local uLong unzlocal_SearchCentralDir(fin) FILE *fin; { unsigned char* buf; uLong uSizeFile; uLong uBackRead; uLong uMaxBack=0xffff; /* maximum size of global comment */ uLong uPosFound=0; if (fseek(fin,0,SEEK_END) != 0) return 0; uSizeFile = ftell( fin ); 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) : (uSizeFile-uReadPos); if (fseek(fin,uReadPos,SEEK_SET)!=0) break; if (fread(buf,(uInt)uReadSize,1,fin)!=1) 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; } /* Open a Zip file. path contain the full pathname (by example, on a Windows NT computer "c:\\test\\zlib109.zip" or on an Unix computer "zlib/zlib109.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. */ extern unzFile ZEXPORT unzOpen(path) const char *path; { unz_s us; unz_s *s; uLong central_pos,uL; FILE * fin ; 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*/ uLong 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; fin=FCEUD_UTF8fopen(path,"rb"); //fin=fopen(path,"rb"); if (fin==NULL) return NULL; central_pos = unzlocal_SearchCentralDir(fin); if (central_pos==0) err=UNZ_ERRNO; if (fseek(fin,central_pos,SEEK_SET)!=0) err=UNZ_ERRNO; /* the signature, already checked */ if (unzlocal_getLong(fin,&uL)!=UNZ_OK) err=UNZ_ERRNO; /* number of this disk */ if (unzlocal_getShort(fin,&number_disk)!=UNZ_OK) err=UNZ_ERRNO; /* number of the disk with the start of the central directory */ if (unzlocal_getShort(fin,&number_disk_with_CD)!=UNZ_OK) err=UNZ_ERRNO; /* total number of entries in the central dir on this disk */ if (unzlocal_getShort(fin,&us.gi.number_entry)!=UNZ_OK) err=UNZ_ERRNO; /* total number of entries in the central dir */ if (unzlocal_getShort(fin,&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 (unzlocal_getLong(fin,&us.size_central_dir)!=UNZ_OK) err=UNZ_ERRNO; /* offset of start of central directory with respect to the starting disk number */ if (unzlocal_getLong(fin,&us.offset_central_dir)!=UNZ_OK) err=UNZ_ERRNO; /* zipfile comment length */ if (unzlocal_getShort(fin,&us.gi.size_comment)!=UNZ_OK) err=UNZ_ERRNO; if ((central_pospfile_in_zip_read!=NULL) unzCloseCurrentFile(file); fclose(s->file); 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 unzGetGlobalInfo (file,pglobal_info) unzFile file; unz_global_info *pglobal_info; { unz_s* s; if (file==NULL) return UNZ_PARAMERROR; s=(unz_s*)file; *pglobal_info=s->gi; return UNZ_OK; } /* Translate date/time from Dos format to tm_unz (readable more easilty) */ local void unzlocal_DosDateToTmuDate (ulDosDate, ptm) uLong ulDosDate; tm_unz* ptm; { uLong uDate; uDate = (uLong)(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 unzlocal_GetCurrentFileInfoInternal OF((unzFile file, unz_file_info *pfile_info, unz_file_info_internal *pfile_info_internal, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)); local int unzlocal_GetCurrentFileInfoInternal (file, pfile_info, pfile_info_internal, szFileName, fileNameBufferSize, extraField, extraFieldBufferSize, szComment, commentBufferSize) unzFile file; unz_file_info *pfile_info; unz_file_info_internal *pfile_info_internal; char *szFileName; uLong fileNameBufferSize; void *extraField; uLong extraFieldBufferSize; char *szComment; uLong commentBufferSize; { unz_s* s; unz_file_info file_info; unz_file_info_internal file_info_internal; int err=UNZ_OK; uLong uMagic; long lSeek=0; if (file==NULL) return UNZ_PARAMERROR; s=(unz_s*)file; if (fseek(s->file,s->pos_in_central_dir+s->byte_before_the_zipfile,SEEK_SET)!=0) err=UNZ_ERRNO; /* we check the magic */ if (err==UNZ_OK) { if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK) err=UNZ_ERRNO; else if (uMagic!=0x02014b50) err=UNZ_BADZIPFILE; } if (unzlocal_getShort(s->file,&file_info.version) != UNZ_OK) err=UNZ_ERRNO; if (unzlocal_getShort(s->file,&file_info.version_needed) != UNZ_OK) err=UNZ_ERRNO; if (unzlocal_getShort(s->file,&file_info.flag) != UNZ_OK) err=UNZ_ERRNO; if (unzlocal_getShort(s->file,&file_info.compression_method) != UNZ_OK) err=UNZ_ERRNO; if (unzlocal_getLong(s->file,&file_info.dosDate) != UNZ_OK) err=UNZ_ERRNO; unzlocal_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date); if (unzlocal_getLong(s->file,&file_info.crc) != UNZ_OK) err=UNZ_ERRNO; if (unzlocal_getLong(s->file,&file_info.compressed_size) != UNZ_OK) err=UNZ_ERRNO; if (unzlocal_getLong(s->file,&file_info.uncompressed_size) != UNZ_OK) err=UNZ_ERRNO; if (unzlocal_getShort(s->file,&file_info.size_filename) != UNZ_OK) err=UNZ_ERRNO; if (unzlocal_getShort(s->file,&file_info.size_file_extra) != UNZ_OK) err=UNZ_ERRNO; if (unzlocal_getShort(s->file,&file_info.size_file_comment) != UNZ_OK) err=UNZ_ERRNO; if (unzlocal_getShort(s->file,&file_info.disk_num_start) != UNZ_OK) err=UNZ_ERRNO; if (unzlocal_getShort(s->file,&file_info.internal_fa) != UNZ_OK) err=UNZ_ERRNO; if (unzlocal_getLong(s->file,&file_info.external_fa) != UNZ_OK) err=UNZ_ERRNO; if (unzlocal_getLong(s->file,&file_info_internal.offset_curfile) != UNZ_OK) err=UNZ_ERRNO; lSeek+=file_info.size_filename; if ((err==UNZ_OK) && (szFileName!=NULL)) { uLong uSizeRead ; if (file_info.size_filename0) && (fileNameBufferSize>0)) if (fread(szFileName,(uInt)uSizeRead,1,s->file)!=1) err=UNZ_ERRNO; lSeek -= uSizeRead; } if ((err==UNZ_OK) && (extraField!=NULL)) { uLong uSizeRead ; if (file_info.size_file_extrafile,lSeek,SEEK_CUR)==0) lSeek=0; else err=UNZ_ERRNO; } if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) if (fread(extraField,(uInt)uSizeRead,1,s->file)!=1) err=UNZ_ERRNO; lSeek += file_info.size_file_extra - uSizeRead; } else lSeek+=file_info.size_file_extra; if ((err==UNZ_OK) && (szComment!=NULL)) { uLong uSizeRead ; if (file_info.size_file_commentfile,lSeek,SEEK_CUR)==0) lSeek=0; else err=UNZ_ERRNO; } if ((file_info.size_file_comment>0) && (commentBufferSize>0)) if (fread(szComment,(uInt)uSizeRead,1,s->file)!=1) 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 unzGetCurrentFileInfo (file, pfile_info, szFileName, fileNameBufferSize, extraField, extraFieldBufferSize, szComment, commentBufferSize) unzFile file; unz_file_info *pfile_info; char *szFileName; uLong fileNameBufferSize; void *extraField; uLong extraFieldBufferSize; char *szComment; uLong commentBufferSize; { return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL, szFileName,fileNameBufferSize, extraField,extraFieldBufferSize, szComment,commentBufferSize); } /* Set the current file of the zipfile to the first file. return UNZ_OK if there is no problem */ extern int ZEXPORT unzGoToFirstFile (file) unzFile file; { int err=UNZ_OK; unz_s* s; if (file==NULL) return UNZ_PARAMERROR; s=(unz_s*)file; s->pos_in_central_dir=s->offset_central_dir; s->num_file=0; err=unzlocal_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 (file) unzFile file; { unz_s* s; int err; if (file==NULL) return UNZ_PARAMERROR; s=(unz_s*)file; if (!s->current_file_ok) return UNZ_END_OF_LIST_OF_FILE; 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 = unzlocal_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 (file, szFileName, iCaseSensitivity) unzFile file; const char *szFileName; int iCaseSensitivity; { unz_s* s; int err; uLong num_fileSaved; uLong pos_in_central_dirSaved; if (file==NULL) return UNZ_PARAMERROR; if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) return UNZ_PARAMERROR; s=(unz_s*)file; if (!s->current_file_ok) return UNZ_END_OF_LIST_OF_FILE; num_fileSaved = s->num_file; pos_in_central_dirSaved = s->pos_in_central_dir; err = unzGoToFirstFile(file); while (err == UNZ_OK) { char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; unzGetCurrentFileInfo(file,NULL, szCurrentFileName,sizeof(szCurrentFileName)-1, NULL,0,NULL,0); if (unzStringFileNameCompare(szCurrentFileName, szFileName,iCaseSensitivity)==0) return UNZ_OK; err = unzGoToNextFile(file); } s->num_file = num_fileSaved ; s->pos_in_central_dir = pos_in_central_dirSaved ; return err; } /* 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 unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar, poffset_local_extrafield, psize_local_extrafield) unz_s* s; uInt* piSizeVar; uLong *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 (fseek(s->file,s->cur_file_info_internal.offset_curfile + s->byte_before_the_zipfile,SEEK_SET)!=0) return UNZ_ERRNO; if (err==UNZ_OK) { if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK) err=UNZ_ERRNO; else if (uMagic!=0x04034b50) err=UNZ_BADZIPFILE; } if (unzlocal_getShort(s->file,&uData) != UNZ_OK) err=UNZ_ERRNO; /* else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion)) err=UNZ_BADZIPFILE; */ if (unzlocal_getShort(s->file,&uFlags) != UNZ_OK) err=UNZ_ERRNO; if (unzlocal_getShort(s->file,&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) && (s->cur_file_info.compression_method!=Z_DEFLATED)) err=UNZ_BADZIPFILE; if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* date/time */ err=UNZ_ERRNO; if (unzlocal_getLong(s->file,&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 (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* size compr */ err=UNZ_ERRNO; else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && ((uFlags & 8)==0)) err=UNZ_BADZIPFILE; if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* size uncompr */ err=UNZ_ERRNO; else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && ((uFlags & 8)==0)) err=UNZ_BADZIPFILE; if (unzlocal_getShort(s->file,&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 (unzlocal_getShort(s->file,&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 unzOpenCurrentFile (file) unzFile file; { int err=UNZ_OK; int Store; uInt iSizeVar; unz_s* s; file_in_zip_read_info_s* pfile_in_zip_read_info; uLong offset_local_extrafield; /* offset of the local extra field */ uInt size_local_extrafield; /* size of the local extra field */ if (file==NULL) return UNZ_PARAMERROR; s=(unz_s*)file; if (!s->current_file_ok) return UNZ_PARAMERROR; if (s->pfile_in_zip_read != NULL) unzCloseCurrentFile(file); if (unzlocal_CheckCurrentFileCoherencyHeader(s,&iSizeVar, &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) return UNZ_BADZIPFILE; pfile_in_zip_read_info = (file_in_zip_read_info_s*) ALLOC(sizeof(file_in_zip_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; 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 ((s->cur_file_info.compression_method!=0) && (s->cur_file_info.compression_method!=Z_DEFLATED)) err=UNZ_BADZIPFILE; Store = s->cur_file_info.compression_method==0; pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; pfile_in_zip_read_info->crc32=0; pfile_in_zip_read_info->compression_method = s->cur_file_info.compression_method; pfile_in_zip_read_info->file=s->file; pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile; pfile_in_zip_read_info->stream.total_out = 0; if (!Store) { 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; err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); if (err == Z_OK) pfile_in_zip_read_info->stream_initialised=1; /* 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; return UNZ_OK; } /* 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 (file, buf, len) unzFile file; voidp buf; unsigned len; { int err=UNZ_OK; uInt iRead = 0; unz_s* s; file_in_zip_read_info_s* pfile_in_zip_read_info; if (file==NULL) return UNZ_PARAMERROR; s=(unz_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->stream.avail_out = (uInt)pfile_in_zip_read_info->rest_read_uncompressed; 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 (fseek(pfile_in_zip_read_info->file, pfile_in_zip_read_info->pos_in_zipfile + pfile_in_zip_read_info->byte_before_the_zipfile,SEEK_SET)!=0) return UNZ_ERRNO; if (fread(pfile_in_zip_read_info->read_buffer,uReadThis,1, pfile_in_zip_read_info->file)!=1) return UNZ_ERRNO; 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) { uInt uDoCopy,i ; 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->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 { uLong uTotalOutBefore,uTotalOutAfter; const Bytef *bufBefore; uLong 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); uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; uOutThis = uTotalOutAfter-uTotalOutBefore; 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 (file) unzFile file; { unz_s* s; file_in_zip_read_info_s* pfile_in_zip_read_info; if (file==NULL) return UNZ_PARAMERROR; s=(unz_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; } /* return 1 if the end of file was reached, 0 elsewhere */ extern int ZEXPORT unzeof (file) unzFile file; { unz_s* s; file_in_zip_read_info_s* pfile_in_zip_read_info; if (file==NULL) return UNZ_PARAMERROR; s=(unz_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 (file,buf,len) unzFile file; voidp buf; unsigned len; { unz_s* s; file_in_zip_read_info_s* pfile_in_zip_read_info; uInt read_now; uLong size_to_read; if (file==NULL) return UNZ_PARAMERROR; s=(unz_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 (fseek(pfile_in_zip_read_info->file, pfile_in_zip_read_info->offset_local_extrafield + pfile_in_zip_read_info->pos_local_extrafield,SEEK_SET)!=0) return UNZ_ERRNO; if (fread(buf,(uInt)size_to_read,1,pfile_in_zip_read_info->file)!=1) 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 (file) unzFile file; { int err=UNZ_OK; unz_s* s; file_in_zip_read_info_s* pfile_in_zip_read_info; if (file==NULL) return UNZ_PARAMERROR; s=(unz_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) { 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) inflateEnd(&pfile_in_zip_read_info->stream); 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 (file, szComment, uSizeBuf) unzFile file; char *szComment; uLong uSizeBuf; { unz_s* s; uLong uReadThis ; if (file==NULL) return UNZ_PARAMERROR; s=(unz_s*)file; uReadThis = uSizeBuf; if (uReadThis>s->gi.size_comment) uReadThis = s->gi.size_comment; if (fseek(s->file,s->central_pos+22,SEEK_SET)!=0) return UNZ_ERRNO; if (uReadThis>0) { *szComment='\0'; if (fread(szComment,(uInt)uReadThis,1,s->file)!=1) return UNZ_ERRNO; } if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) *(szComment+s->gi.size_comment)='\0'; return (int)uReadThis; } fceu-0.98.12/src/unzip.h0000644000175000000620000002331210003562770014620 0ustar joestaff00000000000000/* unzip.h -- IO for uncompress .zip files using zlib Version 0.15 beta, Mar 19th, 1998, Copyright (C) 1998 Gilles Vollant This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g WinZip, InfoZip tools and compatible. Encryption and multi volume ZipFile (span) are not supported. Old compressions used by old PKZip 1.x are not supported THIS IS AN ALPHA VERSION. AT THIS STAGE OF DEVELOPPEMENT, SOMES API OR STRUCTURE CAN CHANGE IN FUTURE VERSION !! I WAIT FEEDBACK at mail info@winimage.com Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution 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. */ /* for more info about .ZIP format, see ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip PkWare has also a specification at : ftp://ftp.pkware.com/probdesc.zip */ #ifndef _unz_H #define _unz_H #ifdef __cplusplus extern "C" { #endif #ifndef _ZLIB_H #include "zlib.h" #endif #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_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_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)); /* Open a Zip file. path contain the full pathname (by example, on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer "zlib/zlib111.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. */ 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)); /* 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 */ 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) */ /***************************************************************************/ /* 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 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)); /* 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 */ #ifdef __cplusplus } #endif #endif /* _unz_H */ fceu-0.98.12/src/fceustr.c0000644000175000000620000000062510030421131015104 0ustar joestaff00000000000000#include #include #include "types.h" #include "fceustr.h" /* Creates a fceustr from a C-style string. */ fceustr *fceustr_create(const char *str) { fceustr *ret; ret=malloc(sizeof(fceustr)); ret->data=malloc(strlen(str)+1); strcpy(ret->data,str); ret->len=strlen(str); return(ret); } void fceustr_destroy(fceustr *str) { if(str->data) free(str->data); free(str); } fceu-0.98.12/src/fceustr.h0000644000175000000620000000014110003562770015121 0ustar joestaff00000000000000typedef struct { uint8 *data; uint32 len; /* Not including extra NULL character. */ } fceustr; fceu-0.98.12/src/movie.c0000644000175000000620000001177310111545662014576 0ustar joestaff00000000000000#include #include #include #include "types.h" #include "input.h" #include "fceu.h" #include "driver.h" #include "state.h" #include "general.h" #include "video.h" static int current = 0; // > 0 for recording, < 0 for playback static FILE *slots[10]={0}; static uint8 joop[4]; static uint32 framets; /* Cache variables used for playback. */ static uint32 nextts; static int nextd; static int CurrentMovie = 0; static int MovieShow = 0; static int MovieStatus[10]; static void DoEncode(int joy, int button, int); int FCEUMOV_IsPlaying(void) { if(current < 0) return(1); else return(0); } void FCEUI_SaveMovie(char *fname) { FILE *fp; char *fn; if(current < 0) /* Can't interrupt playback.*/ return; if(current > 0) /* Stop saving. */ { DoEncode(0,0,1); /* Write a dummy timestamp value so that the movie will keep "playing" after user input has stopped. */ fclose(slots[current-1]); MovieStatus[current - 1] = 1; current=0; FCEU_DispMessage("Movie recording stopped."); return; } current=CurrentMovie; if(fname) fp = FCEUD_UTF8fopen(fname, "wb"); else { fp=FCEUD_UTF8fopen(fn=FCEU_MakeFName(FCEUMKF_MOVIE,CurrentMovie,0),"wb"); free(fn); } if(!fp) return; FCEUSS_SaveFP(fp); fseek(fp, 0, SEEK_END); slots[current] = fp; memset(joop,0,sizeof(joop)); current++; framets=0; FCEUI_SelectMovie(CurrentMovie); /* Quick hack to display status. */ } static void StopPlayback(void) { fclose(slots[-1 - current]); current=0; FCEU_DispMessage("Movie playback stopped."); } void FCEUMOV_Stop(void) { if(current < 0) StopPlayback(); } void FCEUI_LoadMovie(char *fname) { FILE *fp; char *fn; if(current > 0) /* Can't interrupt recording.*/ return; if(current < 0) /* Stop playback. */ { StopPlayback(); return; } if(fname) fp = FCEUD_UTF8fopen(fname, "rb"); else { fp=FCEUD_UTF8fopen(fn=FCEU_MakeFName(FCEUMKF_MOVIE,CurrentMovie,0),"rb"); free(fn); } if(!fp) return; if(!FCEUSS_LoadFP(fp)) return; current = CurrentMovie; slots[current] = fp; memset(joop,0,sizeof(joop)); current = -1 - current; framets=0; nextts=0; nextd = -1; MovieStatus[CurrentMovie] = 1; FCEUI_SelectMovie(CurrentMovie); /* Quick hack to display status. */ } static void DoEncode(int joy, int button, int dummy) { uint8 d; d = 0; if(framets >= 65536) d = 3 << 5; else if(framets >= 256) d = 2 << 5; else if(framets > 0) d = 1 << 5; if(dummy) d|=0x80; d |= joy << 3; d |= button; fputc(d, slots[current - 1]); //printf("Wr: %02x, %d\n",d,slots[current-1]); while(framets) { fputc(framets & 0xff, slots[current - 1]); //printf("Wrts: %02x\n",framets & 0xff); framets >>= 8; } } void FCEUMOV_AddJoy(uint8 *js) { int x,y; if(!current) return; /* Not playback nor recording. */ if(current < 0) /* Playback */ { while(nextts == framets) { int tmp,ti; uint8 d; if(nextd != -1) { if(nextd&0x80) { //puts("Egads"); FCEU_DoSimpleCommand(nextd&0x1F); } else joop[(nextd >> 3)&0x3] ^= 1 << (nextd&0x7); } tmp = fgetc(slots[-1 - current]); d = tmp; if(tmp < 0) { StopPlayback(); return; } nextts = 0; tmp >>= 5; tmp &= 0x3; ti=0; int tmpfix = tmp; while(tmp--) { nextts |= fgetc(slots[-1 - current]) << (ti * 8); ti++; } // This fixes a bug in movies recorded before version 0.98.11 // It's probably not necessary, but it may keep away CRAZY PEOPLE who recorded // movies on <= 0.98.10 and don't work on playback. if(tmpfix == 1 && !nextts) {nextts |= fgetc(slots[-1 - current])<<8; } else if(tmpfix == 2 && !nextts) {nextts |= fgetc(slots[-1 - current])<<16; } framets = 0; nextd = d; } memcpy(js,joop,4); } else /* Recording */ { for(x=0;x<4;x++) { if(js[x] != joop[x]) { for(y=0;y<8;y++) if((js[x] ^ joop[x]) & (1 << y)) DoEncode(x, y, 0); joop[x] = js[x]; } else if(framets == ((1<<24)-1)) DoEncode(0,0,1); /* Overflow will happen, so do dummy update. */ } } framets++; } void FCEUMOV_AddCommand(int cmd) { if(current <= 0) return; /* Return if not recording a movie */ //printf("%d\n",cmd); DoEncode((cmd>>3)&0x3,cmd&0x7,1); } void FCEUMOV_CheckMovies(void) { FILE *st=NULL; char *fn; int ssel; for(ssel=0;ssel<10;ssel++) { st=FCEUD_UTF8fopen(fn=FCEU_MakeFName(FCEUMKF_MOVIE,ssel,0),"rb"); free(fn); if(st) { MovieStatus[ssel]=1; fclose(st); } else MovieStatus[ssel]=0; } } void FCEUI_SelectMovie(int w) { if(w == -1) { MovieShow = 0; return; } FCEUI_SelectState(-1); CurrentMovie=w; MovieShow=180; if(current > 0) FCEU_DispMessage("-recording movie %d-",current-1); else if (current < 0) FCEU_DispMessage("-playing movie %d-",-1 - current); else FCEU_DispMessage("-select movie-"); } void FCEU_DrawMovies(uint8 *XBuf) { if(!MovieShow) return; FCEU_DrawNumberRow(XBuf,MovieStatus, CurrentMovie); MovieShow--; } fceu-0.98.12/src/soundexp.c0000644000175000000620000000121710030421131015274 0ustar joestaff00000000000000#include #include #include "types.h" #include "fceu.h" static OggVorbis_File cursong; void InstallSoundExp(void) { FILE *fp=fopen("test.ogg","rb"); ov_open(fp,&cursong,NULL,0); FCEUGameInfo->soundrate=44100; FCEUGameInfo->soundchan=2; } int cur=0; void UpdateSoundExp(int32 *buf, int32 len) { int16 boo[8192]; int32 offset=0; int x; int32 tlen=len; while(len) { int32 t=ov_read(&cursong,(char *)boo+offset*4,len*4,0,2,1,&cur)/4; len-=t; offset+=t; } // printf("%d\n",inboo); for(x=0;x