From 38278fb60b8b9cad0413e25ed6e0dbaf282c11b8 Mon Sep 17 00:00:00 2001 From: Thomas Adam Date: Sun, 12 Feb 2017 19:48:54 +0000 Subject: [PATCH] Merge READMEs together and form README.MD Rationalise both sets of README files, and convert them to Markdown for the purposes of Github. --- .gitattributes | 42 - .gitignore | 42 - COPYING | 678 +-- changes.txt => Changes.txt | 584 +- Makefile | 659 +++ Makefile.am | 2 + Makefile.in | 659 +++ README.md | 413 ++ TODO.md | 9 + aclocal.m4 | 1179 +++++ cmos.bin | Bin 0 -> 64 bytes cmos350.bin | Bin 0 -> 64 bytes cmosa.bin | Bin 0 -> 64 bytes cmosc.bin | Bin 0 -> 128 bytes configure | 5671 ++++++++++++++++++++ configure.ac | 51 + ddnoise/35/motor.wav | Bin 0 -> 44906 bytes ddnoise/35/motoroff.wav | Bin 0 -> 18670 bytes ddnoise/35/motoron.wav | Bin 0 -> 14094 bytes ddnoise/35/seek1i.wav | Bin 0 -> 6636 bytes ddnoise/35/seek1o.wav | Bin 0 -> 4832 bytes ddnoise/35/seek2i.wav | Bin 0 -> 17016 bytes ddnoise/35/seek2o.wav | Bin 0 -> 16382 bytes ddnoise/35/seek3i.wav | Bin 0 -> 42530 bytes ddnoise/35/seek3o.wav | Bin 0 -> 42358 bytes ddnoise/35/stepi.wav | Bin 0 -> 4212 bytes ddnoise/35/stepo.wav | Bin 0 -> 2226 bytes ddnoise/525/motor.wav | Bin 0 -> 9440 bytes ddnoise/525/motoroff.wav | Bin 0 -> 17278 bytes ddnoise/525/motoron.wav | Bin 0 -> 16352 bytes ddnoise/525/seek.wav | Bin 0 -> 6558 bytes ddnoise/525/seek2.wav | Bin 0 -> 79212 bytes ddnoise/525/seek3.wav | Bin 0 -> 47070 bytes ddnoise/525/step.wav | Bin 0 -> 4296 bytes ddnoise/motoroff.wav | Bin 0 -> 5154 bytes ddnoise/motoron.wav | Bin 0 -> 4480 bytes icon/b-em.png | Bin 0 -> 2619 bytes icon/b-em.svg | 152 + install-sh | 519 ++ missing | 367 ++ readme.txt | 366 -- src/32016.c | 2754 +++++----- src/32016.h | 8 +- src/6502.c | 9716 +++++++++++++++++----------------- src/6502.h | 56 +- src/6502tube.c | 3394 ++++++------ src/6502tube.h | 10 +- src/65816.c | 9710 ++++++++++++++++----------------- src/65816.h | 8 +- src/Makefile | 1500 +++++- src/Makefile.am | 35 + src/Makefile.in | 1472 +++++ src/Makefile.mingw | 28 + src/{z80.c => Z80.c} | 5728 ++++++++++---------- src/acia.c | 260 +- src/acia.h | 28 +- src/adc.c | 180 +- src/adc.h | 18 +- src/adf.c | 638 +-- src/adf.h | 22 +- src/arm.c | 4050 +++++++------- src/arm.h | 26 +- src/b-em.h | 100 +- src/b-em.rc | 1022 ++-- src/b-em.vcxproj | 450 +- src/b-em.vcxproj.filters | 836 +-- src/b-em.vcxproj.user | 3 + src/bbctext.h | 6556 +++++++++++------------ src/cmos.c | 190 +- src/cmos.h | 10 +- src/compact_joystick.c | 40 +- src/compact_joystick.h | 2 +- src/compactcmos.c | 442 +- src/compactcmos.h | 10 +- src/config.c | 274 +- src/config.h | 10 +- src/csw.c | 574 +- src/csw.h | 14 +- src/daa.h | 4102 +++++++------- src/ddnoise.c | 341 +- src/ddnoise.h | 13 +- src/debugger.c | 1782 +++---- src/debugger.h | 22 +- src/disc.c | 484 +- src/disc.h | 88 +- src/fdi.c | 758 +-- src/fdi.h | 18 +- src/fdi2raw.c | 4380 +++++++-------- src/fdi2raw.h | 68 +- src/i8271.c | 1014 ++-- src/i8271.h | 8 +- src/ide.c | 654 +-- src/ide.h | 16 +- src/keyboard.c | 294 +- src/keyboard.h | 22 +- src/linux-gui.c | 1541 +++--- src/linux-gui.h | 2 +- src/linux-keydefine.c | 676 ++- src/linux.c | 198 +- src/main.c | 806 +-- src/main.h | 18 +- src/mem.c | 545 +- src/mem.h | 44 +- src/model.c | 182 +- src/model.h | 68 +- src/mouse.c | 272 +- src/mouse.h | 10 +- src/pal.c | 684 +-- src/pal.h | 4 +- src/resid-fp/AUTHORS | 8 +- src/resid-fp/COPYING | 680 +-- src/resid-fp/ChangeLog | 272 +- src/resid-fp/INSTALL | 28 +- src/resid-fp/Makefile.am | 58 +- src/resid-fp/Makefile.in | 557 ++ src/resid-fp/NEWS | 2 +- src/resid-fp/README | 158 +- src/resid-fp/README.VICE | 28 +- src/resid-fp/aclocal.m4 | 850 +++ src/resid-fp/configure | 5955 +++++++++++++++++++++ src/resid-fp/configure.in | 332 +- src/resid-fp/convolve-sse.cc | 152 +- src/resid-fp/convolve.cc | 54 +- src/resid-fp/envelope.cc | 508 +- src/resid-fp/envelope.h | 348 +- src/resid-fp/extfilt.cc | 188 +- src/resid-fp/extfilt.h | 240 +- src/resid-fp/filter.cc | 388 +- src/resid-fp/filter.h | 766 +-- src/resid-fp/pot.cc | 52 +- src/resid-fp/pot.h | 62 +- src/resid-fp/samp2src.pl | 130 +- src/resid-fp/sid.cc | 1872 +++---- src/resid-fp/sid.h | 260 +- src/resid-fp/siddefs-fp.h | 176 +- src/resid-fp/siddefs-fp.h.in | 174 +- src/resid-fp/version.cc | 42 +- src/resid-fp/voice.cc | 204 +- src/resid-fp/voice.h | 146 +- src/resid-fp/wave.cc | 302 +- src/resid-fp/wave.h | 914 ++-- src/resid-fp/wave6581_PST.cc | 1072 ++-- src/resid-fp/wave6581_PS_.cc | 1072 ++-- src/resid-fp/wave6581_P_T.cc | 1072 ++-- src/resid-fp/wave6581__ST.cc | 1072 ++-- src/resid-fp/wave8580_PST.cc | 1072 ++-- src/resid-fp/wave8580_PS_.cc | 1072 ++-- src/resid-fp/wave8580_P_T.cc | 1072 ++-- src/resid-fp/wave8580__ST.cc | 1072 ++-- src/resid.cc | 316 +- src/resources.h | 182 +- src/savestate.c | 196 +- src/savestate.h | 14 +- src/scan2bbc.h | 88 +- src/serial.c | 118 +- src/serial.h | 16 +- src/sid_b-em.h | 34 +- src/sidtypes.h | 28 +- src/sn76489.c | 508 +- src/sn76489.h | 24 +- src/sound.c | 198 +- src/sound.h | 10 +- src/soundopenal.c | 368 +- src/soundopenal.h | 10 +- src/ssd.c | 538 +- src/ssd.h | 20 +- src/sysvia.c | 414 +- src/sysvia.h | 36 +- src/tape.c | 110 +- src/tape.h | 16 +- src/tapenoise.c | 284 +- src/tapenoise.h | 12 +- src/tube.c | 680 +-- src/tube.h | 46 +- src/uef.c | 800 +-- src/uef.h | 12 +- src/uservia.c | 196 +- src/uservia.h | 32 +- src/via.c | 866 +-- src/via.h | 70 +- src/vidalleg.c | 504 +- src/video.c | 1744 +++--- src/video.h | 70 +- src/video_render.h | 66 +- src/wd1770.c | 684 +-- src/wd1770.h | 8 +- src/win-catalogue.c | 150 +- src/win-keydefine.c | 520 +- src/win-opengl.c | 109 + src/win.c | 1910 +++---- src/win.h | 6 +- src/x86.c | 7050 ++++++++++++------------ src/x86.h | 214 +- src/x86_tube.h | 8 +- src/z80.h | 8 +- 195 files changed, 72017 insertions(+), 52439 deletions(-) delete mode 100644 .gitattributes delete mode 100644 .gitignore rename changes.txt => Changes.txt (96%) create mode 100644 Makefile create mode 100644 Makefile.am create mode 100644 Makefile.in create mode 100644 README.md create mode 100644 TODO.md create mode 100644 aclocal.m4 create mode 100644 cmos.bin create mode 100644 cmos350.bin create mode 100644 cmosa.bin create mode 100644 cmosc.bin create mode 100644 configure create mode 100644 configure.ac create mode 100644 ddnoise/35/motor.wav create mode 100644 ddnoise/35/motoroff.wav create mode 100644 ddnoise/35/motoron.wav create mode 100644 ddnoise/35/seek1i.wav create mode 100644 ddnoise/35/seek1o.wav create mode 100644 ddnoise/35/seek2i.wav create mode 100644 ddnoise/35/seek2o.wav create mode 100644 ddnoise/35/seek3i.wav create mode 100644 ddnoise/35/seek3o.wav create mode 100644 ddnoise/35/stepi.wav create mode 100644 ddnoise/35/stepo.wav create mode 100644 ddnoise/525/motor.wav create mode 100644 ddnoise/525/motoroff.wav create mode 100644 ddnoise/525/motoron.wav create mode 100644 ddnoise/525/seek.wav create mode 100644 ddnoise/525/seek2.wav create mode 100644 ddnoise/525/seek3.wav create mode 100644 ddnoise/525/step.wav create mode 100644 ddnoise/motoroff.wav create mode 100644 ddnoise/motoron.wav create mode 100644 icon/b-em.png create mode 100644 icon/b-em.svg create mode 100644 install-sh create mode 100644 missing delete mode 100644 readme.txt create mode 100644 src/Makefile.am create mode 100644 src/Makefile.in create mode 100644 src/Makefile.mingw rename src/{z80.c => Z80.c} (95%) create mode 100644 src/b-em.vcxproj.user create mode 100644 src/resid-fp/Makefile.in create mode 100644 src/resid-fp/aclocal.m4 create mode 100644 src/resid-fp/configure mode change 100755 => 100644 src/resid-fp/samp2src.pl create mode 100644 src/win-opengl.c diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index e7d3f9b1..00000000 --- a/.gitattributes +++ /dev/null @@ -1,42 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# text -*.c text -*.cpp text -*.h text -*.hpp text -*.pl text -*.cc text -*.m text -*.mm text -*.txt text -*.mak text - -# binary -*.exe binary -*.dll binary -*.ico binary -*.bin binary -*.wav binary -*.snd binary -*.dat binary - -# resources -*.rc text eol=crlf -*.sln text eol=crlf filter=utf8bom -*.vcproj text eol=crlf filter=utf8bom -*.vcxproj text eol=crlf filter=utf8bom -*.vcxproj.filters text eol=crlf filter=utf8bom -*.dsw text eol=crlf -*.dsp text eol=crlf -*.bat text eol=crlf - -# bbc -*.rom binary -*.ssd binary -*.dsd binary -*.adl binary -*.uef binary -*.img binary -*.hdf binary diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 87c47e13..00000000 --- a/.gitignore +++ /dev/null @@ -1,42 +0,0 @@ -*~ -*.bak -.DS_Store - -*.aps -*.exe -*.dll -*.o -*.a -*.pdb -*.sdf -*.opensdf -*.ilk -*.suo -*.user - -# automake/autoconf -Makefile.in -autom4te.cache -aclocal.m4 -compile -configure -depcomp -install-sh -missing -stamp-h1 -config.log -config.status -Makefile -.deps -.dirstamp - -# b-em -cmos*.bin -*.cfg -*.hdf -/ddnoise -/roms -/inf -/discs -/tapes -/uef diff --git a/COPYING b/COPYING index a43ea212..92851102 100644 --- a/COPYING +++ b/COPYING @@ -1,339 +1,339 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/changes.txt b/Changes.txt similarity index 96% rename from changes.txt rename to Changes.txt index 2a90f837..0133ff04 100644 --- a/changes.txt +++ b/Changes.txt @@ -1,293 +1,293 @@ -Version 2.2 (03/06/2012) -- MOS 3.50 emulation -- Fixed CRTC bug when programmed with stupid values (MOS 3.50 startup) -- ADFS disc corruption bug fixed (Carlo Concari) -- Fixed ACIA bug - Pro Boxing Simulator tape version now works -- Fixed bug which created endless blank hard disc images -- Printer port DAC emulation -- AMX mouse emulation -- Master 512 mouse now works properly -- Master Compact joystick emulation -- IDE emulation available in non-Master models -- UI fixes (some from Carlo Concari) -- Improvements to VIA emulation -- PAL video filter -- Bugfixes in ARM and 65816 coprocessors -- Debugger fixes -- Tidying up of code -- Windows version can now build on MSVC as well as GCC - - -Version 2.1a (14/02/2011) -- Keyboard bug fixed, Dr Who : The First Adventure now works -- Video ULA bug, Atic Atac now has correct colours -- Cursor inversion now works properly -- Linux screenshots now work -- Save states in Linux - - -Version 2.1 (25/10/2010) -- IDE hard disc emulation -- OpenGL video support (mainly for Linux) -- Fixed 360k discs in Master 512 mode -- Fixed some hanging bugs in Windows (mainly when resetting) -- Resizeable window in Windows -- Debugger improvements -- VIA and video fixes, cassette version of Lunar Jetman now works -- Lightpen fix, Pharaoh's Curse works -- Some mode 7 fixes -- Speed control - - -Version 2.0b (26/08/2010) -- Fixed keyboard bug with Windows 7 - - -Version 2.0a (16/03/2010) -- Various bugfixes -- Linux port now available - - -Version 2.0 (14/03/2010) -- Most of the emulator re-written -- Cycle-accurate video emulation -- Higher quality mode 7 -- Added 80186 (Master 512) and 65816 second processors -- BeebSID emulation (using resid-fp) -- FDI support is back -- Improved sound overall -- Much more stable -- Linux port (preliminary) - Linux 2.0 never got released -- Debugger -- Redefineable keyboard - - -Version 1.5 (20/05/2008) -- Acorn Z80 tube emulation -- Various fixes to video and sound -- New bandpass sound filter - recommended! (sounds very BBC-ish) -- Fixed crash bug on exit - - -Version 1.4a (10/06/2007) -- Fixed problems with modes 3 and 6 -- FDI code removed due to licensing issues - - -Version 1.4 (15/05/2007) -- 65c012 tube emulation (+ Master Turbo) - from 4mhz to 64mhz -- Fixed bug in ARM tube emulation -- Sideways ROMs supported in Master emulation -- Windows version now releases unneeded CPU time -- Sound should hopefully be better - -Version 1.3 (13/25/2006) -- Better sound in Windows version -- Better CSW support -- Bugfix in mode 7 -- Bugfix in cursor handling - Frogman works again, no more random crashes in some games -- Periodic noise pitch now correct - see Icarus, Cute To Kill -- Video can now use hardware scaling - should be faster -- Removed colour errors with 2xSaI filter -- File dialogs now work properly - - -Version 1.2 (28/07/2006) -- Preliminary CSW support -- Improved timing, more protected games work (eg Nightshade, Tapper, - Beach Head etc) -- E00 DFS now supported -- Disc writing works properly again - - -Version 1.1 (7/05/2006) -- Can now emulate a Model B with 1770 FDC -- Better mode 7 emulation - many programs improved, eg Granny's Garden -- Added cursor to modes 0-6 -- Altered video timing a little -- Added more commands to 1770 FDC - Watford DDFS now works (single density - mode only) -- Some optimisations to video code -- Update VGM logging to latest spec - - -Version 1.0 (24/12/2005) -- FDI support. Allows use of copy protected disc images. A few bugs in FDC - emulation remain, however about 75% of FDI images dumped so far work. -- Improvements to timing, Joust now works, along with some Kevin Edwards - protected games. -- Master Compact emulation (largely for some of the dumped FDI images). -- Slight improvements to cassette emulation, loader on Joust now works, - speedup now available. -- Faster tape loading. -- Fixes and optimisations to ARM emulation - - -Version 0.82 (11/08/2005) -- ARM Evaluation System emulation. Beware that this is quite slow and probably - buggy (I don't have any software to test on it). -- Fixed ADC/SBC BCD flags that were broken in 0.8 - Exile works again. -- Added read ID commands to 8271 FDC - Superior Collection now works. -- Ported to OS X - - -Version 0.81b (28/07/2005) : -- Audio buffer length now user selectable -- Fixed bug with instructions like STA $FFFF,x - 3D Grand Prix no longer - crashes -- A few other fixes - - -Version 0.81a (27/07/2005) : -- Adjusted audio a bit, less lagging in Windows port -- Fixed VGM logging - - -Version 0.81 (26/07/2005) : -- Fixed bugs in 8271 and 1770 FDCs, all write operations should now work. The - Hobbit also now works correctly. -- Fixed some crash bugs -- Added command line options, mainly for use by frontends - - -Version 0.8 (2/07/2005) : -- Timing improvements, some stuff that encrypts via timers (eg Frogman) now - works -- VIA improvements - fixed Planetoids/Super Defender/whatever, Volcano and - Pharoah's Curse -- Improvements to sound accuracy, Ghouls and Killer Gorilla (and probably - others) have better sound -- Cassette emulation now much more reliable -- Save states are implemented again -- Config file now in English -- Added high pass sound filter and SID waveform - -Version 0.71b (27/07/2004) : -- 8271 FDC now supports writing -- FDC no longer crashes B-em in The Hobbit -- Windows version should be more responsive - - -Version 0.71a (6/07/2004) (Windows only) : -- Fixed stupid bug relating to system resources - - -Version 0.71 (5/07/2004) : -- Big bug in Master 128 fixed - most Master stuff should work now -- High resolution video now supported -- 2xSaI filter -- Bugs fixed in CRTC, Uridium and Psycastria now look better -- Sound volume now logarithmic -- Couple of other bug fixes -- Win32 port can now run in a window - - -Version 0.7 (5/04/2004) : -- Master 128 emulation (buggy) -- Better video timing, Uridium works -- VIA interrupt bug fixed, many games better -- Interrupt bug fixed, Empire Strikes Back now working -- Disc write (B+ and Master 128 only) -- Sound mixing now 16 bit -- Low pass filter for sound -- Improved disc drive noise -- More reliable tape emulation - - -Version 0.61 (28/01/2004) : -- ADFS support -- Model A support -- Model B+ fixed a bit, Level 9 adventures now show pictures -- Win32 version improved a bit -- Some undocumented sound stuff emulated - Crazee Rider now has correct drums. -- Some other misc changes - - -Version 0.6 (31/07/2003) : -- Model B+ support, along with 1770 emulation -- Totally rewritten 6502 core - faster, more accurate -- Fixed some VIA timing - Revs now works -- UEF works better -- New GUI -- Improved sound core - now supports sample playback -- Now emulates two disc drives -- Win32 version now available - - -Version 0.5 (23/12/2002) : -- Totally rewritten 6502 core - faster, but some more bugs -- Totally rewritten video - better split palette/mode emulation + R5 scrolling - and some rupture -- UEF support is back -- New GUI -- Blurring filter -- Switchable sound waveforms -- Samples no longer crash B-em -- Sideways RAM emulation actually works -- Joystick emulation - - -Version 0.4a (20/01/2002) : -- Some 6502 bugs fixed, Exile now working properly. -- Re-added Model A emulation. -- Disc drive noise added. -- Default config file no longer points to a non-existant file. -- Can now log sound - invented new file format for this (.sn - player and - format description included) -- Arrow keys and delete/copy now work again. -- Updated documentation - - -Version 0.4 (13/01/2002) : -- Sound is *much* better -- Speed increased 2-4 times -- Video emulation improved. Full overscan is supported, and the colour - generation is the same as on a real BBC -- New GUI -- UEF support removed, as it were crap -- Directories semi-supported in TFS (for Dambusters and Sorcery) -- Setup removed (no longer needed) -- Some 6502 bugs fixed -- Sideways RAM emulation added, but quite buggy -- Exile now works! (just) -- Elite is now playable! - - -Version 0.3a (14/04/2001) : -- `clear screen' command removed, as it was using the same key as change disc. -- Stuff held in seperate directories : - roms - OS ROM and paged ROMs - inf - .INF files (with the extension-less files as well) - uef - .UEF files - discs - .SSD, .IMG, and .DSD files -- You shouldn't get `chunk ID' errors anymore with the UEF code -- American BBC support - - -Version 0.3 (01/04/2001) (first released version!) : -- Full 8271 FDC emulation -- More 6502 bugfixes -- Figured out what the vsync interrupt does (idiot!) -- Fixed hardware scrolling -- Optimisations - - -Version 0.2 (14/10/2000) (never released) : -- 6502 bugfixes - many more games work, plus BASIC is now usable -- VIA bugfixes -- Sound emulation (sounds terrible) -- Preliminary 8271 FDC emulation - not enough to actually run anything - - -Version 0.1 (03/09/2000) (never released) : -- Graphics emulation -- .INF file handling -- Couple of 6502 bugfixes (not many) -- About 3 games work - - -Version 0.0 (24/07/2000) (never released) : -- Buggy 6502 emulation -- Basic mode 7 emulation -- Keyboard +Version 2.2 (03/06/2012) +- MOS 3.50 emulation +- Fixed CRTC bug when programmed with stupid values (MOS 3.50 startup) +- ADFS disc corruption bug fixed (Carlo Concari) +- Fixed ACIA bug - Pro Boxing Simulator tape version now works +- Fixed bug which created endless blank hard disc images +- Printer port DAC emulation +- AMX mouse emulation +- Master 512 mouse now works properly +- Master Compact joystick emulation +- IDE emulation available in non-Master models +- UI fixes (some from Carlo Concari) +- Improvements to VIA emulation +- PAL video filter +- Bugfixes in ARM and 65816 coprocessors +- Debugger fixes +- Tidying up of code +- Windows version can now build on MSVC as well as GCC + + +Version 2.1a (14/02/2011) +- Keyboard bug fixed, Dr Who : The First Adventure now works +- Video ULA bug, Atic Atac now has correct colours +- Cursor inversion now works properly +- Linux screenshots now work +- Save states in Linux + + +Version 2.1 (25/10/2010) +- IDE hard disc emulation +- OpenGL video support (mainly for Linux) +- Fixed 360k discs in Master 512 mode +- Fixed some hanging bugs in Windows (mainly when resetting) +- Resizeable window in Windows +- Debugger improvements +- VIA and video fixes, cassette version of Lunar Jetman now works +- Lightpen fix, Pharaoh's Curse works +- Some mode 7 fixes +- Speed control + + +Version 2.0b (26/08/2010) +- Fixed keyboard bug with Windows 7 + + +Version 2.0a (16/03/2010) +- Various bugfixes +- Linux port now available + + +Version 2.0 (14/03/2010) +- Most of the emulator re-written +- Cycle-accurate video emulation +- Higher quality mode 7 +- Added 80186 (Master 512) and 65816 second processors +- BeebSID emulation (using resid-fp) +- FDI support is back +- Improved sound overall +- Much more stable +- Linux port (preliminary) - Linux 2.0 never got released +- Debugger +- Redefineable keyboard + + +Version 1.5 (20/05/2008) +- Acorn Z80 tube emulation +- Various fixes to video and sound +- New bandpass sound filter - recommended! (sounds very BBC-ish) +- Fixed crash bug on exit + + +Version 1.4a (10/06/2007) +- Fixed problems with modes 3 and 6 +- FDI code removed due to licensing issues + + +Version 1.4 (15/05/2007) +- 65c012 tube emulation (+ Master Turbo) - from 4mhz to 64mhz +- Fixed bug in ARM tube emulation +- Sideways ROMs supported in Master emulation +- Windows version now releases unneeded CPU time +- Sound should hopefully be better + +Version 1.3 (13/25/2006) +- Better sound in Windows version +- Better CSW support +- Bugfix in mode 7 +- Bugfix in cursor handling - Frogman works again, no more random crashes in some games +- Periodic noise pitch now correct - see Icarus, Cute To Kill +- Video can now use hardware scaling - should be faster +- Removed colour errors with 2xSaI filter +- File dialogs now work properly + + +Version 1.2 (28/07/2006) +- Preliminary CSW support +- Improved timing, more protected games work (eg Nightshade, Tapper, + Beach Head etc) +- E00 DFS now supported +- Disc writing works properly again + + +Version 1.1 (7/05/2006) +- Can now emulate a Model B with 1770 FDC +- Better mode 7 emulation - many programs improved, eg Granny's Garden +- Added cursor to modes 0-6 +- Altered video timing a little +- Added more commands to 1770 FDC - Watford DDFS now works (single density + mode only) +- Some optimisations to video code +- Update VGM logging to latest spec + + +Version 1.0 (24/12/2005) +- FDI support. Allows use of copy protected disc images. A few bugs in FDC + emulation remain, however about 75% of FDI images dumped so far work. +- Improvements to timing, Joust now works, along with some Kevin Edwards + protected games. +- Master Compact emulation (largely for some of the dumped FDI images). +- Slight improvements to cassette emulation, loader on Joust now works, + speedup now available. +- Faster tape loading. +- Fixes and optimisations to ARM emulation + + +Version 0.82 (11/08/2005) +- ARM Evaluation System emulation. Beware that this is quite slow and probably + buggy (I don't have any software to test on it). +- Fixed ADC/SBC BCD flags that were broken in 0.8 - Exile works again. +- Added read ID commands to 8271 FDC - Superior Collection now works. +- Ported to OS X + + +Version 0.81b (28/07/2005) : +- Audio buffer length now user selectable +- Fixed bug with instructions like STA $FFFF,x - 3D Grand Prix no longer + crashes +- A few other fixes + + +Version 0.81a (27/07/2005) : +- Adjusted audio a bit, less lagging in Windows port +- Fixed VGM logging + + +Version 0.81 (26/07/2005) : +- Fixed bugs in 8271 and 1770 FDCs, all write operations should now work. The + Hobbit also now works correctly. +- Fixed some crash bugs +- Added command line options, mainly for use by frontends + + +Version 0.8 (2/07/2005) : +- Timing improvements, some stuff that encrypts via timers (eg Frogman) now + works +- VIA improvements - fixed Planetoids/Super Defender/whatever, Volcano and + Pharoah's Curse +- Improvements to sound accuracy, Ghouls and Killer Gorilla (and probably + others) have better sound +- Cassette emulation now much more reliable +- Save states are implemented again +- Config file now in English +- Added high pass sound filter and SID waveform + +Version 0.71b (27/07/2004) : +- 8271 FDC now supports writing +- FDC no longer crashes B-em in The Hobbit +- Windows version should be more responsive + + +Version 0.71a (6/07/2004) (Windows only) : +- Fixed stupid bug relating to system resources + + +Version 0.71 (5/07/2004) : +- Big bug in Master 128 fixed - most Master stuff should work now +- High resolution video now supported +- 2xSaI filter +- Bugs fixed in CRTC, Uridium and Psycastria now look better +- Sound volume now logarithmic +- Couple of other bug fixes +- Win32 port can now run in a window + + +Version 0.7 (5/04/2004) : +- Master 128 emulation (buggy) +- Better video timing, Uridium works +- VIA interrupt bug fixed, many games better +- Interrupt bug fixed, Empire Strikes Back now working +- Disc write (B+ and Master 128 only) +- Sound mixing now 16 bit +- Low pass filter for sound +- Improved disc drive noise +- More reliable tape emulation + + +Version 0.61 (28/01/2004) : +- ADFS support +- Model A support +- Model B+ fixed a bit, Level 9 adventures now show pictures +- Win32 version improved a bit +- Some undocumented sound stuff emulated - Crazee Rider now has correct drums. +- Some other misc changes + + +Version 0.6 (31/07/2003) : +- Model B+ support, along with 1770 emulation +- Totally rewritten 6502 core - faster, more accurate +- Fixed some VIA timing - Revs now works +- UEF works better +- New GUI +- Improved sound core - now supports sample playback +- Now emulates two disc drives +- Win32 version now available + + +Version 0.5 (23/12/2002) : +- Totally rewritten 6502 core - faster, but some more bugs +- Totally rewritten video - better split palette/mode emulation + R5 scrolling + and some rupture +- UEF support is back +- New GUI +- Blurring filter +- Switchable sound waveforms +- Samples no longer crash B-em +- Sideways RAM emulation actually works +- Joystick emulation + + +Version 0.4a (20/01/2002) : +- Some 6502 bugs fixed, Exile now working properly. +- Re-added Model A emulation. +- Disc drive noise added. +- Default config file no longer points to a non-existant file. +- Can now log sound - invented new file format for this (.sn - player and + format description included) +- Arrow keys and delete/copy now work again. +- Updated documentation + + +Version 0.4 (13/01/2002) : +- Sound is *much* better +- Speed increased 2-4 times +- Video emulation improved. Full overscan is supported, and the colour + generation is the same as on a real BBC +- New GUI +- UEF support removed, as it were crap +- Directories semi-supported in TFS (for Dambusters and Sorcery) +- Setup removed (no longer needed) +- Some 6502 bugs fixed +- Sideways RAM emulation added, but quite buggy +- Exile now works! (just) +- Elite is now playable! + + +Version 0.3a (14/04/2001) : +- `clear screen' command removed, as it was using the same key as change disc. +- Stuff held in seperate directories : + roms - OS ROM and paged ROMs + inf - .INF files (with the extension-less files as well) + uef - .UEF files + discs - .SSD, .IMG, and .DSD files +- You shouldn't get `chunk ID' errors anymore with the UEF code +- American BBC support + + +Version 0.3 (01/04/2001) (first released version!) : +- Full 8271 FDC emulation +- More 6502 bugfixes +- Figured out what the vsync interrupt does (idiot!) +- Fixed hardware scrolling +- Optimisations + + +Version 0.2 (14/10/2000) (never released) : +- 6502 bugfixes - many more games work, plus BASIC is now usable +- VIA bugfixes +- Sound emulation (sounds terrible) +- Preliminary 8271 FDC emulation - not enough to actually run anything + + +Version 0.1 (03/09/2000) (never released) : +- Graphics emulation +- .INF file handling +- Couple of 6502 bugfixes (not many) +- About 3 games work + + +Version 0.0 (24/07/2000) (never released) : +- Buggy 6502 emulation +- Basic mode 7 emulation +- Keyboard - Nothing runs! BASIC is screwy \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..263b1380 --- /dev/null +++ b/Makefile @@ -0,0 +1,659 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. + + + +pkgdatadir = $(datadir)/b-em +pkgincludedir = $(includedir)/b-em +pkglibdir = $(libdir)/b-em +pkglibexecdir = $(libexecdir)/b-em +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ + ChangeLog INSTALL NEWS compile depcomp install-sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d "$(distdir)" \ + || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr "$(distdir)"; }; } +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = ${SHELL} /home/mesa/b-em/test/missing --run aclocal-1.11 +ALLEGRO_CONFIG = /usr/bin/allegro-config +AMTAR = ${SHELL} /home/mesa/b-em/test/missing --run tar +AUTOCONF = ${SHELL} /home/mesa/b-em/test/missing --run autoconf +AUTOHEADER = ${SHELL} /home/mesa/b-em/test/missing --run autoheader +AUTOMAKE = ${SHELL} /home/mesa/b-em/test/missing --run automake-1.11 +AWK = mawk +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 -O3 +CPPFLAGS = +CXX = g++ +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -g -O2 +CYGPATH_W = echo +DEFS = -DPACKAGE_NAME=\"B-em\" -DPACKAGE_TARNAME=\"b-em\" -DPACKAGE_VERSION=\"2.2\" -DPACKAGE_STRING=\"B-em\ 2.2\" -DPACKAGE_BUGREPORT=\"Tom\ Walker\ \\" -DPACKAGE_URL=\"\" -DPACKAGE=\"b-em\" -DVERSION=\"2.2\" -DHAVE_LIBZ=1 -DHAVE_LIBOPENAL=1 -DHAVE_LIBALUT=1 +DEPDIR = .deps +ECHO_C = +ECHO_N = -n +ECHO_T = +EXEEXT = +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LDFLAGS = +LIBOBJS = +LIBS = -lalut -lopenal -lz +LTLIBOBJS = +MAKEINFO = ${SHELL} /home/mesa/b-em/test/missing --run makeinfo +MKDIR_P = /bin/mkdir -p +OBJEXT = o +PACKAGE = b-em +PACKAGE_BUGREPORT = Tom Walker +PACKAGE_NAME = B-em +PACKAGE_STRING = B-em 2.2 +PACKAGE_TARNAME = b-em +PACKAGE_URL = +PACKAGE_VERSION = 2.2 +PATH_SEPARATOR = : +SET_MAKE = +SHELL = /bin/bash +STRIP = +VERSION = 2.2 +abs_builddir = /home/mesa/b-em/test +abs_srcdir = /home/mesa/b-em/test +abs_top_builddir = /home/mesa/b-em/test +abs_top_srcdir = /home/mesa/b-em/test +ac_ct_CC = gcc +ac_ct_CXX = g++ +allegro_CFLAGS = -I/usr/include +allegro_LIBS = -L/usr/lib -Wl,-Bsymbolic-functions -lalleg-4.2.2 +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build_alias = +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host_alias = +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /home/mesa/b-em/test/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target_alias = +top_build_prefix = +top_builddir = . +top_srcdir = . +SUBDIRS = src +all: all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +# 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): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -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 $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | 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 + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__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 \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @$(am__cd) '$(distuninstallcheck_dir)' \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +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 in build directory 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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ + dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ + distclean distclean-generic distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-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: diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 00000000..5d397884 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = src + diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 00000000..15b4e4ad --- /dev/null +++ b/Makefile.in @@ -0,0 +1,659 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ + ChangeLog INSTALL NEWS compile depcomp install-sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d "$(distdir)" \ + || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr "$(distdir)"; }; } +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ALLEGRO_CONFIG = @ALLEGRO_CONFIG@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +allegro_CFLAGS = @allegro_CFLAGS@ +allegro_LIBS = @allegro_LIBS@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = src +all: all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +# 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): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -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 $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | 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 + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__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 \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @$(am__cd) '$(distuninstallcheck_dir)' \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +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 in build directory 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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ + dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ + distclean distclean-generic distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-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: diff --git a/README.md b/README.md new file mode 100644 index 00000000..1e46a843 --- /dev/null +++ b/README.md @@ -0,0 +1,413 @@ +# B-Em + +Introduction +============ + +B-em is an attempt to emulate a BBC Micro, made by Acorn Computers in the 80s. +It is presently available for Win32 and Linux/UNIX. + +B-em is licensed under the GPL, see COPYING for more details. + +TODO File +========= + +A [TODO.md](TODO.md) file exists, with ideas for future functionality for +future versions of B-em. + +Contact +======= + +B-em is maintained by a group of volunteers -- please [enquire over on the +stardot forums](http://www.stardot.org.uk/forums) for more details. + +# Compiling +## Linux + +You will need the following libraries: + +* Allegro 4.x +* OpenAL +* ALut +* Zlib + +### Released version + +Open a terminal window, navigate to the B-em directory then enter: + +./configure +make && ./b-em + +### From Git Sources + +``` +./autogen.sh && ./configure && make +``` + +### Notes + +* The menu is not available all the time. Press F11 to open it, then F11 to + close again. +* The debugger is only available via the command line. +* Hardware line doubling mode and the PAL filters are not available on Linux. +* Fullscreen mode doesn't appear to work correctly, at least on my machine. + B-em takes over the screen, but the resolution never changes. +* Video performance is noticeably slower than on Windows. This is largely due + to the lack of hardware acceleration support in B-em. +* Mouse capture is not available. Simply because I don't know how to implement + it on Linux. + + +Features +======== + +- Emulates Models A, B, B+, Master 128, Master 512, Master Turbo and + Master Compact +- Also emulates ARM evaluation system on Master 128 +- Also emulates 6502, 65816 and Z80 tubes. +- Cycle-accurate video emulation +- All documented and undocumented 6502 instructions +- 8271 Floppy Disc Controller emulated (double drive, double sided, 80 track, + read/write) +- 1770 Floppy Disc Controller emulated (double drive, double sided, 80 track, + read/write) +- Supports following formats - .ssd, .dsd, .adf, .adl, .img, .fdi, .uef and .csw +- Can run many protected disc and tape games. +- IDE hard disc emulation +- Sound emulation, including sample playback +- BeebSID emulation +- Lots of video tricks, such as overscan, raster splitting, rupture, interlace, + mid-line palette and mode splits, etc. +- Sideways RAM emulation +- Joystick emulation +- AMX Mouse emulation + + +Differences from last version +============================= + +- MOS 3.50 emulation +- Fixed CRTC bug when programmed with stupid values (MOS 3.50 startup) +- ADFS disc corruption bug fixed (Carlo Concari) +- Fixed ACIA bug - Pro Boxing Simulator tape version now works +- Fixed bug which created endless blank hard disc images +- Printer port DAC emulation +- AMX mouse emulation +- Master 512 mouse now works properly +- Master Compact joystick emulation +- IDE emulation available in non-Master models +- UI fixes (some from Carlo Concari) +- Improvements to VIA emulation +- PAL video filter +- Bugfixes in ARM and 65816 coprocessors +- Debugger fixes +- Tidying up of code +- Windows version can now build on MSVC as well as GCC + + +Default keyboard mapping +======================== + +|BBC key | PC key | +|---------|--------| +| BREAK | f12| +| *: | @'| +| +; | :;| +| -= | -_| +| ^~ | +=| +| f0 | f0 (function keys are based on keycaps, not positioning)| +| 3# | 3| +| 6& | 6| +| 7' | 7| +| 8( | 8| +| 9) | 9| +| 0 | 0| +Shift lock - | ALT| + +The PC key Page Up acts as a speedup key. + +GUI +=== + +The options are: + +## File + +| Option | Meaning | +| ------ | ------- | +| Hard reset | resets the emulator, clearing all memory. | +| Load state | load a previously saved savestate. | +| Save state | save current emulation status. | +| Exit | exit to Windows. | + +## Disc + +| Option | Meaning | +| ------ | ------- | +| Autoboot disc 0/2 | load a disc image into drives 0 and 2, and boot it.| +| Load disc 0/2 | load a disc image into drives 0 and 2.| +| Load disc 1/3 | load a disc image into drives 1 and 3.| +| Eject disc 0/2 | removes disc image from drives 0 and 2.| +| Eject disc 1/3 | removes disc image from drives 1 and 3.| +| New disc 0/2 | creates a new DFS/ADFS disc and loads it into drives 0 and 2.| +| New disc 1/3 | creates a new DFS/ADFS disc and loads it into drives 1 and 3.| +| Write protect disc 0/2| toggles write protection on drives 0 and 2.| +| Write protect disc 1/3| toggles write protection on drives 1 and 3.| +| Default write protect | determines whether loaded discs are write protected by default| + +## Tape + +| Option | Meaning | +| ------ | ------- | +| Load tape | load a tape image.| +| Eject tape | removes a tape image.| +| Rewind tape | rewind the emulated tape.| +| Show tape catalogue | shows the catalogue of the current tape image.| +| Tape speed | select between normal and fast tape speed.| + +## Settings + +### Model + +| Option | Meaning | +| ------ | ------- | +| BBC A w/OS 0.1 | emulate a model A with OS 0.1 - 1981 style. | +| BBC B w/OS 0.1 | emulate a model B with OS 0.1.| +| BBC A | emulate a model A.| +| BBC B w/8271 FDC | emulate a model B with 8271 FDC.| +| BBC B w/8271+SWRAM | emulate a model B with 8271 FDC and plenty of sideways RAM.| +| BBC B w/1770 FDC | emulate a model B with 1770 FDC and plenty of sideways RAM.| +| BBC B US | emulate an American model B with 8271 FDC.| +| BBC B German | emulate an German model B with 8271 FDC.| +| BBC B+64K | emulate a model B+ with 64k RAM.| +| BBC B+128K | emulate a model B+ with 128k RAM.| +| BBC Master 128 | emulate a Master 128 with MOS 3.20.| +| BBC Master 128 w/ MOS 3.50 | emulate a Master 128 with MOS 3.50.| +| BBC Master 512 | emulate a Master 512 (Master 128 with 80186 copro).| +| BBC Master Turbo | emulate a Master Turbo (Master 128 with 65C102 copro)| +| BBC Master Compact | emulate a Master Compact| +| ARM Evaluation System | emulate a Master 128 with an ARM copro.| + + +### Second processor + +| Option | Meaning | +| ------ | ------- | +| None | disable copro emulation | +| 6502 | emulate Acorn 6502 copro | +| 65816 | emulate 16mhz 65816 ReCoPro (when ROM images are available) | +| Z80 | emulate 4mhz Acorn Z80 copro | +| 6502 Tube Speed | select speed of Acorn 6502 copro, from 4mhz to 64mhz | + +### Video + +#### Display Type + +| Option | Meaning | +| ------ | ------- | +| Software line Doubling | stretch the BBC screen by doubling every line in software. Allows high resolution mode 7. | +| Hardware line Doubling | stretch the BBC screen by doubling every line in hardware.| +| Scanlines | stretch the BBC screen by blanking every other line| +| Interlaced | emulate an interlaced display (useful for a handful of demos). Allows high resolution mode 7. | +| PAL | use PAL filter, with hardware line doubling. Slow! +| PAL interlaced | use PAL filter, with interlacing. Slow! Allows high resolution mode 7.| +| Display borders | either display all video borders or crop them slightly or totally.| +| Fullscreen | enters fullscreen mode. Use ALT-ENTER to return to windowed mode.| +| Resizeable Window | allow the window to be either resizable, or to follow the + emulated screen size.| + +## Sound + +| Option | Meaning | +| ------ | ------- | +| Internal sound chip | enable output of the normal BBC sound chip. | +| BeebSID | enable output of the SID emulation.| +| Printer Port DAC | enable output of 8-bit DAC connected to the printer port. | +| Disc drive noise | enable output of the disc drive sounds. | +| Tape noise | enable output of the cassette emulation. | +| Internal sound filter | enable bandpass filtering of sound. Reproduces the poor quality of the internal speaker. | +| Internal waveform | choose between several waveforms for the normal BBC sound chip. Square wave is the original. | + +### reSID configuration + +| Option | Meaning | +| ------ | ------- | +| Model | choose between many different models of SID. Many tunes sound quite different depending on the model chosen. | +| Simple method | Choose between interpolation and resampling. Resampling is in theory higher quality, but I can't tell the difference. | +| Disc drive type | choose between sound from 5.25" drive or 3.5" drive. | +| Disc drive volume | set the relative volume of the disc drive noise.| + +## Keyboard + +| Option | Meaning | +| ------ |-------- | +| Redefine keys | redefine keyboard setup. Map CAPS/CTRL to A/S - remaps those 2 keys. Useful for games where CAPS/CTRL are left/right. | + +## Mouse + +| Option | Meaning | +| ------ |-------- | +| AMX mouse | enables AMX mouse emulation. | + +## IDE emulation + +| Option | Meaning | +| ------ | ------- | +| Enable IDE emulation | enables IDE hard disc emulation.| + +## Misc + +| Option | Meaning | +| ------ | ------- | +| Speed | set speed of emulation, from 10% to 500%. | +| Save screenshot | saves screenshot in BMP, PCX, or TGA format. | +| Debugger | Enters debugger. Type '?' to get list of commands. | +| Break | break into debugger.| + + +Command Line Options +==================== + +``` +b-em [discimage.ssd/dsd/adf/adl/fdi] [-u name.uef] [-mx] [-tx] [-i] [-c] [-fx] +``` + +`-u` name.uef - load UEF image name.uef + +`-mx` - model to emulate, where x is + +``` +0 - BBC A with OS 0.1 +1 - BBC B with OS 0.1 +2 - BBC A +3 - BBC B with 8271 FDC +4 - BBC B with 8271 FDC + loads of sideways RAM +5 - BBC B with 1770 FDC + loads of sideways RAM +6 - BBC B US +7 - BBC B German +8 - B+ 64K +9 - B+ 128K +10 - Master 128 +11 - Master 128 w/ MOS 3.50 +12 - Master 512 +13 - Master Turbo +14 - Master Compact +15 - ARM Evaluation System +``` + +`-tx` - enable tube, where x is: + +``` +0 - 6502 +1 - ARM (Master only) +2 - Z80 +3 - 80186 (Master only) +4 - 65816 (if ROMs available) +``` + +`-i` - enable interlace mode (only useful on a couple of demos) + +`-c` - enables scanlines + +`-fx` - set frameskip to x (1-9, 1=no skip) + +`-fasttape` - speeds up tape access + + +IDE Hard Discs +============== + +To initialise a hard disc, use the included HDINIT program. Press 'I' to investigate the drive - this will +set up the default parameters for a 50 mb drive. If you want a different size press 'Z' and enter the desired +size - it does not matter that this does not match the size given in the emulated hardware. + +Then press 'F' to format, and follow the prompts. + + +Master 512 +========== + +Master 512 includes mouse emulation. This is used by trapping the mouse in the emulator window - click in the +window to capture it, and press CTRL + END to release. + +All disc images used by the Master 512 should have the .img extension - the type is determined by size. Both +640k and 800k discs are supported, as well as DOS standard 360k and 720k. + +You can use the IDE hard disc emulation with this, run HDISK.CMD in DOS-Plus, then HDINSTAL.BAT. Go make a cup +of tea while doing this, it takes _forever_! HDISK.CMD will create a file 'DRIVE_C' in ADFS so you will need +to format the hard disc using ADFS first. + + +65816 coprocessor +================= + +The ROMs for this coprocessor are not included with the emulator. You will need to acquire the file +ReCo6502ROM_816 and place it in roms\tube. + +The 65816 runs at 16mhz, regardless of what the firmware is set to. + + +Hardware emulated +================= + +| Processor | Meaning | +| --------- | ------- | +| The 6502 processor | All instructions should be emulated. Attempts to be cycle perfect. 65C02 is emulated for + Master 128 mode. | +| The 65C12 tube | As a parasite processor.| +| The 65816 tube | As a parasite processor. Emulator from Snem. | +| The Z80 tube | As a parasite processor. Probably a few bugs. Emulator from ZX82. | +| The ARM processor | As a parasite processor for Master 128 only. Emulator from Arculator. | +| The 80186 tube | As a parasite processor for Master 512 only. Emulator from PCem. | +| The 6845 CRTC | Cycle-exact emulation. Runs everything I've tried, with all effects working. | +| The Video ULA | Cycle-exact emulation, though I think palette changes are a cycle off? Might be a delay in the real chip. | +| The System VIA | Keyboard and sound emulated. Also CMOS on Master-based models.| +| The User VIA | Emulated. +| 8271 FDC | Double disc, double sided, 40/80 tracks, read/write. With authentic noise. Supports read-only access of protected FDI images.| +| 1770 FDC | Double disc, double sided, 40/80 tracks, read/write. With authentic noise. Supports read-only access of protected FDI images.| +| IDE hard disc | Emulates 2 discs. Emulation from Arculator.| +| Sound | All channels emulated, with sample support and some undocumented behaviour (Crazee Rider). With optional bandpass filter.| +| BeebSID | Emulated using resid-fp, so should be pretty accurate. Is only emulated when accessed, to reduce CPU load.| +| ADC | Real joystick emulation, supporting both joysticks.| +| 6850 ACIA | Emulated for cassettes. Read only.| +| Serial ULA | Emulated.| + + +Hardware NOT emulated +===================== + +* Serial Port +* Econet +* Printer +* 32016 processor - though it can be enabled in the source. + (Doesn't actually run anything useful though). + + +Thanks +====== + +* David Gilbert for writing Beebem and distributing the sources with it +* James Fidell for writing Xbeeb and distributing the sources with it +* Tom Seddon for updating Model B, indirectly motivating me to do v0.6, and for + identifying the Empire Strikes Back bug. +* Ken Lowe for assistance with the Level 9 adventures. +* Richard Gellman for help with a few things. +* Thomas Harte for some UEF code - I wrote my own in the end - and for the + OS X port. +* Dave Moore for making and hosting the B-em site +* Rich Talbot-Watkins and Peter Edwards (also Dave Moore) for testing +* Robert Schmidt for The BBC Lives! +* DJ Delorie for DJGPP +* Shawn Hargreaves for Allegro + +Acorn for making the BBC in the first place: + +David Allen,Bob Austin,Ram Banerjee,Paul Bond,Allen Boothroyd,Cambridge, +Cleartone,John Coll,John Cox,Andy Cripps,Chris Curry,6502 designers, +Jeremy Dion,Tim Dobson,Joe Dunn,Paul Farrell,Ferranti,Steve Furber,Jon Gibbons, +Andrew Gordon,Lawrence Hardwick,Dylan Harris,Hermann Hauser,Hitachi, +Andy Hopper,ICL,Martin Jackson,Brian Jones,Chris Jordan,David King, +David Kitson,Paul Kriwaczek,Computer Laboratory,Peter Miller,Arthur Norman, +Glyn Phillips,Mike Prees,John Radcliffe,Wilberforce Road,Peter Robinson, +Richard Russell,Kim Spence-Jones,Graham Tebby,Jon Thackray,Chris Turner, +Adrian Warner,Roger Wilson and Alan Wright for contributing to the development +of the BBC Computer (among others too numerous to mention) diff --git a/TODO.md b/TODO.md new file mode 100644 index 00000000..a4f462a8 --- /dev/null +++ b/TODO.md @@ -0,0 +1,9 @@ +Here's a rough list of future ideas for B-em. Not in any particular order. + +* [ ] A better support for Control key. It is tricky to remap it to any key. +* [ ] Return to emulator after hard reset; currently stays in meny mode. +* [ ] Toggle for full-throttle mode. +* [ ] Add current speed indicator for emulation speed. +* [ ] Write to a FAT disc image for Master 512 emulation. +* [ ] Better timing for 32016 emulation. +* [ ] Support to other ROM configuration, e.g. Torch Co-Pro. diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 00000000..b7e27523 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1179 @@ +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009 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. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],, +[m4_warning([this file was generated for autoconf 2.67. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Configure paths for Allegro +# Shamelessly stolen from libxml.a4 +# Jon Rafkind 2004-06-06 +# Adapted from: +# Configure paths for libXML +# Toshio Kuratomi 2001-04-21 +# Adapted from: +# Configure paths for GLIB +# Owen Taylor 97-11-3 + +dnl AM_PATH_allegro([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for allegro, and define allegro_CFLAGS and allegro_LIBS +dnl +AC_DEFUN([AM_PATH_ALLEGRO],[ +AC_ARG_WITH(allegro-prefix, + [ --with-allegro-prefix=PFX Prefix where liballegro is installed (optional)], + ALLEGRO_CONFIG_prefix="$withval", ALLEGRO_CONFIG_prefix="") +AC_ARG_WITH(allegro-exec-prefix, + [ --with-allegro-exec-prefix=PFX Exec prefix where liballegro is installed (optional)], + ALLEGRO_CONFIG_exec_prefix="$withval", ALLEGRO_CONFIG_exec_prefix="") +AC_ARG_ENABLE(allegrotest, + [ --disable-allegrotest Do not try to compile and run a test LIBallegro program],, + enable_allegrotest=yes) + + if test x$ALLEGRO_CONFIG_exec_prefix != x ; then + ALLEGRO_CONFIG_args="$ALLEGRO_CONFIG_args --exec-prefix=$ALLEGRO_CONFIG_exec_prefix" + if test x${ALLEGRO_CONFIG+set} != xset ; then + ALLEGRO_CONFIG=$ALLEGRO_CONFIG_exec_prefix/bin/allegro-config + fi + fi + if test x$ALLEGRO_CONFIG_prefix != x ; then + ALLEGRO_CONFIG_args="$ALLEGRO_CONFIG_args --prefix=$ALLEGRO_CONFIG_prefix" + if test x${ALLEGRO_CONFIG+set} != xset ; then + ALLEGRO_CONFIG=$ALLEGRO_CONFIG_prefix/bin/allegro-config + fi + fi + + AC_PATH_PROG(ALLEGRO_CONFIG, allegro-config, no) + min_allegro_version=ifelse([$1], ,4.0.0,[$1]) + AC_MSG_CHECKING(for Allegro - version >= $min_allegro_version) + no_allegro="" + if test "$ALLEGRO_CONFIG" = "no" ; then + no_allegro=yes + else + allegro_CFLAGS=`$ALLEGRO_CONFIG $ALLEGRO_CONFIG_args --cflags` + allegro_LIBS=`$ALLEGRO_CONFIG $ALLEGRO_CONFIG_args --libs` + ALLEGRO_CONFIG_major_version=`$ALLEGRO_CONFIG $ALLEGRO_CONFIG_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + ALLEGRO_CONFIG_minor_version=`$ALLEGRO_CONFIG $ALLEGRO_CONFIG_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + ALLEGRO_CONFIG_micro_version=`$ALLEGRO_CONFIG $ALLEGRO_CONFIG_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_allegrotest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $allegro_CFLAGS" + LIBS="$allegro_LIBS $LIBS" +dnl +dnl Now check if the installed liballegro is sufficiently new. +dnl (Also sanity checks the results of allegro-config to some extent) +dnl + rm -f conf.allegrotest + AC_TRY_RUN([ +#include +#include +#include +#include + +int +main() +{ + int allegro_major_version, allegro_minor_version, allegro_micro_version; + int major, minor, micro; + char *tmp_version; + int tmp_int_version; + + system("touch conf.allegrotest"); + + /* Capture allegro-config output via autoconf/configure variables */ + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = (char *)strdup("$min_allegro_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string from allegro-config\n", "$min_allegro_version"); + free(tmp_version); + exit(1); + } + free(tmp_version); + + /* Capture the version information from the header files */ + allegro_major_version = ALLEGRO_VERSION; + allegro_minor_version = ALLEGRO_SUB_VERSION; + allegro_micro_version = ALLEGRO_WIP_VERSION; + + /* Compare allegro-config output to the Allegro headers */ + if ((allegro_major_version != $ALLEGRO_CONFIG_major_version) || + (allegro_minor_version != $ALLEGRO_CONFIG_minor_version)) + + { + printf("*** Allegro header files (version %d.%d.%d) do not match\n", + allegro_major_version, allegro_minor_version, allegro_micro_version); + printf("*** allegro-config (version %d.%d.%d)\n", + $ALLEGRO_CONFIG_major_version, $ALLEGRO_CONFIG_minor_version, $ALLEGRO_CONFIG_micro_version); + return 1; + } +/* Compare the headers to the library to make sure we match */ + /* Less than ideal -- doesn't provide us with return value feedback, + * only exits if there's a serious mismatch between header and library. + */ + /* TODO: + * This doesnt work! + */ + /* ALLEGRO_TEST_VERSION; */ + + /* Test that the library is greater than our minimum version */ + if (($ALLEGRO_CONFIG_major_version > major) || + (($ALLEGRO_CONFIG_major_version == major) && ($ALLEGRO_CONFIG_minor_version > minor)) || + (($ALLEGRO_CONFIG_major_version == major) && ($ALLEGRO_CONFIG_minor_version == minor) && + ($ALLEGRO_CONFIG_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of Allegro (%d.%d.%d) was found.\n", + allegro_major_version, allegro_minor_version, allegro_micro_version); + printf("*** You need a version of Allegro newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** Allegro is always available from http://alleg.sf.net.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the allegro-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of Allegro, but you can also set the ALLEGRO_CONFIG environment to point to the\n"); + printf("*** correct copy of allegro-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + return 1; +} END_OF_MAIN() +],, no_allegro=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + + if test "x$no_allegro" = x ; then + AC_MSG_RESULT(yes (version $ALLEGRO_CONFIG_major_version.$ALLEGRO_CONFIG_minor_version.$ALLEGRO_CONFIG_micro_version)) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$ALLEGRO_CONFIG" = "no" ; then + echo "*** The allegro-config script installed by Allegro could not be found" + echo "*** If Allegro was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the ALLEGRO_CONFIG environment variable to the" + echo "*** full path to allegro-config." + else + if test -f conf.allegrotest ; then + : + else + echo "*** Could not run Allegro test program, checking why..." + CFLAGS="$CFLAGS $allegro_CFLAGS" + LIBS="$LIBS $allegro_LIBS" + AC_TRY_LINK([ +#include +#include +], [ ALLEGRO_TEST_VERSION; return 0;], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding Allegro or finding the wrong" + echo "*** version of Allegro. If it is not finding Allegro, 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 Allegro was incorrectly installed" + echo "*** or that you have moved Allegro since it was installed. In the latter case, you" + echo "*** may want to edit the allegro-config script: $ALLEGRO_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + + allegro_CFLAGS="" + allegro_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(allegro_CFLAGS) + AC_SUBST(allegro_LIBS) + rm -f conf.allegrotest +]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 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. + +# 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. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 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. + +# 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. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# 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. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +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])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 +# 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. + +# serial 10 + +# 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], UPC, [depcc="$UPC" am_compiler_list=], + [$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 + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + 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 + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # 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. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + 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_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --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])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# 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. + +#serial 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. 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 " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/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"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008, 2009 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. + +# serial 16 + +# 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. + +# 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_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# 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 +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])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) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# 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 +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_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 +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005, 2008 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. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 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. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 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. + +# serial 4 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +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 +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# 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. + +# serial 6 + +# AM_PROG_CC_C_O +# -------------- +# Like AC_PROG_CC_C_O, but changed for automake. +AC_DEFUN([AM_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != 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 +dnl Make sure AC_PROG_CC is never called again, or it will override our +dnl setting of CC. +m4_define([AC_PROG_CC], + [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# 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. + +# serial 6 + +# 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 +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# 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 +]) + +# Copyright (C) 2003, 2004, 2005, 2006 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. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2008 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. + +# serial 4 + +# _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], +[m4_foreach_w([_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. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 +# 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. + +# serial 5 + +# 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 +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# 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)]) + +# Copyright (C) 2001, 2003, 2005 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. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# 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="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006, 2008 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. + +# serial 2 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 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. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/cmos.bin b/cmos.bin new file mode 100644 index 0000000000000000000000000000000000000000..35ad0cd8b4f804d56c3505e033af66c52b6d8b34 GIT binary patch literal 64 bcmZQzzyK%z{}*BqKPAV?V7d%L5?ufQ!UzPp literal 0 HcmV?d00001 diff --git a/cmos350.bin b/cmos350.bin new file mode 100644 index 0000000000000000000000000000000000000000..a1d26a48ec62dc1ec69090289f28cefafc93695e GIT binary patch literal 64 icmZQzKmq?4UNfBh|6i0rJi&;AOScI{5|zUY<^li>GX^sN literal 0 HcmV?d00001 diff --git a/cmosa.bin b/cmosa.bin new file mode 100644 index 0000000000000000000000000000000000000000..f712343a12d70d4b9557d1e28db8ee22d86939f3 GIT binary patch literal 64 bcmZQzzyN3e{}*BqI3>r*V7d%L5?ufQ!K4JX literal 0 HcmV?d00001 diff --git a/cmosc.bin b/cmosc.bin new file mode 100644 index 0000000000000000000000000000000000000000..4fa4787b8038f45fe1be1dfd17248c1a2a8a28c2 GIT binary patch literal 128 rcmZSh$MBlr?f?G_4BsCsaB%4~Ffg;QF+c!N5CWK?v;|CnYV-yG4h0E> literal 0 HcmV?d00001 diff --git a/configure b/configure new file mode 100644 index 00000000..c642bb49 --- /dev/null +++ b/configure @@ -0,0 +1,5671 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.67 for B-em 2.2. +# +# Report bugs to >. +# +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and Tom Walker +$0: about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval 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="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='B-em' +PACKAGE_TARNAME='b-em' +PACKAGE_VERSION='2.2' +PACKAGE_STRING='B-em 2.2' +PACKAGE_BUGREPORT='Tom Walker ' +PACKAGE_URL='' + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +allegro_LIBS +allegro_CFLAGS +ALLEGRO_CONFIG +OS_LINUX_FALSE +OS_LINUX_TRUE +OS_WIN_FALSE +OS_WIN_TRUE +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +enable_debug +with_allegro_prefix +with_allegro_exec_prefix +enable_allegrotest +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CXX +CXXFLAGS +CCC' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# 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. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +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 + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -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) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$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 ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$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 ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + 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 ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=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 ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_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'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +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 + $as_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 + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# 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 the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + 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 + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# 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 B-em 2.2 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 \`..'] + +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] + --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] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/b-em] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_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 +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of B-em 2.2:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --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 build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-debug build debug executable + --disable-allegrotest Do not try to compile and run a test LIBallegro program + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-allegro-prefix=PFX Prefix where liballegro is installed (optional) + --with-allegro-exec-prefix=PFX Exec prefix where liballegro is installed (optional) + +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 + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to >. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested 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 + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +B-em configure 2.2 +generated by GNU Autoconf 2.67 + +Copyright (C) 2010 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 +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by B-em $as_me 2.2, which was +generated by GNU Autoconf 2.67. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +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` +/usr/bin/hostinfo = `(/usr/bin/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=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append 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 + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > 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 + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5 ; } + 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. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_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 $ac_precious_vars; 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,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_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 + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_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. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +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__api_version='1.11' + +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 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# 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" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then : + $as_echo_n "(cached) " >&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/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$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' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; +esac + +# 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". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "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 $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='b-em' + VERSION='2.2' + + +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"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5 ; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5 ; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5 ; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5 ; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5 ; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +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 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +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 +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-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= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&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 + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + 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 + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # 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. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_ext=cpp +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 -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$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 +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= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&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 + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + 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 + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # 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. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + +if test "x$CC" != xcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_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 : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 conftest2.$ac_objext >&5' +rm -f conftest2.* +if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; +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' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; + 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 core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != 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 + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable debugging" >&5 +$as_echo_n "checking whether to enable debugging... " >&6; } +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; +fi + +if test "$enable_debug" = "yes"; then + CFLAGS="$CFLAGS -Wall -O0 -g -D_DEBUG" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + CFLAGS="$CFLAGS -O3" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +#AC_MSG_CHECKING([for libz]) +#AX_CHECK_ZLIB + + if test "$OS" = "win"; then + OS_WIN_TRUE= + OS_WIN_FALSE='#' +else + OS_WIN_TRUE='#' + OS_WIN_FALSE= +fi + + if test "$OS" = "linux"; then + OS_LINUX_TRUE= + OS_LINUX_FALSE='#' +else + OS_LINUX_TRUE='#' + OS_LINUX_FALSE= +fi + + +# Do not run test for Allegro with Win32/MinGW version, as binary builds have +# `allegro-config' missing. +# NOTE: For the following Autoconf macro to be supported, you need to extract +# allegro.m4 from the DOS/Windows Allegro sources (the file is contained +# in `misc') and copy it to this directory or MSYS's `/share/aclocal'. +if test "$OS" != "win"; then + + + +# Check whether --with-allegro-prefix was given. +if test "${with_allegro_prefix+set}" = set; then : + withval=$with_allegro_prefix; ALLEGRO_CONFIG_prefix="$withval" +else + ALLEGRO_CONFIG_prefix="" +fi + + +# Check whether --with-allegro-exec-prefix was given. +if test "${with_allegro_exec_prefix+set}" = set; then : + withval=$with_allegro_exec_prefix; ALLEGRO_CONFIG_exec_prefix="$withval" +else + ALLEGRO_CONFIG_exec_prefix="" +fi + +# Check whether --enable-allegrotest was given. +if test "${enable_allegrotest+set}" = set; then : + enableval=$enable_allegrotest; +else + enable_allegrotest=yes +fi + + + if test x$ALLEGRO_CONFIG_exec_prefix != x ; then + ALLEGRO_CONFIG_args="$ALLEGRO_CONFIG_args --exec-prefix=$ALLEGRO_CONFIG_exec_prefix" + if test x${ALLEGRO_CONFIG+set} != xset ; then + ALLEGRO_CONFIG=$ALLEGRO_CONFIG_exec_prefix/bin/allegro-config + fi + fi + if test x$ALLEGRO_CONFIG_prefix != x ; then + ALLEGRO_CONFIG_args="$ALLEGRO_CONFIG_args --prefix=$ALLEGRO_CONFIG_prefix" + if test x${ALLEGRO_CONFIG+set} != xset ; then + ALLEGRO_CONFIG=$ALLEGRO_CONFIG_prefix/bin/allegro-config + fi + fi + + # Extract the first word of "allegro-config", so it can be a program name with args. +set dummy allegro-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_ALLEGRO_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $ALLEGRO_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ALLEGRO_CONFIG="$ALLEGRO_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ALLEGRO_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_ALLEGRO_CONFIG" && ac_cv_path_ALLEGRO_CONFIG="no" + ;; +esac +fi +ALLEGRO_CONFIG=$ac_cv_path_ALLEGRO_CONFIG +if test -n "$ALLEGRO_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALLEGRO_CONFIG" >&5 +$as_echo "$ALLEGRO_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + min_allegro_version=4.0.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Allegro - version >= $min_allegro_version" >&5 +$as_echo_n "checking for Allegro - version >= $min_allegro_version... " >&6; } + no_allegro="" + if test "$ALLEGRO_CONFIG" = "no" ; then + no_allegro=yes + else + allegro_CFLAGS=`$ALLEGRO_CONFIG $ALLEGRO_CONFIG_args --cflags` + allegro_LIBS=`$ALLEGRO_CONFIG $ALLEGRO_CONFIG_args --libs` + ALLEGRO_CONFIG_major_version=`$ALLEGRO_CONFIG $ALLEGRO_CONFIG_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + ALLEGRO_CONFIG_minor_version=`$ALLEGRO_CONFIG $ALLEGRO_CONFIG_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + ALLEGRO_CONFIG_micro_version=`$ALLEGRO_CONFIG $ALLEGRO_CONFIG_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + if test "x$enable_allegrotest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $allegro_CFLAGS" + LIBS="$allegro_LIBS $LIBS" + rm -f conf.allegrotest + if test "$cross_compiling" = yes; then : + echo $ac_n "cross compiling; assumed OK... $ac_c" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include + +int +main() +{ + int allegro_major_version, allegro_minor_version, allegro_micro_version; + int major, minor, micro; + char *tmp_version; + int tmp_int_version; + + system("touch conf.allegrotest"); + + /* Capture allegro-config output via autoconf/configure variables */ + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = (char *)strdup("$min_allegro_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string from allegro-config\n", "$min_allegro_version"); + free(tmp_version); + exit(1); + } + free(tmp_version); + + /* Capture the version information from the header files */ + allegro_major_version = ALLEGRO_VERSION; + allegro_minor_version = ALLEGRO_SUB_VERSION; + allegro_micro_version = ALLEGRO_WIP_VERSION; + + /* Compare allegro-config output to the Allegro headers */ + if ((allegro_major_version != $ALLEGRO_CONFIG_major_version) || + (allegro_minor_version != $ALLEGRO_CONFIG_minor_version)) + + { + printf("*** Allegro header files (version %d.%d.%d) do not match\n", + allegro_major_version, allegro_minor_version, allegro_micro_version); + printf("*** allegro-config (version %d.%d.%d)\n", + $ALLEGRO_CONFIG_major_version, $ALLEGRO_CONFIG_minor_version, $ALLEGRO_CONFIG_micro_version); + return 1; + } +/* Compare the headers to the library to make sure we match */ + /* Less than ideal -- doesn't provide us with return value feedback, + * only exits if there's a serious mismatch between header and library. + */ + /* TODO: + * This doesnt work! + */ + /* ALLEGRO_TEST_VERSION; */ + + /* Test that the library is greater than our minimum version */ + if (($ALLEGRO_CONFIG_major_version > major) || + (($ALLEGRO_CONFIG_major_version == major) && ($ALLEGRO_CONFIG_minor_version > minor)) || + (($ALLEGRO_CONFIG_major_version == major) && ($ALLEGRO_CONFIG_minor_version == minor) && + ($ALLEGRO_CONFIG_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of Allegro (%d.%d.%d) was found.\n", + allegro_major_version, allegro_minor_version, allegro_micro_version); + printf("*** You need a version of Allegro newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** Allegro is always available from http://alleg.sf.net.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the allegro-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of Allegro, but you can also set the ALLEGRO_CONFIG environment to point to the\n"); + printf("*** correct copy of allegro-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + return 1; +} END_OF_MAIN() + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + no_allegro=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + + if test "x$no_allegro" = x ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $ALLEGRO_CONFIG_major_version.$ALLEGRO_CONFIG_minor_version.$ALLEGRO_CONFIG_micro_version)" >&5 +$as_echo "yes (version $ALLEGRO_CONFIG_major_version.$ALLEGRO_CONFIG_minor_version.$ALLEGRO_CONFIG_micro_version)" >&6; } + : + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + if test "$ALLEGRO_CONFIG" = "no" ; then + echo "*** The allegro-config script installed by Allegro could not be found" + echo "*** If Allegro was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the ALLEGRO_CONFIG environment variable to the" + echo "*** full path to allegro-config." + else + if test -f conf.allegrotest ; then + : + else + echo "*** Could not run Allegro test program, checking why..." + CFLAGS="$CFLAGS $allegro_CFLAGS" + LIBS="$LIBS $allegro_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main () +{ + ALLEGRO_TEST_VERSION; return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding Allegro or finding the wrong" + echo "*** version of Allegro. If it is not finding Allegro, 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 "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means Allegro was incorrectly installed" + echo "*** or that you have moved Allegro since it was installed. In the latter case, you" + echo "*** may want to edit the allegro-config script: $ALLEGRO_CONFIG" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + + allegro_CFLAGS="" + allegro_LIBS="" + as_fn_error $? "building B-em requires Allegro to be installed" "$LINENO" 5 + fi + + + rm -f conf.allegrotest + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5 +$as_echo_n "checking for gzopen in -lz... " >&6; } +if test "${ac_cv_lib_z_gzopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gzopen (); +int +main () +{ +return gzopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_gzopen=yes +else + ac_cv_lib_z_gzopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzopen" >&5 +$as_echo "$ac_cv_lib_z_gzopen" >&6; } +if test "x$ac_cv_lib_z_gzopen" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZ 1 +_ACEOF + + LIBS="-lz $LIBS" + +else + \ + echo "You need to install the zlib library." + exit -1 +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alGetError in -lopenal" >&5 +$as_echo_n "checking for alGetError in -lopenal... " >&6; } +if test "${ac_cv_lib_openal_alGetError+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lopenal $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char alGetError (); +int +main () +{ +return alGetError (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_openal_alGetError=yes +else + ac_cv_lib_openal_alGetError=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_openal_alGetError" >&5 +$as_echo "$ac_cv_lib_openal_alGetError" >&6; } +if test "x$ac_cv_lib_openal_alGetError" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBOPENAL 1 +_ACEOF + + LIBS="-lopenal $LIBS" + +else + \ + echo "You need to install the OpenAL library." + exit -1 +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alutInit in -lalut" >&5 +$as_echo_n "checking for alutInit in -lalut... " >&6; } +if test "${ac_cv_lib_alut_alutInit+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lalut $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char alutInit (); +int +main () +{ +return alutInit (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_alut_alutInit=yes +else + ac_cv_lib_alut_alutInit=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_alut_alutInit" >&5 +$as_echo "$ac_cv_lib_alut_alutInit" >&6; } +if test "x$ac_cv_lib_alut_alutInit" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBALUT 1 +_ACEOF + + LIBS="-lalut $LIBS" + +else + \ + echo "You need to install the ALUT library." + exit -1 +fi + + + +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, we kill variables containing newlines. +# 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. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + 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" && + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + 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}' + +# 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 branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${OS_WIN_TRUE}" && test -z "${OS_WIN_FALSE}"; then + as_fn_error $? "conditional \"OS_WIN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${OS_LINUX_TRUE}" && test -z "${OS_LINUX_FALSE}"; then + as_fn_error $? "conditional \"OS_LINUX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $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} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval 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="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by B-em $as_me 2.2, which was +generated by GNU Autoconf 2.67. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + 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_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +B-em config.status 2.2 +configured by $0, generated by GNU Autoconf 2.67, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +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=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + 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 || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; + 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 against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # 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. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_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 + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. 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 " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/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_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# 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 || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/configure.ac b/configure.ac new file mode 100644 index 00000000..6480d31a --- /dev/null +++ b/configure.ac @@ -0,0 +1,51 @@ +# configure.ac for B-em +# + +AC_PREREQ([2.61]) +AC_INIT(B-em, 2.2, Tom Walker , b-em) + +AM_INIT_AUTOMAKE +AC_PROG_CC +AC_PROG_CXX +AM_PROG_CC_C_O + + + +AC_MSG_CHECKING([whether to enable debugging]) +AC_ARG_ENABLE(debug, + AC_HELP_STRING([--enable-debug], [build debug executable])) +if test "$enable_debug" = "yes"; then + CFLAGS="$CFLAGS -Wall -O0 -g -D_DEBUG" + AC_MSG_RESULT([yes]) +else + CFLAGS="$CFLAGS -O3" + AC_MSG_RESULT([no]) +fi + +#AC_MSG_CHECKING([for libz]) +#AX_CHECK_ZLIB + +AM_CONDITIONAL(OS_WIN, test "$OS" = "win") +AM_CONDITIONAL(OS_LINUX, test "$OS" = "linux") + +# Do not run test for Allegro with Win32/MinGW version, as binary builds have +# `allegro-config' missing. +# NOTE: For the following Autoconf macro to be supported, you need to extract +# allegro.m4 from the DOS/Windows Allegro sources (the file is contained +# in `misc') and copy it to this directory or MSYS's `/share/aclocal'. +if test "$OS" != "win"; then + AM_PATH_ALLEGRO(, , AC_MSG_ERROR(building B-em requires Allegro to be installed)) +fi + +AC_CHECK_LIB([z], [gzopen], [], \ + [echo "You need to install the zlib library." + exit -1]) +AC_CHECK_LIB([openal], [alGetError], [], \ + [echo "You need to install the OpenAL library." + exit -1]) +AC_CHECK_LIB([alut], [alutInit], [], \ + [echo "You need to install the ALUT library." + exit -1]) + + +AC_OUTPUT([Makefile src/Makefile]) diff --git a/ddnoise/35/motor.wav b/ddnoise/35/motor.wav new file mode 100644 index 0000000000000000000000000000000000000000..646edb74ebd32f2baed995ae250df9ff567aeed2 GIT binary patch literal 44906 zcmXWk2fWwg`#^}4R>zTfY2_Z>}}KJsNoM%!EOYtp&fvt-B%dTxlf}tT$;xDY@@mpM zc`X^4toQqvq+xP0-WKnPAGY^UaxCeV{2MQd*T?mfiMGu1J&ljY)sn}P$*$Gdoz}(u z;#rP4AGc5LPF_eJNZPnty`)UCi;R2XU2(SLrsVnL_2jAKvE=3?S8{2xKRys&l6)JN zOs-6Nkm8GEXwp6@l5C9k+H(teen>7%Gtz;sxIG>dFO9dxjgpzk=_Ga6yvbYfKzIB* zF6?T#llsOsl59Pa2a|1NJrU;@z?Q-@hkDjcx`-Z(k{8jHRs14#`7FqBe|AbIg%gZ&*IVX1hThFmXZD~x*HPD zjOUQ4a*{nc&7M2yC$}T_#pUVespMf>`@}`#?C}Tjk8y3*JrI9N!hW_cpv~Lp=@G{@ zcdd`(=i|w7&g7b8c+xsK7`Kaa$93Ww?wBK~#T)KU?nt`RN!z3bo$raK#Y^IM;veFQ zG*d6x7rzld7+3dc5x0-K*f)>f$|a?eqV#q+-fi^#`B{miN^-kxJ6*SRTsi(HIv+KQ z=f*XYmwCgL$((p-JR|---oV;_#tCoB;4{aJs#5Z3vNSoGWTe}Y(fneg5v+;J($y3a z-%D$k@u2(2*q)SEk}-)l$ERraxDnivR7+09o#JcaVsULFuan%y-?zk5<45Ce@v}5C zF?YnqHd~JM7e7mz3#%CN^Fj?)|MdRS_>TDZC_4+xV%7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-;*56S>k~aQs0zuSD`L>{K%~*7(zUy_6NK@GN^9A@Y6_qBq7C z@8h{GYTsT7F`I9S=%9pX^h+Pw=^biT z?p&!Acx_f@#BH+NWbju){5{I3%K-7m6UL*ibz;C6b&CB@a_V8Wb3Q;BJ@hN|3HxdJ z(Xvr}#4kOtNMmKc$TC*BK37yTn^!Ex88citp6bp^BbMFTKbO6rZxZl=x3Mrt1;f8;oB^8Ga!oC6N5Vxi45ea?Z)q;W`>0eiF7Yd z|Hk5~@r&H-vkb3%h&M-;s83RLR@?c)LErPN6>p)GxWD(n1?*ILtN3`6C?Dk4#S4lbb2|aK1=$-P$gzd zKW^5?YY^{Uves7TobIR#*I$4$!{N;b(59`H%MQ6-hWQs*w=fcB)mP^NuHNIW*!TWk zc+~)V7vM1N3d$F z@}KVKb1UKIV5v4@f!<`F?TzozTSs^uV_6T7>N6|O=FwQ3X>hqZzDKTInU&;^(8guy zliKh$dfn>O?&4Ydy=%5o&saZk7*8Lf*(JEVf;sXHuy#@lj^^sHQC^)5a=%7-xRZ)iM)ZIY)xc-gKY#e?mL-#O$@$#64PP zIM!Uk+74met*qv1eo%;K50E8{%;$L45dG+PN&TYohWdXteZ0@^dW(XlDYFopJAz&E zlOoPIxYKj({npp-4VCbo`zK-grv4sLdr`6d0lwdWojs|QOQ&O>nws?0(z{~+!tWr? zLFL7+Sh@Aqmy0sr;@Kmi`3=er7S5Oc6Jwviz_DZA8CdWG{yr+sh`sw`uf{9rI?nCO zmtF(2c3`T-{Aj(hf5)Hy;ljdXsO*guwP36+iycU!AATFGD9K|7W$^iu}o3`Sng~_(?`A^rbN$rpWs|6Fs($<6O96M9R3WVo8cMj?&l1(A|R8h`a G_x~TiZJDtE literal 0 HcmV?d00001 diff --git a/ddnoise/35/motoroff.wav b/ddnoise/35/motoroff.wav new file mode 100644 index 0000000000000000000000000000000000000000..366e8b612b553fde221b18fdb5e7003a0fc39cc9 GIT binary patch literal 18670 zcmXBc3D`~5_XqITP=+#VkTJ6;W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@BnPjl%tS-VQN&3WU?&(hHK(H^b);7-S8vaiJT?3 zh)Sx{g^X8=!3Cx4wtw@m76^%(-@&mb#Gx2vkoGd3TS*%i83AmYKouF(oMkfB9{K#^44^)RLXbtvJLe7(u z&<>-x=G-GV1~!Hb;6!)?7O-lw5DtRRK?iV|_Gf*+Gp)Nz zyv!;8K+k~I@CmeV0++}5Tg=WnYuMPgvAcsjybUMefT)yb zuTAJKa-p4g2+1d_n5X`pX{C?Na0gS*BcwHXhnKL7rn6Ylqz;K>dr@n4+u>t+*ad81 z`f(nlv73VvAf2%*>HqaKjy%9)@gjzw`Ao+FWopYZ{}BTcPxg|Y45x@GfF8V~Nz~2s z_&d`j7fM5G7?R%Lx$IWpES1;^eFs<#CV+8FbK^k^7I`17MlX>IWEUwTh`b_?$!4~$ zM_2}<=un0V18Wrp9?-EYYkSCI_SOkx8pFsnJcDufE<^p_q$%yk;w+@S*zPcaZlM1M DBSCcm literal 0 HcmV?d00001 diff --git a/ddnoise/35/seek1o.wav b/ddnoise/35/seek1o.wav new file mode 100644 index 0000000000000000000000000000000000000000..6600a4cbb6c42b260d9540ae1008dec5f2d08cda GIT binary patch literal 4832 zcmWNVcYG8@8^?EcXUp}wBqR_N2)%z&~2Z~z#A)si=O-&d#cifq{O)AMINu&&q!@Y4YyaK<%Ii!fxGrO9}<^i%0*Tx<3 zG@OTnC=LB-_zm6o1Z_p9Q5NcD4AGBhYqbUXDMLr&NelCq*@{X6evnUJqo0AM;E~zJ z>_Y-5#~7>Ib)p6Jk%j}UM8i-=G!*;6p+eQh_pq9`BU>cjl&SLMw z*UVnJl)6jaLantOv58_?C_jjTW~ff&b>xKjiS)0s9qj>6VN-4gI}Z+o)7fWSGyWw^ z19k9yt)2Q%U1>}w3(YGyUk|DlJr93k4#xMC`H{513f}<#!(g4rXz@L%r?ST|%mU^N z=d$d#{pncf8s_Tn*lD@J^g@HAE1iu3g5M0b!4@4MxLTF#%L;+ht7fSQ4TNH zhWY|uFqgs(f}0Oe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2W2l>mQ5+>Uy=II#qqCuF)32>v{{Y*O)D*^%UI)Q(>ZB zTz?FsA!_jUekD$Aul0oY^!JA1U_z^)0}Sjl0UeJb=z8P2$AHdyA2?W>p_0aXPpHqd zO8PADHPU5*dQUyB^?@yn-#T80;P@Yb5~u~Ge8Anb}t5p^<%I(jDZ%T zi@j;M1MjMPRFC>fyJRq!rNJvbAD+|}ss+jy#jV~@D;jKSW38;#M0=oZHx#}#Mz8yq z(UD|=Z@_E(HaC&0NLM5XYJnv>p(XoHkY9UD!$gUjQfo*Z=kZw*a{S%K%~kyZ<}?0srX!9RH2~ng8+s R-T&YJ%>UZ|$^Wna!vBDm`Sbt) literal 0 HcmV?d00001 diff --git a/ddnoise/35/seek2o.wav b/ddnoise/35/seek2o.wav new file mode 100644 index 0000000000000000000000000000000000000000..5fe583f26965d3f052d5ecd4fdf67be2b674db25 GIT binary patch literal 16382 zcmW-IRd^Li*KWISjRC>k-GkfUI=H*LyIXJz?!)i_!5s#734y_3aEWehx2n_sdHNz3 z+3B6GUbX7A)wxxR7D__|>E5_o^I>DB6!szrf;v~TR0LVk14S^ziwqe!W#GTgXFeib z(TC`LbPYNV{f2x&2y_s-70p0dEFPKc#4rN#j3B!3nwM&6ga4)hS9ftkDM&eiSL&QZgmAXLrsGdX{>@<=LPXHW9_6pD& zu1D6RE3qng5>DfO><-ckwgB_(LUtwlmhA^YP!rjURU&!D&Hdtra57VjZa~h(d8`3) z+0M~#$R8v1LYsrn!f|q6J=q!x6i^1ai;bZ_3LCuJeYHFsUxxY@9SIqvE!GXk(VymN zb(6ZwOhh8cW_z%9RsCir7=!<06MT2#>nGIm1?V>*tS>j*upE&<3sgF~#@=qa z>>cPB>MT2ttH+EXlF%(M9i~A7oHA!?Zl#>OKx!n8jQXTLdL~+jd+sUWU*+rWOZ4B0 zsSTcINb)+7Yo zF?1r$F;VbZtt^d@I;yzU z9ox*-^`4KN8TZiFmfwz>);q0|npdl*@6gYye~Vv2%Yu)>?UkEgC0)jI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QR!vha?VK^eY64or zbxy|73$iU}cKrYDcN0fz`epj8YSwIPw|xRsMjjyJkwY*)2snDkE2F-X8-8NUG8bB2 z`(L}Pv$t|UcX-*EE&c~_p?{#UPS@Q7(ygP$MLmz+-C2{t<_)VW=nA_a3bF=$i~YiX z5NnACPMWC^a>U73jj~7B-9b0l0hx-LXiaPjb`(>vt$1GI8BvVtZ~fP z<6zQPpegbU`HD0`YQd+VDwqIXfhPcitDO}{aq8iS@aR7BXOKa=A*~ctl_BXGZ56m31 zsN?Ev(P6JyryU%e$Np>& z1R-z;R&Ww$lh8TNs!nn0;R_fFKH9JBllBuE*t_lN_GbHlecMTr#DO)S0W5&@L>FMr zL`U$;Ymvpsqr?|H9V4*zNCp^Z$2pS)U-g;#82!C&7@w@IU@US8&5z~BUZDlh zxkxP1*y)#lfZ4Wb^|YMSv*os9!3ekZeJw?P(V`K)&~4G~30{H{umIcwuG$~0QPwtVqevc&Fa|Dy OEuaayfdb&3{r>>vHlm3D literal 0 HcmV?d00001 diff --git a/ddnoise/35/seek3i.wav b/ddnoise/35/seek3i.wav new file mode 100644 index 0000000000000000000000000000000000000000..d6562b79a0f5fae14af290b271be8e0f0a3499b8 GIT binary patch literal 42530 zcmW)n1#sI4w}r)E8RBr0Hcc_bEp3^ZyJcp^E&pX^W`->@H)T$lnUgde$1G;)Y2J7| z6Hj7!BFXoj`<-*Uw{O!X;RFEmY2Lf_=t(n@BLDyZtw*bK0I<3*2tYstFml+8VZw0$ zIIUgL4r<%1=WK1UHcvaDozgyNZ?u=1p*_{^Xc^YeY1%pMo_1Y3Z~g9!mZx3S-fJN( zU-N69v@e=hyR3cG4qL}~rH$5pY74X}*0C07soF-(V?8%$XSKoFZf%zJ7jLy(?JvEP zend~xkL%0y=DMM!TkqeY{ZB)*Rcefisi2yyE>s_?O|8!@r(f3_8P|g&SV2U&X5OFr|zdQ0rJ{ELFd295%-Q ztAOFaWV63vGe#S=&3K>zFxTvAtkr+&w+zYL3;u$3LMYhF7^~I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3(36vT7m;od<-OVH^rTiUEQwKRjMj$mCiwlV&axRrm z77};yVRd+&$_&S=HIAoRj-OrEh0j!1D5l8GDP$sF5sB!ow;UZ-m#UwYM#?!k z1-J+yJ^-JK&!0 ziVb)IFcv2&K}a=3N*DAEzKs)!VqgX2VFd2t{-leXM;)ZvP)o=gu+JgHF}P34Ntpyj zC9xi!KO^vS{D8aMy+T?^W~E-Hg=qu)U5dzJVV#(^c`i3`Lr@-J!$-J1SDkrYKPgE^^%qZ*07M=R77 zN;l;{<+C~i&w^_2D`FUApu9n`$g7HKV*~^jn9*m{O|ai1>Q_K|TZ$(TTOk!b2WCn! z%)MSX6F6j1=rzwLcw!(Nd37=uu4n;10xpSq#2R8LF`FpDo$w3P8W~X))DbN~Ly)Kz zLbRze*I++4@k=~_=t_Pd zw@@d6R3gD$m=7~74ef+6i^Y9#D*OZP6n+O>H;fMfA&o?nR00TJL(~M+0``AHZJ=IJ zZYtlYCK$u!z&_2vbMT*#X{aMigd6_nal8@kU*M(@o8b6o5Uq$$cpGkn|3f9nfs^3x z^+YAY0$1?~K8*)Ly&{D60xSL?I*sb!zVM8whHs)H=m5I&e+?e~5w1;h;uKECHL(Sh z8U`YT*i4*&EVJuGK2e3tCUfD8^2xW5cD)U#v`J)u*hwrStVA;S^!9*T?s6|Ap5{kHzRw)JZ?=a#5++$y`=sJqrMS6LmeTT>>J!4{|`i&KAr#o literal 0 HcmV?d00001 diff --git a/ddnoise/35/seek3o.wav b/ddnoise/35/seek3o.wav new file mode 100644 index 0000000000000000000000000000000000000000..c208d56d1cb69307e2e600caec9e5da70a822015 GIT binary patch literal 42358 zcmWKXWtbCZ8->R;6ImB_ao5G&ZE-2Zp}0E~cXxMpcPJmOg;Jon+b%0{n~du>*Zjzp zWRmgsea?N((=EGo>+wecpl7q+TMZvKwU`qC0MJ@mo&kUry+8m0oWRgQQwO!P*69fB z0cHckfd{}U;2LliI0U=|Hd?PIfGxmLU@Nc-IBu=68#oBe0tN!(fyKaNU!1~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Knv3XoPlWmswZxkSxP9B=e_`{m`9zLN24G-I&}# z&9Mu+Pm}2}C>GBdKN!Wv4D$n;f!^sRvX3-`21!MZK_fix4Rg17)BF>xkGbY5vpf8) zlkkaibS15V*KNnR-bz9w89MuWZP5Fj zGLM0dvkSVvk3qyAYCguUCX1e>U*P%c(pwmb&FEt6O@5>0^dWQ?yXZlB0AF|0L-2S| z`Wa3{L&-WkMv*c$7tV%atO(<=TJ*tuc+1>wF2G}ndD?uATG>|fu6f_=3XgenjOL5% z5B33T&b)Z`1L(xaPq&8Qbdq%F3_eguxcgt~y<>5Y<1vdfDL}&!B z;tu$nc84=(4(3af#*kXsoe^BIB_MNF#$G=i^rc?33ch#JZuC5Dhbz#O3@6#-7czlN z#5(CA0rn81`8eB*Id33dO*(w9=kT6A)DAYtQM~R(I60)#aZo>Or=#d+RH4=Jxg5cj zj4&suMP9+3^q8$+Gg*D`p6<|NG)zTS3!VcC3hJ-epIks?x-IL9juVvs_=zVpmDw?3 P9UySl#OyrL%rO5CU08^8 literal 0 HcmV?d00001 diff --git a/ddnoise/35/stepi.wav b/ddnoise/35/stepi.wav new file mode 100644 index 0000000000000000000000000000000000000000..71344771ad2c135ea69bceb7ee5d8669e786c0c6 GIT binary patch literal 4212 zcmW+(2Y5}{7Cz_Ro8+dEAVi2D7~NBbXruQi(R=UFqVopB<1tzoy~m6;5{%IqhS6de zy+sX?h!i);ZRhO0*4l4<@7v$K->rME{jatD|6jekbnG}KMAHVe>EB`e)Y%pJrKa<0 zpQ3522I`tc3(>}onmwvBe?eG=s#0?br3O@vno&)vO<@#F)%cSb%Edy=#QT_mA5f9G>3U0;mIFR2B#D3TtCt!aZf-Nx+AHoqx zfuj(Om(fb~N#SeE!?#$1Y}A^%(_)%R5tM?hu|D>}y6Axcuty$|hh@GT0TW;eoP;e9 ziK7wmd%8mB=qw$i2eg&q=?Mm4AVkZZVzYQEO3PsRP;?iuVvC5E3*bE-p?YdMuORg& zmEm7s#Z8!lc4|wpeCtr!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YG+{)29?%ZwMcYUA@9EN>xich!)ejL|Y{Dd9pTk6HL>}zy$PegIu zcIDUGxOS3Rzpk*CTgZL29mlX{+nHSw@EE?wK)T2H#bH<0m9|{NLm9tN{D=8Jm2a{O zD{+RFa@CwD)x4I*5%MhMY|AFT01*S1#gK!3SaB)WUF}@oNo2r97hon__Q!zWhZzSsi2U>)pdT?u9Ux^YYqT=iMt1{cI| zKgRJr!|@FF#S(~x?#$V%*=a<>b-6|km-}UbYzp(3TiY_)k7XE?f(`JL|NV+F-OS(g zf+jEuhB2f0vDW=8SIH!KiG7QZZhjPU4~4_e|JS`DR)cs5gA93I-j`*WS*Ea_^nn-h Jdsdu{@_&M%>G%Ku literal 0 HcmV?d00001 diff --git a/ddnoise/35/stepo.wav b/ddnoise/35/stepo.wav new file mode 100644 index 0000000000000000000000000000000000000000..ada0ff33ce5760e87ad7a9b0bcfdb1e0bfadd44d GIT binary patch literal 2226 zcmWMncT|*j7X5u~z9|d?f`A24M8Q?;iY6F!?cGJhiot}np-2J-V?#g%MUAc{#=1I| zhzhtzUBhB;iDfNdmbG9I92taRhH2mTtC{o8JLmmz&pYqk_s+cu6UL4$)&ekVWYU;L zE3!HV001~&j6M%Q;cO1@AONH;%v!j`huKK;=ql<@(})8v$E7F$GDxC-yb5M`rIXcLm~Av}k4pr7bfc8n#{Y}^w)L2F1jD`T7J zHFQ@sEAx~*^-Ej=Dy8+h%Z3?#6Ah`l{+g#;6HZd!c^%$eO1k%^>#8H#KHP4#n;mJ6 zBKv)NZR;)XUaHl2^(lt=+8pVw)Jyl3|D3?M0Dr?}F`hBR)HBL4uk4xQthTjS<1IP$ zfB#U_aH%QH(Zw4_J8AyspBQ>NJg-YoWKqPA?K=hM`q_ld>hWe>ZSqV0N%w~xpJY`H ztub1yt};$ArF6)Q>KIeeO^lctl54D$MuU5}D_ViJqaWd7Rj>X5|H7ihYHe>ry1rbV zB|M`x=<%kz4%r);e`tzmUTqs}Z*&}UF(s2;5tr+inhpl_3%MG)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5L&m;3mo^OkG^sn?KO<{^}i$pLGTwsc?(*cr5wv)@`H?oe5@%eUVa*Q0L zzK(s<65~AF5Bni-N9ORgf@|>? literal 0 HcmV?d00001 diff --git a/ddnoise/525/motor.wav b/ddnoise/525/motor.wav new file mode 100644 index 0000000000000000000000000000000000000000..856b362d521fb60c7d334468899347eeda33b3a4 GIT binary patch literal 9440 zcmW++1z43?6Q1*7cXuOTx31kS7^v8aEuvyzcXumxH+HSHcCWZ9c8dkO3U=M^%*_A# zKleeec)9n)%v(cXqx$t96eMa>E2v(t{^9x35s|^8KoC*gT|^G0qaIzuyB@-8Do`>r z+#E0i%|v>tJGH0w)<3DKli=)hHke-2O^54Z?W|)pyS|c}vR;nM0!gkJX)z_xI@+X9 zWr$SO)YOJ{({}nq-OUK&Wromq4bUUnhmO-{T52{pUT*a1!STmlJb0u6J)Ng)Bt&A&)IE!Oh)KNJs_QAvR0;o)J*@D zPC83tr8~aYKx#@HlU$aKQb7g@VMSf(p?;F)T8=uBt7Yi04wM9Dz9qNyK6ZOpCWy!t zdBOAeBCnNVYBUb}tFKk`wd|L{a!ju1ZJK84n>utvPiPPY8kY`|F|TPBjin(plg^OR z0&~U0;_HBE=`{CBo5(+r>*eG1%PcfwowQ#0ojbIjHqcp(k{n{WA=Y?Ve548gXT8{w zJQBsFWHg_&_w87_)6L_?xxu`MefhqvX}8#B+>=N0K0YF~bf!+z!n#*y;##|zbta`V z)+y%Xa9){B9fTWKxTqFa)S&)Da@Ml#D)&c^TUT#1tma?}>Er)?M?7ax7W zY4{xXmZ!2$d+B_sFU=(y&kxXFl!u1uO^u>&bQ!mMjs7%;oypF36H5hj8mhrt$7vVM ztG>9=aavZZ>3bcmNo5MpR=VBFJJS;SSih}@7m@`%SvZM}@jX{=t- zQ?}qVzGA=0xvGTeX052nD8K}offS6|Tch)688xO=er|`_@pdD3k-uf7T;i`hSN@W&a-K)< zGXBQRB^kbZn}6{JUToF}v@2P+pKpFI^tilRD zX=Rp`7u!SbD)+H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zV|1giER?!6vWG}}!VbBMme zkH^AIorf;>mHc>RLokH5c9K{Q#>};~Uco(WM;h>!D}z~6;Y?2ed2?ePU*1k~#mxq< z{17MJ4Lpz^J+_-&q!A@`Dm->3eXcE_3GyQ=KWcJ1L3qqC3}=}ruC8G^># zODQP~8AEYswB^vsQ-CO|OgXTa!Z-NgU)7NZ&Bt%GTmTwGY zzdceIF7Ac<-E+}X&MoP-bys@E{p#`S(62V0L!KFK8BE{CxF6g!$e^xcLVJs+A>&x5 zbujJNhCD0KDeslS>#;N3x#hUdWpkKX7(CMzbP5$MDOdSlL-Q&fnO!{s%F zFRcju-pk4F6vA)q{GJir)@uOC-AIs|VA|6VbAn>vu^wQN_Lzc>!|n&`F)73bC%PFq zPrQ2$$}9&Tvme~4BT W^1x3uLJgF~ySBqDr2{&l5d9CR3Gp%j literal 0 HcmV?d00001 diff --git a/ddnoise/525/motoroff.wav b/ddnoise/525/motoroff.wav new file mode 100644 index 0000000000000000000000000000000000000000..18be0c0b6d15c6d99e25d5a6396f9964e822c501 GIT binary patch literal 17278 zcmW-p1-KPO8^>p6_nb=!(nzO(f;5PTh_rM_igZbLH&TL>ARr(jAc(XGNC+Zbq9EPf zCERm%C%zxw!}H0#mveV#XJ_8`U-LDnQMKxTN=yP9w}$g{Rx?P?2|o;Pgw^zka7H*g zJREKan}i+0c(5Vp8s^k(bX$EzPcmF#S<}?KYx0^mO+PcklrevB-2wl<(b=Sg;it;2!gSK;X}Q7}_x}Pa(M(IqtoqnKmn9(M!ePGt|-(zO8-lwmaZ1%eO&HQPS+Ue$n z-k{g$9;Tg5?XtSf_P*(8j+w=#mT6<=n-X@u&FRkCZf1d=uRkz5%_K9=th0&kj$38- zn~rv!^=v1*l((ToK{431aBsLwZmG*5PP$!goh$2-yZ2n^Ub@Wgx&4{75w}llMYq~6 zx39a7wx}IpcbkDGzs+Mm=dQ_^!Pc&!$SDtrd9Hz*ATEeJVupAuYKi;q12IL65qDXw z9c4pxQU+qE7~tx-uf%d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c70)lUx2W4Qg6?4y6-q#VwWgKJ)Q~&OGHcRj+VWOs#T3$ z@HPFq1Usk)`!&k>eS8j1>@5VZO~t2)o8^2aA830J`cxy3wc$i-GZOTZL`~NORB_Ob zq9#wKh80D-EJ7X40z+FRioq27!W3rUCjToxMuUA5e)1=NSOZy8zD0g~miMmL7Tq@` zYW7ojLwflD1@08Pb*LL9s*9BL|6g&b-s0TX9TGa2aq3-8kRL?_JTCjHdz_%&&bjH* zWZ1WQ%ka|YkVWr=x_pT&@^^9}e)L#X3a9-iRT*yhToy%>UaD5Y#d^S6-jJC|2_+Xv snTf8{-!!iNE5t^sColkKc5?!Pyhe` literal 0 HcmV?d00001 diff --git a/ddnoise/525/motoron.wav b/ddnoise/525/motoron.wav new file mode 100644 index 0000000000000000000000000000000000000000..0cdfd919668bee03b77a271702a6097100741532 GIT binary patch literal 16352 zcmW+-19)6p+ueH~%uJHnNNppvZTr?%YWLQ*ZQHg}+vcsCHVtOxoUMO-|C8srH%T*d z&g}DIy=$$vX`PxipI0KJRh5=Cdh{EbB`G0<;wxKALaOf}gps7ATj!yjkKk|KtLJLA zJ}K|XJMyM{p^~YS^0r*62C46IxOysEsp4w5ETXQ6mZE~JE;q@SD!cBZTIwjBTt8MH zRCnph%sQ+3Esx0`vV{uQyVV(0N)=EMWV$v;d)-0p)uUuiQA=i41$9;ZSw0u{WG6YE zr{|gvkt?JnOUu9NEGb1&stEmtOw!d2UIf93WQ+rG64g50SxgHh;mZi{s*}Oh>lR-mDB`B$b*e z*Nc%nv$!Ou%E9WsZb(wo12h*i*>$#o%_c?lVpU5W6D*QBZ2pgk76;^6 zm0Y*h*Yz+RFMFxmq&B^y*C<;z(5KXDao;845HIH5;UVgcO08ze-TFN_M|$C_D{V-} z=%-?#Sj9`ZKiy1x65g?{$f;)0Fe99`rBBE}{Y=gh>v$YL#nbSf{HUm{{#A|iReg*k zq8D{D-BE?Be5#7ZLnU)`ZPj0GlJ~`0F-N2k%fujcNe$IkbOl{Q?<0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nj2Y%hE8HGv-Zj=kf&XQ!HXj+gjSSW^a|-+qSKttNVBItunu+lJe`ayq VUmkNA7?@LV-<>dDV;3!+{vV}y9Pa=C literal 0 HcmV?d00001 diff --git a/ddnoise/525/seek.wav b/ddnoise/525/seek.wav new file mode 100644 index 0000000000000000000000000000000000000000..41ee9af2a63049b01aa8f8893f8c72e38265fb9f GIT binary patch literal 6558 zcmWkyb$Arl*PglKcV^b38zV%303i@4?tvDE;tg&=iWMn^;6J34kW$>G4N$aLDNu?u zxTRPU2yst#H=C8&(Qm)!KF|Cy_dYY{oO{lD&ijt|s$ai7AqX<2*XWd)-!6$VAP9o` zSM+EE>3a@A0AfIsPnTwae|O+g#bX>T%s-+k)DKbv>QC-OYXT zecRoFXOP^Ppt%`TlKjM$YAcb#RHeaKPM2PGd2rraQ+3Mzd)<-pi}gJm5mo867d>|2 z5BDNlSXFexF)$w8?96ODFSe9a-)X@p0qlGDj_NBdX#}27sR7MHf0D0?Io>R>95luE zf;8o=Ev_obUgnNzJnT`Z!7xNSr@kP(x;CZ@@E7cN)ucrs&y_<$TYIB@MBR6vGE38? zD`ZzNTB!2Ys};-!U2ob=Ej33qVdB!Ft(IZBBcT%_(ky>*NrnnOgd|8oPO<-KyWn)X zp8G7wBSNDG(iW;eK1x|9ZO}+YZ$1YvNhR)9(s(kR8AP_yKKtgYt+jG5i85xd*ealPQylaHd92P+CAllRtz@dowTNs%e}hp=kkFS z|Jcerf_T6;S-g*Iqi%Ae`2YCR=JCPX0#_S`={K9Q&3Da|VZXr{P#e%IV7LXE(saAw z53Gk@XzFd*XgZ-^!oTK+GYg0wARg(cB}@N`_r+auoR%g|bMuW49haOs*8qIo+R{ zKsiYrHHQgc4&akf6LLp;f!MU!NK^C$HlG|sk7C+DztLh~ zjp=%t+YLF2CPq`6DKCjo-&4U%4`w;!I7Bx|_dPd}wKD?zkKF~I!dI+~6Sy_(3>JkB zT40_+iSMr`^_TTG4d+e4rUAzD`X68^KZr+{RG`5{WSeU-pN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4hXHpW%3w{M^3ifF}>A7d5EQ-WrHOoAlrJ#qFU!#uUghxo`{cx=E5Z0 zfkX?@!fmoiST1DZ4cHDY@IPQZv;%en7P!ca?cg(?0Uv@yc-E|N6FAT8)JZU$?`JLe zIewQdWy{$f7Q}Omx*YQ~c8m9A=XhP7N)NISmS!Zd^K_P>8h}sWYgw{!N--9r!$@4*=8gFDeN z6p9IXN*WRe882>-u9&L6QJ7-R>=5EZXGl}QD%>)?*d^0@4j}^&gV#*vEgZYMaq_JO5(>80>_3hd&ZL0oJ{Zai#jn)$N zO09>UPD6~ZjZVyKJf!dGJ)_77=i9l3-{iabXCT4~kOI%cW5@+3;3arDS^%%{a!|rW c^DPpuFi{e~_b}Bk=o=bEljsk|BD#eAAE`Mu4gdfE literal 0 HcmV?d00001 diff --git a/ddnoise/motoroff.wav b/ddnoise/motoroff.wav new file mode 100644 index 0000000000000000000000000000000000000000..0b9c9afd30c88c17786dc8b0ef6453b9fa76b2fe GIT binary patch literal 5154 zcmW+)37k#UAOHP+=iK*Zd2d#;$z+elk|asiELlQ?LB^IW4ap1<$%wIMX|iw0zNILP zCHtNv*%A_>kzvNH@4b7^|J#4g=ic|`-E+@x|NfRPZCkf4TZSmPdG}U>hL5TcK}3wz zax2mF9!x?JG_e1u{zcJ59z2M~#oUlhT-rY(qtOm%9M}sEJZ#6g$&Sm7ps}nmzN|_;>6*y@`xXEZTaudD|fk& zmE?kNKZlE-@3Y7y&VdzX@*wVkl?HoF;~^ZwxipwQq;>R&+QG&h`6kV$>eQ3=Q$G&y zw{llj$*b~&+ewV-r5jo2tV7nj)^zKJ<+tWr-K{$KzR{{>HPx$CIhD_Tn##|*GQC|Q zb3GZ-&%eABK>%nEx){(zi` z|K2OO7fqAEH%fyJh)l#B6mYQ+N1^++Y==|$mh8b?v2pr5p(A)kBzBP6&K1XqZtwm9V=|xGUNBk*vs6ETK zqi9dz)S{t&UODgPB>$@(9eTJnr~1RpN28wTf&nG@c72uL+M_Qz zGm9%eeXh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Nej%+jA7( zrwjBOI35o_nLusnV`@N8%`TIHS~T5!YG#{F=B(LmPC#yBUWCLMko+p$f~HzvQu98) z#{)2xIfS{zdB|}dc=H&Us4IH?H-KCbavF1)|E4E9kwK>LIK)OOzsqg7C3M>mUUQ0$ zz+aEUOQ(W*YpRU-P%u(&dFlt0IEdP+7RPZ3?7R`)JPn*~gdg9-dWNgvoIa4_b$%Hh z_&RLX1D@vPP-OG&u=)zjb+$tLrSNAz$H*PnKL&G^M$k+Zd4SnWUsyeyDTEoMdpdS72NeL>_8khj}l`wc+ZB+B`;2tH%;br4tm9F4%IwF4osEb_T F{{gf1*kJ$w literal 0 HcmV?d00001 diff --git a/ddnoise/motoron.wav b/ddnoise/motoron.wav new file mode 100644 index 0000000000000000000000000000000000000000..ccb9a201d6caba9bd72d5f4f8042c9bc26b3ccd9 GIT binary patch literal 4480 zcmW+)2Ut``w4QTj?skw4QpAcu#b9h$5(AcJiHc%Nq9##95xby>U85+9(G*Lf#tIsH z4H#p=7^B!V2qH#NL=-{lvb%Thyz}07zh(JmXJ_V||3ClyXNM2y*Du+fvC)yE`o>L9 zZ0g1s1A6)#W^BzEV94B9>^F(ujG#HKpaXmaZJ;%TLO3MAKzhx9cu4vG*B00U`S1iB z&;>t06}&JIyI^0OjMH%lc1MP;*qq)M;8cvmUMTQ6WWzZ)4#o7;zzeuSD=dcP5J&IF z;0^$~(DNUhhr2ZI23Qbr5Pg3(uD}TV6hrW1{0hh5cQ}rA=!uQ75q?G^tMDLh$6c6+ z?XfAo1`WDnC;S}yV>2v<{jd>M!+babCuqk5u#`^U3={~4b}$*X!9F_CU3dhA;EnCD zH;%@5T!}x>a~yAD8G7^fd@hgW@w_!J!LvArPB0c1;XZta1{%x4J0Rs+*%97iJRi)% z_*vOg?ci($wS2pb&)!nz(ovbgvFrHil7h?|;Wxf5 zSS~Z${@S-F;$O?Cr;o31&pTwT2>K&@bm$Jlh5yE1iacY=i7s8+;{G>h**D1T* zAhTa}-McmoyY*XrcQ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3``^_ZiV+g7rJrQn}Pg3U|3X<*UD|!J!hv_W*%FfTI2R^!vf! zz#uOMM)ZJbhi<9De;EH!N;KuKT=<6eQuX@VB=N18jGez;cY?~jnn_7^2PY{Jl81;}G3BO`n!_xd|aC&8?tvLJ0jbX{2)}t58`yl;Pdv zZg6yV;GLgEQ79-Z5M9q+p!HT8D{uZKCP3i_b+?)!H~rEwGw@CHbg6OwZYS$_A(3-X ze4v2ljiit?+Sz!i1^g1Em>Z1ar;k9V(<31$87((kS@nLk3jhqgQLRSHIeFk$z5q+; dH~-%%{|Ci8DkdN3vgZH*002ovPDHLkV1l0!;Y9!d literal 0 HcmV?d00001 diff --git a/icon/b-em.svg b/icon/b-em.svg new file mode 100644 index 00000000..1dc3d4bc --- /dev/null +++ b/icon/b-em.svg @@ -0,0 +1,152 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/install-sh b/install-sh new file mode 100644 index 00000000..97a459c7 --- /dev/null +++ b/install-sh @@ -0,0 +1,519 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2006-12-25.00 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# 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. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # 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 $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/missing b/missing new file mode 100644 index 00000000..ff1d5cb9 --- /dev/null +++ b/missing @@ -0,0 +1,367 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2006-05-10.23 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 +# 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., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, 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=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# 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 + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -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' + autom4te touch the output file, or create a stub one + 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] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case $1 in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $1 in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + 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' $msg. 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 test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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 test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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 "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # 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 is $msg. + 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 prerequisites 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 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/readme.txt b/readme.txt deleted file mode 100644 index 8782df30..00000000 --- a/readme.txt +++ /dev/null @@ -1,366 +0,0 @@ - ██████████▄ █████████ ████▄ ▄████ - ██ ▀██ ██ ██ ▀██▄▄██▀ ██ - ██ ▄██ ██ ██ ▀██▀ ██ - ███████████ █████ █████ ██ ██ - ██ ▀██ ██ ██ ██ - ██ ▄██ ██ ██ ██ - ██████████▀ █████████ ██ ██ - - Version 2.2 - A freeware BBC Micro emulator - -Introduction -~~~~~~~~~~~~ - -B-em is an attempt to emulate a BBC Micro, made by Acorn Computers in the 80's. It is presently -available for Win32 and Linux. - -B-em is licensed under the GPL, see COPYING for more details. - - -Features -~~~~~~~~ - -- Emulates Models A, B, B+, Master 128, Master 512, Master Turbo and Master Compact -- Also emulates ARM evaluation system on Master 128 -- Also emulates 6502, 65816 and Z80 tubes. -- Cycle-accurate video emulation -- All documented and undocumented 6502 instructions -- 8271 Floppy Disc Controller emulated (double drive, double sided, 80 track, read/write) -- 1770 Floppy Disc Controller emulated (double drive, double sided, 80 track, read/write) -- Supports following formats - .ssd, .dsd, .adf, .adl, .img, .fdi, .uef and .csw -- Can run many protected disc and tape games. -- IDE hard disc emulation -- Sound emulation, including sample playback -- BeebSID emulation -- Lots of video tricks, such as overscan, raster splitting, rupture, interlace, mid-line - palette and mode splits, etc. -- Sideways RAM emulation -- Joystick emulation -- AMX Mouse emulation - - -Differences from last version -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -- MOS 3.50 emulation -- Fixed CRTC bug when programmed with stupid values (MOS 3.50 startup) -- ADFS disc corruption bug fixed (Carlo Concari) -- Fixed ACIA bug - Pro Boxing Simulator tape version now works -- Fixed bug which created endless blank hard disc images -- Printer port DAC emulation -- AMX mouse emulation -- Master 512 mouse now works properly -- Master Compact joystick emulation -- IDE emulation available in non-Master models -- UI fixes (some from Carlo Concari) -- Improvements to VIA emulation -- PAL video filter -- Bugfixes in ARM and 65816 coprocessors -- Debugger fixes -- Tidying up of code -- Windows version can now build on MSVC as well as GCC - - -Default keyboard mapping : -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -BBC key - PC key --------------------- - BREAK f12 - *: @' - +; :; - -= -_ - ^~ += - f0 f0 (function keys are based on keycaps rather than positioning) - 3# 3 - 6& 6 - 7' 7 - 8( 8 - 9) 9 - 0 0 -Shift lock - ALT - -The PC key Page Up acts as a speedup key. - -GUI : -~~~~~ - -The options are : - -File : - Hard reset - resets the emulator, clearing all memory. - Load state - load a previously saved savestate. - Save state - save current emulation status. - Exit - exit to Windows. - -Disc : - Autoboot disc 0/2 - load a disc image into drives 0 and 2, and boot it. - Load disc 0/2 - load a disc image into drives 0 and 2. - Load disc 1/3 - load a disc image into drives 1 and 3. - Eject disc 0/2 - removes disc image from drives 0 and 2. - Eject disc 1/3 - removes disc image from drives 1 and 3. - New disc 0/2 - creates a new DFS/ADFS disc and loads it into drives 0 and 2. - New disc 1/3 - creates a new DFS/ADFS disc and loads it into drives 1 and 3. - Write protect disc 0/2 - toggles write protection on drives 0 and 2. - Write protect disc 1/3 - toggles write protection on drives 1 and 3. - Default write protect - determines whether loaded discs are write protected by default - -Tape : - Load tape - load a tape image. - Eject tape - removes a tape image. - Rewind tape - rewind the emulated tape. - Show tape catalogue - shows the catalogue of the current tape image. - Tape speed - select between normal and fast tape speed. - -Settings : - Model : - BBC A w/OS 0.1 - emulate a model A with OS 0.1 - 1981 style. - BBC B w/OS 0.1 - emulate a model B with OS 0.1. - BBC A - emulate a model A. - BBC B w/8271 FDC - emulate a model B with 8271 FDC. - BBC B w/8271+SWRAM - emulate a model B with 8271 FDC and plenty of sideways RAM. - BBC B w/1770 FDC - emulate a model B with 1770 FDC and plenty of sideways RAM. - BBC B US - emulate an American model B with 8271 FDC. - BBC B German - emulate an German model B with 8271 FDC. - BBC B+64K - emulate a model B+ with 64k RAM. - BBC B+128K - emulate a model B+ with 128k RAM. - BBC Master 128 - emulate a Master 128 with MOS 3.20. - BBC Master 128 w/ MOS 3.50 - emulate a Master 128 with MOS 3.50. - BBC Master 512 - emulate a Master 512 (Master 128 with 80186 copro). - BBC Master Turbo - emulate a Master Turbo (Master 128 with 65C102 copro) - BBC Master Compact - emulate a Master Compact - ARM Evaluation System - emulate a Master 128 with an ARM copro. - Second processor : - None - disable copro emulation - 6502 - emulate Acorn 6502 copro - 65816 - emulate 16mhz 65816 ReCoPro (when ROM images are available) - Z80 - emulate 4mhz Acorn Z80 copro - 6502 Tube Speed - select speed of Acorn 6502 copro, from 4mhz to 64mhz - Video : - Display Type : - Software line Doubling - stretch the BBC screen by doubling every line in software. - Allows high resolution mode 7. - Hardware line Doubling - stretch the BBC screen by doubling every line in hardware. - Scanlines - stretch the BBC screen by blanking every other line - Interlaced - emulate an interlaced display (useful for a handful of demos). Allows - high resolution mode 7. - PAL - use PAL filter, with hardware line doubling. Slow! - PAL interlaced - use PAL filter, with interlacing. Slow! Allows high resolution mode 7. - Display borders - either display all video borders or crop them slightly or totally. - Fullscreen - enters fullscreen mode. Use ALT-ENTER to return to windowed mode. - Resizeable Window - allow the window to be either resizable, or to follow the emulated screen - size. - Sound : - Internal sound chip - enable output of the normal BBC sound chip. - BeebSID - enable output of the SID emulation. - Printer Port DAC - enable output of 8-bit DAC connected to the printer port. - Disc drive noise - enable output of the disc drive sounds. - Tape noise - enable output of the cassette emulation. - Internal sound filter - enable bandpass filtering of sound. Reproduces the poor quality of - the internal speaker. - Internal waveform - choose between several waveforms for the normal BBC sound chip. Square - wave is the original. - reSID configuration : - Model - choose between many different models of SID. Many tunes sound quite - different depending on the model chosen. - Sample method - choose between interpolation and resampling. Resampling is in theory - higher quality, but I can't tell the difference. - Disc drive type - choose between sound from 5.25" drive or 3.5" drive. - Disc drive volume - set the relative volume of the disc drive noise. - Keyboard : - Redefine keys - redefine keyboard setup. - Map CAPS/CTRL to A/S - remaps those 2 keys. Useful for games where CAPS/CTRL are left/right. - Mouse : - AMX mouse - enables AMX mouse emulation. - IDE emulation : - Enable IDE emulation - enables IDE hard disc emulation. - -Misc : - Speed - set speed of emulation, from 10% to 500%. - Save screenshot - saves screenshot in BMP, PCX, or TGA format. - Debugger - enters debugger. Type '?' to get list of commands. - Break - break into debugger. - - -Command line options : -~~~~~~~~~~~~~~~~~~~~~~ - -b-em [discimage.ssd/dsd/adf/adl/fdi] [-u name.uef] [-mx] [-tx] [-i] [-c] [-fx] - --u name.uef - load UEF image name.uef - --mx - model to emulate, where x is -0 - BBC A with OS 0.1 -1 - BBC B with OS 0.1 -2 - BBC A -3 - BBC B with 8271 FDC -4 - BBC B with 8271 FDC + loads of sideways RAM -5 - BBC B with 1770 FDC + loads of sideways RAM -6 - BBC B US -7 - BBC B German -8 - B+ 64K -9 - B+ 128K -10 - Master 128 -11 - Master 128 w/ MOS 3.50 -12 - Master 512 -13 - Master Turbo -14 - Master Compact -15 - ARM Evaluation System - --tx - enable tube, where x is -0 - 6502 -1 - ARM (Master only) -2 - Z80 -3 - 80186 (Master only) -4 - 65816 (if ROMs available) - --i - enable interlace mode (only useful on a couple of demos) --c - enables scanlines --fx - set frameskip to x (1-9, 1=no skip) --fasttape - speeds up tape access - - -IDE Hard Discs -~~~~~~~~~~~~~~ - -To initialise a hard disc, use the included HDINIT program. Press 'I' to investigate the drive - this will -set up the default parameters for a 50 mb drive. If you want a different size press 'Z' and enter the desired -size - it does not matter that this does not match the size given in the emulated hardware. - -Then press 'F' to format, and follow the prompts. - - -Master 512 -~~~~~~~~~~ - -Master 512 includes mouse emulation. This is used by trapping the mouse in the emulator window - click in the -window to capture it, and press CTRL + END to release. - -All disc images used by the Master 512 should have the .img extension - the type is determined by size. Both -640k and 800k discs are supported, as well as DOS standard 360k and 720k. - -You can use the IDE hard disc emulation with this, run HDISK.CMD in DOS-Plus, then HDINSTAL.BAT. Go make a cup -of tea while doing this, it takes _forever_! HDISK.CMD will create a file 'DRIVE_C' in ADFS so you will need -to format the hard disc using ADFS first. - - -65816 coprocessor -~~~~~~~~~~~~~~~~~ - -The ROMs for this coprocessor are not included with the emulator. You will need to acquire the file -ReCo6502ROM_816 and place it in roms\tube. - -The 65816 runs at 16mhz, regardless of what the firmware is set to. - - -Hardware emulated -~~~~~~~~~~~~~~~~~ - -The 6502 processor - All instructions should be emulated. Attempts to be cycle perfect. 65C02 is emulated for - Master 128 mode. - -The 65C12 tube - As a parasite processor. - -The 65816 tube - As a parasite processor. Emulator from Snem. - -The Z80 tube - As a parasite processor. Probably a few bugs. Emulator from ZX82. - -The ARM processor - As a parasite processor for Master 128 only. Emulator from Arculator. - -The 80186 tube - As a parasite processor for Master 512 only. Emulator from PCem. - -The 6845 CRTC - Cycle-exact emulation. Runs everything I've tried, with all effects working. - -The Video ULA - Cycle-exact emulation, though I think palette changes are a cycle off? Might be a delay in - the real chip. - -The System VIA - Keyboard and sound emulated. Also CMOS on Master-based models. - -The User VIA - Emulated. - -8271 FDC - Double disc, double sided, 40/80 tracks, read/write. With authentic noise. Supports read-only - access of protected FDI images. - -1770 FDC - Double disc, double sided, 40/80 tracks, read/write. With authentic noise. Supports read-only - access of protected FDI images. - -IDE hard disc - Emulates 2 discs. Emulation from Arculator. - -Sound - All channels emulated, with sample support and some undocumented behaviour (Crazee Rider). - With optional bandpass filter. - -BeebSID - Emulated using resid-fp, so should be pretty accurate. Is only emulated when accessed, to reduce - CPU load. - -ADC - Real joystick emulation, supporting both joysticks. - -6850 ACIA - Emulated for cassettes. Read only. - -Serial ULA - Emulated. - - -Hardware NOT emulated -~~~~~~~~~~~~~~~~~~~~~ - -serial port -Econet -Printer -32016 processor - though it can be enabled in the source. Doesn't actually run anything useful though. - - -Thanks to : -~~~~~~~~~~~ - -David Gilbert for writing Beebem and distributing the sources with it - -James Fidell for writing Xbeeb and distributing the sources with it - -Tom Seddon for updating Model B, indirectly motivating me to do v0.6, and for -identifying the Empire Strikes Back bug. - -Ken Lowe for assistance with the Level 9 adventures. - -Richard Gellman for help with a few things. - -Thomas Harte for some UEF code - I wrote my own in the end - and for the OS X port. - -Dave Moore for making and hosting the B-em site - -Rich Talbot-Watkins and Peter Edwards (also Dave Moore) for testing - -Robert Schmidt for The BBC Lives! - -DJ Delorie for DJGPP - -Shawn Hargreaves for Allegro - -Acorn for making the BBC in the first place - -David Allen,Bob Austin,Ram Banerjee,Paul Bond,Allen Boothroyd,Cambridge, -Cleartone,John Coll,John Cox,Andy Cripps,Chris Curry,6502 designers, -Jeremy Dion,Tim Dobson,Joe Dunn,Paul Farrell,Ferranti,Steve Furber,Jon Gibbons, -Andrew Gordon,Lawrence Hardwick,Dylan Harris,Hermann Hauser,Hitachi, -Andy Hopper,ICL,Martin Jackson,Brian Jones,Chris Jordan,David King, -David Kitson,Paul Kriwaczek,Computer Laboratory,Peter Miller,Arthur Norman, -Glyn Phillips,Mike Prees,John Radcliffe,Wilberforce Road,Peter Robinson, -Richard Russell,Kim Spence-Jones,Graham Tebby,Jon Thackray,Chris Turner, -Adrian Warner,Roger Wilson and Alan Wright for contributing to the development -of the BBC Computer (among others too numerous to mention) - - - -Tom Walker - -b-em@bbcmicro.com - - -Also check out Elkulator (elkulator.acornelectron.co.uk), my Electron emulator, -Arculator (b-em.bbcmicro.com/arculator), my Archimedes emulator, and RPCemu -(www.riscos.info/RPCEmu), my RiscPC/A7000 emulator (that I'm not really involved -with anymore). - - - -Also check out www.tommowalker.co.uk, for more emulators than is really necessary. - \ No newline at end of file diff --git a/src/32016.c b/src/32016.c index 7ba829a9..b2534e2c 100644 --- a/src/32016.c +++ b/src/32016.c @@ -1,1377 +1,1377 @@ -/*B-em v2.2 by Tom Walker - 32016 parasite processor emulation (not working yet)*/ -#include -#include -#include "b-em.h" -#include "tube.h" -#include "32016.h" - -static int nsoutput=0; -#define r ns_r -#define pc ns_pc -#define sp ns_sp -#define fp ns_fp -#define sb ns_sb -#define intbase ns_intbase -#define psr ns_psr -#define mod ns_mod -#define cycles ns_cycles - -#define readmemb ns_readmemb -#define writememb ns_writememb -#define readmemw ns_readmemw -#define writememw ns_writememw - -static uint16_t readmemw(uint32_t addr); -static void writememw(uint32_t addr, uint16_t val); - -static uint32_t r[8]; -static uint32_t pc,sp[2],fp,sb,intbase; -static uint16_t psr,mod; -static uint32_t startpc; -static int nscfg; - -#define C_FLAG 0x01 -#define T_FLAG 0x02 -#define L_FLAG 0x04 -#define F_FLAG 0x20 -#define V_FLAG 0x20 -#define Z_FLAG 0x40 -#define N_FLAG 0x80 - -#define U_FLAG 0x100 -#define S_FLAG 0x200 -#define P_FLAG 0x400 -#define I_FLAG 0x800 - -#define SP ((psr&S_FLAG)>>9) - -static void pushw(uint16_t val) -{ - sp[SP]-=2; - writememw(sp[SP],val); -} -static void pushd(uint32_t val) -{ - sp[SP]-=4; - // if (nsoutput) printf("Push %08X to %08X\n",val,sp[SP]); - writememw(sp[SP],val); - writememw(sp[SP]+2,val>>16); -} -static uint16_t popw() -{ - uint16_t temp=readmemw(sp[SP]); - sp[SP]+=2; - return temp; -} -static uint32_t popd() -{ - uint32_t temp=readmemw(sp[SP])|(readmemw(sp[SP]+2)<<16); - sp[SP]+=4; - return temp; -} - -static uint8_t *ns32016rom,*ns32016ram; - -void n32016_reset() -{ - pc=0; - psr=0; - memcpy(ns32016ram,ns32016rom,16); -} - -void n32016_init() -{ - FILE *f; - char fn[512]; - if (!ns32016rom) ns32016rom=malloc(0x8000); - if (!ns32016ram) ns32016ram=malloc(0x100000); - append_filename(fn,exedir,"roms/tube/Pandora.rom",511); - f=fopen(fn,"rb"); - fread(ns32016rom,0x8000,1,f); - fclose(f); - memset(ns32016ram,0,0x100000); -} - -void n32016_close() -{ - if (ns32016rom) free(ns32016rom); - if (ns32016ram) free(ns32016ram); -} - -static void n32016_dumpregs() -{ - FILE *f=fopen("32016.dmp","wb"); - fwrite(ns32016ram,1024*1024,1,f); - fclose(f); - printf("R0=%08X R1=%08X R2=%08X R3=%08X\n",r[0],r[1],r[2],r[3]); - printf("R4=%08X R5=%08X R6=%08X R7=%08X\n",r[4],r[5],r[6],r[7]); - printf("PC=%08X SB=%08X SP0=%08X SP1=%08X\n",pc,sb,sp[0],sp[1]); - printf("FP=%08X INTBASE=%08X PSR=%04X MOD=%04X\n",fp,intbase,psr,mod); -} - -static uint8_t readmemb(uint32_t addr) -{ - uint8_t temp; - addr&=0xFFFFFF; - if (addr<0x100000) return ns32016ram[addr]; - if ((addr&~0x7FFF)==0xF00000) return ns32016rom[addr&0x7FFF]; - if (addr==0xF90000) return 0; /*What's here?*/ - if (addr>=0xFFFFF0) - { - temp=tube_parasite_read(addr>>1); -// if (addr&2) printf("Read TUBE %08X %02X\n",addr,temp); - return temp; - } - printf("Bad readmemb %08X\n",addr); - n32016_dumpregs(); - exit(-1); -} - -static uint16_t readmemw(uint32_t addr) -{ - addr&=0xFFFFFF; - if (addr<0x100000) - { -// printf("Read %08X %04X\n",addr,ns32016ram[addr&0xFFFFF]|(ns32016ram[(addr+1)&0xFFFFF]<<8)); - return ns32016ram[addr&0xFFFFF]|(ns32016ram[(addr+1)&0xFFFFF]<<8); - } - if (addr<0x400000) return 0; - if ((addr&~0x7FFF)==0xF00000) - { - return ns32016rom[addr&0x7FFF]|(ns32016rom[(addr+1)&0x7FFF]<<8); - } - printf("Bad readmemw %08X\n",addr); - n32016_dumpregs(); - exit(-1); -} - -static void writememb(uint32_t addr, uint8_t val) -{ - addr&=0xFFFFFF; -// if (addr==0xFFDC8) printf("Writeb %08X %02X %08X\n",addr,val,pc); - if (addr<0x100000) { ns32016ram[addr]=val; return; } - if (addr==0xF90000) return; - if (addr>=0xFFFFF0) { tube_parasite_write(addr>>1,val); /*printf("Write tube %08X %02X %c\n",addr,val,(val<33)?'.':val);*/ /*if (nsoutput) exit(-1);*/ /*if (val=='K') { n32016_dumpregs(); exit(-1); } */return; } - printf("Bad writememb %08X %02X\n",addr,val); - n32016_dumpregs(); - exit(-1); -} - -static void writememw(uint32_t addr, uint16_t val) -{ - addr&=0xFFFFFF; -// if ((addr&~1)==0xFFDC8) printf("Writew %08X %04X %08X\n",addr,val,pc); - if (addr<0x100000) - { -// printf("Write %08X %04X ",addr,val); - ns32016ram[addr]=val; - ns32016ram[addr+1]=val>>8; -// printf("%02X %02X\n",ns32016ram[addr],ns32016ram[addr+1]); - return; - } - if (addr<0x400000) return; - printf("Bad writememw %08X %04X\n",addr,val); - n32016_dumpregs(); - exit(-1); -} - -static uint32_t genaddr[2]; -static int gentype[2]; - -static uint32_t getdisp() -{ - uint32_t addr=readmemb(pc); pc++; - if (!(addr&0x80)) - { -// printf("8 bit addr %08X\n",addr); - return addr|((addr&0x40)?0xFFFFFF80:0); - } - else if (!(addr&0x40)) - { - addr&=0x3F; - addr=(addr<<8)|readmemb(pc); pc++; -// printf("16 bit addr %08X\n",addr); - return addr|((addr&0x2000)?0xFFFFC000:0); - } - else - { - addr&=0x3F; - addr=(addr<<24)|(readmemb(pc)<<16); pc++; - addr=addr|(readmemb(pc)<<8); pc++; - addr=addr|readmemb(pc); pc++; -// printf("32 bit addr %08X\n",addr); - return addr|((addr&0x20000000)?0xC0000000:0); - } -} - -static int isize=0; -static int ilook[4]={1,2,0,4}; - -static int genindex[2]; -static void getgen1(int gen, int c) -{ - if ((gen&0x1C)==0x1C) - { - genindex[c]=readmemb(pc); - pc++; - } -} - -static int sdiff[2]={0,0}; -static uint32_t nsimm[2]; - -static void getgen(int gen, int c) -{ - uint32_t temp,temp2; -// if (nsoutput&2) printf("Gen %02X %i\n",gen&0x1F,c); - switch (gen&0x1F) - { - case 0: case 1: case 2: case 3: - case 4: case 5: case 6: case 7: - gentype[c]=1; - genaddr[c]=(uint32_t)&r[gen&7]; - break; - case 8: case 9: case 0xA: case 0xB: - case 0xC: case 0xD: case 0xE: case 0xF: - gentype[c]=0; - genaddr[c]=r[gen&7]+getdisp(); -// printf("RDisp %08X\n",genaddr[c]); - break; - case 0x10: /*Frame memory relative*/ - temp=getdisp(); - temp2=getdisp(); -// if (nsoutput) printf("First addr %08X (%08X+%08X\n",fp+temp,fp,temp); - genaddr[c]=readmemw(fp+temp)|(readmemw(fp+temp+2)<<16); -// if (nsoutput) printf("Second addr %08X\n",genaddr[c]); - genaddr[c]+=temp2; -// if (nsoutput) printf("Final addr %08X %08X\n",genaddr[c],temp2); - gentype[c]=0; - break; - case 0x11: /*Stack memory relative*/ - temp=getdisp(); - temp2=getdisp(); -// if (nsoutput) printf("First addr %08X (%08X+%08X\n",sp[SP]+temp,sp[SP],temp); - genaddr[c]=readmemw(sp[SP]+temp)|(readmemw(sp[SP]+temp+2)<<16); -// if (nsoutput) printf("Second addr %08X\n",genaddr[c]); - genaddr[c]+=temp2; -// if (nsoutput) printf("Final addr %08X %08X\n",genaddr[c],temp2); - gentype[c]=0; - break; - case 0x12: /*Static memory relative*/ - temp=getdisp(); - temp2=getdisp(); -// if (nsoutput) printf("First addr %08X (%08X+%08X\n",sb+temp,sb,temp); - genaddr[c]=readmemw(sb+temp)|(readmemw(sb+temp+2)<<16); -// if (nsoutput) printf("Second addr %08X\n",genaddr[c]); - genaddr[c]+=temp2; -// if (nsoutput) printf("Final addr %08X %08X\n",genaddr[c],temp2); - gentype[c]=0; - break; - case 0x14: /*Immediate*/ -/* genaddr[c]=pc; - gentype[c]=0;*/ - gentype[c]=1; - genaddr[c]=(uint32_t)&nsimm[c]; - /*Why can't they just decided on an endian and then stick to it?*/ - if (isize==1) nsimm[c]=readmemb(pc); - else if (isize==2) nsimm[c]=(readmemb(pc)<<8)|readmemb(pc+1); - else nsimm[c]=(readmemb(pc)<<24)|(readmemb(pc+1)<<16)|(readmemb(pc+2)<<8)|readmemb(pc+3); - pc+=isize; -// printf("PC %08X %i\n",pc,isize); - break; - - case 0x15: /*Absolute*/ - gentype[c]=0; - genaddr[c]=getdisp(); -// printf("Disp %08X\n",genaddr[c]); - break; - case 0x16: /*External*/ - gentype[c]=0; - temp=readmemw(mod+4)+(readmemw(mod+6)<<16); - temp+=getdisp(); - temp2=readmemw(temp)+(readmemw(temp+2)<<16); - genaddr[c]=temp2+getdisp(); - break; - case 0x17: /*Stack*/ -// nsoutput=1; - gentype[c]=0; - sdiff[c]=isize; - genaddr[c]=sp[SP]; -// printf("TOS %i %i\n",sdiff,isize); -/* if (c) - { - sp[SP]-=isize; - genaddr[c]=sp[SP]; - } - else - { - genaddr[c]=sp[SP]; - sp[SP]+=isize; - }*/ - break; - - case 0x18: /*FP relative*/ - gentype[c]=0; - genaddr[c]=getdisp()+fp; -// printf("FPAddr %08X %08X\n",genaddr[c],fp); - break; - case 0x19: /*SP relative*/ - gentype[c]=0; - genaddr[c]=getdisp()+sp[SP]; -// printf("SPAddr %08X %08X\n",genaddr[c],sp[SP]); - break; - case 0x1A: /*SB relative*/ - gentype[c]=0; - genaddr[c]=getdisp()+sb; -// if (nsoutput) printf("SBAddr %08X %08X\n",genaddr[c],sb); - break; - case 0x1B: /*PC relative*/ - gentype[c]=0; - genaddr[c]=getdisp()+startpc; -// printf("Addr %08X %08X %08X\n",genaddr[c],pc,startpc); - break; - - case 0x1C: /*EA + Rn*/ - getgen(genindex[c]>>3,c); - if (!gentype[c]) genaddr[c]+=r[genindex[c]&7]; - else genaddr[c]=*(uint32_t *)genaddr[c]+r[genindex[c]&7]; -// if (nsoutput&2) printf("EA + R%i addr %08X %02X\n",genindex[c]&7,genaddr[c],genindex[c]); - gentype[c]=0; - break; - case 0x1D: /*EA + Rn*2*/ - getgen(genindex[c]>>3,c); - if (!gentype[c]) genaddr[c]+=(r[genindex[c]&7]*2); - else genaddr[c]=*(uint32_t *)genaddr[c]+(r[genindex[c]&7]*2); -// printf("EA + Rn*2 addr %08X\n",genaddr[c]); - gentype[c]=0; - break; - - - default: - printf("Bad NS32016 gen mode %02X\n",gen&0x1F); - n32016_dumpregs(); - exit(-1); - } -} - -#define readgenb(c,temp) if (gentype[c]) temp=*(uint8_t *)genaddr[c]; \ - else \ - { \ - temp=readmemb(genaddr[c]); \ - if (sdiff[c]) genaddr[c]=sp[SP]=sp[SP]+sdiff[c]; \ - } - -#define readgenw(c,temp) if (gentype[c]) temp=*(uint16_t *)genaddr[c]; \ - else \ - { \ - temp=readmemw(genaddr[c]); \ - if (sdiff[c]) genaddr[c]=sp[SP]=sp[SP]+sdiff[c]; \ - } - -#define readgenl(c,temp) if (gentype[c]) temp=*(uint32_t *)genaddr[c]; \ - else \ - { \ - temp=readmemw(genaddr[c])|(readmemw(genaddr[c]+2)<<16); \ - if (sdiff[c]) genaddr[c]=sp[SP]=sp[SP]+sdiff[c]; \ - } - -#define readgenq(c,temp) if (gentype[c]) temp=*(uint64_t *)genaddr[c]; \ - else \ - { \ - temp=readmemw(genaddr[c])|(readmemw(genaddr[c]+2)<<16); \ - if (sdiff[c]) genaddr[c]=sp[SP]=sp[SP]+sdiff[c]; \ - temp|=((readmemw(genaddr[c])|(readmemw(genaddr[c]+2)<<16))<<16); \ - if (sdiff[c]) genaddr[c]=sp[SP]=sp[SP]+sdiff[c]; \ - } - -#define writegenb(c,temp) if (gentype[c]) *(uint8_t *)genaddr[c]=temp; \ - else \ - { \ - if (sdiff[c]) genaddr[c]=sp[SP]=sp[SP]-sdiff[c]; \ - writememb(genaddr[c],temp); \ - } - -#define writegenw(c,temp) if (gentype[c]) *(uint16_t *)genaddr[c]=temp; \ - else \ - { \ - if (sdiff[c]) genaddr[c]=sp[SP]=sp[SP]-sdiff[c]; \ - writememw(genaddr[c],temp); \ - } - -#define writegenl(c,temp) if (gentype[c]) *(uint32_t *)genaddr[c]=temp; \ - else \ - { \ - if (sdiff[c]) genaddr[c]=sp[SP]=sp[SP]-sdiff[c]; \ - writememw(genaddr[c],temp); \ - writememw(genaddr[c]+2,temp>>16); \ - } - - -static uint16_t oldpsr; - -void n32016_exec() -{ - uint32_t opcode; - uint32_t temp = 0,temp2,temp3,temp4; - uint64_t temp64; - int c; - while (tubecycles>0) - { - sdiff[0]=sdiff[1]=0; -// if (pc==0xF00A3C) nsoutput=1; -// if (pc==0xF00A73) nsoutput=0; - startpc=pc; - opcode=readmemb(pc); -// if (nsoutput && (pc<0xF000A0 || pc>0xF000B3)) printf("%08X %08X %08X %08X %08X %08X %04X : %02X %02X %02X %02X\n",pc,r[0],r[1],r[2],r[3],sp[SP],psr,opcode,readmemb(pc+1),readmemb(pc+2),readmemb(pc+3)); - pc++; - isize=ilook[opcode&3]; - switch (opcode) - { - case 0x0E: /*String instruction*/ - opcode|=(readmemb(pc)<<8); pc++; - opcode|=(readmemb(pc)<<16); pc++; - temp2=(opcode>>15)&0xF; - switch ((opcode>>8)&0x3F) - { - case 0x00: /*MOVS byte*/ - if (temp2&3) - { - printf("Bad NS32016 MOVS %02X %04X %01X\n",(opcode>>15)&0xF,opcode,(opcode>>15)&0xF); - n32016_dumpregs(); - exit(-1); - } -// printf("MOVSB %08X %08X %08X %08X\n",r[1],r[2],r[0],pc); - while (r[0]) - { - temp=readmemb(r[1]); r[1]++; - if ((temp2&0xC)==0xC && temp==r[4]) { /*printf("Break EQ\n");*/ break; } - if ((temp2&0xC)==0x4 && temp!=r[4]) { /*printf("Break NE\n");*/ break; } - writememb(r[2],temp); r[2]++; - r[0]--; -// printf("MOVS %02X %08X %08X %08X %01X\n",temp,r[1],r[2],r[4],temp); - } - break; - case 0x03: /*MOVS dword*/ -// printf("MOVSD %08X %08X %08X %08X\n",r[1],r[2],r[0],pc); - if (temp2) - { - printf("Bad NS32016 MOVS %02X %04X %01X\n",(opcode>>15)&0xF,opcode,(opcode>>15)&0xF); - n32016_dumpregs(); - exit(-1); - } - while (r[0]) - { - temp=readmemw(r[1]); temp|=(readmemw(r[1]+2)<<16); r[1]+=4; - writememw(r[2],temp); writememw(r[2]+2,temp>>16); r[2]+=4; - r[0]--; - } - break; - - case 0x0B: /*SETCFG*/ - nscfg=temp; - break; - - default: - printf("Bad NS32016 0E opcode %02X %04X %01X\n",(opcode>>8)&0x3F,opcode,(opcode>>15)&0xF); - n32016_dumpregs(); - exit(-1); - } - break; - - case 0x1C: case 0x9C: /*CMPQ byte*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen(opcode>>11,0); - temp2=(opcode>>7)&0xF; if (temp2&8) temp2|=0xFFFFFFF0; - readgenb(0,temp); -// if (!temp) nsoutput=1; - psr&=~(Z_FLAG|N_FLAG|L_FLAG); - if (temp==temp2) psr|=Z_FLAG; - if (temp2>temp) psr|=L_FLAG; - if (((signed char)temp2)>((signed char)temp)) psr|=N_FLAG; - break; - case 0x1F: case 0x9F: /*CMPQ dword*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen(opcode>>11,0); - temp2=(opcode>>7)&0xF; if (temp2&8) temp2|=0xFFFFFFF0; - readgenl(0,temp); -// if (!temp) nsoutput=1; - psr&=~(Z_FLAG|N_FLAG|L_FLAG); - if (temp==temp2) psr|=Z_FLAG; - if (temp2>temp) psr|=L_FLAG; - if (((signed long)temp2)>((signed long)temp)) psr|=N_FLAG; -// printf("CMPQ %08X %08X %i %i\n",temp,temp2,temp>temp2,((signed long)temp)>((signed long)temp2)); - break; - case 0x5C: case 0xDC: /*MOVQ byte*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen(opcode>>11,0); - temp=(opcode>>7)&0xF; if (temp&8) temp|=0xFFFFFFF0; - writegenb(0,temp); - break; - case 0x5D: case 0xDD: /*MOVQ word*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen(opcode>>11,0); - temp=(opcode>>7)&0xF; if (temp&8) temp|=0xFFFFFFF0; - writegenw(0,temp); - break; - case 0x5F: case 0xDF: /*MOVQ dword*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen(opcode>>11,0); - temp=(opcode>>7)&0xF; if (temp&8) temp|=0xFFFFFFF0; - writegenl(0,temp); - break; - case 0x0C: case 0x8C: /*ADDQ byte*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen(opcode>>11,0); - temp2=(opcode>>7)&0xF; if (temp2&8) temp2|=0xFFFFFFF0; - readgenb(0,temp); - psr&=~(C_FLAG|V_FLAG); - if ((temp+temp2)&0x100) psr|=C_FLAG; - if ((temp^(temp+temp2))&(temp2^(temp+temp2))&0x80) psr|=V_FLAG; - temp+=temp2; - writegenb(0,temp); - break; - case 0x0D: case 0x8D: /*ADDQ word*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen(opcode>>11,0); - temp2=(opcode>>7)&0xF; if (temp2&8) temp2|=0xFFFFFFF0; - readgenw(0,temp); - psr&=~(C_FLAG|V_FLAG); - if ((temp+temp2)&0x10000) psr|=C_FLAG; - if ((temp^(temp+temp2))&(temp2^(temp+temp2))&0x8000) psr|=V_FLAG; - temp+=temp2; - writegenw(0,temp); - break; - case 0x0F: case 0x8F: /*ADDQ dword*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen(opcode>>11,0); - temp2=(opcode>>7)&0xF; if (temp2&8) temp2|=0xFFFFFFF0; - readgenl(0,temp); - psr&=~(C_FLAG|V_FLAG); - if ((temp+temp2)>11,0); - getgen(opcode>>11,0); -// readgenb(0,temp); -temp=0; - switch ((opcode>>7)&0xF) - { - case 0x0: if (psr&Z_FLAG) temp=1; break; - case 0x1: if (!(psr&Z_FLAG)) temp=1; break; - case 0x2: if (psr&C_FLAG) temp=1; break; - case 0x3: if (!(psr&C_FLAG)) temp=1; break; - case 0x4: if (psr&L_FLAG) temp=1; break; - case 0x5: if (!(psr&L_FLAG)) temp=1; break; - case 0x6: if (psr&N_FLAG) temp=1; break; - case 0x7: if (!(psr&N_FLAG)) temp=1; break; - case 0x8: if (!(psr&(L_FLAG|Z_FLAG))) temp=1; break; - case 0x9: if (psr&(L_FLAG|Z_FLAG)) temp=1; break; - case 0xA: if (!(psr&(N_FLAG|Z_FLAG))) temp=1; break; - case 0xB: if (psr&(N_FLAG|Z_FLAG)) temp=1; break; - case 0xC: if (psr&Z_FLAG) temp=1; break; - case 0xD: if (!(psr&Z_FLAG)) temp=1; break; - case 0xE: temp=1; break; - case 0xF: break; - } - writegenb(0,temp); - break; - case 0x4C: case 0xCC: /*ACBB*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen(opcode>>11,0); - temp2=(opcode>>7)&0xF; if (temp2&8) temp2|=0xFFFFFFF0; - readgenb(0,temp); - temp+=temp2; - writegenb(0,temp); - temp2=getdisp(); - if (temp&0xFF) pc=startpc+temp2; - break; - case 0x4F: case 0xCF: /*ACBD*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen(opcode>>11,0); - temp2=(opcode>>7)&0xF; if (temp2&8) temp2|=0xFFFFFFF0; - readgenl(0,temp); - temp+=temp2; - writegenl(0,temp); - temp2=getdisp(); - if (temp) pc=startpc+temp2; - break; - - case 0x00: case 0x40: case 0x80: case 0xC0: /*ADD byte*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen1(opcode>>6,1); - getgen(opcode>>11,0); - getgen(opcode>>6,1); - readgenb(0,temp); - readgenb(1,temp2); - psr&=~(C_FLAG|V_FLAG); - if ((temp+temp2)&0x100) psr|=C_FLAG; - if ((temp^(temp+temp2))&(temp2^(temp+temp2))&0x80) psr|=V_FLAG; - temp2+=temp; - writegenb(1,temp2); - break; - case 0x03: case 0x43: case 0x83: case 0xC3: /*ADD dword*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen1(opcode>>6,1); - getgen(opcode>>11,0); - getgen(opcode>>6,1); - readgenl(0,temp); - readgenl(1,temp2); - psr&=~(C_FLAG|V_FLAG); - if ((temp+temp2)>11,0); - getgen1(opcode>>6,1); - getgen(opcode>>11,0); - getgen(opcode>>6,1); - readgenb(0,temp); - readgenb(1,temp2); - psr&=~(Z_FLAG|N_FLAG|L_FLAG); - if (temp==temp2) psr|=Z_FLAG; - if (temp>temp2) psr|=L_FLAG; - if (((signed char)temp)>((signed char)temp2)) psr|=N_FLAG; - break; - case 0x07: case 0x47: case 0x87: case 0xC7: /*CMP dword*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen1(opcode>>6,1); - nsoutput|=2; - getgen(opcode>>11,0); - getgen(opcode>>6,1); - nsoutput&=~2; - readgenl(0,temp); - readgenl(1,temp2); - -// printf("CMP %08X %08X %i %i\n",temp,temp2,temp>temp2,(((signed long)temp)>((signed long)temp2))); - psr&=~(Z_FLAG|N_FLAG|L_FLAG); - if (temp==temp2) psr|=Z_FLAG; - if (temp>temp2) psr|=L_FLAG; - if (((signed long)temp)>((signed long)temp2)) psr|=N_FLAG; - break; - case 0x08: case 0x48: case 0x88: case 0xC8: /*BIC byte*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen1(opcode>>6,1); - getgen(opcode>>11,0); - getgen(opcode>>6,1); - readgenb(0,temp); - readgenb(1,temp2); - temp2&=~temp; - writegenb(1,temp2); - break; - case 0x09: case 0x49: case 0x89: case 0xC9: /*BIC word*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen1(opcode>>6,1); - getgen(opcode>>11,0); - getgen(opcode>>6,1); - readgenw(0,temp); - readgenw(1,temp2); - temp2&=~temp; - writegenw(1,temp2); - break; - - case 0x14: case 0x54: case 0x94: case 0xD4: /*MOV byte*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen1(opcode>>6,1); - getgen(opcode>>11,0); - getgen(opcode>>6,1); - readgenb(0,temp); - writegenb(1,temp); - break; - case 0x15: case 0x55: case 0x95: case 0xD5: /*MOV word*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen1(opcode>>6,1); - getgen(opcode>>11,0); - getgen(opcode>>6,1); - readgenw(0,temp); - writegenw(1,temp); - break; - case 0x17: case 0x57: case 0x97: case 0xD7: /*MOV dword*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen1(opcode>>6,1); - getgen(opcode>>11,0); - getgen(opcode>>6,1); - // printf("Read from %08X write to %08X\n",genaddr[0],genaddr[1]); - readgenl(0,temp); -// printf("Dat %08X\n",temp); - writegenl(1,temp); - break; - case 0x18: case 0x58: case 0x98: case 0xB8: /*OR byte*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen1(opcode>>6,1); - getgen(opcode>>11,0); - getgen(opcode>>6,1); - readgenb(0,temp); - readgenb(1,temp2); - temp2|=temp; - writegenb(1,temp2); - break; - - case 0x23: case 0x63: case 0xA3: case 0xE3: /*SUB dword*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen1(opcode>>6,1); - getgen(opcode>>11,0); - getgen(opcode>>6,1); - readgenl(0,temp); - readgenl(1,temp2); - psr&=~(C_FLAG|V_FLAG); - if ((temp+temp2)>temp) psr|=C_FLAG; - if ((temp^temp2)&(temp^(temp+temp2))&0x80000000) psr|=V_FLAG; - temp2-=temp; - writegenl(1,temp2); - break; - case 0x27: case 0x67: case 0xA7: case 0xE7: /*ADDR dword*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen1(opcode>>6,1); - getgen(opcode>>11,0); - getgen(opcode>>6,1); -// printf("Writegenl %08X ",sp[SP]); - writegenl(1,genaddr[0]); -// printf("%08X\n",sp[SP]); - break; - - case 0x28: case 0x68: case 0xA8: case 0xE8: /*AND byte*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen1(opcode>>6,1); - getgen(opcode>>11,0); - getgen(opcode>>6,1); - readgenb(0,temp); - readgenb(1,temp2); - temp2&=temp; - writegenb(1,temp2); - break; - case 0x2B: case 0x6B: case 0xAB: case 0xEB: /*AND dword*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen1(opcode>>6,1); - getgen(opcode>>11,0); - getgen(opcode>>6,1); - readgenl(0,temp); - readgenl(1,temp2); - temp2&=temp; - writegenl(1,temp2); - break; - case 0x34: case 0x74: case 0xB4: case 0xF4: /*TBITB*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen1(opcode>>6,1); - getgen(opcode>>11,0); - getgen(opcode>>6,1); - readgenb(0,temp); - readgenb(1,temp2); - psr&=~F_FLAG; - temp&=7; - if (temp2&(1<>11,0); - getgen1(opcode>>6,1); - getgen(opcode>>11,0); - getgen(opcode>>6,1); - readgenl(0,temp); - readgenl(1,temp2); - psr&=~F_FLAG; - temp&=31; - if (temp2&(1<>11,0); - getgen1(opcode>>6,1); - if ((opcode&0x3F)==0x17) isize=1; - getgen(opcode>>11,0); - isize=ilook[opcode&3]; - getgen(opcode>>6,1); - switch (opcode&0x3F) - { - case 8: /*CBITB*/ - readgenb(0,temp); temp&=31; - if (gentype[1]) { readgenl(1,temp2); } - else { readgenb(1,temp2); } - if (temp2&(1<>=((temp^0xFF)+1); - else temp2<<=temp; - writegenl(1,temp2); - break; - case 0x30: /*ABSB*/ - readgenb(0,temp); - if (temp&0x80) temp=(temp^0xFF)+1; - writegenb(1,temp); - break; - case 0x34: /*COMB*/ - readgenb(0,temp); - writegenb(1,~temp); - break; - - default: - printf("Bad NS32016 4E opcode %04X %01X\n",opcode,opcode&0x3F); - n32016_dumpregs(); - exit(-1); - } - break; - - case 0x7C: /*Type 3 byte*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen(opcode>>11,0); - switch ((opcode>>7)&0xF) - { - case 2: /*BICPSR*/ - readgenb(0,temp); - psr&=~temp; - break; - case 6: /*BISPSR*/ - readgenb(0,temp); - psr|=temp; -// nsoutput=1; - break; - case 0xA: /*ADJSP*/ - readgenb(0,temp2); - if (temp2&0x80) temp2|=0xFFFFFF00; - sp[SP]-=temp2; - break; - case 0xE: /*CASE*/ - readgenb(0,temp); - if (temp&0x80) temp|=0xFFFFFF00; - pc=startpc+temp; - break; - - default: - printf("Bad NS32016 7C opcode %04X %01X\n",opcode,(opcode>>7)&0xF); - n32016_dumpregs(); - exit(-1); - } - break; - - case 0x7D: /*Type 3 word*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen(opcode>>11,0); - switch ((opcode>>7)&0xF) - { - case 2: /*BICPSR*/ - readgenw(0,temp); - psr&=~temp; - break; - case 6: /*BISPSR*/ - readgenw(0,temp); - psr|=temp; - break; - case 0xA: /*ADJSP*/ - readgenw(0,temp2); - if (temp&0x8000) temp|=0xFFFF0000; - sp[SP]-=temp2; - break; - case 0xE: /*CASE*/ - readgenw(0,temp); - if (temp&0x8000) temp|=0xFFFF0000; - pc=startpc+temp; - break; - - default: - printf("Bad NS32016 7D opcode %04X %01X\n",opcode,(opcode>>7)&0xF); - n32016_dumpregs(); - exit(-1); - } - break; - case 0x7F: /*Type 3 dword*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen(opcode>>11,0); - switch ((opcode>>7)&0xF) - { - case 0: /*CXPD*/ - readgenl(0,temp); -// printf("CXPD %08X\n",temp); - pushw(0); - pushw(mod); - pushd(pc); - mod=temp&0xFFFF; - temp3=temp>>16; -// printf("MOD %04X OFFSET %04X\n",mod,temp3); - sb=readmemw(mod)|(readmemw(mod+2)<<16); -// printf("SB = %08X\n",sb); - temp2=readmemw(mod+8)|(readmemw(mod+10)<<16); -// printf("PC temp2 = %08X\n",temp2); - pc=temp2+temp3; -// printf("PC = %08X\n",pc); - break; - case 4: /*JUMP*/ - if (gentype[0]) pc=*(uint32_t *)genaddr[0]; - else pc=genaddr[0]; - break; - case 0xA: /*ADJSP*/ - readgenl(0,temp2); - sp[SP]-=temp2; - break; - - default: - printf("Bad NS32016 7F opcode %04X %01X\n",opcode,(opcode>>7)&0xF); - n32016_dumpregs(); - exit(-1); - } - break; - - case 0x2F: case 0xAF: /*SPR*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen(opcode>>11,0); - switch ((opcode>>7)&0xF) - { - case 0x8: writegenl(0,fp); break; - case 0x9: writegenl(0,sp[SP]); break; - case 0xA: writegenl(0,sb); break; - case 0xF: writegenl(0,mod); /*nsoutput=1; */break; - - default: - printf("Bad SPR reg %01X\n",(opcode>>7)&0xF); - n32016_dumpregs(); - exit(-1); - } - break; - case 0x6C: case 0xEC: /*LPRB*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen(opcode>>11,0); - readgenb(0,temp); - switch ((opcode>>7)&0xF) - { - case 0: psr=(psr&0xFF00)|(temp&0xFF); break; - case 9: sp[SP]=temp; break; - - default: - printf("Bad LPRB reg %01X\n",(opcode>>7)&0xF); - n32016_dumpregs(); - exit(-1); - } - break; - case 0x6D: case 0xED: /*LPRW*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen(opcode>>11,0); - readgenw(0,temp); - switch ((opcode>>7)&0xF) - { - case 15: mod=temp; break; - - default: - printf("Bad LPRW reg %01X\n",(opcode>>7)&0xF); - n32016_dumpregs(); - exit(-1); - } - break; - case 0x6F: case 0xEF: /*LPRD*/ - opcode|=(readmemb(pc)<<8); pc++; - getgen1(opcode>>11,0); - getgen(opcode>>11,0); - readgenl(0,temp); - switch ((opcode>>7)&0xF) - { - case 9: sp[SP]=temp; break; - case 0xA: sb=temp; break; - case 0xE: intbase=temp; /*printf("INTBASE %08X %08X\n",temp,pc); */break; - - default: - printf("Bad LPRD reg %01X\n",(opcode>>7)&0xF); - n32016_dumpregs(); - exit(-1); - } - break; - - case 0xCE: /*Format 7*/ - opcode=readmemb(pc); pc++; - opcode|=(readmemb(pc)<<8); pc++; - isize=ilook[opcode&3]; - getgen1(opcode>>11,0); - getgen1(opcode>>6,1); - getgen(opcode>>11,0); - getgen(opcode>>6,1); - switch (opcode&0x3F) - { - case 0x00: /*MOVMB*/ - temp=getdisp(); - while (temp) - { - temp2=readmemb(genaddr[0]); genaddr[0]++; - writememb(genaddr[1],temp2); genaddr[1]++; - temp--; - } - break; - case 0x08: /*INSSB*/ - temp3=readmemb(pc); pc++; - readgenb(0,temp); - readgenb(1,temp2); - for (c=0;c<=(temp3&31);c++) - { - temp2&=~(1<<((c+(temp3>>3))&7)); - if (temp&(1<>3))&7)); - } - writegenb(1,temp2); - break; - case 0x18: /*MOVZBD*/ -// printf("Read MOVZ from %08X\n",genaddr[0]); - readgenb(0,temp); - if (sdiff[1]) sdiff[1]=4; - writegenl(1,temp) - break; - case 0x19: /*MOVZWD*/ - readgenw(0,temp); - if (sdiff[1]) sdiff[1]=4; - writegenl(1,temp) - break; - case 0x2F: /*DEID*/ - readgenl(0,temp); - readgenq(1,temp64); - if (!temp) - { - printf("Divide by zero - DEID CE\n"); - n32016_dumpregs(); - exit(-1); - } - temp3=temp64%temp; - writegenl(1,temp3); - temp3=temp64/temp; - if (gentype[1]) *(uint32_t *)(genaddr[1]+4)=temp3; - else { writememw(genaddr[1]+4,temp3); writememw(genaddr[1]+4+2,temp3>>16); } - break; - case 0x33: /*QUOD*/ - readgenl(0,temp); - readgenl(1,temp2); - if (!temp) - { - printf("Divide by zero - QUOD CE\n"); - n32016_dumpregs(); - exit(-1); - } - temp2/=temp; - writegenl(1,temp2); - break; - case 0x37: /*REMD*/ - readgenl(0,temp); - readgenl(1,temp2); - if (!temp) - { - printf("Divide by zero - QUOD CE\n"); - n32016_dumpregs(); - exit(-1); - } - temp2%=temp; - writegenl(1,temp2); - break; - - default: - printf("Bad NS32016 CE opcode %04X %01X\n",opcode,opcode&0x3F); - n32016_dumpregs(); - exit(-1); - } - break; - - case 0x2E: case 0x6E: case 0xAE: case 0xEE: /*Type 8*/ - opcode|=(readmemb(pc)<<8); pc++; - opcode|=(readmemb(pc)<<16); pc++; - getgen1(opcode>>19,0); - getgen1(opcode>>14,1); - getgen(opcode>>19,0); - getgen(opcode>>14,1); - temp=((opcode>>6)&3)|((opcode&0x400)>>8); - temp=(temp<<2)|((opcode>>8)&3); - switch (temp) - { - case 0: /*EXT*/ - temp=r[(opcode>>11)&7]&31; - temp2=getdisp(); - readgenl(0,temp3); - temp4=0; - for (c=0;c=temp3 && temp3>=temp2) - { - r[(opcode>>11)&7]=temp3-temp2; - psr&=~F_FLAG; - } - else - psr|=F_FLAG; - break; - -// printf("EXT - R%i %08X R%i %08X R%i %08X %08X\n",temp,genaddr[0],((int)genaddr[0]-(int)&r[0])/4,genaddr[1],((int)genaddr[1]-(int)&r[0])/4,temp2,pc); -// exit(-1); - - default: - printf("Bad NS32016 Type 8 opcode %04X %01X %i\n",opcode,temp,(opcode>>11)&7); - n32016_dumpregs(); - exit(-1); - } - break; - - case 0x02: /*BSR*/ - temp=getdisp(); - pushd(pc); - pc=startpc+temp; - break; - case 0x12: /*RET*/ - temp=getdisp(); - pc=popd(); - sp[SP]+=temp; - break; - case 0x22: /*CXP*/ - temp=getdisp(); - pushw(0); - pushw(mod); - pushd(pc); -// printf("CXP %08X\n",temp); - temp2=readmemw(mod+4)+(readmemw(mod+6)<<16)+(4*temp); -// printf("%08X\n",temp2); - temp=readmemw(temp2)+(readmemw(temp2+2)<<16); -// printf("%08X\n",temp); - mod=temp&0xFFFF; -// printf("MOD=%04X\n",mod); - sb=readmemw(mod)+(readmemw(mod+2)<<16); -// printf("SB=%08X\n",sb); - pc=readmemw(mod+8)+(readmemw(mod+10)<<16)+(temp>>16); -// printf("PC=%08X\n",pc); - nsoutput=1; - break; - case 0x32: /*RXP*/ -// nsoutput=1; - temp=getdisp(); - pc=popd(); - temp2=popd(); - mod=temp2&0xFFFF; - sp[SP]+=temp; - sb=readmemw(mod)|(readmemw(mod+2)<<16); - break; - case 0x42: /*RETT*/ - temp=getdisp(); - pc=popd(); - mod=popw(); - psr=popw(); - sp[SP]+=temp; - sb=readmemw(mod)|(readmemw(mod+2)<<16); - break; - case 0x62: /*SAVE*/ - temp=readmemb(pc); pc++; - for (c=0;c<8;c++) - { - if (temp&(1<>16; -// printf("MOD %04X OFFSET %04X\n",mod,temp3); - sb=readmemw(mod)|(readmemw(mod+2)<<16); -// printf("SB = %08X\n",sb); - temp2=readmemw(mod+8)|(readmemw(mod+10)<<16); -// printf("PC temp2 = %08X\n",temp2); - pc=temp2+temp3; - //printf("PC = %08X\n",pc); - break; - - case 0x0A: /*BEQ*/ - temp=getdisp(); - if (psr&Z_FLAG) pc=startpc+temp; - break; - case 0x1A: /*BNE*/ - temp=getdisp(); - if (!(psr&Z_FLAG)) pc=startpc+temp; - break; - case 0x4A: /*BH*/ - temp=getdisp(); - if (psr&L_FLAG) pc=startpc+temp; - break; - case 0x5A: /*BLS*/ - temp=getdisp(); - if (!(psr&L_FLAG)) pc=startpc+temp; - break; - case 0x6A: /*BGT*/ - temp=getdisp(); - if (psr&N_FLAG) pc=startpc+temp; - break; - case 0x7A: /*BLE*/ - temp=getdisp(); - if (!(psr&N_FLAG)) pc=startpc+temp; - break; - case 0x8A: /*BFS*/ - temp=getdisp(); - if (psr&F_FLAG) pc=startpc+temp; - break; - case 0x9A: /*BFC*/ - temp=getdisp(); - if (!(psr&F_FLAG)) pc=startpc+temp; - break; - case 0xAA: /*BLO*/ - temp=getdisp(); - if (!(psr&(L_FLAG|Z_FLAG))) pc=startpc+temp; - break; - case 0xBA: /*BHS*/ - temp=getdisp(); - if (psr&(L_FLAG|Z_FLAG)) pc=startpc+temp; - break; - case 0xCA: /*BLT*/ - temp=getdisp(); - if (!(psr&(N_FLAG|Z_FLAG))) pc=startpc+temp; - break; - case 0xDA: /*BGE*/ - temp=getdisp(); - if (psr&(N_FLAG|Z_FLAG)) pc=startpc+temp; - break; - case 0xEA: /*BR*/ - pc=startpc+getdisp(); - break; - - default: - printf("Bad NS32016 opcode %02X\n",opcode); - n32016_dumpregs(); - exit(-1); - } - tubecycles-=8; - if (tube_irq&2) - { - temp=psr; - psr&=~0xF00; - pushw(temp); - pushw(mod); - pushd(pc); -// printf("NMI!\n"); - temp=readmemw(intbase+(1*4))|(readmemw(intbase+(1*4)+2)<<16); - mod=temp&0xFFFF; - temp3=temp>>16; -// printf("MOD %04X OFFSET %04X\n",mod,temp3); - sb=readmemw(mod)|(readmemw(mod+2)<<16); -// printf("SB = %08X\n",sb); - temp2=readmemw(mod+8)|(readmemw(mod+10)<<16); -// printf("PC temp2 = %08X\n",temp2); - pc=temp2+temp3; -// printf("PC = %08X\n",pc); - } - if ((tube_irq&1) && (psr&0x800)) - { - temp=psr; - psr&=~0xF00; - pushw(temp); - pushw(mod); - pushd(pc); -// printf("Interrupt!\n"); - temp=readmemw(intbase)|(readmemw(intbase+2)<<16); - mod=temp&0xFFFF; - temp3=temp>>16; -// printf("MOD %04X OFFSET %04X\n",mod,temp3); - sb=readmemw(mod)|(readmemw(mod+2)<<16); -// printf("SB = %08X\n",sb); - temp2=readmemw(mod+8)|(readmemw(mod+10)<<16); -// printf("PC temp2 = %08X\n",temp2); - pc=temp2+temp3; -// printf("PC = %08X\n",pc); -// nsoutput=1; - } -/* if ((oldpsr^psr)&0x800) - { - if (psr&0x800) printf("INT enabled at %08X\n",startpc); - else printf("INT disabled at %08X\n",startpc); - }*/ - oldpsr=psr; - } -} +/*B-em v2.2 by Tom Walker + 32016 parasite processor emulation (not working yet)*/ +#include +#include +#include "b-em.h" +#include "tube.h" +#include "32016.h" + +static int nsoutput=0; +#define r ns_r +#define pc ns_pc +#define sp ns_sp +#define fp ns_fp +#define sb ns_sb +#define intbase ns_intbase +#define psr ns_psr +#define mod ns_mod +#define cycles ns_cycles + +#define readmemb ns_readmemb +#define writememb ns_writememb +#define readmemw ns_readmemw +#define writememw ns_writememw + +static uint16_t readmemw(uint32_t addr); +static void writememw(uint32_t addr, uint16_t val); + +static uint32_t r[8]; +static uint32_t pc,sp[2],fp,sb,intbase; +static uint16_t psr,mod; +static uint32_t startpc; +static int nscfg; + +#define C_FLAG 0x01 +#define T_FLAG 0x02 +#define L_FLAG 0x04 +#define F_FLAG 0x20 +#define V_FLAG 0x20 +#define Z_FLAG 0x40 +#define N_FLAG 0x80 + +#define U_FLAG 0x100 +#define S_FLAG 0x200 +#define P_FLAG 0x400 +#define I_FLAG 0x800 + +#define SP ((psr&S_FLAG)>>9) + +static void pushw(uint16_t val) +{ + sp[SP]-=2; + writememw(sp[SP],val); +} +static void pushd(uint32_t val) +{ + sp[SP]-=4; + // if (nsoutput) printf("Push %08X to %08X\n",val,sp[SP]); + writememw(sp[SP],val); + writememw(sp[SP]+2,val>>16); +} +static uint16_t popw() +{ + uint16_t temp=readmemw(sp[SP]); + sp[SP]+=2; + return temp; +} +static uint32_t popd() +{ + uint32_t temp=readmemw(sp[SP])|(readmemw(sp[SP]+2)<<16); + sp[SP]+=4; + return temp; +} + +static uint8_t *ns32016rom,*ns32016ram; + +void n32016_reset() +{ + pc=0; + psr=0; + memcpy(ns32016ram,ns32016rom,16); +} + +void n32016_init() +{ + FILE *f; + char fn[512]; + if (!ns32016rom) ns32016rom=malloc(0x8000); + if (!ns32016ram) ns32016ram=malloc(0x100000); + append_filename(fn,exedir,"roms/tube/Pandora.rom",511); + f=fopen(fn,"rb"); + fread(ns32016rom,0x8000,1,f); + fclose(f); + memset(ns32016ram,0,0x100000); +} + +void n32016_close() +{ + if (ns32016rom) free(ns32016rom); + if (ns32016ram) free(ns32016ram); +} + +static void n32016_dumpregs() +{ + FILE *f=fopen("32016.dmp","wb"); + fwrite(ns32016ram,1024*1024,1,f); + fclose(f); + printf("R0=%08X R1=%08X R2=%08X R3=%08X\n",r[0],r[1],r[2],r[3]); + printf("R4=%08X R5=%08X R6=%08X R7=%08X\n",r[4],r[5],r[6],r[7]); + printf("PC=%08X SB=%08X SP0=%08X SP1=%08X\n",pc,sb,sp[0],sp[1]); + printf("FP=%08X INTBASE=%08X PSR=%04X MOD=%04X\n",fp,intbase,psr,mod); +} + +static uint8_t readmemb(uint32_t addr) +{ + uint8_t temp; + addr&=0xFFFFFF; + if (addr<0x100000) return ns32016ram[addr]; + if ((addr&~0x7FFF)==0xF00000) return ns32016rom[addr&0x7FFF]; + if (addr==0xF90000) return 0; /*What's here?*/ + if (addr>=0xFFFFF0) + { + temp=tube_parasite_read(addr>>1); +// if (addr&2) printf("Read TUBE %08X %02X\n",addr,temp); + return temp; + } + printf("Bad readmemb %08X\n",addr); + n32016_dumpregs(); + exit(-1); +} + +static uint16_t readmemw(uint32_t addr) +{ + addr&=0xFFFFFF; + if (addr<0x100000) + { +// printf("Read %08X %04X\n",addr,ns32016ram[addr&0xFFFFF]|(ns32016ram[(addr+1)&0xFFFFF]<<8)); + return ns32016ram[addr&0xFFFFF]|(ns32016ram[(addr+1)&0xFFFFF]<<8); + } + if (addr<0x400000) return 0; + if ((addr&~0x7FFF)==0xF00000) + { + return ns32016rom[addr&0x7FFF]|(ns32016rom[(addr+1)&0x7FFF]<<8); + } + printf("Bad readmemw %08X\n",addr); + n32016_dumpregs(); + exit(-1); +} + +static void writememb(uint32_t addr, uint8_t val) +{ + addr&=0xFFFFFF; +// if (addr==0xFFDC8) printf("Writeb %08X %02X %08X\n",addr,val,pc); + if (addr<0x100000) { ns32016ram[addr]=val; return; } + if (addr==0xF90000) return; + if (addr>=0xFFFFF0) { tube_parasite_write(addr>>1,val); /*printf("Write tube %08X %02X %c\n",addr,val,(val<33)?'.':val);*/ /*if (nsoutput) exit(-1);*/ /*if (val=='K') { n32016_dumpregs(); exit(-1); } */return; } + printf("Bad writememb %08X %02X\n",addr,val); + n32016_dumpregs(); + exit(-1); +} + +static void writememw(uint32_t addr, uint16_t val) +{ + addr&=0xFFFFFF; +// if ((addr&~1)==0xFFDC8) printf("Writew %08X %04X %08X\n",addr,val,pc); + if (addr<0x100000) + { +// printf("Write %08X %04X ",addr,val); + ns32016ram[addr]=val; + ns32016ram[addr+1]=val>>8; +// printf("%02X %02X\n",ns32016ram[addr],ns32016ram[addr+1]); + return; + } + if (addr<0x400000) return; + printf("Bad writememw %08X %04X\n",addr,val); + n32016_dumpregs(); + exit(-1); +} + +static uint32_t genaddr[2]; +static int gentype[2]; + +static uint32_t getdisp() +{ + uint32_t addr=readmemb(pc); pc++; + if (!(addr&0x80)) + { +// printf("8 bit addr %08X\n",addr); + return addr|((addr&0x40)?0xFFFFFF80:0); + } + else if (!(addr&0x40)) + { + addr&=0x3F; + addr=(addr<<8)|readmemb(pc); pc++; +// printf("16 bit addr %08X\n",addr); + return addr|((addr&0x2000)?0xFFFFC000:0); + } + else + { + addr&=0x3F; + addr=(addr<<24)|(readmemb(pc)<<16); pc++; + addr=addr|(readmemb(pc)<<8); pc++; + addr=addr|readmemb(pc); pc++; +// printf("32 bit addr %08X\n",addr); + return addr|((addr&0x20000000)?0xC0000000:0); + } +} + +static int isize=0; +static int ilook[4]={1,2,0,4}; + +static int genindex[2]; +static void getgen1(int gen, int c) +{ + if ((gen&0x1C)==0x1C) + { + genindex[c]=readmemb(pc); + pc++; + } +} + +static int sdiff[2]={0,0}; +static uint32_t nsimm[2]; + +static void getgen(int gen, int c) +{ + uint32_t temp,temp2; +// if (nsoutput&2) printf("Gen %02X %i\n",gen&0x1F,c); + switch (gen&0x1F) + { + case 0: case 1: case 2: case 3: + case 4: case 5: case 6: case 7: + gentype[c]=1; + genaddr[c]=(uint32_t)&r[gen&7]; + break; + case 8: case 9: case 0xA: case 0xB: + case 0xC: case 0xD: case 0xE: case 0xF: + gentype[c]=0; + genaddr[c]=r[gen&7]+getdisp(); +// printf("RDisp %08X\n",genaddr[c]); + break; + case 0x10: /*Frame memory relative*/ + temp=getdisp(); + temp2=getdisp(); +// if (nsoutput) printf("First addr %08X (%08X+%08X\n",fp+temp,fp,temp); + genaddr[c]=readmemw(fp+temp)|(readmemw(fp+temp+2)<<16); +// if (nsoutput) printf("Second addr %08X\n",genaddr[c]); + genaddr[c]+=temp2; +// if (nsoutput) printf("Final addr %08X %08X\n",genaddr[c],temp2); + gentype[c]=0; + break; + case 0x11: /*Stack memory relative*/ + temp=getdisp(); + temp2=getdisp(); +// if (nsoutput) printf("First addr %08X (%08X+%08X\n",sp[SP]+temp,sp[SP],temp); + genaddr[c]=readmemw(sp[SP]+temp)|(readmemw(sp[SP]+temp+2)<<16); +// if (nsoutput) printf("Second addr %08X\n",genaddr[c]); + genaddr[c]+=temp2; +// if (nsoutput) printf("Final addr %08X %08X\n",genaddr[c],temp2); + gentype[c]=0; + break; + case 0x12: /*Static memory relative*/ + temp=getdisp(); + temp2=getdisp(); +// if (nsoutput) printf("First addr %08X (%08X+%08X\n",sb+temp,sb,temp); + genaddr[c]=readmemw(sb+temp)|(readmemw(sb+temp+2)<<16); +// if (nsoutput) printf("Second addr %08X\n",genaddr[c]); + genaddr[c]+=temp2; +// if (nsoutput) printf("Final addr %08X %08X\n",genaddr[c],temp2); + gentype[c]=0; + break; + case 0x14: /*Immediate*/ +/* genaddr[c]=pc; + gentype[c]=0;*/ + gentype[c]=1; + genaddr[c]=(uint32_t)&nsimm[c]; + /*Why can't they just decided on an endian and then stick to it?*/ + if (isize==1) nsimm[c]=readmemb(pc); + else if (isize==2) nsimm[c]=(readmemb(pc)<<8)|readmemb(pc+1); + else nsimm[c]=(readmemb(pc)<<24)|(readmemb(pc+1)<<16)|(readmemb(pc+2)<<8)|readmemb(pc+3); + pc+=isize; +// printf("PC %08X %i\n",pc,isize); + break; + + case 0x15: /*Absolute*/ + gentype[c]=0; + genaddr[c]=getdisp(); +// printf("Disp %08X\n",genaddr[c]); + break; + case 0x16: /*External*/ + gentype[c]=0; + temp=readmemw(mod+4)+(readmemw(mod+6)<<16); + temp+=getdisp(); + temp2=readmemw(temp)+(readmemw(temp+2)<<16); + genaddr[c]=temp2+getdisp(); + break; + case 0x17: /*Stack*/ +// nsoutput=1; + gentype[c]=0; + sdiff[c]=isize; + genaddr[c]=sp[SP]; +// printf("TOS %i %i\n",sdiff,isize); +/* if (c) + { + sp[SP]-=isize; + genaddr[c]=sp[SP]; + } + else + { + genaddr[c]=sp[SP]; + sp[SP]+=isize; + }*/ + break; + + case 0x18: /*FP relative*/ + gentype[c]=0; + genaddr[c]=getdisp()+fp; +// printf("FPAddr %08X %08X\n",genaddr[c],fp); + break; + case 0x19: /*SP relative*/ + gentype[c]=0; + genaddr[c]=getdisp()+sp[SP]; +// printf("SPAddr %08X %08X\n",genaddr[c],sp[SP]); + break; + case 0x1A: /*SB relative*/ + gentype[c]=0; + genaddr[c]=getdisp()+sb; +// if (nsoutput) printf("SBAddr %08X %08X\n",genaddr[c],sb); + break; + case 0x1B: /*PC relative*/ + gentype[c]=0; + genaddr[c]=getdisp()+startpc; +// printf("Addr %08X %08X %08X\n",genaddr[c],pc,startpc); + break; + + case 0x1C: /*EA + Rn*/ + getgen(genindex[c]>>3,c); + if (!gentype[c]) genaddr[c]+=r[genindex[c]&7]; + else genaddr[c]=*(uint32_t *)genaddr[c]+r[genindex[c]&7]; +// if (nsoutput&2) printf("EA + R%i addr %08X %02X\n",genindex[c]&7,genaddr[c],genindex[c]); + gentype[c]=0; + break; + case 0x1D: /*EA + Rn*2*/ + getgen(genindex[c]>>3,c); + if (!gentype[c]) genaddr[c]+=(r[genindex[c]&7]*2); + else genaddr[c]=*(uint32_t *)genaddr[c]+(r[genindex[c]&7]*2); +// printf("EA + Rn*2 addr %08X\n",genaddr[c]); + gentype[c]=0; + break; + + + default: + printf("Bad NS32016 gen mode %02X\n",gen&0x1F); + n32016_dumpregs(); + exit(-1); + } +} + +#define readgenb(c,temp) if (gentype[c]) temp=*(uint8_t *)genaddr[c]; \ + else \ + { \ + temp=readmemb(genaddr[c]); \ + if (sdiff[c]) genaddr[c]=sp[SP]=sp[SP]+sdiff[c]; \ + } + +#define readgenw(c,temp) if (gentype[c]) temp=*(uint16_t *)genaddr[c]; \ + else \ + { \ + temp=readmemw(genaddr[c]); \ + if (sdiff[c]) genaddr[c]=sp[SP]=sp[SP]+sdiff[c]; \ + } + +#define readgenl(c,temp) if (gentype[c]) temp=*(uint32_t *)genaddr[c]; \ + else \ + { \ + temp=readmemw(genaddr[c])|(readmemw(genaddr[c]+2)<<16); \ + if (sdiff[c]) genaddr[c]=sp[SP]=sp[SP]+sdiff[c]; \ + } + +#define readgenq(c,temp) if (gentype[c]) temp=*(uint64_t *)genaddr[c]; \ + else \ + { \ + temp=readmemw(genaddr[c])|(readmemw(genaddr[c]+2)<<16); \ + if (sdiff[c]) genaddr[c]=sp[SP]=sp[SP]+sdiff[c]; \ + temp|=((readmemw(genaddr[c])|(readmemw(genaddr[c]+2)<<16))<<16); \ + if (sdiff[c]) genaddr[c]=sp[SP]=sp[SP]+sdiff[c]; \ + } + +#define writegenb(c,temp) if (gentype[c]) *(uint8_t *)genaddr[c]=temp; \ + else \ + { \ + if (sdiff[c]) genaddr[c]=sp[SP]=sp[SP]-sdiff[c]; \ + writememb(genaddr[c],temp); \ + } + +#define writegenw(c,temp) if (gentype[c]) *(uint16_t *)genaddr[c]=temp; \ + else \ + { \ + if (sdiff[c]) genaddr[c]=sp[SP]=sp[SP]-sdiff[c]; \ + writememw(genaddr[c],temp); \ + } + +#define writegenl(c,temp) if (gentype[c]) *(uint32_t *)genaddr[c]=temp; \ + else \ + { \ + if (sdiff[c]) genaddr[c]=sp[SP]=sp[SP]-sdiff[c]; \ + writememw(genaddr[c],temp); \ + writememw(genaddr[c]+2,temp>>16); \ + } + + +static uint16_t oldpsr; + +void n32016_exec() +{ + uint32_t opcode; + uint32_t temp = 0,temp2,temp3,temp4; + uint64_t temp64; + int c; + while (tubecycles>0) + { + sdiff[0]=sdiff[1]=0; +// if (pc==0xF00A3C) nsoutput=1; +// if (pc==0xF00A73) nsoutput=0; + startpc=pc; + opcode=readmemb(pc); +// if (nsoutput && (pc<0xF000A0 || pc>0xF000B3)) printf("%08X %08X %08X %08X %08X %08X %04X : %02X %02X %02X %02X\n",pc,r[0],r[1],r[2],r[3],sp[SP],psr,opcode,readmemb(pc+1),readmemb(pc+2),readmemb(pc+3)); + pc++; + isize=ilook[opcode&3]; + switch (opcode) + { + case 0x0E: /*String instruction*/ + opcode|=(readmemb(pc)<<8); pc++; + opcode|=(readmemb(pc)<<16); pc++; + temp2=(opcode>>15)&0xF; + switch ((opcode>>8)&0x3F) + { + case 0x00: /*MOVS byte*/ + if (temp2&3) + { + printf("Bad NS32016 MOVS %02X %04X %01X\n",(opcode>>15)&0xF,opcode,(opcode>>15)&0xF); + n32016_dumpregs(); + exit(-1); + } +// printf("MOVSB %08X %08X %08X %08X\n",r[1],r[2],r[0],pc); + while (r[0]) + { + temp=readmemb(r[1]); r[1]++; + if ((temp2&0xC)==0xC && temp==r[4]) { /*printf("Break EQ\n");*/ break; } + if ((temp2&0xC)==0x4 && temp!=r[4]) { /*printf("Break NE\n");*/ break; } + writememb(r[2],temp); r[2]++; + r[0]--; +// printf("MOVS %02X %08X %08X %08X %01X\n",temp,r[1],r[2],r[4],temp); + } + break; + case 0x03: /*MOVS dword*/ +// printf("MOVSD %08X %08X %08X %08X\n",r[1],r[2],r[0],pc); + if (temp2) + { + printf("Bad NS32016 MOVS %02X %04X %01X\n",(opcode>>15)&0xF,opcode,(opcode>>15)&0xF); + n32016_dumpregs(); + exit(-1); + } + while (r[0]) + { + temp=readmemw(r[1]); temp|=(readmemw(r[1]+2)<<16); r[1]+=4; + writememw(r[2],temp); writememw(r[2]+2,temp>>16); r[2]+=4; + r[0]--; + } + break; + + case 0x0B: /*SETCFG*/ + nscfg=temp; + break; + + default: + printf("Bad NS32016 0E opcode %02X %04X %01X\n",(opcode>>8)&0x3F,opcode,(opcode>>15)&0xF); + n32016_dumpregs(); + exit(-1); + } + break; + + case 0x1C: case 0x9C: /*CMPQ byte*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen(opcode>>11,0); + temp2=(opcode>>7)&0xF; if (temp2&8) temp2|=0xFFFFFFF0; + readgenb(0,temp); +// if (!temp) nsoutput=1; + psr&=~(Z_FLAG|N_FLAG|L_FLAG); + if (temp==temp2) psr|=Z_FLAG; + if (temp2>temp) psr|=L_FLAG; + if (((signed char)temp2)>((signed char)temp)) psr|=N_FLAG; + break; + case 0x1F: case 0x9F: /*CMPQ dword*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen(opcode>>11,0); + temp2=(opcode>>7)&0xF; if (temp2&8) temp2|=0xFFFFFFF0; + readgenl(0,temp); +// if (!temp) nsoutput=1; + psr&=~(Z_FLAG|N_FLAG|L_FLAG); + if (temp==temp2) psr|=Z_FLAG; + if (temp2>temp) psr|=L_FLAG; + if (((signed long)temp2)>((signed long)temp)) psr|=N_FLAG; +// printf("CMPQ %08X %08X %i %i\n",temp,temp2,temp>temp2,((signed long)temp)>((signed long)temp2)); + break; + case 0x5C: case 0xDC: /*MOVQ byte*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen(opcode>>11,0); + temp=(opcode>>7)&0xF; if (temp&8) temp|=0xFFFFFFF0; + writegenb(0,temp); + break; + case 0x5D: case 0xDD: /*MOVQ word*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen(opcode>>11,0); + temp=(opcode>>7)&0xF; if (temp&8) temp|=0xFFFFFFF0; + writegenw(0,temp); + break; + case 0x5F: case 0xDF: /*MOVQ dword*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen(opcode>>11,0); + temp=(opcode>>7)&0xF; if (temp&8) temp|=0xFFFFFFF0; + writegenl(0,temp); + break; + case 0x0C: case 0x8C: /*ADDQ byte*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen(opcode>>11,0); + temp2=(opcode>>7)&0xF; if (temp2&8) temp2|=0xFFFFFFF0; + readgenb(0,temp); + psr&=~(C_FLAG|V_FLAG); + if ((temp+temp2)&0x100) psr|=C_FLAG; + if ((temp^(temp+temp2))&(temp2^(temp+temp2))&0x80) psr|=V_FLAG; + temp+=temp2; + writegenb(0,temp); + break; + case 0x0D: case 0x8D: /*ADDQ word*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen(opcode>>11,0); + temp2=(opcode>>7)&0xF; if (temp2&8) temp2|=0xFFFFFFF0; + readgenw(0,temp); + psr&=~(C_FLAG|V_FLAG); + if ((temp+temp2)&0x10000) psr|=C_FLAG; + if ((temp^(temp+temp2))&(temp2^(temp+temp2))&0x8000) psr|=V_FLAG; + temp+=temp2; + writegenw(0,temp); + break; + case 0x0F: case 0x8F: /*ADDQ dword*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen(opcode>>11,0); + temp2=(opcode>>7)&0xF; if (temp2&8) temp2|=0xFFFFFFF0; + readgenl(0,temp); + psr&=~(C_FLAG|V_FLAG); + if ((temp+temp2)>11,0); + getgen(opcode>>11,0); +// readgenb(0,temp); +temp=0; + switch ((opcode>>7)&0xF) + { + case 0x0: if (psr&Z_FLAG) temp=1; break; + case 0x1: if (!(psr&Z_FLAG)) temp=1; break; + case 0x2: if (psr&C_FLAG) temp=1; break; + case 0x3: if (!(psr&C_FLAG)) temp=1; break; + case 0x4: if (psr&L_FLAG) temp=1; break; + case 0x5: if (!(psr&L_FLAG)) temp=1; break; + case 0x6: if (psr&N_FLAG) temp=1; break; + case 0x7: if (!(psr&N_FLAG)) temp=1; break; + case 0x8: if (!(psr&(L_FLAG|Z_FLAG))) temp=1; break; + case 0x9: if (psr&(L_FLAG|Z_FLAG)) temp=1; break; + case 0xA: if (!(psr&(N_FLAG|Z_FLAG))) temp=1; break; + case 0xB: if (psr&(N_FLAG|Z_FLAG)) temp=1; break; + case 0xC: if (psr&Z_FLAG) temp=1; break; + case 0xD: if (!(psr&Z_FLAG)) temp=1; break; + case 0xE: temp=1; break; + case 0xF: break; + } + writegenb(0,temp); + break; + case 0x4C: case 0xCC: /*ACBB*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen(opcode>>11,0); + temp2=(opcode>>7)&0xF; if (temp2&8) temp2|=0xFFFFFFF0; + readgenb(0,temp); + temp+=temp2; + writegenb(0,temp); + temp2=getdisp(); + if (temp&0xFF) pc=startpc+temp2; + break; + case 0x4F: case 0xCF: /*ACBD*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen(opcode>>11,0); + temp2=(opcode>>7)&0xF; if (temp2&8) temp2|=0xFFFFFFF0; + readgenl(0,temp); + temp+=temp2; + writegenl(0,temp); + temp2=getdisp(); + if (temp) pc=startpc+temp2; + break; + + case 0x00: case 0x40: case 0x80: case 0xC0: /*ADD byte*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen1(opcode>>6,1); + getgen(opcode>>11,0); + getgen(opcode>>6,1); + readgenb(0,temp); + readgenb(1,temp2); + psr&=~(C_FLAG|V_FLAG); + if ((temp+temp2)&0x100) psr|=C_FLAG; + if ((temp^(temp+temp2))&(temp2^(temp+temp2))&0x80) psr|=V_FLAG; + temp2+=temp; + writegenb(1,temp2); + break; + case 0x03: case 0x43: case 0x83: case 0xC3: /*ADD dword*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen1(opcode>>6,1); + getgen(opcode>>11,0); + getgen(opcode>>6,1); + readgenl(0,temp); + readgenl(1,temp2); + psr&=~(C_FLAG|V_FLAG); + if ((temp+temp2)>11,0); + getgen1(opcode>>6,1); + getgen(opcode>>11,0); + getgen(opcode>>6,1); + readgenb(0,temp); + readgenb(1,temp2); + psr&=~(Z_FLAG|N_FLAG|L_FLAG); + if (temp==temp2) psr|=Z_FLAG; + if (temp>temp2) psr|=L_FLAG; + if (((signed char)temp)>((signed char)temp2)) psr|=N_FLAG; + break; + case 0x07: case 0x47: case 0x87: case 0xC7: /*CMP dword*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen1(opcode>>6,1); + nsoutput|=2; + getgen(opcode>>11,0); + getgen(opcode>>6,1); + nsoutput&=~2; + readgenl(0,temp); + readgenl(1,temp2); + +// printf("CMP %08X %08X %i %i\n",temp,temp2,temp>temp2,(((signed long)temp)>((signed long)temp2))); + psr&=~(Z_FLAG|N_FLAG|L_FLAG); + if (temp==temp2) psr|=Z_FLAG; + if (temp>temp2) psr|=L_FLAG; + if (((signed long)temp)>((signed long)temp2)) psr|=N_FLAG; + break; + case 0x08: case 0x48: case 0x88: case 0xC8: /*BIC byte*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen1(opcode>>6,1); + getgen(opcode>>11,0); + getgen(opcode>>6,1); + readgenb(0,temp); + readgenb(1,temp2); + temp2&=~temp; + writegenb(1,temp2); + break; + case 0x09: case 0x49: case 0x89: case 0xC9: /*BIC word*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen1(opcode>>6,1); + getgen(opcode>>11,0); + getgen(opcode>>6,1); + readgenw(0,temp); + readgenw(1,temp2); + temp2&=~temp; + writegenw(1,temp2); + break; + + case 0x14: case 0x54: case 0x94: case 0xD4: /*MOV byte*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen1(opcode>>6,1); + getgen(opcode>>11,0); + getgen(opcode>>6,1); + readgenb(0,temp); + writegenb(1,temp); + break; + case 0x15: case 0x55: case 0x95: case 0xD5: /*MOV word*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen1(opcode>>6,1); + getgen(opcode>>11,0); + getgen(opcode>>6,1); + readgenw(0,temp); + writegenw(1,temp); + break; + case 0x17: case 0x57: case 0x97: case 0xD7: /*MOV dword*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen1(opcode>>6,1); + getgen(opcode>>11,0); + getgen(opcode>>6,1); + // printf("Read from %08X write to %08X\n",genaddr[0],genaddr[1]); + readgenl(0,temp); +// printf("Dat %08X\n",temp); + writegenl(1,temp); + break; + case 0x18: case 0x58: case 0x98: case 0xB8: /*OR byte*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen1(opcode>>6,1); + getgen(opcode>>11,0); + getgen(opcode>>6,1); + readgenb(0,temp); + readgenb(1,temp2); + temp2|=temp; + writegenb(1,temp2); + break; + + case 0x23: case 0x63: case 0xA3: case 0xE3: /*SUB dword*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen1(opcode>>6,1); + getgen(opcode>>11,0); + getgen(opcode>>6,1); + readgenl(0,temp); + readgenl(1,temp2); + psr&=~(C_FLAG|V_FLAG); + if ((temp+temp2)>temp) psr|=C_FLAG; + if ((temp^temp2)&(temp^(temp+temp2))&0x80000000) psr|=V_FLAG; + temp2-=temp; + writegenl(1,temp2); + break; + case 0x27: case 0x67: case 0xA7: case 0xE7: /*ADDR dword*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen1(opcode>>6,1); + getgen(opcode>>11,0); + getgen(opcode>>6,1); +// printf("Writegenl %08X ",sp[SP]); + writegenl(1,genaddr[0]); +// printf("%08X\n",sp[SP]); + break; + + case 0x28: case 0x68: case 0xA8: case 0xE8: /*AND byte*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen1(opcode>>6,1); + getgen(opcode>>11,0); + getgen(opcode>>6,1); + readgenb(0,temp); + readgenb(1,temp2); + temp2&=temp; + writegenb(1,temp2); + break; + case 0x2B: case 0x6B: case 0xAB: case 0xEB: /*AND dword*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen1(opcode>>6,1); + getgen(opcode>>11,0); + getgen(opcode>>6,1); + readgenl(0,temp); + readgenl(1,temp2); + temp2&=temp; + writegenl(1,temp2); + break; + case 0x34: case 0x74: case 0xB4: case 0xF4: /*TBITB*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen1(opcode>>6,1); + getgen(opcode>>11,0); + getgen(opcode>>6,1); + readgenb(0,temp); + readgenb(1,temp2); + psr&=~F_FLAG; + temp&=7; + if (temp2&(1<>11,0); + getgen1(opcode>>6,1); + getgen(opcode>>11,0); + getgen(opcode>>6,1); + readgenl(0,temp); + readgenl(1,temp2); + psr&=~F_FLAG; + temp&=31; + if (temp2&(1<>11,0); + getgen1(opcode>>6,1); + if ((opcode&0x3F)==0x17) isize=1; + getgen(opcode>>11,0); + isize=ilook[opcode&3]; + getgen(opcode>>6,1); + switch (opcode&0x3F) + { + case 8: /*CBITB*/ + readgenb(0,temp); temp&=31; + if (gentype[1]) { readgenl(1,temp2); } + else { readgenb(1,temp2); } + if (temp2&(1<>=((temp^0xFF)+1); + else temp2<<=temp; + writegenl(1,temp2); + break; + case 0x30: /*ABSB*/ + readgenb(0,temp); + if (temp&0x80) temp=(temp^0xFF)+1; + writegenb(1,temp); + break; + case 0x34: /*COMB*/ + readgenb(0,temp); + writegenb(1,~temp); + break; + + default: + printf("Bad NS32016 4E opcode %04X %01X\n",opcode,opcode&0x3F); + n32016_dumpregs(); + exit(-1); + } + break; + + case 0x7C: /*Type 3 byte*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen(opcode>>11,0); + switch ((opcode>>7)&0xF) + { + case 2: /*BICPSR*/ + readgenb(0,temp); + psr&=~temp; + break; + case 6: /*BISPSR*/ + readgenb(0,temp); + psr|=temp; +// nsoutput=1; + break; + case 0xA: /*ADJSP*/ + readgenb(0,temp2); + if (temp2&0x80) temp2|=0xFFFFFF00; + sp[SP]-=temp2; + break; + case 0xE: /*CASE*/ + readgenb(0,temp); + if (temp&0x80) temp|=0xFFFFFF00; + pc=startpc+temp; + break; + + default: + printf("Bad NS32016 7C opcode %04X %01X\n",opcode,(opcode>>7)&0xF); + n32016_dumpregs(); + exit(-1); + } + break; + + case 0x7D: /*Type 3 word*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen(opcode>>11,0); + switch ((opcode>>7)&0xF) + { + case 2: /*BICPSR*/ + readgenw(0,temp); + psr&=~temp; + break; + case 6: /*BISPSR*/ + readgenw(0,temp); + psr|=temp; + break; + case 0xA: /*ADJSP*/ + readgenw(0,temp2); + if (temp&0x8000) temp|=0xFFFF0000; + sp[SP]-=temp2; + break; + case 0xE: /*CASE*/ + readgenw(0,temp); + if (temp&0x8000) temp|=0xFFFF0000; + pc=startpc+temp; + break; + + default: + printf("Bad NS32016 7D opcode %04X %01X\n",opcode,(opcode>>7)&0xF); + n32016_dumpregs(); + exit(-1); + } + break; + case 0x7F: /*Type 3 dword*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen(opcode>>11,0); + switch ((opcode>>7)&0xF) + { + case 0: /*CXPD*/ + readgenl(0,temp); +// printf("CXPD %08X\n",temp); + pushw(0); + pushw(mod); + pushd(pc); + mod=temp&0xFFFF; + temp3=temp>>16; +// printf("MOD %04X OFFSET %04X\n",mod,temp3); + sb=readmemw(mod)|(readmemw(mod+2)<<16); +// printf("SB = %08X\n",sb); + temp2=readmemw(mod+8)|(readmemw(mod+10)<<16); +// printf("PC temp2 = %08X\n",temp2); + pc=temp2+temp3; +// printf("PC = %08X\n",pc); + break; + case 4: /*JUMP*/ + if (gentype[0]) pc=*(uint32_t *)genaddr[0]; + else pc=genaddr[0]; + break; + case 0xA: /*ADJSP*/ + readgenl(0,temp2); + sp[SP]-=temp2; + break; + + default: + printf("Bad NS32016 7F opcode %04X %01X\n",opcode,(opcode>>7)&0xF); + n32016_dumpregs(); + exit(-1); + } + break; + + case 0x2F: case 0xAF: /*SPR*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen(opcode>>11,0); + switch ((opcode>>7)&0xF) + { + case 0x8: writegenl(0,fp); break; + case 0x9: writegenl(0,sp[SP]); break; + case 0xA: writegenl(0,sb); break; + case 0xF: writegenl(0,mod); /*nsoutput=1; */break; + + default: + printf("Bad SPR reg %01X\n",(opcode>>7)&0xF); + n32016_dumpregs(); + exit(-1); + } + break; + case 0x6C: case 0xEC: /*LPRB*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen(opcode>>11,0); + readgenb(0,temp); + switch ((opcode>>7)&0xF) + { + case 0: psr=(psr&0xFF00)|(temp&0xFF); break; + case 9: sp[SP]=temp; break; + + default: + printf("Bad LPRB reg %01X\n",(opcode>>7)&0xF); + n32016_dumpregs(); + exit(-1); + } + break; + case 0x6D: case 0xED: /*LPRW*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen(opcode>>11,0); + readgenw(0,temp); + switch ((opcode>>7)&0xF) + { + case 15: mod=temp; break; + + default: + printf("Bad LPRW reg %01X\n",(opcode>>7)&0xF); + n32016_dumpregs(); + exit(-1); + } + break; + case 0x6F: case 0xEF: /*LPRD*/ + opcode|=(readmemb(pc)<<8); pc++; + getgen1(opcode>>11,0); + getgen(opcode>>11,0); + readgenl(0,temp); + switch ((opcode>>7)&0xF) + { + case 9: sp[SP]=temp; break; + case 0xA: sb=temp; break; + case 0xE: intbase=temp; /*printf("INTBASE %08X %08X\n",temp,pc); */break; + + default: + printf("Bad LPRD reg %01X\n",(opcode>>7)&0xF); + n32016_dumpregs(); + exit(-1); + } + break; + + case 0xCE: /*Format 7*/ + opcode=readmemb(pc); pc++; + opcode|=(readmemb(pc)<<8); pc++; + isize=ilook[opcode&3]; + getgen1(opcode>>11,0); + getgen1(opcode>>6,1); + getgen(opcode>>11,0); + getgen(opcode>>6,1); + switch (opcode&0x3F) + { + case 0x00: /*MOVMB*/ + temp=getdisp(); + while (temp) + { + temp2=readmemb(genaddr[0]); genaddr[0]++; + writememb(genaddr[1],temp2); genaddr[1]++; + temp--; + } + break; + case 0x08: /*INSSB*/ + temp3=readmemb(pc); pc++; + readgenb(0,temp); + readgenb(1,temp2); + for (c=0;c<=(temp3&31);c++) + { + temp2&=~(1<<((c+(temp3>>3))&7)); + if (temp&(1<>3))&7)); + } + writegenb(1,temp2); + break; + case 0x18: /*MOVZBD*/ +// printf("Read MOVZ from %08X\n",genaddr[0]); + readgenb(0,temp); + if (sdiff[1]) sdiff[1]=4; + writegenl(1,temp) + break; + case 0x19: /*MOVZWD*/ + readgenw(0,temp); + if (sdiff[1]) sdiff[1]=4; + writegenl(1,temp) + break; + case 0x2F: /*DEID*/ + readgenl(0,temp); + readgenq(1,temp64); + if (!temp) + { + printf("Divide by zero - DEID CE\n"); + n32016_dumpregs(); + exit(-1); + } + temp3=temp64%temp; + writegenl(1,temp3); + temp3=temp64/temp; + if (gentype[1]) *(uint32_t *)(genaddr[1]+4)=temp3; + else { writememw(genaddr[1]+4,temp3); writememw(genaddr[1]+4+2,temp3>>16); } + break; + case 0x33: /*QUOD*/ + readgenl(0,temp); + readgenl(1,temp2); + if (!temp) + { + printf("Divide by zero - QUOD CE\n"); + n32016_dumpregs(); + exit(-1); + } + temp2/=temp; + writegenl(1,temp2); + break; + case 0x37: /*REMD*/ + readgenl(0,temp); + readgenl(1,temp2); + if (!temp) + { + printf("Divide by zero - QUOD CE\n"); + n32016_dumpregs(); + exit(-1); + } + temp2%=temp; + writegenl(1,temp2); + break; + + default: + printf("Bad NS32016 CE opcode %04X %01X\n",opcode,opcode&0x3F); + n32016_dumpregs(); + exit(-1); + } + break; + + case 0x2E: case 0x6E: case 0xAE: case 0xEE: /*Type 8*/ + opcode|=(readmemb(pc)<<8); pc++; + opcode|=(readmemb(pc)<<16); pc++; + getgen1(opcode>>19,0); + getgen1(opcode>>14,1); + getgen(opcode>>19,0); + getgen(opcode>>14,1); + temp=((opcode>>6)&3)|((opcode&0x400)>>8); + temp=(temp<<2)|((opcode>>8)&3); + switch (temp) + { + case 0: /*EXT*/ + temp=r[(opcode>>11)&7]&31; + temp2=getdisp(); + readgenl(0,temp3); + temp4=0; + for (c=0;c=temp3 && temp3>=temp2) + { + r[(opcode>>11)&7]=temp3-temp2; + psr&=~F_FLAG; + } + else + psr|=F_FLAG; + break; + +// printf("EXT - R%i %08X R%i %08X R%i %08X %08X\n",temp,genaddr[0],((int)genaddr[0]-(int)&r[0])/4,genaddr[1],((int)genaddr[1]-(int)&r[0])/4,temp2,pc); +// exit(-1); + + default: + printf("Bad NS32016 Type 8 opcode %04X %01X %i\n",opcode,temp,(opcode>>11)&7); + n32016_dumpregs(); + exit(-1); + } + break; + + case 0x02: /*BSR*/ + temp=getdisp(); + pushd(pc); + pc=startpc+temp; + break; + case 0x12: /*RET*/ + temp=getdisp(); + pc=popd(); + sp[SP]+=temp; + break; + case 0x22: /*CXP*/ + temp=getdisp(); + pushw(0); + pushw(mod); + pushd(pc); +// printf("CXP %08X\n",temp); + temp2=readmemw(mod+4)+(readmemw(mod+6)<<16)+(4*temp); +// printf("%08X\n",temp2); + temp=readmemw(temp2)+(readmemw(temp2+2)<<16); +// printf("%08X\n",temp); + mod=temp&0xFFFF; +// printf("MOD=%04X\n",mod); + sb=readmemw(mod)+(readmemw(mod+2)<<16); +// printf("SB=%08X\n",sb); + pc=readmemw(mod+8)+(readmemw(mod+10)<<16)+(temp>>16); +// printf("PC=%08X\n",pc); + nsoutput=1; + break; + case 0x32: /*RXP*/ +// nsoutput=1; + temp=getdisp(); + pc=popd(); + temp2=popd(); + mod=temp2&0xFFFF; + sp[SP]+=temp; + sb=readmemw(mod)|(readmemw(mod+2)<<16); + break; + case 0x42: /*RETT*/ + temp=getdisp(); + pc=popd(); + mod=popw(); + psr=popw(); + sp[SP]+=temp; + sb=readmemw(mod)|(readmemw(mod+2)<<16); + break; + case 0x62: /*SAVE*/ + temp=readmemb(pc); pc++; + for (c=0;c<8;c++) + { + if (temp&(1<>16; +// printf("MOD %04X OFFSET %04X\n",mod,temp3); + sb=readmemw(mod)|(readmemw(mod+2)<<16); +// printf("SB = %08X\n",sb); + temp2=readmemw(mod+8)|(readmemw(mod+10)<<16); +// printf("PC temp2 = %08X\n",temp2); + pc=temp2+temp3; + //printf("PC = %08X\n",pc); + break; + + case 0x0A: /*BEQ*/ + temp=getdisp(); + if (psr&Z_FLAG) pc=startpc+temp; + break; + case 0x1A: /*BNE*/ + temp=getdisp(); + if (!(psr&Z_FLAG)) pc=startpc+temp; + break; + case 0x4A: /*BH*/ + temp=getdisp(); + if (psr&L_FLAG) pc=startpc+temp; + break; + case 0x5A: /*BLS*/ + temp=getdisp(); + if (!(psr&L_FLAG)) pc=startpc+temp; + break; + case 0x6A: /*BGT*/ + temp=getdisp(); + if (psr&N_FLAG) pc=startpc+temp; + break; + case 0x7A: /*BLE*/ + temp=getdisp(); + if (!(psr&N_FLAG)) pc=startpc+temp; + break; + case 0x8A: /*BFS*/ + temp=getdisp(); + if (psr&F_FLAG) pc=startpc+temp; + break; + case 0x9A: /*BFC*/ + temp=getdisp(); + if (!(psr&F_FLAG)) pc=startpc+temp; + break; + case 0xAA: /*BLO*/ + temp=getdisp(); + if (!(psr&(L_FLAG|Z_FLAG))) pc=startpc+temp; + break; + case 0xBA: /*BHS*/ + temp=getdisp(); + if (psr&(L_FLAG|Z_FLAG)) pc=startpc+temp; + break; + case 0xCA: /*BLT*/ + temp=getdisp(); + if (!(psr&(N_FLAG|Z_FLAG))) pc=startpc+temp; + break; + case 0xDA: /*BGE*/ + temp=getdisp(); + if (psr&(N_FLAG|Z_FLAG)) pc=startpc+temp; + break; + case 0xEA: /*BR*/ + pc=startpc+getdisp(); + break; + + default: + printf("Bad NS32016 opcode %02X\n",opcode); + n32016_dumpregs(); + exit(-1); + } + tubecycles-=8; + if (tube_irq&2) + { + temp=psr; + psr&=~0xF00; + pushw(temp); + pushw(mod); + pushd(pc); +// printf("NMI!\n"); + temp=readmemw(intbase+(1*4))|(readmemw(intbase+(1*4)+2)<<16); + mod=temp&0xFFFF; + temp3=temp>>16; +// printf("MOD %04X OFFSET %04X\n",mod,temp3); + sb=readmemw(mod)|(readmemw(mod+2)<<16); +// printf("SB = %08X\n",sb); + temp2=readmemw(mod+8)|(readmemw(mod+10)<<16); +// printf("PC temp2 = %08X\n",temp2); + pc=temp2+temp3; +// printf("PC = %08X\n",pc); + } + if ((tube_irq&1) && (psr&0x800)) + { + temp=psr; + psr&=~0xF00; + pushw(temp); + pushw(mod); + pushd(pc); +// printf("Interrupt!\n"); + temp=readmemw(intbase)|(readmemw(intbase+2)<<16); + mod=temp&0xFFFF; + temp3=temp>>16; +// printf("MOD %04X OFFSET %04X\n",mod,temp3); + sb=readmemw(mod)|(readmemw(mod+2)<<16); +// printf("SB = %08X\n",sb); + temp2=readmemw(mod+8)|(readmemw(mod+10)<<16); +// printf("PC temp2 = %08X\n",temp2); + pc=temp2+temp3; +// printf("PC = %08X\n",pc); +// nsoutput=1; + } +/* if ((oldpsr^psr)&0x800) + { + if (psr&0x800) printf("INT enabled at %08X\n",startpc); + else printf("INT disabled at %08X\n",startpc); + }*/ + oldpsr=psr; + } +} diff --git a/src/32016.h b/src/32016.h index 3e78a71f..4e80014b 100644 --- a/src/32016.h +++ b/src/32016.h @@ -1,4 +1,4 @@ -void n32016_init(); -void n32016_reset(); -void n32016_exec(); -void n32016_close(); +void n32016_init(); +void n32016_reset(); +void n32016_exec(); +void n32016_close(); diff --git a/src/6502.c b/src/6502.c index 138f6d29..a9c14611 100644 --- a/src/6502.c +++ b/src/6502.c @@ -1,4858 +1,4858 @@ -/*B-em v2.2 by Tom Walker - 6502/65c02 host CPU emulation*/ - -#include -#include "b-em.h" - -#include "6502.h" -#include "acia.h" -#include "adc.h" -#include "debugger.h" -#include "disc.h" -#include "i8271.h" -#include "ide.h" -#include "mem.h" -#include "model.h" -#include "mouse.h" -#include "serial.h" -#include "sid_b-em.h" -#include "sound.h" -#include "tape.h" -#include "tube.h" -#include "via.h" -#include "sysvia.h" -#include "uservia.h" -#include "video.h" -#include "wd1770.h" - - -int tubecycle; - -int output = 0; -int timetolive = 0; - -#define polltime(c) { cycles -= (c); \ - sysvia.t1c -= (c); if (!(sysvia.acr & 0x20)) sysvia.t2c -= (c); if (sysvia.t1c < -3 || sysvia.t2c < -3) sysvia_updatetimers(); \ - uservia.t1c -= (c); if (!(uservia.acr & 0x20)) uservia.t2c -= (c); if (uservia.t1c < -3 || uservia.t2c < -3) uservia_updatetimers(); \ - video_poll(c); \ - otherstuffcount -= (c); \ - if (motoron) \ - { \ - if (fdc_time) { fdc_time -= (c); if (fdc_time <= 0) fdc_callback(); } \ - disc_time -= (c); if (disc_time <= 0) { disc_time += 16; disc_poll(); } \ - } \ - tubecycle += (c); \ - } - - -static int cycles; -static int otherstuffcount=0; -static int romsel; -static int ram4k, ram8k, ram12k, ram20k; - -static int FEslowdown[8] = {1, 0, 1, 1, 0, 0, 1, 0}; -static int RAMbank[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - - -static uint8_t *memlook[2][256]; -static int memstat[2][256]; -static int vis20k=0; - -static uint8_t acccon; - -uint8_t readmem(uint16_t addr) -{ - - if (debugon) debug_read(addr); - if (pc == addr) fetchc[addr] = 31; - else readc[addr] = 31; - if (memstat[vis20k][addr >> 8]) return memlook[vis20k][addr >> 8][addr]; - if (MASTER && (acccon & 0x40) && addr >= 0xFC00) return os[addr & 0x3FFF]; - if (addr < 0xFE00 || FEslowdown[(addr >> 5) & 7]) { if (cycles & 1) { polltime(2); } else { polltime(1); } } - - switch (addr&~3) - { - case 0xFC20: case 0xFC24: case 0xFC28: case 0xFC2C: - case 0xFC30: case 0xFC34: case 0xFC38: case 0xFC3C: - if (sound_beebsid) return sid_read(addr); - break; - - case 0xFC40: case 0xFC44: case 0xFC48: case 0xFC4C: - case 0xFC50: case 0xFC54: case 0xFC58: case 0xFC5C: - if (ide_enable) return ide_read(addr); - break; - - case 0xFE00: case 0xFE04: return crtc_read(addr); - - case 0xFE08: case 0xFE0C: return acia_read(addr); - - case 0xFE10: case 0xFE14: return serial_read(addr); - - case 0xFE18: if (MASTER) return adc_read(addr); break; - - case 0xFE24: case 0xFE28: if (MASTER) return wd1770_read(addr); break; - - case 0xFE34: if (MASTER) return acccon; break; - - case 0xFE40: case 0xFE44: case 0xFE48: case 0xFE4C: - case 0xFE50: case 0xFE54: case 0xFE58: case 0xFE5C: - return sysvia_read(addr); - - case 0xFE60: case 0xFE64: case 0xFE68: case 0xFE6C: - case 0xFE70: case 0xFE74: case 0xFE78: case 0xFE7C: - return uservia_read(addr); - - case 0xFE80: case 0xFE84: case 0xFE88: case 0xFE8C: - case 0xFE90: case 0xFE94: case 0xFE98: case 0xFE9C: - if (!MASTER) - { - if (WD1770) return wd1770_read(addr); - return i8271_read(addr); - } - break; - - case 0xFEC0: case 0xFEC4: case 0xFEC8: case 0xFECC: - case 0xFED0: case 0xFED4: case 0xFED8: case 0xFEDC: - if (!MASTER) return adc_read(addr); - break; - - case 0xFEE0: case 0xFEE4: case 0xFEE8: case 0xFEEC: - case 0xFEF0: case 0xFEF4: case 0xFEF8: case 0xFEFC: - return tube_host_read(addr); - } - if (addr>=0xFC00 && addr<0xFE00) return 0xFF; - return addr>>8; -} - -void writemem(uint16_t addr, uint8_t val) -{ - int c; - - if (debugon) debug_write(addr,val); - writec[addr] = 31; - if (memstat[vis20k][addr >> 8] == 1) { memlook[vis20k][addr >> 8][addr]=val; return; } - if (addr < 0xFC00 || addr >= 0xFF00) return; - if (addr < 0xFE00 || FEslowdown[(addr >> 5) & 7]) { if (cycles & 1) { polltime(2); } else { polltime(1); } } - - switch (addr&~3) - { - case 0xFC20: case 0xFC24: case 0xFC28: case 0xFC2C: - case 0xFC30: case 0xFC34: case 0xFC38: case 0xFC3C: - if (sound_beebsid) sid_write(addr, val); - break; - - case 0xFC40: case 0xFC44: case 0xFC48: case 0xFC4C: - case 0xFC50: case 0xFC54: case 0xFC58: case 0xFC5C: - ide_write(addr, val); - break; - - case 0xFE00: case 0xFE04: crtc_write(addr, val); break; - - case 0xFE08: case 0xFE0C: acia_write(addr, val); break; - - case 0xFE10: case 0xFE14: serial_write(addr, val); break; - - case 0xFE18: if (MASTER) adc_write(addr, val); break; - - case 0xFE20: videoula_write(addr, val); break; - - case 0xFE24: if (MASTER) wd1770_write(addr, val); else videoula_write(addr, val); break; - - case 0xFE28: if (MASTER) wd1770_write(addr, val); break; - - case 0xFE30: - ram_fe30 = val; - for (c = 128; c < 192; c++) memlook[0][c] = memlook[1][c] = &rom[(val & 15) << 14] - 0x8000; - for (c = 128; c < 192; c++) memstat[0][c] = memstat[1][c] = swram[val & 15] ? 1 : 2; - romsel = (val & 15) << 14; - ram4k = ((val & 0x80) && MASTER); - ram12k = ((val & 0x80) && BPLUS); - RAMbank[0xA] = ram12k; - if (ram4k) - { - for (c = 128; c < 144; c++) memlook[0][c] = memlook[1][c] = ram; - for (c = 128; c < 144; c++) memstat[0][c] = memstat[1][c] = 1; - } - if (ram12k) - { - for (c = 128; c < 176; c++) memlook[0][c] = memlook[1][c] = ram; - for (c = 128; c < 176; c++) memstat[0][c] = memstat[1][c] = 1; - } - break; - - case 0xFE34: - ram_fe34 = val; - if (BPLUS) - { - acccon = val; - vidbank = (val & 0x80) << 8; - if (val & 0x80) RAMbank[0xC] = RAMbank[0xD] = 1; - else RAMbank[0xC] = RAMbank[0xD] = 0; - } - if (MASTER) - { - acccon = val; - ram8k = (val & 8); - ram20k = (val & 4); - vidbank = (val & 1) ? 0x8000 : 0; - if (val & 2) RAMbank[0xC] = RAMbank[0xD] = 1; - else RAMbank[0xC] = RAMbank[0xD] = 0; - for (c = 48; c < 128; c++) memlook[0][c] = ram + ((ram20k) ? 32768 : 0); - if (ram8k) - { - for (c = 192; c < 224; c++) memlook[0][c] = memlook[1][c] = ram - 0x3000; - for (c = 192; c < 224; c++) memstat[0][c] = memstat[1][c] = 1; - } - else - { - for (c = 192; c < 224; c++) memlook[0][c] = memlook[1][c] = os - 0xC000; - for (c = 192; c < 224; c++) memstat[0][c] = memstat[1][c] = 2; - } - } - break; - - case 0xFE40: case 0xFE44: case 0xFE48: case 0xFE4C: - case 0xFE50: case 0xFE54: case 0xFE58: case 0xFE5C: - sysvia_write(addr, val); - break; - - case 0xFE60: case 0xFE64: case 0xFE68: case 0xFE6C: - case 0xFE70: case 0xFE74: case 0xFE78: case 0xFE7C: - uservia_write(addr, val); - break; - - case 0xFE80: case 0xFE84: case 0xFE88: case 0xFE8C: - case 0xFE90: case 0xFE94: case 0xFE98: case 0xFE9C: - if (!MASTER) - { - if (WD1770) wd1770_write(addr, val); - else i8271_write(addr, val); - } - break; - - case 0xFEC0: case 0xFEC4: case 0xFEC8: case 0xFECC: - case 0xFED0: case 0xFED4: case 0xFED8: case 0xFEDC: - if (!MASTER) adc_write(addr, val); - break; - - case 0xFEE0: case 0xFEE4: case 0xFEE8: case 0xFEEC: - case 0xFEF0: case 0xFEF4: case 0xFEF8: case 0xFEFC: - tube_host_write(addr, val); - break; - } -} - -uint8_t a,x,y,s; -uint16_t pc; -PREG p; -int nmi,oldnmi,interrupt,takeint; - -uint16_t pc3,oldpc,oldoldpc; -uint8_t opcode; - -void m6502_reset() -{ - int c; - for (c = 0; c<16; c++) RAMbank[c] = 0; - for (c = 0; c<128; c++) memstat[0][c] = memstat[1][c] = 1; - for (c = 128; c<256; c++) memstat[0][c] = memstat[1][c] = 2; - for (c = 0; c<128; c++) memlook[0][c] = memlook[1][c] = ram; - if (MODELA) - { - for (c = 0; c < 64; c++) memlook[0][c] = memlook[1][c] = ram + 16384; - } - for (c = 48; c < 128; c++) memlook[1][c] = ram + 32768; - for (c = 128; c < 192; c++) memlook[0][c] = memlook[1][c] = rom - 0x8000; - for (c = 192; c < 256; c++) memlook[0][c] = memlook[1][c] = os - 0xC000; - memstat[0][0xFC] = memstat[0][0xFD] = memstat[0][0xFE] = 0; - memstat[1][0xFC] = memstat[1][0xFD] = memstat[1][0xFE] = 0; - - cycles = 0; - ram4k = ram8k = ram12k = ram20k = 0; - - pc = readmem(0xFFFC) | (readmem(0xFFFD) << 8); - p.i = 1; - nmi = oldnmi = 0; - output = 0; - tubecycle = tubecycles = 0; - rpclog("PC : %04X\n",pc); -} - -void dumpregs() -{ - rpclog("6502 registers :\n"); - rpclog("A=%02X X=%02X Y=%02X S=01%02X PC=%04X\n",a, x, y, s, pc); - rpclog("Status : %c%c%c%c%c%c\n", (p.n) ? 'N' : ' ', (p.v) ? 'V' : ' ', (p.d) ? 'D' : ' ', (p.i) ? 'I' : ' ', (p.z) ? 'Z' : ' ', (p.c) ? 'C' : ' '); - rpclog("ROMSEL %02X\n", romsel >> 14); -} - -static inline uint16_t getsw() -{ - uint16_t temp = readmem(pc); pc++; - temp |= (readmem(pc)<<8); pc++; - return temp; -} -#define getw() getsw() - -//#define getw() (readmem(pc)|(readmem(pc+1)<<8)); pc+=2 - -#define setzn(v) p.z = !(v); p.n = (v) & 0x80 - -#define push(v) writemem(0x100 + (s--), v) -#define pull() readmem(0x100 + (++s)) - -/*ADC/SBC temp variables*/ -static uint16_t tempw; -static int tempv,hc6,al,ah; -static uint8_t tempb; - -#define ADC(temp) if (!p.d) \ - { \ - tempw = (a + temp + (p.c ? 1 : 0)); \ - p.v = (!((a ^ temp) & 0x80) && ((a ^ tempw) & 0x80)); \ - a = tempw & 0xFF; \ - p.c = tempw & 0x100; \ - setzn(a); \ - } \ - else \ - { \ - ah = 0; \ - tempb = a + temp + (p.c ? 1:0); \ - if (!tempb) \ - p.z = 1; \ - al = (a & 0xF) + (temp & 0xF) + (p.c ? 1 : 0); \ - if (al > 9) \ - { \ - al -= 10; \ - al &= 0xF; \ - ah = 1; \ - } \ - ah += ((a >> 4) + (temp >> 4)); \ - if (ah & 8) p.n = 1; \ - p.v = (((ah << 4) ^ a) & 128) && !((a ^ temp) & 128); \ - p.c = 0; \ - if (ah > 9) \ - { \ - p.c = 1; \ - ah -= 10; \ - ah &= 0xF; \ - } \ - a = (al & 0xF) | (ah << 4); \ - } - -#define SBC(temp) if (!p.d) \ - { \ - tempw = a - (temp + (p.c ? 0 : 1)); \ - tempv = (short)a - (short)(temp + (p.c ? 0 : 1)); \ - p.v = ((a ^ (temp + (p.c ? 0 : 1))) & (a ^ (uint8_t)tempv) & 0x80); \ - p.c = tempv >= 0;\ - a = tempw & 0xFF; \ - setzn(a); \ - } \ - else \ - { \ - hc6 = 0; \ - p.z = p.n = 0; \ - if (!((a - temp) - (p.c ? 0 : 1))) \ - p.z = 1; \ - al = (a & 15) - (temp & 15) - (p.c ? 0 : 1); \ - if (al & 16) \ - { \ - al -= 6; \ - al &= 0xF; \ - hc6 = 1; \ - } \ - ah = (a >> 4) - (temp >> 4); \ - if (hc6) ah--; \ - if ((a - (temp + (p.c ? 0 : 1))) & 0x80) \ - p.n = 1; \ - p.v = (((a - (temp + (p.c ? 0 : 1))) ^ temp) & 0x80) && ((a ^ temp) & 0x80); \ - p.c = 1; \ - if (ah & 16) \ - { \ - p.c = 0; \ - ah -= 6; \ - ah &= 0xF; \ - } \ - a = (al & 0xF) | ((ah & 0xF) << 4); \ - } - -#define ADCc(temp) if (!p.d) \ - { \ - tempw = (a + temp + (p.c ? 1 : 0)); \ - p.v = (!((a ^ temp) & 0x80) && ((a ^ tempw) & 0x80)); \ - a = tempw & 0xFF; \ - p.c = tempw & 0x100; \ - setzn(a); \ - } \ - else \ - { \ - ah = 0; \ - tempb = a + temp + (p.c ? 1 : 0); \ - al = (a & 0xF) + (temp & 0xF) + (p.c ? 1 : 0); \ - if (al > 9) \ - { \ - al -= 10; \ - al &= 0xF; \ - ah = 1; \ - } \ - ah += ((a >> 4) + (temp >> 4)); \ - p.v = (((ah << 4) ^ a) & 0x80) && !((a ^ temp) & 0x80); \ - p.c = 0; \ - if (ah > 9) \ - { \ - p.c = 1; \ - ah -= 10; \ - ah &= 0xF; \ - } \ - a = (al & 0xF) | (ah << 4); \ - setzn(a); \ - polltime(1); \ - } - -#define SBCc(temp) if (!p.d) \ - { \ - tempw = a - (temp + (p.c ? 0 : 1)); \ - tempv = (short)a - (short)(temp + (p.c ? 0 : 1)); \ - p.v = ((a ^ (temp + (p.c ? 0 : 1))) & (a ^ (uint8_t)tempv) & 0x80); \ - p.c = tempv >= 0;\ - a = tempw & 0xFF; \ - setzn(a); \ - } \ - else \ - { \ - hc6 = 0; \ - p.z = p.n = 0; \ - al = (a & 15) - (temp & 15) - ((p.c) ? 0 : 1); \ - if (al & 16) \ - { \ - al -= 6; \ - al &= 0xF; \ - hc6 = 1; \ - } \ - ah = (a >> 4) - (temp >> 4); \ - if (hc6) ah--; \ - p.v = (((a - (temp + (p.c ? 0 : 1))) ^ temp) & 0x80) && ((a ^ temp) & 0x80); \ - p.c = 1; \ - if (ah & 16) \ - { \ - p.c = 0; \ - ah -= 6; \ - ah &= 0xF; \ - } \ - a = (al & 0xF) | ((ah & 0xF) << 4); \ - setzn(a); \ - polltime(1); \ - } - -static void branchcycles(int temp) -{ - if (temp > 2) - { - polltime(temp - 1); - takeint = (interrupt && !p.i); - polltime(1); - } - else - { - polltime(2); - takeint = (interrupt && !p.i); - } -} - -void m6502_exec() -{ - uint16_t addr; - uint8_t temp; - int tempi; - int8_t offset; - int c; - cycles+=40000; - while (cycles>0) - { - pc3=oldoldpc; - oldoldpc=oldpc; - oldpc=pc; -// if (pc==0x2853) output=1; -// if (skipint==1) skipint=0; - vis20k=RAMbank[pc>>12]; - opcode=readmem(pc); - if (debugon) debugger_do(); - pc++; - switch (opcode) - { - case 0x00: /*BRK*/ -// if (output) -// { - //printf("BRK! at %04X\n",pc); -// output=1; -// dumpregs(); -// mem_dump(); -// exit(-1); -// } - pc++; - push(pc>>8); - push(pc&0xFF); - temp=0x30; - if (p.c) temp|=1; if (p.z) temp|=2; - if (p.d) temp|=8; if (p.v) temp|=0x40; - if (p.n) temp|=0x80; - push(temp); - pc=readmem(0xFFFE)|(readmem(0xFFFF)<<8); - p.i=1; - polltime(7); - takeint=0; - break; - - case 0x01: /*ORA (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - polltime(6); - takeint=(interrupt && !p.i); - a|=readmem(addr); - setzn(a); - break; - - case 0x03: /*Undocumented - SLO (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - polltime(5); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - polltime(1); - c=temp&0x80; - temp<<=1; - writemem(addr,temp); - a|=temp; - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x04: /*Undocumented - NOP zp*/ - addr=readmem(pc); pc++; - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x05: /*ORA zp*/ - addr=readmem(pc); pc++; - a|=readmem(addr); - setzn(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x06: /*ASL zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - p.c=temp&0x80; - temp<<=1; - setzn(temp); - writemem(addr,temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x07: /*Undocumented - SLO zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - c=temp&0x80; - temp<<=1; - writemem(addr,temp); - a|=temp; - setzn(a); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x08: /*PHP*/ - temp=0x30; - if (p.c) temp|=1; if (p.z) temp|=2; - if (p.i) temp|=4; if (p.d) temp|=8; - if (p.v) temp|=0x40; if (p.n) temp|=0x80; - push(temp); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x09: /*ORA imm*/ - a|=readmem(pc); pc++; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x0A: /*ASL A*/ - p.c=a&0x80; - a<<=1; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x0B: /*Undocumented - ANC imm*/ - a&=readmem(pc); pc++; - setzn(a); - p.c=p.n; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x0C: /*Undocumented - NOP abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x0D: /*ORA abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - a|=readmem(addr); - setzn(a); - break; - - case 0x0E: /*ASL abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - polltime(1); - p.c=temp&0x80; - temp<<=1; - setzn(temp); - takeint=(interrupt && !p.i); - writemem(addr,temp); - break; - - case 0x0F: /*Undocumented - SLO abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - polltime(1); - c=temp&0x80; - temp<<=1; - writemem(addr,temp); - a|=temp; - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x10: /*BPL*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (!p.n) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - branchcycles(temp); - break; - - case 0x11: /*ORA (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a|=readmem(addr+y); - setzn(a); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x13: /*Undocumented - SLO (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - polltime(5); - temp=readmem(addr+y); - polltime(1); - writemem(addr+y,temp); - polltime(1); - c=temp&0x80; - temp<<=1; - writemem(addr+y,temp); - a|=temp; - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x14: /*Undocumented - NOP zp,x*/ - addr=readmem(pc); pc++; - readmem((addr+x)&0xFF); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x15: /*ORA zp,x*/ - addr=readmem(pc); pc++; - a|=readmem((addr+x)&0xFF); - setzn(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x16: /*ASL zp,x*/ - addr=(readmem(pc)+x)&0xFF; pc++; - temp=readmem(addr); - p.c=temp&0x80; - temp<<=1; - setzn(temp); - writemem(addr,temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x17: /*Undocumented - SLO zp,x*/ - addr=(readmem(pc)+x)&0xFF; pc++; - polltime(3); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - polltime(1); - c=temp&0x80; - temp<<=1; - writemem(addr,temp); - a|=temp; - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x18: /*CLC*/ - p.c=0; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x19: /*ORA abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a|=readmem(addr+y); - setzn(a); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x1A: /*Undocumented - NOP*/ - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x1B: /*Undocumented - SLO abs,y*/ - addr=getw()+y; - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - polltime(4); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - polltime(1); - c=temp&0x80; - temp<<=1; - writemem(addr,temp); - a|=temp; - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x1C: /*Undocumented - NOP abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - readmem(addr); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x1D: /*ORA abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - addr+=x; - polltime(4); - takeint=(interrupt && !p.i); - a|=readmem(addr); - setzn(a); - break; - - case 0x1E: /*ASL abs,x*/ - addr=getw(); - readmem((addr&0xFF00)|((addr+x)&0xFF)); - addr+=x; - temp=readmem(addr); - writemem(addr,temp); - p.c=temp&0x80; - temp<<=1; - takeint=(interrupt && !p.i); - writemem(addr,temp); - setzn(temp); - polltime(7); - break; - - case 0x1F: /*Undocumented - SLO abs,x*/ - addr=getw()+x; - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - polltime(4); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - polltime(1); - c=temp&0x80; - temp<<=1; - writemem(addr,temp); - a|=temp; - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x20: /*JSR*/ - addr=getw(); pc--; - push(pc>>8); - push(pc); - pc=addr; - polltime(5); - takeint=(interrupt && !p.i); - polltime(1); - break; - - case 0x21: /*AND (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - a&=readmem(addr); - setzn(a); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0x23: /*Undocumented - RLA (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - polltime(5); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - polltime(1); - tempi=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - writemem(addr,temp); - a&=temp; - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x24: /*BIT zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - p.z=!(a&temp); - p.v=temp&0x40; - p.n=temp&0x80; - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x25: /*AND zp*/ - addr=readmem(pc); pc++; - a&=readmem(addr); - setzn(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x26: /*ROL zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - tempi=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - setzn(temp); - writemem(addr,temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x27: /*Undocumented - RLA zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - tempi=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - writemem(addr,temp); - a&=temp; - setzn(a); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x28: /*PLP*/ - temp=pull(); - polltime(4); - takeint=(interrupt && !p.i); - p.c=temp&1; p.z=temp&2; - p.i=temp&4; p.d=temp&8; - p.v=temp&0x40; p.n=temp&0x80; - break; - - case 0x29: /*AND*/ - a&=readmem(pc); pc++; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x2A: /*ROL A*/ - tempi=p.c; - p.c=a&0x80; - a<<=1; - if (tempi) a|=1; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x2B: /*Undocumented - ANC imm*/ - a&=readmem(pc); pc++; - setzn(a); - p.c=p.n; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x2C: /*BIT abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - temp=readmem(addr); - p.z=!(a&temp); - p.v=temp&0x40; - p.n=temp&0x80; - break; - - case 0x2D: /*AND abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - a&=readmem(addr); - setzn(a); - break; - - case 0x2E: /*ROL abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - tempi=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - takeint=((interrupt&128) && !p.i);// takeint=1; - polltime(1); - if (!takeint) takeint=(interrupt && !p.i); - writemem(addr,temp); - setzn(temp); - break; - - case 0x2F: /*Undocumented - RLA abs*/ - addr=getw(); /*Found in The Hobbit*/ - temp=readmem(addr); - tempi=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - writemem(addr,temp); - a&=temp; - setzn(a); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0x30: /*BMI*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (p.n) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - branchcycles(temp); - break; - - case 0x31: /*AND (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a&=readmem(addr+y); - setzn(a); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x33: /*Undocumented - RLA (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - polltime(5); - temp=readmem(addr+y); - polltime(1); - writemem(addr+y,temp); - tempi=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - polltime(1); - writemem(addr+y,temp); - a&=temp; - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x34: /*Undocumented - NOP zp,x*/ - addr=readmem(pc); pc++; - readmem((addr+x)&0xFF); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x35: /*AND zp,x*/ - addr=readmem(pc); pc++; - a&=readmem((addr+x)&0xFF); - setzn(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x36: /*ROL zp,x*/ - addr=readmem(pc); pc++; - addr+=x; addr&=0xFF; - temp=readmem(addr); - tempi=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - setzn(temp); - writemem(addr,temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x37: /*Undocumented - RLA zp,x*/ - addr=(readmem(pc)+x)&0xFF; pc++; - temp=readmem(addr); - tempi=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - writemem(addr,temp); - a&=temp; - setzn(a); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x38: /*SEC*/ - p.c=1; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x39: /*AND abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a&=readmem(addr+y); - setzn(a); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x3A: /*Undocumented - NOP*/ - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x3B: /*Undocumented - RLA abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - polltime(4); - temp=readmem(addr+y); - polltime(1); - writemem(addr+y,temp); - tempi=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - polltime(1); - writemem(addr+y,temp); - a&=temp; - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x3C: /*Undocumented - NOP abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - readmem(addr+x); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x3D: /*AND abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - addr+=x; - a&=readmem(addr); - setzn(a); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x3E: /*ROL abs,x*/ - addr=getw(); - readmem((addr&0xFF00)|((addr+x)&0xFF)); - addr+=x; - temp=readmem(addr); - writemem(addr,temp); - tempi=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - writemem(addr,temp); - setzn(temp); - polltime(7); - takeint=(interrupt && !p.i); - break; - - case 0x3F: /*Undocumented - RLA abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - polltime(4); - temp=readmem(addr+x); - polltime(1); - writemem(addr+x,temp); - tempi=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - polltime(1); - writemem(addr+x,temp); - a&=temp; - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x40: /*RTI*/ - output=0; - temp=pull(); - p.c=temp&1; p.z=temp&2; - p.i=temp&4; p.d=temp&8; - p.v=temp&0x40; p.n=temp&0x80; - pc=pull(); - pc|=(pull()<<8); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0x41: /*EOR (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - a^=readmem(addr); - setzn(a); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0x43: /*Undocumented - SRE (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - polltime(5); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - p.c=temp&1; - temp>>=1; - polltime(1); - writemem(addr,temp); - a^=temp; - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x44: /*Undocumented - NOP zp*/ - addr=readmem(pc); pc++; - readmem(addr); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x45: /*EOR zp*/ - addr=readmem(pc); pc++; - a^=readmem(addr); - setzn(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x46: /*LSR zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - p.c=temp&1; - temp>>=1; - setzn(temp); - writemem(addr,temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x47: /*Undocumented - SRE zp*/ - addr=readmem(pc); pc++; - polltime(3); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - p.c=temp&1; - temp>>=1; - polltime(1); - writemem(addr,temp); - a^=temp; - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x48: /*PHA*/ - push(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x49: /*EOR imm*/ - a^=readmem(pc); pc++; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x4A: /*LSR A*/ - p.c=a&1; - a>>=1; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x4B: /*Undocumented - ASR imm*/ - a&=readmem(pc); pc++; - p.c=a&1; - a>>=1; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x4C: /*JMP*/ - addr=getw(); - pc=addr; - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x4D: /*EOR abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - a^=readmem(addr); - setzn(a); - break; - - case 0x4E: /*LSR abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - takeint=((interrupt&128) && !p.i);// takeint=1; - polltime(1); - if (!takeint) takeint=(interrupt && !p.i); - p.c=temp&1; - temp>>=1; - setzn(temp); - writemem(addr,temp); - break; - - case 0x4F: /*Undocumented - SRE abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - p.c=temp&1; - temp>>=1; - polltime(1); - writemem(addr,temp); - a^=temp; - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x50: /*BVC*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (!p.v) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - branchcycles(temp); - break; - - case 0x51: /*EOR (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a^=readmem(addr+y); - setzn(a); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x53: /*Undocumented - SRE (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - polltime(5); - temp=readmem(addr+y); - polltime(1); - writemem(addr+y,temp); - p.c=temp&1; - temp>>=1; - polltime(1); - writemem(addr+y,temp); - a^=temp; - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x54: /*Undocumented - NOP zp,x*/ - addr=readmem(pc); pc++; - readmem((addr+x)&0xFF); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x55: /*EOR zp,x*/ - addr=readmem(pc); pc++; - a^=readmem((addr+x)&0xFF); - setzn(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x56: /*LSR zp,x*/ - addr=(readmem(pc)+x)&0xFF; pc++; - temp=readmem(addr); - p.c=temp&1; - temp>>=1; - setzn(temp); - writemem(addr,temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x57: /*Undocumented - SRE zp,x*/ - addr=(readmem(pc)+x)&0xFF; pc++; - polltime(3); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - p.c=temp&1; - temp>>=1; - polltime(1); - writemem(addr,temp); - a^=temp; - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x58: /*CLI*/ - polltime(2); - takeint=(interrupt && !p.i); - p.i=0; - break; - - case 0x59: /*EOR abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a^=readmem(addr+y); - setzn(a); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x5A: /*Undocumented - NOP*/ - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x5B: /*Undocumented - SRE abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - polltime(4); - temp=readmem(addr+y); - polltime(1); - writemem(addr+y,temp); - p.c=temp&1; - temp>>=1; - polltime(1); - writemem(addr+y,temp); - a^=temp; - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x5C: /*Undocumented - NOP abs,x*/ - addr=getw(); - polltime(4); - if ((addr&0xFF00)^((addr+x)&0xFF00)) { readmem((addr&0xFF00)|((addr+x)&0xFF)); polltime(1); } - readmem(addr+x); - takeint=(interrupt && !p.i); - break; - - case 0x5D: /*EOR abs,x*/ - addr=getw(); - polltime(4); - if ((addr&0xFF00)^((addr+x)&0xFF00)) { readmem((addr&0xFF00)|((addr+x)&0xFF)); polltime(1); } - addr+=x; - a^=readmem(addr); - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x5E: /*LSR abs,x*/ - addr=getw(); - readmem((addr&0xFF00)|((addr+x)&0xFF)); - addr+=x; - temp=readmem(addr); - writemem(addr,temp); - p.c=temp&1; - temp>>=1; - writemem(addr,temp); - setzn(temp); - polltime(7); - takeint=(interrupt && !p.i); - break; - - case 0x5F: /*Undocumented - SRE abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - polltime(4); - temp=readmem(addr+x); - polltime(1); - writemem(addr+x,temp); - p.c=temp&1; - temp>>=1; - polltime(1); - writemem(addr+x,temp); - a^=temp; - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x60: /*RTS*/ - pc=pull(); - pc|=(pull()<<8); - pc++; - polltime(5); - takeint=(interrupt && !p.i); - polltime(1); - break; - - case 0x61: /*ADC (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - temp=readmem(addr); - ADC(temp); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0x63: /*Undocumented - RRA (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - polltime(5); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - temp>>=1; - if (p.c) temp|=0x80; - polltime(1); - writemem(addr,temp); - ADC(temp); - takeint=(interrupt && !p.i); - break; - - case 0x64: /*Undocumented - NOP zp*/ - addr=readmem(pc); pc++; - readmem(addr); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x65: /*ADC zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - ADC(temp); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x66: /*ROR zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - tempi=p.c; - p.c=temp&1; - temp>>=1; - if (tempi) temp|=0x80; - setzn(temp); - writemem(addr,temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x67: /*Undocumented - RRA zp*/ - addr=readmem(pc); pc++; - polltime(3); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - temp>>=1; - if (p.c) temp|=0x80; - polltime(1); - writemem(addr,temp); - ADC(temp); - takeint=(interrupt && !p.i); - break; - - case 0x68: /*PLA*/ - a=pull(); - setzn(a); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x69: /*ADC imm*/ - temp=readmem(pc); pc++; - ADC(temp); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x6A: /*ROR A*/ - tempi=p.c; - p.c=a&1; - a>>=1; - if (tempi) a|=0x80; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x6B: /*Undocumented - ARR*/ - a&=readmem(pc); pc++; - tempi=p.c; - if (p.d) /*This instruction is just as broken on a real 6502 as it is here*/ - { - p.v=((a>>6)^(a>>7)); /*V set if bit 6 changes in ROR*/ - a>>=1; - if (tempi) a|=0x80; - setzn(tempi); - p.c=0; - if ((a&0xF)+(a&1)>5) a=(a&0xF0)+((a&0xF)+6); /*Do broken fixup*/ - if ((a&0xF0)+(a&0x10)>0x50) { a+=0x60; p.c=1; } - } - else - { /*V & C flag behaviours in 64doc.txt are backwards*/ - p.v=((a>>6)^(a>>7)); /*V set if bit 6 changes in ROR*/ - a>>=1; - if (tempi) a|=0x80; - setzn(a); - p.c=a&0x40; - } - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x6C: /*JMP ()*/ - addr=getw(); - if ((addr&0xFF)==0xFF) pc=readmem(addr)|(readmem(addr-0xFF)<<8); - else pc=readmem(addr)|(readmem(addr+1)<<8); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x6D: /*ADC abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - temp=readmem(addr); - ADC(temp); - break; - - case 0x6E: /*ROR abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr); - polltime(1); - takeint=(interrupt && !p.i); - writemem(addr,temp); - if ((interrupt&128) && !p.i) takeint=1; - polltime(1); - if (interrupt && !p.i) takeint=1; - tempi=p.c; - p.c=temp&1; - temp>>=1; - if (tempi) temp|=0x80; - setzn(temp); - writemem(addr,temp); - break; - - case 0x6F: /*Undocumented - RRA abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - temp>>=1; - if (p.c) temp|=0x80; - polltime(1); - writemem(addr,temp); - ADC(temp); - takeint=(interrupt && !p.i); - break; - - case 0x70: /*BVS*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (p.v) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - branchcycles(temp); - break; - - case 0x71: /*ADC (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - temp=readmem(addr+y); - ADC(temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x73: /*Undocumented - RRA (,y)*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - polltime(5); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - temp>>=1; - if (p.c) temp|=0x80; - polltime(1); - writemem(addr,temp); - ADC(temp); - takeint=(interrupt && !p.i); - break; - - case 0x74: /*Undocumented - NOP zp,x*/ - addr=readmem(pc); pc++; - readmem((addr+x)&0xFF); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x75: /*ADC zp,x*/ - addr=readmem(pc); pc++; - temp=readmem((addr+x)&0xFF); - ADC(temp); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x76: /*ROR zp,x*/ - addr=readmem(pc); pc++; - addr+=x; addr&=0xFF; - temp=readmem(addr); - tempi=p.c; - p.c=temp&1; - temp>>=1; - if (tempi) temp|=0x80; - setzn(temp); - writemem(addr,temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x77: /*Undocumented - RRA zp,x*/ - addr=(readmem(pc)+x)&0xFF; pc++; - polltime(3); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - temp>>=1; - if (p.c) temp|=0x80; - polltime(1); - writemem(addr,temp); - ADC(temp); - takeint=(interrupt && !p.i); - break; - - case 0x78: /*SEI*/ - polltime(2); - takeint=(interrupt && !p.i); - p.i=1; - break; - - case 0x79: /*ADC abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - temp=readmem(addr+y); - ADC(temp); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x7A: /*Undocumented - NOP*/ - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x7B: /*Undocumented - RRA abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - polltime(4); - temp=readmem(addr+y); - polltime(1); - writemem(addr+y,temp); - temp>>=1; - if (p.c) temp|=0x80; - polltime(1); - writemem(addr+y,temp); - ADC(temp); - takeint=(interrupt && !p.i); - break; - - case 0x7C: /*Undocumented - NOP abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - readmem(addr); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x7D: /*ADC abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - addr+=x; - temp=readmem(addr); - ADC(temp); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x7E: /*ROR abs,x*/ - addr=getw(); - readmem((addr&0xFF00)|((addr+x)&0xFF)); - addr+=x; - temp=readmem(addr); - writemem(addr,temp); - tempi=p.c; - p.c=temp&1; - temp>>=1; - if (tempi) temp|=0x80; - writemem(addr,temp); - setzn(temp); - polltime(7); - takeint=(interrupt && !p.i); - break; - - case 0x7F: /*Undocumented - RRA abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - polltime(4); - temp=readmem(addr+x); - polltime(1); - writemem(addr+x,temp); - temp>>=1; - if (p.c) temp|=0x80; - polltime(1); - writemem(addr+x,temp); - ADC(temp); - takeint=(interrupt && !p.i); - break; - - case 0x80: /*Undocumented - NOP imm*/ - readmem(pc); pc++; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x81: /*STA (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - writemem(addr,a); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0x82: /*Undocumented - NOP imm*/ /*Should sometimes lock up the machine*/ - readmem(pc); pc++; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x83: /*Undocumented - SAX (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - writemem(addr,a&x); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0x84: /*STY zp*/ - addr=readmem(pc); pc++; - writemem(addr,y); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x85: /*STA zp*/ - addr=readmem(pc); pc++; - writemem(addr,a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x86: /*STX zp*/ - addr=readmem(pc); pc++; - writemem(addr,x); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x87: /*Undocumented - SAX zp*/ - addr=readmem(pc); pc++; - writemem(addr,a&x); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x88: /*DEY*/ - y--; - setzn(y); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x89: /*Undocumented - NOP imm*/ - readmem(pc); pc++; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x8A: /*TXA*/ - a=x; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x8B: /*Undocumented - ANE*/ - temp=readmem(pc); pc++; - a=(a|0xEE)&x&temp; /*Internal parameter always 0xEE on BBC, always 0xFF on Electron*/ - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x8C: /*STY abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - writemem(addr,y); - break; - - case 0x8D: /*STA abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - writemem(addr,a); - break; - - case 0x8E: /*STX abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - writemem(addr,x); - break; - - case 0x8F: /*Undocumented - SAX abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - writemem(addr,a&x); - break; - - case 0x90: /*BCC*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (!p.c) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - branchcycles(temp); - break; - - case 0x91: /*STA (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8)+y; - writemem(addr,a); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0x93: /*Undocumented - SHA (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - writemem(addr+y,a&x&((addr>>8)+1)); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0x94: /*STY zp,x*/ - addr=readmem(pc); pc++; - writemem((addr+x)&0xFF,y); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x95: /*STA zp,x*/ - addr=readmem(pc); pc++; - writemem((addr+x)&0xFF,a); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x96: /*STX zp,y*/ - addr=readmem(pc); pc++; - writemem((addr+y)&0xFF,x); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x97: /*Undocumented - SAX zp,y*/ - addr=readmem(pc); pc++; - writemem((addr+y)&0xFF,a&x); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x98: /*TYA*/ - a=y; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x99: /*STA abs,y*/ - addr=getw(); - polltime(4); - readmem((addr&0xFF00)|((addr+y)&0xFF)); - polltime(1); - takeint=(interrupt && !p.i); - writemem(addr+y,a); - break; - - case 0x9A: /*TXS*/ - s=x; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x9B: /*Undocumented - SHS abs,y*/ - addr=getw(); - readmem((addr&0xFF00)+((addr+y)&0xFF)); - writemem(addr+y,a&x&((addr>>8)+1)); - s=a&x; - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x9C: /*Undocumented - SHY abs,x*/ - addr=getw(); - readmem((addr&0xFF00)+((addr+x)&0xFF)); - writemem(addr+x,y&((addr>>8)+1)); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x9D: /*STA abs,x*/ - addr=getw(); - polltime(4); - readmem((addr&0xFF00)|((addr+x)&0xFF)); - polltime(1); - takeint=(interrupt && !p.i); - writemem(addr+x,a); - break; - - case 0x9E: /*Undocumented - SHX abs,y*/ - addr=getw(); - polltime(4); - readmem((addr&0xFF00)|((addr+x)&0xFF)); - polltime(1); - takeint=(interrupt && !p.i); - writemem(addr+y,x&((addr>>8)+1)); - break; - - case 0x9F: /*Undocumented - SHA abs,y*/ - addr=getw(); - polltime(4); - readmem((addr&0xFF00)|((addr+x)&0xFF)); - polltime(1); - takeint=(interrupt && !p.i); - writemem(addr+y,a&x&((addr>>8)+1)); - break; - - case 0xA0: /*LDY imm*/ - y=readmem(pc); pc++; - setzn(y); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xA1: /*LDA (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - a=readmem(addr); - setzn(a); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0xA2: /*LDX imm*/ - x=readmem(pc); pc++; - setzn(x); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xA3: /*Undocumented - LAX (,y)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - a=x=readmem(addr); - setzn(a); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0xA4: /*LDY zp*/ - addr=readmem(pc); pc++; - y=readmem(addr); - setzn(y); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xA5: /*LDA zp*/ - addr=readmem(pc); pc++; - a=readmem(addr); - setzn(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xA6: /*LDX zp*/ - addr=readmem(pc); pc++; - x=readmem(addr); - setzn(x); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xA7: /*Undocumented - LAX zp*/ - addr=readmem(pc); pc++; - a=x=readmem(addr); - setzn(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xA8: /*TAY*/ - y=a; - setzn(y); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xA9: /*LDA imm*/ - a=readmem(pc); pc++; - setzn(a); - polltime(1); - takeint=(interrupt && !p.i); - polltime(1); - break; - - case 0xAA: /*TAX*/ - x=a; - setzn(x); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xAB: /*Undocumented - LAX*/ - temp=readmem(pc); pc++; - a=x=((a|0xEE)&temp); /*WAAAAY more complicated than this, but it varies from machine to machine anyway*/ - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xAC: /*LDY abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - y=readmem(addr); - setzn(y); - break; - - case 0xAD: /*LDA abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - a=readmem(addr); - setzn(a); - break; - - case 0xAE: /*LDX abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - x=readmem(addr); - setzn(x); - break; - - case 0xAF: /*LAX abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - a=x=readmem(addr); - setzn(a); - break; - - case 0xB0: /*BCS*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (p.c) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - branchcycles(temp); - break; - - case 0xB1: /*LDA (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a=readmem(addr+y); - setzn(a); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0xB3: /*LAX (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a=x=readmem(addr+y); - setzn(a); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0xB4: /*LDY zp,x*/ - addr=readmem(pc); pc++; - y=readmem((addr+x)&0xFF); - setzn(y); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xB5: /*LDA zp,x*/ - addr=readmem(pc); pc++; - a=readmem((addr+x)&0xFF); - setzn(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xB6: /*LDX zp,y*/ - addr=readmem(pc); pc++; - x=readmem((addr+y)&0xFF); - setzn(x); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xB7: /*LAX zp,y*/ - addr=readmem(pc); pc++; - a=x=readmem((addr+y)&0xFF); - setzn(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xB8: /*CLV*/ - p.v=0; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xB9: /*LDA abs,y*/ - addr=getw(); - polltime(3); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a=readmem(addr+y); - setzn(a); - polltime(1); - takeint=(interrupt && !p.i); - break; - - case 0xBA: /*TSX*/ - x=s; - setzn(x); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xBB: /*Undocumented - LAS abs,y*/ - addr=getw(); - polltime(3); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a=x=s=s&readmem(addr+y); /*No, really!*/ - setzn(a); - polltime(1); - takeint=(interrupt && !p.i); - break; - - case 0xBC: /*LDY abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - y=readmem(addr+x); - setzn(y); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0xBD: /*LDA abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - a=readmem(addr+x); - setzn(a); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0xBE: /*LDX abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - x=readmem(addr+y); - setzn(x); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0xBF: /*LAX abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a=x=readmem(addr+y); - setzn(a); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0xC0: /*CPY imm*/ - temp=readmem(pc); pc++; - setzn(y-temp); - p.c=(y>=temp); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xC1: /*CMP (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - temp=readmem(addr); - setzn(a-temp); - p.c=(a>=temp); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0xC2: /*Undocumented - NOP imm*/ /*Should sometimes lock up the machine*/ - readmem(pc); pc++; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xC3: /*Undocumented - DCP (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - polltime(5); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - temp--; - polltime(1); - writemem(addr,temp); - setzn(a-temp); - p.c=(a>=temp); - takeint=(interrupt && !p.i); - break; - - case 0xC4: /*CPY zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - setzn(y-temp); - p.c=(y>=temp); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xC5: /*CMP zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - setzn(a-temp); - p.c=(a>=temp); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xC6: /*DEC zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr)-1; - writemem(addr,temp); - setzn(temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0xC7: /*Undocumented - DCP zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr)-1; - writemem(addr,temp); - setzn(a-temp); - p.c=(a>=temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0xC8: /*INY*/ - y++; - setzn(y); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xC9: /*CMP imm*/ - temp=readmem(pc); pc++; - setzn(a-temp); - p.c=(a>=temp); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xCA: /*DEX*/ - x--; - setzn(x); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xCB: /*Undocumented - SBX imm*/ - temp=readmem(pc); pc++; - setzn((a&x)-temp); - p.c=((a&x)>=temp); - x=(a&x)-temp; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xCC: /*CPY abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - temp=readmem(addr); - setzn(y-temp); - p.c=(y>=temp); - break; - - case 0xCD: /*CMP abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - temp=readmem(addr); - setzn(a-temp); - p.c=(a>=temp); - break; - - case 0xCE: /*DEC abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr)-1; - polltime(1); -// takeint=(interrupt && !p.i); - writemem(addr,temp+1); - takeint=((interrupt&128) && !p.i);// takeint=1; - polltime(1); - if (!takeint) takeint=(interrupt && !p.i); - writemem(addr,temp); - setzn(temp); - break; - - case 0xCF: /*Undocumented - DCP abs*/ - addr=getw(); - temp=readmem(addr)-1; - writemem(addr,temp); - setzn(a-temp); - p.c=(a>=temp); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0xD0: /*BNE*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (!p.z) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - branchcycles(temp); - break; - - case 0xD1: /*CMP (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - temp=readmem(addr+y); - setzn(a-temp); - p.c=(a>=temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0xD3: /*Undocumented - DCP (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - polltime(5); - temp=readmem(addr)-1; - polltime(1); - writemem(addr,temp+1); - polltime(1); - writemem(addr,temp); - setzn(a-temp); - p.c=(a>=temp); - takeint=(interrupt && !p.i); - break; - - case 0xD4: /*Undocumented - NOP zp,x*/ - addr=readmem(pc); pc++; - readmem((addr+x)&0xFF); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xD5: /*CMP zp,x*/ - addr=readmem(pc); pc++; - temp=readmem((addr+x)&0xFF); - setzn(a-temp); - p.c=(a>=temp); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xD6: /*DEC zp,x*/ - addr=readmem(pc); pc++; - temp=readmem((addr+x)&0xFF)-1; - setzn(temp); - writemem((addr+x)&0xFF,temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0xD7: /*Undocumented - DCP zp,x*/ - addr=(readmem(pc)+x)&0xFF; pc++; - temp=readmem(addr)-1; - writemem(addr,temp); - setzn(a-temp); - p.c=(a>=temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0xD8: /*CLD*/ - p.d=0; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xD9: /*CMP abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - temp=readmem(addr+y); - setzn(a-temp); - p.c=(a>=temp); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0xDA: /*Undocumented - NOP*/ - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xDB: /*Undocumented - DCP abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - polltime(4); - temp=readmem(addr+y)-1; - polltime(1); - writemem(addr+y,temp+1); - polltime(1); - writemem(addr+y,temp); - setzn(a-temp); - p.c=(a>=temp); - takeint=(interrupt && !p.i); - break; - - case 0xDC: /*Undocumented - NOP abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - readmem(addr+x); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0xDD: /*CMP abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - temp=readmem(addr+x); - setzn(a-temp); - p.c=(a>=temp); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0xDE: /*DEC abs,x*/ - addr=getw(); - readmem((addr&0xFF00)|((addr+x)&0xFF)); - addr+=x; - temp=readmem(addr)-1; - writemem(addr,temp+1); - writemem(addr,temp); - setzn(temp); - polltime(7); - takeint=(interrupt && !p.i); - break; - - case 0xDF: /*Undocumented - DCP abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - polltime(4); - temp=readmem(addr+x)-1; - polltime(1); - writemem(addr+x,temp+1); - polltime(1); - writemem(addr+x,temp); - setzn(a-temp); - p.c=(a>=temp); - takeint=(interrupt && !p.i); - break; - - case 0xE0: /*CPX imm*/ - temp=readmem(pc); pc++; - setzn(x-temp); - p.c=(x>=temp); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xE1: /*SBC (,x)*/ /*This was missed out of every B-em version since 0.6 as it was never used!*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - temp=readmem(addr); - SBC(temp); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0xE2: /*Undocumented - NOP imm*/ /*Should sometimes lock up the machine*/ - readmem(pc); pc++; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xE3: /*Undocumented - ISB (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - polltime(5); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - temp++; - polltime(1); - writemem(addr,temp); - SBC(temp); - takeint=(interrupt && !p.i); - break; - - case 0xE4: /*CPX zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - setzn(x-temp); - p.c=(x>=temp); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xE5: /*SBC zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - SBC(temp); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xE6: /*INC zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr)+1; - writemem(addr,temp); - setzn(temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0xE7: /*Undocumented - ISB zp*/ - addr=readmem(pc); pc++; - polltime(3); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - temp++; - polltime(1); - writemem(addr,temp); - SBC(temp); - takeint=(interrupt && !p.i); - break; - - case 0xE8: /*INX*/ - x++; - setzn(x); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xE9: /*SBC imm*/ - temp=readmem(pc); pc++; - SBC(temp); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xEA: /*NOP*/ - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xEB: /*Undocumented - SBC imm*/ - temp=readmem(pc); pc++; - SBC(temp); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xEC: /*CPX abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - temp=readmem(addr); - setzn(x-temp); - p.c=(x>=temp); - break; - - case 0xED: /*SBC abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - temp=readmem(addr); - SBC(temp); - break; - - case 0xEE: /*INC abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr)+1; - polltime(1); - writemem(addr,temp-1); - if ((interrupt&128) && !p.i) takeint=1; - polltime(1); - if (interrupt && !p.i) takeint=1; - writemem(addr,temp); - setzn(temp); - break; - - case 0xEF: /*Undocumented - ISB abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - temp++; - polltime(1); - writemem(addr,temp); - SBC(temp); - takeint=(interrupt && !p.i); - break; - - case 0xF0: /*BEQ*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (p.z) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; -// if (pc<0x8000) printf("%04X %02X\n",(pc&0xFF00)^((pc+offset)&0xFF00),temp); - pc+=offset; - } - branchcycles(temp); - break; - - case 0xF1: /*SBC (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - temp=readmem(addr+y); - SBC(temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0xF3: /*Undocumented - ISB (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - polltime(5); - temp=readmem(addr+y); - polltime(1); - writemem(addr+y,temp); - temp++; - polltime(1); - writemem(addr+y,temp); - SBC(temp); - takeint=(interrupt && !p.i); - break; - - case 0xF4: /*Undocumented - NOP zpx*/ - addr=readmem(pc); pc++; - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0xF5: /*SBC zp,x*/ - addr=readmem(pc); pc++; - temp=readmem((addr+x)&0xFF); - SBC(temp); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xF6: /*INC zp,x*/ - addr=readmem(pc); pc++; - temp=readmem((addr+x)&0xFF)+1; - writemem((addr+x)&0xFF,temp); - setzn(temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0xF7: /*Undocumented - ISB zp,x*/ - addr=(readmem(pc)+x)&0xFF; pc++; - polltime(3); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - temp++; - polltime(1); - writemem(addr,temp); - SBC(temp); - takeint=(interrupt && !p.i); - break; - - case 0xF8: /*SED*/ - p.d=1; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xF9: /*SBC abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - temp=readmem(addr+y); - SBC(temp); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0xFA: /*Undocumented - NOP*/ - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xFB: /*Undocumented - ISB abs,y*/ - addr=getw()+y; - polltime(5); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - temp++; - polltime(1); - writemem(addr,temp); - SBC(temp); - takeint=(interrupt && !p.i); - break; - - case 0xFC: /*Undocumented - NOP abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - readmem(addr+x); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0xFD: /*SBC abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - temp=readmem(addr+x); - SBC(temp); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0xFE: /*INC abs,x*/ - addr=getw(); - readmem((addr&0xFF00)|((addr+x)&0xFF)); - addr+=x; - temp=readmem(addr)+1; - writemem(addr,temp-1); - writemem(addr,temp); - setzn(temp); - polltime(7); - takeint=(interrupt && !p.i); - break; - - case 0xFF: /*Undocumented - ISB abs,x*/ - addr=getw()+x; - polltime(5); - temp=readmem(addr); - polltime(1); - writemem(addr,temp); - temp++; - polltime(1); - writemem(addr,temp); - SBC(temp); - takeint=(interrupt && !p.i); - break; - -#if 0 - case 0x02: /*TFS opcode - OSFSC*/ -/* if (uefena) - { - pc+=2; - } - else - {*/ - printf("OSFSC!\n"); - c=OSFSC(); - if (c==6||c==8||c==0||c==5) - { - pc=pull(); - pc+=(pull()<<8)+1; - } - if (c==0x80) - { - temp=ram[pc++]; - p.c=(a>=temp); - setzn(a-temp); - } -// }*/ -// pc+=2; - break; - - case 0x92: /*TFS opcode - OSFILE*/ -/* if (uefena) - { - pc+=2; - } - else - {*/ - printf("OSFILE!\n"); - a=OSFILE(); - if (a==0x80) - { - push(a); - } - else if (a!=0x7F) - { - pc=pull(); - pc+=(pull()<<8)+1; - } -// }*/ -// pc+=2; - break; -#endif - default: /*Halt!*/ -// printf("HALT\n"); -// dumpregs(); -// exit(-1); - pc--; /*PC never moves on*/ - takeint=0; /*Interrupts never occur*/ - oldnmi=1; /*NMIs never occur*/ - polltime(100000); /*Actually lasts forever, but the above code keeps executing HLT forever*/ - break; -// printf("Found bad opcode %02X\n",opcode); -/* switch (opcode&0xF) - { - case 0xA: - break; - case 0x0: - case 0x2: - case 0x3: - case 0x4: - case 0x7: - case 0x9: - case 0xB: - pc++; - break; - case 0xC: - case 0xE: - case 0xF: - pc+=2; - break; - }*/ - } - -// output=(pc<0x172B && pc>=0x167F); -/* if (pc==0x7112) - { - output=1; - dumpregs(); - mem_dump(); - exit(-1); - }*/ -// if (pc==0x1f00) output=1; -/* if (pc==0x6195) - { - dumpregs(); - mem_dump(); - exit(-1); - }*/ -// if (pc==0xCD7A) printf("CD7A from %04X\n",oldpc); -// if (pc==0xC565) printf("C565 from %04X\n",oldpc); -//if (pc>=0x2078 && pc<0x20CA){ output=1; rpclog("%04X\n",pc); } -//if (pc==0x2770) output=1; -//if (pc==0x277C) output=0; - -// if (skipint) skipint--; -/* if (pc==0x6000) output=1; - if (pc==0x6204) output=1; - if (pc==0x6191) - { - dumpregs(); - mem_dump(); - exit(-1); - } - if (pc==0x612B) - { - dumpregs(); - mem_dump(); - exit(-1); - }*/ -/* if (output) - { -// #undef printf - rpclog("A=%02X X=%02X Y=%02X S=%02X PC=%04X %c%c%c%c%c%c op=%02X %02X%02X\n",a,x,y,s,pc,(p.n)?'N':' ',(p.v)?'V':' ',(p.d)?'D':' ',(p.i)?'I':' ',(p.z)?'Z':' ',(p.c)?'C':' ',opcode,ram[0x29],uservia.ifr); - }*/ -// if (pc==0x400) output=1; - if (timetolive) - { - timetolive--; - if (!timetolive) output=0; - } - if (takeint) - { -// output=1; - interrupt&=~128; - takeint=0; -// skipint=0; - push(pc>>8); - push(pc&0xFF); - temp=0x20; - if (p.c) temp|=1; if (p.z) temp|=2; - if (p.i) temp|=4; if (p.d) temp|=8; - if (p.v) temp|=0x40; if (p.n) temp|=0x80; - push(temp); - pc=readmem(0xFFFE)|(readmem(0xFFFF)<<8); - p.i=1; - polltime(7); -// rpclog("INT\n"); - } - interrupt&=~128; - - if (otherstuffcount<=0) - { - otherstuffcount+=128; - sound_poll(); - if (!tapelcount) - { - acia_poll(); - tapelcount=tapellatch; - } - tapelcount--; - if (motorspin) - { - motorspin--; - if (!motorspin) fdc_spindown(); - } - if (ide_count) - { - ide_count-=200; - if (ide_count<=0) - { - ide_callback(); - } - } - if (adc_time) - { - adc_time--; - if (!adc_time) adc_poll(); - } - mcount--; - if (!mcount) - { - mcount = 6; - mouse_poll(); - } - } - if (tube_exec && tubecycle) - { - tubecycles+=(tubecycle<3) tube_exec(); - tubecycle=0; - } - - if (nmi && !oldnmi) - { - push(pc>>8); - push(pc&0xFF); - temp=0x20; - if (p.c) temp|=1; if (p.z) temp|=2; - if (p.i) temp|=4; if (p.d) temp|=8; - if (p.v) temp|=0x40; if (p.n) temp|=0x80; - push(temp); - pc=readmem(0xFFFA)|(readmem(0xFFFB)<<8); - p.i=1; - polltime(7); - nmi=0; -// printf("NMI\n"); - } - } -} - -void m65c02_exec() -{ - uint16_t addr; - uint8_t temp; - int tempi; - int8_t offset; - cycles+=40000; -// rpclog("PC = %04X\n",pc); -// rpclog("Exec cycles %i\n",cycles); - while (cycles>0) - { -// if (pc==0x806F) rpclog("806F from %04X %04X\n",oldpc,oldoldpc); -// if (pc>0xDFF && pc<0x8000) rpclog("EXEC %04X\n",pc); - pc3=oldoldpc; - oldoldpc=oldpc; - oldpc=pc; -// if (skipint==1) skipint=0; - vis20k=RAMbank[pc>>12]; - opcode=readmem(pc); - if (debugon) debugger_do(); - pc++; - switch (opcode) - { - case 0x00: /*BRK*/ -// printf("BRK! %04X\n",pc); -// if (output==2) -// { -// rpclog("BRK! %04X %04X %04X %04X\n",pc,oldpc,oldoldpc,pc3); -// dumpregs(); -// if (output) exit(-1); -// exit(-1); -// } - pc++; - push(pc>>8); - push(pc&0xFF); - temp=0x30; - if (p.c) temp|=1; if (p.z) temp|=2; - if (p.d) temp|=8; if (p.v) temp|=0x40; - if (p.n) temp|=0x80; - push(temp); - pc=readmem(0xFFFE)|(readmem(0xFFFF)<<8); - p.i=1; - p.d=0; - polltime(7); - takeint=0; - break; - - case 0x01: /*ORA (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - polltime(6); - takeint=(interrupt && !p.i); - a|=readmem(addr); - setzn(a); - break; - - case 0x04: /*TSB zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - p.z=!(temp&a); - temp|=a; - writemem(addr,temp); - polltime(5); - break; - - case 0x05: /*ORA zp*/ - addr=readmem(pc); pc++; - a|=readmem(addr); - setzn(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x06: /*ASL zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - p.c=temp&0x80; - temp<<=1; - setzn(temp); - writemem(addr,temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x08: /*PHP*/ - temp=0x30; - if (p.c) temp|=1; if (p.z) temp|=2; - if (p.i) temp|=4; if (p.d) temp|=8; - if (p.v) temp|=0x40; if (p.n) temp|=0x80; - push(temp); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x09: /*ORA imm*/ - a|=readmem(pc); pc++; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x0A: /*ASL A*/ - p.c=a&0x80; - a<<=1; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x0B: /*ANC imm*/ - a&=readmem(pc); pc++; - setzn(a); - p.c=p.n; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x0C: /*TSB abs*/ - addr=getw(); - temp=readmem(addr); - p.z=!(temp&a); - temp|=a; - writemem(addr,temp); - polltime(6); - break; - - case 0x0D: /*ORA abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - a|=readmem(addr); - setzn(a); - break; - - case 0x0E: /*ASL abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr); - polltime(1); - readmem(addr); - polltime(1); - p.c=temp&0x80; - temp<<=1; - setzn(temp); - takeint=(interrupt && !p.i); - writemem(addr,temp); - break; - - case 0x10: /*BPL*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (!p.n) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - branchcycles(temp); - break; - - case 0x11: /*ORA (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a|=readmem(addr+y); - setzn(a); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x12: /*ORA ()*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - a|=readmem(addr); - setzn(a); - polltime(5); - break; - - case 0x14: /*TRB zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - p.z=!(temp&a); - temp&=~a; - writemem(addr,temp); - polltime(5); - break; - - case 0x15: /*ORA zp,x*/ - addr=readmem(pc); pc++; - a|=readmem((addr+x)&0xFF); - setzn(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x16: /*ASL zp,x*/ - addr=(readmem(pc)+x)&0xFF; pc++; - temp=readmem(addr); - p.c=temp&0x80; - temp<<=1; - setzn(temp); - writemem(addr,temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x18: /*CLC*/ - p.c=0; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x19: /*ORA abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a|=readmem(addr+y); - setzn(a); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x1A: /*INC A*/ - a++; - setzn(a); - polltime(2); - break; - - case 0x1C: /*TRB abs*/ - addr=getw(); - temp=readmem(addr); - p.z=!(temp&a); - temp&=~a; - writemem(addr,temp); - polltime(6); - break; - - case 0x1D: /*ORA abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - addr+=x; - polltime(4); - takeint=(interrupt && !p.i); - a|=readmem(addr); - setzn(a); - break; - - case 0x1E: /*ASL abs,x*/ - addr=getw(); - readmem((addr&0xFF00)|((addr+x)&0xFF)); - tempw=((addr&0xFF00)^((addr+x)&0xFF00))?1:0; - addr+=x; - temp=readmem(addr); - readmem(addr); - p.c=temp&0x80; - temp<<=1; - takeint=(interrupt && !p.i); - writemem(addr,temp); - setzn(temp); - polltime(6+tempw); - break; - - case 0x20: /*JSR*/ - addr=getw(); pc--; - push(pc>>8); - push(pc); - pc=addr; - polltime(5); - takeint=(interrupt && !p.i); - polltime(1); - break; - - case 0x21: /*AND (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - a&=readmem(addr); - setzn(a); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0x24: /*BIT zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - p.z=!(a&temp); - p.v=temp&0x40; - p.n=temp&0x80; - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x25: /*AND zp*/ - addr=readmem(pc); pc++; - a&=readmem(addr); - setzn(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x26: /*ROL zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - tempi=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - setzn(temp); - writemem(addr,temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x28: /*PLP*/ - temp=pull(); - polltime(4); - takeint=(interrupt && !p.i); - p.c=temp&1; p.z=temp&2; - p.i=temp&4; p.d=temp&8; - p.v=temp&0x40; p.n=temp&0x80; - break; - - case 0x29: /*AND*/ - a&=readmem(pc); pc++; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x2A: /*ROL A*/ - tempi=p.c; - p.c=a&0x80; - a<<=1; - if (tempi) a|=1; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x2C: /*BIT abs*/ - addr=getw(); - polltime(3); - takeint=(interrupt && !p.i); - polltime(1); - temp=readmem(addr); - p.z=!(a&temp); - p.v=temp&0x40; - p.n=temp&0x80; - break; - - case 0x2D: /*AND abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - a&=readmem(addr); - setzn(a); - break; - - case 0x2E: /*ROL abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr); - polltime(1); - readmem(addr); - tempi=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - polltime(1); - takeint=(interrupt && !p.i); - writemem(addr,temp); - setzn(temp); - break; - - case 0x30: /*BMI*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (p.n) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - branchcycles(temp); - break; - - case 0x31: /*AND (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a&=readmem(addr+y); - setzn(a); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x32: /*AND ()*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - a&=readmem(addr); - setzn(a); - polltime(5); - break; - - case 0x35: /*AND zp,x*/ - addr=readmem(pc); pc++; - a&=readmem((addr+x)&0xFF); - setzn(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x36: /*ROL zp,x*/ - addr=readmem(pc); pc++; - addr+=x; addr&=0xFF; - temp=readmem(addr); - tempi=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - setzn(temp); - writemem(addr,temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x38: /*SEC*/ - p.c=1; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x39: /*AND abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a&=readmem(addr+y); - setzn(a); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x3A: /*DEC A*/ - a--; - setzn(a); - polltime(2); - break; - - case 0x3C: /*BIT abs,x*/ - addr=getw(); addr+=x; - temp=readmem(addr); - p.z=!(a&temp); - p.v=temp&0x40; - p.n=temp&0x80; - polltime(4); - break; - - case 0x3D: /*AND abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - addr+=x; - a&=readmem(addr); - setzn(a); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x3E: /*ROL abs,x*/ - addr=getw(); - readmem((addr&0xFF00)|((addr+x)&0xFF)); - tempw=((addr&0xFF00)^((addr+x)&0xFF00))?1:0; - addr+=x; - temp=readmem(addr); - readmem(addr); - tempi=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - writemem(addr,temp); - setzn(temp); - polltime(6+tempw); - takeint=(interrupt && !p.i); - break; - - case 0x40: /*RTI*/ - temp=pull(); - p.c=temp&1; p.z=temp&2; - p.i=temp&4; p.d=temp&8; - p.v=temp&0x40; p.n=temp&0x80; - pc=pull(); - pc|=(pull()<<8); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0x41: /*EOR (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - a^=readmem(addr); - setzn(a); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0x45: /*EOR zp*/ - addr=readmem(pc); pc++; - a^=readmem(addr); - setzn(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x46: /*LSR zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - p.c=temp&1; - temp>>=1; - setzn(temp); - writemem(addr,temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x48: /*PHA*/ - push(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x49: /*EOR imm*/ - a^=readmem(pc); pc++; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x4A: /*LSR A*/ - p.c=a&1; - a>>=1; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x4C: /*JMP*/ - addr=getw(); - pc=addr; - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x4D: /*EOR abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - a^=readmem(addr); - setzn(a); - break; - - case 0x4E: /*LSR abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr); - polltime(1); - readmem(addr); - polltime(1); - p.c=temp&1; - temp>>=1; - setzn(temp); - takeint=(interrupt && !p.i); - writemem(addr,temp); - break; - - case 0x50: /*BVC*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (!p.v) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - branchcycles(temp); - break; - - case 0x51: /*EOR (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a^=readmem(addr+y); - setzn(a); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x52: /*EOR ()*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - a^=readmem(addr); - setzn(a); - polltime(5); - break; - - case 0x55: /*EOR zp,x*/ - addr=readmem(pc); pc++; - a^=readmem((addr+x)&0xFF); - setzn(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x56: /*LSR zp,x*/ - addr=(readmem(pc)+x)&0xFF; pc++; - temp=readmem(addr); - p.c=temp&1; - temp>>=1; - setzn(temp); - writemem(addr,temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x58: /*CLI*/ - polltime(2); - takeint=(interrupt && !p.i); - p.i=0; - break; - - case 0x59: /*EOR abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a^=readmem(addr+y); - setzn(a); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x5A: /*PHY*/ - push(y); - polltime(3); - break; - - case 0x5D: /*EOR abs,x*/ - addr=getw(); - polltime(4); - if ((addr&0xFF00)^((addr+x)&0xFF00)) { readmem((addr&0xFF00)|((addr+x)&0xFF)); polltime(1); } - addr+=x; - a^=readmem(addr); - setzn(a); - takeint=(interrupt && !p.i); - break; - - case 0x5E: /*LSR abs,x*/ - addr=getw(); - readmem((addr&0xFF00)|((addr+x)&0xFF)); - tempw=((addr&0xFF00)^((addr+x)&0xFF00))?1:0; - addr+=x; - temp=readmem(addr); - readmem(addr); - p.c=temp&1; - temp>>=1; - writemem(addr,temp); - setzn(temp); - polltime(6+tempw); - takeint=(interrupt && !p.i); - break; - - case 0x60: /*RTS*/ - pc=pull(); - pc|=(pull()<<8); - pc++; - polltime(5); - takeint=(interrupt && !p.i); - polltime(1); - break; - - case 0x61: /*ADC (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - temp=readmem(addr); - ADCc(temp); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0x64: /*STZ zp*/ - addr=readmem(pc); pc++; - writemem(addr,0); - polltime(3); - break; - - case 0x65: /*ADC zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - ADCc(temp); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x66: /*ROR zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - tempi=p.c; - p.c=temp&1; - temp>>=1; - if (tempi) temp|=0x80; - setzn(temp); - writemem(addr,temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x68: /*PLA*/ - a=pull(); - setzn(a); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x69: /*ADC imm*/ - temp=readmem(pc); pc++; - ADCc(temp); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x6A: /*ROR A*/ - tempi=p.c; - p.c=a&1; - a>>=1; - if (tempi) a|=0x80; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x6C: /*JMP ()*/ - addr=getw(); - pc=readmem(addr)|(readmem(addr+1)<<8); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0x6D: /*ADC abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - temp=readmem(addr); - ADCc(temp); - break; - - case 0x6E: /*ROR abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr); - polltime(1); - takeint=(interrupt && !p.i); - readmem(addr); - if ((interrupt&128) && !p.i) takeint=1; - polltime(1); - if (interrupt && !p.i) takeint=1; - tempi=p.c; - p.c=temp&1; - temp>>=1; - if (tempi) temp|=0x80; - setzn(temp); - writemem(addr,temp); - break; - - case 0x70: /*BVS*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (p.v) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - branchcycles(temp); - break; - - case 0x71: /*ADC (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - temp=readmem(addr+y); - ADCc(temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x72: /*ADC ()*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - temp=readmem(addr); - ADCc(temp); - polltime(5); - break; - - case 0x74: /*STZ zp,x*/ - addr=readmem(pc); pc++; - writemem((addr+x)&0xFF,0); - polltime(3); - break; - - case 0x75: /*ADC zp,x*/ - addr=readmem(pc); pc++; - temp=readmem((addr+x)&0xFF); - ADCc(temp); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x76: /*ROR zp,x*/ - addr=readmem(pc); pc++; - addr+=x; addr&=0xFF; - temp=readmem(addr); - tempi=p.c; - p.c=temp&1; - temp>>=1; - if (tempi) temp|=0x80; - setzn(temp); - writemem(addr,temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0x78: /*SEI*/ - polltime(2); - takeint=(interrupt && !p.i); - p.i=1; - break; - - case 0x79: /*ADC abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - temp=readmem(addr+y); - ADCc(temp); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x7A: /*PLY*/ - y=pull(); - setzn(y); - polltime(4); - break; - - case 0x7C: /*JMP (,x)*/ - addr=getw(); addr+=x; - pc=readmem(addr)|(readmem(addr+1)<<8); - polltime(6); - break; - - case 0x7D: /*ADC abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - addr+=x; - temp=readmem(addr); - ADCc(temp); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x7E: /*ROR abs,x*/ - addr=getw(); - readmem((addr&0xFF00)|((addr+x)&0xFF)); - tempw=((addr&0xFF00)^((addr+x)&0xFF00))?1:0; - addr+=x; - temp=readmem(addr); - readmem(addr); - tempi=p.c; - p.c=temp&1; - temp>>=1; - if (tempi) temp|=0x80; - writemem(addr,temp); - setzn(temp); - polltime(6+tempw); - takeint=(interrupt && !p.i); - break; - - case 0x80: /*BRA*/ - offset=(int8_t)readmem(pc); pc++; - temp=3; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - polltime(temp); - break; - - case 0x81: /*STA (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - writemem(addr,a); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0x84: /*STY zp*/ - addr=readmem(pc); pc++; - writemem(addr,y); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x85: /*STA zp*/ - addr=readmem(pc); pc++; - writemem(addr,a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x86: /*STX zp*/ - addr=readmem(pc); pc++; - writemem(addr,x); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0x88: /*DEY*/ - y--; - setzn(y); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x89: /*BIT imm*/ - temp=readmem(pc); pc++; - p.z=!(a&temp); - polltime(2); - break; - - case 0x8A: /*TXA*/ - a=x; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x8C: /*STY abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - writemem(addr,y); - break; - - case 0x8D: /*STA abs*/ - addr=getw(); - polltime(3); - takeint=(interrupt && !p.i); - polltime(1); - writemem(addr,a); - break; - - case 0x8E: /*STX abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - writemem(addr,x); - break; - - case 0x90: /*BCC*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (!p.c) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - branchcycles(temp); - break; - - case 0x91: /*STA (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8)+y; - writemem(addr,a); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0x92: /*STA ()*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - writemem(addr,a); - polltime(6); - break; - - case 0x94: /*STY zp,x*/ - addr=readmem(pc); pc++; - writemem((addr+x)&0xFF,y); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x95: /*STA zp,x*/ - addr=readmem(pc); pc++; - writemem((addr+x)&0xFF,a); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x96: /*STX zp,y*/ - addr=readmem(pc); pc++; - writemem((addr+y)&0xFF,x); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0x98: /*TYA*/ - a=y; - setzn(a); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x99: /*STA abs,y*/ - addr=getw(); - polltime(4); - readmem((addr&0xFF00)|((addr+y)&0xFF)); - polltime(1); - takeint=(interrupt && !p.i); - writemem(addr+y,a); - break; - - case 0x9A: /*TXS*/ - s=x; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0x9C: /*STZ abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - writemem(addr,0); - break; - - case 0x9D: /*STA abs,x*/ - addr=getw(); - polltime(4); - readmem((addr&0xFF00)|((addr+x)&0xFF)); - polltime(1); - takeint=(interrupt && !p.i); - writemem(addr+x,a); - break; - - case 0x9E: /*STZ abs,x*/ - addr=getw(); addr+=x; - polltime(4); - writemem(addr,0); - polltime(1); - break; - - case 0xA0: /*LDY imm*/ - y=readmem(pc); pc++; - setzn(y); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xA1: /*LDA (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - a=readmem(addr); - setzn(a); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0xA2: /*LDX imm*/ - x=readmem(pc); pc++; - setzn(x); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xA4: /*LDY zp*/ - addr=readmem(pc); pc++; - y=readmem(addr); - setzn(y); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xA5: /*LDA zp*/ - addr=readmem(pc); pc++; - a=readmem(addr); - setzn(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xA6: /*LDX zp*/ - addr=readmem(pc); pc++; - x=readmem(addr); - setzn(x); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xA8: /*TAY*/ - y=a; - setzn(y); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xA9: /*LDA imm*/ - a=readmem(pc); pc++; - setzn(a); - polltime(1); - takeint=(interrupt && !p.i); - polltime(1); - break; - - case 0xAA: /*TAX*/ - x=a; - setzn(x); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xAC: /*LDY abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - y=readmem(addr); - setzn(y); - break; - - case 0xAD: /*LDA abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - a=readmem(addr); - setzn(a); - break; - - case 0xAE: /*LDX abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - x=readmem(addr); - setzn(x); - break; - - case 0xB0: /*BCS*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (p.c) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - branchcycles(temp); - break; - - case 0xB1: /*LDA (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a=readmem(addr+y); - setzn(a); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0xB2: /*LDA ()*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - a=readmem(addr); - setzn(a); - polltime(5); - break; - - case 0xB4: /*LDY zp,x*/ - addr=readmem(pc); pc++; - y=readmem((addr+x)&0xFF); - setzn(y); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xB5: /*LDA zp,x*/ - addr=readmem(pc); pc++; - a=readmem((addr+x)&0xFF); - setzn(a); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xB6: /*LDX zp,y*/ - addr=readmem(pc); pc++; - x=readmem((addr+y)&0xFF); - setzn(x); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xB8: /*CLV*/ - p.v=0; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xB9: /*LDA abs,y*/ - addr=getw(); - polltime(3); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a=readmem(addr+y); - setzn(a); - polltime(1); - takeint=(interrupt && !p.i); - break; - - case 0xBA: /*TSX*/ - x=s; - setzn(x); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xBC: /*LDY abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - y=readmem(addr+x); - setzn(y); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0xBD: /*LDA abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - a=readmem(addr+x); - setzn(a); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0xBE: /*LDX abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - x=readmem(addr+y); - setzn(x); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0xC0: /*CPY imm*/ - temp=readmem(pc); pc++; - setzn(y-temp); - p.c=(y>=temp); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xC1: /*CMP (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - temp=readmem(addr); - setzn(a-temp); - p.c=(a>=temp); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0xC4: /*CPY zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - setzn(y-temp); - p.c=(y>=temp); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xC5: /*CMP zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - setzn(a-temp); - p.c=(a>=temp); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xC6: /*DEC zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr)-1; - writemem(addr,temp); - setzn(temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0xC8: /*INY*/ - y++; - setzn(y); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xC9: /*CMP imm*/ - temp=readmem(pc); pc++; - setzn(a-temp); - p.c=(a>=temp); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xCA: /*DEX*/ - x--; - setzn(x); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xCB: /*WAI*/ - polltime(2); - takeint=(interrupt && !p.i); - if (!takeint) pc--; - break; - - case 0xCC: /*CPY abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - temp=readmem(addr); - setzn(y-temp); - p.c=(y>=temp); - break; - - case 0xCD: /*CMP abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - temp=readmem(addr); - setzn(a-temp); - p.c=(a>=temp); - break; - - case 0xCE: /*DEC abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr)-1; - polltime(1); -// takeint=(interrupt && !p.i); - readmem(addr); - takeint=((interrupt&128) && !p.i);// takeint=1; - polltime(1); - if (!takeint) takeint=(interrupt && !p.i); - writemem(addr,temp); - setzn(temp); - break; - - case 0xD0: /*BNE*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (!p.z) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - branchcycles(temp); - break; - - case 0xD1: /*CMP (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - temp=readmem(addr+y); - setzn(a-temp); - p.c=(a>=temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0xD2: /*CMP ()*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - temp=readmem(addr); - setzn(a-temp); - p.c=(a>=temp); - polltime(5); - break; - - case 0xD5: /*CMP zp,x*/ - addr=readmem(pc); pc++; - temp=readmem((addr+x)&0xFF); - setzn(a-temp); - p.c=(a>=temp); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xD6: /*DEC zp,x*/ - addr=readmem(pc); pc++; - temp=readmem((addr+x)&0xFF)-1; - writemem((addr+x)&0xFF,temp); - setzn(temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0xD8: /*CLD*/ - p.d=0; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xD9: /*CMP abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - temp=readmem(addr+y); - setzn(a-temp); - p.c=(a>=temp); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0xDA: /*PHX*/ - push(x); - polltime(3); - break; - - case 0xDD: /*CMP abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - temp=readmem(addr+x); - setzn(a-temp); - p.c=(a>=temp); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0xDE: /*DEC abs,x*/ - addr=getw(); - readmem((addr&0xFF00)|((addr+x)&0xFF)); - addr+=x; - temp=readmem(addr)-1; - readmem(addr); - writemem(addr,temp); - setzn(temp); - polltime(7); - takeint=(interrupt && !p.i); - break; - - case 0xE0: /*CPX imm*/ - temp=readmem(pc); pc++; - setzn(x-temp); - p.c=(x>=temp); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xE1: /*SBC (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - temp=readmem(addr); - SBC(temp); - polltime(6); - takeint=(interrupt && !p.i); - break; - - case 0xE4: /*CPX zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - setzn(x-temp); - p.c=(x>=temp); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xE5: /*SBC zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - SBCc(temp); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xE6: /*INC zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr)+1; - writemem(addr,temp); - setzn(temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0xE8: /*INX*/ - x++; - setzn(x); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xE9: /*SBC imm*/ - temp=readmem(pc); pc++; - SBCc(temp); - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xEA: /*NOP*/ - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xEC: /*CPX abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - temp=readmem(addr); - setzn(x-temp); - p.c=(x>=temp); - break; - - case 0xED: /*SBC abs*/ - addr=getw(); - polltime(4); - takeint=(interrupt && !p.i); - temp=readmem(addr); - SBCc(temp); - break; - - case 0xEE: /*INC abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr)+1; - polltime(1); - readmem(addr); - polltime(1); - takeint=(interrupt && !p.i); - writemem(addr,temp); - setzn(temp); - break; - - case 0xF0: /*BEQ*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (p.z) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; -// if (pc<0x8000) printf("%04X %02X\n",(pc&0xFF00)^((pc+offset)&0xFF00),temp); - pc+=offset; - } - branchcycles(temp); - break; - - case 0xF1: /*SBC (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - temp=readmem(addr+y); - SBCc(temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0xF2: /*SBC ()*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - temp=readmem(addr); - SBCc(temp); - polltime(5); - break; - - case 0xF5: /*SBC zp,x*/ - addr=readmem(pc); pc++; - temp=readmem((addr+x)&0xFF); - SBCc(temp); - polltime(3); - takeint=(interrupt && !p.i); - break; - - case 0xF6: /*INC zp,x*/ - addr=readmem(pc); pc++; - temp=readmem((addr+x)&0xFF)+1; - writemem((addr+x)&0xFF,temp); - setzn(temp); - polltime(5); - takeint=(interrupt && !p.i); - break; - - case 0xF8: /*SED*/ - p.d=1; - polltime(2); - takeint=(interrupt && !p.i); - break; - - case 0xF9: /*SBC abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - temp=readmem(addr+y); - SBCc(temp); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0xFA: /*PLX*/ - x=pull(); - setzn(x); - polltime(4); - break; - - case 0xFD: /*SBC abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - temp=readmem(addr+x); - SBCc(temp); - polltime(4); - takeint=(interrupt && !p.i); - break; - - case 0xFE: /*INC abs,x*/ - addr=getw(); - readmem((addr&0xFF00)|((addr+x)&0xFF)); - addr+=x; - temp=readmem(addr)+1; - readmem(addr); - writemem(addr,temp); - setzn(temp); - polltime(7); - takeint=(interrupt && !p.i); - break; - - default: - switch (opcode&0xF) - { - case 2: pc++; polltime(2); break; - case 3: case 0xB: polltime(1); break; - case 4: pc++; if (opcode==0x44) { polltime(3); } else { polltime(4); } break; - case 0xC: pc+=2; if (opcode==0x5C) { polltime(8); } else { polltime(4); } break; - case 7: case 0xF: pc++; polltime(2); break; - } - takeint=(interrupt && !p.i); - break; - - printf("Found bad opcode %02X\n",opcode); - dumpregs(); - mem_dump(); - exit(-1); - } -/* if (output | 1) - { - rpclog("A=%02X X=%02X Y=%02X S=%02X PC=%04X %c%c%c%c%c%c op=%02X %02X%02X %02X%02X %02X %08X\n",a,x,y,s,pc,(p.n)?'N':' ',(p.v)?'V':' ',(p.d)?'D':' ',(p.i)?'I':' ',(p.z)?'Z':' ',(p.c)?'C':' ',opcode,ram[0x21],ram[0x20],ram[0x7F],ram[0x7E],ram[0x7D],memlook[pc>>8]); - }*/ -/* if (timetolive) - { - timetolive--; - if (!timetolive) output=0; - }*/ - if (takeint) - { - interrupt&=~128; - takeint=0; -// skipint=0; - push(pc>>8); - push(pc&0xFF); - temp=0x20; - if (p.c) temp|=1; if (p.z) temp|=2; - if (p.i) temp|=4; if (p.d) temp|=8; - if (p.v) temp|=0x40; if (p.n) temp|=0x80; - push(temp); - pc=readmem(0xFFFE)|(readmem(0xFFFF)<<8); - p.i=1; - p.d=0; - polltime(7); -// rpclog("INT\n"); -// printf("Interrupt - %02X %02X\n",sysvia.ifr&sysvia.ier,uservia.ifr&uservia.ier); -// printf("INT\n"); - } - interrupt&=~128; - if (tube_exec && tubecycle) - { -// rpclog("tubeexec %i %i %i\n",tubecycles,tubecycle,tube_shift); - tubecycles+=(tubecycle<3) tube_exec(); - tubecycle=0; - } - - if (otherstuffcount<=0) - { - otherstuffcount+=128; -// sidline(); - sound_poll(); - if (!tapelcount) - { - acia_poll(); - tapelcount=tapellatch; - } - tapelcount--; - if (motorspin) - { - motorspin--; - if (!motorspin) fdc_spindown(); - } - if (ide_count) - { - ide_count-=200; - if (ide_count<=0) - { - ide_callback(); - } - } - if (adc_time) - { - adc_time--; - if (!adc_time) adc_poll(); - } - mcount--; - if (!mcount) - { - mcount = 6; - mouse_poll(); - } - } - if (nmi && !oldnmi) - { - push(pc>>8); - push(pc&0xFF); - temp=0x20; - if (p.c) temp|=1; if (p.z) temp|=2; - if (p.i) temp|=4; if (p.d) temp|=8; - if (p.v) temp|=0x40; if (p.n) temp|=0x80; - push(temp); - pc=readmem(0xFFFA)|(readmem(0xFFFB)<<8); - p.i=1; - polltime(7); - nmi=0; - p.d=0; -// rpclog("NMI\n"); -// printf("NMI\n"); - } - oldnmi=nmi; - } -} - -void m6502_savestate(FILE *f) -{ - uint8_t temp; - putc(a,f); putc(x,f); putc(y,f); - temp =(p.c)?1:0; temp|=(p.z)?2:0; - temp|=(p.i)?4:0; temp|=(p.d)?8:0; - temp|=(p.v)?0x40:0; temp|=(p.n)?0x80:0; - temp|=0x30; - putc(temp,f); - putc(s,f); putc(pc&0xFF,f); putc(pc>>8,f); - putc(nmi,f); putc(interrupt,f); - putc(cycles,f); putc(cycles>>8,f); putc(cycles>>16,f); putc(cycles>>24,f); -} - -void m6502_loadstate(FILE *f) -{ - uint8_t temp; - a=getc(f); x=getc(f); y=getc(f); - temp=getc(f); - p.c=temp&0x01; p.z=temp&0x02; - p.i=temp&0x04; p.d=temp&0x08; - p.v=temp&0x40; p.n=temp&0x80; - s=getc(f); pc=getc(f); pc|=(getc(f)<<8); - nmi=getc(f); interrupt=getc(f); - cycles=getc(f); cycles|=(getc(f)<<8); cycles|=(getc(f)<<16); cycles|=(getc(f)<<24); -} +/*B-em v2.2 by Tom Walker + 6502/65c02 host CPU emulation*/ + +#include +#include "b-em.h" + +#include "6502.h" +#include "acia.h" +#include "adc.h" +#include "debugger.h" +#include "disc.h" +#include "i8271.h" +#include "ide.h" +#include "mem.h" +#include "model.h" +#include "mouse.h" +#include "serial.h" +#include "sid_b-em.h" +#include "sound.h" +#include "tape.h" +#include "tube.h" +#include "via.h" +#include "sysvia.h" +#include "uservia.h" +#include "video.h" +#include "wd1770.h" + + +int tubecycle; + +int output = 0; +int timetolive = 0; + +#define polltime(c) { cycles -= (c); \ + sysvia.t1c -= (c); if (!(sysvia.acr & 0x20)) sysvia.t2c -= (c); if (sysvia.t1c < -3 || sysvia.t2c < -3) sysvia_updatetimers(); \ + uservia.t1c -= (c); if (!(uservia.acr & 0x20)) uservia.t2c -= (c); if (uservia.t1c < -3 || uservia.t2c < -3) uservia_updatetimers(); \ + video_poll(c); \ + otherstuffcount -= (c); \ + if (motoron) \ + { \ + if (fdc_time) { fdc_time -= (c); if (fdc_time <= 0) fdc_callback(); } \ + disc_time -= (c); if (disc_time <= 0) { disc_time += 16; disc_poll(); } \ + } \ + tubecycle += (c); \ + } + + +static int cycles; +static int otherstuffcount=0; +static int romsel; +static int ram4k, ram8k, ram12k, ram20k; + +static int FEslowdown[8] = {1, 0, 1, 1, 0, 0, 1, 0}; +static int RAMbank[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + + +static uint8_t *memlook[2][256]; +static int memstat[2][256]; +static int vis20k=0; + +static uint8_t acccon; + +uint8_t readmem(uint16_t addr) +{ + + if (debugon) debug_read(addr); + if (pc == addr) fetchc[addr] = 31; + else readc[addr] = 31; + if (memstat[vis20k][addr >> 8]) return memlook[vis20k][addr >> 8][addr]; + if (MASTER && (acccon & 0x40) && addr >= 0xFC00) return os[addr & 0x3FFF]; + if (addr < 0xFE00 || FEslowdown[(addr >> 5) & 7]) { if (cycles & 1) { polltime(2); } else { polltime(1); } } + + switch (addr&~3) + { + case 0xFC20: case 0xFC24: case 0xFC28: case 0xFC2C: + case 0xFC30: case 0xFC34: case 0xFC38: case 0xFC3C: + if (sound_beebsid) return sid_read(addr); + break; + + case 0xFC40: case 0xFC44: case 0xFC48: case 0xFC4C: + case 0xFC50: case 0xFC54: case 0xFC58: case 0xFC5C: + if (ide_enable) return ide_read(addr); + break; + + case 0xFE00: case 0xFE04: return crtc_read(addr); + + case 0xFE08: case 0xFE0C: return acia_read(addr); + + case 0xFE10: case 0xFE14: return serial_read(addr); + + case 0xFE18: if (MASTER) return adc_read(addr); break; + + case 0xFE24: case 0xFE28: if (MASTER) return wd1770_read(addr); break; + + case 0xFE34: if (MASTER) return acccon; break; + + case 0xFE40: case 0xFE44: case 0xFE48: case 0xFE4C: + case 0xFE50: case 0xFE54: case 0xFE58: case 0xFE5C: + return sysvia_read(addr); + + case 0xFE60: case 0xFE64: case 0xFE68: case 0xFE6C: + case 0xFE70: case 0xFE74: case 0xFE78: case 0xFE7C: + return uservia_read(addr); + + case 0xFE80: case 0xFE84: case 0xFE88: case 0xFE8C: + case 0xFE90: case 0xFE94: case 0xFE98: case 0xFE9C: + if (!MASTER) + { + if (WD1770) return wd1770_read(addr); + return i8271_read(addr); + } + break; + + case 0xFEC0: case 0xFEC4: case 0xFEC8: case 0xFECC: + case 0xFED0: case 0xFED4: case 0xFED8: case 0xFEDC: + if (!MASTER) return adc_read(addr); + break; + + case 0xFEE0: case 0xFEE4: case 0xFEE8: case 0xFEEC: + case 0xFEF0: case 0xFEF4: case 0xFEF8: case 0xFEFC: + return tube_host_read(addr); + } + if (addr>=0xFC00 && addr<0xFE00) return 0xFF; + return addr>>8; +} + +void writemem(uint16_t addr, uint8_t val) +{ + int c; + + if (debugon) debug_write(addr,val); + writec[addr] = 31; + if (memstat[vis20k][addr >> 8] == 1) { memlook[vis20k][addr >> 8][addr]=val; return; } + if (addr < 0xFC00 || addr >= 0xFF00) return; + if (addr < 0xFE00 || FEslowdown[(addr >> 5) & 7]) { if (cycles & 1) { polltime(2); } else { polltime(1); } } + + switch (addr&~3) + { + case 0xFC20: case 0xFC24: case 0xFC28: case 0xFC2C: + case 0xFC30: case 0xFC34: case 0xFC38: case 0xFC3C: + if (sound_beebsid) sid_write(addr, val); + break; + + case 0xFC40: case 0xFC44: case 0xFC48: case 0xFC4C: + case 0xFC50: case 0xFC54: case 0xFC58: case 0xFC5C: + ide_write(addr, val); + break; + + case 0xFE00: case 0xFE04: crtc_write(addr, val); break; + + case 0xFE08: case 0xFE0C: acia_write(addr, val); break; + + case 0xFE10: case 0xFE14: serial_write(addr, val); break; + + case 0xFE18: if (MASTER) adc_write(addr, val); break; + + case 0xFE20: videoula_write(addr, val); break; + + case 0xFE24: if (MASTER) wd1770_write(addr, val); else videoula_write(addr, val); break; + + case 0xFE28: if (MASTER) wd1770_write(addr, val); break; + + case 0xFE30: + ram_fe30 = val; + for (c = 128; c < 192; c++) memlook[0][c] = memlook[1][c] = &rom[(val & 15) << 14] - 0x8000; + for (c = 128; c < 192; c++) memstat[0][c] = memstat[1][c] = swram[val & 15] ? 1 : 2; + romsel = (val & 15) << 14; + ram4k = ((val & 0x80) && MASTER); + ram12k = ((val & 0x80) && BPLUS); + RAMbank[0xA] = ram12k; + if (ram4k) + { + for (c = 128; c < 144; c++) memlook[0][c] = memlook[1][c] = ram; + for (c = 128; c < 144; c++) memstat[0][c] = memstat[1][c] = 1; + } + if (ram12k) + { + for (c = 128; c < 176; c++) memlook[0][c] = memlook[1][c] = ram; + for (c = 128; c < 176; c++) memstat[0][c] = memstat[1][c] = 1; + } + break; + + case 0xFE34: + ram_fe34 = val; + if (BPLUS) + { + acccon = val; + vidbank = (val & 0x80) << 8; + if (val & 0x80) RAMbank[0xC] = RAMbank[0xD] = 1; + else RAMbank[0xC] = RAMbank[0xD] = 0; + } + if (MASTER) + { + acccon = val; + ram8k = (val & 8); + ram20k = (val & 4); + vidbank = (val & 1) ? 0x8000 : 0; + if (val & 2) RAMbank[0xC] = RAMbank[0xD] = 1; + else RAMbank[0xC] = RAMbank[0xD] = 0; + for (c = 48; c < 128; c++) memlook[0][c] = ram + ((ram20k) ? 32768 : 0); + if (ram8k) + { + for (c = 192; c < 224; c++) memlook[0][c] = memlook[1][c] = ram - 0x3000; + for (c = 192; c < 224; c++) memstat[0][c] = memstat[1][c] = 1; + } + else + { + for (c = 192; c < 224; c++) memlook[0][c] = memlook[1][c] = os - 0xC000; + for (c = 192; c < 224; c++) memstat[0][c] = memstat[1][c] = 2; + } + } + break; + + case 0xFE40: case 0xFE44: case 0xFE48: case 0xFE4C: + case 0xFE50: case 0xFE54: case 0xFE58: case 0xFE5C: + sysvia_write(addr, val); + break; + + case 0xFE60: case 0xFE64: case 0xFE68: case 0xFE6C: + case 0xFE70: case 0xFE74: case 0xFE78: case 0xFE7C: + uservia_write(addr, val); + break; + + case 0xFE80: case 0xFE84: case 0xFE88: case 0xFE8C: + case 0xFE90: case 0xFE94: case 0xFE98: case 0xFE9C: + if (!MASTER) + { + if (WD1770) wd1770_write(addr, val); + else i8271_write(addr, val); + } + break; + + case 0xFEC0: case 0xFEC4: case 0xFEC8: case 0xFECC: + case 0xFED0: case 0xFED4: case 0xFED8: case 0xFEDC: + if (!MASTER) adc_write(addr, val); + break; + + case 0xFEE0: case 0xFEE4: case 0xFEE8: case 0xFEEC: + case 0xFEF0: case 0xFEF4: case 0xFEF8: case 0xFEFC: + tube_host_write(addr, val); + break; + } +} + +uint8_t a,x,y,s; +uint16_t pc; +PREG p; +int nmi,oldnmi,interrupt,takeint; + +uint16_t pc3,oldpc,oldoldpc; +uint8_t opcode; + +void m6502_reset() +{ + int c; + for (c = 0; c<16; c++) RAMbank[c] = 0; + for (c = 0; c<128; c++) memstat[0][c] = memstat[1][c] = 1; + for (c = 128; c<256; c++) memstat[0][c] = memstat[1][c] = 2; + for (c = 0; c<128; c++) memlook[0][c] = memlook[1][c] = ram; + if (MODELA) + { + for (c = 0; c < 64; c++) memlook[0][c] = memlook[1][c] = ram + 16384; + } + for (c = 48; c < 128; c++) memlook[1][c] = ram + 32768; + for (c = 128; c < 192; c++) memlook[0][c] = memlook[1][c] = rom - 0x8000; + for (c = 192; c < 256; c++) memlook[0][c] = memlook[1][c] = os - 0xC000; + memstat[0][0xFC] = memstat[0][0xFD] = memstat[0][0xFE] = 0; + memstat[1][0xFC] = memstat[1][0xFD] = memstat[1][0xFE] = 0; + + cycles = 0; + ram4k = ram8k = ram12k = ram20k = 0; + + pc = readmem(0xFFFC) | (readmem(0xFFFD) << 8); + p.i = 1; + nmi = oldnmi = 0; + output = 0; + tubecycle = tubecycles = 0; + rpclog("PC : %04X\n",pc); +} + +void dumpregs() +{ + rpclog("6502 registers :\n"); + rpclog("A=%02X X=%02X Y=%02X S=01%02X PC=%04X\n",a, x, y, s, pc); + rpclog("Status : %c%c%c%c%c%c\n", (p.n) ? 'N' : ' ', (p.v) ? 'V' : ' ', (p.d) ? 'D' : ' ', (p.i) ? 'I' : ' ', (p.z) ? 'Z' : ' ', (p.c) ? 'C' : ' '); + rpclog("ROMSEL %02X\n", romsel >> 14); +} + +static inline uint16_t getsw() +{ + uint16_t temp = readmem(pc); pc++; + temp |= (readmem(pc)<<8); pc++; + return temp; +} +#define getw() getsw() + +//#define getw() (readmem(pc)|(readmem(pc+1)<<8)); pc+=2 + +#define setzn(v) p.z = !(v); p.n = (v) & 0x80 + +#define push(v) writemem(0x100 + (s--), v) +#define pull() readmem(0x100 + (++s)) + +/*ADC/SBC temp variables*/ +static uint16_t tempw; +static int tempv,hc6,al,ah; +static uint8_t tempb; + +#define ADC(temp) if (!p.d) \ + { \ + tempw = (a + temp + (p.c ? 1 : 0)); \ + p.v = (!((a ^ temp) & 0x80) && ((a ^ tempw) & 0x80)); \ + a = tempw & 0xFF; \ + p.c = tempw & 0x100; \ + setzn(a); \ + } \ + else \ + { \ + ah = 0; \ + tempb = a + temp + (p.c ? 1:0); \ + if (!tempb) \ + p.z = 1; \ + al = (a & 0xF) + (temp & 0xF) + (p.c ? 1 : 0); \ + if (al > 9) \ + { \ + al -= 10; \ + al &= 0xF; \ + ah = 1; \ + } \ + ah += ((a >> 4) + (temp >> 4)); \ + if (ah & 8) p.n = 1; \ + p.v = (((ah << 4) ^ a) & 128) && !((a ^ temp) & 128); \ + p.c = 0; \ + if (ah > 9) \ + { \ + p.c = 1; \ + ah -= 10; \ + ah &= 0xF; \ + } \ + a = (al & 0xF) | (ah << 4); \ + } + +#define SBC(temp) if (!p.d) \ + { \ + tempw = a - (temp + (p.c ? 0 : 1)); \ + tempv = (short)a - (short)(temp + (p.c ? 0 : 1)); \ + p.v = ((a ^ (temp + (p.c ? 0 : 1))) & (a ^ (uint8_t)tempv) & 0x80); \ + p.c = tempv >= 0;\ + a = tempw & 0xFF; \ + setzn(a); \ + } \ + else \ + { \ + hc6 = 0; \ + p.z = p.n = 0; \ + if (!((a - temp) - (p.c ? 0 : 1))) \ + p.z = 1; \ + al = (a & 15) - (temp & 15) - (p.c ? 0 : 1); \ + if (al & 16) \ + { \ + al -= 6; \ + al &= 0xF; \ + hc6 = 1; \ + } \ + ah = (a >> 4) - (temp >> 4); \ + if (hc6) ah--; \ + if ((a - (temp + (p.c ? 0 : 1))) & 0x80) \ + p.n = 1; \ + p.v = (((a - (temp + (p.c ? 0 : 1))) ^ temp) & 0x80) && ((a ^ temp) & 0x80); \ + p.c = 1; \ + if (ah & 16) \ + { \ + p.c = 0; \ + ah -= 6; \ + ah &= 0xF; \ + } \ + a = (al & 0xF) | ((ah & 0xF) << 4); \ + } + +#define ADCc(temp) if (!p.d) \ + { \ + tempw = (a + temp + (p.c ? 1 : 0)); \ + p.v = (!((a ^ temp) & 0x80) && ((a ^ tempw) & 0x80)); \ + a = tempw & 0xFF; \ + p.c = tempw & 0x100; \ + setzn(a); \ + } \ + else \ + { \ + ah = 0; \ + tempb = a + temp + (p.c ? 1 : 0); \ + al = (a & 0xF) + (temp & 0xF) + (p.c ? 1 : 0); \ + if (al > 9) \ + { \ + al -= 10; \ + al &= 0xF; \ + ah = 1; \ + } \ + ah += ((a >> 4) + (temp >> 4)); \ + p.v = (((ah << 4) ^ a) & 0x80) && !((a ^ temp) & 0x80); \ + p.c = 0; \ + if (ah > 9) \ + { \ + p.c = 1; \ + ah -= 10; \ + ah &= 0xF; \ + } \ + a = (al & 0xF) | (ah << 4); \ + setzn(a); \ + polltime(1); \ + } + +#define SBCc(temp) if (!p.d) \ + { \ + tempw = a - (temp + (p.c ? 0 : 1)); \ + tempv = (short)a - (short)(temp + (p.c ? 0 : 1)); \ + p.v = ((a ^ (temp + (p.c ? 0 : 1))) & (a ^ (uint8_t)tempv) & 0x80); \ + p.c = tempv >= 0;\ + a = tempw & 0xFF; \ + setzn(a); \ + } \ + else \ + { \ + hc6 = 0; \ + p.z = p.n = 0; \ + al = (a & 15) - (temp & 15) - ((p.c) ? 0 : 1); \ + if (al & 16) \ + { \ + al -= 6; \ + al &= 0xF; \ + hc6 = 1; \ + } \ + ah = (a >> 4) - (temp >> 4); \ + if (hc6) ah--; \ + p.v = (((a - (temp + (p.c ? 0 : 1))) ^ temp) & 0x80) && ((a ^ temp) & 0x80); \ + p.c = 1; \ + if (ah & 16) \ + { \ + p.c = 0; \ + ah -= 6; \ + ah &= 0xF; \ + } \ + a = (al & 0xF) | ((ah & 0xF) << 4); \ + setzn(a); \ + polltime(1); \ + } + +static void branchcycles(int temp) +{ + if (temp > 2) + { + polltime(temp - 1); + takeint = (interrupt && !p.i); + polltime(1); + } + else + { + polltime(2); + takeint = (interrupt && !p.i); + } +} + +void m6502_exec() +{ + uint16_t addr; + uint8_t temp; + int tempi; + int8_t offset; + int c; + cycles+=40000; + while (cycles>0) + { + pc3=oldoldpc; + oldoldpc=oldpc; + oldpc=pc; +// if (pc==0x2853) output=1; +// if (skipint==1) skipint=0; + vis20k=RAMbank[pc>>12]; + opcode=readmem(pc); + if (debugon) debugger_do(); + pc++; + switch (opcode) + { + case 0x00: /*BRK*/ +// if (output) +// { + //printf("BRK! at %04X\n",pc); +// output=1; +// dumpregs(); +// mem_dump(); +// exit(-1); +// } + pc++; + push(pc>>8); + push(pc&0xFF); + temp=0x30; + if (p.c) temp|=1; if (p.z) temp|=2; + if (p.d) temp|=8; if (p.v) temp|=0x40; + if (p.n) temp|=0x80; + push(temp); + pc=readmem(0xFFFE)|(readmem(0xFFFF)<<8); + p.i=1; + polltime(7); + takeint=0; + break; + + case 0x01: /*ORA (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + polltime(6); + takeint=(interrupt && !p.i); + a|=readmem(addr); + setzn(a); + break; + + case 0x03: /*Undocumented - SLO (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + polltime(5); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + polltime(1); + c=temp&0x80; + temp<<=1; + writemem(addr,temp); + a|=temp; + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x04: /*Undocumented - NOP zp*/ + addr=readmem(pc); pc++; + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x05: /*ORA zp*/ + addr=readmem(pc); pc++; + a|=readmem(addr); + setzn(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x06: /*ASL zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + p.c=temp&0x80; + temp<<=1; + setzn(temp); + writemem(addr,temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x07: /*Undocumented - SLO zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + c=temp&0x80; + temp<<=1; + writemem(addr,temp); + a|=temp; + setzn(a); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x08: /*PHP*/ + temp=0x30; + if (p.c) temp|=1; if (p.z) temp|=2; + if (p.i) temp|=4; if (p.d) temp|=8; + if (p.v) temp|=0x40; if (p.n) temp|=0x80; + push(temp); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x09: /*ORA imm*/ + a|=readmem(pc); pc++; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x0A: /*ASL A*/ + p.c=a&0x80; + a<<=1; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x0B: /*Undocumented - ANC imm*/ + a&=readmem(pc); pc++; + setzn(a); + p.c=p.n; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x0C: /*Undocumented - NOP abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x0D: /*ORA abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + a|=readmem(addr); + setzn(a); + break; + + case 0x0E: /*ASL abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + polltime(1); + p.c=temp&0x80; + temp<<=1; + setzn(temp); + takeint=(interrupt && !p.i); + writemem(addr,temp); + break; + + case 0x0F: /*Undocumented - SLO abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + polltime(1); + c=temp&0x80; + temp<<=1; + writemem(addr,temp); + a|=temp; + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x10: /*BPL*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (!p.n) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + branchcycles(temp); + break; + + case 0x11: /*ORA (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a|=readmem(addr+y); + setzn(a); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x13: /*Undocumented - SLO (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + polltime(5); + temp=readmem(addr+y); + polltime(1); + writemem(addr+y,temp); + polltime(1); + c=temp&0x80; + temp<<=1; + writemem(addr+y,temp); + a|=temp; + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x14: /*Undocumented - NOP zp,x*/ + addr=readmem(pc); pc++; + readmem((addr+x)&0xFF); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x15: /*ORA zp,x*/ + addr=readmem(pc); pc++; + a|=readmem((addr+x)&0xFF); + setzn(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x16: /*ASL zp,x*/ + addr=(readmem(pc)+x)&0xFF; pc++; + temp=readmem(addr); + p.c=temp&0x80; + temp<<=1; + setzn(temp); + writemem(addr,temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x17: /*Undocumented - SLO zp,x*/ + addr=(readmem(pc)+x)&0xFF; pc++; + polltime(3); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + polltime(1); + c=temp&0x80; + temp<<=1; + writemem(addr,temp); + a|=temp; + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x18: /*CLC*/ + p.c=0; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x19: /*ORA abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a|=readmem(addr+y); + setzn(a); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x1A: /*Undocumented - NOP*/ + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x1B: /*Undocumented - SLO abs,y*/ + addr=getw()+y; + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + polltime(4); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + polltime(1); + c=temp&0x80; + temp<<=1; + writemem(addr,temp); + a|=temp; + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x1C: /*Undocumented - NOP abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + readmem(addr); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x1D: /*ORA abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + addr+=x; + polltime(4); + takeint=(interrupt && !p.i); + a|=readmem(addr); + setzn(a); + break; + + case 0x1E: /*ASL abs,x*/ + addr=getw(); + readmem((addr&0xFF00)|((addr+x)&0xFF)); + addr+=x; + temp=readmem(addr); + writemem(addr,temp); + p.c=temp&0x80; + temp<<=1; + takeint=(interrupt && !p.i); + writemem(addr,temp); + setzn(temp); + polltime(7); + break; + + case 0x1F: /*Undocumented - SLO abs,x*/ + addr=getw()+x; + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + polltime(4); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + polltime(1); + c=temp&0x80; + temp<<=1; + writemem(addr,temp); + a|=temp; + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x20: /*JSR*/ + addr=getw(); pc--; + push(pc>>8); + push(pc); + pc=addr; + polltime(5); + takeint=(interrupt && !p.i); + polltime(1); + break; + + case 0x21: /*AND (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + a&=readmem(addr); + setzn(a); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0x23: /*Undocumented - RLA (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + polltime(5); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + polltime(1); + tempi=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + writemem(addr,temp); + a&=temp; + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x24: /*BIT zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + p.z=!(a&temp); + p.v=temp&0x40; + p.n=temp&0x80; + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x25: /*AND zp*/ + addr=readmem(pc); pc++; + a&=readmem(addr); + setzn(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x26: /*ROL zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + tempi=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + setzn(temp); + writemem(addr,temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x27: /*Undocumented - RLA zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + tempi=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + writemem(addr,temp); + a&=temp; + setzn(a); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x28: /*PLP*/ + temp=pull(); + polltime(4); + takeint=(interrupt && !p.i); + p.c=temp&1; p.z=temp&2; + p.i=temp&4; p.d=temp&8; + p.v=temp&0x40; p.n=temp&0x80; + break; + + case 0x29: /*AND*/ + a&=readmem(pc); pc++; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x2A: /*ROL A*/ + tempi=p.c; + p.c=a&0x80; + a<<=1; + if (tempi) a|=1; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x2B: /*Undocumented - ANC imm*/ + a&=readmem(pc); pc++; + setzn(a); + p.c=p.n; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x2C: /*BIT abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + temp=readmem(addr); + p.z=!(a&temp); + p.v=temp&0x40; + p.n=temp&0x80; + break; + + case 0x2D: /*AND abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + a&=readmem(addr); + setzn(a); + break; + + case 0x2E: /*ROL abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + tempi=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + takeint=((interrupt&128) && !p.i);// takeint=1; + polltime(1); + if (!takeint) takeint=(interrupt && !p.i); + writemem(addr,temp); + setzn(temp); + break; + + case 0x2F: /*Undocumented - RLA abs*/ + addr=getw(); /*Found in The Hobbit*/ + temp=readmem(addr); + tempi=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + writemem(addr,temp); + a&=temp; + setzn(a); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0x30: /*BMI*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (p.n) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + branchcycles(temp); + break; + + case 0x31: /*AND (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a&=readmem(addr+y); + setzn(a); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x33: /*Undocumented - RLA (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + polltime(5); + temp=readmem(addr+y); + polltime(1); + writemem(addr+y,temp); + tempi=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + polltime(1); + writemem(addr+y,temp); + a&=temp; + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x34: /*Undocumented - NOP zp,x*/ + addr=readmem(pc); pc++; + readmem((addr+x)&0xFF); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x35: /*AND zp,x*/ + addr=readmem(pc); pc++; + a&=readmem((addr+x)&0xFF); + setzn(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x36: /*ROL zp,x*/ + addr=readmem(pc); pc++; + addr+=x; addr&=0xFF; + temp=readmem(addr); + tempi=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + setzn(temp); + writemem(addr,temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x37: /*Undocumented - RLA zp,x*/ + addr=(readmem(pc)+x)&0xFF; pc++; + temp=readmem(addr); + tempi=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + writemem(addr,temp); + a&=temp; + setzn(a); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x38: /*SEC*/ + p.c=1; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x39: /*AND abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a&=readmem(addr+y); + setzn(a); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x3A: /*Undocumented - NOP*/ + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x3B: /*Undocumented - RLA abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + polltime(4); + temp=readmem(addr+y); + polltime(1); + writemem(addr+y,temp); + tempi=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + polltime(1); + writemem(addr+y,temp); + a&=temp; + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x3C: /*Undocumented - NOP abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + readmem(addr+x); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x3D: /*AND abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + addr+=x; + a&=readmem(addr); + setzn(a); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x3E: /*ROL abs,x*/ + addr=getw(); + readmem((addr&0xFF00)|((addr+x)&0xFF)); + addr+=x; + temp=readmem(addr); + writemem(addr,temp); + tempi=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + writemem(addr,temp); + setzn(temp); + polltime(7); + takeint=(interrupt && !p.i); + break; + + case 0x3F: /*Undocumented - RLA abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + polltime(4); + temp=readmem(addr+x); + polltime(1); + writemem(addr+x,temp); + tempi=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + polltime(1); + writemem(addr+x,temp); + a&=temp; + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x40: /*RTI*/ + output=0; + temp=pull(); + p.c=temp&1; p.z=temp&2; + p.i=temp&4; p.d=temp&8; + p.v=temp&0x40; p.n=temp&0x80; + pc=pull(); + pc|=(pull()<<8); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0x41: /*EOR (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + a^=readmem(addr); + setzn(a); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0x43: /*Undocumented - SRE (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + polltime(5); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + p.c=temp&1; + temp>>=1; + polltime(1); + writemem(addr,temp); + a^=temp; + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x44: /*Undocumented - NOP zp*/ + addr=readmem(pc); pc++; + readmem(addr); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x45: /*EOR zp*/ + addr=readmem(pc); pc++; + a^=readmem(addr); + setzn(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x46: /*LSR zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + p.c=temp&1; + temp>>=1; + setzn(temp); + writemem(addr,temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x47: /*Undocumented - SRE zp*/ + addr=readmem(pc); pc++; + polltime(3); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + p.c=temp&1; + temp>>=1; + polltime(1); + writemem(addr,temp); + a^=temp; + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x48: /*PHA*/ + push(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x49: /*EOR imm*/ + a^=readmem(pc); pc++; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x4A: /*LSR A*/ + p.c=a&1; + a>>=1; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x4B: /*Undocumented - ASR imm*/ + a&=readmem(pc); pc++; + p.c=a&1; + a>>=1; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x4C: /*JMP*/ + addr=getw(); + pc=addr; + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x4D: /*EOR abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + a^=readmem(addr); + setzn(a); + break; + + case 0x4E: /*LSR abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + takeint=((interrupt&128) && !p.i);// takeint=1; + polltime(1); + if (!takeint) takeint=(interrupt && !p.i); + p.c=temp&1; + temp>>=1; + setzn(temp); + writemem(addr,temp); + break; + + case 0x4F: /*Undocumented - SRE abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + p.c=temp&1; + temp>>=1; + polltime(1); + writemem(addr,temp); + a^=temp; + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x50: /*BVC*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (!p.v) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + branchcycles(temp); + break; + + case 0x51: /*EOR (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a^=readmem(addr+y); + setzn(a); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x53: /*Undocumented - SRE (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + polltime(5); + temp=readmem(addr+y); + polltime(1); + writemem(addr+y,temp); + p.c=temp&1; + temp>>=1; + polltime(1); + writemem(addr+y,temp); + a^=temp; + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x54: /*Undocumented - NOP zp,x*/ + addr=readmem(pc); pc++; + readmem((addr+x)&0xFF); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x55: /*EOR zp,x*/ + addr=readmem(pc); pc++; + a^=readmem((addr+x)&0xFF); + setzn(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x56: /*LSR zp,x*/ + addr=(readmem(pc)+x)&0xFF; pc++; + temp=readmem(addr); + p.c=temp&1; + temp>>=1; + setzn(temp); + writemem(addr,temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x57: /*Undocumented - SRE zp,x*/ + addr=(readmem(pc)+x)&0xFF; pc++; + polltime(3); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + p.c=temp&1; + temp>>=1; + polltime(1); + writemem(addr,temp); + a^=temp; + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x58: /*CLI*/ + polltime(2); + takeint=(interrupt && !p.i); + p.i=0; + break; + + case 0x59: /*EOR abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a^=readmem(addr+y); + setzn(a); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x5A: /*Undocumented - NOP*/ + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x5B: /*Undocumented - SRE abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + polltime(4); + temp=readmem(addr+y); + polltime(1); + writemem(addr+y,temp); + p.c=temp&1; + temp>>=1; + polltime(1); + writemem(addr+y,temp); + a^=temp; + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x5C: /*Undocumented - NOP abs,x*/ + addr=getw(); + polltime(4); + if ((addr&0xFF00)^((addr+x)&0xFF00)) { readmem((addr&0xFF00)|((addr+x)&0xFF)); polltime(1); } + readmem(addr+x); + takeint=(interrupt && !p.i); + break; + + case 0x5D: /*EOR abs,x*/ + addr=getw(); + polltime(4); + if ((addr&0xFF00)^((addr+x)&0xFF00)) { readmem((addr&0xFF00)|((addr+x)&0xFF)); polltime(1); } + addr+=x; + a^=readmem(addr); + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x5E: /*LSR abs,x*/ + addr=getw(); + readmem((addr&0xFF00)|((addr+x)&0xFF)); + addr+=x; + temp=readmem(addr); + writemem(addr,temp); + p.c=temp&1; + temp>>=1; + writemem(addr,temp); + setzn(temp); + polltime(7); + takeint=(interrupt && !p.i); + break; + + case 0x5F: /*Undocumented - SRE abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + polltime(4); + temp=readmem(addr+x); + polltime(1); + writemem(addr+x,temp); + p.c=temp&1; + temp>>=1; + polltime(1); + writemem(addr+x,temp); + a^=temp; + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x60: /*RTS*/ + pc=pull(); + pc|=(pull()<<8); + pc++; + polltime(5); + takeint=(interrupt && !p.i); + polltime(1); + break; + + case 0x61: /*ADC (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + temp=readmem(addr); + ADC(temp); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0x63: /*Undocumented - RRA (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + polltime(5); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + temp>>=1; + if (p.c) temp|=0x80; + polltime(1); + writemem(addr,temp); + ADC(temp); + takeint=(interrupt && !p.i); + break; + + case 0x64: /*Undocumented - NOP zp*/ + addr=readmem(pc); pc++; + readmem(addr); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x65: /*ADC zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + ADC(temp); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x66: /*ROR zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + tempi=p.c; + p.c=temp&1; + temp>>=1; + if (tempi) temp|=0x80; + setzn(temp); + writemem(addr,temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x67: /*Undocumented - RRA zp*/ + addr=readmem(pc); pc++; + polltime(3); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + temp>>=1; + if (p.c) temp|=0x80; + polltime(1); + writemem(addr,temp); + ADC(temp); + takeint=(interrupt && !p.i); + break; + + case 0x68: /*PLA*/ + a=pull(); + setzn(a); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x69: /*ADC imm*/ + temp=readmem(pc); pc++; + ADC(temp); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x6A: /*ROR A*/ + tempi=p.c; + p.c=a&1; + a>>=1; + if (tempi) a|=0x80; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x6B: /*Undocumented - ARR*/ + a&=readmem(pc); pc++; + tempi=p.c; + if (p.d) /*This instruction is just as broken on a real 6502 as it is here*/ + { + p.v=((a>>6)^(a>>7)); /*V set if bit 6 changes in ROR*/ + a>>=1; + if (tempi) a|=0x80; + setzn(tempi); + p.c=0; + if ((a&0xF)+(a&1)>5) a=(a&0xF0)+((a&0xF)+6); /*Do broken fixup*/ + if ((a&0xF0)+(a&0x10)>0x50) { a+=0x60; p.c=1; } + } + else + { /*V & C flag behaviours in 64doc.txt are backwards*/ + p.v=((a>>6)^(a>>7)); /*V set if bit 6 changes in ROR*/ + a>>=1; + if (tempi) a|=0x80; + setzn(a); + p.c=a&0x40; + } + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x6C: /*JMP ()*/ + addr=getw(); + if ((addr&0xFF)==0xFF) pc=readmem(addr)|(readmem(addr-0xFF)<<8); + else pc=readmem(addr)|(readmem(addr+1)<<8); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x6D: /*ADC abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + temp=readmem(addr); + ADC(temp); + break; + + case 0x6E: /*ROR abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr); + polltime(1); + takeint=(interrupt && !p.i); + writemem(addr,temp); + if ((interrupt&128) && !p.i) takeint=1; + polltime(1); + if (interrupt && !p.i) takeint=1; + tempi=p.c; + p.c=temp&1; + temp>>=1; + if (tempi) temp|=0x80; + setzn(temp); + writemem(addr,temp); + break; + + case 0x6F: /*Undocumented - RRA abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + temp>>=1; + if (p.c) temp|=0x80; + polltime(1); + writemem(addr,temp); + ADC(temp); + takeint=(interrupt && !p.i); + break; + + case 0x70: /*BVS*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (p.v) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + branchcycles(temp); + break; + + case 0x71: /*ADC (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + temp=readmem(addr+y); + ADC(temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x73: /*Undocumented - RRA (,y)*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + polltime(5); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + temp>>=1; + if (p.c) temp|=0x80; + polltime(1); + writemem(addr,temp); + ADC(temp); + takeint=(interrupt && !p.i); + break; + + case 0x74: /*Undocumented - NOP zp,x*/ + addr=readmem(pc); pc++; + readmem((addr+x)&0xFF); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x75: /*ADC zp,x*/ + addr=readmem(pc); pc++; + temp=readmem((addr+x)&0xFF); + ADC(temp); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x76: /*ROR zp,x*/ + addr=readmem(pc); pc++; + addr+=x; addr&=0xFF; + temp=readmem(addr); + tempi=p.c; + p.c=temp&1; + temp>>=1; + if (tempi) temp|=0x80; + setzn(temp); + writemem(addr,temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x77: /*Undocumented - RRA zp,x*/ + addr=(readmem(pc)+x)&0xFF; pc++; + polltime(3); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + temp>>=1; + if (p.c) temp|=0x80; + polltime(1); + writemem(addr,temp); + ADC(temp); + takeint=(interrupt && !p.i); + break; + + case 0x78: /*SEI*/ + polltime(2); + takeint=(interrupt && !p.i); + p.i=1; + break; + + case 0x79: /*ADC abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + temp=readmem(addr+y); + ADC(temp); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x7A: /*Undocumented - NOP*/ + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x7B: /*Undocumented - RRA abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + polltime(4); + temp=readmem(addr+y); + polltime(1); + writemem(addr+y,temp); + temp>>=1; + if (p.c) temp|=0x80; + polltime(1); + writemem(addr+y,temp); + ADC(temp); + takeint=(interrupt && !p.i); + break; + + case 0x7C: /*Undocumented - NOP abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + readmem(addr); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x7D: /*ADC abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + addr+=x; + temp=readmem(addr); + ADC(temp); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x7E: /*ROR abs,x*/ + addr=getw(); + readmem((addr&0xFF00)|((addr+x)&0xFF)); + addr+=x; + temp=readmem(addr); + writemem(addr,temp); + tempi=p.c; + p.c=temp&1; + temp>>=1; + if (tempi) temp|=0x80; + writemem(addr,temp); + setzn(temp); + polltime(7); + takeint=(interrupt && !p.i); + break; + + case 0x7F: /*Undocumented - RRA abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + polltime(4); + temp=readmem(addr+x); + polltime(1); + writemem(addr+x,temp); + temp>>=1; + if (p.c) temp|=0x80; + polltime(1); + writemem(addr+x,temp); + ADC(temp); + takeint=(interrupt && !p.i); + break; + + case 0x80: /*Undocumented - NOP imm*/ + readmem(pc); pc++; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x81: /*STA (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + writemem(addr,a); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0x82: /*Undocumented - NOP imm*/ /*Should sometimes lock up the machine*/ + readmem(pc); pc++; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x83: /*Undocumented - SAX (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + writemem(addr,a&x); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0x84: /*STY zp*/ + addr=readmem(pc); pc++; + writemem(addr,y); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x85: /*STA zp*/ + addr=readmem(pc); pc++; + writemem(addr,a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x86: /*STX zp*/ + addr=readmem(pc); pc++; + writemem(addr,x); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x87: /*Undocumented - SAX zp*/ + addr=readmem(pc); pc++; + writemem(addr,a&x); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x88: /*DEY*/ + y--; + setzn(y); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x89: /*Undocumented - NOP imm*/ + readmem(pc); pc++; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x8A: /*TXA*/ + a=x; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x8B: /*Undocumented - ANE*/ + temp=readmem(pc); pc++; + a=(a|0xEE)&x&temp; /*Internal parameter always 0xEE on BBC, always 0xFF on Electron*/ + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x8C: /*STY abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + writemem(addr,y); + break; + + case 0x8D: /*STA abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + writemem(addr,a); + break; + + case 0x8E: /*STX abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + writemem(addr,x); + break; + + case 0x8F: /*Undocumented - SAX abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + writemem(addr,a&x); + break; + + case 0x90: /*BCC*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (!p.c) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + branchcycles(temp); + break; + + case 0x91: /*STA (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8)+y; + writemem(addr,a); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0x93: /*Undocumented - SHA (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + writemem(addr+y,a&x&((addr>>8)+1)); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0x94: /*STY zp,x*/ + addr=readmem(pc); pc++; + writemem((addr+x)&0xFF,y); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x95: /*STA zp,x*/ + addr=readmem(pc); pc++; + writemem((addr+x)&0xFF,a); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x96: /*STX zp,y*/ + addr=readmem(pc); pc++; + writemem((addr+y)&0xFF,x); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x97: /*Undocumented - SAX zp,y*/ + addr=readmem(pc); pc++; + writemem((addr+y)&0xFF,a&x); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x98: /*TYA*/ + a=y; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x99: /*STA abs,y*/ + addr=getw(); + polltime(4); + readmem((addr&0xFF00)|((addr+y)&0xFF)); + polltime(1); + takeint=(interrupt && !p.i); + writemem(addr+y,a); + break; + + case 0x9A: /*TXS*/ + s=x; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x9B: /*Undocumented - SHS abs,y*/ + addr=getw(); + readmem((addr&0xFF00)+((addr+y)&0xFF)); + writemem(addr+y,a&x&((addr>>8)+1)); + s=a&x; + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x9C: /*Undocumented - SHY abs,x*/ + addr=getw(); + readmem((addr&0xFF00)+((addr+x)&0xFF)); + writemem(addr+x,y&((addr>>8)+1)); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x9D: /*STA abs,x*/ + addr=getw(); + polltime(4); + readmem((addr&0xFF00)|((addr+x)&0xFF)); + polltime(1); + takeint=(interrupt && !p.i); + writemem(addr+x,a); + break; + + case 0x9E: /*Undocumented - SHX abs,y*/ + addr=getw(); + polltime(4); + readmem((addr&0xFF00)|((addr+x)&0xFF)); + polltime(1); + takeint=(interrupt && !p.i); + writemem(addr+y,x&((addr>>8)+1)); + break; + + case 0x9F: /*Undocumented - SHA abs,y*/ + addr=getw(); + polltime(4); + readmem((addr&0xFF00)|((addr+x)&0xFF)); + polltime(1); + takeint=(interrupt && !p.i); + writemem(addr+y,a&x&((addr>>8)+1)); + break; + + case 0xA0: /*LDY imm*/ + y=readmem(pc); pc++; + setzn(y); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xA1: /*LDA (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + a=readmem(addr); + setzn(a); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0xA2: /*LDX imm*/ + x=readmem(pc); pc++; + setzn(x); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xA3: /*Undocumented - LAX (,y)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + a=x=readmem(addr); + setzn(a); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0xA4: /*LDY zp*/ + addr=readmem(pc); pc++; + y=readmem(addr); + setzn(y); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xA5: /*LDA zp*/ + addr=readmem(pc); pc++; + a=readmem(addr); + setzn(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xA6: /*LDX zp*/ + addr=readmem(pc); pc++; + x=readmem(addr); + setzn(x); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xA7: /*Undocumented - LAX zp*/ + addr=readmem(pc); pc++; + a=x=readmem(addr); + setzn(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xA8: /*TAY*/ + y=a; + setzn(y); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xA9: /*LDA imm*/ + a=readmem(pc); pc++; + setzn(a); + polltime(1); + takeint=(interrupt && !p.i); + polltime(1); + break; + + case 0xAA: /*TAX*/ + x=a; + setzn(x); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xAB: /*Undocumented - LAX*/ + temp=readmem(pc); pc++; + a=x=((a|0xEE)&temp); /*WAAAAY more complicated than this, but it varies from machine to machine anyway*/ + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xAC: /*LDY abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + y=readmem(addr); + setzn(y); + break; + + case 0xAD: /*LDA abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + a=readmem(addr); + setzn(a); + break; + + case 0xAE: /*LDX abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + x=readmem(addr); + setzn(x); + break; + + case 0xAF: /*LAX abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + a=x=readmem(addr); + setzn(a); + break; + + case 0xB0: /*BCS*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (p.c) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + branchcycles(temp); + break; + + case 0xB1: /*LDA (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a=readmem(addr+y); + setzn(a); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0xB3: /*LAX (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a=x=readmem(addr+y); + setzn(a); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0xB4: /*LDY zp,x*/ + addr=readmem(pc); pc++; + y=readmem((addr+x)&0xFF); + setzn(y); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xB5: /*LDA zp,x*/ + addr=readmem(pc); pc++; + a=readmem((addr+x)&0xFF); + setzn(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xB6: /*LDX zp,y*/ + addr=readmem(pc); pc++; + x=readmem((addr+y)&0xFF); + setzn(x); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xB7: /*LAX zp,y*/ + addr=readmem(pc); pc++; + a=x=readmem((addr+y)&0xFF); + setzn(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xB8: /*CLV*/ + p.v=0; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xB9: /*LDA abs,y*/ + addr=getw(); + polltime(3); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a=readmem(addr+y); + setzn(a); + polltime(1); + takeint=(interrupt && !p.i); + break; + + case 0xBA: /*TSX*/ + x=s; + setzn(x); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xBB: /*Undocumented - LAS abs,y*/ + addr=getw(); + polltime(3); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a=x=s=s&readmem(addr+y); /*No, really!*/ + setzn(a); + polltime(1); + takeint=(interrupt && !p.i); + break; + + case 0xBC: /*LDY abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + y=readmem(addr+x); + setzn(y); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0xBD: /*LDA abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + a=readmem(addr+x); + setzn(a); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0xBE: /*LDX abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + x=readmem(addr+y); + setzn(x); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0xBF: /*LAX abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a=x=readmem(addr+y); + setzn(a); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0xC0: /*CPY imm*/ + temp=readmem(pc); pc++; + setzn(y-temp); + p.c=(y>=temp); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xC1: /*CMP (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + temp=readmem(addr); + setzn(a-temp); + p.c=(a>=temp); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0xC2: /*Undocumented - NOP imm*/ /*Should sometimes lock up the machine*/ + readmem(pc); pc++; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xC3: /*Undocumented - DCP (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + polltime(5); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + temp--; + polltime(1); + writemem(addr,temp); + setzn(a-temp); + p.c=(a>=temp); + takeint=(interrupt && !p.i); + break; + + case 0xC4: /*CPY zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + setzn(y-temp); + p.c=(y>=temp); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xC5: /*CMP zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + setzn(a-temp); + p.c=(a>=temp); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xC6: /*DEC zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr)-1; + writemem(addr,temp); + setzn(temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0xC7: /*Undocumented - DCP zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr)-1; + writemem(addr,temp); + setzn(a-temp); + p.c=(a>=temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0xC8: /*INY*/ + y++; + setzn(y); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xC9: /*CMP imm*/ + temp=readmem(pc); pc++; + setzn(a-temp); + p.c=(a>=temp); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xCA: /*DEX*/ + x--; + setzn(x); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xCB: /*Undocumented - SBX imm*/ + temp=readmem(pc); pc++; + setzn((a&x)-temp); + p.c=((a&x)>=temp); + x=(a&x)-temp; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xCC: /*CPY abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + temp=readmem(addr); + setzn(y-temp); + p.c=(y>=temp); + break; + + case 0xCD: /*CMP abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + temp=readmem(addr); + setzn(a-temp); + p.c=(a>=temp); + break; + + case 0xCE: /*DEC abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr)-1; + polltime(1); +// takeint=(interrupt && !p.i); + writemem(addr,temp+1); + takeint=((interrupt&128) && !p.i);// takeint=1; + polltime(1); + if (!takeint) takeint=(interrupt && !p.i); + writemem(addr,temp); + setzn(temp); + break; + + case 0xCF: /*Undocumented - DCP abs*/ + addr=getw(); + temp=readmem(addr)-1; + writemem(addr,temp); + setzn(a-temp); + p.c=(a>=temp); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0xD0: /*BNE*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (!p.z) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + branchcycles(temp); + break; + + case 0xD1: /*CMP (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + temp=readmem(addr+y); + setzn(a-temp); + p.c=(a>=temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0xD3: /*Undocumented - DCP (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + polltime(5); + temp=readmem(addr)-1; + polltime(1); + writemem(addr,temp+1); + polltime(1); + writemem(addr,temp); + setzn(a-temp); + p.c=(a>=temp); + takeint=(interrupt && !p.i); + break; + + case 0xD4: /*Undocumented - NOP zp,x*/ + addr=readmem(pc); pc++; + readmem((addr+x)&0xFF); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xD5: /*CMP zp,x*/ + addr=readmem(pc); pc++; + temp=readmem((addr+x)&0xFF); + setzn(a-temp); + p.c=(a>=temp); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xD6: /*DEC zp,x*/ + addr=readmem(pc); pc++; + temp=readmem((addr+x)&0xFF)-1; + setzn(temp); + writemem((addr+x)&0xFF,temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0xD7: /*Undocumented - DCP zp,x*/ + addr=(readmem(pc)+x)&0xFF; pc++; + temp=readmem(addr)-1; + writemem(addr,temp); + setzn(a-temp); + p.c=(a>=temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0xD8: /*CLD*/ + p.d=0; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xD9: /*CMP abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + temp=readmem(addr+y); + setzn(a-temp); + p.c=(a>=temp); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0xDA: /*Undocumented - NOP*/ + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xDB: /*Undocumented - DCP abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + polltime(4); + temp=readmem(addr+y)-1; + polltime(1); + writemem(addr+y,temp+1); + polltime(1); + writemem(addr+y,temp); + setzn(a-temp); + p.c=(a>=temp); + takeint=(interrupt && !p.i); + break; + + case 0xDC: /*Undocumented - NOP abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + readmem(addr+x); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0xDD: /*CMP abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + temp=readmem(addr+x); + setzn(a-temp); + p.c=(a>=temp); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0xDE: /*DEC abs,x*/ + addr=getw(); + readmem((addr&0xFF00)|((addr+x)&0xFF)); + addr+=x; + temp=readmem(addr)-1; + writemem(addr,temp+1); + writemem(addr,temp); + setzn(temp); + polltime(7); + takeint=(interrupt && !p.i); + break; + + case 0xDF: /*Undocumented - DCP abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + polltime(4); + temp=readmem(addr+x)-1; + polltime(1); + writemem(addr+x,temp+1); + polltime(1); + writemem(addr+x,temp); + setzn(a-temp); + p.c=(a>=temp); + takeint=(interrupt && !p.i); + break; + + case 0xE0: /*CPX imm*/ + temp=readmem(pc); pc++; + setzn(x-temp); + p.c=(x>=temp); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xE1: /*SBC (,x)*/ /*This was missed out of every B-em version since 0.6 as it was never used!*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + temp=readmem(addr); + SBC(temp); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0xE2: /*Undocumented - NOP imm*/ /*Should sometimes lock up the machine*/ + readmem(pc); pc++; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xE3: /*Undocumented - ISB (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + polltime(5); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + temp++; + polltime(1); + writemem(addr,temp); + SBC(temp); + takeint=(interrupt && !p.i); + break; + + case 0xE4: /*CPX zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + setzn(x-temp); + p.c=(x>=temp); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xE5: /*SBC zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + SBC(temp); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xE6: /*INC zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr)+1; + writemem(addr,temp); + setzn(temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0xE7: /*Undocumented - ISB zp*/ + addr=readmem(pc); pc++; + polltime(3); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + temp++; + polltime(1); + writemem(addr,temp); + SBC(temp); + takeint=(interrupt && !p.i); + break; + + case 0xE8: /*INX*/ + x++; + setzn(x); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xE9: /*SBC imm*/ + temp=readmem(pc); pc++; + SBC(temp); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xEA: /*NOP*/ + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xEB: /*Undocumented - SBC imm*/ + temp=readmem(pc); pc++; + SBC(temp); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xEC: /*CPX abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + temp=readmem(addr); + setzn(x-temp); + p.c=(x>=temp); + break; + + case 0xED: /*SBC abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + temp=readmem(addr); + SBC(temp); + break; + + case 0xEE: /*INC abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr)+1; + polltime(1); + writemem(addr,temp-1); + if ((interrupt&128) && !p.i) takeint=1; + polltime(1); + if (interrupt && !p.i) takeint=1; + writemem(addr,temp); + setzn(temp); + break; + + case 0xEF: /*Undocumented - ISB abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + temp++; + polltime(1); + writemem(addr,temp); + SBC(temp); + takeint=(interrupt && !p.i); + break; + + case 0xF0: /*BEQ*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (p.z) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; +// if (pc<0x8000) printf("%04X %02X\n",(pc&0xFF00)^((pc+offset)&0xFF00),temp); + pc+=offset; + } + branchcycles(temp); + break; + + case 0xF1: /*SBC (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + temp=readmem(addr+y); + SBC(temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0xF3: /*Undocumented - ISB (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + polltime(5); + temp=readmem(addr+y); + polltime(1); + writemem(addr+y,temp); + temp++; + polltime(1); + writemem(addr+y,temp); + SBC(temp); + takeint=(interrupt && !p.i); + break; + + case 0xF4: /*Undocumented - NOP zpx*/ + addr=readmem(pc); pc++; + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0xF5: /*SBC zp,x*/ + addr=readmem(pc); pc++; + temp=readmem((addr+x)&0xFF); + SBC(temp); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xF6: /*INC zp,x*/ + addr=readmem(pc); pc++; + temp=readmem((addr+x)&0xFF)+1; + writemem((addr+x)&0xFF,temp); + setzn(temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0xF7: /*Undocumented - ISB zp,x*/ + addr=(readmem(pc)+x)&0xFF; pc++; + polltime(3); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + temp++; + polltime(1); + writemem(addr,temp); + SBC(temp); + takeint=(interrupt && !p.i); + break; + + case 0xF8: /*SED*/ + p.d=1; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xF9: /*SBC abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + temp=readmem(addr+y); + SBC(temp); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0xFA: /*Undocumented - NOP*/ + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xFB: /*Undocumented - ISB abs,y*/ + addr=getw()+y; + polltime(5); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + temp++; + polltime(1); + writemem(addr,temp); + SBC(temp); + takeint=(interrupt && !p.i); + break; + + case 0xFC: /*Undocumented - NOP abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + readmem(addr+x); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0xFD: /*SBC abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + temp=readmem(addr+x); + SBC(temp); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0xFE: /*INC abs,x*/ + addr=getw(); + readmem((addr&0xFF00)|((addr+x)&0xFF)); + addr+=x; + temp=readmem(addr)+1; + writemem(addr,temp-1); + writemem(addr,temp); + setzn(temp); + polltime(7); + takeint=(interrupt && !p.i); + break; + + case 0xFF: /*Undocumented - ISB abs,x*/ + addr=getw()+x; + polltime(5); + temp=readmem(addr); + polltime(1); + writemem(addr,temp); + temp++; + polltime(1); + writemem(addr,temp); + SBC(temp); + takeint=(interrupt && !p.i); + break; + +#if 0 + case 0x02: /*TFS opcode - OSFSC*/ +/* if (uefena) + { + pc+=2; + } + else + {*/ + printf("OSFSC!\n"); + c=OSFSC(); + if (c==6||c==8||c==0||c==5) + { + pc=pull(); + pc+=(pull()<<8)+1; + } + if (c==0x80) + { + temp=ram[pc++]; + p.c=(a>=temp); + setzn(a-temp); + } +// }*/ +// pc+=2; + break; + + case 0x92: /*TFS opcode - OSFILE*/ +/* if (uefena) + { + pc+=2; + } + else + {*/ + printf("OSFILE!\n"); + a=OSFILE(); + if (a==0x80) + { + push(a); + } + else if (a!=0x7F) + { + pc=pull(); + pc+=(pull()<<8)+1; + } +// }*/ +// pc+=2; + break; +#endif + default: /*Halt!*/ +// printf("HALT\n"); +// dumpregs(); +// exit(-1); + pc--; /*PC never moves on*/ + takeint=0; /*Interrupts never occur*/ + oldnmi=1; /*NMIs never occur*/ + polltime(100000); /*Actually lasts forever, but the above code keeps executing HLT forever*/ + break; +// printf("Found bad opcode %02X\n",opcode); +/* switch (opcode&0xF) + { + case 0xA: + break; + case 0x0: + case 0x2: + case 0x3: + case 0x4: + case 0x7: + case 0x9: + case 0xB: + pc++; + break; + case 0xC: + case 0xE: + case 0xF: + pc+=2; + break; + }*/ + } + +// output=(pc<0x172B && pc>=0x167F); +/* if (pc==0x7112) + { + output=1; + dumpregs(); + mem_dump(); + exit(-1); + }*/ +// if (pc==0x1f00) output=1; +/* if (pc==0x6195) + { + dumpregs(); + mem_dump(); + exit(-1); + }*/ +// if (pc==0xCD7A) printf("CD7A from %04X\n",oldpc); +// if (pc==0xC565) printf("C565 from %04X\n",oldpc); +//if (pc>=0x2078 && pc<0x20CA){ output=1; rpclog("%04X\n",pc); } +//if (pc==0x2770) output=1; +//if (pc==0x277C) output=0; + +// if (skipint) skipint--; +/* if (pc==0x6000) output=1; + if (pc==0x6204) output=1; + if (pc==0x6191) + { + dumpregs(); + mem_dump(); + exit(-1); + } + if (pc==0x612B) + { + dumpregs(); + mem_dump(); + exit(-1); + }*/ +/* if (output) + { +// #undef printf + rpclog("A=%02X X=%02X Y=%02X S=%02X PC=%04X %c%c%c%c%c%c op=%02X %02X%02X\n",a,x,y,s,pc,(p.n)?'N':' ',(p.v)?'V':' ',(p.d)?'D':' ',(p.i)?'I':' ',(p.z)?'Z':' ',(p.c)?'C':' ',opcode,ram[0x29],uservia.ifr); + }*/ +// if (pc==0x400) output=1; + if (timetolive) + { + timetolive--; + if (!timetolive) output=0; + } + if (takeint) + { +// output=1; + interrupt&=~128; + takeint=0; +// skipint=0; + push(pc>>8); + push(pc&0xFF); + temp=0x20; + if (p.c) temp|=1; if (p.z) temp|=2; + if (p.i) temp|=4; if (p.d) temp|=8; + if (p.v) temp|=0x40; if (p.n) temp|=0x80; + push(temp); + pc=readmem(0xFFFE)|(readmem(0xFFFF)<<8); + p.i=1; + polltime(7); +// rpclog("INT\n"); + } + interrupt&=~128; + + if (otherstuffcount<=0) + { + otherstuffcount+=128; + sound_poll(); + if (!tapelcount) + { + acia_poll(); + tapelcount=tapellatch; + } + tapelcount--; + if (motorspin) + { + motorspin--; + if (!motorspin) fdc_spindown(); + } + if (ide_count) + { + ide_count-=200; + if (ide_count<=0) + { + ide_callback(); + } + } + if (adc_time) + { + adc_time--; + if (!adc_time) adc_poll(); + } + mcount--; + if (!mcount) + { + mcount = 6; + mouse_poll(); + } + } + if (tube_exec && tubecycle) + { + tubecycles+=(tubecycle<3) tube_exec(); + tubecycle=0; + } + + if (nmi && !oldnmi) + { + push(pc>>8); + push(pc&0xFF); + temp=0x20; + if (p.c) temp|=1; if (p.z) temp|=2; + if (p.i) temp|=4; if (p.d) temp|=8; + if (p.v) temp|=0x40; if (p.n) temp|=0x80; + push(temp); + pc=readmem(0xFFFA)|(readmem(0xFFFB)<<8); + p.i=1; + polltime(7); + nmi=0; +// printf("NMI\n"); + } + } +} + +void m65c02_exec() +{ + uint16_t addr; + uint8_t temp; + int tempi; + int8_t offset; + cycles+=40000; +// rpclog("PC = %04X\n",pc); +// rpclog("Exec cycles %i\n",cycles); + while (cycles>0) + { +// if (pc==0x806F) rpclog("806F from %04X %04X\n",oldpc,oldoldpc); +// if (pc>0xDFF && pc<0x8000) rpclog("EXEC %04X\n",pc); + pc3=oldoldpc; + oldoldpc=oldpc; + oldpc=pc; +// if (skipint==1) skipint=0; + vis20k=RAMbank[pc>>12]; + opcode=readmem(pc); + if (debugon) debugger_do(); + pc++; + switch (opcode) + { + case 0x00: /*BRK*/ +// printf("BRK! %04X\n",pc); +// if (output==2) +// { +// rpclog("BRK! %04X %04X %04X %04X\n",pc,oldpc,oldoldpc,pc3); +// dumpregs(); +// if (output) exit(-1); +// exit(-1); +// } + pc++; + push(pc>>8); + push(pc&0xFF); + temp=0x30; + if (p.c) temp|=1; if (p.z) temp|=2; + if (p.d) temp|=8; if (p.v) temp|=0x40; + if (p.n) temp|=0x80; + push(temp); + pc=readmem(0xFFFE)|(readmem(0xFFFF)<<8); + p.i=1; + p.d=0; + polltime(7); + takeint=0; + break; + + case 0x01: /*ORA (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + polltime(6); + takeint=(interrupt && !p.i); + a|=readmem(addr); + setzn(a); + break; + + case 0x04: /*TSB zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + p.z=!(temp&a); + temp|=a; + writemem(addr,temp); + polltime(5); + break; + + case 0x05: /*ORA zp*/ + addr=readmem(pc); pc++; + a|=readmem(addr); + setzn(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x06: /*ASL zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + p.c=temp&0x80; + temp<<=1; + setzn(temp); + writemem(addr,temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x08: /*PHP*/ + temp=0x30; + if (p.c) temp|=1; if (p.z) temp|=2; + if (p.i) temp|=4; if (p.d) temp|=8; + if (p.v) temp|=0x40; if (p.n) temp|=0x80; + push(temp); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x09: /*ORA imm*/ + a|=readmem(pc); pc++; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x0A: /*ASL A*/ + p.c=a&0x80; + a<<=1; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x0B: /*ANC imm*/ + a&=readmem(pc); pc++; + setzn(a); + p.c=p.n; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x0C: /*TSB abs*/ + addr=getw(); + temp=readmem(addr); + p.z=!(temp&a); + temp|=a; + writemem(addr,temp); + polltime(6); + break; + + case 0x0D: /*ORA abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + a|=readmem(addr); + setzn(a); + break; + + case 0x0E: /*ASL abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr); + polltime(1); + readmem(addr); + polltime(1); + p.c=temp&0x80; + temp<<=1; + setzn(temp); + takeint=(interrupt && !p.i); + writemem(addr,temp); + break; + + case 0x10: /*BPL*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (!p.n) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + branchcycles(temp); + break; + + case 0x11: /*ORA (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a|=readmem(addr+y); + setzn(a); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x12: /*ORA ()*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + a|=readmem(addr); + setzn(a); + polltime(5); + break; + + case 0x14: /*TRB zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + p.z=!(temp&a); + temp&=~a; + writemem(addr,temp); + polltime(5); + break; + + case 0x15: /*ORA zp,x*/ + addr=readmem(pc); pc++; + a|=readmem((addr+x)&0xFF); + setzn(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x16: /*ASL zp,x*/ + addr=(readmem(pc)+x)&0xFF; pc++; + temp=readmem(addr); + p.c=temp&0x80; + temp<<=1; + setzn(temp); + writemem(addr,temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x18: /*CLC*/ + p.c=0; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x19: /*ORA abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a|=readmem(addr+y); + setzn(a); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x1A: /*INC A*/ + a++; + setzn(a); + polltime(2); + break; + + case 0x1C: /*TRB abs*/ + addr=getw(); + temp=readmem(addr); + p.z=!(temp&a); + temp&=~a; + writemem(addr,temp); + polltime(6); + break; + + case 0x1D: /*ORA abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + addr+=x; + polltime(4); + takeint=(interrupt && !p.i); + a|=readmem(addr); + setzn(a); + break; + + case 0x1E: /*ASL abs,x*/ + addr=getw(); + readmem((addr&0xFF00)|((addr+x)&0xFF)); + tempw=((addr&0xFF00)^((addr+x)&0xFF00))?1:0; + addr+=x; + temp=readmem(addr); + readmem(addr); + p.c=temp&0x80; + temp<<=1; + takeint=(interrupt && !p.i); + writemem(addr,temp); + setzn(temp); + polltime(6+tempw); + break; + + case 0x20: /*JSR*/ + addr=getw(); pc--; + push(pc>>8); + push(pc); + pc=addr; + polltime(5); + takeint=(interrupt && !p.i); + polltime(1); + break; + + case 0x21: /*AND (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + a&=readmem(addr); + setzn(a); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0x24: /*BIT zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + p.z=!(a&temp); + p.v=temp&0x40; + p.n=temp&0x80; + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x25: /*AND zp*/ + addr=readmem(pc); pc++; + a&=readmem(addr); + setzn(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x26: /*ROL zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + tempi=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + setzn(temp); + writemem(addr,temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x28: /*PLP*/ + temp=pull(); + polltime(4); + takeint=(interrupt && !p.i); + p.c=temp&1; p.z=temp&2; + p.i=temp&4; p.d=temp&8; + p.v=temp&0x40; p.n=temp&0x80; + break; + + case 0x29: /*AND*/ + a&=readmem(pc); pc++; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x2A: /*ROL A*/ + tempi=p.c; + p.c=a&0x80; + a<<=1; + if (tempi) a|=1; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x2C: /*BIT abs*/ + addr=getw(); + polltime(3); + takeint=(interrupt && !p.i); + polltime(1); + temp=readmem(addr); + p.z=!(a&temp); + p.v=temp&0x40; + p.n=temp&0x80; + break; + + case 0x2D: /*AND abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + a&=readmem(addr); + setzn(a); + break; + + case 0x2E: /*ROL abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr); + polltime(1); + readmem(addr); + tempi=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + polltime(1); + takeint=(interrupt && !p.i); + writemem(addr,temp); + setzn(temp); + break; + + case 0x30: /*BMI*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (p.n) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + branchcycles(temp); + break; + + case 0x31: /*AND (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a&=readmem(addr+y); + setzn(a); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x32: /*AND ()*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + a&=readmem(addr); + setzn(a); + polltime(5); + break; + + case 0x35: /*AND zp,x*/ + addr=readmem(pc); pc++; + a&=readmem((addr+x)&0xFF); + setzn(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x36: /*ROL zp,x*/ + addr=readmem(pc); pc++; + addr+=x; addr&=0xFF; + temp=readmem(addr); + tempi=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + setzn(temp); + writemem(addr,temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x38: /*SEC*/ + p.c=1; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x39: /*AND abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a&=readmem(addr+y); + setzn(a); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x3A: /*DEC A*/ + a--; + setzn(a); + polltime(2); + break; + + case 0x3C: /*BIT abs,x*/ + addr=getw(); addr+=x; + temp=readmem(addr); + p.z=!(a&temp); + p.v=temp&0x40; + p.n=temp&0x80; + polltime(4); + break; + + case 0x3D: /*AND abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + addr+=x; + a&=readmem(addr); + setzn(a); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x3E: /*ROL abs,x*/ + addr=getw(); + readmem((addr&0xFF00)|((addr+x)&0xFF)); + tempw=((addr&0xFF00)^((addr+x)&0xFF00))?1:0; + addr+=x; + temp=readmem(addr); + readmem(addr); + tempi=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + writemem(addr,temp); + setzn(temp); + polltime(6+tempw); + takeint=(interrupt && !p.i); + break; + + case 0x40: /*RTI*/ + temp=pull(); + p.c=temp&1; p.z=temp&2; + p.i=temp&4; p.d=temp&8; + p.v=temp&0x40; p.n=temp&0x80; + pc=pull(); + pc|=(pull()<<8); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0x41: /*EOR (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + a^=readmem(addr); + setzn(a); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0x45: /*EOR zp*/ + addr=readmem(pc); pc++; + a^=readmem(addr); + setzn(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x46: /*LSR zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + p.c=temp&1; + temp>>=1; + setzn(temp); + writemem(addr,temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x48: /*PHA*/ + push(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x49: /*EOR imm*/ + a^=readmem(pc); pc++; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x4A: /*LSR A*/ + p.c=a&1; + a>>=1; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x4C: /*JMP*/ + addr=getw(); + pc=addr; + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x4D: /*EOR abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + a^=readmem(addr); + setzn(a); + break; + + case 0x4E: /*LSR abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr); + polltime(1); + readmem(addr); + polltime(1); + p.c=temp&1; + temp>>=1; + setzn(temp); + takeint=(interrupt && !p.i); + writemem(addr,temp); + break; + + case 0x50: /*BVC*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (!p.v) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + branchcycles(temp); + break; + + case 0x51: /*EOR (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a^=readmem(addr+y); + setzn(a); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x52: /*EOR ()*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + a^=readmem(addr); + setzn(a); + polltime(5); + break; + + case 0x55: /*EOR zp,x*/ + addr=readmem(pc); pc++; + a^=readmem((addr+x)&0xFF); + setzn(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x56: /*LSR zp,x*/ + addr=(readmem(pc)+x)&0xFF; pc++; + temp=readmem(addr); + p.c=temp&1; + temp>>=1; + setzn(temp); + writemem(addr,temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x58: /*CLI*/ + polltime(2); + takeint=(interrupt && !p.i); + p.i=0; + break; + + case 0x59: /*EOR abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a^=readmem(addr+y); + setzn(a); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x5A: /*PHY*/ + push(y); + polltime(3); + break; + + case 0x5D: /*EOR abs,x*/ + addr=getw(); + polltime(4); + if ((addr&0xFF00)^((addr+x)&0xFF00)) { readmem((addr&0xFF00)|((addr+x)&0xFF)); polltime(1); } + addr+=x; + a^=readmem(addr); + setzn(a); + takeint=(interrupt && !p.i); + break; + + case 0x5E: /*LSR abs,x*/ + addr=getw(); + readmem((addr&0xFF00)|((addr+x)&0xFF)); + tempw=((addr&0xFF00)^((addr+x)&0xFF00))?1:0; + addr+=x; + temp=readmem(addr); + readmem(addr); + p.c=temp&1; + temp>>=1; + writemem(addr,temp); + setzn(temp); + polltime(6+tempw); + takeint=(interrupt && !p.i); + break; + + case 0x60: /*RTS*/ + pc=pull(); + pc|=(pull()<<8); + pc++; + polltime(5); + takeint=(interrupt && !p.i); + polltime(1); + break; + + case 0x61: /*ADC (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + temp=readmem(addr); + ADCc(temp); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0x64: /*STZ zp*/ + addr=readmem(pc); pc++; + writemem(addr,0); + polltime(3); + break; + + case 0x65: /*ADC zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + ADCc(temp); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x66: /*ROR zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + tempi=p.c; + p.c=temp&1; + temp>>=1; + if (tempi) temp|=0x80; + setzn(temp); + writemem(addr,temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x68: /*PLA*/ + a=pull(); + setzn(a); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x69: /*ADC imm*/ + temp=readmem(pc); pc++; + ADCc(temp); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x6A: /*ROR A*/ + tempi=p.c; + p.c=a&1; + a>>=1; + if (tempi) a|=0x80; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x6C: /*JMP ()*/ + addr=getw(); + pc=readmem(addr)|(readmem(addr+1)<<8); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0x6D: /*ADC abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + temp=readmem(addr); + ADCc(temp); + break; + + case 0x6E: /*ROR abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr); + polltime(1); + takeint=(interrupt && !p.i); + readmem(addr); + if ((interrupt&128) && !p.i) takeint=1; + polltime(1); + if (interrupt && !p.i) takeint=1; + tempi=p.c; + p.c=temp&1; + temp>>=1; + if (tempi) temp|=0x80; + setzn(temp); + writemem(addr,temp); + break; + + case 0x70: /*BVS*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (p.v) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + branchcycles(temp); + break; + + case 0x71: /*ADC (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + temp=readmem(addr+y); + ADCc(temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x72: /*ADC ()*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + temp=readmem(addr); + ADCc(temp); + polltime(5); + break; + + case 0x74: /*STZ zp,x*/ + addr=readmem(pc); pc++; + writemem((addr+x)&0xFF,0); + polltime(3); + break; + + case 0x75: /*ADC zp,x*/ + addr=readmem(pc); pc++; + temp=readmem((addr+x)&0xFF); + ADCc(temp); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x76: /*ROR zp,x*/ + addr=readmem(pc); pc++; + addr+=x; addr&=0xFF; + temp=readmem(addr); + tempi=p.c; + p.c=temp&1; + temp>>=1; + if (tempi) temp|=0x80; + setzn(temp); + writemem(addr,temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0x78: /*SEI*/ + polltime(2); + takeint=(interrupt && !p.i); + p.i=1; + break; + + case 0x79: /*ADC abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + temp=readmem(addr+y); + ADCc(temp); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x7A: /*PLY*/ + y=pull(); + setzn(y); + polltime(4); + break; + + case 0x7C: /*JMP (,x)*/ + addr=getw(); addr+=x; + pc=readmem(addr)|(readmem(addr+1)<<8); + polltime(6); + break; + + case 0x7D: /*ADC abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + addr+=x; + temp=readmem(addr); + ADCc(temp); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x7E: /*ROR abs,x*/ + addr=getw(); + readmem((addr&0xFF00)|((addr+x)&0xFF)); + tempw=((addr&0xFF00)^((addr+x)&0xFF00))?1:0; + addr+=x; + temp=readmem(addr); + readmem(addr); + tempi=p.c; + p.c=temp&1; + temp>>=1; + if (tempi) temp|=0x80; + writemem(addr,temp); + setzn(temp); + polltime(6+tempw); + takeint=(interrupt && !p.i); + break; + + case 0x80: /*BRA*/ + offset=(int8_t)readmem(pc); pc++; + temp=3; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + polltime(temp); + break; + + case 0x81: /*STA (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + writemem(addr,a); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0x84: /*STY zp*/ + addr=readmem(pc); pc++; + writemem(addr,y); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x85: /*STA zp*/ + addr=readmem(pc); pc++; + writemem(addr,a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x86: /*STX zp*/ + addr=readmem(pc); pc++; + writemem(addr,x); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0x88: /*DEY*/ + y--; + setzn(y); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x89: /*BIT imm*/ + temp=readmem(pc); pc++; + p.z=!(a&temp); + polltime(2); + break; + + case 0x8A: /*TXA*/ + a=x; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x8C: /*STY abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + writemem(addr,y); + break; + + case 0x8D: /*STA abs*/ + addr=getw(); + polltime(3); + takeint=(interrupt && !p.i); + polltime(1); + writemem(addr,a); + break; + + case 0x8E: /*STX abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + writemem(addr,x); + break; + + case 0x90: /*BCC*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (!p.c) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + branchcycles(temp); + break; + + case 0x91: /*STA (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8)+y; + writemem(addr,a); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0x92: /*STA ()*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + writemem(addr,a); + polltime(6); + break; + + case 0x94: /*STY zp,x*/ + addr=readmem(pc); pc++; + writemem((addr+x)&0xFF,y); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x95: /*STA zp,x*/ + addr=readmem(pc); pc++; + writemem((addr+x)&0xFF,a); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x96: /*STX zp,y*/ + addr=readmem(pc); pc++; + writemem((addr+y)&0xFF,x); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0x98: /*TYA*/ + a=y; + setzn(a); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x99: /*STA abs,y*/ + addr=getw(); + polltime(4); + readmem((addr&0xFF00)|((addr+y)&0xFF)); + polltime(1); + takeint=(interrupt && !p.i); + writemem(addr+y,a); + break; + + case 0x9A: /*TXS*/ + s=x; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0x9C: /*STZ abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + writemem(addr,0); + break; + + case 0x9D: /*STA abs,x*/ + addr=getw(); + polltime(4); + readmem((addr&0xFF00)|((addr+x)&0xFF)); + polltime(1); + takeint=(interrupt && !p.i); + writemem(addr+x,a); + break; + + case 0x9E: /*STZ abs,x*/ + addr=getw(); addr+=x; + polltime(4); + writemem(addr,0); + polltime(1); + break; + + case 0xA0: /*LDY imm*/ + y=readmem(pc); pc++; + setzn(y); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xA1: /*LDA (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + a=readmem(addr); + setzn(a); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0xA2: /*LDX imm*/ + x=readmem(pc); pc++; + setzn(x); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xA4: /*LDY zp*/ + addr=readmem(pc); pc++; + y=readmem(addr); + setzn(y); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xA5: /*LDA zp*/ + addr=readmem(pc); pc++; + a=readmem(addr); + setzn(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xA6: /*LDX zp*/ + addr=readmem(pc); pc++; + x=readmem(addr); + setzn(x); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xA8: /*TAY*/ + y=a; + setzn(y); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xA9: /*LDA imm*/ + a=readmem(pc); pc++; + setzn(a); + polltime(1); + takeint=(interrupt && !p.i); + polltime(1); + break; + + case 0xAA: /*TAX*/ + x=a; + setzn(x); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xAC: /*LDY abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + y=readmem(addr); + setzn(y); + break; + + case 0xAD: /*LDA abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + a=readmem(addr); + setzn(a); + break; + + case 0xAE: /*LDX abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + x=readmem(addr); + setzn(x); + break; + + case 0xB0: /*BCS*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (p.c) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + branchcycles(temp); + break; + + case 0xB1: /*LDA (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a=readmem(addr+y); + setzn(a); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0xB2: /*LDA ()*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + a=readmem(addr); + setzn(a); + polltime(5); + break; + + case 0xB4: /*LDY zp,x*/ + addr=readmem(pc); pc++; + y=readmem((addr+x)&0xFF); + setzn(y); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xB5: /*LDA zp,x*/ + addr=readmem(pc); pc++; + a=readmem((addr+x)&0xFF); + setzn(a); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xB6: /*LDX zp,y*/ + addr=readmem(pc); pc++; + x=readmem((addr+y)&0xFF); + setzn(x); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xB8: /*CLV*/ + p.v=0; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xB9: /*LDA abs,y*/ + addr=getw(); + polltime(3); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a=readmem(addr+y); + setzn(a); + polltime(1); + takeint=(interrupt && !p.i); + break; + + case 0xBA: /*TSX*/ + x=s; + setzn(x); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xBC: /*LDY abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + y=readmem(addr+x); + setzn(y); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0xBD: /*LDA abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + a=readmem(addr+x); + setzn(a); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0xBE: /*LDX abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + x=readmem(addr+y); + setzn(x); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0xC0: /*CPY imm*/ + temp=readmem(pc); pc++; + setzn(y-temp); + p.c=(y>=temp); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xC1: /*CMP (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + temp=readmem(addr); + setzn(a-temp); + p.c=(a>=temp); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0xC4: /*CPY zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + setzn(y-temp); + p.c=(y>=temp); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xC5: /*CMP zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + setzn(a-temp); + p.c=(a>=temp); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xC6: /*DEC zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr)-1; + writemem(addr,temp); + setzn(temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0xC8: /*INY*/ + y++; + setzn(y); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xC9: /*CMP imm*/ + temp=readmem(pc); pc++; + setzn(a-temp); + p.c=(a>=temp); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xCA: /*DEX*/ + x--; + setzn(x); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xCB: /*WAI*/ + polltime(2); + takeint=(interrupt && !p.i); + if (!takeint) pc--; + break; + + case 0xCC: /*CPY abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + temp=readmem(addr); + setzn(y-temp); + p.c=(y>=temp); + break; + + case 0xCD: /*CMP abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + temp=readmem(addr); + setzn(a-temp); + p.c=(a>=temp); + break; + + case 0xCE: /*DEC abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr)-1; + polltime(1); +// takeint=(interrupt && !p.i); + readmem(addr); + takeint=((interrupt&128) && !p.i);// takeint=1; + polltime(1); + if (!takeint) takeint=(interrupt && !p.i); + writemem(addr,temp); + setzn(temp); + break; + + case 0xD0: /*BNE*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (!p.z) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + branchcycles(temp); + break; + + case 0xD1: /*CMP (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + temp=readmem(addr+y); + setzn(a-temp); + p.c=(a>=temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0xD2: /*CMP ()*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + temp=readmem(addr); + setzn(a-temp); + p.c=(a>=temp); + polltime(5); + break; + + case 0xD5: /*CMP zp,x*/ + addr=readmem(pc); pc++; + temp=readmem((addr+x)&0xFF); + setzn(a-temp); + p.c=(a>=temp); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xD6: /*DEC zp,x*/ + addr=readmem(pc); pc++; + temp=readmem((addr+x)&0xFF)-1; + writemem((addr+x)&0xFF,temp); + setzn(temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0xD8: /*CLD*/ + p.d=0; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xD9: /*CMP abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + temp=readmem(addr+y); + setzn(a-temp); + p.c=(a>=temp); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0xDA: /*PHX*/ + push(x); + polltime(3); + break; + + case 0xDD: /*CMP abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + temp=readmem(addr+x); + setzn(a-temp); + p.c=(a>=temp); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0xDE: /*DEC abs,x*/ + addr=getw(); + readmem((addr&0xFF00)|((addr+x)&0xFF)); + addr+=x; + temp=readmem(addr)-1; + readmem(addr); + writemem(addr,temp); + setzn(temp); + polltime(7); + takeint=(interrupt && !p.i); + break; + + case 0xE0: /*CPX imm*/ + temp=readmem(pc); pc++; + setzn(x-temp); + p.c=(x>=temp); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xE1: /*SBC (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + temp=readmem(addr); + SBC(temp); + polltime(6); + takeint=(interrupt && !p.i); + break; + + case 0xE4: /*CPX zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + setzn(x-temp); + p.c=(x>=temp); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xE5: /*SBC zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + SBCc(temp); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xE6: /*INC zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr)+1; + writemem(addr,temp); + setzn(temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0xE8: /*INX*/ + x++; + setzn(x); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xE9: /*SBC imm*/ + temp=readmem(pc); pc++; + SBCc(temp); + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xEA: /*NOP*/ + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xEC: /*CPX abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + temp=readmem(addr); + setzn(x-temp); + p.c=(x>=temp); + break; + + case 0xED: /*SBC abs*/ + addr=getw(); + polltime(4); + takeint=(interrupt && !p.i); + temp=readmem(addr); + SBCc(temp); + break; + + case 0xEE: /*INC abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr)+1; + polltime(1); + readmem(addr); + polltime(1); + takeint=(interrupt && !p.i); + writemem(addr,temp); + setzn(temp); + break; + + case 0xF0: /*BEQ*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (p.z) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; +// if (pc<0x8000) printf("%04X %02X\n",(pc&0xFF00)^((pc+offset)&0xFF00),temp); + pc+=offset; + } + branchcycles(temp); + break; + + case 0xF1: /*SBC (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + temp=readmem(addr+y); + SBCc(temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0xF2: /*SBC ()*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + temp=readmem(addr); + SBCc(temp); + polltime(5); + break; + + case 0xF5: /*SBC zp,x*/ + addr=readmem(pc); pc++; + temp=readmem((addr+x)&0xFF); + SBCc(temp); + polltime(3); + takeint=(interrupt && !p.i); + break; + + case 0xF6: /*INC zp,x*/ + addr=readmem(pc); pc++; + temp=readmem((addr+x)&0xFF)+1; + writemem((addr+x)&0xFF,temp); + setzn(temp); + polltime(5); + takeint=(interrupt && !p.i); + break; + + case 0xF8: /*SED*/ + p.d=1; + polltime(2); + takeint=(interrupt && !p.i); + break; + + case 0xF9: /*SBC abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + temp=readmem(addr+y); + SBCc(temp); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0xFA: /*PLX*/ + x=pull(); + setzn(x); + polltime(4); + break; + + case 0xFD: /*SBC abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + temp=readmem(addr+x); + SBCc(temp); + polltime(4); + takeint=(interrupt && !p.i); + break; + + case 0xFE: /*INC abs,x*/ + addr=getw(); + readmem((addr&0xFF00)|((addr+x)&0xFF)); + addr+=x; + temp=readmem(addr)+1; + readmem(addr); + writemem(addr,temp); + setzn(temp); + polltime(7); + takeint=(interrupt && !p.i); + break; + + default: + switch (opcode&0xF) + { + case 2: pc++; polltime(2); break; + case 3: case 0xB: polltime(1); break; + case 4: pc++; if (opcode==0x44) { polltime(3); } else { polltime(4); } break; + case 0xC: pc+=2; if (opcode==0x5C) { polltime(8); } else { polltime(4); } break; + case 7: case 0xF: pc++; polltime(2); break; + } + takeint=(interrupt && !p.i); + break; + + printf("Found bad opcode %02X\n",opcode); + dumpregs(); + mem_dump(); + exit(-1); + } +/* if (output | 1) + { + rpclog("A=%02X X=%02X Y=%02X S=%02X PC=%04X %c%c%c%c%c%c op=%02X %02X%02X %02X%02X %02X %08X\n",a,x,y,s,pc,(p.n)?'N':' ',(p.v)?'V':' ',(p.d)?'D':' ',(p.i)?'I':' ',(p.z)?'Z':' ',(p.c)?'C':' ',opcode,ram[0x21],ram[0x20],ram[0x7F],ram[0x7E],ram[0x7D],memlook[pc>>8]); + }*/ +/* if (timetolive) + { + timetolive--; + if (!timetolive) output=0; + }*/ + if (takeint) + { + interrupt&=~128; + takeint=0; +// skipint=0; + push(pc>>8); + push(pc&0xFF); + temp=0x20; + if (p.c) temp|=1; if (p.z) temp|=2; + if (p.i) temp|=4; if (p.d) temp|=8; + if (p.v) temp|=0x40; if (p.n) temp|=0x80; + push(temp); + pc=readmem(0xFFFE)|(readmem(0xFFFF)<<8); + p.i=1; + p.d=0; + polltime(7); +// rpclog("INT\n"); +// printf("Interrupt - %02X %02X\n",sysvia.ifr&sysvia.ier,uservia.ifr&uservia.ier); +// printf("INT\n"); + } + interrupt&=~128; + if (tube_exec && tubecycle) + { +// rpclog("tubeexec %i %i %i\n",tubecycles,tubecycle,tube_shift); + tubecycles+=(tubecycle<3) tube_exec(); + tubecycle=0; + } + + if (otherstuffcount<=0) + { + otherstuffcount+=128; +// sidline(); + sound_poll(); + if (!tapelcount) + { + acia_poll(); + tapelcount=tapellatch; + } + tapelcount--; + if (motorspin) + { + motorspin--; + if (!motorspin) fdc_spindown(); + } + if (ide_count) + { + ide_count-=200; + if (ide_count<=0) + { + ide_callback(); + } + } + if (adc_time) + { + adc_time--; + if (!adc_time) adc_poll(); + } + mcount--; + if (!mcount) + { + mcount = 6; + mouse_poll(); + } + } + if (nmi && !oldnmi) + { + push(pc>>8); + push(pc&0xFF); + temp=0x20; + if (p.c) temp|=1; if (p.z) temp|=2; + if (p.i) temp|=4; if (p.d) temp|=8; + if (p.v) temp|=0x40; if (p.n) temp|=0x80; + push(temp); + pc=readmem(0xFFFA)|(readmem(0xFFFB)<<8); + p.i=1; + polltime(7); + nmi=0; + p.d=0; +// rpclog("NMI\n"); +// printf("NMI\n"); + } + oldnmi=nmi; + } +} + +void m6502_savestate(FILE *f) +{ + uint8_t temp; + putc(a,f); putc(x,f); putc(y,f); + temp =(p.c)?1:0; temp|=(p.z)?2:0; + temp|=(p.i)?4:0; temp|=(p.d)?8:0; + temp|=(p.v)?0x40:0; temp|=(p.n)?0x80:0; + temp|=0x30; + putc(temp,f); + putc(s,f); putc(pc&0xFF,f); putc(pc>>8,f); + putc(nmi,f); putc(interrupt,f); + putc(cycles,f); putc(cycles>>8,f); putc(cycles>>16,f); putc(cycles>>24,f); +} + +void m6502_loadstate(FILE *f) +{ + uint8_t temp; + a=getc(f); x=getc(f); y=getc(f); + temp=getc(f); + p.c=temp&0x01; p.z=temp&0x02; + p.i=temp&0x04; p.d=temp&0x08; + p.v=temp&0x40; p.n=temp&0x80; + s=getc(f); pc=getc(f); pc|=(getc(f)<<8); + nmi=getc(f); interrupt=getc(f); + cycles=getc(f); cycles|=(getc(f)<<8); cycles|=(getc(f)<<16); cycles|=(getc(f)<<24); +} diff --git a/src/6502.h b/src/6502.h index 7fc04f2b..727e8039 100644 --- a/src/6502.h +++ b/src/6502.h @@ -1,28 +1,28 @@ -extern uint8_t a,x,y,s; -extern uint16_t pc; -extern uint16_t oldpc, oldoldpc, pc3; -typedef struct PREG -{ - int c,z,i,d,v,n; -} PREG; - -extern PREG p; - - -extern int output; -extern int timetolive; -extern int interrupt; -extern int nmi; - -extern uint8_t opcode; - -void m6502_reset(); -void m6502_exec(); -void m65c02_exec(); -void dumpregs(); - -uint8_t readmem(uint16_t addr); -void writemem(uint16_t addr, uint8_t val); - -void m6502_savestate(FILE *f); -void m6502_loadstate(FILE *f); +extern uint8_t a,x,y,s; +extern uint16_t pc; +extern uint16_t oldpc, oldoldpc, pc3; +typedef struct PREG +{ + int c,z,i,d,v,n; +} PREG; + +extern PREG p; + + +extern int output; +extern int timetolive; +extern int interrupt; +extern int nmi; + +extern uint8_t opcode; + +void m6502_reset(); +void m6502_exec(); +void m65c02_exec(); +void dumpregs(); + +uint8_t readmem(uint16_t addr); +void writemem(uint16_t addr, uint8_t val); + +void m6502_savestate(FILE *f); +void m6502_loadstate(FILE *f); diff --git a/src/6502tube.c b/src/6502tube.c index e1bf4ecf..3559363d 100644 --- a/src/6502tube.c +++ b/src/6502tube.c @@ -1,1697 +1,1697 @@ -/*B-em v2.2 by Tom Walker - 6502 parasite CPU emulation*/ - -#include -#include - -#include "b-em.h" -#include "tube.h" -#include "6502tube.h" - -#define a tubea -#define x tubex -#define y tubey -#define s tubesp -#define pc tubepc - -static int tube_6502_skipint; -static int tube_6502_oldnmi; - -/*6502 registers*/ -static uint8_t a,x,y,s; -static uint16_t pc; -static struct -{ - int c,z,i,d,v,n; -} tubep; - -/*Memory structures*/ -/*There is an extra entry to allow for stupid programs (3d grand prix) doing - something stupid like STA $FFFF,x*/ -static uint8_t *tubemem[0x101]; -static int tubememstat[0x101]; -static uint8_t *tuberam; -static uint8_t tuberom[0x1000]; - -static void tube_6502_loadrom() -{ - FILE *f; - char fn[512]; - append_filename(fn,exedir,"roms/tube/6502Tube.rom",511); - f=fopen(fn,"rb"); - fread(tuberom+0x800,0x800,1,f); - fclose(f); -} - -void tube_6502_init_cpu() -{ - int c; - if (!tuberam) tuberam=(uint8_t *)malloc(0x10000); - memset(tuberam,0,0x10000); - for (c=0x00;c<0x100;c++) tubemem[c]=(uint8_t *)(tuberam+(c<<8)); - for (c=0x00;c<0x100;c++) tubememstat[c]=0; - for (c=0xF0;c<0x100;c++) tubememstat[c]=2; -// tubememstat[0xFE]=tubememstat[0xFF]=2; - tubemem[0x100]=tubemem[0]; - tubememstat[0x100]=tubememstat[0]; - tube_6502_loadrom(); -} - -void tube_6502_close() -{ - if (tuberam) free(tuberam); -} - -#undef printf -/*static void tubedumpregs() -{ - FILE *f=fopen("tuberam.dmp","wb"); - fwrite(tuberam,65536,1,f); - fclose(f); - rpclog("Tube 65c12 registers :\n"); - rpclog("A=%02X X=%02X Y=%02X S=01%02X PC=%04X\n",a,x,y,s,pc); - rpclog("Status : %c%c%c%c%c%c\n",(tubep.n)?'N':' ',(tubep.v)?'V':' ',(tubep.d)?'D':' ',(tubep.i)?'I':' ',(tubep.z)?'Z':' ',(tubep.c)?'C':' '); -}*/ - -static int tuberomin=1; -void tube_6502_mapoutrom() -{ - tuberomin=0; -} - -#define polltime(c) { tubecycles-=c; } - -static uint8_t tubereadmeml(uint16_t addr) -{ - uint8_t temp; - if ((addr&~7)==0xFEF8) - { - temp=tube_parasite_read(addr); -// rpclog("Read tube %04X %02X %04X\n",addr,temp,pc); - return temp; - } - if ((addr&~0xFFF)==0xF000 && tuberomin) return tuberom[addr&0xFFF]; - return tuberam[addr]; -} - -int endtimeslice; -static void tubewritememl(uint16_t addr, uint8_t val) -{ -// rpclog("Tube writemem %04X %02X %04X\n",addr,val,pc); - if ((addr&~7)==0xFEF8) - { -// rpclog("Write tube %04X %02X %04X\n",addr,val,pc); - tube_parasite_write(addr,val); - endtimeslice=1; - return; - } -// if (addr==0xF4 || addr==0xF5) rpclog("TUBE PARASITE write %04X %02X\n",addr,val); - tuberam[addr]=val; -} - -#define readmem(a) ((tubememstat[(a)>>8]==2)?tubereadmeml(a):tubemem[(a)>>8][(a)&0xFF]) -#define writemem(a,b) tubewritememl(a,b) -//if (tubememstat[(a)>>8]==0) tubemem[(a)>>8][(a)&0xFF]=b; else if (tubememstat[(a)>>8]==2) tubewritememl(a,b) -#define getw() (readmem(pc)|(readmem(pc+1)<<8)); pc+=2 - -void tube_6502_reset() -{ - tuberomin=1; -//memset(tuberam,0,0x10000); - pc=readmem(0xFFFC)|(readmem(0xFFFD)<<8); - tubep.i=1; - tube_irq=0; - tube_6502_skipint=0; -} - -#define setzn(v) tubep.z=!(v); tubep.n=(v)&0x80 - -#define push(v) tuberam[0x100+(s--)]=v -#define pull() tuberam[0x100+(++s)] - -/*ADC/SBC temp variables*/ -static uint16_t tempw; -static int tempv,hc,al,ah; -static uint8_t tempb; - -#define ADC(temp) if (!tubep.d) \ - { \ - tempw=(a+temp+(tubep.c?1:0)); \ - tubep.v=(!((a^temp)&0x80)&&((a^tempw)&0x80)); \ - a=tempw&0xFF; \ - tubep.c=tempw&0x100; \ - setzn(a); \ - } \ - else \ - { \ - ah=0; \ - tempb=a+temp+(tubep.c?1:0); \ - if (!tempb) \ - tubep.z=1; \ - al=(a&0xF)+(temp&0xF)+(tubep.c?1:0); \ - if (al>9) \ - { \ - al-=10; \ - al&=0xF; \ - ah=1; \ - } \ - ah+=((a>>4)+(temp>>4)); \ - if (ah&8) tubep.n=1; \ - tubep.v=(((ah << 4) ^ a) & 128) && !((a ^ temp) & 128); \ - tubep.c=0; \ - if (ah>9) \ - { \ - tubep.c=1; \ - ah-=10; \ - ah&=0xF; \ - } \ - a=(al&0xF)|(ah<<4); \ - } - -#define SBC(temp) if (!tubep.d) \ - { \ - tempw=a-(temp+(tubep.c?0:1)); \ - tempv=(short)a-(short)(temp+(tubep.c?0:1)); \ - tubep.v=((a^(temp+(tubep.c?0:1)))&(a^(uint8_t)tempv)&0x80); \ - tubep.c=tempv>=0;\ - a=tempw&0xFF; \ - setzn(a); \ - } \ - else \ - { \ - hc=0; \ - tubep.z=tubep.n=0; \ - if (!((a-temp)-((tubep.c)?0:1))) \ - tubep.z=1; \ - al=(a&15)-(temp&15)-((tubep.c)?0:1); \ - if (al&16) \ - { \ - al-=6; \ - al&=0xF; \ - hc=1; \ - } \ - ah=(a>>4)-(temp>>4); \ - if (hc) ah--; \ - if ((a-(temp+((tubep.c)?0:1)))&0x80) \ - tubep.n=1; \ - tubep.v=(((a-(temp+((tubep.c)?0:1)))^temp)&128)&&((a^temp)&128); \ - tubep.c=1; \ - if (ah&16) \ - { \ - tubep.c=0; \ - ah-=6; \ - ah&=0xF; \ - } \ - a=(al&0xF)|((ah&0xF)<<4); \ - } - -static uint16_t oldtpc,oldtpc2; - -void tube_6502_exec() -{ - uint8_t opcode; - uint16_t addr; - uint8_t temp; - int tempi; - int8_t offset; -// tubecycles+=(tubecycs<<1); -// printf("Tube exec %i %04X\n",tubecycles,pc); - while (tubecycles>0) - { - oldtpc2=oldtpc; - oldtpc=pc; - opcode=readmem(pc); pc++; -// printf("Tube opcode %02X\n",opcode); - switch (opcode) - { - case 0x00: /*BRK*/ -// rpclog("Tube BRK at %04X! %04X %04X\n",pc,oldtpc,oldtpc2); - pc++; - push(pc>>8); - push(pc&0xFF); - temp=0x30; - if (tubep.c) temp|=1; if (tubep.z) temp|=2; - if (tubep.d) temp|=8; if (tubep.v) temp|=0x40; - if (tubep.n) temp|=0x80; - push(temp); - pc=readmem(0xFFFE)|(readmem(0xFFFF)<<8); - tubep.i=1; - polltime(7); - break; - - case 0x01: /*ORA (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - a|=readmem(addr); - setzn(a); - polltime(6); - break; - - case 0x04: /*TSB zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - tubep.z=!(temp&a); - temp|=a; - writemem(addr,temp); - polltime(5); - break; - - case 0x05: /*ORA zp*/ - addr=readmem(pc); pc++; - a|=tuberam[addr]; - setzn(a); - polltime(3); - break; - - case 0x06: /*ASL zp*/ - addr=readmem(pc); pc++; - temp=tuberam[addr]; - tubep.c=temp&0x80; - temp<<=1; - setzn(temp); - tuberam[addr]=temp; - polltime(5); - break; - - case 0x08: /*PHP*/ - temp=0x30; - if (tubep.c) temp|=1; if (tubep.z) temp|=2; - if (tubep.i) temp|=4; if (tubep.d) temp|=8; - if (tubep.v) temp|=0x40; if (tubep.n) temp|=0x80; - push(temp); - polltime(3); - break; - - case 0x09: /*ORA imm*/ - a|=readmem(pc); pc++; - setzn(a); - polltime(2); - break; - - case 0x0A: /*ASL A*/ - tubep.c=a&0x80; - a<<=1; - setzn(a); - polltime(2); - break; - - case 0x0C: /*TSB abs*/ - addr=getw(); -// printf("TSB %04X %02X\n",addr,a); - temp=readmem(addr); - tubep.z=!(temp&a); - temp|=a; - writemem(addr,temp); - polltime(6); - break; - - case 0x0D: /*ORA abs*/ - addr=getw(); - polltime(4); - a|=readmem(addr); - setzn(a); - break; - - case 0x0E: /*ASL abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr); - polltime(1); - readmem(addr); - polltime(1); - tubep.c=temp&0x80; - temp<<=1; - setzn(temp); - writemem(addr,temp); - polltime(6); - break; - - case 0x10: /*BPL*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (!tubep.n) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - polltime(temp); - break; - - case 0x11: /*ORA (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a|=readmem(addr+y); - setzn(a); - polltime(5); - break; - - case 0x12: /*ORA ()*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - a|=readmem(addr); - setzn(a); - polltime(5); - break; - - case 0x14: /*TRB zp*/ - addr=readmem(pc); pc++; - temp=readmem(addr); - tubep.z=!(temp&a); - temp&=~a; - writemem(addr,temp); - polltime(5); - break; - - case 0x15: /*ORA zp,x*/ - addr=readmem(pc); pc++; - a|=tuberam[(addr+x)&0xFF]; - setzn(a); - polltime(3); - break; - - case 0x16: /*ASL zp,x*/ - addr=(readmem(pc)+x)&0xFF; pc++; - temp=tuberam[addr]; - tubep.c=temp&0x80; - temp<<=1; - setzn(temp); - tuberam[addr]=temp; - polltime(5); - break; - - case 0x18: /*CLC*/ - tubep.c=0; - polltime(2); - break; - - case 0x19: /*ORA abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a|=readmem(addr+y); - setzn(a); - polltime(4); - break; - - case 0x1A: /*INC A*/ - a++; - setzn(a); - polltime(2); - break; - - case 0x1C: /*TRB abs*/ - addr=getw(); - temp=readmem(addr); - tubep.z=!(temp&a);//!(temp&(~a)); - temp&=~a; - writemem(addr,temp); - polltime(6); - break; - - case 0x1D: /*ORA abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - addr+=x; - a|=readmem(addr); - setzn(a); - polltime(4); - break; - - case 0x1E: /*ASL abs,x*/ - addr=getw(); addr+=x; - temp=readmem(addr); - tubep.c=temp&0x80; - temp<<=1; - writemem(addr,temp); - setzn(temp); - polltime(7); - break; - - case 0x20: /*JSR*/ - addr=getw(); pc--; - push(pc>>8); - push(pc); - pc=addr; - polltime(6); - break; - - case 0x21: /*AND (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - a&=readmem(addr); - setzn(a); - polltime(6); - break; - - case 0x24: /*BIT zp*/ - addr=readmem(pc); pc++; - temp=tuberam[addr]; - tubep.z=!(a&temp); - tubep.v=temp&0x40; - tubep.n=temp&0x80; - polltime(3); - break; - - case 0x25: /*AND zp*/ - addr=readmem(pc); pc++; - a&=tuberam[addr]; - setzn(a); - polltime(3); - break; - - case 0x26: /*ROL zp*/ - addr=readmem(pc); pc++; - temp=tuberam[addr]; - tempi=tubep.c; - tubep.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - setzn(temp); - tuberam[addr]=temp; - polltime(5); - break; - - case 0x28: /*PLP*/ - temp=pull(); - tubep.c=temp&1; tubep.z=temp&2; - tubep.i=temp&4; tubep.d=temp&8; - tubep.v=temp&0x40; tubep.n=temp&0x80; - polltime(4); - break; - - case 0x29: /*AND*/ - a&=readmem(pc); pc++; - setzn(a); - polltime(2); - break; - - case 0x2A: /*ROL A*/ - tempi=tubep.c; - tubep.c=a&0x80; - a<<=1; - if (tempi) a|=1; - setzn(a); - polltime(2); - break; - - case 0x2C: /*BIT abs*/ - addr=getw(); - temp=readmem(addr); -// printf("BIT %04X\n",addr); - tubep.z=!(a&temp); - tubep.v=temp&0x40; - tubep.n=temp&0x80; - polltime(4); - break; - - case 0x2D: /*AND abs*/ - addr=getw(); - polltime(4); - a&=readmem(addr); - setzn(a); - break; - - case 0x2E: /*ROL abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr); - polltime(1); - readmem(addr); - polltime(1); - tempi=tubep.c; - tubep.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - writemem(addr,temp); - setzn(temp); - break; - - case 0x30: /*BMI*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (tubep.n) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - polltime(temp); - break; - - case 0x31: /*AND (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a&=readmem(addr+y); - setzn(a); - polltime(5); - break; - - case 0x35: /*AND zp,x*/ - addr=readmem(pc); pc++; - a&=tuberam[(addr+x)&0xFF]; - setzn(a); - polltime(3); - break; - - case 0x36: /*ROL zp,x*/ - addr=readmem(pc); pc++; - addr+=x; addr&=0xFF; - temp=tuberam[addr]; - tempi=tubep.c; - tubep.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - setzn(temp); - tuberam[addr]=temp; - polltime(5); - break; - - case 0x38: /*SEC*/ - tubep.c=1; - polltime(2); - break; - - case 0x39: /*AND abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a&=readmem(addr+y); - setzn(a); - polltime(4); - break; - - case 0x3A: /*DEC A*/ - a--; - setzn(a); - polltime(2); - break; - - case 0x3C: /*BIT abs,x*/ - addr=getw(); addr+=x; - temp=readmem(addr); -// printf("BIT abs,x %02X %04X\n",temp,addr); - tubep.z=!(a&temp); - tubep.v=temp&0x40; - tubep.n=temp&0x80; - polltime(4); - break; - - case 0x3D: /*AND abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - a&=readmem(addr+x); - setzn(a); - polltime(4); - break; - - case 0x3E: /*ROL abs,x*/ - addr=getw(); addr+=x; - temp=readmem(addr); - tempi=tubep.c; - tubep.c=temp&0x80; - temp<<=1; - if (tempi) temp|=1; - writemem(addr,temp); - setzn(temp); - polltime(7); - break; - - case 0x40: /*RTI*/ - temp=pull(); - tubep.c=temp&1; tubep.z=temp&2; - tubep.i=temp&4; tubep.d=temp&8; - tubep.v=temp&0x40; tubep.n=temp&0x80; - pc=pull(); - pc|=(pull()<<8); - polltime(6); - break; - - case 0x41: /*EOR (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - a^=readmem(addr); - setzn(a); - polltime(6); - break; - - case 0x45: /*EOR zp*/ - addr=readmem(pc); pc++; - a^=tuberam[addr]; - setzn(a); - polltime(3); - break; - - case 0x46: /*LSR zp*/ - addr=readmem(pc); pc++; - temp=tuberam[addr]; - tubep.c=temp&1; - temp>>=1; - setzn(temp); - tuberam[addr]=temp; - polltime(5); - break; - - case 0x48: /*PHA*/ - push(a); - polltime(3); - break; - - case 0x49: /*EOR*/ - a^=readmem(pc); pc++; - setzn(a); - polltime(2); - break; - - case 0x4A: /*LSR A*/ - tubep.c=a&1; - a>>=1; - setzn(a); - polltime(2); - break; - - case 0x4C: /*JMP*/ - addr=getw(); - pc=addr; - polltime(3); - break; - - case 0x4D: /*EOR abs*/ - addr=getw(); - polltime(4); - a^=readmem(addr); - setzn(a); - break; - - case 0x4E: /*LSR abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr); - polltime(1); - readmem(addr); - polltime(1); - tubep.c=temp&1; - temp>>=1; - setzn(temp); - writemem(addr,temp); - polltime(6); - break; - - case 0x50: /*BVC*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (!tubep.v) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - polltime(temp); - break; - - case 0x51: /*EOR (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a^=readmem(addr+y); - setzn(a); - polltime(5); - break; - - case 0x52: /*EOR ()*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - a^=readmem(addr); - setzn(a); - polltime(5); - break; - - case 0x55: /*EOR zp,x*/ - addr=readmem(pc); pc++; - a^=tuberam[(addr+x)&0xFF]; - setzn(a); - polltime(3); - break; - - case 0x56: /*LSR zp,x*/ - addr=(readmem(pc)+x)&0xFF; pc++; - temp=tuberam[addr]; - tubep.c=temp&1; - temp>>=1; - setzn(temp); - tuberam[addr]=temp; - polltime(5); - break; - - case 0x58: /*CLI*/ - tubep.i=0; - polltime(2); - break; - - case 0x59: /*EOR abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a^=readmem(addr+y); - setzn(a); - polltime(4); - break; - - case 0x5A: /*PHY*/ - push(y); - polltime(3); - break; - - case 0x5D: /*EOR abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - a^=readmem(addr+x); - setzn(a); - polltime(4); - break; - - case 0x5E: /*LSR abs,x*/ - addr=getw(); addr+=x; - temp=readmem(addr); - tubep.c=temp&1; - temp>>=1; - writemem(addr,temp); - setzn(temp); - polltime(7); - break; - - case 0x60: /*RTS*/ - pc=pull(); - pc|=(pull()<<8); - pc++; - polltime(6); - break; - - case 0x61: /*ADC (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - temp=readmem(addr); - ADC(temp); - polltime(6); - break; - - case 0x64: /*STZ zp*/ - addr=readmem(pc); pc++; - tuberam[addr]=0; - polltime(3); - break; - - case 0x65: /*ADC zp*/ - addr=readmem(pc); pc++; - temp=tuberam[addr]; - ADC(temp); - polltime(3); - break; - - case 0x66: /*ROR zp*/ - addr=readmem(pc); pc++; - temp=tuberam[addr]; - tempi=tubep.c; - tubep.c=temp&1; - temp>>=1; - if (tempi) temp|=0x80; - setzn(temp); - tuberam[addr]=temp; - polltime(5); - break; - - case 0x68: /*PLA*/ - a=pull(); - setzn(a); - polltime(4); - break; - - case 0x69: /*ADC imm*/ - temp=readmem(pc); pc++; - ADC(temp); - polltime(2); - break; - - case 0x6A: /*ROR A*/ - tempi=tubep.c; - tubep.c=a&1; - a>>=1; - if (tempi) a|=0x80; - setzn(a); - polltime(2); - break; - - case 0x6C: /*JMP ()*/ - addr=getw(); - pc=readmem(addr)|(readmem(addr+1)<<8); - polltime(5); - break; - - case 0x6D: /*ADC abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr); - ADC(temp); - break; - - case 0x6E: /*ROR abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr); - polltime(1); - readmem(addr); - polltime(1); - tempi=tubep.c; - tubep.c=temp&1; - temp>>=1; - if (tempi) temp|=0x80; - setzn(temp); - writemem(addr,temp); - break; - - case 0x70: /*BVS*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (tubep.v) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - polltime(temp); - break; - - case 0x71: /*ADC (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - temp=readmem(addr+y); - ADC(temp); - polltime(5); - break; - - case 0x72: /*ADC ()*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - temp=readmem(addr); - ADC(temp); - polltime(5); - break; - - case 0x74: /*STZ zp,x*/ - addr=readmem(pc); pc++; - tuberam[(addr+x)&0xFF]=0; - polltime(3); - break; - - case 0x75: /*ADC zp,x*/ - addr=readmem(pc); pc++; - temp=tuberam[(addr+x)&0xFF]; - ADC(temp); - polltime(4); - break; - - case 0x76: /*ROR zp,x*/ - addr=readmem(pc); pc++; - addr+=x; addr&=0xFF; - temp=tuberam[addr]; - tempi=tubep.c; - tubep.c=temp&1; - temp>>=1; - if (tempi) temp|=0x80; - setzn(temp); - tuberam[addr]=temp; - polltime(5); - break; - - case 0x78: /*SEI*/ - tubep.i=1; - polltime(2); -// if (output2) printf("SEI at line %i %04X %02X %02X\n",lines,pc,tuberam[0x103+s],tuberam[0x104+s]); - break; - - case 0x79: /*ADC abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - temp=readmem(addr+y); - ADC(temp); - polltime(4); - break; - - case 0x7A: /*PLY*/ - y=pull(); - setzn(y); - polltime(4); - break; - - case 0x7C: /*JMP (,x)*/ - addr=getw(); addr+=x; - pc=readmem(addr)|(readmem(addr+1)<<8); - polltime(6); - break; - - case 0x7D: /*ADC abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - temp=readmem(addr+x); - ADC(temp); - polltime(4); - break; - - case 0x7E: /*ROR abs,x*/ - addr=getw(); addr+=x; - temp=readmem(addr); - tempi=tubep.c; - tubep.c=temp&1; - temp>>=1; - if (tempi) temp|=0x80; - writemem(addr,temp); - setzn(temp); - polltime(7); - break; - - case 0x80: /*BRA*/ - offset=(int8_t)readmem(pc); pc++; - temp=3; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - polltime(temp); - break; - - case 0x81: /*STA (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - writemem(addr,a); - polltime(6); - break; - - case 0x84: /*STY zp*/ - addr=readmem(pc); pc++; - tuberam[addr]=y; - polltime(3); - break; - - case 0x85: /*STA zp*/ - addr=readmem(pc); pc++; - tuberam[addr]=a; - polltime(3); - break; - - case 0x86: /*STX zp*/ - addr=readmem(pc); pc++; - tuberam[addr]=x; - polltime(3); - break; - - case 0x88: /*DEY*/ - y--; - setzn(y); - polltime(2); - break; - - case 0x89: /*BIT imm*/ - temp=readmem(pc); pc++; - tubep.z=!(a&temp); - tubep.v=temp&0x40; - tubep.n=temp&0x80; - polltime(2); - break; - - case 0x8A: /*TXA*/ - a=x; - setzn(a); - polltime(2); - break; - - case 0x8C: /*STY abs*/ - addr=getw(); - polltime(4); - writemem(addr,y); - break; - - case 0x8D: /*STA abs*/ - addr=getw(); - polltime(4); - writemem(addr,a); - break; - - case 0x8E: /*STX abs*/ - addr=getw(); - polltime(4); - writemem(addr,x); - break; - - case 0x90: /*BCC*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (!tubep.c) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - polltime(temp); - break; - - case 0x91: /*STA (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8)+y; - writemem(addr,a); - polltime(6); - break; - - case 0x92: /*STA ()*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - writemem(addr,a); - polltime(6); - break; - - case 0x94: /*STY zp,x*/ - addr=readmem(pc); pc++; - tuberam[(addr+x)&0xFF]=y; - polltime(4); - break; - - case 0x95: /*STA zp,x*/ - addr=readmem(pc); pc++; - tuberam[(addr+x)&0xFF]=a; - polltime(4); - break; - - case 0x96: /*STX zp,y*/ - addr=readmem(pc); pc++; - tuberam[(addr+y)&0xFF]=x; - polltime(4); - break; - - case 0x98: /*TYA*/ - a=y; - setzn(a); - polltime(2); - break; - - case 0x99: /*STA abs,y*/ - addr=getw(); - polltime(4); - writemem(addr+y,a); - polltime(1); - break; - - case 0x9A: /*TXS*/ - s=x; - polltime(2); - break; - - case 0x9C: /*STZ abs*/ - addr=getw(); - polltime(3); - writemem(addr,0); - polltime(1); - break; - - case 0x9D: /*STA abs,x*/ - addr=getw(); - polltime(4); - writemem(addr+x,a); - polltime(1); - break; - - case 0x9E: /*STZ abs,x*/ - addr=getw(); addr+=x; - polltime(4); - writemem(addr,0); - polltime(1); - break; - - case 0xA0: /*LDY imm*/ - y=readmem(pc); pc++; - setzn(y); - polltime(2); - break; - - case 0xA1: /*LDA (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - a=readmem(addr); - setzn(a); - polltime(6); - break; - - case 0xA2: /*LDX imm*/ - x=readmem(pc); pc++; - setzn(x); - polltime(2); - break; - - case 0xA4: /*LDY zp*/ - addr=readmem(pc); pc++; - y=tuberam[addr]; - setzn(y); - polltime(3); - break; - - case 0xA5: /*LDA zp*/ - addr=readmem(pc); pc++; - a=tuberam[addr]; - setzn(a); - polltime(3); - break; - - case 0xA6: /*LDX zp*/ - addr=readmem(pc); pc++; - x=tuberam[addr]; - setzn(x); - polltime(3); - break; - - case 0xA8: /*TAY*/ - y=a; - setzn(y); - break; - - case 0xA9: /*LDA imm*/ - a=readmem(pc); pc++; - setzn(a); - polltime(2); - break; - - case 0xAA: /*TAX*/ - x=a; - setzn(x); - polltime(2); - break; - - case 0xAC: /*LDY abs*/ - addr=getw(); - polltime(4); - y=readmem(addr); - setzn(y); - break; - - case 0xAD: /*LDA abs*/ - addr=getw(); - polltime(4); - a=readmem(addr); - setzn(a); - break; - - case 0xAE: /*LDX abs*/ - addr=getw(); - polltime(4); - x=readmem(addr); - setzn(x); - break; - - case 0xB0: /*BCS*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (tubep.c) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - polltime(temp); - break; - - case 0xB1: /*LDA (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a=readmem(addr+y); - setzn(a); - polltime(5); - break; - - case 0xB2: /*LDA ()*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - a=readmem(addr); - setzn(a); - polltime(5); - break; - - case 0xB4: /*LDY zp,x*/ - addr=readmem(pc); pc++; - y=tuberam[(addr+x)&0xFF]; - setzn(y); - polltime(3); - break; - - case 0xB5: /*LDA zp,x*/ - addr=readmem(pc); pc++; - a=tuberam[(addr+x)&0xFF]; - setzn(a); - polltime(3); - break; - - case 0xB6: /*LDX zp,y*/ - addr=readmem(pc); pc++; - x=tuberam[(addr+y)&0xFF]; - setzn(x); - polltime(3); - break; - - case 0xB8: /*CLV*/ - tubep.v=0; - polltime(2); - break; - - case 0xB9: /*LDA abs,y*/ - addr=getw(); - polltime(3); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - a=readmem(addr+y); - setzn(a); - polltime(1); - break; - - case 0xBA: /*TSX*/ - x=s; - setzn(x); - polltime(2); - break; - - case 0xBC: /*LDY abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - y=readmem(addr+x); - setzn(y); - polltime(4); - break; - - case 0xBD: /*LDA abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - a=readmem(addr+x); - setzn(a); - polltime(4); - break; - - case 0xBE: /*LDX abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - x=readmem(addr+y); - setzn(x); - polltime(4); - break; - - case 0xC0: /*CPY imm*/ - temp=readmem(pc); pc++; - setzn(y-temp); - tubep.c=(y>=temp); - polltime(2); - break; - - case 0xC1: /*CMP (,x)*/ - temp=readmem(pc)+x; pc++; - addr=readmem(temp)|(readmem(temp+1)<<8); - temp=readmem(addr); - setzn(a-temp); - tubep.c=(a>=temp); - polltime(6); - break; - - case 0xC4: /*CPY zp*/ - addr=readmem(pc); pc++; - temp=tuberam[addr]; - setzn(y-temp); - tubep.c=(y>=temp); - polltime(3); - break; - - case 0xC5: /*CMP zp*/ - addr=readmem(pc); pc++; - temp=tuberam[addr]; - setzn(a-temp); - tubep.c=(a>=temp); - polltime(3); - break; - - case 0xC6: /*DEC zp*/ - addr=readmem(pc); pc++; - tuberam[addr]--; - setzn(tuberam[addr]); - polltime(5); - break; - - case 0xC8: /*INY*/ - y++; - setzn(y); - polltime(2); - break; - - case 0xC9: /*CMP imm*/ - temp=readmem(pc); pc++; - setzn(a-temp); - tubep.c=(a>=temp); - polltime(2); - break; - - case 0xCA: /*DEX*/ - x--; - setzn(x); - polltime(2); - break; - - case 0xCC: /*CPY abs*/ - addr=getw(); - temp=readmem(addr); - setzn(y-temp); - tubep.c=(y>=temp); - polltime(4); - break; - - case 0xCD: /*CMP abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr); - setzn(a-temp); - tubep.c=(a>=temp); - break; - - case 0xCE: /*DEC abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr)-1; - polltime(1); - readmem(addr); - polltime(1); - writemem(addr,temp); - setzn(temp); - break; - - case 0xD0: /*BNE*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (!tubep.z) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - polltime(temp); - break; - - case 0xD1: /*CMP (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - temp=readmem(addr+y); - setzn(a-temp); - tubep.c=(a>=temp); - polltime(5); - break; - - case 0xD2: /*CMP ()*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - temp=readmem(addr); - setzn(a-temp); - tubep.c=(a>=temp); - polltime(5); - break; - - case 0xD5: /*CMP zp,x*/ - addr=readmem(pc); pc++; - temp=tuberam[(addr+x)&0xFF]; - setzn(a-temp); - tubep.c=(a>=temp); - polltime(3); - break; - - case 0xD6: /*DEC zp,x*/ - addr=readmem(pc); pc++; - tuberam[(addr+x)&0xFF]--; - setzn(tuberam[(addr+x)&0xFF]); - polltime(5); - break; - - case 0xD8: /*CLD*/ - tubep.d=0; - polltime(2); - break; - - case 0xD9: /*CMP abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - temp=readmem(addr+y); - setzn(a-temp); - tubep.c=(a>=temp); - polltime(4); - break; - - case 0xDA: /*PHX*/ - push(x); - polltime(3); - break; - - case 0xDD: /*CMP abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - temp=readmem(addr+x); - setzn(a-temp); - tubep.c=(a>=temp); - polltime(4); - break; - - case 0xDE: /*DEC abs,x*/ - addr=getw(); addr+=x; - temp=readmem(addr)-1; - writemem(addr,temp); - setzn(temp); - polltime(6); - break; - - case 0xE0: /*CPX imm*/ - temp=readmem(pc); pc++; - setzn(x-temp); - tubep.c=(x>=temp); - polltime(2); - break; - - case 0xE4: /*CPX zp*/ - addr=readmem(pc); pc++; - temp=tuberam[addr]; - setzn(x-temp); - tubep.c=(x>=temp); - polltime(3); - break; - - case 0xE5: /*SBC zp*/ - addr=readmem(pc); pc++; - temp=tuberam[addr]; - SBC(temp); - polltime(3); - break; - - case 0xE6: /*INC zp*/ - addr=readmem(pc); pc++; - tuberam[addr]++; - setzn(tuberam[addr]); - polltime(5); - break; - - case 0xE8: /*INX*/ - x++; - setzn(x); - polltime(2); - break; - - case 0xE9: /*SBC imm*/ - temp=readmem(pc); pc++; - SBC(temp); - polltime(2); - break; - - case 0xEA: /*NOP*/ - polltime(2); - break; - - case 0xEC: /*CPX abs*/ - addr=getw(); - temp=readmem(addr); - setzn(x-temp); - tubep.c=(x>=temp); - polltime(3); - break; - - case 0xED: /*SBC abs*/ - addr=getw(); - temp=readmem(addr); - SBC(temp); - polltime(4); - break; - - case 0xEE: /*INC abs*/ - addr=getw(); - polltime(4); - temp=readmem(addr)+1; - polltime(1); - readmem(addr); - polltime(1); - writemem(addr,temp); - setzn(temp); - break; - - case 0xF0: /*BEQ*/ - offset=(int8_t)readmem(pc); pc++; - temp=2; - if (tubep.z) - { - temp++; - if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; - pc+=offset; - } - polltime(temp); - break; - - case 0xF1: /*SBC (),y*/ - temp=readmem(pc); pc++; - addr=readmem(temp)+(readmem(temp+1)<<8); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - temp=readmem(addr+y); - SBC(temp); - polltime(5); - break; - - case 0xF5: /*SBC zp,x*/ - addr=readmem(pc); pc++; - temp=tuberam[(addr+x)&0xFF]; - SBC(temp); - polltime(3); - break; - - case 0xF6: /*INC zp,x*/ - addr=readmem(pc); pc++; - tuberam[(addr+x)&0xFF]++; - setzn(tuberam[(addr+x)&0xFF]); - polltime(5); - break; - - case 0xF8: /*SED*/ - tubep.d=1; - polltime(2); - break; - - case 0xF9: /*SBC abs,y*/ - addr=getw(); - if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); - temp=readmem(addr+y); - SBC(temp); - polltime(4); - break; - - case 0xFA: /*PLX*/ - x=pull(); - setzn(x); - polltime(4); - break; - - case 0xFD: /*SBC abs,x*/ - addr=getw(); - if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); - temp=readmem(addr+x); - SBC(temp); - polltime(4); - break; - - case 0xFE: /*INC abs,x*/ - addr=getw(); addr+=x; - temp=readmem(addr)+1; - writemem(addr,temp); - setzn(temp); - polltime(6); - break; - - case 0x02: case 0x22: case 0x42: case 0x62: case 0x82: - case 0xC2: case 0xE2: - case 0x03: case 0x13: case 0x23: case 0x33: - case 0x43: case 0x53: case 0x63: case 0x73: - case 0x83: case 0x93: case 0xA3: case 0xB3: - case 0xC3: case 0xD3: case 0xE3: case 0xF3: - case 0x0B: case 0x1B: case 0x2B: case 0x3B: - case 0x4B: case 0x5B: case 0x6B: case 0x7B: - case 0x8B: case 0x9B: case 0xAB: case 0xBB: - case 0xEB: case 0xFB: - case 0x44: case 0x54: case 0xD4: case 0xF4: - case 0x5C: case 0xDC: case 0xFC: - switch (opcode&0xF) - { - case 0xA: - break; - case 0x0: - case 0x2: - case 0x3: - case 0x4: - case 0x7: - case 0x9: - case 0xB: - pc++; - break; - case 0xC: - case 0xE: - case 0xF: - pc+=2; - break; - } - break; -// default: -// allegro_exit(); -// printf("Error : Bad tube 65c02 opcode %02X\n",opcode); -// pc--; -// dumpregs(); -// printf("Current ROM %02X\n",currom); -// exit(-1); - } - if ((tube_irq&2) && !tube_6502_oldnmi) - { - push(pc>>8); - push(pc&0xFF); - temp=0x20; - if (tubep.c) temp|=1; if (tubep.z) temp|=2; - if (tubep.i) temp|=4; if (tubep.d) temp|=8; - if (tubep.v) temp|=0x40; if (tubep.n) temp|=0x80; - push(temp); - pc=readmem(0xFFFA)|(readmem(0xFFFB)<<8); - tubep.i=1; - polltime(7); - } - tube_6502_oldnmi=tube_irq&2; - if (((tube_irq&1) && !tubep.i && !tube_6502_skipint) || tube_6502_skipint==2) - { -// if (skipint==2) printf("interrupt\n"); - tube_6502_skipint=0; - push(pc>>8); - push(pc&0xFF); - temp=0x20; - if (tubep.c) temp|=1; if (tubep.z) temp|=2; - if (tubep.i) temp|=4; if (tubep.d) temp|=8; - if (tubep.v) temp|=0x40; if (tubep.n) temp|=0x80; - push(temp); - pc=readmem(0xFFFE)|(readmem(0xFFFF)<<8); - tubep.i=1; - polltime(7); -// printf("Interrupt line %i %i %02X %02X %02X %02X\n",interrupt,lines,sysvia.ifr&sysvia.ier,uservia.ifr&uservia.ier,uservia.ier,uservia.ifr); - } - if ((tube_irq&1) && !tubep.i && tube_6502_skipint) - { - tube_6502_skipint=2; -// printf("skipint=2\n"); - } - if (endtimeslice) - { - endtimeslice=0; - return; - } -/* if (tubeoutput==2) rpclog("%04X : %02X %02X %02X\n",pc,a,x,y); - if (tubetimetolive) - { - tubetimetolive--; - if (!tubetimetolive) - { - tubeoutput=1; - } - }*/ - } -} +/*B-em v2.2 by Tom Walker + 6502 parasite CPU emulation*/ + +#include +#include + +#include "b-em.h" +#include "tube.h" +#include "6502tube.h" + +#define a tubea +#define x tubex +#define y tubey +#define s tubesp +#define pc tubepc + +static int tube_6502_skipint; +static int tube_6502_oldnmi; + +/*6502 registers*/ +static uint8_t a,x,y,s; +static uint16_t pc; +static struct +{ + int c,z,i,d,v,n; +} tubep; + +/*Memory structures*/ +/*There is an extra entry to allow for stupid programs (3d grand prix) doing + something stupid like STA $FFFF,x*/ +static uint8_t *tubemem[0x101]; +static int tubememstat[0x101]; +static uint8_t *tuberam; +static uint8_t tuberom[0x1000]; + +static void tube_6502_loadrom() +{ + FILE *f; + char fn[512]; + append_filename(fn,exedir,"roms/tube/6502Tube.rom",511); + f=fopen(fn,"rb"); + fread(tuberom+0x800,0x800,1,f); + fclose(f); +} + +void tube_6502_init_cpu() +{ + int c; + if (!tuberam) tuberam=(uint8_t *)malloc(0x10000); + memset(tuberam,0,0x10000); + for (c=0x00;c<0x100;c++) tubemem[c]=(uint8_t *)(tuberam+(c<<8)); + for (c=0x00;c<0x100;c++) tubememstat[c]=0; + for (c=0xF0;c<0x100;c++) tubememstat[c]=2; +// tubememstat[0xFE]=tubememstat[0xFF]=2; + tubemem[0x100]=tubemem[0]; + tubememstat[0x100]=tubememstat[0]; + tube_6502_loadrom(); +} + +void tube_6502_close() +{ + if (tuberam) free(tuberam); +} + +#undef printf +/*static void tubedumpregs() +{ + FILE *f=fopen("tuberam.dmp","wb"); + fwrite(tuberam,65536,1,f); + fclose(f); + rpclog("Tube 65c12 registers :\n"); + rpclog("A=%02X X=%02X Y=%02X S=01%02X PC=%04X\n",a,x,y,s,pc); + rpclog("Status : %c%c%c%c%c%c\n",(tubep.n)?'N':' ',(tubep.v)?'V':' ',(tubep.d)?'D':' ',(tubep.i)?'I':' ',(tubep.z)?'Z':' ',(tubep.c)?'C':' '); +}*/ + +static int tuberomin=1; +void tube_6502_mapoutrom() +{ + tuberomin=0; +} + +#define polltime(c) { tubecycles-=c; } + +static uint8_t tubereadmeml(uint16_t addr) +{ + uint8_t temp; + if ((addr&~7)==0xFEF8) + { + temp=tube_parasite_read(addr); +// rpclog("Read tube %04X %02X %04X\n",addr,temp,pc); + return temp; + } + if ((addr&~0xFFF)==0xF000 && tuberomin) return tuberom[addr&0xFFF]; + return tuberam[addr]; +} + +int endtimeslice; +static void tubewritememl(uint16_t addr, uint8_t val) +{ +// rpclog("Tube writemem %04X %02X %04X\n",addr,val,pc); + if ((addr&~7)==0xFEF8) + { +// rpclog("Write tube %04X %02X %04X\n",addr,val,pc); + tube_parasite_write(addr,val); + endtimeslice=1; + return; + } +// if (addr==0xF4 || addr==0xF5) rpclog("TUBE PARASITE write %04X %02X\n",addr,val); + tuberam[addr]=val; +} + +#define readmem(a) ((tubememstat[(a)>>8]==2)?tubereadmeml(a):tubemem[(a)>>8][(a)&0xFF]) +#define writemem(a,b) tubewritememl(a,b) +//if (tubememstat[(a)>>8]==0) tubemem[(a)>>8][(a)&0xFF]=b; else if (tubememstat[(a)>>8]==2) tubewritememl(a,b) +#define getw() (readmem(pc)|(readmem(pc+1)<<8)); pc+=2 + +void tube_6502_reset() +{ + tuberomin=1; +//memset(tuberam,0,0x10000); + pc=readmem(0xFFFC)|(readmem(0xFFFD)<<8); + tubep.i=1; + tube_irq=0; + tube_6502_skipint=0; +} + +#define setzn(v) tubep.z=!(v); tubep.n=(v)&0x80 + +#define push(v) tuberam[0x100+(s--)]=v +#define pull() tuberam[0x100+(++s)] + +/*ADC/SBC temp variables*/ +static uint16_t tempw; +static int tempv,hc,al,ah; +static uint8_t tempb; + +#define ADC(temp) if (!tubep.d) \ + { \ + tempw=(a+temp+(tubep.c?1:0)); \ + tubep.v=(!((a^temp)&0x80)&&((a^tempw)&0x80)); \ + a=tempw&0xFF; \ + tubep.c=tempw&0x100; \ + setzn(a); \ + } \ + else \ + { \ + ah=0; \ + tempb=a+temp+(tubep.c?1:0); \ + if (!tempb) \ + tubep.z=1; \ + al=(a&0xF)+(temp&0xF)+(tubep.c?1:0); \ + if (al>9) \ + { \ + al-=10; \ + al&=0xF; \ + ah=1; \ + } \ + ah+=((a>>4)+(temp>>4)); \ + if (ah&8) tubep.n=1; \ + tubep.v=(((ah << 4) ^ a) & 128) && !((a ^ temp) & 128); \ + tubep.c=0; \ + if (ah>9) \ + { \ + tubep.c=1; \ + ah-=10; \ + ah&=0xF; \ + } \ + a=(al&0xF)|(ah<<4); \ + } + +#define SBC(temp) if (!tubep.d) \ + { \ + tempw=a-(temp+(tubep.c?0:1)); \ + tempv=(short)a-(short)(temp+(tubep.c?0:1)); \ + tubep.v=((a^(temp+(tubep.c?0:1)))&(a^(uint8_t)tempv)&0x80); \ + tubep.c=tempv>=0;\ + a=tempw&0xFF; \ + setzn(a); \ + } \ + else \ + { \ + hc=0; \ + tubep.z=tubep.n=0; \ + if (!((a-temp)-((tubep.c)?0:1))) \ + tubep.z=1; \ + al=(a&15)-(temp&15)-((tubep.c)?0:1); \ + if (al&16) \ + { \ + al-=6; \ + al&=0xF; \ + hc=1; \ + } \ + ah=(a>>4)-(temp>>4); \ + if (hc) ah--; \ + if ((a-(temp+((tubep.c)?0:1)))&0x80) \ + tubep.n=1; \ + tubep.v=(((a-(temp+((tubep.c)?0:1)))^temp)&128)&&((a^temp)&128); \ + tubep.c=1; \ + if (ah&16) \ + { \ + tubep.c=0; \ + ah-=6; \ + ah&=0xF; \ + } \ + a=(al&0xF)|((ah&0xF)<<4); \ + } + +static uint16_t oldtpc,oldtpc2; + +void tube_6502_exec() +{ + uint8_t opcode; + uint16_t addr; + uint8_t temp; + int tempi; + int8_t offset; +// tubecycles+=(tubecycs<<1); +// printf("Tube exec %i %04X\n",tubecycles,pc); + while (tubecycles>0) + { + oldtpc2=oldtpc; + oldtpc=pc; + opcode=readmem(pc); pc++; +// printf("Tube opcode %02X\n",opcode); + switch (opcode) + { + case 0x00: /*BRK*/ +// rpclog("Tube BRK at %04X! %04X %04X\n",pc,oldtpc,oldtpc2); + pc++; + push(pc>>8); + push(pc&0xFF); + temp=0x30; + if (tubep.c) temp|=1; if (tubep.z) temp|=2; + if (tubep.d) temp|=8; if (tubep.v) temp|=0x40; + if (tubep.n) temp|=0x80; + push(temp); + pc=readmem(0xFFFE)|(readmem(0xFFFF)<<8); + tubep.i=1; + polltime(7); + break; + + case 0x01: /*ORA (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + a|=readmem(addr); + setzn(a); + polltime(6); + break; + + case 0x04: /*TSB zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + tubep.z=!(temp&a); + temp|=a; + writemem(addr,temp); + polltime(5); + break; + + case 0x05: /*ORA zp*/ + addr=readmem(pc); pc++; + a|=tuberam[addr]; + setzn(a); + polltime(3); + break; + + case 0x06: /*ASL zp*/ + addr=readmem(pc); pc++; + temp=tuberam[addr]; + tubep.c=temp&0x80; + temp<<=1; + setzn(temp); + tuberam[addr]=temp; + polltime(5); + break; + + case 0x08: /*PHP*/ + temp=0x30; + if (tubep.c) temp|=1; if (tubep.z) temp|=2; + if (tubep.i) temp|=4; if (tubep.d) temp|=8; + if (tubep.v) temp|=0x40; if (tubep.n) temp|=0x80; + push(temp); + polltime(3); + break; + + case 0x09: /*ORA imm*/ + a|=readmem(pc); pc++; + setzn(a); + polltime(2); + break; + + case 0x0A: /*ASL A*/ + tubep.c=a&0x80; + a<<=1; + setzn(a); + polltime(2); + break; + + case 0x0C: /*TSB abs*/ + addr=getw(); +// printf("TSB %04X %02X\n",addr,a); + temp=readmem(addr); + tubep.z=!(temp&a); + temp|=a; + writemem(addr,temp); + polltime(6); + break; + + case 0x0D: /*ORA abs*/ + addr=getw(); + polltime(4); + a|=readmem(addr); + setzn(a); + break; + + case 0x0E: /*ASL abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr); + polltime(1); + readmem(addr); + polltime(1); + tubep.c=temp&0x80; + temp<<=1; + setzn(temp); + writemem(addr,temp); + polltime(6); + break; + + case 0x10: /*BPL*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (!tubep.n) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + polltime(temp); + break; + + case 0x11: /*ORA (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a|=readmem(addr+y); + setzn(a); + polltime(5); + break; + + case 0x12: /*ORA ()*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + a|=readmem(addr); + setzn(a); + polltime(5); + break; + + case 0x14: /*TRB zp*/ + addr=readmem(pc); pc++; + temp=readmem(addr); + tubep.z=!(temp&a); + temp&=~a; + writemem(addr,temp); + polltime(5); + break; + + case 0x15: /*ORA zp,x*/ + addr=readmem(pc); pc++; + a|=tuberam[(addr+x)&0xFF]; + setzn(a); + polltime(3); + break; + + case 0x16: /*ASL zp,x*/ + addr=(readmem(pc)+x)&0xFF; pc++; + temp=tuberam[addr]; + tubep.c=temp&0x80; + temp<<=1; + setzn(temp); + tuberam[addr]=temp; + polltime(5); + break; + + case 0x18: /*CLC*/ + tubep.c=0; + polltime(2); + break; + + case 0x19: /*ORA abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a|=readmem(addr+y); + setzn(a); + polltime(4); + break; + + case 0x1A: /*INC A*/ + a++; + setzn(a); + polltime(2); + break; + + case 0x1C: /*TRB abs*/ + addr=getw(); + temp=readmem(addr); + tubep.z=!(temp&a);//!(temp&(~a)); + temp&=~a; + writemem(addr,temp); + polltime(6); + break; + + case 0x1D: /*ORA abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + addr+=x; + a|=readmem(addr); + setzn(a); + polltime(4); + break; + + case 0x1E: /*ASL abs,x*/ + addr=getw(); addr+=x; + temp=readmem(addr); + tubep.c=temp&0x80; + temp<<=1; + writemem(addr,temp); + setzn(temp); + polltime(7); + break; + + case 0x20: /*JSR*/ + addr=getw(); pc--; + push(pc>>8); + push(pc); + pc=addr; + polltime(6); + break; + + case 0x21: /*AND (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + a&=readmem(addr); + setzn(a); + polltime(6); + break; + + case 0x24: /*BIT zp*/ + addr=readmem(pc); pc++; + temp=tuberam[addr]; + tubep.z=!(a&temp); + tubep.v=temp&0x40; + tubep.n=temp&0x80; + polltime(3); + break; + + case 0x25: /*AND zp*/ + addr=readmem(pc); pc++; + a&=tuberam[addr]; + setzn(a); + polltime(3); + break; + + case 0x26: /*ROL zp*/ + addr=readmem(pc); pc++; + temp=tuberam[addr]; + tempi=tubep.c; + tubep.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + setzn(temp); + tuberam[addr]=temp; + polltime(5); + break; + + case 0x28: /*PLP*/ + temp=pull(); + tubep.c=temp&1; tubep.z=temp&2; + tubep.i=temp&4; tubep.d=temp&8; + tubep.v=temp&0x40; tubep.n=temp&0x80; + polltime(4); + break; + + case 0x29: /*AND*/ + a&=readmem(pc); pc++; + setzn(a); + polltime(2); + break; + + case 0x2A: /*ROL A*/ + tempi=tubep.c; + tubep.c=a&0x80; + a<<=1; + if (tempi) a|=1; + setzn(a); + polltime(2); + break; + + case 0x2C: /*BIT abs*/ + addr=getw(); + temp=readmem(addr); +// printf("BIT %04X\n",addr); + tubep.z=!(a&temp); + tubep.v=temp&0x40; + tubep.n=temp&0x80; + polltime(4); + break; + + case 0x2D: /*AND abs*/ + addr=getw(); + polltime(4); + a&=readmem(addr); + setzn(a); + break; + + case 0x2E: /*ROL abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr); + polltime(1); + readmem(addr); + polltime(1); + tempi=tubep.c; + tubep.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + writemem(addr,temp); + setzn(temp); + break; + + case 0x30: /*BMI*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (tubep.n) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + polltime(temp); + break; + + case 0x31: /*AND (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a&=readmem(addr+y); + setzn(a); + polltime(5); + break; + + case 0x35: /*AND zp,x*/ + addr=readmem(pc); pc++; + a&=tuberam[(addr+x)&0xFF]; + setzn(a); + polltime(3); + break; + + case 0x36: /*ROL zp,x*/ + addr=readmem(pc); pc++; + addr+=x; addr&=0xFF; + temp=tuberam[addr]; + tempi=tubep.c; + tubep.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + setzn(temp); + tuberam[addr]=temp; + polltime(5); + break; + + case 0x38: /*SEC*/ + tubep.c=1; + polltime(2); + break; + + case 0x39: /*AND abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a&=readmem(addr+y); + setzn(a); + polltime(4); + break; + + case 0x3A: /*DEC A*/ + a--; + setzn(a); + polltime(2); + break; + + case 0x3C: /*BIT abs,x*/ + addr=getw(); addr+=x; + temp=readmem(addr); +// printf("BIT abs,x %02X %04X\n",temp,addr); + tubep.z=!(a&temp); + tubep.v=temp&0x40; + tubep.n=temp&0x80; + polltime(4); + break; + + case 0x3D: /*AND abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + a&=readmem(addr+x); + setzn(a); + polltime(4); + break; + + case 0x3E: /*ROL abs,x*/ + addr=getw(); addr+=x; + temp=readmem(addr); + tempi=tubep.c; + tubep.c=temp&0x80; + temp<<=1; + if (tempi) temp|=1; + writemem(addr,temp); + setzn(temp); + polltime(7); + break; + + case 0x40: /*RTI*/ + temp=pull(); + tubep.c=temp&1; tubep.z=temp&2; + tubep.i=temp&4; tubep.d=temp&8; + tubep.v=temp&0x40; tubep.n=temp&0x80; + pc=pull(); + pc|=(pull()<<8); + polltime(6); + break; + + case 0x41: /*EOR (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + a^=readmem(addr); + setzn(a); + polltime(6); + break; + + case 0x45: /*EOR zp*/ + addr=readmem(pc); pc++; + a^=tuberam[addr]; + setzn(a); + polltime(3); + break; + + case 0x46: /*LSR zp*/ + addr=readmem(pc); pc++; + temp=tuberam[addr]; + tubep.c=temp&1; + temp>>=1; + setzn(temp); + tuberam[addr]=temp; + polltime(5); + break; + + case 0x48: /*PHA*/ + push(a); + polltime(3); + break; + + case 0x49: /*EOR*/ + a^=readmem(pc); pc++; + setzn(a); + polltime(2); + break; + + case 0x4A: /*LSR A*/ + tubep.c=a&1; + a>>=1; + setzn(a); + polltime(2); + break; + + case 0x4C: /*JMP*/ + addr=getw(); + pc=addr; + polltime(3); + break; + + case 0x4D: /*EOR abs*/ + addr=getw(); + polltime(4); + a^=readmem(addr); + setzn(a); + break; + + case 0x4E: /*LSR abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr); + polltime(1); + readmem(addr); + polltime(1); + tubep.c=temp&1; + temp>>=1; + setzn(temp); + writemem(addr,temp); + polltime(6); + break; + + case 0x50: /*BVC*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (!tubep.v) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + polltime(temp); + break; + + case 0x51: /*EOR (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a^=readmem(addr+y); + setzn(a); + polltime(5); + break; + + case 0x52: /*EOR ()*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + a^=readmem(addr); + setzn(a); + polltime(5); + break; + + case 0x55: /*EOR zp,x*/ + addr=readmem(pc); pc++; + a^=tuberam[(addr+x)&0xFF]; + setzn(a); + polltime(3); + break; + + case 0x56: /*LSR zp,x*/ + addr=(readmem(pc)+x)&0xFF; pc++; + temp=tuberam[addr]; + tubep.c=temp&1; + temp>>=1; + setzn(temp); + tuberam[addr]=temp; + polltime(5); + break; + + case 0x58: /*CLI*/ + tubep.i=0; + polltime(2); + break; + + case 0x59: /*EOR abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a^=readmem(addr+y); + setzn(a); + polltime(4); + break; + + case 0x5A: /*PHY*/ + push(y); + polltime(3); + break; + + case 0x5D: /*EOR abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + a^=readmem(addr+x); + setzn(a); + polltime(4); + break; + + case 0x5E: /*LSR abs,x*/ + addr=getw(); addr+=x; + temp=readmem(addr); + tubep.c=temp&1; + temp>>=1; + writemem(addr,temp); + setzn(temp); + polltime(7); + break; + + case 0x60: /*RTS*/ + pc=pull(); + pc|=(pull()<<8); + pc++; + polltime(6); + break; + + case 0x61: /*ADC (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + temp=readmem(addr); + ADC(temp); + polltime(6); + break; + + case 0x64: /*STZ zp*/ + addr=readmem(pc); pc++; + tuberam[addr]=0; + polltime(3); + break; + + case 0x65: /*ADC zp*/ + addr=readmem(pc); pc++; + temp=tuberam[addr]; + ADC(temp); + polltime(3); + break; + + case 0x66: /*ROR zp*/ + addr=readmem(pc); pc++; + temp=tuberam[addr]; + tempi=tubep.c; + tubep.c=temp&1; + temp>>=1; + if (tempi) temp|=0x80; + setzn(temp); + tuberam[addr]=temp; + polltime(5); + break; + + case 0x68: /*PLA*/ + a=pull(); + setzn(a); + polltime(4); + break; + + case 0x69: /*ADC imm*/ + temp=readmem(pc); pc++; + ADC(temp); + polltime(2); + break; + + case 0x6A: /*ROR A*/ + tempi=tubep.c; + tubep.c=a&1; + a>>=1; + if (tempi) a|=0x80; + setzn(a); + polltime(2); + break; + + case 0x6C: /*JMP ()*/ + addr=getw(); + pc=readmem(addr)|(readmem(addr+1)<<8); + polltime(5); + break; + + case 0x6D: /*ADC abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr); + ADC(temp); + break; + + case 0x6E: /*ROR abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr); + polltime(1); + readmem(addr); + polltime(1); + tempi=tubep.c; + tubep.c=temp&1; + temp>>=1; + if (tempi) temp|=0x80; + setzn(temp); + writemem(addr,temp); + break; + + case 0x70: /*BVS*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (tubep.v) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + polltime(temp); + break; + + case 0x71: /*ADC (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + temp=readmem(addr+y); + ADC(temp); + polltime(5); + break; + + case 0x72: /*ADC ()*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + temp=readmem(addr); + ADC(temp); + polltime(5); + break; + + case 0x74: /*STZ zp,x*/ + addr=readmem(pc); pc++; + tuberam[(addr+x)&0xFF]=0; + polltime(3); + break; + + case 0x75: /*ADC zp,x*/ + addr=readmem(pc); pc++; + temp=tuberam[(addr+x)&0xFF]; + ADC(temp); + polltime(4); + break; + + case 0x76: /*ROR zp,x*/ + addr=readmem(pc); pc++; + addr+=x; addr&=0xFF; + temp=tuberam[addr]; + tempi=tubep.c; + tubep.c=temp&1; + temp>>=1; + if (tempi) temp|=0x80; + setzn(temp); + tuberam[addr]=temp; + polltime(5); + break; + + case 0x78: /*SEI*/ + tubep.i=1; + polltime(2); +// if (output2) printf("SEI at line %i %04X %02X %02X\n",lines,pc,tuberam[0x103+s],tuberam[0x104+s]); + break; + + case 0x79: /*ADC abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + temp=readmem(addr+y); + ADC(temp); + polltime(4); + break; + + case 0x7A: /*PLY*/ + y=pull(); + setzn(y); + polltime(4); + break; + + case 0x7C: /*JMP (,x)*/ + addr=getw(); addr+=x; + pc=readmem(addr)|(readmem(addr+1)<<8); + polltime(6); + break; + + case 0x7D: /*ADC abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + temp=readmem(addr+x); + ADC(temp); + polltime(4); + break; + + case 0x7E: /*ROR abs,x*/ + addr=getw(); addr+=x; + temp=readmem(addr); + tempi=tubep.c; + tubep.c=temp&1; + temp>>=1; + if (tempi) temp|=0x80; + writemem(addr,temp); + setzn(temp); + polltime(7); + break; + + case 0x80: /*BRA*/ + offset=(int8_t)readmem(pc); pc++; + temp=3; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + polltime(temp); + break; + + case 0x81: /*STA (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + writemem(addr,a); + polltime(6); + break; + + case 0x84: /*STY zp*/ + addr=readmem(pc); pc++; + tuberam[addr]=y; + polltime(3); + break; + + case 0x85: /*STA zp*/ + addr=readmem(pc); pc++; + tuberam[addr]=a; + polltime(3); + break; + + case 0x86: /*STX zp*/ + addr=readmem(pc); pc++; + tuberam[addr]=x; + polltime(3); + break; + + case 0x88: /*DEY*/ + y--; + setzn(y); + polltime(2); + break; + + case 0x89: /*BIT imm*/ + temp=readmem(pc); pc++; + tubep.z=!(a&temp); + tubep.v=temp&0x40; + tubep.n=temp&0x80; + polltime(2); + break; + + case 0x8A: /*TXA*/ + a=x; + setzn(a); + polltime(2); + break; + + case 0x8C: /*STY abs*/ + addr=getw(); + polltime(4); + writemem(addr,y); + break; + + case 0x8D: /*STA abs*/ + addr=getw(); + polltime(4); + writemem(addr,a); + break; + + case 0x8E: /*STX abs*/ + addr=getw(); + polltime(4); + writemem(addr,x); + break; + + case 0x90: /*BCC*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (!tubep.c) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + polltime(temp); + break; + + case 0x91: /*STA (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8)+y; + writemem(addr,a); + polltime(6); + break; + + case 0x92: /*STA ()*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + writemem(addr,a); + polltime(6); + break; + + case 0x94: /*STY zp,x*/ + addr=readmem(pc); pc++; + tuberam[(addr+x)&0xFF]=y; + polltime(4); + break; + + case 0x95: /*STA zp,x*/ + addr=readmem(pc); pc++; + tuberam[(addr+x)&0xFF]=a; + polltime(4); + break; + + case 0x96: /*STX zp,y*/ + addr=readmem(pc); pc++; + tuberam[(addr+y)&0xFF]=x; + polltime(4); + break; + + case 0x98: /*TYA*/ + a=y; + setzn(a); + polltime(2); + break; + + case 0x99: /*STA abs,y*/ + addr=getw(); + polltime(4); + writemem(addr+y,a); + polltime(1); + break; + + case 0x9A: /*TXS*/ + s=x; + polltime(2); + break; + + case 0x9C: /*STZ abs*/ + addr=getw(); + polltime(3); + writemem(addr,0); + polltime(1); + break; + + case 0x9D: /*STA abs,x*/ + addr=getw(); + polltime(4); + writemem(addr+x,a); + polltime(1); + break; + + case 0x9E: /*STZ abs,x*/ + addr=getw(); addr+=x; + polltime(4); + writemem(addr,0); + polltime(1); + break; + + case 0xA0: /*LDY imm*/ + y=readmem(pc); pc++; + setzn(y); + polltime(2); + break; + + case 0xA1: /*LDA (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + a=readmem(addr); + setzn(a); + polltime(6); + break; + + case 0xA2: /*LDX imm*/ + x=readmem(pc); pc++; + setzn(x); + polltime(2); + break; + + case 0xA4: /*LDY zp*/ + addr=readmem(pc); pc++; + y=tuberam[addr]; + setzn(y); + polltime(3); + break; + + case 0xA5: /*LDA zp*/ + addr=readmem(pc); pc++; + a=tuberam[addr]; + setzn(a); + polltime(3); + break; + + case 0xA6: /*LDX zp*/ + addr=readmem(pc); pc++; + x=tuberam[addr]; + setzn(x); + polltime(3); + break; + + case 0xA8: /*TAY*/ + y=a; + setzn(y); + break; + + case 0xA9: /*LDA imm*/ + a=readmem(pc); pc++; + setzn(a); + polltime(2); + break; + + case 0xAA: /*TAX*/ + x=a; + setzn(x); + polltime(2); + break; + + case 0xAC: /*LDY abs*/ + addr=getw(); + polltime(4); + y=readmem(addr); + setzn(y); + break; + + case 0xAD: /*LDA abs*/ + addr=getw(); + polltime(4); + a=readmem(addr); + setzn(a); + break; + + case 0xAE: /*LDX abs*/ + addr=getw(); + polltime(4); + x=readmem(addr); + setzn(x); + break; + + case 0xB0: /*BCS*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (tubep.c) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + polltime(temp); + break; + + case 0xB1: /*LDA (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a=readmem(addr+y); + setzn(a); + polltime(5); + break; + + case 0xB2: /*LDA ()*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + a=readmem(addr); + setzn(a); + polltime(5); + break; + + case 0xB4: /*LDY zp,x*/ + addr=readmem(pc); pc++; + y=tuberam[(addr+x)&0xFF]; + setzn(y); + polltime(3); + break; + + case 0xB5: /*LDA zp,x*/ + addr=readmem(pc); pc++; + a=tuberam[(addr+x)&0xFF]; + setzn(a); + polltime(3); + break; + + case 0xB6: /*LDX zp,y*/ + addr=readmem(pc); pc++; + x=tuberam[(addr+y)&0xFF]; + setzn(x); + polltime(3); + break; + + case 0xB8: /*CLV*/ + tubep.v=0; + polltime(2); + break; + + case 0xB9: /*LDA abs,y*/ + addr=getw(); + polltime(3); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + a=readmem(addr+y); + setzn(a); + polltime(1); + break; + + case 0xBA: /*TSX*/ + x=s; + setzn(x); + polltime(2); + break; + + case 0xBC: /*LDY abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + y=readmem(addr+x); + setzn(y); + polltime(4); + break; + + case 0xBD: /*LDA abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + a=readmem(addr+x); + setzn(a); + polltime(4); + break; + + case 0xBE: /*LDX abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + x=readmem(addr+y); + setzn(x); + polltime(4); + break; + + case 0xC0: /*CPY imm*/ + temp=readmem(pc); pc++; + setzn(y-temp); + tubep.c=(y>=temp); + polltime(2); + break; + + case 0xC1: /*CMP (,x)*/ + temp=readmem(pc)+x; pc++; + addr=readmem(temp)|(readmem(temp+1)<<8); + temp=readmem(addr); + setzn(a-temp); + tubep.c=(a>=temp); + polltime(6); + break; + + case 0xC4: /*CPY zp*/ + addr=readmem(pc); pc++; + temp=tuberam[addr]; + setzn(y-temp); + tubep.c=(y>=temp); + polltime(3); + break; + + case 0xC5: /*CMP zp*/ + addr=readmem(pc); pc++; + temp=tuberam[addr]; + setzn(a-temp); + tubep.c=(a>=temp); + polltime(3); + break; + + case 0xC6: /*DEC zp*/ + addr=readmem(pc); pc++; + tuberam[addr]--; + setzn(tuberam[addr]); + polltime(5); + break; + + case 0xC8: /*INY*/ + y++; + setzn(y); + polltime(2); + break; + + case 0xC9: /*CMP imm*/ + temp=readmem(pc); pc++; + setzn(a-temp); + tubep.c=(a>=temp); + polltime(2); + break; + + case 0xCA: /*DEX*/ + x--; + setzn(x); + polltime(2); + break; + + case 0xCC: /*CPY abs*/ + addr=getw(); + temp=readmem(addr); + setzn(y-temp); + tubep.c=(y>=temp); + polltime(4); + break; + + case 0xCD: /*CMP abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr); + setzn(a-temp); + tubep.c=(a>=temp); + break; + + case 0xCE: /*DEC abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr)-1; + polltime(1); + readmem(addr); + polltime(1); + writemem(addr,temp); + setzn(temp); + break; + + case 0xD0: /*BNE*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (!tubep.z) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + polltime(temp); + break; + + case 0xD1: /*CMP (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + temp=readmem(addr+y); + setzn(a-temp); + tubep.c=(a>=temp); + polltime(5); + break; + + case 0xD2: /*CMP ()*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + temp=readmem(addr); + setzn(a-temp); + tubep.c=(a>=temp); + polltime(5); + break; + + case 0xD5: /*CMP zp,x*/ + addr=readmem(pc); pc++; + temp=tuberam[(addr+x)&0xFF]; + setzn(a-temp); + tubep.c=(a>=temp); + polltime(3); + break; + + case 0xD6: /*DEC zp,x*/ + addr=readmem(pc); pc++; + tuberam[(addr+x)&0xFF]--; + setzn(tuberam[(addr+x)&0xFF]); + polltime(5); + break; + + case 0xD8: /*CLD*/ + tubep.d=0; + polltime(2); + break; + + case 0xD9: /*CMP abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + temp=readmem(addr+y); + setzn(a-temp); + tubep.c=(a>=temp); + polltime(4); + break; + + case 0xDA: /*PHX*/ + push(x); + polltime(3); + break; + + case 0xDD: /*CMP abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + temp=readmem(addr+x); + setzn(a-temp); + tubep.c=(a>=temp); + polltime(4); + break; + + case 0xDE: /*DEC abs,x*/ + addr=getw(); addr+=x; + temp=readmem(addr)-1; + writemem(addr,temp); + setzn(temp); + polltime(6); + break; + + case 0xE0: /*CPX imm*/ + temp=readmem(pc); pc++; + setzn(x-temp); + tubep.c=(x>=temp); + polltime(2); + break; + + case 0xE4: /*CPX zp*/ + addr=readmem(pc); pc++; + temp=tuberam[addr]; + setzn(x-temp); + tubep.c=(x>=temp); + polltime(3); + break; + + case 0xE5: /*SBC zp*/ + addr=readmem(pc); pc++; + temp=tuberam[addr]; + SBC(temp); + polltime(3); + break; + + case 0xE6: /*INC zp*/ + addr=readmem(pc); pc++; + tuberam[addr]++; + setzn(tuberam[addr]); + polltime(5); + break; + + case 0xE8: /*INX*/ + x++; + setzn(x); + polltime(2); + break; + + case 0xE9: /*SBC imm*/ + temp=readmem(pc); pc++; + SBC(temp); + polltime(2); + break; + + case 0xEA: /*NOP*/ + polltime(2); + break; + + case 0xEC: /*CPX abs*/ + addr=getw(); + temp=readmem(addr); + setzn(x-temp); + tubep.c=(x>=temp); + polltime(3); + break; + + case 0xED: /*SBC abs*/ + addr=getw(); + temp=readmem(addr); + SBC(temp); + polltime(4); + break; + + case 0xEE: /*INC abs*/ + addr=getw(); + polltime(4); + temp=readmem(addr)+1; + polltime(1); + readmem(addr); + polltime(1); + writemem(addr,temp); + setzn(temp); + break; + + case 0xF0: /*BEQ*/ + offset=(int8_t)readmem(pc); pc++; + temp=2; + if (tubep.z) + { + temp++; + if ((pc&0xFF00)^((pc+offset)&0xFF00)) temp++; + pc+=offset; + } + polltime(temp); + break; + + case 0xF1: /*SBC (),y*/ + temp=readmem(pc); pc++; + addr=readmem(temp)+(readmem(temp+1)<<8); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + temp=readmem(addr+y); + SBC(temp); + polltime(5); + break; + + case 0xF5: /*SBC zp,x*/ + addr=readmem(pc); pc++; + temp=tuberam[(addr+x)&0xFF]; + SBC(temp); + polltime(3); + break; + + case 0xF6: /*INC zp,x*/ + addr=readmem(pc); pc++; + tuberam[(addr+x)&0xFF]++; + setzn(tuberam[(addr+x)&0xFF]); + polltime(5); + break; + + case 0xF8: /*SED*/ + tubep.d=1; + polltime(2); + break; + + case 0xF9: /*SBC abs,y*/ + addr=getw(); + if ((addr&0xFF00)^((addr+y)&0xFF00)) polltime(1); + temp=readmem(addr+y); + SBC(temp); + polltime(4); + break; + + case 0xFA: /*PLX*/ + x=pull(); + setzn(x); + polltime(4); + break; + + case 0xFD: /*SBC abs,x*/ + addr=getw(); + if ((addr&0xFF00)^((addr+x)&0xFF00)) polltime(1); + temp=readmem(addr+x); + SBC(temp); + polltime(4); + break; + + case 0xFE: /*INC abs,x*/ + addr=getw(); addr+=x; + temp=readmem(addr)+1; + writemem(addr,temp); + setzn(temp); + polltime(6); + break; + + case 0x02: case 0x22: case 0x42: case 0x62: case 0x82: + case 0xC2: case 0xE2: + case 0x03: case 0x13: case 0x23: case 0x33: + case 0x43: case 0x53: case 0x63: case 0x73: + case 0x83: case 0x93: case 0xA3: case 0xB3: + case 0xC3: case 0xD3: case 0xE3: case 0xF3: + case 0x0B: case 0x1B: case 0x2B: case 0x3B: + case 0x4B: case 0x5B: case 0x6B: case 0x7B: + case 0x8B: case 0x9B: case 0xAB: case 0xBB: + case 0xEB: case 0xFB: + case 0x44: case 0x54: case 0xD4: case 0xF4: + case 0x5C: case 0xDC: case 0xFC: + switch (opcode&0xF) + { + case 0xA: + break; + case 0x0: + case 0x2: + case 0x3: + case 0x4: + case 0x7: + case 0x9: + case 0xB: + pc++; + break; + case 0xC: + case 0xE: + case 0xF: + pc+=2; + break; + } + break; +// default: +// allegro_exit(); +// printf("Error : Bad tube 65c02 opcode %02X\n",opcode); +// pc--; +// dumpregs(); +// printf("Current ROM %02X\n",currom); +// exit(-1); + } + if ((tube_irq&2) && !tube_6502_oldnmi) + { + push(pc>>8); + push(pc&0xFF); + temp=0x20; + if (tubep.c) temp|=1; if (tubep.z) temp|=2; + if (tubep.i) temp|=4; if (tubep.d) temp|=8; + if (tubep.v) temp|=0x40; if (tubep.n) temp|=0x80; + push(temp); + pc=readmem(0xFFFA)|(readmem(0xFFFB)<<8); + tubep.i=1; + polltime(7); + } + tube_6502_oldnmi=tube_irq&2; + if (((tube_irq&1) && !tubep.i && !tube_6502_skipint) || tube_6502_skipint==2) + { +// if (skipint==2) printf("interrupt\n"); + tube_6502_skipint=0; + push(pc>>8); + push(pc&0xFF); + temp=0x20; + if (tubep.c) temp|=1; if (tubep.z) temp|=2; + if (tubep.i) temp|=4; if (tubep.d) temp|=8; + if (tubep.v) temp|=0x40; if (tubep.n) temp|=0x80; + push(temp); + pc=readmem(0xFFFE)|(readmem(0xFFFF)<<8); + tubep.i=1; + polltime(7); +// printf("Interrupt line %i %i %02X %02X %02X %02X\n",interrupt,lines,sysvia.ifr&sysvia.ier,uservia.ifr&uservia.ier,uservia.ier,uservia.ifr); + } + if ((tube_irq&1) && !tubep.i && tube_6502_skipint) + { + tube_6502_skipint=2; +// printf("skipint=2\n"); + } + if (endtimeslice) + { + endtimeslice=0; + return; + } +/* if (tubeoutput==2) rpclog("%04X : %02X %02X %02X\n",pc,a,x,y); + if (tubetimetolive) + { + tubetimetolive--; + if (!tubetimetolive) + { + tubeoutput=1; + } + }*/ + } +} diff --git a/src/6502tube.h b/src/6502tube.h index 004f94bc..475fb344 100644 --- a/src/6502tube.h +++ b/src/6502tube.h @@ -1,5 +1,5 @@ -void tube_6502_init_cpu(); -void tube_6502_reset(); -void tube_6502_exec(); -void tube_6502_close(); -void tube_6502_mapoutrom(); +void tube_6502_init_cpu(); +void tube_6502_reset(); +void tube_6502_exec(); +void tube_6502_close(); +void tube_6502_mapoutrom(); diff --git a/src/65816.c b/src/65816.c index 9c0afe84..84b839a0 100644 --- a/src/65816.c +++ b/src/65816.c @@ -1,4855 +1,4855 @@ -/*B-em v2.2 by Tom Walker - 65816 parasite CPU emulation - Originally from Snem, with some bugfixes*/ - -#include -#include -#include "b-em.h" -#include "tube.h" -#include "65816.h" - -#define printf rpclog - -static uint8_t *w65816ram,*w65816rom; -/*Registers*/ -typedef union -{ - uint16_t w; - struct - { - uint8_t l,h; - } b; -} reg; - -static reg w65816a,w65816x,w65816y,w65816s; -static uint32_t pbr,dbr; -static uint16_t w65816pc,dp; - -static int wins=0; - -static struct -{ - int c,z,i,d,b,v,n,m,ex,e; /*X renamed to EX due to #define conflict*/ -} w65816p; - -static int inwai; -/*Opcode table*/ -static void (*opcodes[256][5])(); - -/*CPU modes : 0 = X1M1 - 1 = X1M0 - 2 = X0M1 - 3 = X0M0 - 4 = emulation*/ -static int cpumode; - -/*Current opcode*/ -static uint8_t w65816opcode; - -#define a w65816a -#define x w65816x -#define y w65816y -#define s w65816s -#define pc w65816pc -#define p w65816p - -#define cycles tubecycles -#define opcode w65816opcode - -static int def=1,divider=0,banking=0,banknum=0; -static uint32_t w65816mask=0xFFFF; - -static uint8_t readmem65816(uint32_t a) -{ - uint8_t temp; - a&=w65816mask; - cycles--; - if ((a&~7)==0xFEF8) - { - temp=tube_parasite_read(a); -/* if (a==0xFEFB && temp==0xD) - { - dtimes++; - if (dtimes==2) toutput=1; - }*/ - //rpclog("Read TUBE %04X %02X %04X\n",a,temp,pc); - return temp; - } - if ((a&0x78000)==0x8000 && (def || (banking&8))) return w65816rom[a&0x7FFF]; - if ((a&0x78000)==0x4000 && !def && (banking&1)) return w65816ram[(a&0x3FFF)|((banknum&7)<<14)]; - if ((a&0x78000)==0x8000 && !def && (banking&2)) return w65816ram[(a&0x3FFF)|(((banknum>>3)&7)<<14)]; - return w65816ram[a]; -} - -static uint16_t readmemw65816(uint32_t a) -{ - a&=w65816mask; - return readmem65816(a)|(readmem65816(a+1)<<8); -// cycles-=2; -// rpclog("Reading %08X %i %08X %08X\n",a,tuberomin,w65816rom,w65816ram); -// if ((a&~0xFFF)==0xF000 && tuberomin) return w65816rom[a&0xFFF]|(w65816rom[(a+1)&0xFFF]<<8); -// if (a<0x10000) return w65816ram[a]|(w65816ram[a+1]<<8); -} - -int endtimeslice; -static void writemem65816(uint32_t a, uint8_t v) -{ - a&=w65816mask; -// if (a==0xFF) rpclog("Write 00FF %02X %04X %i\n",v,pc,wins); - cycles--; - if ((a&~7)==0xFEF0) - { -// printf("Write control %04X %02X\n",a,v); - switch (v&7) - { - case 0: case 1: def=v&1; /*rpclog("Default now %i\n",def); */break; - case 2: case 3: divider=(divider>>1)|((v&1)<<3); /*rpclog("Divider now %i\n",divider);*/ break; - case 4: case 5: banking=(banking>>1)|((v&1)<<3); /*rpclog("Banking now %i\n",banking);*/ break; - case 6: case 7: banknum=(banknum>>1)|((v&1)<<5); /*rpclog("Banknum now %i\n",banknum);*/ break; - } - if (def || !(banking&4)) w65816mask=0xFFFF; - else w65816mask=0x7FFFF; -// rpclog("Mask now %08X\n",w65816mask); - return; - } - if ((a&~7)==0xFEF8) - { -// rpclog("Write TUBE %04X %02X %04X\n",a,v,pc); - tube_parasite_write(a,v); - endtimeslice=1; - return; - } - if ((a&0x78000)==0x4000 && !def && (banking&1)) { w65816ram[(a&0x3FFF)|((banknum&7)<<14)]=v; return; } - if ((a&0x78000)==0x8000 && !def && (banking&2)) { w65816ram[(a&0x3FFF)|(((banknum>>3)&7)<<14)]=v; return; } -// if (a>0xF000) rpclog("Write %04X %02X %04X\n",a,v,pc); -// if (a==0xF7FF && v==0xFF) toutput=1; - w65816ram[a]=v; -} - -static void writememw65816(uint32_t a, uint16_t v) -{ - a&=w65816mask; - writemem65816(a,v); - writemem65816(a+1,v>>8); -// cycles-=2; -// if (a<0x10000) -// { -// w65816ram[a]=v&0xFF; -// w65816ram[a+1]=v>>8; -// } -} - -#define readmem(a) readmem65816(a) -#define readmemw(a) readmemw65816(a) -#define writemem(a,v) writemem65816(a,v) -#define writememw(a,v) writememw65816(a,v) - -#define clockspc(c) - -static void updatecpumode(); -static int inwai=0; -/*Temporary variables*/ -static uint32_t addr; - -/*Addressing modes*/ -static uint32_t absolute() -{ - uint32_t temp=readmemw(pbr|pc); pc+=2; - return temp|dbr; -} - -static uint32_t absolutex() -{ - uint32_t temp=(readmemw(pbr|pc))+x.w+dbr; pc+=2; -// if ((temp&0xFFFF)>0x2200 && (temp&0xFFFF)<0x8000) printf("ABSX %04X %06X\n",x.w,temp); -// if (output) printf("ABSX 0000,%04X - %06X\n",x.w,temp); -// if (output) printf("Addr %06X\n",temp); - return temp; -} - -static uint32_t absolutey() -{ - uint32_t temp=(readmemw(pbr|pc))+y.w+dbr; pc+=2; - return temp; -} - -static uint32_t absolutelong() -{ - uint32_t temp=readmemw(pbr|pc); pc+=2; - temp|=(readmem(pbr|pc)<<16); pc++; - return temp; -} - -static uint32_t absolutelongx() -{ - uint32_t temp=(readmemw(pbr|pc))+x.w; pc+=2; - temp+=(readmem(pbr|pc)<<16); pc++; -// printf("abslx %06X %04X\n",temp,x.w); - return temp; -} - -static uint32_t zeropage() /*It's actually direct page, but I'm used to calling it zero page*/ -{ - uint32_t temp=readmem(pbr|pc); pc++; - temp+=dp; - if (dp&0xFF) { cycles--; clockspc(6); } - return temp&0xFFFF; -} - -static uint32_t zeropagex() -{ - uint32_t temp=readmem(pbr|pc)+x.w; pc++; - if (p.e) temp&=0xFF; - temp+=dp; - if (dp&0xFF) { cycles--; clockspc(6); } - return temp&0xFFFF; -} - -static uint32_t zeropagey() -{ - uint32_t temp=readmem(pbr|pc)+y.w; pc++; - if (p.e) temp&=0xFF; - temp+=dp; - if (dp&0xFF) { cycles--; clockspc(6); } - return temp&0xFFFF; -} - -static uint32_t stack() -{ - uint32_t temp=readmem(pbr|pc); pc++; - temp+=s.w; - return temp&0xFFFF; -} - -static uint32_t indirect() -{ - uint32_t temp=(readmem(pbr|pc)+dp)&0xFFFF; pc++; - return (readmemw(temp))+dbr; -} - -static uint32_t indirectx() -{ - uint32_t temp=(readmem(pbr|pc)+dp+x.w)&0xFFFF; pc++; - return (readmemw(temp))+dbr; -} -static uint32_t jindirectx() /*JSR (,x) uses PBR instead of DBR, and 2 byte address insted of 1 + dp*/ -{ - uint32_t temp=(readmem(pbr|pc)+(readmem((pbr|pc)+1)<<8)+x.w)+pbr; pc+=2; -// printf("Temp %06X\n",temp); - return temp; -} - -static uint32_t indirecty() -{ - uint32_t temp=(readmem(pbr|pc)+dp)&0xFFFF; pc++; - return (readmemw(temp))+y.w+dbr; -} -static uint32_t sindirecty() -{ - uint32_t temp=(readmem(pbr|pc)+s.w)&0xFFFF; pc++; - return (readmemw(temp))+y.w+dbr; -} - -static uint32_t indirectl() -{ - uint32_t temp, addr; - temp=(readmem(pbr|pc)+dp)&0xFFFF; pc++; - addr=readmemw(temp)|(readmem(temp+2)<<16); -// printf("IND %06X\n",addr); - return addr; -} - -static uint32_t indirectly() -{ - uint32_t temp, addr; - temp=(readmem(pbr|pc)+dp)&0xFFFF; pc++; - addr=(readmemw(temp)|(readmem(temp+2)<<16))+y.w; -// if (pc==0xFDC9) printf("INDy %04X %06X\n",temp,addr); -// if (output) printf("INDy %06X %02X %06X\n",addr,opcode,pbr|pc); - return addr; -} - -/*Flag setting*/ -#define setzn8(v) p.z=!(v); p.n=(v)&0x80 -#define setzn16(v) p.z=!(v); p.n=(v)&0x8000 - -/*ADC/SBC macros*/ -#define ADC8() tempw=a.b.l+temp+((p.c)?1:0); \ - p.v=(!((a.b.l^temp)&0x80)&&((a.b.l^tempw)&0x80)); \ - a.b.l=tempw&0xFF; \ - setzn8(a.b.l); \ - p.c=tempw&0x100; - -#define ADC16() templ=a.w+tempw+((p.c)?1:0); \ - p.v=(!((a.w^tempw)&0x8000)&&((a.w^templ)&0x8000)); \ - a.w=templ&0xFFFF; \ - setzn16(a.w); \ - p.c=templ&0x10000; - -#define ADCBCD8() \ - tempw=(a.b.l&0xF)+(temp&0xF)+(p.c?1:0); \ - if (tempw>9) \ - { \ - tempw+=6; \ - } \ - tempw+=((a.b.l&0xF0)+(temp&0xF0)); \ - if (tempw>0x9F) \ - { \ - tempw+=0x60; \ - } \ - p.v=(!((a.b.l^temp)&0x80)&&((a.b.l^tempw)&0x80)); \ - a.b.l=tempw&0xFF; \ - setzn8(a.b.l); \ - p.c=tempw>0xFF; \ - cycles--; clockspc(6); - -#define ADCBCD16() \ - templ=(a.w&0xF)+(tempw&0xF)+(p.c?1:0); \ - if (templ>9) \ - { \ - templ+=6; \ - } \ - templ+=((a.w&0xF0)+(tempw&0xF0)); \ - if (templ>0x9F) \ - { \ - templ+=0x60; \ - } \ - templ+=((a.w&0xF00)+(tempw&0xF00)); \ - if (templ>0x9FF) \ - { \ - templ+=0x600; \ - } \ - templ+=((a.w&0xF000)+(tempw&0xF000)); \ - if (templ>0x9FFF) \ - { \ - templ+=0x6000; \ - } \ - p.v=(!((a.w^tempw)&0x8000)&&((a.w^templ)&0x8000)); \ - a.w=templ&0xFFFF; \ - setzn16(a.w); \ - p.c=templ>0xFFFF; \ - cycles--; clockspc(6); - -#define SBC8() tempw=a.b.l-temp-((p.c)?0:1); \ - p.v=(((a.b.l^temp)&0x80)&&((a.b.l^tempw)&0x80)); \ - a.b.l=tempw&0xFF; \ - setzn8(a.b.l); \ - p.c=tempw<=0xFF; - -#define SBC16() templ=a.w-tempw-((p.c)?0:1); \ - p.v=(((a.w^tempw)&(a.w^templ))&0x8000); \ - a.w=templ&0xFFFF; \ - setzn16(a.w); \ - p.c=templ<=0xFFFF; - -#define SBCBCD8() \ - tempw=(a.b.l&0xF)-(temp&0xF)-(p.c?0:1); \ - if (tempw>9) \ - { \ - tempw-=6; \ - } \ - tempw+=((a.b.l&0xF0)-(temp&0xF0)); \ - if (tempw>0x9F) \ - { \ - tempw-=0x60; \ - } \ - p.v=(((a.b.l^temp)&0x80)&&((a.b.l^tempw)&0x80)); \ - a.b.l=tempw&0xFF; \ - setzn8(a.b.l); \ - p.c=tempw<=0xFF; \ - cycles--; clockspc(6); - -#define SBCBCD16() \ - templ=(a.w&0xF)-(tempw&0xF)-(p.c?0:1); \ - if (templ>9) \ - { \ - templ-=6; \ - } \ - templ+=((a.w&0xF0)-(tempw&0xF0)); \ - if (templ>0x9F) \ - { \ - templ-=0x60; \ - } \ - templ+=((a.w&0xF00)-(tempw&0xF00)); \ - if (templ>0x9FF) \ - { \ - templ-=0x600; \ - } \ - templ+=((a.w&0xF000)-(tempw&0xF000)); \ - if (templ>0x9FFF) \ - { \ - templ-=0x6000; \ - } \ - p.v=(((a.w^tempw)&0x8000)&&((a.w^templ)&0x8000)); \ - a.w=templ&0xFFFF; \ - setzn16(a.w); \ - p.c=templ<=0xFFFF; \ - cycles--; clockspc(6); - -/*Instructions*/ -static void inca8() -{ - readmem(pbr|pc); - a.b.l++; - setzn8(a.b.l); -} -static void inca16() -{ - readmem(pbr|pc); - a.w++; - setzn16(a.w); -} -static void inx8() -{ - readmem(pbr|pc); - x.b.l++; - setzn8(x.b.l); -} -static void inx16() -{ - readmem(pbr|pc); - x.w++; - setzn16(x.w); -} -static void iny8() -{ - readmem(pbr|pc); - y.b.l++; - setzn8(y.b.l); -} -static void iny16() -{ - readmem(pbr|pc); - y.w++; - setzn16(y.w); -} - -static void deca8() -{ - readmem(pbr|pc); - a.b.l--; - setzn8(a.b.l); -} -static void deca16() -{ - readmem(pbr|pc); - a.w--; - setzn16(a.w); -} -static void dex8() -{ - readmem(pbr|pc); - x.b.l--; - setzn8(x.b.l); -} -static void dex16() -{ - readmem(pbr|pc); - x.w--; - setzn16(x.w); -} -static void dey8() -{ - readmem(pbr|pc); - y.b.l--; - setzn8(y.b.l); -} -static void dey16() -{ - readmem(pbr|pc); - y.w--; - setzn16(y.w); -} - -/*INC group*/ -static void incZp8() -{ - uint8_t temp; - addr=zeropage(); - temp=readmem(addr); - cycles--; clockspc(6); - temp++; - setzn8(temp); - writemem(addr,temp); -} -static void incZp16() -{ - uint16_t temp; - addr=zeropage(); - temp=readmemw(addr); - cycles--; clockspc(6); - temp++; - setzn16(temp); - writememw(addr,temp); -} - -static void incZpx8() -{ - uint8_t temp; - addr=zeropagex(); - temp=readmem(addr); - cycles--; clockspc(6); - temp++; - setzn8(temp); - writemem(addr,temp); -} -static void incZpx16() -{ - uint16_t temp; - addr=zeropagex(); - temp=readmemw(addr); - cycles--; clockspc(6); - temp++; - setzn16(temp); - writememw(addr,temp); -} - -static void incAbs8() -{ - uint8_t temp; - addr=absolute(); - temp=readmem(addr); - cycles--; clockspc(6); - temp++; - setzn8(temp); - writemem(addr,temp); -} -static void incAbs16() -{ - uint16_t temp; - addr=absolute(); - temp=readmemw(addr); - cycles--; clockspc(6); - temp++; - setzn16(temp); - writememw(addr,temp); -} - -static void incAbsx8() -{ - uint8_t temp; - addr=absolutex(); - temp=readmem(addr); - cycles--; clockspc(6); - temp++; - setzn8(temp); - writemem(addr,temp); -} -static void incAbsx16() -{ - uint16_t temp; - addr=absolutex(); - temp=readmemw(addr); - cycles--; clockspc(6); - temp++; - setzn16(temp); - writememw(addr,temp); -} - -/*DEC group*/ -static void decZp8() -{ - uint8_t temp; - addr=zeropage(); - temp=readmem(addr); - cycles--; clockspc(6); - temp--; - setzn8(temp); - writemem(addr,temp); -// if (output && addr==4) printf("DEC 4 %02X %i %i\n",temp,p.z,p.n); -} -static void decZp16() -{ - uint16_t temp; - addr=zeropage(); - temp=readmemw(addr); - cycles--; clockspc(6); - temp--; - setzn16(temp); - writememw(addr,temp); -} - -static void decZpx8() -{ - uint8_t temp; - addr=zeropagex(); - temp=readmem(addr); - cycles--; clockspc(6); - temp--; - setzn8(temp); - writemem(addr,temp); -} -static void decZpx16() -{ - uint16_t temp; - addr=zeropagex(); - temp=readmemw(addr); - cycles--; clockspc(6); - temp--; - setzn16(temp); - writememw(addr,temp); -} - -static void decAbs8() -{ - uint8_t temp; - addr=absolute(); - temp=readmem(addr); - cycles--; clockspc(6); - temp--; - setzn8(temp); - writemem(addr,temp); -} -static void decAbs16() -{ - uint16_t temp; - addr=absolute(); - temp=readmemw(addr); - cycles--; clockspc(6); - temp--; - setzn16(temp); - writememw(addr,temp); -} - -static void decAbsx8() -{ - uint8_t temp; - addr=absolutex(); - temp=readmem(addr); - cycles--; clockspc(6); - temp--; - setzn8(temp); - writemem(addr,temp); -} -static void decAbsx16() -{ - uint16_t temp; - addr=absolutex(); - temp=readmemw(addr); - cycles--; clockspc(6); - temp--; - setzn16(temp); - writememw(addr,temp); -} - -/*Flag group*/ -static void clc() -{ - readmem(pbr|pc); - p.c=0; -} -static void cld() -{ - readmem(pbr|pc); - p.d=0; -} -static void cli() -{ - readmem(pbr|pc); - p.i=0; -} -static void clv() -{ - readmem(pbr|pc); - p.v=0; -} - -static void sec() -{ - readmem(pbr|pc); - p.c=1; -} -static void sed() -{ - readmem(pbr|pc); - p.d=1; -} -static void sei() -{ - readmem(pbr|pc); - p.i=1; -} - -static void xce() -{ - int temp=p.c; - p.c=p.e; - p.e=temp; - readmem(pbr|pc); - updatecpumode(); -} - -static void sep() -{ - uint8_t temp=readmem(pbr|pc); pc++; - if (temp&1) p.c=1; - if (temp&2) p.z=1; - if (temp&4) p.i=1; - if (temp&8) p.d=1; - if (temp&0x40) p.v=1; - if (temp&0x80) p.n=1; - if (!p.e) - { - if (temp&0x10) p.ex=1; - if (temp&0x20) p.m=1; - updatecpumode(); - } -} - -static void rep65816() -{ - uint8_t temp=readmem(pbr|pc); pc++; - if (temp&1) p.c=0; - if (temp&2) p.z=0; - if (temp&4) p.i=0; - if (temp&8) p.d=0; - if (temp&0x40) p.v=0; - if (temp&0x80) p.n=0; - if (!p.e) - { - if (temp&0x10) p.ex=0; - if (temp&0x20) p.m=0; - updatecpumode(); - } -} - -/*Transfer group*/ -static void tax8() -{ - readmem(pbr|pc); - x.b.l=a.b.l; - setzn8(x.b.l); -} -static void tay8() -{ - readmem(pbr|pc); - y.b.l=a.b.l; - setzn8(y.b.l); -} -static void txa8() -{ - readmem(pbr|pc); - a.b.l=x.b.l; - setzn8(a.b.l); -} -static void tya8() -{ - readmem(pbr|pc); - a.b.l=y.b.l; - setzn8(a.b.l); -} -static void tsx8() -{ - readmem(pbr|pc); - x.b.l=s.b.l; - setzn8(x.b.l); -} -static void txs8() -{ - readmem(pbr|pc); - s.b.l=x.b.l; -// setzn8(s.b.l); -} -static void txy8() -{ - readmem(pbr|pc); - y.b.l=x.b.l; - setzn8(y.b.l); -} -static void tyx8() -{ - readmem(pbr|pc); - x.b.l=y.b.l; - setzn8(x.b.l); -} - -static void tax16() -{ - readmem(pbr|pc); - x.w=a.w; - setzn16(x.w); -} -static void tay16() -{ - readmem(pbr|pc); - y.w=a.w; - setzn16(y.w); -} -static void txa16() -{ - readmem(pbr|pc); - a.w=x.w; - setzn16(a.w); -} -static void tya16() -{ - readmem(pbr|pc); - a.w=y.w; - setzn16(a.w); -} -static void tsx16() -{ - readmem(pbr|pc); - x.w=s.w; - setzn16(x.w); -} -static void txs16() -{ - readmem(pbr|pc); - s.w=x.w; -// setzn16(s.w); -} -static void txy16() -{ - readmem(pbr|pc); - y.w=x.w; - setzn16(y.w); -} -static void tyx16() -{ - readmem(pbr|pc); - x.w=y.w; - setzn16(x.w); -} - -/*LDX group*/ -static void ldxImm8() -{ - x.b.l=readmem(pbr|pc); pc++; - setzn8(x.b.l); -} -static void ldxZp8() -{ - addr=zeropage(); - x.b.l=readmem(addr); - setzn8(x.b.l); -} -static void ldxZpy8() -{ - addr=zeropagey(); - x.b.l=readmem(addr); - setzn8(x.b.l); -} -static void ldxAbs8() -{ - addr=absolute(); - x.b.l=readmem(addr); - setzn8(x.b.l); -} -static void ldxAbsy8() -{ - addr=absolutey(); - x.b.l=readmem(addr); - setzn8(x.b.l); -} - -static void ldxImm16() -{ - x.w=readmemw(pbr|pc); pc+=2; - setzn16(x.w); -} -static void ldxZp16() -{ - addr=zeropage(); - x.w=readmemw(addr); - setzn16(x.w); -} -static void ldxZpy16() -{ - addr=zeropagey(); - x.w=readmemw(addr); - setzn16(x.w); -} -static void ldxAbs16() -{ - addr=absolute(); - x.w=readmemw(addr); - setzn16(x.w); -} -static void ldxAbsy16() -{ - addr=absolutey(); - x.w=readmemw(addr); - setzn16(x.w); -} - -/*LDY group*/ -static void ldyImm8() -{ - y.b.l=readmem(pbr|pc); pc++; - setzn8(y.b.l); -} -static void ldyZp8() -{ - addr=zeropage(); - y.b.l=readmem(addr); - setzn8(y.b.l); -} -static void ldyZpx8() -{ - addr=zeropagex(); - y.b.l=readmem(addr); - setzn8(y.b.l); -} -static void ldyAbs8() -{ - addr=absolute(); - y.b.l=readmem(addr); - setzn8(y.b.l); -} -static void ldyAbsx8() -{ - addr=absolutex(); - y.b.l=readmem(addr); - setzn8(y.b.l); -} - -static void ldyImm16() -{ - y.w=readmemw(pbr|pc); pc+=2; - setzn16(y.w); -} -static void ldyZp16() -{ - addr=zeropage(); - y.w=readmemw(addr); - setzn16(y.w); -} -static void ldyZpx16() -{ - addr=zeropagex(); - y.w=readmemw(addr); - setzn16(y.w); -} -static void ldyAbs16() -{ - addr=absolute(); - y.w=readmemw(addr); - setzn16(y.w); -} -static void ldyAbsx16() -{ - addr=absolutex(); - y.w=readmemw(addr); - setzn16(y.w); -} - -/*LDA group*/ -static void ldaImm8() -{ - a.b.l=readmem(pbr|pc); pc++; - setzn8(a.b.l); -} -static void ldaZp8() -{ - addr=zeropage(); - a.b.l=readmem(addr); - setzn8(a.b.l); -} -static void ldaZpx8() -{ - addr=zeropagex(); - a.b.l=readmem(addr); - setzn8(a.b.l); -} -static void ldaSp8() -{ - addr=stack(); - a.b.l=readmem(addr); - setzn8(a.b.l); -} -static void ldaSIndirecty8() -{ - addr=sindirecty(); - a.b.l=readmem(addr); - setzn8(a.b.l); -} -static void ldaAbs8() -{ - addr=absolute(); - a.b.l=readmem(addr); - setzn8(a.b.l); -} -static void ldaAbsx8() -{ - addr=absolutex(); - a.b.l=readmem(addr); - setzn8(a.b.l); -} -static void ldaAbsy8() -{ - addr=absolutey(); - a.b.l=readmem(addr); - setzn8(a.b.l); -} -static void ldaLong8() -{ - addr=absolutelong(); - a.b.l=readmem(addr); - setzn8(a.b.l); -} -static void ldaLongx8() -{ - addr=absolutelongx(); - a.b.l=readmem(addr); - setzn8(a.b.l); -} -static void ldaIndirect8() -{ - addr=indirect(); - a.b.l=readmem(addr); - setzn8(a.b.l); -} -static void ldaIndirectx8() -{ - addr=indirectx(); - a.b.l=readmem(addr); - setzn8(a.b.l); -} -static void ldaIndirecty8() -{ - addr=indirecty(); - a.b.l=readmem(addr); - setzn8(a.b.l); -} -static void ldaIndirectLong8() -{ - addr=indirectl(); - a.b.l=readmem(addr); - setzn8(a.b.l); -} -static void ldaIndirectLongy8() -{ - addr=indirectly(); - a.b.l=readmem(addr); - setzn8(a.b.l); -} - -static void ldaImm16() -{ - a.w=readmemw(pbr|pc); pc+=2; - setzn16(a.w); -} -static void ldaZp16() -{ - addr=zeropage(); - a.w=readmemw(addr); - setzn16(a.w); -} -static void ldaZpx16() -{ - addr=zeropagex(); - a.w=readmemw(addr); - setzn16(a.w); -} -static void ldaSp16() -{ - addr=stack(); - a.w=readmemw(addr); - setzn16(a.w); -} -static void ldaSIndirecty16() -{ - addr=sindirecty(); - a.w=readmemw(addr); - setzn16(a.w); -} -static void ldaAbs16() -{ - addr=absolute(); - a.w=readmemw(addr); - setzn16(a.w); -} -static void ldaAbsx16() -{ - addr=absolutex(); - a.w=readmemw(addr); - setzn16(a.w); -} -static void ldaAbsy16() -{ - addr=absolutey(); - a.w=readmemw(addr); - setzn16(a.w); -} -static void ldaLong16() -{ - addr=absolutelong(); - a.w=readmemw(addr); - setzn16(a.w); -} -static void ldaLongx16() -{ - addr=absolutelongx(); - a.w=readmemw(addr); - setzn16(a.w); -} -static void ldaIndirect16() -{ - addr=indirect(); - a.w=readmemw(addr); - setzn16(a.w); -} -static void ldaIndirectx16() -{ - addr=indirectx(); - a.w=readmemw(addr); - setzn16(a.w); -} -static void ldaIndirecty16() -{ - addr=indirecty(); - a.w=readmemw(addr); - setzn16(a.w); -} -static void ldaIndirectLong16() -{ - addr=indirectl(); - a.w=readmemw(addr); - setzn16(a.w); -} -static void ldaIndirectLongy16() -{ - addr=indirectly(); - a.w=readmemw(addr); - setzn16(a.w); -} - -/*STA group*/ -static void staZp8() -{ - addr=zeropage(); - writemem(addr,a.b.l); -} -static void staZpx8() -{ - addr=zeropagex(); - writemem(addr,a.b.l); -} -static void staAbs8() -{ - addr=absolute(); - writemem(addr,a.b.l); -} -static void staAbsx8() -{ - addr=absolutex(); - writemem(addr,a.b.l); -} -static void staAbsy8() -{ - addr=absolutey(); - writemem(addr,a.b.l); -} -static void staLong8() -{ - addr=absolutelong(); - writemem(addr,a.b.l); -} -static void staLongx8() -{ - addr=absolutelongx(); -// rpclog("Addr %06X\n",addr); - writemem(addr,a.b.l); -} -static void staIndirect8() -{ - addr=indirect(); - writemem(addr,a.b.l); -} -static void staIndirectx8() -{ - addr=indirectx(); - writemem(addr,a.b.l); -} -static void staIndirecty8() -{ - addr=indirecty(); - writemem(addr,a.b.l); -} -static void staIndirectLong8() -{ - addr=indirectl(); - writemem(addr,a.b.l); -} -static void staIndirectLongy8() -{ - addr=indirectly(); - writemem(addr,a.b.l); -} -static void staSp8() -{ - addr=stack(); - writemem(addr,a.b.l); -} -static void staSIndirecty8() -{ - addr=sindirecty(); - writemem(addr,a.b.l); -} - -static void staZp16() -{ - addr=zeropage(); - writememw(addr,a.w); -} -static void staZpx16() -{ - addr=zeropagex(); - writememw(addr,a.w); -} -static void staAbs16() -{ - addr=absolute(); - writememw(addr,a.w); -} -static void staAbsx16() -{ - addr=absolutex(); - writememw(addr,a.w); -} -static void staAbsy16() -{ - addr=absolutey(); - writememw(addr,a.w); -} -static void staLong16() -{ - addr=absolutelong(); - writememw(addr,a.w); -} -static void staLongx16() -{ - addr=absolutelongx(); - writememw(addr,a.w); -// printf("Written %06X %04X %04X\n",addr,a.w,readmemw(addr)); -} -static void staIndirect16() -{ - addr=indirect(); - writememw(addr,a.w); -} -static void staIndirectx16() -{ - addr=indirectx(); - writememw(addr,a.w); -} -static void staIndirecty16() -{ - addr=indirecty(); - writememw(addr,a.w); -} -static void staIndirectLong16() -{ - addr=indirectl(); - writememw(addr,a.w); -} -static void staIndirectLongy16() -{ - addr=indirectly(); - writememw(addr,a.w); -} -static void staSp16() -{ - addr=stack(); - writememw(addr,a.w); -} -static void staSIndirecty16() -{ - addr=sindirecty(); - writememw(addr,a.w); -} - -/*STX group*/ -static void stxZp8() -{ - addr=zeropage(); - writemem(addr,x.b.l); -} -static void stxZpy8() -{ - addr=zeropagey(); - writemem(addr,x.b.l); -} -static void stxAbs8() -{ - addr=absolute(); - writemem(addr,x.b.l); -} - -static void stxZp16() -{ - addr=zeropage(); - writememw(addr,x.w); -} -static void stxZpy16() -{ - addr=zeropagey(); - writememw(addr,x.w); -} -static void stxAbs16() -{ - addr=absolute(); - writememw(addr,x.w); -} - -/*STY group*/ -static void styZp8() -{ - addr=zeropage(); - writemem(addr,y.b.l); -} -static void styZpx8() -{ - addr=zeropagex(); - writemem(addr,y.b.l); -} -static void styAbs8() -{ - addr=absolute(); - writemem(addr,y.b.l); -} - -static void styZp16() -{ - addr=zeropage(); - writememw(addr,y.w); -} -static void styZpx16() -{ - addr=zeropagex(); - writememw(addr,y.w); -} -static void styAbs16() -{ - addr=absolute(); - writememw(addr,y.w); -} - -/*STZ group*/ -static void stzZp8() -{ - addr=zeropage(); - writemem(addr,0); -} -static void stzZpx8() -{ - addr=zeropagex(); - writemem(addr,0); -} -static void stzAbs8() -{ - addr=absolute(); - writemem(addr,0); -} -static void stzAbsx8() -{ - addr=absolutex(); - writemem(addr,0); -} - -static void stzZp16() -{ - addr=zeropage(); - writememw(addr,0); -} -static void stzZpx16() -{ - addr=zeropagex(); - writememw(addr,0); -} -static void stzAbs16() -{ - addr=absolute(); - writememw(addr,0); -} -static void stzAbsx16() -{ - addr=absolutex(); - writememw(addr,0); -} - -/*ADC group*/ -static void adcImm8() -{ - uint16_t tempw; - uint8_t temp=readmem(pbr|pc); pc++; - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static void adcZp8() -{ - uint16_t tempw; - uint8_t temp; - addr=zeropage(); - temp=readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static void adcZpx8() -{ - uint16_t tempw; - uint8_t temp; - addr=zeropagex(); - temp=readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static void adcSp8() -{ - uint16_t tempw; - uint8_t temp; - addr=stack(); - temp=readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static void adcAbs8() -{ - uint16_t tempw; - uint8_t temp; - addr=absolute(); - temp=readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static void adcAbsx8() -{ - uint16_t tempw; - uint8_t temp; - addr=absolutex(); - temp=readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static void adcAbsy8() -{ - uint16_t tempw; - uint8_t temp; - addr=absolutey(); - temp=readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static void adcLong8() -{ - uint16_t tempw; - uint8_t temp; - addr=absolutelong(); - temp=readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static void adcLongx8() -{ - uint16_t tempw; - uint8_t temp; - addr=absolutelongx(); - temp=readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static void adcIndirect8() -{ - uint16_t tempw; - uint8_t temp; - addr=indirect(); - temp=readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static void adcIndirectx8() -{ - uint16_t tempw; - uint8_t temp; - addr=indirectx(); - temp=readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static void adcIndirecty8() -{ - uint16_t tempw; - uint8_t temp; - addr=indirecty(); - temp=readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static void adcsIndirecty8() -{ - uint16_t tempw; - uint8_t temp; - addr=sindirecty(); - temp=readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static void adcIndirectLong8() -{ - uint16_t tempw; - uint8_t temp; - addr=indirectl(); - temp=readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} -static void adcIndirectLongy8() -{ - uint16_t tempw; - uint8_t temp; - addr=indirectly(); - temp=readmem(addr); - if (p.d) { ADCBCD8(); } else { ADC8(); } -} - -static void adcImm16() -{ - uint32_t templ; - uint16_t tempw; - tempw=readmemw(pbr|pc); pc+=2; - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static void adcZp16() -{ - uint32_t templ; - uint16_t tempw; - addr=zeropage(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static void adcZpx16() -{ - uint32_t templ; - uint16_t tempw; - addr=zeropagex(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static void adcSp16() -{ - uint32_t templ; - uint16_t tempw; - addr=stack(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static void adcAbs16() -{ - uint32_t templ; - uint16_t tempw; - addr=absolute(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static void adcAbsx16() -{ - uint32_t templ; - uint16_t tempw; - addr=absolutex(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static void adcAbsy16() -{ - uint32_t templ; - uint16_t tempw; - addr=absolutey(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static void adcLong16() -{ - uint32_t templ; - uint16_t tempw; - addr=absolutelong(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static void adcLongx16() -{ - uint32_t templ; - uint16_t tempw; - addr=absolutelongx(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static void adcIndirect16() -{ - uint32_t templ; - uint16_t tempw; - addr=indirect(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static void adcIndirectx16() -{ - uint32_t templ; - uint16_t tempw; - addr=indirectx(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static void adcIndirecty16() -{ - uint32_t templ; - uint16_t tempw; - addr=indirecty(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static void adcsIndirecty16() -{ - uint32_t templ; - uint16_t tempw; - addr=sindirecty(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static void adcIndirectLong16() -{ - uint32_t templ; - uint16_t tempw; - addr=indirectl(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} -static void adcIndirectLongy16() -{ - uint32_t templ; - uint16_t tempw; - addr=indirectly(); - tempw=readmemw(addr); - if (p.d) { ADCBCD16(); } else { ADC16(); } -} - -/*SBC group*/ -static void sbcImm8() -{ - uint16_t tempw; - uint8_t temp=readmem(pbr|pc); pc++; - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static void sbcZp8() -{ - uint16_t tempw; - uint8_t temp; - addr=zeropage(); - temp=readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static void sbcZpx8() -{ - uint16_t tempw; - uint8_t temp; - addr=zeropagex(); - temp=readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static void sbcSp8() -{ - uint16_t tempw; - uint8_t temp; - addr=stack(); - temp=readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static void sbcAbs8() -{ - uint16_t tempw; - uint8_t temp; - addr=absolute(); - temp=readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static void sbcAbsx8() -{ - uint16_t tempw; - uint8_t temp; - addr=absolutex(); - temp=readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static void sbcAbsy8() -{ - uint16_t tempw; - uint8_t temp; - addr=absolutey(); - temp=readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static void sbcLong8() -{ - uint16_t tempw; - uint8_t temp; - addr=absolutelong(); - temp=readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static void sbcLongx8() -{ - uint16_t tempw; - uint8_t temp; - addr=absolutelongx(); - temp=readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static void sbcIndirect8() -{ - uint16_t tempw; - uint8_t temp; - addr=indirect(); - temp=readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static void sbcIndirectx8() -{ - uint16_t tempw; - uint8_t temp; - addr=indirectx(); - temp=readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static void sbcIndirecty8() -{ - uint16_t tempw; - uint8_t temp; - addr=indirecty(); - temp=readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static void sbcsIndirecty8() -{ - uint16_t tempw; - uint8_t temp; - addr=sindirecty(); - temp=readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static void sbcIndirectLong8() -{ - uint16_t tempw; - uint8_t temp; - addr=indirectl(); - temp=readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} -static void sbcIndirectLongy8() -{ - uint16_t tempw; - uint8_t temp; - addr=indirectly(); - temp=readmem(addr); - if (p.d) { SBCBCD8(); } else { SBC8(); } -} - -static void sbcImm16() -{ - uint32_t templ; - uint16_t tempw; - tempw=readmemw(pbr|pc); pc+=2; - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static void sbcZp16() -{ - uint32_t templ; - uint16_t tempw; - addr=zeropage(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static void sbcZpx16() -{ - uint32_t templ; - uint16_t tempw; - addr=zeropagex(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static void sbcSp16() -{ - uint32_t templ; - uint16_t tempw; - addr=stack(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static void sbcAbs16() -{ - uint32_t templ; - uint16_t tempw; - addr=absolute(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static void sbcAbsx16() -{ - uint32_t templ; - uint16_t tempw; - addr=absolutex(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static void sbcAbsy16() -{ - uint32_t templ; - uint16_t tempw; - addr=absolutey(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static void sbcLong16() -{ - uint32_t templ; - uint16_t tempw; - addr=absolutelong(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static void sbcLongx16() -{ - uint32_t templ; - uint16_t tempw; - addr=absolutelongx(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static void sbcIndirect16() -{ - uint32_t templ; - uint16_t tempw; - addr=indirect(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static void sbcIndirectx16() -{ - uint32_t templ; - uint16_t tempw; - addr=indirectx(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static void sbcIndirecty16() -{ - uint32_t templ; - uint16_t tempw; - addr=indirecty(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static void sbcsIndirecty16() -{ - uint32_t templ; - uint16_t tempw; - addr=sindirecty(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static void sbcIndirectLong16() -{ - uint32_t templ; - uint16_t tempw; - addr=indirectl(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} -static void sbcIndirectLongy16() -{ - uint32_t templ; - uint16_t tempw; - addr=indirectly(); - tempw=readmemw(addr); - if (p.d) { SBCBCD16(); } else { SBC16(); } -} - -/*EOR group*/ -static void eorImm8() -{ - a.b.l^=readmem(pbr|pc); pc++; - setzn8(a.b.l); -} -static void eorZp8() -{ - addr=zeropage(); - a.b.l^=readmem(addr); - setzn8(a.b.l); -} -static void eorZpx8() -{ - addr=zeropagex(); - a.b.l^=readmem(addr); - setzn8(a.b.l); -} -static void eorSp8() -{ - addr=stack(); - a.b.l^=readmem(addr); - setzn8(a.b.l); -} -static void eorAbs8() -{ - addr=absolute(); - a.b.l^=readmem(addr); - setzn8(a.b.l); -} -static void eorAbsx8() -{ - addr=absolutex(); - a.b.l^=readmem(addr); - setzn8(a.b.l); -} -static void eorAbsy8() -{ - addr=absolutey(); - a.b.l^=readmem(addr); - setzn8(a.b.l); -} -static void eorLong8() -{ - addr=absolutelong(); - a.b.l^=readmem(addr); - setzn8(a.b.l); -} -static void eorLongx8() -{ - addr=absolutelongx(); - a.b.l^=readmem(addr); - setzn8(a.b.l); -} -static void eorIndirect8() -{ - addr=indirect(); - a.b.l^=readmem(addr); - setzn8(a.b.l); -} -static void eorIndirectx8() -{ - addr=indirectx(); - a.b.l^=readmem(addr); - setzn8(a.b.l); -} -static void eorIndirecty8() -{ - addr=indirecty(); - a.b.l^=readmem(addr); - setzn8(a.b.l); -} -static void eorsIndirecty8() -{ - addr=sindirecty(); - a.b.l^=readmem(addr); - setzn8(a.b.l); -} -static void eorIndirectLong8() -{ - addr=indirectl(); - a.b.l^=readmem(addr); - setzn8(a.b.l); -} -static void eorIndirectLongy8() -{ - addr=indirectly(); - a.b.l^=readmem(addr); - setzn8(a.b.l); -} - -static void eorImm16() -{ - a.w^=readmemw(pbr|pc); pc+=2; - setzn16(a.w); -} -static void eorZp16() -{ - addr=zeropage(); - a.w^=readmemw(addr); - setzn16(a.w); -} -static void eorZpx16() -{ - addr=zeropagex(); - a.w^=readmemw(addr); - setzn16(a.w); -} -static void eorSp16() -{ - addr=stack(); - a.w^=readmemw(addr); - setzn16(a.w); -} -static void eorAbs16() -{ - addr=absolute(); - a.w^=readmemw(addr); - setzn16(a.w); -} -static void eorAbsx16() -{ - addr=absolutex(); - a.w^=readmemw(addr); - setzn16(a.w); -} -static void eorAbsy16() -{ - addr=absolutey(); - a.w^=readmemw(addr); - setzn16(a.w); -} -static void eorLong16() -{ - addr=absolutelong(); - a.w^=readmemw(addr); - setzn16(a.w); -} -static void eorLongx16() -{ - addr=absolutelongx(); - a.w^=readmemw(addr); - setzn16(a.w); -} -static void eorIndirect16() -{ - addr=indirect(); - a.w^=readmemw(addr); - setzn16(a.w); -} -static void eorIndirectx16() -{ - addr=indirectx(); - a.w^=readmemw(addr); - setzn16(a.w); -} -static void eorIndirecty16() -{ - addr=indirecty(); - a.w^=readmemw(addr); - setzn16(a.w); -} -static void eorsIndirecty16() -{ - addr=sindirecty(); - a.w^=readmemw(addr); - setzn16(a.w); -} -static void eorIndirectLong16() -{ - addr=indirectl(); - a.w^=readmemw(addr); - setzn16(a.w); -} -static void eorIndirectLongy16() -{ - addr=indirectly(); - a.w^=readmemw(addr); - setzn16(a.w); -} - -/*AND group*/ -static void andImm8() -{ - a.b.l&=readmem(pbr|pc); pc++; - setzn8(a.b.l); -} -static void andZp8() -{ - addr=zeropage(); - a.b.l&=readmem(addr); - setzn8(a.b.l); -} -static void andZpx8() -{ - addr=zeropagex(); - a.b.l&=readmem(addr); - setzn8(a.b.l); -} -static void andSp8() -{ - addr=stack(); - a.b.l&=readmem(addr); - setzn8(a.b.l); -} -static void andAbs8() -{ - addr=absolute(); - a.b.l&=readmem(addr); - setzn8(a.b.l); -} -static void andAbsx8() -{ - addr=absolutex(); - a.b.l&=readmem(addr); - setzn8(a.b.l); -} -static void andAbsy8() -{ - addr=absolutey(); - a.b.l&=readmem(addr); - setzn8(a.b.l); -} -static void andLong8() -{ - addr=absolutelong(); - a.b.l&=readmem(addr); - setzn8(a.b.l); -} -static void andLongx8() -{ - addr=absolutelongx(); - a.b.l&=readmem(addr); - setzn8(a.b.l); -} -static void andIndirect8() -{ - addr=indirect(); - a.b.l&=readmem(addr); - setzn8(a.b.l); -} -static void andIndirectx8() -{ - addr=indirectx(); - a.b.l&=readmem(addr); - setzn8(a.b.l); -} -static void andIndirecty8() -{ - addr=indirecty(); - a.b.l&=readmem(addr); - setzn8(a.b.l); -} -static void andsIndirecty8() -{ - addr=sindirecty(); - a.b.l&=readmem(addr); - setzn8(a.b.l); -} -static void andIndirectLong8() -{ - addr=indirectl(); - a.b.l&=readmem(addr); - setzn8(a.b.l); -} -static void andIndirectLongy8() -{ - addr=indirectly(); - a.b.l&=readmem(addr); - setzn8(a.b.l); -} - -static void andImm16() -{ - a.w&=readmemw(pbr|pc); pc+=2; - setzn16(a.w); -} -static void andZp16() -{ - addr=zeropage(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static void andZpx16() -{ - addr=zeropagex(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static void andSp16() -{ - addr=stack(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static void andAbs16() -{ - addr=absolute(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static void andAbsx16() -{ - addr=absolutex(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static void andAbsy16() -{ - addr=absolutey(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static void andLong16() -{ - addr=absolutelong(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static void andLongx16() -{ - addr=absolutelongx(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static void andIndirect16() -{ - addr=indirect(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static void andIndirectx16() -{ - addr=indirectx(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static void andIndirecty16() -{ - addr=indirecty(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static void andsIndirecty16() -{ - addr=sindirecty(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static void andIndirectLong16() -{ - addr=indirectl(); - a.w&=readmemw(addr); - setzn16(a.w); -} -static void andIndirectLongy16() -{ - addr=indirectly(); - a.w&=readmemw(addr); - setzn16(a.w); -} - -/*ORA group*/ -static void oraImm8() -{ - a.b.l|=readmem(pbr|pc); pc++; - setzn8(a.b.l); -} -static void oraZp8() -{ - addr=zeropage(); - a.b.l|=readmem(addr); - setzn8(a.b.l); -} -static void oraZpx8() -{ - addr=zeropagex(); - a.b.l|=readmem(addr); - setzn8(a.b.l); -} -static void oraSp8() -{ - addr=stack(); - a.b.l|=readmem(addr); - setzn8(a.b.l); -} -static void oraAbs8() -{ - addr=absolute(); - a.b.l|=readmem(addr); - setzn8(a.b.l); -} -static void oraAbsx8() -{ - addr=absolutex(); - a.b.l|=readmem(addr); - setzn8(a.b.l); -} -static void oraAbsy8() -{ - addr=absolutey(); - a.b.l|=readmem(addr); - setzn8(a.b.l); -} -static void oraLong8() -{ - addr=absolutelong(); - a.b.l|=readmem(addr); - setzn8(a.b.l); -} -static void oraLongx8() -{ - addr=absolutelongx(); - a.b.l|=readmem(addr); - setzn8(a.b.l); -} -static void oraIndirect8() -{ - addr=indirect(); - a.b.l|=readmem(addr); - setzn8(a.b.l); -} -static void oraIndirectx8() -{ - addr=indirectx(); - a.b.l|=readmem(addr); - setzn8(a.b.l); -} -static void oraIndirecty8() -{ - addr=indirecty(); - a.b.l|=readmem(addr); - setzn8(a.b.l); -} -static void orasIndirecty8() -{ - addr=sindirecty(); - a.b.l|=readmem(addr); - setzn8(a.b.l); -} -static void oraIndirectLong8() -{ - addr=indirectl(); - a.b.l|=readmem(addr); - setzn8(a.b.l); -} -static void oraIndirectLongy8() -{ - addr=indirectly(); - a.b.l|=readmem(addr); - setzn8(a.b.l); -} - -static void oraImm16() -{ - a.w|=readmemw(pbr|pc); pc+=2; - setzn16(a.w); -} -static void oraZp16() -{ - addr=zeropage(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static void oraZpx16() -{ - addr=zeropagex(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static void oraSp16() -{ - addr=stack(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static void oraAbs16() -{ - addr=absolute(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static void oraAbsx16() -{ - addr=absolutex(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static void oraAbsy16() -{ - addr=absolutey(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static void oraLong16() -{ - addr=absolutelong(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static void oraLongx16() -{ - addr=absolutelongx(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static void oraIndirect16() -{ - addr=indirect(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static void oraIndirectx16() -{ - addr=indirectx(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static void oraIndirecty16() -{ - addr=indirecty(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static void orasIndirecty16() -{ - addr=sindirecty(); - a.w|=readmem(addr); - setzn16(a.w); -} -static void oraIndirectLong16() -{ - addr=indirectl(); - a.w|=readmemw(addr); - setzn16(a.w); -} -static void oraIndirectLongy16() -{ - addr=indirectly(); - a.w|=readmemw(addr); - setzn16(a.w); -} - -/*BIT group*/ -static void bitImm8() -{ - uint8_t temp=readmem(pbr|pc); pc++; - p.z=!(temp&a.b.l); -} -static void bitImm16() -{ - uint16_t temp=readmemw(pbr|pc); pc+=2; - p.z=!(temp&a.w); -} - -static void bitZp8() -{ - uint8_t temp; - addr=zeropage(); - temp=readmem(addr); - p.z=!(temp&a.b.l); - p.v=temp&0x40; - p.n=temp&0x80; -} -static void bitZp16() -{ - uint16_t temp; - addr=zeropage(); - temp=readmemw(addr); - p.z=!(temp&a.w); - p.v=temp&0x4000; - p.n=temp&0x8000; -} - -static void bitZpx8() -{ - uint8_t temp; - addr=zeropagex(); - temp=readmem(addr); - p.z=!(temp&a.b.l); - p.v=temp&0x40; - p.n=temp&0x80; -} -static void bitZpx16() -{ - uint16_t temp; - addr=zeropagex(); - temp=readmemw(addr); - p.z=!(temp&a.w); - p.v=temp&0x4000; - p.n=temp&0x8000; -} - -static void bitAbs8() -{ - uint8_t temp; - addr=absolute(); - temp=readmem(addr); - p.z=!(temp&a.b.l); - p.v=temp&0x40; - p.n=temp&0x80; -} -static void bitAbs16() -{ - uint16_t temp; - addr=absolute(); - temp=readmemw(addr); - p.z=!(temp&a.w); - p.v=temp&0x4000; - p.n=temp&0x8000; -} - -static void bitAbsx8() -{ - uint8_t temp; - addr=absolutex(); - temp=readmem(addr); - p.z=!(temp&a.b.l); - p.v=temp&0x40; - p.n=temp&0x80; -} -static void bitAbsx16() -{ - uint16_t temp; - addr=absolutex(); - temp=readmemw(addr); - p.z=!(temp&a.w); - p.v=temp&0x4000; - p.n=temp&0x8000; -} - -/*CMP group*/ -static void cmpImm8() -{ - uint8_t temp; - temp=readmem(pbr|pc); pc++; - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static void cmpZp8() -{ - uint8_t temp; - addr=zeropage(); - temp=readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static void cmpZpx8() -{ - uint8_t temp; - addr=zeropagex(); - temp=readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static void cmpSp8() -{ - uint8_t temp; - addr=stack(); - temp=readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static void cmpAbs8() -{ - uint8_t temp; - addr=absolute(); - temp=readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static void cmpAbsx8() -{ - uint8_t temp; - addr=absolutex(); - temp=readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static void cmpAbsy8() -{ - uint8_t temp; - addr=absolutey(); - temp=readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static void cmpLong8() -{ - uint8_t temp; - addr=absolutelong(); - temp=readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static void cmpLongx8() -{ - uint8_t temp; - addr=absolutelongx(); - temp=readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static void cmpIndirect8() -{ - uint8_t temp; - addr=indirect(); - temp=readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static void cmpIndirectx8() -{ - uint8_t temp; - addr=indirectx(); - temp=readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static void cmpIndirecty8() -{ - uint8_t temp; - addr=indirecty(); - temp=readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static void cmpsIndirecty8() -{ - uint8_t temp; - addr=sindirecty(); - temp=readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static void cmpIndirectLong8() -{ - uint8_t temp; - addr=indirectl(); - temp=readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} -static void cmpIndirectLongy8() -{ - uint8_t temp; - addr=indirectly(); - temp=readmem(addr); - setzn8(a.b.l-temp); - p.c=(a.b.l>=temp); -} - -static void cmpImm16() -{ - uint16_t temp; - temp=readmemw(pbr|pc); pc+=2; - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static void cmpZp16() -{ - uint16_t temp; - addr=zeropage(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static void cmpSp16() -{ - uint16_t temp; - addr=stack(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static void cmpZpx16() -{ - uint16_t temp; - addr=zeropagex(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static void cmpAbs16() -{ - uint16_t temp; - addr=absolute(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static void cmpAbsx16() -{ - uint16_t temp; - addr=absolutex(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static void cmpAbsy16() -{ - uint16_t temp; - addr=absolutey(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static void cmpLong16() -{ - uint16_t temp; - addr=absolutelong(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static void cmpLongx16() -{ - uint16_t temp; - addr=absolutelongx(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static void cmpIndirect16() -{ - uint16_t temp; - addr=indirect(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static void cmpIndirectx16() -{ - uint16_t temp; - addr=indirectx(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static void cmpIndirecty16() -{ - uint16_t temp; - addr=indirecty(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static void cmpsIndirecty16() -{ - uint16_t temp; - addr=sindirecty(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static void cmpIndirectLong16() -{ - uint16_t temp; - addr=indirectl(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} -static void cmpIndirectLongy16() -{ - uint16_t temp; - addr=indirectly(); - temp=readmemw(addr); - setzn16(a.w-temp); - p.c=(a.w>=temp); -} - -/*Stack Group*/ -static void phb() -{ - readmem(pbr|pc); - writemem(s.w,dbr>>16); s.w--; -// printf("PHB %04X\n",s.w); -} -static void phbe() -{ - readmem(pbr|pc); - writemem(s.w,dbr>>16); s.b.l--; -} - -static void phk() -{ - readmem(pbr|pc); - writemem(s.w,pbr>>16); s.w--; -// printf("PHK %04X\n",s.w); -} -static void phke() -{ - readmem(pbr|pc); - writemem(s.w,pbr>>16); s.b.l--; -} - -static void pea() -{ - addr=readmemw(pbr|pc); pc+=2; - writemem(s.w,addr>>8); s.w--; - writemem(s.w,addr&0xFF); s.w--; -// printf("PEA %04X\n",s.w); -} - -static void pei() -{ - addr=indirect(); - writemem(s.w,addr>>8); s.w--; - writemem(s.w,addr&0xFF); s.w--; - //printf("PEI %04X\n",s.w); -} - -static void per() -{ - addr=readmemw(pbr|pc); pc+=2; - addr+=pc; - writemem(s.w,addr>>8); s.w--; - writemem(s.w,addr&0xFF); s.w--; - //printf("PER %04X\n",s.w); -} - -static void phd() -{ - writemem(s.w,dp>>8); s.w--; - writemem(s.w,dp&0xFF); s.w--; - //printf("PHD %04X\n",s.w); -} -static void pld() -{ - readmem(pbr|pc); - s.w++; cycles--; clockspc(6); - dp=readmem(s.w); - s.w++; dp|=(readmem(s.w)<<8); - //printf("PLD %04X\n",s.w); -} - -static void pha8() -{ - readmem(pbr|pc); - writemem(s.w,a.b.l); s.w--; - //printf("PHA %04X\n",s.w); -} -static void pha16() -{ - readmem(pbr|pc); - writemem(s.w,a.b.h); s.w--; - writemem(s.w,a.b.l); s.w--; - //printf("PHA %04X\n",s.w); -} - -static void phx8() -{ - readmem(pbr|pc); - writemem(s.w,x.b.l); s.w--; - //printf("PHX %04X\n",s.w); -} -static void phx16() -{ - readmem(pbr|pc); - writemem(s.w,x.b.h); s.w--; - writemem(s.w,x.b.l); s.w--; - //printf("PHX %04X\n",s.w); -} - -static void phy8() -{ - readmem(pbr|pc); - writemem(s.w,y.b.l); s.w--; - //printf("PHY %04X\n",s.w); -} -static void phy16() -{ - readmem(pbr|pc); - writemem(s.w,y.b.h); s.w--; - writemem(s.w,y.b.l); s.w--; - //printf("PHY %04X\n",s.w); -} - -static void pla8() -{ - readmem(pbr|pc); - s.w++; cycles--; clockspc(6); - a.b.l=readmem(s.w); - setzn8(a.b.l); - //printf("PLA %04X\n",s.w); -} -static void pla16() -{ - readmem(pbr|pc); - s.w++; cycles--; clockspc(6); - a.b.l=readmem(s.w); - s.w++; a.b.h=readmem(s.w); - setzn16(a.w); - //printf("PLA %04X\n",s.w); -} - -static void plx8() -{ - readmem(pbr|pc); - s.w++; cycles--; clockspc(6); - x.b.l=readmem(s.w); - setzn8(x.b.l); - //printf("PLX %04X\n",s.w); -} -static void plx16() -{ - readmem(pbr|pc); - s.w++; cycles--; clockspc(6); - x.b.l=readmem(s.w); - s.w++; x.b.h=readmem(s.w); - setzn16(x.w); - //printf("PLX %04X\n",s.w); -} - -static void ply8() -{ - readmem(pbr|pc); - s.w++; cycles--; clockspc(6); - y.b.l=readmem(s.w); - setzn8(y.b.l); - //printf("PLY %04X\n",s.w); -} -static void ply16() -{ - readmem(pbr|pc); - s.w++; cycles--; clockspc(6); - y.b.l=readmem(s.w); - s.w++; y.b.h=readmem(s.w); - setzn16(y.w); - //printf("PLY %04X\n",s.w); -} - -static void plb() -{ - readmem(pbr|pc); - s.w++; cycles--; clockspc(6); - dbr=readmem(s.w)<<16; - //printf("PLB %04X\n",s.w); -} -static void plbe() -{ - readmem(pbr|pc); - s.b.l++; cycles--; clockspc(6); - dbr=readmem(s.w)<<16; -} - -static void plp() -{ - uint8_t temp=readmem(s.w+1); s.w++; - p.c=temp&1; - p.z=temp&2; - p.i=temp&4; - p.d=temp&8; - p.ex=temp&0x10; - p.m=temp&0x20; - p.v=temp&0x40; - p.n=temp&0x80; - cycles-=2; clockspc(12); - updatecpumode(); - //printf("PLP %04X\n",s.w); -} -static void plpe() -{ - uint8_t temp; - s.b.l++; temp=readmem(s.w); - p.c=temp&1; - p.z=temp&2; - p.i=temp&4; - p.d=temp&8; - p.v=temp&0x40; - p.n=temp&0x80; - cycles-=2; clockspc(12); -} - -static void php() -{ - uint8_t temp=(p.c)?1:0; - if (p.z) temp|=2; - if (p.i) temp|=4; - if (p.d) temp|=8; - if (p.v) temp|=0x40; - if (p.n) temp|=0x80; - if (p.ex) temp|=0x10; - if (p.m) temp|=0x20; - readmem(pbr|pc); - writemem(s.w,temp); s.w--; - //printf("PHP %04X\n",s.w); -} -static void phpe() -{ - uint8_t temp=(p.c)?1:0; - if (p.z) temp|=2; - if (p.i) temp|=4; - if (p.d) temp|=8; - if (p.v) temp|=0x40; - if (p.n) temp|=0x80; - temp|=0x30; - readmem(pbr|pc); - writemem(s.w,temp); s.b.l--; -} - -/*CPX group*/ -static void cpxImm8() -{ - uint8_t temp=readmem(pbr|pc); pc++; - setzn8(x.b.l-temp); - p.c=(x.b.l>=temp); -} -static void cpxImm16() -{ - uint16_t temp=readmemw(pbr|pc); pc+=2; - setzn16(x.w-temp); - p.c=(x.w>=temp); -} - -static void cpxZp8() -{ - uint8_t temp; - addr=zeropage(); - temp=readmem(addr); - setzn8(x.b.l-temp); - p.c=(x.b.l>=temp); -} -static void cpxZp16() -{ - uint16_t temp; - addr=zeropage(); - temp=readmemw(addr); - setzn16(x.w-temp); - p.c=(x.w>=temp); -} - -static void cpxAbs8() -{ - uint8_t temp; - addr=absolute(); - temp=readmem(addr); - setzn8(x.b.l-temp); - p.c=(x.b.l>=temp); -} -static void cpxAbs16() -{ - uint16_t temp; - addr=absolute(); - temp=readmemw(addr); - setzn16(x.w-temp); - p.c=(x.w>=temp); -} - -/*CPY group*/ -static void cpyImm8() -{ - uint8_t temp=readmem(pbr|pc); pc++; - setzn8(y.b.l-temp); - p.c=(y.b.l>=temp); -} -static void cpyImm16() -{ - uint16_t temp=readmemw(pbr|pc); pc+=2; - setzn16(y.w-temp); - p.c=(y.w>=temp); -} - -static void cpyZp8() -{ - uint8_t temp; - addr=zeropage(); - temp=readmem(addr); - setzn8(y.b.l-temp); - p.c=(y.b.l>=temp); -} -static void cpyZp16() -{ - uint16_t temp; - addr=zeropage(); - temp=readmemw(addr); - setzn16(y.w-temp); - p.c=(y.w>=temp); -} - -static void cpyAbs8() -{ - uint8_t temp; - addr=absolute(); - temp=readmem(addr); - setzn8(y.b.l-temp); - p.c=(y.b.l>=temp); -} -static void cpyAbs16() -{ - uint16_t temp; - addr=absolute(); - temp=readmemw(addr); - setzn16(y.w-temp); - p.c=(y.w>=temp); -} - -/*Branch group*/ -static void bcc() -{ - int8_t temp=(int8_t)readmem(pbr|pc); pc++; - if (!p.c) - { - pc+=temp; - cycles--; clockspc(6); - } -} -static void bcs() -{ - int8_t temp=(int8_t)readmem(pbr|pc); pc++; - if (p.c) - { - pc+=temp; - cycles--; clockspc(6); - } -} -static void beq() -{ - int8_t temp=(int8_t)readmem(pbr|pc); pc++; -// if (setzf>0) p.z=0; -// if (setzf<0) p.z=1; -// setzf=0; - if (p.z) - { - pc+=temp; - cycles--; clockspc(6); - } -} -static void bne() -{ - int8_t temp=(int8_t)readmem(pbr|pc); pc++; -// if (pc==0x8D44) printf("BNE %i %i ",setzf,p.z); -// if (setzf>0) p.z=1; -// if (setzf<0) p.z=0; -// setzf=0; -// if (pc==0x8D44) printf("%i\n",p.z); -// if (skipz) //printf("skipz "); - if (!p.z)// && !skipz) - { - pc+=temp; - cycles--; clockspc(6); - } -// if (skipz) //printf("%04X\n",pc); -// skipz=0; -} -static void bpl() -{ - int8_t temp=(int8_t)readmem(pbr|pc); pc++; - if (!p.n) - { - pc+=temp; - cycles--; clockspc(6); - } -} -static void bmi() -{ - int8_t temp=(int8_t)readmem(pbr|pc); pc++; - if (p.n) - { - pc+=temp; - cycles--; clockspc(6); - } -} -static void bvc() -{ - int8_t temp=(int8_t)readmem(pbr|pc); pc++; - if (!p.v) - { - pc+=temp; - cycles--; clockspc(6); - } -} -static void bvs() -{ - int8_t temp=(int8_t)readmem(pbr|pc); pc++; - if (p.v) - { - pc+=temp; - cycles--; clockspc(6); - } -} - -static void bra() -{ - int8_t temp=(int8_t)readmem(pbr|pc); pc++; - pc+=temp; - cycles--; clockspc(6); -} -static void brl() -{ - uint16_t temp=readmemw(pbr|pc); pc+=2; - pc+=temp; - cycles--; clockspc(6); -} - -/*Jump group*/ -static void jmp() -{ - addr=readmemw(pbr|pc); - pc=addr; -} - -static void jmplong() -{ - addr=readmemw(pbr|pc)|(readmem((pbr|pc)+2)<<16); - pc=addr&0xFFFF; - pbr=addr&0xFF0000; -} - -static void jmpind() -{ - addr=readmemw(pbr|pc); -// rpclog("Addr %04X\n",addr); - pc=readmemw(addr); -// rpclog("PC %04X\n",addr); -} - -static void jmpindx() -{ - addr=(readmemw(pbr|pc))+x.w+pbr; -// //printf("Read %06X\n",addr); - pc=readmemw(addr); -} - -static void jmlind() -{ - addr=readmemw(pbr|pc); - pc=readmemw(addr); - pbr=readmem(addr+2)<<16; -} - -static void jsr() -{ - addr=readmemw(pbr|pc); pc++; - readmem(pbr|pc); - writemem(s.w,pc>>8); s.w--; - writemem(s.w,pc&0xFF); s.w--; - pc=addr; - //printf("JSR %04X\n",s.w); -} -static void jsre() -{ - addr=readmemw(pbr|pc); pc++; - readmem(pbr|pc); - writemem(s.w,pc>>8); s.b.l--; - writemem(s.w,pc&0xFF); s.b.l--; - pc=addr; -} - -static void jsrIndx() -{ - addr=jindirectx(); pc--; -// //printf("Addr %06X\n",addr); - writemem(s.w,pc>>8); s.w--; - writemem(s.w,pc&0xFF); s.w--; - pc=readmemw(addr); - //printf("JSR %04X\n",s.w); -// //printf("PC %04X\n",pc); -} -static void jsrIndxe() -{ - addr=jindirectx(); pc--; - writemem(s.w,pc>>8); s.b.l--; - writemem(s.w,pc&0xFF); s.b.l--; - pc=readmemw(addr); -} - -static void jsl() -{ - uint8_t temp; - addr=readmemw(pbr|pc); pc+=2; - temp=readmem(pbr|pc); - writemem(s.w,pbr>>16); s.w--; - writemem(s.w,pc>>8); s.w--; - writemem(s.w,pc&0xFF); s.w--; -// rpclog("JSL %06X\n",pbr|pc); - pc=addr; - pbr=temp<<16; - //printf("JSL %04X\n",s.w); -} - -static void jsle() -{ - uint8_t temp; - addr=readmemw(pbr|pc); pc+=2; - temp=readmem(pbr|pc); - writemem(s.w,pbr>>16); s.b.l--; - writemem(s.w,pc>>8); s.b.l--; - writemem(s.w,pc&0xFF); s.b.l--; -// rpclog("JSLe %06X\n",pbr|pc); - pc=addr; - pbr=temp<<16; -} - -static void rtl() -{ - cycles-=3; clockspc(18); - pc=readmemw(s.w+1); s.w+=2; - pbr=readmem(s.w+1)<<16; s.w++; -// rpclog("RTL %06X\n",pbr|pc); - pc++; - //printf("RTL %04X\n",s.w); -} -static void rtle() -{ - cycles-=3; clockspc(18); - s.b.l++; pc=readmem(s.w); - s.b.l++; pc|=(readmem(s.w)<<8); - s.b.l++; pbr=readmem(s.w)<<16; - pc++; -} - -static void rts() -{ - cycles-=3; clockspc(18); - pc=readmemw(s.w+1); s.w+=2; - pc++; - //printf("RTS %04X\n",s.w); -} -static void rtse() -{ - cycles-=3; clockspc(18); - s.b.l++; pc=readmem(s.w); - s.b.l++; pc|=(readmem(s.w)<<8); - pc++; -} - -static void rti() -{ - uint8_t temp; - cycles--; s.w++; clockspc(6); - temp=readmem(s.w); - p.c=temp&1; - p.z=temp&2; - p.i=temp&4; - p.d=temp&8; - p.ex=temp&0x10; - p.m=temp&0x20; - p.v=temp&0x40; - p.n=temp&0x80; - s.w++; pc=readmem(s.w); // //printf("%04X -> %02X\n",s.w,pc); - s.w++; pc|=(readmem(s.w)<<8); // //printf("%04X -> %02X\n",s.w,pc>>8); - s.w++; pbr=readmem(s.w)<<16; ////printf("%04X -> %02X\n",s.w,pbr>>16); - updatecpumode(); -} - -static void rtie() -{ - uint8_t temp; - cycles--; s.b.l++; clockspc(6); - temp=readmem(s.w); - p.c=temp&1; - p.z=temp&2; - p.i=temp&4; - p.d=temp&8; - p.ex=p.m=0; - p.v=temp&0x40; - p.n=temp&0x80; - s.b.l++; pc=readmem(s.w); // //printf("%04X -> %02X\n",s.w,pc); - s.b.l++; pc|=(readmem(s.w)<<8); // //printf("%04X -> %02X\n",s.w,pc>>8); - updatecpumode(); -} - -/*Shift group*/ -static void asla8() -{ - readmem(pbr|pc); - p.c=a.b.l&0x80; - a.b.l<<=1; - setzn8(a.b.l); -} -static void asla16() -{ - readmem(pbr|pc); - p.c=a.w&0x8000; - a.w<<=1; - setzn16(a.w); -} - -static void aslZp8() -{ - uint8_t temp; - addr=zeropage(); - temp=readmem(addr); - cycles--; clockspc(6); - p.c=temp&0x80; - temp<<=1; - setzn8(temp); - writemem(addr,temp); -} -static void aslZp16() -{ - uint16_t temp; - addr=zeropage(); - temp=readmemw(addr); - cycles--; clockspc(6); - p.c=temp&0x8000; - temp<<=1; - setzn16(temp); - writememw(addr,temp); -} - -static void aslZpx8() -{ - uint8_t temp; - addr=zeropagex(); - temp=readmem(addr); - cycles--; clockspc(6); - p.c=temp&0x80; - temp<<=1; - setzn8(temp); - writemem(addr,temp); -} -static void aslZpx16() -{ - uint16_t temp; - addr=zeropagex(); - temp=readmemw(addr); - cycles--; clockspc(6); - p.c=temp&0x8000; - temp<<=1; - setzn16(temp); - writememw(addr,temp); -} - -static void aslAbs8() -{ - uint8_t temp; - addr=absolute(); - temp=readmem(addr); - cycles--; clockspc(6); - p.c=temp&0x80; - temp<<=1; - setzn8(temp); - writemem(addr,temp); -} -static void aslAbs16() -{ - uint16_t temp; - addr=absolute(); - temp=readmemw(addr); - cycles--; clockspc(6); - p.c=temp&0x8000; - temp<<=1; - setzn16(temp); - writememw(addr,temp); -} - -static void aslAbsx8() -{ - uint8_t temp; - addr=absolutex(); - temp=readmem(addr); - cycles--; clockspc(6); - p.c=temp&0x80; - temp<<=1; - setzn8(temp); - writemem(addr,temp); -} -static void aslAbsx16() -{ - uint16_t temp; - addr=absolutex(); - temp=readmemw(addr); - cycles--; clockspc(6); - p.c=temp&0x8000; - temp<<=1; - setzn16(temp); - writememw(addr,temp); -} - -static void lsra8() -{ - readmem(pbr|pc); - p.c=a.b.l&1; - a.b.l>>=1; - setzn8(a.b.l); -} -static void lsra16() -{ - readmem(pbr|pc); - p.c=a.w&1; - a.w>>=1; - setzn16(a.w); -} - -static void lsrZp8() -{ - uint8_t temp; - addr=zeropage(); - temp=readmem(addr); - cycles--; clockspc(6); - p.c=temp&1; - temp>>=1; - setzn8(temp); - writemem(addr,temp); -} -static void lsrZp16() -{ - uint16_t temp; - addr=zeropage(); - temp=readmemw(addr); - cycles--; clockspc(6); - p.c=temp&1; - temp>>=1; - setzn16(temp); - writememw(addr,temp); -} - -static void lsrZpx8() -{ - uint8_t temp; - addr=zeropagex(); - temp=readmem(addr); - cycles--; clockspc(6); - p.c=temp&1; - temp>>=1; - setzn8(temp); - writemem(addr,temp); -} -static void lsrZpx16() -{ - uint16_t temp; - addr=zeropagex(); - temp=readmemw(addr); - cycles--; clockspc(6); - p.c=temp&1; - temp>>=1; - setzn16(temp); - writememw(addr,temp); -} - -static void lsrAbs8() -{ - uint8_t temp; - addr=absolute(); - temp=readmem(addr); - cycles--; clockspc(6); - p.c=temp&1; - temp>>=1; - setzn8(temp); - writemem(addr,temp); -} -static void lsrAbs16() -{ - uint16_t temp; - addr=absolute(); - temp=readmemw(addr); - cycles--; clockspc(6); - p.c=temp&1; - temp>>=1; - setzn16(temp); - writememw(addr,temp); -} - -static void lsrAbsx8() -{ - uint8_t temp; - addr=absolutex(); - temp=readmem(addr); - cycles--; clockspc(6); - p.c=temp&1; - temp>>=1; - setzn8(temp); - writemem(addr,temp); -} -static void lsrAbsx16() -{ - uint16_t temp; - addr=absolutex(); - temp=readmemw(addr); - cycles--; clockspc(6); - p.c=temp&1; - temp>>=1; - setzn16(temp); - writememw(addr,temp); -} - -static void rola8() -{ - readmem(pbr|pc); - addr=p.c; - p.c=a.b.l&0x80; - a.b.l<<=1; - if (addr) a.b.l|=1; - setzn8(a.b.l); -} -static void rola16() -{ - readmem(pbr|pc); - addr=p.c; - p.c=a.w&0x8000; - a.w<<=1; - if (addr) a.w|=1; - setzn16(a.w); -} - -static void rolZp8() -{ - uint8_t temp; - int tempc; - addr=zeropage(); - temp=readmem(addr); - cycles--; clockspc(6); - tempc=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempc) temp|=1; - setzn8(temp); - writemem(addr,temp); -} -static void rolZp16() -{ - uint16_t temp; - int tempc; - addr=zeropage(); - temp=readmemw(addr); - cycles--; clockspc(6); - tempc=p.c; - p.c=temp&0x8000; - temp<<=1; - if (tempc) temp|=1; - setzn16(temp); - writememw(addr,temp); -} - -static void rolZpx8() -{ - uint8_t temp; - int tempc; - addr=zeropagex(); - temp=readmem(addr); - cycles--; clockspc(6); - tempc=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempc) temp|=1; - setzn8(temp); - writemem(addr,temp); -} -static void rolZpx16() -{ - uint16_t temp; - int tempc; - addr=zeropagex(); - temp=readmemw(addr); - cycles--; clockspc(6); - tempc=p.c; - p.c=temp&0x8000; - temp<<=1; - if (tempc) temp|=1; - setzn16(temp); - writememw(addr,temp); -} - -static void rolAbs8() -{ - uint8_t temp; - int tempc; - addr=absolute(); - temp=readmem(addr); - cycles--; clockspc(6); - tempc=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempc) temp|=1; - setzn8(temp); - writemem(addr,temp); -} -static void rolAbs16() -{ - uint16_t temp; - int tempc; - addr=absolute(); - temp=readmemw(addr); - cycles--; clockspc(6); - tempc=p.c; - p.c=temp&0x8000; - temp<<=1; - if (tempc) temp|=1; - setzn16(temp); - writememw(addr,temp); -} - -static void rolAbsx8() -{ - uint8_t temp; - int tempc; - addr=absolutex(); - temp=readmem(addr); - cycles--; clockspc(6); - tempc=p.c; - p.c=temp&0x80; - temp<<=1; - if (tempc) temp|=1; - setzn8(temp); - writemem(addr,temp); -} -static void rolAbsx16() -{ - uint16_t temp; - int tempc; - addr=absolutex(); - temp=readmemw(addr); - cycles--; clockspc(6); - tempc=p.c; - p.c=temp&0x8000; - temp<<=1; - if (tempc) temp|=1; - setzn16(temp); - writememw(addr,temp); -} - -static void rora8() -{ - readmem(pbr|pc); - addr=p.c; - p.c=a.b.l&1; - a.b.l>>=1; - if (addr) a.b.l|=0x80; - setzn8(a.b.l); -} -static void rora16() -{ - readmem(pbr|pc); - addr=p.c; - p.c=a.w&1; - a.w>>=1; - if (addr) a.w|=0x8000; - setzn16(a.w); -} - -static void rorZp8() -{ - uint8_t temp; - int tempc; - addr=zeropage(); - temp=readmem(addr); - cycles--; clockspc(6); - tempc=p.c; - p.c=temp&1; - temp>>=1; - if (tempc) temp|=0x80; - setzn8(temp); - writemem(addr,temp); -} -static void rorZp16() -{ - uint16_t temp; - int tempc; - addr=zeropage(); - temp=readmemw(addr); - cycles--; clockspc(6); - tempc=p.c; - p.c=temp&1; - temp>>=1; - if (tempc) temp|=0x8000; - setzn16(temp); - writememw(addr,temp); -} - -static void rorZpx8() -{ - uint8_t temp; - int tempc; - addr=zeropagex(); - temp=readmem(addr); - cycles--; clockspc(6); - tempc=p.c; - p.c=temp&1; - temp>>=1; - if (tempc) temp|=0x80; - setzn8(temp); - writemem(addr,temp); -} -static void rorZpx16() -{ - uint16_t temp; - int tempc; - addr=zeropagex(); - temp=readmemw(addr); - cycles--; clockspc(6); - tempc=p.c; - p.c=temp&1; - temp>>=1; - if (tempc) temp|=0x8000; - setzn16(temp); - writememw(addr,temp); -} - -static void rorAbs8() -{ - uint8_t temp; - int tempc; - addr=absolute(); - temp=readmem(addr); - cycles--; clockspc(6); - tempc=p.c; - p.c=temp&1; - temp>>=1; - if (tempc) temp|=0x80; - setzn8(temp); - writemem(addr,temp); -} -static void rorAbs16() -{ - uint16_t temp; - int tempc; - addr=absolute(); - temp=readmemw(addr); - cycles--; clockspc(6); - tempc=p.c; - p.c=temp&1; - temp>>=1; - if (tempc) temp|=0x8000; - setzn16(temp); - writememw(addr,temp); -} - -static void rorAbsx8() -{ - uint8_t temp; - int tempc; - addr=absolutex(); - temp=readmem(addr); - cycles--; clockspc(6); - tempc=p.c; - p.c=temp&1; - temp>>=1; - if (tempc) temp|=0x80; - setzn8(temp); - writemem(addr,temp); -} -static void rorAbsx16() -{ - uint16_t temp; - int tempc; - addr=absolutex(); - temp=readmemw(addr); - cycles--; clockspc(6); - tempc=p.c; - p.c=temp&1; - temp>>=1; - if (tempc) temp|=0x8000; - setzn16(temp); - writememw(addr,temp); -} - -/*Misc group*/ -static void xba() -{ - readmem(pbr|pc); - a.w=(a.w>>8)|(a.w<<8); - setzn8(a.b.l); -} -static void nop() -{ - cycles--; clockspc(6); -} - -static void tcd() -{ - readmem(pbr|pc); - dp=a.w; - setzn16(dp); -} - -static void tdc() -{ - readmem(pbr|pc); - a.w=dp; - setzn16(a.w); -} - -static void tcs() -{ - readmem(pbr|pc); - s.w=a.w; -} - -static void tsc() -{ - readmem(pbr|pc); - a.w=s.w; - setzn16(a.w); -} - -static void trbZp8() -{ - uint8_t temp; - addr=zeropage(); - temp=readmem(addr); - p.z=!(a.b.l&temp); - temp&=~a.b.l; - cycles--; clockspc(6); - writemem(addr,temp); -} -static void trbZp16() -{ - uint16_t temp; - addr=zeropage(); - temp=readmemw(addr); - p.z=!(a.w&temp); - temp&=~a.w; - cycles--; clockspc(6); - writememw(addr,temp); -} - -static void trbAbs8() -{ - uint8_t temp; - addr=absolute(); - temp=readmem(addr); - p.z=!(a.b.l&temp); - temp&=~a.b.l; - cycles--; clockspc(6); - writemem(addr,temp); -} -static void trbAbs16() -{ - uint16_t temp; - addr=absolute(); - temp=readmemw(addr); - p.z=!(a.w&temp); - temp&=~a.w; - cycles--; clockspc(6); - writememw(addr,temp); -} - -static void tsbZp8() -{ - uint8_t temp; - addr=zeropage(); - temp=readmem(addr); - p.z=!(a.b.l&temp); - temp|=a.b.l; - cycles--; clockspc(6); - writemem(addr,temp); -} -static void tsbZp16() -{ - uint16_t temp; - addr=zeropage(); - temp=readmemw(addr); - p.z=!(a.w&temp); - temp|=a.w; - cycles--; clockspc(6); - writememw(addr,temp); -} - -static void tsbAbs8() -{ - uint8_t temp; - addr=absolute(); - temp=readmem(addr); - p.z=!(a.b.l&temp); - temp|=a.b.l; - cycles--; clockspc(6); - writemem(addr,temp); -} -static void tsbAbs16() -{ - uint16_t temp; - addr=absolute(); - temp=readmemw(addr); - p.z=!(a.w&temp); - temp|=a.w; - cycles--; clockspc(6); - writememw(addr,temp); -} - -static void wai() -{ - readmem(pbr|pc); - inwai=1; - pc--; -// printf("WAI %06X\n",pbr|pc); -} - -static void mvp() -{ - uint8_t temp; - dbr=(readmem(pbr|pc))<<16; pc++; - addr=(readmem(pbr|pc))<<16; pc++; - temp=readmem(addr|x.w); - writemem(dbr|y.w,temp); - x.w--; - y.w--; - a.w--; - if (a.w!=0xFFFF) pc-=3; - cycles-=2; clockspc(12); -} - -static void mvn() -{ - uint8_t temp; - dbr=(readmem(pbr|pc))<<16; pc++; - addr=(readmem(pbr|pc))<<16; pc++; - temp=readmem(addr|x.w); - writemem(dbr|y.w,temp); - x.w++; - y.w++; - a.w--; - if (a.w!=0xFFFF) pc-=3; - cycles-=2; clockspc(12); -} - -static void op_brk() -{ - uint8_t temp=0; - pc++; - writemem(s.w,pbr>>16); s.w--; - writemem(s.w,pc>>8); s.w--; - writemem(s.w,pc&0xFF); s.w--; - if (p.c) temp|=1; - if (p.z) temp|=2; - if (p.i) temp|=4; - if (p.d) temp|=8; - if (p.ex) temp|=0x10; - if (p.m) temp|=0x20; - if (p.v) temp|=0x40; - if (p.n) temp|=0x80; - writemem(s.w,temp); s.w--; - pc=readmemw(0xFFE6); - pbr=0; - p.i=1; - p.d=0; -} - -static void brke() -{ - uint8_t temp=0; - pc++; - writemem(s.w,pc>>8); s.w--; - writemem(s.w,pc&0xFF); s.w--; - if (p.c) temp|=1; - if (p.z) temp|=2; - if (p.i) temp|=4; - if (p.d) temp|=8; - if (p.v) temp|=0x40; - if (p.n) temp|=0x80; - writemem(s.w,temp|0x30); s.w--; - pc=readmemw(0xFFFE); - pbr=0; - p.i=1; - p.d=0; -} - -static void cop() -{ - uint8_t temp=0; - pc++; - writemem(s.w,pbr>>16); s.w--; - writemem(s.w,pc>>8); s.w--; - writemem(s.w,pc&0xFF); s.w--; - if (p.c) temp|=1; - if (p.z) temp|=2; - if (p.i) temp|=4; - if (p.d) temp|=8; - if (p.ex) temp|=0x10; - if (p.m) temp|=0x20; - if (p.v) temp|=0x40; - if (p.n) temp|=0x80; - writemem(s.w,temp); s.w--; - pc=readmemw(0xFFE4); - pbr=0; - p.i=1; - p.d=0; -} - -static void cope() -{ - uint8_t temp=0; - pc++; - writemem(s.w,pc>>8); s.w--; - writemem(s.w,pc&0xFF); s.w--; - if (p.c) temp|=1; - if (p.z) temp|=2; - if (p.i) temp|=4; - if (p.d) temp|=8; - if (p.v) temp|=0x40; - if (p.n) temp|=0x80; - writemem(s.w,temp); s.w--; - pc=readmemw(0xFFF4); - pbr=0; - p.i=1; - p.d=0; -} - -static void wdm() -{ - readmem(pc); pc++; -} - -static void stp() /*No point emulating this properly as the external support circuitry isn't there*/ -{ - pc--; - cycles-=600; -} - -/*Functions*/ -void w65816_reset() -{ - def=1; - if (def || (banking&4)) w65816mask=0xFFFF; - else w65816mask=0x7FFFF; -// tuberomin=1; - pbr=dbr=0; - s.w=0x1FF; - cpumode=4; - p.e=1; - p.i=1; - pc=readmemw(0xFFFC); - a.w=x.w=y.w=0; - p.ex=p.m=1; - cycles=0; - //skipz=0; -// printf("Reset to %04X\n",pc); -// exit(-1); -} - -/*static void w65816_dumpregs() -{ - int c; - FILE *f=fopen("65816.dmp","wb"); - - for (c=0;c<65536;c++) putc(readmem(c),f); - fclose(f); - printf("65816 regs :\n"); - printf("A=%04X X=%04X Y=%04X S=%04X\n",a.w,x.w,y.w,s.w); - printf("PC=%06X DBR=%02X DP=%04X\n",pc|pbr,dbr>>24,dp); - printf("%c %c %c %i %i\n",(p.e)?'E':' ',(p.ex)?'X':' ',(p.m)?'M':' ',cpumode,wins); - //printf("89272=%02X\n",readmem(0x89272)); -}*/ - -static void badopcode() -{ -// FILE *f=fopen("rom.dmp","wb"); -// printf("Bad opcode %02X\n",opcode); -// pc--; -// dumpregs65816(); - //printf("%02X %06X\n",readmem(0x3F8A82),rom[((0x3F8A82>>16)*0x8000)+(((0x3F8A82>>12)&3)*0x2000)+(0x3F8A82&0x1FFF)]); -// fwrite(rom,2048*1024,1,f); -// fclose(f); -// exit(-1); -} - -static void makeopcodetable65816() -{ - int c,d; - for (c=0;c<256;c++) - { - for (d=0;d<5;d++) - { - opcodes[c][d]=badopcode; - } - } - /*LDA group*/ - opcodes[0xA9][0]=opcodes[0xA9][2]=opcodes[0xA9][4]=ldaImm8; - opcodes[0xA9][1]=opcodes[0xA9][3]=ldaImm16; - opcodes[0xA5][0]=opcodes[0xA5][2]=opcodes[0xA5][4]=ldaZp8; - opcodes[0xA5][1]=opcodes[0xA5][3]=ldaZp16; - opcodes[0xB5][0]=opcodes[0xB5][2]=opcodes[0xB5][4]=ldaZpx8; - opcodes[0xB5][1]=opcodes[0xB5][3]=ldaZpx16; - opcodes[0xA3][0]=opcodes[0xA3][2]=opcodes[0xA3][4]=ldaSp8; - opcodes[0xA3][1]=opcodes[0xA3][3]=ldaSp16; - opcodes[0xB3][0]=opcodes[0xB3][2]=opcodes[0xB3][4]=ldaSIndirecty8; - opcodes[0xB3][1]=opcodes[0xB3][3]=ldaSIndirecty16; - opcodes[0xAD][0]=opcodes[0xAD][2]=opcodes[0xAD][4]=ldaAbs8; - opcodes[0xAD][1]=opcodes[0xAD][3]=ldaAbs16; - opcodes[0xBD][0]=opcodes[0xBD][2]=opcodes[0xBD][4]=ldaAbsx8; - opcodes[0xBD][1]=opcodes[0xBD][3]=ldaAbsx16; - opcodes[0xB9][0]=opcodes[0xB9][2]=opcodes[0xB9][4]=ldaAbsy8; - opcodes[0xB9][1]=opcodes[0xB9][3]=ldaAbsy16; - opcodes[0xAF][0]=opcodes[0xAF][2]=opcodes[0xAF][4]=ldaLong8; - opcodes[0xAF][1]=opcodes[0xAF][3]=ldaLong16; - opcodes[0xBF][0]=opcodes[0xBF][2]=opcodes[0xBF][4]=ldaLongx8; - opcodes[0xBF][1]=opcodes[0xBF][3]=ldaLongx16; - opcodes[0xB2][0]=opcodes[0xB2][2]=opcodes[0xB2][4]=ldaIndirect8; - opcodes[0xB2][1]=opcodes[0xB2][3]=ldaIndirect16; - opcodes[0xA1][0]=opcodes[0xA1][2]=opcodes[0xA1][4]=ldaIndirectx8; - opcodes[0xA1][1]=opcodes[0xA1][3]=ldaIndirectx16; - opcodes[0xB1][0]=opcodes[0xB1][2]=opcodes[0xB1][4]=ldaIndirecty8; - opcodes[0xB1][1]=opcodes[0xB1][3]=ldaIndirecty16; - opcodes[0xA7][0]=opcodes[0xA7][2]=opcodes[0xA7][4]=ldaIndirectLong8; - opcodes[0xA7][1]=opcodes[0xA7][3]=ldaIndirectLong16; - opcodes[0xB7][0]=opcodes[0xB7][2]=opcodes[0xB7][4]=ldaIndirectLongy8; - opcodes[0xB7][1]=opcodes[0xB7][3]=ldaIndirectLongy16; - /*LDX group*/ - opcodes[0xA2][0]=opcodes[0xA2][1]=opcodes[0xA2][4]=ldxImm8; - opcodes[0xA2][2]=opcodes[0xA2][3]=ldxImm16; - opcodes[0xA6][0]=opcodes[0xA6][1]=opcodes[0xA6][4]=ldxZp8; - opcodes[0xA6][2]=opcodes[0xA6][3]=ldxZp16; - opcodes[0xB6][0]=opcodes[0xB6][1]=opcodes[0xB6][4]=ldxZpy8; - opcodes[0xB6][2]=opcodes[0xB6][3]=ldxZpy16; - opcodes[0xAE][0]=opcodes[0xAE][1]=opcodes[0xAE][4]=ldxAbs8; - opcodes[0xAE][2]=opcodes[0xAE][3]=ldxAbs16; - opcodes[0xBE][0]=opcodes[0xBE][1]=opcodes[0xBE][4]=ldxAbsy8; - opcodes[0xBE][2]=opcodes[0xBE][3]=ldxAbsy16; - /*LDY group*/ - opcodes[0xA0][0]=opcodes[0xA0][1]=opcodes[0xA0][4]=ldyImm8; - opcodes[0xA0][2]=opcodes[0xA0][3]=ldyImm16; - opcodes[0xA4][0]=opcodes[0xA4][1]=opcodes[0xA4][4]=ldyZp8; - opcodes[0xA4][2]=opcodes[0xA4][3]=ldyZp16; - opcodes[0xB4][0]=opcodes[0xB4][1]=opcodes[0xB4][4]=ldyZpx8; - opcodes[0xB4][2]=opcodes[0xB4][3]=ldyZpx16; - opcodes[0xAC][0]=opcodes[0xAC][1]=opcodes[0xAC][4]=ldyAbs8; - opcodes[0xAC][2]=opcodes[0xAC][3]=ldyAbs16; - opcodes[0xBC][0]=opcodes[0xBC][1]=opcodes[0xBC][4]=ldyAbsx8; - opcodes[0xBC][2]=opcodes[0xBC][3]=ldyAbsx16; - - /*STA group*/ - opcodes[0x85][0]=opcodes[0x85][2]=opcodes[0x85][4]=staZp8; - opcodes[0x85][1]=opcodes[0x85][3]=staZp16; - opcodes[0x95][0]=opcodes[0x95][2]=opcodes[0x95][4]=staZpx8; - opcodes[0x95][1]=opcodes[0x95][3]=staZpx16; - opcodes[0x8D][0]=opcodes[0x8D][2]=opcodes[0x8D][4]=staAbs8; - opcodes[0x8D][1]=opcodes[0x8D][3]=staAbs16; - opcodes[0x9D][0]=opcodes[0x9D][2]=opcodes[0x9D][4]=staAbsx8; - opcodes[0x9D][1]=opcodes[0x9D][3]=staAbsx16; - opcodes[0x99][0]=opcodes[0x99][2]=opcodes[0x99][4]=staAbsy8; - opcodes[0x99][1]=opcodes[0x99][3]=staAbsy16; - opcodes[0x8F][0]=opcodes[0x8F][2]=opcodes[0x8F][4]=staLong8; - opcodes[0x8F][1]=opcodes[0x8F][3]=staLong16; - opcodes[0x9F][0]=opcodes[0x9F][2]=opcodes[0x9F][4]=staLongx8; - opcodes[0x9F][1]=opcodes[0x9F][3]=staLongx16; - opcodes[0x92][0]=opcodes[0x92][2]=opcodes[0x92][4]=staIndirect8; - opcodes[0x92][1]=opcodes[0x92][3]=staIndirect16; - opcodes[0x81][0]=opcodes[0x81][2]=opcodes[0x81][4]=staIndirectx8; - opcodes[0x81][1]=opcodes[0x81][3]=staIndirectx16; - opcodes[0x91][0]=opcodes[0x91][2]=opcodes[0x91][4]=staIndirecty8; - opcodes[0x91][1]=opcodes[0x91][3]=staIndirecty16; - opcodes[0x87][0]=opcodes[0x87][2]=opcodes[0x87][4]=staIndirectLong8; - opcodes[0x87][1]=opcodes[0x87][3]=staIndirectLong16; - opcodes[0x97][0]=opcodes[0x97][2]=opcodes[0x97][4]=staIndirectLongy8; - opcodes[0x97][1]=opcodes[0x97][3]=staIndirectLongy16; - opcodes[0x83][0]=opcodes[0x83][2]=opcodes[0x83][4]=staSp8; - opcodes[0x83][1]=opcodes[0x83][3]=staSp16; - opcodes[0x93][0]=opcodes[0x93][2]=opcodes[0x93][4]=staSIndirecty8; - opcodes[0x93][1]=opcodes[0x93][3]=staSIndirecty16; - /*STX group*/ - opcodes[0x86][0]=opcodes[0x86][1]=opcodes[0x86][4]=stxZp8; - opcodes[0x86][2]=opcodes[0x86][3]=stxZp16; - opcodes[0x96][0]=opcodes[0x96][1]=opcodes[0x96][4]=stxZpy8; - opcodes[0x96][2]=opcodes[0x96][3]=stxZpy16; - opcodes[0x8E][0]=opcodes[0x8E][1]=opcodes[0x8E][4]=stxAbs8; - opcodes[0x8E][2]=opcodes[0x8E][3]=stxAbs16; - /*STY group*/ - opcodes[0x84][0]=opcodes[0x84][1]=opcodes[0x84][4]=styZp8; - opcodes[0x84][2]=opcodes[0x84][3]=styZp16; - opcodes[0x94][0]=opcodes[0x94][1]=opcodes[0x94][4]=styZpx8; - opcodes[0x94][2]=opcodes[0x94][3]=styZpx16; - opcodes[0x8C][0]=opcodes[0x8C][1]=opcodes[0x8C][4]=styAbs8; - opcodes[0x8C][2]=opcodes[0x8C][3]=styAbs16; - /*STZ group*/ - opcodes[0x64][0]=opcodes[0x64][2]=opcodes[0x64][4]=stzZp8; - opcodes[0x64][1]=opcodes[0x64][3]=stzZp16; - opcodes[0x74][0]=opcodes[0x74][2]=opcodes[0x74][4]=stzZpx8; - opcodes[0x74][1]=opcodes[0x74][3]=stzZpx16; - opcodes[0x9C][0]=opcodes[0x9C][2]=opcodes[0x9C][4]=stzAbs8; - opcodes[0x9C][1]=opcodes[0x9C][3]=stzAbs16; - opcodes[0x9E][0]=opcodes[0x9E][2]=opcodes[0x9E][4]=stzAbsx8; - opcodes[0x9E][1]=opcodes[0x9E][3]=stzAbsx16; - - opcodes[0x3A][0]=opcodes[0x3A][2]=opcodes[0x3A][4]=deca8; - opcodes[0x3A][1]=opcodes[0x3A][3]=deca16; - opcodes[0xCA][0]=opcodes[0xCA][1]=opcodes[0xCA][4]=dex8; - opcodes[0xCA][2]=opcodes[0xCA][3]=dex16; - opcodes[0x88][0]=opcodes[0x88][1]=opcodes[0x88][4]=dey8; - opcodes[0x88][2]=opcodes[0x88][3]=dey16; - opcodes[0x1A][0]=opcodes[0x1A][2]=opcodes[0x1A][4]=inca8; - opcodes[0x1A][1]=opcodes[0x1A][3]=inca16; - opcodes[0xE8][0]=opcodes[0xE8][1]=opcodes[0xE8][4]=inx8; - opcodes[0xE8][2]=opcodes[0xE8][3]=inx16; - opcodes[0xC8][0]=opcodes[0xC8][1]=opcodes[0xC8][4]=iny8; - opcodes[0xC8][2]=opcodes[0xC8][3]=iny16; - - /*INC group*/ - opcodes[0xE6][0]=opcodes[0xE6][2]=opcodes[0xE6][4]=incZp8; - opcodes[0xE6][1]=opcodes[0xE6][3]=incZp16; - opcodes[0xF6][0]=opcodes[0xF6][2]=opcodes[0xF6][4]=incZpx8; - opcodes[0xF6][1]=opcodes[0xF6][3]=incZpx16; - opcodes[0xEE][0]=opcodes[0xEE][2]=opcodes[0xEE][4]=incAbs8; - opcodes[0xEE][1]=opcodes[0xEE][3]=incAbs16; - opcodes[0xFE][0]=opcodes[0xFE][2]=opcodes[0xFE][4]=incAbsx8; - opcodes[0xFE][1]=opcodes[0xFE][3]=incAbsx16; - - /*DEC group*/ - opcodes[0xC6][0]=opcodes[0xC6][2]=opcodes[0xC6][4]=decZp8; - opcodes[0xC6][1]=opcodes[0xC6][3]=decZp16; - opcodes[0xD6][0]=opcodes[0xD6][2]=opcodes[0xD6][4]=decZpx8; - opcodes[0xD6][1]=opcodes[0xD6][3]=decZpx16; - opcodes[0xCE][0]=opcodes[0xCE][2]=opcodes[0xCE][4]=decAbs8; - opcodes[0xCE][1]=opcodes[0xCE][3]=decAbs16; - opcodes[0xDE][0]=opcodes[0xDE][2]=opcodes[0xDE][4]=decAbsx8; - opcodes[0xDE][1]=opcodes[0xDE][3]=decAbsx16; - - /*AND group*/ - opcodes[0x29][0]=opcodes[0x29][2]=opcodes[0x29][4]=andImm8; - opcodes[0x29][1]=opcodes[0x29][3]=andImm16; - opcodes[0x25][0]=opcodes[0x25][2]=opcodes[0x25][4]=andZp8; - opcodes[0x25][1]=opcodes[0x25][3]=andZp16; - opcodes[0x35][0]=opcodes[0x35][2]=opcodes[0x35][4]=andZpx8; - opcodes[0x35][1]=opcodes[0x35][3]=andZpx16; - opcodes[0x23][0]=opcodes[0x23][2]=opcodes[0x23][4]=andSp8; - opcodes[0x23][1]=opcodes[0x23][3]=andSp16; - opcodes[0x2D][0]=opcodes[0x2D][2]=opcodes[0x2D][4]=andAbs8; - opcodes[0x2D][1]=opcodes[0x2D][3]=andAbs16; - opcodes[0x3D][0]=opcodes[0x3D][2]=opcodes[0x3D][4]=andAbsx8; - opcodes[0x3D][1]=opcodes[0x3D][3]=andAbsx16; - opcodes[0x39][0]=opcodes[0x39][2]=opcodes[0x39][4]=andAbsy8; - opcodes[0x39][1]=opcodes[0x39][3]=andAbsy16; - opcodes[0x2F][0]=opcodes[0x2F][2]=opcodes[0x2F][4]=andLong8; - opcodes[0x2F][1]=opcodes[0x2F][3]=andLong16; - opcodes[0x3F][0]=opcodes[0x3F][2]=opcodes[0x3F][4]=andLongx8; - opcodes[0x3F][1]=opcodes[0x3F][3]=andLongx16; - opcodes[0x32][0]=opcodes[0x32][2]=opcodes[0x32][4]=andIndirect8; - opcodes[0x32][1]=opcodes[0x32][3]=andIndirect16; - opcodes[0x21][0]=opcodes[0x21][2]=opcodes[0x21][4]=andIndirectx8; - opcodes[0x21][1]=opcodes[0x21][3]=andIndirectx16; - opcodes[0x31][0]=opcodes[0x31][2]=opcodes[0x31][4]=andIndirecty8; - opcodes[0x31][1]=opcodes[0x31][3]=andIndirecty16; - opcodes[0x33][0]=opcodes[0x33][2]=opcodes[0x33][4]=andsIndirecty8; - opcodes[0x33][1]=opcodes[0x33][3]=andsIndirecty16; - opcodes[0x27][0]=opcodes[0x27][2]=opcodes[0x27][4]=andIndirectLong8; - opcodes[0x27][1]=opcodes[0x27][3]=andIndirectLong16; - opcodes[0x37][0]=opcodes[0x37][2]=opcodes[0x37][4]=andIndirectLongy8; - opcodes[0x37][1]=opcodes[0x37][3]=andIndirectLongy16; - - /*EOR group*/ - opcodes[0x49][0]=opcodes[0x49][2]=opcodes[0x49][4]=eorImm8; - opcodes[0x49][1]=opcodes[0x49][3]=eorImm16; - opcodes[0x45][0]=opcodes[0x45][2]=opcodes[0x45][4]=eorZp8; - opcodes[0x45][1]=opcodes[0x45][3]=eorZp16; - opcodes[0x55][0]=opcodes[0x55][2]=opcodes[0x55][4]=eorZpx8; - opcodes[0x55][1]=opcodes[0x55][3]=eorZpx16; - opcodes[0x43][0]=opcodes[0x43][2]=opcodes[0x43][4]=eorSp8; - opcodes[0x43][1]=opcodes[0x43][3]=eorSp16; - opcodes[0x4D][0]=opcodes[0x4D][2]=opcodes[0x4D][4]=eorAbs8; - opcodes[0x4D][1]=opcodes[0x4D][3]=eorAbs16; - opcodes[0x5D][0]=opcodes[0x5D][2]=opcodes[0x5D][4]=eorAbsx8; - opcodes[0x5D][1]=opcodes[0x5D][3]=eorAbsx16; - opcodes[0x59][0]=opcodes[0x59][2]=opcodes[0x59][4]=eorAbsy8; - opcodes[0x59][1]=opcodes[0x59][3]=eorAbsy16; - opcodes[0x4F][0]=opcodes[0x4F][2]=opcodes[0x4F][4]=eorLong8; - opcodes[0x4F][1]=opcodes[0x4F][3]=eorLong16; - opcodes[0x5F][0]=opcodes[0x5F][2]=opcodes[0x5F][4]=eorLongx8; - opcodes[0x5F][1]=opcodes[0x5F][3]=eorLongx16; - opcodes[0x52][0]=opcodes[0x52][2]=opcodes[0x52][4]=eorIndirect8; - opcodes[0x52][1]=opcodes[0x52][3]=eorIndirect16; - opcodes[0x41][0]=opcodes[0x41][2]=opcodes[0x41][4]=eorIndirectx8; - opcodes[0x41][1]=opcodes[0x41][3]=eorIndirectx16; - opcodes[0x51][0]=opcodes[0x51][2]=opcodes[0x51][4]=eorIndirecty8; - opcodes[0x51][1]=opcodes[0x51][3]=eorIndirecty16; - opcodes[0x53][0]=opcodes[0x53][2]=opcodes[0x53][4]=eorsIndirecty8; - opcodes[0x53][1]=opcodes[0x53][3]=eorsIndirecty16; - opcodes[0x47][0]=opcodes[0x47][2]=opcodes[0x47][4]=eorIndirectLong8; - opcodes[0x47][1]=opcodes[0x47][3]=eorIndirectLong16; - opcodes[0x57][0]=opcodes[0x57][2]=opcodes[0x57][4]=eorIndirectLongy8; - opcodes[0x57][1]=opcodes[0x57][3]=eorIndirectLongy16; - - /*ORA group*/ - opcodes[0x09][0]=opcodes[0x09][2]=opcodes[0x09][4]=oraImm8; - opcodes[0x09][1]=opcodes[0x09][3]=oraImm16; - opcodes[0x05][0]=opcodes[0x05][2]=opcodes[0x05][4]=oraZp8; - opcodes[0x05][1]=opcodes[0x05][3]=oraZp16; - opcodes[0x15][0]=opcodes[0x15][2]=opcodes[0x15][4]=oraZpx8; - opcodes[0x15][1]=opcodes[0x15][3]=oraZpx16; - opcodes[0x03][0]=opcodes[0x03][2]=opcodes[0x03][4]=oraSp8; - opcodes[0x03][1]=opcodes[0x03][3]=oraSp16; - opcodes[0x0D][0]=opcodes[0x0D][2]=opcodes[0x0D][4]=oraAbs8; - opcodes[0x0D][1]=opcodes[0x0D][3]=oraAbs16; - opcodes[0x1D][0]=opcodes[0x1D][2]=opcodes[0x1D][4]=oraAbsx8; - opcodes[0x1D][1]=opcodes[0x1D][3]=oraAbsx16; - opcodes[0x19][0]=opcodes[0x19][2]=opcodes[0x19][4]=oraAbsy8; - opcodes[0x19][1]=opcodes[0x19][3]=oraAbsy16; - opcodes[0x0F][0]=opcodes[0x0F][2]=opcodes[0x0F][4]=oraLong8; - opcodes[0x0F][1]=opcodes[0x0F][3]=oraLong16; - opcodes[0x1F][0]=opcodes[0x1F][2]=opcodes[0x1F][4]=oraLongx8; - opcodes[0x1F][1]=opcodes[0x1F][3]=oraLongx16; - opcodes[0x12][0]=opcodes[0x12][2]=opcodes[0x12][4]=oraIndirect8; - opcodes[0x12][1]=opcodes[0x12][3]=oraIndirect16; - opcodes[0x01][0]=opcodes[0x01][2]=opcodes[0x01][4]=oraIndirectx8; - opcodes[0x01][1]=opcodes[0x01][3]=oraIndirectx16; - opcodes[0x11][0]=opcodes[0x11][2]=opcodes[0x11][4]=oraIndirecty8; - opcodes[0x11][1]=opcodes[0x11][3]=oraIndirecty16; - opcodes[0x13][0]=opcodes[0x13][2]=opcodes[0x13][4]=orasIndirecty8; - opcodes[0x13][1]=opcodes[0x13][3]=orasIndirecty16; - opcodes[0x07][0]=opcodes[0x07][2]=opcodes[0x07][4]=oraIndirectLong8; - opcodes[0x07][1]=opcodes[0x07][3]=oraIndirectLong16; - opcodes[0x17][0]=opcodes[0x17][2]=opcodes[0x17][4]=oraIndirectLongy8; - opcodes[0x17][1]=opcodes[0x17][3]=oraIndirectLongy16; - - /*ADC group*/ - opcodes[0x69][0]=opcodes[0x69][2]=opcodes[0x69][4]=adcImm8; - opcodes[0x69][1]=opcodes[0x69][3]=adcImm16; - opcodes[0x65][0]=opcodes[0x65][2]=opcodes[0x65][4]=adcZp8; - opcodes[0x65][1]=opcodes[0x65][3]=adcZp16; - opcodes[0x75][0]=opcodes[0x75][2]=opcodes[0x75][4]=adcZpx8; - opcodes[0x75][1]=opcodes[0x75][3]=adcZpx16; - opcodes[0x63][0]=opcodes[0x63][2]=opcodes[0x63][4]=adcSp8; - opcodes[0x63][1]=opcodes[0x63][3]=adcSp16; - opcodes[0x6D][0]=opcodes[0x6D][2]=opcodes[0x6D][4]=adcAbs8; - opcodes[0x6D][1]=opcodes[0x6D][3]=adcAbs16; - opcodes[0x7D][0]=opcodes[0x7D][2]=opcodes[0x7D][4]=adcAbsx8; - opcodes[0x7D][1]=opcodes[0x7D][3]=adcAbsx16; - opcodes[0x79][0]=opcodes[0x79][2]=opcodes[0x79][4]=adcAbsy8; - opcodes[0x79][1]=opcodes[0x79][3]=adcAbsy16; - opcodes[0x6F][0]=opcodes[0x6F][2]=opcodes[0x6F][4]=adcLong8; - opcodes[0x6F][1]=opcodes[0x6F][3]=adcLong16; - opcodes[0x7F][0]=opcodes[0x7F][2]=opcodes[0x7F][4]=adcLongx8; - opcodes[0x7F][1]=opcodes[0x7F][3]=adcLongx16; - opcodes[0x72][0]=opcodes[0x72][2]=opcodes[0x72][4]=adcIndirect8; - opcodes[0x72][1]=opcodes[0x72][3]=adcIndirect16; - opcodes[0x61][0]=opcodes[0x61][2]=opcodes[0x61][4]=adcIndirectx8; - opcodes[0x61][1]=opcodes[0x61][3]=adcIndirectx16; - opcodes[0x71][0]=opcodes[0x71][2]=opcodes[0x71][4]=adcIndirecty8; - opcodes[0x71][1]=opcodes[0x71][3]=adcIndirecty16; - opcodes[0x73][0]=opcodes[0x73][2]=opcodes[0x73][4]=adcsIndirecty8; - opcodes[0x73][1]=opcodes[0x73][3]=adcsIndirecty16; - opcodes[0x67][0]=opcodes[0x67][2]=opcodes[0x67][4]=adcIndirectLong8; - opcodes[0x67][1]=opcodes[0x67][3]=adcIndirectLong16; - opcodes[0x77][0]=opcodes[0x77][2]=opcodes[0x77][4]=adcIndirectLongy8; - opcodes[0x77][1]=opcodes[0x77][3]=adcIndirectLongy16; - - /*SBC group*/ - opcodes[0xE9][0]=opcodes[0xE9][2]=opcodes[0xE9][4]=sbcImm8; - opcodes[0xE9][1]=opcodes[0xE9][3]=sbcImm16; - opcodes[0xE5][0]=opcodes[0xE5][2]=opcodes[0xE5][4]=sbcZp8; - opcodes[0xE5][1]=opcodes[0xE5][3]=sbcZp16; - opcodes[0xE3][0]=opcodes[0xE3][2]=opcodes[0xE3][4]=sbcSp8; - opcodes[0xE3][1]=opcodes[0xE3][3]=sbcSp16; - opcodes[0xF5][0]=opcodes[0xF5][2]=opcodes[0xF5][4]=sbcZpx8; - opcodes[0xF5][1]=opcodes[0xF5][3]=sbcZpx16; - opcodes[0xED][0]=opcodes[0xED][2]=opcodes[0xED][4]=sbcAbs8; - opcodes[0xED][1]=opcodes[0xED][3]=sbcAbs16; - opcodes[0xFD][0]=opcodes[0xFD][2]=opcodes[0xFD][4]=sbcAbsx8; - opcodes[0xFD][1]=opcodes[0xFD][3]=sbcAbsx16; - opcodes[0xF9][0]=opcodes[0xF9][2]=opcodes[0xF9][4]=sbcAbsy8; - opcodes[0xF9][1]=opcodes[0xF9][3]=sbcAbsy16; - opcodes[0xEF][0]=opcodes[0xEF][2]=opcodes[0xEF][4]=sbcLong8; - opcodes[0xEF][1]=opcodes[0xEF][3]=sbcLong16; - opcodes[0xFF][0]=opcodes[0xFF][2]=opcodes[0xFF][4]=sbcLongx8; - opcodes[0xFF][1]=opcodes[0xFF][3]=sbcLongx16; - opcodes[0xF2][0]=opcodes[0xF2][2]=opcodes[0xF2][4]=sbcIndirect8; - opcodes[0xF2][1]=opcodes[0xF2][3]=sbcIndirect16; - opcodes[0xE1][0]=opcodes[0xE1][2]=opcodes[0xE1][4]=sbcIndirectx8; - opcodes[0xE1][1]=opcodes[0xE1][3]=sbcIndirectx16; - opcodes[0xF1][0]=opcodes[0xF1][2]=opcodes[0xF1][4]=sbcIndirecty8; - opcodes[0xF1][1]=opcodes[0xF1][3]=sbcIndirecty16; - opcodes[0xF3][0]=opcodes[0xF3][2]=opcodes[0xF3][4]=sbcsIndirecty8; - opcodes[0xF3][1]=opcodes[0xF3][3]=sbcsIndirecty16; - opcodes[0xE7][0]=opcodes[0xE7][2]=opcodes[0xE7][4]=sbcIndirectLong8; - opcodes[0xE7][1]=opcodes[0xE7][3]=sbcIndirectLong16; - opcodes[0xF7][0]=opcodes[0xF7][2]=opcodes[0xF7][4]=sbcIndirectLongy8; - opcodes[0xF7][1]=opcodes[0xF7][3]=sbcIndirectLongy16; - - /*Transfer group*/ - opcodes[0xAA][0]=opcodes[0xAA][1]=opcodes[0xAA][4]=tax8; - opcodes[0xAA][2]=opcodes[0xAA][3]=tax16; - opcodes[0xA8][0]=opcodes[0xA8][1]=opcodes[0xA8][4]=tay8; - opcodes[0xA8][2]=opcodes[0xA8][3]=tay16; - opcodes[0x8A][0]=opcodes[0x8A][2]=opcodes[0x8A][4]=txa8; - opcodes[0x8A][1]=opcodes[0x8A][3]=txa16; - opcodes[0x98][0]=opcodes[0x98][2]=opcodes[0x98][4]=tya8; - opcodes[0x98][1]=opcodes[0x98][3]=tya16; - opcodes[0x9B][0]=opcodes[0x9B][1]=opcodes[0x9B][4]=txy8; - opcodes[0x9B][2]=opcodes[0x9B][3]=txy16; - opcodes[0xBB][0]=opcodes[0xBB][1]=opcodes[0xBB][4]=tyx8; - opcodes[0xBB][2]=opcodes[0xBB][3]=tyx16; - opcodes[0xBA][0]=opcodes[0xBA][1]=opcodes[0xBA][4]=tsx8; - opcodes[0xBA][2]=opcodes[0xBA][3]=tsx16; - opcodes[0x9A][0]=opcodes[0x9A][1]=opcodes[0x9A][4]=txs8; - opcodes[0x9A][2]=opcodes[0x9A][3]=txs16; - - /*Flag Group*/ - opcodes[0x18][0]=opcodes[0x18][1]=opcodes[0x18][2]= - opcodes[0x18][3]=opcodes[0x18][4]=clc; - opcodes[0xD8][0]=opcodes[0xD8][1]=opcodes[0xD8][2]= - opcodes[0xD8][3]=opcodes[0xD8][4]=cld; - opcodes[0x58][0]=opcodes[0x58][1]=opcodes[0x58][2]= - opcodes[0x58][3]=opcodes[0x58][4]=cli; - opcodes[0xB8][0]=opcodes[0xB8][1]=opcodes[0xB8][2]= - opcodes[0xB8][3]=opcodes[0xB8][4]=clv; - opcodes[0x38][0]=opcodes[0x38][1]=opcodes[0x38][2]= - opcodes[0x38][3]=opcodes[0x38][4]=sec; - opcodes[0xF8][0]=opcodes[0xF8][1]=opcodes[0xF8][2]= - opcodes[0xF8][3]=opcodes[0xF8][4]=sed; - opcodes[0x78][0]=opcodes[0x78][1]=opcodes[0x78][2]= - opcodes[0x78][3]=opcodes[0x78][4]=sei; - opcodes[0xFB][0]=opcodes[0xFB][1]=opcodes[0xFB][2]= - opcodes[0xFB][3]=opcodes[0xFB][4]=xce; - opcodes[0xE2][0]=opcodes[0xE2][1]=opcodes[0xE2][2]= - opcodes[0xE2][3]=opcodes[0xE2][4]=sep; - opcodes[0xC2][0]=opcodes[0xC2][1]=opcodes[0xC2][2]= - opcodes[0xC2][3]=opcodes[0xC2][4]=rep65816; - - /*Stack group*/ - opcodes[0x8B][0]=opcodes[0x8B][1]=opcodes[0x8B][2]= - opcodes[0x8B][3]=phb; - opcodes[0x8B][4]=phbe; - opcodes[0x4B][0]=opcodes[0x4B][1]=opcodes[0x4B][2]= - opcodes[0x4B][3]=phk; - opcodes[0x4B][4]=phke; - opcodes[0xAB][0]=opcodes[0xAB][1]=opcodes[0xAB][2]= - opcodes[0xAB][3]=plb; - opcodes[0xAB][4]=plbe; - opcodes[0x08][0]=opcodes[0x08][1]=opcodes[0x08][2]= - opcodes[0x08][3]=php; - opcodes[0x08][4]=phpe; - opcodes[0x28][0]=opcodes[0x28][1]=opcodes[0x28][2]= - opcodes[0x28][3]=plp; - opcodes[0x28][4]=plpe; - opcodes[0x48][0]=opcodes[0x48][2]=opcodes[0x48][4]=pha8; - opcodes[0x48][1]=opcodes[0x48][3]=pha16; - opcodes[0xDA][0]=opcodes[0xDA][1]=opcodes[0xDA][4]=phx8; - opcodes[0xDA][2]=opcodes[0xDA][3]=phx16; - opcodes[0x5A][0]=opcodes[0x5A][1]=opcodes[0x5A][4]=phy8; - opcodes[0x5A][2]=opcodes[0x5A][3]=phy16; - opcodes[0x68][0]=opcodes[0x68][2]=opcodes[0x68][4]=pla8; - opcodes[0x68][1]=opcodes[0x68][3]=pla16; - opcodes[0xFA][0]=opcodes[0xFA][1]=opcodes[0xFA][4]=plx8; - opcodes[0xFA][2]=opcodes[0xFA][3]=plx16; - opcodes[0x7A][0]=opcodes[0x7A][1]=opcodes[0x7A][4]=ply8; - opcodes[0x7A][2]=opcodes[0x7A][3]=ply16; - opcodes[0xD4][0]=opcodes[0xD4][1]=opcodes[0xD4][2]= - opcodes[0xD4][3]=opcodes[0xD4][4]=pei; - opcodes[0xF4][0]=opcodes[0xF4][1]=opcodes[0xF4][2]= - opcodes[0xF4][3]=opcodes[0xF4][4]=pea; - opcodes[0x62][0]=opcodes[0x62][1]=opcodes[0x62][2]= - opcodes[0x62][3]=opcodes[0x62][4]=per; - opcodes[0x0B][0]=opcodes[0x0B][1]=opcodes[0x0B][2]= - opcodes[0x0B][3]=opcodes[0x0B][4]=phd; - opcodes[0x2B][0]=opcodes[0x2B][1]=opcodes[0x2B][2]= - opcodes[0x2B][3]=opcodes[0x2B][4]=pld; - - /*CMP group*/ - opcodes[0xC9][0]=opcodes[0xC9][2]=opcodes[0xC9][4]=cmpImm8; - opcodes[0xC9][1]=opcodes[0xC9][3]=cmpImm16; - opcodes[0xC5][0]=opcodes[0xC5][2]=opcodes[0xC5][4]=cmpZp8; - opcodes[0xC5][1]=opcodes[0xC5][3]=cmpZp16; - opcodes[0xC3][0]=opcodes[0xC3][2]=opcodes[0xC3][4]=cmpSp8; - opcodes[0xC3][1]=opcodes[0xC3][3]=cmpSp16; - opcodes[0xD5][0]=opcodes[0xD5][2]=opcodes[0xD5][4]=cmpZpx8; - opcodes[0xD5][1]=opcodes[0xD5][3]=cmpZpx16; - opcodes[0xCD][0]=opcodes[0xCD][2]=opcodes[0xCD][4]=cmpAbs8; - opcodes[0xCD][1]=opcodes[0xCD][3]=cmpAbs16; - opcodes[0xDD][0]=opcodes[0xDD][2]=opcodes[0xDD][4]=cmpAbsx8; - opcodes[0xDD][1]=opcodes[0xDD][3]=cmpAbsx16; - opcodes[0xD9][0]=opcodes[0xD9][2]=opcodes[0xD9][4]=cmpAbsy8; - opcodes[0xD9][1]=opcodes[0xD9][3]=cmpAbsy16; - opcodes[0xCF][0]=opcodes[0xCF][2]=opcodes[0xCF][4]=cmpLong8; - opcodes[0xCF][1]=opcodes[0xCF][3]=cmpLong16; - opcodes[0xDF][0]=opcodes[0xDF][2]=opcodes[0xDF][4]=cmpLongx8; - opcodes[0xDF][1]=opcodes[0xDF][3]=cmpLongx16; - opcodes[0xD2][0]=opcodes[0xD2][2]=opcodes[0xD2][4]=cmpIndirect8; - opcodes[0xD2][1]=opcodes[0xD2][3]=cmpIndirect16; - opcodes[0xC1][0]=opcodes[0xC1][2]=opcodes[0xC1][4]=cmpIndirectx8; - opcodes[0xC1][1]=opcodes[0xC1][3]=cmpIndirectx16; - opcodes[0xD1][0]=opcodes[0xD1][2]=opcodes[0xD1][4]=cmpIndirecty8; - opcodes[0xD1][1]=opcodes[0xD1][3]=cmpIndirecty16; - opcodes[0xD3][0]=opcodes[0xD3][2]=opcodes[0xD3][4]=cmpsIndirecty8; - opcodes[0xD3][1]=opcodes[0xD3][3]=cmpsIndirecty16; - opcodes[0xC7][0]=opcodes[0xC7][2]=opcodes[0xC7][4]=cmpIndirectLong8; - opcodes[0xC7][1]=opcodes[0xC7][3]=cmpIndirectLong16; - opcodes[0xD7][0]=opcodes[0xD7][2]=opcodes[0xD7][4]=cmpIndirectLongy8; - opcodes[0xD7][1]=opcodes[0xD7][3]=cmpIndirectLongy16; - - /*CPX group*/ - opcodes[0xE0][0]=opcodes[0xE0][1]=opcodes[0xE0][4]=cpxImm8; - opcodes[0xE0][2]=opcodes[0xE0][3]=cpxImm16; - opcodes[0xE4][0]=opcodes[0xE4][1]=opcodes[0xE4][4]=cpxZp8; - opcodes[0xE4][2]=opcodes[0xE4][3]=cpxZp16; - opcodes[0xEC][0]=opcodes[0xEC][1]=opcodes[0xEC][4]=cpxAbs8; - opcodes[0xEC][2]=opcodes[0xEC][3]=cpxAbs16; - - /*CPY group*/ - opcodes[0xC0][0]=opcodes[0xC0][1]=opcodes[0xC0][4]=cpyImm8; - opcodes[0xC0][2]=opcodes[0xC0][3]=cpyImm16; - opcodes[0xC4][0]=opcodes[0xC4][1]=opcodes[0xC4][4]=cpyZp8; - opcodes[0xC4][2]=opcodes[0xC4][3]=cpyZp16; - opcodes[0xCC][0]=opcodes[0xCC][1]=opcodes[0xCC][4]=cpyAbs8; - opcodes[0xCC][2]=opcodes[0xCC][3]=cpyAbs16; - - /*Branch group*/ - opcodes[0x90][0]=opcodes[0x90][1]=opcodes[0x90][2]= - opcodes[0x90][3]=opcodes[0x90][4]=bcc; - opcodes[0xB0][0]=opcodes[0xB0][1]=opcodes[0xB0][2]= - opcodes[0xB0][3]=opcodes[0xB0][4]=bcs; - opcodes[0xF0][0]=opcodes[0xF0][1]=opcodes[0xF0][2]= - opcodes[0xF0][3]=opcodes[0xF0][4]=beq; - opcodes[0xD0][0]=opcodes[0xD0][1]=opcodes[0xD0][2]= - opcodes[0xD0][3]=opcodes[0xD0][4]=bne; - opcodes[0x80][0]=opcodes[0x80][1]=opcodes[0x80][2]= - opcodes[0x80][3]=opcodes[0x80][4]=bra; - opcodes[0x82][0]=opcodes[0x82][1]=opcodes[0x82][2]= - opcodes[0x82][3]=opcodes[0x82][4]=brl; - opcodes[0x10][0]=opcodes[0x10][1]=opcodes[0x10][2]= - opcodes[0x10][3]=opcodes[0x10][4]=bpl; - opcodes[0x30][0]=opcodes[0x30][1]=opcodes[0x30][2]= - opcodes[0x30][3]=opcodes[0x30][4]=bmi; - opcodes[0x50][0]=opcodes[0x50][1]=opcodes[0x50][2]= - opcodes[0x50][3]=opcodes[0x50][4]=bvc; - opcodes[0x70][0]=opcodes[0x70][1]=opcodes[0x70][2]= - opcodes[0x70][3]=opcodes[0x70][4]=bvs; - - /*Jump group*/ - opcodes[0x4C][0]=opcodes[0x4C][1]=opcodes[0x4C][2]= - opcodes[0x4C][3]=opcodes[0x4C][4]=jmp; - opcodes[0x5C][0]=opcodes[0x5C][1]=opcodes[0x5C][2]= - opcodes[0x5C][3]=opcodes[0x5C][4]=jmplong; - opcodes[0x6C][0]=opcodes[0x6C][1]=opcodes[0x6C][2]= - opcodes[0x6C][3]=opcodes[0x6C][4]=jmpind; - opcodes[0x7C][0]=opcodes[0x7C][1]=opcodes[0x7C][2]= - opcodes[0x7C][3]=opcodes[0x7C][4]=jmpindx; - opcodes[0xDC][0]=opcodes[0xDC][1]=opcodes[0xDC][2]= - opcodes[0xDC][3]=opcodes[0xDC][4]=jmlind; - opcodes[0x20][0]=opcodes[0x20][1]=opcodes[0x20][2]= - opcodes[0x20][3]=jsr; - opcodes[0x20][4]=jsre; - opcodes[0xFC][0]=opcodes[0xFC][1]=opcodes[0xFC][2]= - opcodes[0xFC][3]=jsrIndx; - opcodes[0xFC][4]=jsrIndxe; - opcodes[0x60][0]=opcodes[0x60][1]=opcodes[0x60][2]= - opcodes[0x60][3]=rts; - opcodes[0x60][4]=rtse; - opcodes[0x6B][0]=opcodes[0x6B][1]=opcodes[0x6B][2]= - opcodes[0x6B][3]=rtl; - opcodes[0x6B][4]=rtle; - opcodes[0x40][0]=opcodes[0x40][1]=opcodes[0x40][2]= - opcodes[0x40][3]=rti; - opcodes[0x40][4]=rtie; - opcodes[0x22][0]=opcodes[0x22][1]=opcodes[0x22][2]= - opcodes[0x22][3]=jsl; - opcodes[0x22][4]=jsle; - - /*Shift group*/ - opcodes[0x0A][0]=opcodes[0x0A][2]=opcodes[0x0A][4]=asla8; - opcodes[0x0A][1]=opcodes[0x0A][3]=asla16; - opcodes[0x06][0]=opcodes[0x06][2]=opcodes[0x06][4]=aslZp8; - opcodes[0x06][1]=opcodes[0x06][3]=aslZp16; - opcodes[0x16][0]=opcodes[0x16][2]=opcodes[0x16][4]=aslZpx8; - opcodes[0x16][1]=opcodes[0x16][3]=aslZpx16; - opcodes[0x0E][0]=opcodes[0x0E][2]=opcodes[0x0E][4]=aslAbs8; - opcodes[0x0E][1]=opcodes[0x0E][3]=aslAbs16; - opcodes[0x1E][0]=opcodes[0x1E][2]=opcodes[0x1E][4]=aslAbsx8; - opcodes[0x1E][1]=opcodes[0x1E][3]=aslAbsx16; - - opcodes[0x4A][0]=opcodes[0x4A][2]=opcodes[0x4A][4]=lsra8; - opcodes[0x4A][1]=opcodes[0x4A][3]=lsra16; - opcodes[0x46][0]=opcodes[0x46][2]=opcodes[0x46][4]=lsrZp8; - opcodes[0x46][1]=opcodes[0x46][3]=lsrZp16; - opcodes[0x56][0]=opcodes[0x56][2]=opcodes[0x56][4]=lsrZpx8; - opcodes[0x56][1]=opcodes[0x56][3]=lsrZpx16; - opcodes[0x4E][0]=opcodes[0x4E][2]=opcodes[0x4E][4]=lsrAbs8; - opcodes[0x4E][1]=opcodes[0x4E][3]=lsrAbs16; - opcodes[0x5E][0]=opcodes[0x5E][2]=opcodes[0x5E][4]=lsrAbsx8; - opcodes[0x5E][1]=opcodes[0x5E][3]=lsrAbsx16; - - opcodes[0x2A][0]=opcodes[0x2A][2]=opcodes[0x2A][4]=rola8; - opcodes[0x2A][1]=opcodes[0x2A][3]=rola16; - opcodes[0x26][0]=opcodes[0x26][2]=opcodes[0x26][4]=rolZp8; - opcodes[0x26][1]=opcodes[0x26][3]=rolZp16; - opcodes[0x36][0]=opcodes[0x36][2]=opcodes[0x36][4]=rolZpx8; - opcodes[0x36][1]=opcodes[0x36][3]=rolZpx16; - opcodes[0x2E][0]=opcodes[0x2E][2]=opcodes[0x2E][4]=rolAbs8; - opcodes[0x2E][1]=opcodes[0x2E][3]=rolAbs16; - opcodes[0x3E][0]=opcodes[0x3E][2]=opcodes[0x3E][4]=rolAbsx8; - opcodes[0x3E][1]=opcodes[0x3E][3]=rolAbsx16; - - opcodes[0x6A][0]=opcodes[0x6A][2]=opcodes[0x6A][4]=rora8; - opcodes[0x6A][1]=opcodes[0x6A][3]=rora16; - opcodes[0x66][0]=opcodes[0x66][2]=opcodes[0x66][4]=rorZp8; - opcodes[0x66][1]=opcodes[0x66][3]=rorZp16; - opcodes[0x76][0]=opcodes[0x76][2]=opcodes[0x76][4]=rorZpx8; - opcodes[0x76][1]=opcodes[0x76][3]=rorZpx16; - opcodes[0x6E][0]=opcodes[0x6E][2]=opcodes[0x6E][4]=rorAbs8; - opcodes[0x6E][1]=opcodes[0x6E][3]=rorAbs16; - opcodes[0x7E][0]=opcodes[0x7E][2]=opcodes[0x7E][4]=rorAbsx8; - opcodes[0x7E][1]=opcodes[0x7E][3]=rorAbsx16; - - /*BIT group*/ - opcodes[0x89][0]=opcodes[0x89][2]=opcodes[0x89][4]=bitImm8; - opcodes[0x89][1]=opcodes[0x89][3]=bitImm16; - opcodes[0x24][0]=opcodes[0x24][2]=opcodes[0x24][4]=bitZp8; - opcodes[0x24][1]=opcodes[0x24][3]=bitZp16; - opcodes[0x34][0]=opcodes[0x34][2]=opcodes[0x34][4]=bitZpx8; - opcodes[0x34][1]=opcodes[0x34][3]=bitZpx16; - opcodes[0x2C][0]=opcodes[0x2C][2]=opcodes[0x2C][4]=bitAbs8; - opcodes[0x2C][1]=opcodes[0x2C][3]=bitAbs16; - opcodes[0x3C][0]=opcodes[0x3C][2]=opcodes[0x3C][4]=bitAbsx8; - opcodes[0x3C][1]=opcodes[0x3C][3]=bitAbsx16; - - /*Misc group*/ - opcodes[0x00][0]=opcodes[0x00][1]=opcodes[0x00][2]= - opcodes[0x00][3]=op_brk; - opcodes[0x00][4]=brke; - opcodes[0x02][0]=opcodes[0x02][1]=opcodes[0x02][2]= - opcodes[0x02][3]=cop; - opcodes[0x02][4]=cope; - opcodes[0xEB][0]=opcodes[0xEB][1]=opcodes[0xEB][2]= - opcodes[0xEB][3]=opcodes[0xEB][4]=xba; - opcodes[0xEA][0]=opcodes[0xEA][1]=opcodes[0xEA][2]= - opcodes[0xEA][3]=opcodes[0xEA][4]=nop; - opcodes[0x5B][0]=opcodes[0x5B][1]=opcodes[0x5B][2]= - opcodes[0x5B][3]=opcodes[0x5B][4]=tcd; - opcodes[0x7B][0]=opcodes[0x7B][1]=opcodes[0x7B][2]= - opcodes[0x7B][3]=opcodes[0x7B][4]=tdc; - opcodes[0x1B][0]=opcodes[0x1B][1]=opcodes[0x1B][2]= - opcodes[0x1B][3]=opcodes[0x1B][4]=tcs; - opcodes[0x3B][0]=opcodes[0x3B][1]=opcodes[0x3B][2]= - opcodes[0x3B][3]=opcodes[0x3B][4]=tsc; - opcodes[0xCB][0]=opcodes[0xCB][1]=opcodes[0xCB][2]= - opcodes[0xCB][3]=opcodes[0xCB][4]=wai; - opcodes[0x44][0]=opcodes[0x44][1]=opcodes[0x44][2]= - opcodes[0x44][3]=opcodes[0x44][4]=mvp; - opcodes[0x54][0]=opcodes[0x54][1]=opcodes[0x54][2]= - opcodes[0x54][3]=opcodes[0x54][4]=mvn; - opcodes[0x04][0]=opcodes[0x04][2]=opcodes[0x04][4]=tsbZp8; - opcodes[0x04][1]=opcodes[0x04][3]=tsbZp16; - opcodes[0x0C][0]=opcodes[0x0C][2]=opcodes[0x0C][4]=tsbAbs8; - opcodes[0x0C][1]=opcodes[0x0C][3]=tsbAbs16; - opcodes[0x14][0]=opcodes[0x14][2]=opcodes[0x14][4]=trbZp8; - opcodes[0x14][1]=opcodes[0x14][3]=trbZp16; - opcodes[0x1C][0]=opcodes[0x1C][2]=opcodes[0x1C][4]=trbAbs8; - opcodes[0x1C][1]=opcodes[0x1C][3]=trbAbs16; - opcodes[0x42][0]=opcodes[0x42][1]=opcodes[0x42][2]= - opcodes[0x42][3]=opcodes[0x42][4]=wdm; - opcodes[0xDB][0]=opcodes[0xDB][1]=opcodes[0xDB][2]= - opcodes[0xDB][3]=opcodes[0xDB][4]=stp; -} - -void w65816_init() -{ - FILE *f; - char fn[512]; - if (!w65816rom) w65816rom=malloc(0x8000); - if (!w65816ram) w65816ram=malloc(0x80000); - append_filename(fn,exedir,"roms/tube/ReCo6502ROM_816",511); - f=fopen(fn,"rb"); - fread(w65816rom,0x8000,1,f); - fclose(f); - makeopcodetable65816(); -} - -void w65816_close() -{ - if (w65816ram) free(w65816ram); - if (w65816rom) free(w65816rom); -} - -static void updatecpumode() -{ - if (p.e) - { - cpumode=4; - x.b.h=y.b.h=0; - } - else - { - cpumode=0; - if (!p.m) cpumode|=1; - if (!p.ex) cpumode|=2; - if (p.ex) x.b.h=y.b.h=0; - } -} - -static void nmi65816() -{ - uint8_t temp=0; -// printf("NMI %i %i %i\n",p.i,inwai,irqenable); - readmem(pbr|pc); - cycles--; clockspc(6); - if (inwai) pc++; - inwai=0; - if (!p.e) - { -// //printf("%02X -> %04X\n",pbr>>16,s.w); - writemem(s.w,pbr>>16); s.w--; -// //printf("%02X -> %04X\n",pc>>8,s.w); - writemem(s.w,pc>>8); s.w--; -// //printf("%02X -> %04X\n",pc&0xFF,s.w); - writemem(s.w,pc&0xFF); s.w--; - if (p.c) temp|=1; - if (p.z) temp|=2; - if (p.i) temp|=4; - if (p.d) temp|=8; - if (p.ex) temp|=0x10; - if (p.m) temp|=0x20; - if (p.v) temp|=0x40; - if (p.n) temp|=0x80; -// //printf("%02X -> %04X\n",temp,s.w); - writemem(s.w,temp); s.w--; - pc=readmemw(0xFFEA); - pbr=0; - p.i=1; - p.d=0; -// printf("NMI\n"); - } - else - { - writemem(s.w,pc>>8); s.b.l--; - writemem(s.w,pc&0xFF); s.b.l--; - if (p.c) temp|=1; - if (p.z) temp|=2; - if (p.i) temp|=4; - if (p.d) temp|=8; - if (p.v) temp|=0x40; - if (p.n) temp|=0x80; - writemem(s.w,temp|0x30); s.b.l--; - pc=readmemw(0xFFFA); - pbr=0; - p.i=1; - p.d=0; -// printf("Emulation mode NMI\n"); -// dumpregs(); -// exit(-1); - } -} - -static int toutput=0; -static void irq65816() -{ - uint8_t temp=0; -// printf("IRQ %i %i %i\n",p.i,inwai,irqenable); - readmem(pbr|pc); - cycles--; clockspc(6); - if (inwai && p.i) - { - pc++; - inwai=0; - return; - } - if (inwai) pc++; - inwai=0; - if (!p.e) - { - writemem(s.w,pbr>>16); s.w--; - writemem(s.w,pc>>8); s.w--; - writemem(s.w,pc&0xFF); s.w--; - if (p.c) temp|=1; - if (p.z) temp|=2; - if (p.i) temp|=4; - if (p.d) temp|=8; - if (p.ex) temp|=0x10; - if (p.m) temp|=0x20; - if (p.v) temp|=0x40; - if (p.n) temp|=0x80; - writemem(s.w,temp); s.w--; - pc=readmemw(0xFFEE); - pbr=0; - p.i=1; - p.d=0; -// printf("IRQ\n"); - } - else - { - writemem(s.w,pc>>8); s.b.l--; - writemem(s.w,pc&0xFF); s.b.l--; - if (p.c) temp|=1; - if (p.z) temp|=2; - if (p.i) temp|=4; - if (p.d) temp|=8; - if (p.v) temp|=0x40; - if (p.n) temp|=0x80; - writemem(s.w,temp|0x20); s.b.l--; - pc=readmemw(0xFFFE); - pbr=0; - p.i=1; - p.d=0; -// rpclog("Emulation mode IRQ %04X\n",pc); -// toutput=1; -// dumpregs(); -// exit(-1); - } -} - -static int woldnmi=0; -static uint16_t toldpc; -void w65816_exec() -{ - while (tubecycles>0) - { - opcode=readmem(pbr|pc); pc++; - if (toutput) rpclog("%i : %02X:%04X %04X %02X %i %04X %04X %04X %04X\n",wins,pbr,pc-1,toldpc,opcode,cycles,s.b.l,a.w,x.w,y.w); - toldpc=pc-1; - opcodes[opcode][cpumode](); -// if (pc==0xffee) toutput=1; - wins++; - if ((tube_irq&2) && !woldnmi) nmi65816(); - else if ((tube_irq&1) && !p.i) irq65816(); - woldnmi=tube_irq&2; -// if (pc==0x10C) toutput=1; -/* if (pc==0xfff7) - { - dumpregs65816(); - exit(-1); - }*/ -// if (pc==0xCB63) toutput=1; -// if (wins==4236000) toutput=1; -// if (wins==4236050) toutput=0; - } -} +/*B-em v2.2 by Tom Walker + 65816 parasite CPU emulation + Originally from Snem, with some bugfixes*/ + +#include +#include +#include "b-em.h" +#include "tube.h" +#include "65816.h" + +#define printf rpclog + +static uint8_t *w65816ram,*w65816rom; +/*Registers*/ +typedef union +{ + uint16_t w; + struct + { + uint8_t l,h; + } b; +} reg; + +static reg w65816a,w65816x,w65816y,w65816s; +static uint32_t pbr,dbr; +static uint16_t w65816pc,dp; + +static int wins=0; + +static struct +{ + int c,z,i,d,b,v,n,m,ex,e; /*X renamed to EX due to #define conflict*/ +} w65816p; + +static int inwai; +/*Opcode table*/ +static void (*opcodes[256][5])(); + +/*CPU modes : 0 = X1M1 + 1 = X1M0 + 2 = X0M1 + 3 = X0M0 + 4 = emulation*/ +static int cpumode; + +/*Current opcode*/ +static uint8_t w65816opcode; + +#define a w65816a +#define x w65816x +#define y w65816y +#define s w65816s +#define pc w65816pc +#define p w65816p + +#define cycles tubecycles +#define opcode w65816opcode + +static int def=1,divider=0,banking=0,banknum=0; +static uint32_t w65816mask=0xFFFF; + +static uint8_t readmem65816(uint32_t a) +{ + uint8_t temp; + a&=w65816mask; + cycles--; + if ((a&~7)==0xFEF8) + { + temp=tube_parasite_read(a); +/* if (a==0xFEFB && temp==0xD) + { + dtimes++; + if (dtimes==2) toutput=1; + }*/ + //rpclog("Read TUBE %04X %02X %04X\n",a,temp,pc); + return temp; + } + if ((a&0x78000)==0x8000 && (def || (banking&8))) return w65816rom[a&0x7FFF]; + if ((a&0x78000)==0x4000 && !def && (banking&1)) return w65816ram[(a&0x3FFF)|((banknum&7)<<14)]; + if ((a&0x78000)==0x8000 && !def && (banking&2)) return w65816ram[(a&0x3FFF)|(((banknum>>3)&7)<<14)]; + return w65816ram[a]; +} + +static uint16_t readmemw65816(uint32_t a) +{ + a&=w65816mask; + return readmem65816(a)|(readmem65816(a+1)<<8); +// cycles-=2; +// rpclog("Reading %08X %i %08X %08X\n",a,tuberomin,w65816rom,w65816ram); +// if ((a&~0xFFF)==0xF000 && tuberomin) return w65816rom[a&0xFFF]|(w65816rom[(a+1)&0xFFF]<<8); +// if (a<0x10000) return w65816ram[a]|(w65816ram[a+1]<<8); +} + +int endtimeslice; +static void writemem65816(uint32_t a, uint8_t v) +{ + a&=w65816mask; +// if (a==0xFF) rpclog("Write 00FF %02X %04X %i\n",v,pc,wins); + cycles--; + if ((a&~7)==0xFEF0) + { +// printf("Write control %04X %02X\n",a,v); + switch (v&7) + { + case 0: case 1: def=v&1; /*rpclog("Default now %i\n",def); */break; + case 2: case 3: divider=(divider>>1)|((v&1)<<3); /*rpclog("Divider now %i\n",divider);*/ break; + case 4: case 5: banking=(banking>>1)|((v&1)<<3); /*rpclog("Banking now %i\n",banking);*/ break; + case 6: case 7: banknum=(banknum>>1)|((v&1)<<5); /*rpclog("Banknum now %i\n",banknum);*/ break; + } + if (def || !(banking&4)) w65816mask=0xFFFF; + else w65816mask=0x7FFFF; +// rpclog("Mask now %08X\n",w65816mask); + return; + } + if ((a&~7)==0xFEF8) + { +// rpclog("Write TUBE %04X %02X %04X\n",a,v,pc); + tube_parasite_write(a,v); + endtimeslice=1; + return; + } + if ((a&0x78000)==0x4000 && !def && (banking&1)) { w65816ram[(a&0x3FFF)|((banknum&7)<<14)]=v; return; } + if ((a&0x78000)==0x8000 && !def && (banking&2)) { w65816ram[(a&0x3FFF)|(((banknum>>3)&7)<<14)]=v; return; } +// if (a>0xF000) rpclog("Write %04X %02X %04X\n",a,v,pc); +// if (a==0xF7FF && v==0xFF) toutput=1; + w65816ram[a]=v; +} + +static void writememw65816(uint32_t a, uint16_t v) +{ + a&=w65816mask; + writemem65816(a,v); + writemem65816(a+1,v>>8); +// cycles-=2; +// if (a<0x10000) +// { +// w65816ram[a]=v&0xFF; +// w65816ram[a+1]=v>>8; +// } +} + +#define readmem(a) readmem65816(a) +#define readmemw(a) readmemw65816(a) +#define writemem(a,v) writemem65816(a,v) +#define writememw(a,v) writememw65816(a,v) + +#define clockspc(c) + +static void updatecpumode(); +static int inwai=0; +/*Temporary variables*/ +static uint32_t addr; + +/*Addressing modes*/ +static uint32_t absolute() +{ + uint32_t temp=readmemw(pbr|pc); pc+=2; + return temp|dbr; +} + +static uint32_t absolutex() +{ + uint32_t temp=(readmemw(pbr|pc))+x.w+dbr; pc+=2; +// if ((temp&0xFFFF)>0x2200 && (temp&0xFFFF)<0x8000) printf("ABSX %04X %06X\n",x.w,temp); +// if (output) printf("ABSX 0000,%04X - %06X\n",x.w,temp); +// if (output) printf("Addr %06X\n",temp); + return temp; +} + +static uint32_t absolutey() +{ + uint32_t temp=(readmemw(pbr|pc))+y.w+dbr; pc+=2; + return temp; +} + +static uint32_t absolutelong() +{ + uint32_t temp=readmemw(pbr|pc); pc+=2; + temp|=(readmem(pbr|pc)<<16); pc++; + return temp; +} + +static uint32_t absolutelongx() +{ + uint32_t temp=(readmemw(pbr|pc))+x.w; pc+=2; + temp+=(readmem(pbr|pc)<<16); pc++; +// printf("abslx %06X %04X\n",temp,x.w); + return temp; +} + +static uint32_t zeropage() /*It's actually direct page, but I'm used to calling it zero page*/ +{ + uint32_t temp=readmem(pbr|pc); pc++; + temp+=dp; + if (dp&0xFF) { cycles--; clockspc(6); } + return temp&0xFFFF; +} + +static uint32_t zeropagex() +{ + uint32_t temp=readmem(pbr|pc)+x.w; pc++; + if (p.e) temp&=0xFF; + temp+=dp; + if (dp&0xFF) { cycles--; clockspc(6); } + return temp&0xFFFF; +} + +static uint32_t zeropagey() +{ + uint32_t temp=readmem(pbr|pc)+y.w; pc++; + if (p.e) temp&=0xFF; + temp+=dp; + if (dp&0xFF) { cycles--; clockspc(6); } + return temp&0xFFFF; +} + +static uint32_t stack() +{ + uint32_t temp=readmem(pbr|pc); pc++; + temp+=s.w; + return temp&0xFFFF; +} + +static uint32_t indirect() +{ + uint32_t temp=(readmem(pbr|pc)+dp)&0xFFFF; pc++; + return (readmemw(temp))+dbr; +} + +static uint32_t indirectx() +{ + uint32_t temp=(readmem(pbr|pc)+dp+x.w)&0xFFFF; pc++; + return (readmemw(temp))+dbr; +} +static uint32_t jindirectx() /*JSR (,x) uses PBR instead of DBR, and 2 byte address insted of 1 + dp*/ +{ + uint32_t temp=(readmem(pbr|pc)+(readmem((pbr|pc)+1)<<8)+x.w)+pbr; pc+=2; +// printf("Temp %06X\n",temp); + return temp; +} + +static uint32_t indirecty() +{ + uint32_t temp=(readmem(pbr|pc)+dp)&0xFFFF; pc++; + return (readmemw(temp))+y.w+dbr; +} +static uint32_t sindirecty() +{ + uint32_t temp=(readmem(pbr|pc)+s.w)&0xFFFF; pc++; + return (readmemw(temp))+y.w+dbr; +} + +static uint32_t indirectl() +{ + uint32_t temp, addr; + temp=(readmem(pbr|pc)+dp)&0xFFFF; pc++; + addr=readmemw(temp)|(readmem(temp+2)<<16); +// printf("IND %06X\n",addr); + return addr; +} + +static uint32_t indirectly() +{ + uint32_t temp, addr; + temp=(readmem(pbr|pc)+dp)&0xFFFF; pc++; + addr=(readmemw(temp)|(readmem(temp+2)<<16))+y.w; +// if (pc==0xFDC9) printf("INDy %04X %06X\n",temp,addr); +// if (output) printf("INDy %06X %02X %06X\n",addr,opcode,pbr|pc); + return addr; +} + +/*Flag setting*/ +#define setzn8(v) p.z=!(v); p.n=(v)&0x80 +#define setzn16(v) p.z=!(v); p.n=(v)&0x8000 + +/*ADC/SBC macros*/ +#define ADC8() tempw=a.b.l+temp+((p.c)?1:0); \ + p.v=(!((a.b.l^temp)&0x80)&&((a.b.l^tempw)&0x80)); \ + a.b.l=tempw&0xFF; \ + setzn8(a.b.l); \ + p.c=tempw&0x100; + +#define ADC16() templ=a.w+tempw+((p.c)?1:0); \ + p.v=(!((a.w^tempw)&0x8000)&&((a.w^templ)&0x8000)); \ + a.w=templ&0xFFFF; \ + setzn16(a.w); \ + p.c=templ&0x10000; + +#define ADCBCD8() \ + tempw=(a.b.l&0xF)+(temp&0xF)+(p.c?1:0); \ + if (tempw>9) \ + { \ + tempw+=6; \ + } \ + tempw+=((a.b.l&0xF0)+(temp&0xF0)); \ + if (tempw>0x9F) \ + { \ + tempw+=0x60; \ + } \ + p.v=(!((a.b.l^temp)&0x80)&&((a.b.l^tempw)&0x80)); \ + a.b.l=tempw&0xFF; \ + setzn8(a.b.l); \ + p.c=tempw>0xFF; \ + cycles--; clockspc(6); + +#define ADCBCD16() \ + templ=(a.w&0xF)+(tempw&0xF)+(p.c?1:0); \ + if (templ>9) \ + { \ + templ+=6; \ + } \ + templ+=((a.w&0xF0)+(tempw&0xF0)); \ + if (templ>0x9F) \ + { \ + templ+=0x60; \ + } \ + templ+=((a.w&0xF00)+(tempw&0xF00)); \ + if (templ>0x9FF) \ + { \ + templ+=0x600; \ + } \ + templ+=((a.w&0xF000)+(tempw&0xF000)); \ + if (templ>0x9FFF) \ + { \ + templ+=0x6000; \ + } \ + p.v=(!((a.w^tempw)&0x8000)&&((a.w^templ)&0x8000)); \ + a.w=templ&0xFFFF; \ + setzn16(a.w); \ + p.c=templ>0xFFFF; \ + cycles--; clockspc(6); + +#define SBC8() tempw=a.b.l-temp-((p.c)?0:1); \ + p.v=(((a.b.l^temp)&0x80)&&((a.b.l^tempw)&0x80)); \ + a.b.l=tempw&0xFF; \ + setzn8(a.b.l); \ + p.c=tempw<=0xFF; + +#define SBC16() templ=a.w-tempw-((p.c)?0:1); \ + p.v=(((a.w^tempw)&(a.w^templ))&0x8000); \ + a.w=templ&0xFFFF; \ + setzn16(a.w); \ + p.c=templ<=0xFFFF; + +#define SBCBCD8() \ + tempw=(a.b.l&0xF)-(temp&0xF)-(p.c?0:1); \ + if (tempw>9) \ + { \ + tempw-=6; \ + } \ + tempw+=((a.b.l&0xF0)-(temp&0xF0)); \ + if (tempw>0x9F) \ + { \ + tempw-=0x60; \ + } \ + p.v=(((a.b.l^temp)&0x80)&&((a.b.l^tempw)&0x80)); \ + a.b.l=tempw&0xFF; \ + setzn8(a.b.l); \ + p.c=tempw<=0xFF; \ + cycles--; clockspc(6); + +#define SBCBCD16() \ + templ=(a.w&0xF)-(tempw&0xF)-(p.c?0:1); \ + if (templ>9) \ + { \ + templ-=6; \ + } \ + templ+=((a.w&0xF0)-(tempw&0xF0)); \ + if (templ>0x9F) \ + { \ + templ-=0x60; \ + } \ + templ+=((a.w&0xF00)-(tempw&0xF00)); \ + if (templ>0x9FF) \ + { \ + templ-=0x600; \ + } \ + templ+=((a.w&0xF000)-(tempw&0xF000)); \ + if (templ>0x9FFF) \ + { \ + templ-=0x6000; \ + } \ + p.v=(((a.w^tempw)&0x8000)&&((a.w^templ)&0x8000)); \ + a.w=templ&0xFFFF; \ + setzn16(a.w); \ + p.c=templ<=0xFFFF; \ + cycles--; clockspc(6); + +/*Instructions*/ +static void inca8() +{ + readmem(pbr|pc); + a.b.l++; + setzn8(a.b.l); +} +static void inca16() +{ + readmem(pbr|pc); + a.w++; + setzn16(a.w); +} +static void inx8() +{ + readmem(pbr|pc); + x.b.l++; + setzn8(x.b.l); +} +static void inx16() +{ + readmem(pbr|pc); + x.w++; + setzn16(x.w); +} +static void iny8() +{ + readmem(pbr|pc); + y.b.l++; + setzn8(y.b.l); +} +static void iny16() +{ + readmem(pbr|pc); + y.w++; + setzn16(y.w); +} + +static void deca8() +{ + readmem(pbr|pc); + a.b.l--; + setzn8(a.b.l); +} +static void deca16() +{ + readmem(pbr|pc); + a.w--; + setzn16(a.w); +} +static void dex8() +{ + readmem(pbr|pc); + x.b.l--; + setzn8(x.b.l); +} +static void dex16() +{ + readmem(pbr|pc); + x.w--; + setzn16(x.w); +} +static void dey8() +{ + readmem(pbr|pc); + y.b.l--; + setzn8(y.b.l); +} +static void dey16() +{ + readmem(pbr|pc); + y.w--; + setzn16(y.w); +} + +/*INC group*/ +static void incZp8() +{ + uint8_t temp; + addr=zeropage(); + temp=readmem(addr); + cycles--; clockspc(6); + temp++; + setzn8(temp); + writemem(addr,temp); +} +static void incZp16() +{ + uint16_t temp; + addr=zeropage(); + temp=readmemw(addr); + cycles--; clockspc(6); + temp++; + setzn16(temp); + writememw(addr,temp); +} + +static void incZpx8() +{ + uint8_t temp; + addr=zeropagex(); + temp=readmem(addr); + cycles--; clockspc(6); + temp++; + setzn8(temp); + writemem(addr,temp); +} +static void incZpx16() +{ + uint16_t temp; + addr=zeropagex(); + temp=readmemw(addr); + cycles--; clockspc(6); + temp++; + setzn16(temp); + writememw(addr,temp); +} + +static void incAbs8() +{ + uint8_t temp; + addr=absolute(); + temp=readmem(addr); + cycles--; clockspc(6); + temp++; + setzn8(temp); + writemem(addr,temp); +} +static void incAbs16() +{ + uint16_t temp; + addr=absolute(); + temp=readmemw(addr); + cycles--; clockspc(6); + temp++; + setzn16(temp); + writememw(addr,temp); +} + +static void incAbsx8() +{ + uint8_t temp; + addr=absolutex(); + temp=readmem(addr); + cycles--; clockspc(6); + temp++; + setzn8(temp); + writemem(addr,temp); +} +static void incAbsx16() +{ + uint16_t temp; + addr=absolutex(); + temp=readmemw(addr); + cycles--; clockspc(6); + temp++; + setzn16(temp); + writememw(addr,temp); +} + +/*DEC group*/ +static void decZp8() +{ + uint8_t temp; + addr=zeropage(); + temp=readmem(addr); + cycles--; clockspc(6); + temp--; + setzn8(temp); + writemem(addr,temp); +// if (output && addr==4) printf("DEC 4 %02X %i %i\n",temp,p.z,p.n); +} +static void decZp16() +{ + uint16_t temp; + addr=zeropage(); + temp=readmemw(addr); + cycles--; clockspc(6); + temp--; + setzn16(temp); + writememw(addr,temp); +} + +static void decZpx8() +{ + uint8_t temp; + addr=zeropagex(); + temp=readmem(addr); + cycles--; clockspc(6); + temp--; + setzn8(temp); + writemem(addr,temp); +} +static void decZpx16() +{ + uint16_t temp; + addr=zeropagex(); + temp=readmemw(addr); + cycles--; clockspc(6); + temp--; + setzn16(temp); + writememw(addr,temp); +} + +static void decAbs8() +{ + uint8_t temp; + addr=absolute(); + temp=readmem(addr); + cycles--; clockspc(6); + temp--; + setzn8(temp); + writemem(addr,temp); +} +static void decAbs16() +{ + uint16_t temp; + addr=absolute(); + temp=readmemw(addr); + cycles--; clockspc(6); + temp--; + setzn16(temp); + writememw(addr,temp); +} + +static void decAbsx8() +{ + uint8_t temp; + addr=absolutex(); + temp=readmem(addr); + cycles--; clockspc(6); + temp--; + setzn8(temp); + writemem(addr,temp); +} +static void decAbsx16() +{ + uint16_t temp; + addr=absolutex(); + temp=readmemw(addr); + cycles--; clockspc(6); + temp--; + setzn16(temp); + writememw(addr,temp); +} + +/*Flag group*/ +static void clc() +{ + readmem(pbr|pc); + p.c=0; +} +static void cld() +{ + readmem(pbr|pc); + p.d=0; +} +static void cli() +{ + readmem(pbr|pc); + p.i=0; +} +static void clv() +{ + readmem(pbr|pc); + p.v=0; +} + +static void sec() +{ + readmem(pbr|pc); + p.c=1; +} +static void sed() +{ + readmem(pbr|pc); + p.d=1; +} +static void sei() +{ + readmem(pbr|pc); + p.i=1; +} + +static void xce() +{ + int temp=p.c; + p.c=p.e; + p.e=temp; + readmem(pbr|pc); + updatecpumode(); +} + +static void sep() +{ + uint8_t temp=readmem(pbr|pc); pc++; + if (temp&1) p.c=1; + if (temp&2) p.z=1; + if (temp&4) p.i=1; + if (temp&8) p.d=1; + if (temp&0x40) p.v=1; + if (temp&0x80) p.n=1; + if (!p.e) + { + if (temp&0x10) p.ex=1; + if (temp&0x20) p.m=1; + updatecpumode(); + } +} + +static void rep65816() +{ + uint8_t temp=readmem(pbr|pc); pc++; + if (temp&1) p.c=0; + if (temp&2) p.z=0; + if (temp&4) p.i=0; + if (temp&8) p.d=0; + if (temp&0x40) p.v=0; + if (temp&0x80) p.n=0; + if (!p.e) + { + if (temp&0x10) p.ex=0; + if (temp&0x20) p.m=0; + updatecpumode(); + } +} + +/*Transfer group*/ +static void tax8() +{ + readmem(pbr|pc); + x.b.l=a.b.l; + setzn8(x.b.l); +} +static void tay8() +{ + readmem(pbr|pc); + y.b.l=a.b.l; + setzn8(y.b.l); +} +static void txa8() +{ + readmem(pbr|pc); + a.b.l=x.b.l; + setzn8(a.b.l); +} +static void tya8() +{ + readmem(pbr|pc); + a.b.l=y.b.l; + setzn8(a.b.l); +} +static void tsx8() +{ + readmem(pbr|pc); + x.b.l=s.b.l; + setzn8(x.b.l); +} +static void txs8() +{ + readmem(pbr|pc); + s.b.l=x.b.l; +// setzn8(s.b.l); +} +static void txy8() +{ + readmem(pbr|pc); + y.b.l=x.b.l; + setzn8(y.b.l); +} +static void tyx8() +{ + readmem(pbr|pc); + x.b.l=y.b.l; + setzn8(x.b.l); +} + +static void tax16() +{ + readmem(pbr|pc); + x.w=a.w; + setzn16(x.w); +} +static void tay16() +{ + readmem(pbr|pc); + y.w=a.w; + setzn16(y.w); +} +static void txa16() +{ + readmem(pbr|pc); + a.w=x.w; + setzn16(a.w); +} +static void tya16() +{ + readmem(pbr|pc); + a.w=y.w; + setzn16(a.w); +} +static void tsx16() +{ + readmem(pbr|pc); + x.w=s.w; + setzn16(x.w); +} +static void txs16() +{ + readmem(pbr|pc); + s.w=x.w; +// setzn16(s.w); +} +static void txy16() +{ + readmem(pbr|pc); + y.w=x.w; + setzn16(y.w); +} +static void tyx16() +{ + readmem(pbr|pc); + x.w=y.w; + setzn16(x.w); +} + +/*LDX group*/ +static void ldxImm8() +{ + x.b.l=readmem(pbr|pc); pc++; + setzn8(x.b.l); +} +static void ldxZp8() +{ + addr=zeropage(); + x.b.l=readmem(addr); + setzn8(x.b.l); +} +static void ldxZpy8() +{ + addr=zeropagey(); + x.b.l=readmem(addr); + setzn8(x.b.l); +} +static void ldxAbs8() +{ + addr=absolute(); + x.b.l=readmem(addr); + setzn8(x.b.l); +} +static void ldxAbsy8() +{ + addr=absolutey(); + x.b.l=readmem(addr); + setzn8(x.b.l); +} + +static void ldxImm16() +{ + x.w=readmemw(pbr|pc); pc+=2; + setzn16(x.w); +} +static void ldxZp16() +{ + addr=zeropage(); + x.w=readmemw(addr); + setzn16(x.w); +} +static void ldxZpy16() +{ + addr=zeropagey(); + x.w=readmemw(addr); + setzn16(x.w); +} +static void ldxAbs16() +{ + addr=absolute(); + x.w=readmemw(addr); + setzn16(x.w); +} +static void ldxAbsy16() +{ + addr=absolutey(); + x.w=readmemw(addr); + setzn16(x.w); +} + +/*LDY group*/ +static void ldyImm8() +{ + y.b.l=readmem(pbr|pc); pc++; + setzn8(y.b.l); +} +static void ldyZp8() +{ + addr=zeropage(); + y.b.l=readmem(addr); + setzn8(y.b.l); +} +static void ldyZpx8() +{ + addr=zeropagex(); + y.b.l=readmem(addr); + setzn8(y.b.l); +} +static void ldyAbs8() +{ + addr=absolute(); + y.b.l=readmem(addr); + setzn8(y.b.l); +} +static void ldyAbsx8() +{ + addr=absolutex(); + y.b.l=readmem(addr); + setzn8(y.b.l); +} + +static void ldyImm16() +{ + y.w=readmemw(pbr|pc); pc+=2; + setzn16(y.w); +} +static void ldyZp16() +{ + addr=zeropage(); + y.w=readmemw(addr); + setzn16(y.w); +} +static void ldyZpx16() +{ + addr=zeropagex(); + y.w=readmemw(addr); + setzn16(y.w); +} +static void ldyAbs16() +{ + addr=absolute(); + y.w=readmemw(addr); + setzn16(y.w); +} +static void ldyAbsx16() +{ + addr=absolutex(); + y.w=readmemw(addr); + setzn16(y.w); +} + +/*LDA group*/ +static void ldaImm8() +{ + a.b.l=readmem(pbr|pc); pc++; + setzn8(a.b.l); +} +static void ldaZp8() +{ + addr=zeropage(); + a.b.l=readmem(addr); + setzn8(a.b.l); +} +static void ldaZpx8() +{ + addr=zeropagex(); + a.b.l=readmem(addr); + setzn8(a.b.l); +} +static void ldaSp8() +{ + addr=stack(); + a.b.l=readmem(addr); + setzn8(a.b.l); +} +static void ldaSIndirecty8() +{ + addr=sindirecty(); + a.b.l=readmem(addr); + setzn8(a.b.l); +} +static void ldaAbs8() +{ + addr=absolute(); + a.b.l=readmem(addr); + setzn8(a.b.l); +} +static void ldaAbsx8() +{ + addr=absolutex(); + a.b.l=readmem(addr); + setzn8(a.b.l); +} +static void ldaAbsy8() +{ + addr=absolutey(); + a.b.l=readmem(addr); + setzn8(a.b.l); +} +static void ldaLong8() +{ + addr=absolutelong(); + a.b.l=readmem(addr); + setzn8(a.b.l); +} +static void ldaLongx8() +{ + addr=absolutelongx(); + a.b.l=readmem(addr); + setzn8(a.b.l); +} +static void ldaIndirect8() +{ + addr=indirect(); + a.b.l=readmem(addr); + setzn8(a.b.l); +} +static void ldaIndirectx8() +{ + addr=indirectx(); + a.b.l=readmem(addr); + setzn8(a.b.l); +} +static void ldaIndirecty8() +{ + addr=indirecty(); + a.b.l=readmem(addr); + setzn8(a.b.l); +} +static void ldaIndirectLong8() +{ + addr=indirectl(); + a.b.l=readmem(addr); + setzn8(a.b.l); +} +static void ldaIndirectLongy8() +{ + addr=indirectly(); + a.b.l=readmem(addr); + setzn8(a.b.l); +} + +static void ldaImm16() +{ + a.w=readmemw(pbr|pc); pc+=2; + setzn16(a.w); +} +static void ldaZp16() +{ + addr=zeropage(); + a.w=readmemw(addr); + setzn16(a.w); +} +static void ldaZpx16() +{ + addr=zeropagex(); + a.w=readmemw(addr); + setzn16(a.w); +} +static void ldaSp16() +{ + addr=stack(); + a.w=readmemw(addr); + setzn16(a.w); +} +static void ldaSIndirecty16() +{ + addr=sindirecty(); + a.w=readmemw(addr); + setzn16(a.w); +} +static void ldaAbs16() +{ + addr=absolute(); + a.w=readmemw(addr); + setzn16(a.w); +} +static void ldaAbsx16() +{ + addr=absolutex(); + a.w=readmemw(addr); + setzn16(a.w); +} +static void ldaAbsy16() +{ + addr=absolutey(); + a.w=readmemw(addr); + setzn16(a.w); +} +static void ldaLong16() +{ + addr=absolutelong(); + a.w=readmemw(addr); + setzn16(a.w); +} +static void ldaLongx16() +{ + addr=absolutelongx(); + a.w=readmemw(addr); + setzn16(a.w); +} +static void ldaIndirect16() +{ + addr=indirect(); + a.w=readmemw(addr); + setzn16(a.w); +} +static void ldaIndirectx16() +{ + addr=indirectx(); + a.w=readmemw(addr); + setzn16(a.w); +} +static void ldaIndirecty16() +{ + addr=indirecty(); + a.w=readmemw(addr); + setzn16(a.w); +} +static void ldaIndirectLong16() +{ + addr=indirectl(); + a.w=readmemw(addr); + setzn16(a.w); +} +static void ldaIndirectLongy16() +{ + addr=indirectly(); + a.w=readmemw(addr); + setzn16(a.w); +} + +/*STA group*/ +static void staZp8() +{ + addr=zeropage(); + writemem(addr,a.b.l); +} +static void staZpx8() +{ + addr=zeropagex(); + writemem(addr,a.b.l); +} +static void staAbs8() +{ + addr=absolute(); + writemem(addr,a.b.l); +} +static void staAbsx8() +{ + addr=absolutex(); + writemem(addr,a.b.l); +} +static void staAbsy8() +{ + addr=absolutey(); + writemem(addr,a.b.l); +} +static void staLong8() +{ + addr=absolutelong(); + writemem(addr,a.b.l); +} +static void staLongx8() +{ + addr=absolutelongx(); +// rpclog("Addr %06X\n",addr); + writemem(addr,a.b.l); +} +static void staIndirect8() +{ + addr=indirect(); + writemem(addr,a.b.l); +} +static void staIndirectx8() +{ + addr=indirectx(); + writemem(addr,a.b.l); +} +static void staIndirecty8() +{ + addr=indirecty(); + writemem(addr,a.b.l); +} +static void staIndirectLong8() +{ + addr=indirectl(); + writemem(addr,a.b.l); +} +static void staIndirectLongy8() +{ + addr=indirectly(); + writemem(addr,a.b.l); +} +static void staSp8() +{ + addr=stack(); + writemem(addr,a.b.l); +} +static void staSIndirecty8() +{ + addr=sindirecty(); + writemem(addr,a.b.l); +} + +static void staZp16() +{ + addr=zeropage(); + writememw(addr,a.w); +} +static void staZpx16() +{ + addr=zeropagex(); + writememw(addr,a.w); +} +static void staAbs16() +{ + addr=absolute(); + writememw(addr,a.w); +} +static void staAbsx16() +{ + addr=absolutex(); + writememw(addr,a.w); +} +static void staAbsy16() +{ + addr=absolutey(); + writememw(addr,a.w); +} +static void staLong16() +{ + addr=absolutelong(); + writememw(addr,a.w); +} +static void staLongx16() +{ + addr=absolutelongx(); + writememw(addr,a.w); +// printf("Written %06X %04X %04X\n",addr,a.w,readmemw(addr)); +} +static void staIndirect16() +{ + addr=indirect(); + writememw(addr,a.w); +} +static void staIndirectx16() +{ + addr=indirectx(); + writememw(addr,a.w); +} +static void staIndirecty16() +{ + addr=indirecty(); + writememw(addr,a.w); +} +static void staIndirectLong16() +{ + addr=indirectl(); + writememw(addr,a.w); +} +static void staIndirectLongy16() +{ + addr=indirectly(); + writememw(addr,a.w); +} +static void staSp16() +{ + addr=stack(); + writememw(addr,a.w); +} +static void staSIndirecty16() +{ + addr=sindirecty(); + writememw(addr,a.w); +} + +/*STX group*/ +static void stxZp8() +{ + addr=zeropage(); + writemem(addr,x.b.l); +} +static void stxZpy8() +{ + addr=zeropagey(); + writemem(addr,x.b.l); +} +static void stxAbs8() +{ + addr=absolute(); + writemem(addr,x.b.l); +} + +static void stxZp16() +{ + addr=zeropage(); + writememw(addr,x.w); +} +static void stxZpy16() +{ + addr=zeropagey(); + writememw(addr,x.w); +} +static void stxAbs16() +{ + addr=absolute(); + writememw(addr,x.w); +} + +/*STY group*/ +static void styZp8() +{ + addr=zeropage(); + writemem(addr,y.b.l); +} +static void styZpx8() +{ + addr=zeropagex(); + writemem(addr,y.b.l); +} +static void styAbs8() +{ + addr=absolute(); + writemem(addr,y.b.l); +} + +static void styZp16() +{ + addr=zeropage(); + writememw(addr,y.w); +} +static void styZpx16() +{ + addr=zeropagex(); + writememw(addr,y.w); +} +static void styAbs16() +{ + addr=absolute(); + writememw(addr,y.w); +} + +/*STZ group*/ +static void stzZp8() +{ + addr=zeropage(); + writemem(addr,0); +} +static void stzZpx8() +{ + addr=zeropagex(); + writemem(addr,0); +} +static void stzAbs8() +{ + addr=absolute(); + writemem(addr,0); +} +static void stzAbsx8() +{ + addr=absolutex(); + writemem(addr,0); +} + +static void stzZp16() +{ + addr=zeropage(); + writememw(addr,0); +} +static void stzZpx16() +{ + addr=zeropagex(); + writememw(addr,0); +} +static void stzAbs16() +{ + addr=absolute(); + writememw(addr,0); +} +static void stzAbsx16() +{ + addr=absolutex(); + writememw(addr,0); +} + +/*ADC group*/ +static void adcImm8() +{ + uint16_t tempw; + uint8_t temp=readmem(pbr|pc); pc++; + if (p.d) { ADCBCD8(); } else { ADC8(); } +} +static void adcZp8() +{ + uint16_t tempw; + uint8_t temp; + addr=zeropage(); + temp=readmem(addr); + if (p.d) { ADCBCD8(); } else { ADC8(); } +} +static void adcZpx8() +{ + uint16_t tempw; + uint8_t temp; + addr=zeropagex(); + temp=readmem(addr); + if (p.d) { ADCBCD8(); } else { ADC8(); } +} +static void adcSp8() +{ + uint16_t tempw; + uint8_t temp; + addr=stack(); + temp=readmem(addr); + if (p.d) { ADCBCD8(); } else { ADC8(); } +} +static void adcAbs8() +{ + uint16_t tempw; + uint8_t temp; + addr=absolute(); + temp=readmem(addr); + if (p.d) { ADCBCD8(); } else { ADC8(); } +} +static void adcAbsx8() +{ + uint16_t tempw; + uint8_t temp; + addr=absolutex(); + temp=readmem(addr); + if (p.d) { ADCBCD8(); } else { ADC8(); } +} +static void adcAbsy8() +{ + uint16_t tempw; + uint8_t temp; + addr=absolutey(); + temp=readmem(addr); + if (p.d) { ADCBCD8(); } else { ADC8(); } +} +static void adcLong8() +{ + uint16_t tempw; + uint8_t temp; + addr=absolutelong(); + temp=readmem(addr); + if (p.d) { ADCBCD8(); } else { ADC8(); } +} +static void adcLongx8() +{ + uint16_t tempw; + uint8_t temp; + addr=absolutelongx(); + temp=readmem(addr); + if (p.d) { ADCBCD8(); } else { ADC8(); } +} +static void adcIndirect8() +{ + uint16_t tempw; + uint8_t temp; + addr=indirect(); + temp=readmem(addr); + if (p.d) { ADCBCD8(); } else { ADC8(); } +} +static void adcIndirectx8() +{ + uint16_t tempw; + uint8_t temp; + addr=indirectx(); + temp=readmem(addr); + if (p.d) { ADCBCD8(); } else { ADC8(); } +} +static void adcIndirecty8() +{ + uint16_t tempw; + uint8_t temp; + addr=indirecty(); + temp=readmem(addr); + if (p.d) { ADCBCD8(); } else { ADC8(); } +} +static void adcsIndirecty8() +{ + uint16_t tempw; + uint8_t temp; + addr=sindirecty(); + temp=readmem(addr); + if (p.d) { ADCBCD8(); } else { ADC8(); } +} +static void adcIndirectLong8() +{ + uint16_t tempw; + uint8_t temp; + addr=indirectl(); + temp=readmem(addr); + if (p.d) { ADCBCD8(); } else { ADC8(); } +} +static void adcIndirectLongy8() +{ + uint16_t tempw; + uint8_t temp; + addr=indirectly(); + temp=readmem(addr); + if (p.d) { ADCBCD8(); } else { ADC8(); } +} + +static void adcImm16() +{ + uint32_t templ; + uint16_t tempw; + tempw=readmemw(pbr|pc); pc+=2; + if (p.d) { ADCBCD16(); } else { ADC16(); } +} +static void adcZp16() +{ + uint32_t templ; + uint16_t tempw; + addr=zeropage(); + tempw=readmemw(addr); + if (p.d) { ADCBCD16(); } else { ADC16(); } +} +static void adcZpx16() +{ + uint32_t templ; + uint16_t tempw; + addr=zeropagex(); + tempw=readmemw(addr); + if (p.d) { ADCBCD16(); } else { ADC16(); } +} +static void adcSp16() +{ + uint32_t templ; + uint16_t tempw; + addr=stack(); + tempw=readmemw(addr); + if (p.d) { ADCBCD16(); } else { ADC16(); } +} +static void adcAbs16() +{ + uint32_t templ; + uint16_t tempw; + addr=absolute(); + tempw=readmemw(addr); + if (p.d) { ADCBCD16(); } else { ADC16(); } +} +static void adcAbsx16() +{ + uint32_t templ; + uint16_t tempw; + addr=absolutex(); + tempw=readmemw(addr); + if (p.d) { ADCBCD16(); } else { ADC16(); } +} +static void adcAbsy16() +{ + uint32_t templ; + uint16_t tempw; + addr=absolutey(); + tempw=readmemw(addr); + if (p.d) { ADCBCD16(); } else { ADC16(); } +} +static void adcLong16() +{ + uint32_t templ; + uint16_t tempw; + addr=absolutelong(); + tempw=readmemw(addr); + if (p.d) { ADCBCD16(); } else { ADC16(); } +} +static void adcLongx16() +{ + uint32_t templ; + uint16_t tempw; + addr=absolutelongx(); + tempw=readmemw(addr); + if (p.d) { ADCBCD16(); } else { ADC16(); } +} +static void adcIndirect16() +{ + uint32_t templ; + uint16_t tempw; + addr=indirect(); + tempw=readmemw(addr); + if (p.d) { ADCBCD16(); } else { ADC16(); } +} +static void adcIndirectx16() +{ + uint32_t templ; + uint16_t tempw; + addr=indirectx(); + tempw=readmemw(addr); + if (p.d) { ADCBCD16(); } else { ADC16(); } +} +static void adcIndirecty16() +{ + uint32_t templ; + uint16_t tempw; + addr=indirecty(); + tempw=readmemw(addr); + if (p.d) { ADCBCD16(); } else { ADC16(); } +} +static void adcsIndirecty16() +{ + uint32_t templ; + uint16_t tempw; + addr=sindirecty(); + tempw=readmemw(addr); + if (p.d) { ADCBCD16(); } else { ADC16(); } +} +static void adcIndirectLong16() +{ + uint32_t templ; + uint16_t tempw; + addr=indirectl(); + tempw=readmemw(addr); + if (p.d) { ADCBCD16(); } else { ADC16(); } +} +static void adcIndirectLongy16() +{ + uint32_t templ; + uint16_t tempw; + addr=indirectly(); + tempw=readmemw(addr); + if (p.d) { ADCBCD16(); } else { ADC16(); } +} + +/*SBC group*/ +static void sbcImm8() +{ + uint16_t tempw; + uint8_t temp=readmem(pbr|pc); pc++; + if (p.d) { SBCBCD8(); } else { SBC8(); } +} +static void sbcZp8() +{ + uint16_t tempw; + uint8_t temp; + addr=zeropage(); + temp=readmem(addr); + if (p.d) { SBCBCD8(); } else { SBC8(); } +} +static void sbcZpx8() +{ + uint16_t tempw; + uint8_t temp; + addr=zeropagex(); + temp=readmem(addr); + if (p.d) { SBCBCD8(); } else { SBC8(); } +} +static void sbcSp8() +{ + uint16_t tempw; + uint8_t temp; + addr=stack(); + temp=readmem(addr); + if (p.d) { SBCBCD8(); } else { SBC8(); } +} +static void sbcAbs8() +{ + uint16_t tempw; + uint8_t temp; + addr=absolute(); + temp=readmem(addr); + if (p.d) { SBCBCD8(); } else { SBC8(); } +} +static void sbcAbsx8() +{ + uint16_t tempw; + uint8_t temp; + addr=absolutex(); + temp=readmem(addr); + if (p.d) { SBCBCD8(); } else { SBC8(); } +} +static void sbcAbsy8() +{ + uint16_t tempw; + uint8_t temp; + addr=absolutey(); + temp=readmem(addr); + if (p.d) { SBCBCD8(); } else { SBC8(); } +} +static void sbcLong8() +{ + uint16_t tempw; + uint8_t temp; + addr=absolutelong(); + temp=readmem(addr); + if (p.d) { SBCBCD8(); } else { SBC8(); } +} +static void sbcLongx8() +{ + uint16_t tempw; + uint8_t temp; + addr=absolutelongx(); + temp=readmem(addr); + if (p.d) { SBCBCD8(); } else { SBC8(); } +} +static void sbcIndirect8() +{ + uint16_t tempw; + uint8_t temp; + addr=indirect(); + temp=readmem(addr); + if (p.d) { SBCBCD8(); } else { SBC8(); } +} +static void sbcIndirectx8() +{ + uint16_t tempw; + uint8_t temp; + addr=indirectx(); + temp=readmem(addr); + if (p.d) { SBCBCD8(); } else { SBC8(); } +} +static void sbcIndirecty8() +{ + uint16_t tempw; + uint8_t temp; + addr=indirecty(); + temp=readmem(addr); + if (p.d) { SBCBCD8(); } else { SBC8(); } +} +static void sbcsIndirecty8() +{ + uint16_t tempw; + uint8_t temp; + addr=sindirecty(); + temp=readmem(addr); + if (p.d) { SBCBCD8(); } else { SBC8(); } +} +static void sbcIndirectLong8() +{ + uint16_t tempw; + uint8_t temp; + addr=indirectl(); + temp=readmem(addr); + if (p.d) { SBCBCD8(); } else { SBC8(); } +} +static void sbcIndirectLongy8() +{ + uint16_t tempw; + uint8_t temp; + addr=indirectly(); + temp=readmem(addr); + if (p.d) { SBCBCD8(); } else { SBC8(); } +} + +static void sbcImm16() +{ + uint32_t templ; + uint16_t tempw; + tempw=readmemw(pbr|pc); pc+=2; + if (p.d) { SBCBCD16(); } else { SBC16(); } +} +static void sbcZp16() +{ + uint32_t templ; + uint16_t tempw; + addr=zeropage(); + tempw=readmemw(addr); + if (p.d) { SBCBCD16(); } else { SBC16(); } +} +static void sbcZpx16() +{ + uint32_t templ; + uint16_t tempw; + addr=zeropagex(); + tempw=readmemw(addr); + if (p.d) { SBCBCD16(); } else { SBC16(); } +} +static void sbcSp16() +{ + uint32_t templ; + uint16_t tempw; + addr=stack(); + tempw=readmemw(addr); + if (p.d) { SBCBCD16(); } else { SBC16(); } +} +static void sbcAbs16() +{ + uint32_t templ; + uint16_t tempw; + addr=absolute(); + tempw=readmemw(addr); + if (p.d) { SBCBCD16(); } else { SBC16(); } +} +static void sbcAbsx16() +{ + uint32_t templ; + uint16_t tempw; + addr=absolutex(); + tempw=readmemw(addr); + if (p.d) { SBCBCD16(); } else { SBC16(); } +} +static void sbcAbsy16() +{ + uint32_t templ; + uint16_t tempw; + addr=absolutey(); + tempw=readmemw(addr); + if (p.d) { SBCBCD16(); } else { SBC16(); } +} +static void sbcLong16() +{ + uint32_t templ; + uint16_t tempw; + addr=absolutelong(); + tempw=readmemw(addr); + if (p.d) { SBCBCD16(); } else { SBC16(); } +} +static void sbcLongx16() +{ + uint32_t templ; + uint16_t tempw; + addr=absolutelongx(); + tempw=readmemw(addr); + if (p.d) { SBCBCD16(); } else { SBC16(); } +} +static void sbcIndirect16() +{ + uint32_t templ; + uint16_t tempw; + addr=indirect(); + tempw=readmemw(addr); + if (p.d) { SBCBCD16(); } else { SBC16(); } +} +static void sbcIndirectx16() +{ + uint32_t templ; + uint16_t tempw; + addr=indirectx(); + tempw=readmemw(addr); + if (p.d) { SBCBCD16(); } else { SBC16(); } +} +static void sbcIndirecty16() +{ + uint32_t templ; + uint16_t tempw; + addr=indirecty(); + tempw=readmemw(addr); + if (p.d) { SBCBCD16(); } else { SBC16(); } +} +static void sbcsIndirecty16() +{ + uint32_t templ; + uint16_t tempw; + addr=sindirecty(); + tempw=readmemw(addr); + if (p.d) { SBCBCD16(); } else { SBC16(); } +} +static void sbcIndirectLong16() +{ + uint32_t templ; + uint16_t tempw; + addr=indirectl(); + tempw=readmemw(addr); + if (p.d) { SBCBCD16(); } else { SBC16(); } +} +static void sbcIndirectLongy16() +{ + uint32_t templ; + uint16_t tempw; + addr=indirectly(); + tempw=readmemw(addr); + if (p.d) { SBCBCD16(); } else { SBC16(); } +} + +/*EOR group*/ +static void eorImm8() +{ + a.b.l^=readmem(pbr|pc); pc++; + setzn8(a.b.l); +} +static void eorZp8() +{ + addr=zeropage(); + a.b.l^=readmem(addr); + setzn8(a.b.l); +} +static void eorZpx8() +{ + addr=zeropagex(); + a.b.l^=readmem(addr); + setzn8(a.b.l); +} +static void eorSp8() +{ + addr=stack(); + a.b.l^=readmem(addr); + setzn8(a.b.l); +} +static void eorAbs8() +{ + addr=absolute(); + a.b.l^=readmem(addr); + setzn8(a.b.l); +} +static void eorAbsx8() +{ + addr=absolutex(); + a.b.l^=readmem(addr); + setzn8(a.b.l); +} +static void eorAbsy8() +{ + addr=absolutey(); + a.b.l^=readmem(addr); + setzn8(a.b.l); +} +static void eorLong8() +{ + addr=absolutelong(); + a.b.l^=readmem(addr); + setzn8(a.b.l); +} +static void eorLongx8() +{ + addr=absolutelongx(); + a.b.l^=readmem(addr); + setzn8(a.b.l); +} +static void eorIndirect8() +{ + addr=indirect(); + a.b.l^=readmem(addr); + setzn8(a.b.l); +} +static void eorIndirectx8() +{ + addr=indirectx(); + a.b.l^=readmem(addr); + setzn8(a.b.l); +} +static void eorIndirecty8() +{ + addr=indirecty(); + a.b.l^=readmem(addr); + setzn8(a.b.l); +} +static void eorsIndirecty8() +{ + addr=sindirecty(); + a.b.l^=readmem(addr); + setzn8(a.b.l); +} +static void eorIndirectLong8() +{ + addr=indirectl(); + a.b.l^=readmem(addr); + setzn8(a.b.l); +} +static void eorIndirectLongy8() +{ + addr=indirectly(); + a.b.l^=readmem(addr); + setzn8(a.b.l); +} + +static void eorImm16() +{ + a.w^=readmemw(pbr|pc); pc+=2; + setzn16(a.w); +} +static void eorZp16() +{ + addr=zeropage(); + a.w^=readmemw(addr); + setzn16(a.w); +} +static void eorZpx16() +{ + addr=zeropagex(); + a.w^=readmemw(addr); + setzn16(a.w); +} +static void eorSp16() +{ + addr=stack(); + a.w^=readmemw(addr); + setzn16(a.w); +} +static void eorAbs16() +{ + addr=absolute(); + a.w^=readmemw(addr); + setzn16(a.w); +} +static void eorAbsx16() +{ + addr=absolutex(); + a.w^=readmemw(addr); + setzn16(a.w); +} +static void eorAbsy16() +{ + addr=absolutey(); + a.w^=readmemw(addr); + setzn16(a.w); +} +static void eorLong16() +{ + addr=absolutelong(); + a.w^=readmemw(addr); + setzn16(a.w); +} +static void eorLongx16() +{ + addr=absolutelongx(); + a.w^=readmemw(addr); + setzn16(a.w); +} +static void eorIndirect16() +{ + addr=indirect(); + a.w^=readmemw(addr); + setzn16(a.w); +} +static void eorIndirectx16() +{ + addr=indirectx(); + a.w^=readmemw(addr); + setzn16(a.w); +} +static void eorIndirecty16() +{ + addr=indirecty(); + a.w^=readmemw(addr); + setzn16(a.w); +} +static void eorsIndirecty16() +{ + addr=sindirecty(); + a.w^=readmemw(addr); + setzn16(a.w); +} +static void eorIndirectLong16() +{ + addr=indirectl(); + a.w^=readmemw(addr); + setzn16(a.w); +} +static void eorIndirectLongy16() +{ + addr=indirectly(); + a.w^=readmemw(addr); + setzn16(a.w); +} + +/*AND group*/ +static void andImm8() +{ + a.b.l&=readmem(pbr|pc); pc++; + setzn8(a.b.l); +} +static void andZp8() +{ + addr=zeropage(); + a.b.l&=readmem(addr); + setzn8(a.b.l); +} +static void andZpx8() +{ + addr=zeropagex(); + a.b.l&=readmem(addr); + setzn8(a.b.l); +} +static void andSp8() +{ + addr=stack(); + a.b.l&=readmem(addr); + setzn8(a.b.l); +} +static void andAbs8() +{ + addr=absolute(); + a.b.l&=readmem(addr); + setzn8(a.b.l); +} +static void andAbsx8() +{ + addr=absolutex(); + a.b.l&=readmem(addr); + setzn8(a.b.l); +} +static void andAbsy8() +{ + addr=absolutey(); + a.b.l&=readmem(addr); + setzn8(a.b.l); +} +static void andLong8() +{ + addr=absolutelong(); + a.b.l&=readmem(addr); + setzn8(a.b.l); +} +static void andLongx8() +{ + addr=absolutelongx(); + a.b.l&=readmem(addr); + setzn8(a.b.l); +} +static void andIndirect8() +{ + addr=indirect(); + a.b.l&=readmem(addr); + setzn8(a.b.l); +} +static void andIndirectx8() +{ + addr=indirectx(); + a.b.l&=readmem(addr); + setzn8(a.b.l); +} +static void andIndirecty8() +{ + addr=indirecty(); + a.b.l&=readmem(addr); + setzn8(a.b.l); +} +static void andsIndirecty8() +{ + addr=sindirecty(); + a.b.l&=readmem(addr); + setzn8(a.b.l); +} +static void andIndirectLong8() +{ + addr=indirectl(); + a.b.l&=readmem(addr); + setzn8(a.b.l); +} +static void andIndirectLongy8() +{ + addr=indirectly(); + a.b.l&=readmem(addr); + setzn8(a.b.l); +} + +static void andImm16() +{ + a.w&=readmemw(pbr|pc); pc+=2; + setzn16(a.w); +} +static void andZp16() +{ + addr=zeropage(); + a.w&=readmemw(addr); + setzn16(a.w); +} +static void andZpx16() +{ + addr=zeropagex(); + a.w&=readmemw(addr); + setzn16(a.w); +} +static void andSp16() +{ + addr=stack(); + a.w&=readmemw(addr); + setzn16(a.w); +} +static void andAbs16() +{ + addr=absolute(); + a.w&=readmemw(addr); + setzn16(a.w); +} +static void andAbsx16() +{ + addr=absolutex(); + a.w&=readmemw(addr); + setzn16(a.w); +} +static void andAbsy16() +{ + addr=absolutey(); + a.w&=readmemw(addr); + setzn16(a.w); +} +static void andLong16() +{ + addr=absolutelong(); + a.w&=readmemw(addr); + setzn16(a.w); +} +static void andLongx16() +{ + addr=absolutelongx(); + a.w&=readmemw(addr); + setzn16(a.w); +} +static void andIndirect16() +{ + addr=indirect(); + a.w&=readmemw(addr); + setzn16(a.w); +} +static void andIndirectx16() +{ + addr=indirectx(); + a.w&=readmemw(addr); + setzn16(a.w); +} +static void andIndirecty16() +{ + addr=indirecty(); + a.w&=readmemw(addr); + setzn16(a.w); +} +static void andsIndirecty16() +{ + addr=sindirecty(); + a.w&=readmemw(addr); + setzn16(a.w); +} +static void andIndirectLong16() +{ + addr=indirectl(); + a.w&=readmemw(addr); + setzn16(a.w); +} +static void andIndirectLongy16() +{ + addr=indirectly(); + a.w&=readmemw(addr); + setzn16(a.w); +} + +/*ORA group*/ +static void oraImm8() +{ + a.b.l|=readmem(pbr|pc); pc++; + setzn8(a.b.l); +} +static void oraZp8() +{ + addr=zeropage(); + a.b.l|=readmem(addr); + setzn8(a.b.l); +} +static void oraZpx8() +{ + addr=zeropagex(); + a.b.l|=readmem(addr); + setzn8(a.b.l); +} +static void oraSp8() +{ + addr=stack(); + a.b.l|=readmem(addr); + setzn8(a.b.l); +} +static void oraAbs8() +{ + addr=absolute(); + a.b.l|=readmem(addr); + setzn8(a.b.l); +} +static void oraAbsx8() +{ + addr=absolutex(); + a.b.l|=readmem(addr); + setzn8(a.b.l); +} +static void oraAbsy8() +{ + addr=absolutey(); + a.b.l|=readmem(addr); + setzn8(a.b.l); +} +static void oraLong8() +{ + addr=absolutelong(); + a.b.l|=readmem(addr); + setzn8(a.b.l); +} +static void oraLongx8() +{ + addr=absolutelongx(); + a.b.l|=readmem(addr); + setzn8(a.b.l); +} +static void oraIndirect8() +{ + addr=indirect(); + a.b.l|=readmem(addr); + setzn8(a.b.l); +} +static void oraIndirectx8() +{ + addr=indirectx(); + a.b.l|=readmem(addr); + setzn8(a.b.l); +} +static void oraIndirecty8() +{ + addr=indirecty(); + a.b.l|=readmem(addr); + setzn8(a.b.l); +} +static void orasIndirecty8() +{ + addr=sindirecty(); + a.b.l|=readmem(addr); + setzn8(a.b.l); +} +static void oraIndirectLong8() +{ + addr=indirectl(); + a.b.l|=readmem(addr); + setzn8(a.b.l); +} +static void oraIndirectLongy8() +{ + addr=indirectly(); + a.b.l|=readmem(addr); + setzn8(a.b.l); +} + +static void oraImm16() +{ + a.w|=readmemw(pbr|pc); pc+=2; + setzn16(a.w); +} +static void oraZp16() +{ + addr=zeropage(); + a.w|=readmemw(addr); + setzn16(a.w); +} +static void oraZpx16() +{ + addr=zeropagex(); + a.w|=readmemw(addr); + setzn16(a.w); +} +static void oraSp16() +{ + addr=stack(); + a.w|=readmemw(addr); + setzn16(a.w); +} +static void oraAbs16() +{ + addr=absolute(); + a.w|=readmemw(addr); + setzn16(a.w); +} +static void oraAbsx16() +{ + addr=absolutex(); + a.w|=readmemw(addr); + setzn16(a.w); +} +static void oraAbsy16() +{ + addr=absolutey(); + a.w|=readmemw(addr); + setzn16(a.w); +} +static void oraLong16() +{ + addr=absolutelong(); + a.w|=readmemw(addr); + setzn16(a.w); +} +static void oraLongx16() +{ + addr=absolutelongx(); + a.w|=readmemw(addr); + setzn16(a.w); +} +static void oraIndirect16() +{ + addr=indirect(); + a.w|=readmemw(addr); + setzn16(a.w); +} +static void oraIndirectx16() +{ + addr=indirectx(); + a.w|=readmemw(addr); + setzn16(a.w); +} +static void oraIndirecty16() +{ + addr=indirecty(); + a.w|=readmemw(addr); + setzn16(a.w); +} +static void orasIndirecty16() +{ + addr=sindirecty(); + a.w|=readmem(addr); + setzn16(a.w); +} +static void oraIndirectLong16() +{ + addr=indirectl(); + a.w|=readmemw(addr); + setzn16(a.w); +} +static void oraIndirectLongy16() +{ + addr=indirectly(); + a.w|=readmemw(addr); + setzn16(a.w); +} + +/*BIT group*/ +static void bitImm8() +{ + uint8_t temp=readmem(pbr|pc); pc++; + p.z=!(temp&a.b.l); +} +static void bitImm16() +{ + uint16_t temp=readmemw(pbr|pc); pc+=2; + p.z=!(temp&a.w); +} + +static void bitZp8() +{ + uint8_t temp; + addr=zeropage(); + temp=readmem(addr); + p.z=!(temp&a.b.l); + p.v=temp&0x40; + p.n=temp&0x80; +} +static void bitZp16() +{ + uint16_t temp; + addr=zeropage(); + temp=readmemw(addr); + p.z=!(temp&a.w); + p.v=temp&0x4000; + p.n=temp&0x8000; +} + +static void bitZpx8() +{ + uint8_t temp; + addr=zeropagex(); + temp=readmem(addr); + p.z=!(temp&a.b.l); + p.v=temp&0x40; + p.n=temp&0x80; +} +static void bitZpx16() +{ + uint16_t temp; + addr=zeropagex(); + temp=readmemw(addr); + p.z=!(temp&a.w); + p.v=temp&0x4000; + p.n=temp&0x8000; +} + +static void bitAbs8() +{ + uint8_t temp; + addr=absolute(); + temp=readmem(addr); + p.z=!(temp&a.b.l); + p.v=temp&0x40; + p.n=temp&0x80; +} +static void bitAbs16() +{ + uint16_t temp; + addr=absolute(); + temp=readmemw(addr); + p.z=!(temp&a.w); + p.v=temp&0x4000; + p.n=temp&0x8000; +} + +static void bitAbsx8() +{ + uint8_t temp; + addr=absolutex(); + temp=readmem(addr); + p.z=!(temp&a.b.l); + p.v=temp&0x40; + p.n=temp&0x80; +} +static void bitAbsx16() +{ + uint16_t temp; + addr=absolutex(); + temp=readmemw(addr); + p.z=!(temp&a.w); + p.v=temp&0x4000; + p.n=temp&0x8000; +} + +/*CMP group*/ +static void cmpImm8() +{ + uint8_t temp; + temp=readmem(pbr|pc); pc++; + setzn8(a.b.l-temp); + p.c=(a.b.l>=temp); +} +static void cmpZp8() +{ + uint8_t temp; + addr=zeropage(); + temp=readmem(addr); + setzn8(a.b.l-temp); + p.c=(a.b.l>=temp); +} +static void cmpZpx8() +{ + uint8_t temp; + addr=zeropagex(); + temp=readmem(addr); + setzn8(a.b.l-temp); + p.c=(a.b.l>=temp); +} +static void cmpSp8() +{ + uint8_t temp; + addr=stack(); + temp=readmem(addr); + setzn8(a.b.l-temp); + p.c=(a.b.l>=temp); +} +static void cmpAbs8() +{ + uint8_t temp; + addr=absolute(); + temp=readmem(addr); + setzn8(a.b.l-temp); + p.c=(a.b.l>=temp); +} +static void cmpAbsx8() +{ + uint8_t temp; + addr=absolutex(); + temp=readmem(addr); + setzn8(a.b.l-temp); + p.c=(a.b.l>=temp); +} +static void cmpAbsy8() +{ + uint8_t temp; + addr=absolutey(); + temp=readmem(addr); + setzn8(a.b.l-temp); + p.c=(a.b.l>=temp); +} +static void cmpLong8() +{ + uint8_t temp; + addr=absolutelong(); + temp=readmem(addr); + setzn8(a.b.l-temp); + p.c=(a.b.l>=temp); +} +static void cmpLongx8() +{ + uint8_t temp; + addr=absolutelongx(); + temp=readmem(addr); + setzn8(a.b.l-temp); + p.c=(a.b.l>=temp); +} +static void cmpIndirect8() +{ + uint8_t temp; + addr=indirect(); + temp=readmem(addr); + setzn8(a.b.l-temp); + p.c=(a.b.l>=temp); +} +static void cmpIndirectx8() +{ + uint8_t temp; + addr=indirectx(); + temp=readmem(addr); + setzn8(a.b.l-temp); + p.c=(a.b.l>=temp); +} +static void cmpIndirecty8() +{ + uint8_t temp; + addr=indirecty(); + temp=readmem(addr); + setzn8(a.b.l-temp); + p.c=(a.b.l>=temp); +} +static void cmpsIndirecty8() +{ + uint8_t temp; + addr=sindirecty(); + temp=readmem(addr); + setzn8(a.b.l-temp); + p.c=(a.b.l>=temp); +} +static void cmpIndirectLong8() +{ + uint8_t temp; + addr=indirectl(); + temp=readmem(addr); + setzn8(a.b.l-temp); + p.c=(a.b.l>=temp); +} +static void cmpIndirectLongy8() +{ + uint8_t temp; + addr=indirectly(); + temp=readmem(addr); + setzn8(a.b.l-temp); + p.c=(a.b.l>=temp); +} + +static void cmpImm16() +{ + uint16_t temp; + temp=readmemw(pbr|pc); pc+=2; + setzn16(a.w-temp); + p.c=(a.w>=temp); +} +static void cmpZp16() +{ + uint16_t temp; + addr=zeropage(); + temp=readmemw(addr); + setzn16(a.w-temp); + p.c=(a.w>=temp); +} +static void cmpSp16() +{ + uint16_t temp; + addr=stack(); + temp=readmemw(addr); + setzn16(a.w-temp); + p.c=(a.w>=temp); +} +static void cmpZpx16() +{ + uint16_t temp; + addr=zeropagex(); + temp=readmemw(addr); + setzn16(a.w-temp); + p.c=(a.w>=temp); +} +static void cmpAbs16() +{ + uint16_t temp; + addr=absolute(); + temp=readmemw(addr); + setzn16(a.w-temp); + p.c=(a.w>=temp); +} +static void cmpAbsx16() +{ + uint16_t temp; + addr=absolutex(); + temp=readmemw(addr); + setzn16(a.w-temp); + p.c=(a.w>=temp); +} +static void cmpAbsy16() +{ + uint16_t temp; + addr=absolutey(); + temp=readmemw(addr); + setzn16(a.w-temp); + p.c=(a.w>=temp); +} +static void cmpLong16() +{ + uint16_t temp; + addr=absolutelong(); + temp=readmemw(addr); + setzn16(a.w-temp); + p.c=(a.w>=temp); +} +static void cmpLongx16() +{ + uint16_t temp; + addr=absolutelongx(); + temp=readmemw(addr); + setzn16(a.w-temp); + p.c=(a.w>=temp); +} +static void cmpIndirect16() +{ + uint16_t temp; + addr=indirect(); + temp=readmemw(addr); + setzn16(a.w-temp); + p.c=(a.w>=temp); +} +static void cmpIndirectx16() +{ + uint16_t temp; + addr=indirectx(); + temp=readmemw(addr); + setzn16(a.w-temp); + p.c=(a.w>=temp); +} +static void cmpIndirecty16() +{ + uint16_t temp; + addr=indirecty(); + temp=readmemw(addr); + setzn16(a.w-temp); + p.c=(a.w>=temp); +} +static void cmpsIndirecty16() +{ + uint16_t temp; + addr=sindirecty(); + temp=readmemw(addr); + setzn16(a.w-temp); + p.c=(a.w>=temp); +} +static void cmpIndirectLong16() +{ + uint16_t temp; + addr=indirectl(); + temp=readmemw(addr); + setzn16(a.w-temp); + p.c=(a.w>=temp); +} +static void cmpIndirectLongy16() +{ + uint16_t temp; + addr=indirectly(); + temp=readmemw(addr); + setzn16(a.w-temp); + p.c=(a.w>=temp); +} + +/*Stack Group*/ +static void phb() +{ + readmem(pbr|pc); + writemem(s.w,dbr>>16); s.w--; +// printf("PHB %04X\n",s.w); +} +static void phbe() +{ + readmem(pbr|pc); + writemem(s.w,dbr>>16); s.b.l--; +} + +static void phk() +{ + readmem(pbr|pc); + writemem(s.w,pbr>>16); s.w--; +// printf("PHK %04X\n",s.w); +} +static void phke() +{ + readmem(pbr|pc); + writemem(s.w,pbr>>16); s.b.l--; +} + +static void pea() +{ + addr=readmemw(pbr|pc); pc+=2; + writemem(s.w,addr>>8); s.w--; + writemem(s.w,addr&0xFF); s.w--; +// printf("PEA %04X\n",s.w); +} + +static void pei() +{ + addr=indirect(); + writemem(s.w,addr>>8); s.w--; + writemem(s.w,addr&0xFF); s.w--; + //printf("PEI %04X\n",s.w); +} + +static void per() +{ + addr=readmemw(pbr|pc); pc+=2; + addr+=pc; + writemem(s.w,addr>>8); s.w--; + writemem(s.w,addr&0xFF); s.w--; + //printf("PER %04X\n",s.w); +} + +static void phd() +{ + writemem(s.w,dp>>8); s.w--; + writemem(s.w,dp&0xFF); s.w--; + //printf("PHD %04X\n",s.w); +} +static void pld() +{ + readmem(pbr|pc); + s.w++; cycles--; clockspc(6); + dp=readmem(s.w); + s.w++; dp|=(readmem(s.w)<<8); + //printf("PLD %04X\n",s.w); +} + +static void pha8() +{ + readmem(pbr|pc); + writemem(s.w,a.b.l); s.w--; + //printf("PHA %04X\n",s.w); +} +static void pha16() +{ + readmem(pbr|pc); + writemem(s.w,a.b.h); s.w--; + writemem(s.w,a.b.l); s.w--; + //printf("PHA %04X\n",s.w); +} + +static void phx8() +{ + readmem(pbr|pc); + writemem(s.w,x.b.l); s.w--; + //printf("PHX %04X\n",s.w); +} +static void phx16() +{ + readmem(pbr|pc); + writemem(s.w,x.b.h); s.w--; + writemem(s.w,x.b.l); s.w--; + //printf("PHX %04X\n",s.w); +} + +static void phy8() +{ + readmem(pbr|pc); + writemem(s.w,y.b.l); s.w--; + //printf("PHY %04X\n",s.w); +} +static void phy16() +{ + readmem(pbr|pc); + writemem(s.w,y.b.h); s.w--; + writemem(s.w,y.b.l); s.w--; + //printf("PHY %04X\n",s.w); +} + +static void pla8() +{ + readmem(pbr|pc); + s.w++; cycles--; clockspc(6); + a.b.l=readmem(s.w); + setzn8(a.b.l); + //printf("PLA %04X\n",s.w); +} +static void pla16() +{ + readmem(pbr|pc); + s.w++; cycles--; clockspc(6); + a.b.l=readmem(s.w); + s.w++; a.b.h=readmem(s.w); + setzn16(a.w); + //printf("PLA %04X\n",s.w); +} + +static void plx8() +{ + readmem(pbr|pc); + s.w++; cycles--; clockspc(6); + x.b.l=readmem(s.w); + setzn8(x.b.l); + //printf("PLX %04X\n",s.w); +} +static void plx16() +{ + readmem(pbr|pc); + s.w++; cycles--; clockspc(6); + x.b.l=readmem(s.w); + s.w++; x.b.h=readmem(s.w); + setzn16(x.w); + //printf("PLX %04X\n",s.w); +} + +static void ply8() +{ + readmem(pbr|pc); + s.w++; cycles--; clockspc(6); + y.b.l=readmem(s.w); + setzn8(y.b.l); + //printf("PLY %04X\n",s.w); +} +static void ply16() +{ + readmem(pbr|pc); + s.w++; cycles--; clockspc(6); + y.b.l=readmem(s.w); + s.w++; y.b.h=readmem(s.w); + setzn16(y.w); + //printf("PLY %04X\n",s.w); +} + +static void plb() +{ + readmem(pbr|pc); + s.w++; cycles--; clockspc(6); + dbr=readmem(s.w)<<16; + //printf("PLB %04X\n",s.w); +} +static void plbe() +{ + readmem(pbr|pc); + s.b.l++; cycles--; clockspc(6); + dbr=readmem(s.w)<<16; +} + +static void plp() +{ + uint8_t temp=readmem(s.w+1); s.w++; + p.c=temp&1; + p.z=temp&2; + p.i=temp&4; + p.d=temp&8; + p.ex=temp&0x10; + p.m=temp&0x20; + p.v=temp&0x40; + p.n=temp&0x80; + cycles-=2; clockspc(12); + updatecpumode(); + //printf("PLP %04X\n",s.w); +} +static void plpe() +{ + uint8_t temp; + s.b.l++; temp=readmem(s.w); + p.c=temp&1; + p.z=temp&2; + p.i=temp&4; + p.d=temp&8; + p.v=temp&0x40; + p.n=temp&0x80; + cycles-=2; clockspc(12); +} + +static void php() +{ + uint8_t temp=(p.c)?1:0; + if (p.z) temp|=2; + if (p.i) temp|=4; + if (p.d) temp|=8; + if (p.v) temp|=0x40; + if (p.n) temp|=0x80; + if (p.ex) temp|=0x10; + if (p.m) temp|=0x20; + readmem(pbr|pc); + writemem(s.w,temp); s.w--; + //printf("PHP %04X\n",s.w); +} +static void phpe() +{ + uint8_t temp=(p.c)?1:0; + if (p.z) temp|=2; + if (p.i) temp|=4; + if (p.d) temp|=8; + if (p.v) temp|=0x40; + if (p.n) temp|=0x80; + temp|=0x30; + readmem(pbr|pc); + writemem(s.w,temp); s.b.l--; +} + +/*CPX group*/ +static void cpxImm8() +{ + uint8_t temp=readmem(pbr|pc); pc++; + setzn8(x.b.l-temp); + p.c=(x.b.l>=temp); +} +static void cpxImm16() +{ + uint16_t temp=readmemw(pbr|pc); pc+=2; + setzn16(x.w-temp); + p.c=(x.w>=temp); +} + +static void cpxZp8() +{ + uint8_t temp; + addr=zeropage(); + temp=readmem(addr); + setzn8(x.b.l-temp); + p.c=(x.b.l>=temp); +} +static void cpxZp16() +{ + uint16_t temp; + addr=zeropage(); + temp=readmemw(addr); + setzn16(x.w-temp); + p.c=(x.w>=temp); +} + +static void cpxAbs8() +{ + uint8_t temp; + addr=absolute(); + temp=readmem(addr); + setzn8(x.b.l-temp); + p.c=(x.b.l>=temp); +} +static void cpxAbs16() +{ + uint16_t temp; + addr=absolute(); + temp=readmemw(addr); + setzn16(x.w-temp); + p.c=(x.w>=temp); +} + +/*CPY group*/ +static void cpyImm8() +{ + uint8_t temp=readmem(pbr|pc); pc++; + setzn8(y.b.l-temp); + p.c=(y.b.l>=temp); +} +static void cpyImm16() +{ + uint16_t temp=readmemw(pbr|pc); pc+=2; + setzn16(y.w-temp); + p.c=(y.w>=temp); +} + +static void cpyZp8() +{ + uint8_t temp; + addr=zeropage(); + temp=readmem(addr); + setzn8(y.b.l-temp); + p.c=(y.b.l>=temp); +} +static void cpyZp16() +{ + uint16_t temp; + addr=zeropage(); + temp=readmemw(addr); + setzn16(y.w-temp); + p.c=(y.w>=temp); +} + +static void cpyAbs8() +{ + uint8_t temp; + addr=absolute(); + temp=readmem(addr); + setzn8(y.b.l-temp); + p.c=(y.b.l>=temp); +} +static void cpyAbs16() +{ + uint16_t temp; + addr=absolute(); + temp=readmemw(addr); + setzn16(y.w-temp); + p.c=(y.w>=temp); +} + +/*Branch group*/ +static void bcc() +{ + int8_t temp=(int8_t)readmem(pbr|pc); pc++; + if (!p.c) + { + pc+=temp; + cycles--; clockspc(6); + } +} +static void bcs() +{ + int8_t temp=(int8_t)readmem(pbr|pc); pc++; + if (p.c) + { + pc+=temp; + cycles--; clockspc(6); + } +} +static void beq() +{ + int8_t temp=(int8_t)readmem(pbr|pc); pc++; +// if (setzf>0) p.z=0; +// if (setzf<0) p.z=1; +// setzf=0; + if (p.z) + { + pc+=temp; + cycles--; clockspc(6); + } +} +static void bne() +{ + int8_t temp=(int8_t)readmem(pbr|pc); pc++; +// if (pc==0x8D44) printf("BNE %i %i ",setzf,p.z); +// if (setzf>0) p.z=1; +// if (setzf<0) p.z=0; +// setzf=0; +// if (pc==0x8D44) printf("%i\n",p.z); +// if (skipz) //printf("skipz "); + if (!p.z)// && !skipz) + { + pc+=temp; + cycles--; clockspc(6); + } +// if (skipz) //printf("%04X\n",pc); +// skipz=0; +} +static void bpl() +{ + int8_t temp=(int8_t)readmem(pbr|pc); pc++; + if (!p.n) + { + pc+=temp; + cycles--; clockspc(6); + } +} +static void bmi() +{ + int8_t temp=(int8_t)readmem(pbr|pc); pc++; + if (p.n) + { + pc+=temp; + cycles--; clockspc(6); + } +} +static void bvc() +{ + int8_t temp=(int8_t)readmem(pbr|pc); pc++; + if (!p.v) + { + pc+=temp; + cycles--; clockspc(6); + } +} +static void bvs() +{ + int8_t temp=(int8_t)readmem(pbr|pc); pc++; + if (p.v) + { + pc+=temp; + cycles--; clockspc(6); + } +} + +static void bra() +{ + int8_t temp=(int8_t)readmem(pbr|pc); pc++; + pc+=temp; + cycles--; clockspc(6); +} +static void brl() +{ + uint16_t temp=readmemw(pbr|pc); pc+=2; + pc+=temp; + cycles--; clockspc(6); +} + +/*Jump group*/ +static void jmp() +{ + addr=readmemw(pbr|pc); + pc=addr; +} + +static void jmplong() +{ + addr=readmemw(pbr|pc)|(readmem((pbr|pc)+2)<<16); + pc=addr&0xFFFF; + pbr=addr&0xFF0000; +} + +static void jmpind() +{ + addr=readmemw(pbr|pc); +// rpclog("Addr %04X\n",addr); + pc=readmemw(addr); +// rpclog("PC %04X\n",addr); +} + +static void jmpindx() +{ + addr=(readmemw(pbr|pc))+x.w+pbr; +// //printf("Read %06X\n",addr); + pc=readmemw(addr); +} + +static void jmlind() +{ + addr=readmemw(pbr|pc); + pc=readmemw(addr); + pbr=readmem(addr+2)<<16; +} + +static void jsr() +{ + addr=readmemw(pbr|pc); pc++; + readmem(pbr|pc); + writemem(s.w,pc>>8); s.w--; + writemem(s.w,pc&0xFF); s.w--; + pc=addr; + //printf("JSR %04X\n",s.w); +} +static void jsre() +{ + addr=readmemw(pbr|pc); pc++; + readmem(pbr|pc); + writemem(s.w,pc>>8); s.b.l--; + writemem(s.w,pc&0xFF); s.b.l--; + pc=addr; +} + +static void jsrIndx() +{ + addr=jindirectx(); pc--; +// //printf("Addr %06X\n",addr); + writemem(s.w,pc>>8); s.w--; + writemem(s.w,pc&0xFF); s.w--; + pc=readmemw(addr); + //printf("JSR %04X\n",s.w); +// //printf("PC %04X\n",pc); +} +static void jsrIndxe() +{ + addr=jindirectx(); pc--; + writemem(s.w,pc>>8); s.b.l--; + writemem(s.w,pc&0xFF); s.b.l--; + pc=readmemw(addr); +} + +static void jsl() +{ + uint8_t temp; + addr=readmemw(pbr|pc); pc+=2; + temp=readmem(pbr|pc); + writemem(s.w,pbr>>16); s.w--; + writemem(s.w,pc>>8); s.w--; + writemem(s.w,pc&0xFF); s.w--; +// rpclog("JSL %06X\n",pbr|pc); + pc=addr; + pbr=temp<<16; + //printf("JSL %04X\n",s.w); +} + +static void jsle() +{ + uint8_t temp; + addr=readmemw(pbr|pc); pc+=2; + temp=readmem(pbr|pc); + writemem(s.w,pbr>>16); s.b.l--; + writemem(s.w,pc>>8); s.b.l--; + writemem(s.w,pc&0xFF); s.b.l--; +// rpclog("JSLe %06X\n",pbr|pc); + pc=addr; + pbr=temp<<16; +} + +static void rtl() +{ + cycles-=3; clockspc(18); + pc=readmemw(s.w+1); s.w+=2; + pbr=readmem(s.w+1)<<16; s.w++; +// rpclog("RTL %06X\n",pbr|pc); + pc++; + //printf("RTL %04X\n",s.w); +} +static void rtle() +{ + cycles-=3; clockspc(18); + s.b.l++; pc=readmem(s.w); + s.b.l++; pc|=(readmem(s.w)<<8); + s.b.l++; pbr=readmem(s.w)<<16; + pc++; +} + +static void rts() +{ + cycles-=3; clockspc(18); + pc=readmemw(s.w+1); s.w+=2; + pc++; + //printf("RTS %04X\n",s.w); +} +static void rtse() +{ + cycles-=3; clockspc(18); + s.b.l++; pc=readmem(s.w); + s.b.l++; pc|=(readmem(s.w)<<8); + pc++; +} + +static void rti() +{ + uint8_t temp; + cycles--; s.w++; clockspc(6); + temp=readmem(s.w); + p.c=temp&1; + p.z=temp&2; + p.i=temp&4; + p.d=temp&8; + p.ex=temp&0x10; + p.m=temp&0x20; + p.v=temp&0x40; + p.n=temp&0x80; + s.w++; pc=readmem(s.w); // //printf("%04X -> %02X\n",s.w,pc); + s.w++; pc|=(readmem(s.w)<<8); // //printf("%04X -> %02X\n",s.w,pc>>8); + s.w++; pbr=readmem(s.w)<<16; ////printf("%04X -> %02X\n",s.w,pbr>>16); + updatecpumode(); +} + +static void rtie() +{ + uint8_t temp; + cycles--; s.b.l++; clockspc(6); + temp=readmem(s.w); + p.c=temp&1; + p.z=temp&2; + p.i=temp&4; + p.d=temp&8; + p.ex=p.m=0; + p.v=temp&0x40; + p.n=temp&0x80; + s.b.l++; pc=readmem(s.w); // //printf("%04X -> %02X\n",s.w,pc); + s.b.l++; pc|=(readmem(s.w)<<8); // //printf("%04X -> %02X\n",s.w,pc>>8); + updatecpumode(); +} + +/*Shift group*/ +static void asla8() +{ + readmem(pbr|pc); + p.c=a.b.l&0x80; + a.b.l<<=1; + setzn8(a.b.l); +} +static void asla16() +{ + readmem(pbr|pc); + p.c=a.w&0x8000; + a.w<<=1; + setzn16(a.w); +} + +static void aslZp8() +{ + uint8_t temp; + addr=zeropage(); + temp=readmem(addr); + cycles--; clockspc(6); + p.c=temp&0x80; + temp<<=1; + setzn8(temp); + writemem(addr,temp); +} +static void aslZp16() +{ + uint16_t temp; + addr=zeropage(); + temp=readmemw(addr); + cycles--; clockspc(6); + p.c=temp&0x8000; + temp<<=1; + setzn16(temp); + writememw(addr,temp); +} + +static void aslZpx8() +{ + uint8_t temp; + addr=zeropagex(); + temp=readmem(addr); + cycles--; clockspc(6); + p.c=temp&0x80; + temp<<=1; + setzn8(temp); + writemem(addr,temp); +} +static void aslZpx16() +{ + uint16_t temp; + addr=zeropagex(); + temp=readmemw(addr); + cycles--; clockspc(6); + p.c=temp&0x8000; + temp<<=1; + setzn16(temp); + writememw(addr,temp); +} + +static void aslAbs8() +{ + uint8_t temp; + addr=absolute(); + temp=readmem(addr); + cycles--; clockspc(6); + p.c=temp&0x80; + temp<<=1; + setzn8(temp); + writemem(addr,temp); +} +static void aslAbs16() +{ + uint16_t temp; + addr=absolute(); + temp=readmemw(addr); + cycles--; clockspc(6); + p.c=temp&0x8000; + temp<<=1; + setzn16(temp); + writememw(addr,temp); +} + +static void aslAbsx8() +{ + uint8_t temp; + addr=absolutex(); + temp=readmem(addr); + cycles--; clockspc(6); + p.c=temp&0x80; + temp<<=1; + setzn8(temp); + writemem(addr,temp); +} +static void aslAbsx16() +{ + uint16_t temp; + addr=absolutex(); + temp=readmemw(addr); + cycles--; clockspc(6); + p.c=temp&0x8000; + temp<<=1; + setzn16(temp); + writememw(addr,temp); +} + +static void lsra8() +{ + readmem(pbr|pc); + p.c=a.b.l&1; + a.b.l>>=1; + setzn8(a.b.l); +} +static void lsra16() +{ + readmem(pbr|pc); + p.c=a.w&1; + a.w>>=1; + setzn16(a.w); +} + +static void lsrZp8() +{ + uint8_t temp; + addr=zeropage(); + temp=readmem(addr); + cycles--; clockspc(6); + p.c=temp&1; + temp>>=1; + setzn8(temp); + writemem(addr,temp); +} +static void lsrZp16() +{ + uint16_t temp; + addr=zeropage(); + temp=readmemw(addr); + cycles--; clockspc(6); + p.c=temp&1; + temp>>=1; + setzn16(temp); + writememw(addr,temp); +} + +static void lsrZpx8() +{ + uint8_t temp; + addr=zeropagex(); + temp=readmem(addr); + cycles--; clockspc(6); + p.c=temp&1; + temp>>=1; + setzn8(temp); + writemem(addr,temp); +} +static void lsrZpx16() +{ + uint16_t temp; + addr=zeropagex(); + temp=readmemw(addr); + cycles--; clockspc(6); + p.c=temp&1; + temp>>=1; + setzn16(temp); + writememw(addr,temp); +} + +static void lsrAbs8() +{ + uint8_t temp; + addr=absolute(); + temp=readmem(addr); + cycles--; clockspc(6); + p.c=temp&1; + temp>>=1; + setzn8(temp); + writemem(addr,temp); +} +static void lsrAbs16() +{ + uint16_t temp; + addr=absolute(); + temp=readmemw(addr); + cycles--; clockspc(6); + p.c=temp&1; + temp>>=1; + setzn16(temp); + writememw(addr,temp); +} + +static void lsrAbsx8() +{ + uint8_t temp; + addr=absolutex(); + temp=readmem(addr); + cycles--; clockspc(6); + p.c=temp&1; + temp>>=1; + setzn8(temp); + writemem(addr,temp); +} +static void lsrAbsx16() +{ + uint16_t temp; + addr=absolutex(); + temp=readmemw(addr); + cycles--; clockspc(6); + p.c=temp&1; + temp>>=1; + setzn16(temp); + writememw(addr,temp); +} + +static void rola8() +{ + readmem(pbr|pc); + addr=p.c; + p.c=a.b.l&0x80; + a.b.l<<=1; + if (addr) a.b.l|=1; + setzn8(a.b.l); +} +static void rola16() +{ + readmem(pbr|pc); + addr=p.c; + p.c=a.w&0x8000; + a.w<<=1; + if (addr) a.w|=1; + setzn16(a.w); +} + +static void rolZp8() +{ + uint8_t temp; + int tempc; + addr=zeropage(); + temp=readmem(addr); + cycles--; clockspc(6); + tempc=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempc) temp|=1; + setzn8(temp); + writemem(addr,temp); +} +static void rolZp16() +{ + uint16_t temp; + int tempc; + addr=zeropage(); + temp=readmemw(addr); + cycles--; clockspc(6); + tempc=p.c; + p.c=temp&0x8000; + temp<<=1; + if (tempc) temp|=1; + setzn16(temp); + writememw(addr,temp); +} + +static void rolZpx8() +{ + uint8_t temp; + int tempc; + addr=zeropagex(); + temp=readmem(addr); + cycles--; clockspc(6); + tempc=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempc) temp|=1; + setzn8(temp); + writemem(addr,temp); +} +static void rolZpx16() +{ + uint16_t temp; + int tempc; + addr=zeropagex(); + temp=readmemw(addr); + cycles--; clockspc(6); + tempc=p.c; + p.c=temp&0x8000; + temp<<=1; + if (tempc) temp|=1; + setzn16(temp); + writememw(addr,temp); +} + +static void rolAbs8() +{ + uint8_t temp; + int tempc; + addr=absolute(); + temp=readmem(addr); + cycles--; clockspc(6); + tempc=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempc) temp|=1; + setzn8(temp); + writemem(addr,temp); +} +static void rolAbs16() +{ + uint16_t temp; + int tempc; + addr=absolute(); + temp=readmemw(addr); + cycles--; clockspc(6); + tempc=p.c; + p.c=temp&0x8000; + temp<<=1; + if (tempc) temp|=1; + setzn16(temp); + writememw(addr,temp); +} + +static void rolAbsx8() +{ + uint8_t temp; + int tempc; + addr=absolutex(); + temp=readmem(addr); + cycles--; clockspc(6); + tempc=p.c; + p.c=temp&0x80; + temp<<=1; + if (tempc) temp|=1; + setzn8(temp); + writemem(addr,temp); +} +static void rolAbsx16() +{ + uint16_t temp; + int tempc; + addr=absolutex(); + temp=readmemw(addr); + cycles--; clockspc(6); + tempc=p.c; + p.c=temp&0x8000; + temp<<=1; + if (tempc) temp|=1; + setzn16(temp); + writememw(addr,temp); +} + +static void rora8() +{ + readmem(pbr|pc); + addr=p.c; + p.c=a.b.l&1; + a.b.l>>=1; + if (addr) a.b.l|=0x80; + setzn8(a.b.l); +} +static void rora16() +{ + readmem(pbr|pc); + addr=p.c; + p.c=a.w&1; + a.w>>=1; + if (addr) a.w|=0x8000; + setzn16(a.w); +} + +static void rorZp8() +{ + uint8_t temp; + int tempc; + addr=zeropage(); + temp=readmem(addr); + cycles--; clockspc(6); + tempc=p.c; + p.c=temp&1; + temp>>=1; + if (tempc) temp|=0x80; + setzn8(temp); + writemem(addr,temp); +} +static void rorZp16() +{ + uint16_t temp; + int tempc; + addr=zeropage(); + temp=readmemw(addr); + cycles--; clockspc(6); + tempc=p.c; + p.c=temp&1; + temp>>=1; + if (tempc) temp|=0x8000; + setzn16(temp); + writememw(addr,temp); +} + +static void rorZpx8() +{ + uint8_t temp; + int tempc; + addr=zeropagex(); + temp=readmem(addr); + cycles--; clockspc(6); + tempc=p.c; + p.c=temp&1; + temp>>=1; + if (tempc) temp|=0x80; + setzn8(temp); + writemem(addr,temp); +} +static void rorZpx16() +{ + uint16_t temp; + int tempc; + addr=zeropagex(); + temp=readmemw(addr); + cycles--; clockspc(6); + tempc=p.c; + p.c=temp&1; + temp>>=1; + if (tempc) temp|=0x8000; + setzn16(temp); + writememw(addr,temp); +} + +static void rorAbs8() +{ + uint8_t temp; + int tempc; + addr=absolute(); + temp=readmem(addr); + cycles--; clockspc(6); + tempc=p.c; + p.c=temp&1; + temp>>=1; + if (tempc) temp|=0x80; + setzn8(temp); + writemem(addr,temp); +} +static void rorAbs16() +{ + uint16_t temp; + int tempc; + addr=absolute(); + temp=readmemw(addr); + cycles--; clockspc(6); + tempc=p.c; + p.c=temp&1; + temp>>=1; + if (tempc) temp|=0x8000; + setzn16(temp); + writememw(addr,temp); +} + +static void rorAbsx8() +{ + uint8_t temp; + int tempc; + addr=absolutex(); + temp=readmem(addr); + cycles--; clockspc(6); + tempc=p.c; + p.c=temp&1; + temp>>=1; + if (tempc) temp|=0x80; + setzn8(temp); + writemem(addr,temp); +} +static void rorAbsx16() +{ + uint16_t temp; + int tempc; + addr=absolutex(); + temp=readmemw(addr); + cycles--; clockspc(6); + tempc=p.c; + p.c=temp&1; + temp>>=1; + if (tempc) temp|=0x8000; + setzn16(temp); + writememw(addr,temp); +} + +/*Misc group*/ +static void xba() +{ + readmem(pbr|pc); + a.w=(a.w>>8)|(a.w<<8); + setzn8(a.b.l); +} +static void nop() +{ + cycles--; clockspc(6); +} + +static void tcd() +{ + readmem(pbr|pc); + dp=a.w; + setzn16(dp); +} + +static void tdc() +{ + readmem(pbr|pc); + a.w=dp; + setzn16(a.w); +} + +static void tcs() +{ + readmem(pbr|pc); + s.w=a.w; +} + +static void tsc() +{ + readmem(pbr|pc); + a.w=s.w; + setzn16(a.w); +} + +static void trbZp8() +{ + uint8_t temp; + addr=zeropage(); + temp=readmem(addr); + p.z=!(a.b.l&temp); + temp&=~a.b.l; + cycles--; clockspc(6); + writemem(addr,temp); +} +static void trbZp16() +{ + uint16_t temp; + addr=zeropage(); + temp=readmemw(addr); + p.z=!(a.w&temp); + temp&=~a.w; + cycles--; clockspc(6); + writememw(addr,temp); +} + +static void trbAbs8() +{ + uint8_t temp; + addr=absolute(); + temp=readmem(addr); + p.z=!(a.b.l&temp); + temp&=~a.b.l; + cycles--; clockspc(6); + writemem(addr,temp); +} +static void trbAbs16() +{ + uint16_t temp; + addr=absolute(); + temp=readmemw(addr); + p.z=!(a.w&temp); + temp&=~a.w; + cycles--; clockspc(6); + writememw(addr,temp); +} + +static void tsbZp8() +{ + uint8_t temp; + addr=zeropage(); + temp=readmem(addr); + p.z=!(a.b.l&temp); + temp|=a.b.l; + cycles--; clockspc(6); + writemem(addr,temp); +} +static void tsbZp16() +{ + uint16_t temp; + addr=zeropage(); + temp=readmemw(addr); + p.z=!(a.w&temp); + temp|=a.w; + cycles--; clockspc(6); + writememw(addr,temp); +} + +static void tsbAbs8() +{ + uint8_t temp; + addr=absolute(); + temp=readmem(addr); + p.z=!(a.b.l&temp); + temp|=a.b.l; + cycles--; clockspc(6); + writemem(addr,temp); +} +static void tsbAbs16() +{ + uint16_t temp; + addr=absolute(); + temp=readmemw(addr); + p.z=!(a.w&temp); + temp|=a.w; + cycles--; clockspc(6); + writememw(addr,temp); +} + +static void wai() +{ + readmem(pbr|pc); + inwai=1; + pc--; +// printf("WAI %06X\n",pbr|pc); +} + +static void mvp() +{ + uint8_t temp; + dbr=(readmem(pbr|pc))<<16; pc++; + addr=(readmem(pbr|pc))<<16; pc++; + temp=readmem(addr|x.w); + writemem(dbr|y.w,temp); + x.w--; + y.w--; + a.w--; + if (a.w!=0xFFFF) pc-=3; + cycles-=2; clockspc(12); +} + +static void mvn() +{ + uint8_t temp; + dbr=(readmem(pbr|pc))<<16; pc++; + addr=(readmem(pbr|pc))<<16; pc++; + temp=readmem(addr|x.w); + writemem(dbr|y.w,temp); + x.w++; + y.w++; + a.w--; + if (a.w!=0xFFFF) pc-=3; + cycles-=2; clockspc(12); +} + +static void op_brk() +{ + uint8_t temp=0; + pc++; + writemem(s.w,pbr>>16); s.w--; + writemem(s.w,pc>>8); s.w--; + writemem(s.w,pc&0xFF); s.w--; + if (p.c) temp|=1; + if (p.z) temp|=2; + if (p.i) temp|=4; + if (p.d) temp|=8; + if (p.ex) temp|=0x10; + if (p.m) temp|=0x20; + if (p.v) temp|=0x40; + if (p.n) temp|=0x80; + writemem(s.w,temp); s.w--; + pc=readmemw(0xFFE6); + pbr=0; + p.i=1; + p.d=0; +} + +static void brke() +{ + uint8_t temp=0; + pc++; + writemem(s.w,pc>>8); s.w--; + writemem(s.w,pc&0xFF); s.w--; + if (p.c) temp|=1; + if (p.z) temp|=2; + if (p.i) temp|=4; + if (p.d) temp|=8; + if (p.v) temp|=0x40; + if (p.n) temp|=0x80; + writemem(s.w,temp|0x30); s.w--; + pc=readmemw(0xFFFE); + pbr=0; + p.i=1; + p.d=0; +} + +static void cop() +{ + uint8_t temp=0; + pc++; + writemem(s.w,pbr>>16); s.w--; + writemem(s.w,pc>>8); s.w--; + writemem(s.w,pc&0xFF); s.w--; + if (p.c) temp|=1; + if (p.z) temp|=2; + if (p.i) temp|=4; + if (p.d) temp|=8; + if (p.ex) temp|=0x10; + if (p.m) temp|=0x20; + if (p.v) temp|=0x40; + if (p.n) temp|=0x80; + writemem(s.w,temp); s.w--; + pc=readmemw(0xFFE4); + pbr=0; + p.i=1; + p.d=0; +} + +static void cope() +{ + uint8_t temp=0; + pc++; + writemem(s.w,pc>>8); s.w--; + writemem(s.w,pc&0xFF); s.w--; + if (p.c) temp|=1; + if (p.z) temp|=2; + if (p.i) temp|=4; + if (p.d) temp|=8; + if (p.v) temp|=0x40; + if (p.n) temp|=0x80; + writemem(s.w,temp); s.w--; + pc=readmemw(0xFFF4); + pbr=0; + p.i=1; + p.d=0; +} + +static void wdm() +{ + readmem(pc); pc++; +} + +static void stp() /*No point emulating this properly as the external support circuitry isn't there*/ +{ + pc--; + cycles-=600; +} + +/*Functions*/ +void w65816_reset() +{ + def=1; + if (def || (banking&4)) w65816mask=0xFFFF; + else w65816mask=0x7FFFF; +// tuberomin=1; + pbr=dbr=0; + s.w=0x1FF; + cpumode=4; + p.e=1; + p.i=1; + pc=readmemw(0xFFFC); + a.w=x.w=y.w=0; + p.ex=p.m=1; + cycles=0; + //skipz=0; +// printf("Reset to %04X\n",pc); +// exit(-1); +} + +/*static void w65816_dumpregs() +{ + int c; + FILE *f=fopen("65816.dmp","wb"); + + for (c=0;c<65536;c++) putc(readmem(c),f); + fclose(f); + printf("65816 regs :\n"); + printf("A=%04X X=%04X Y=%04X S=%04X\n",a.w,x.w,y.w,s.w); + printf("PC=%06X DBR=%02X DP=%04X\n",pc|pbr,dbr>>24,dp); + printf("%c %c %c %i %i\n",(p.e)?'E':' ',(p.ex)?'X':' ',(p.m)?'M':' ',cpumode,wins); + //printf("89272=%02X\n",readmem(0x89272)); +}*/ + +static void badopcode() +{ +// FILE *f=fopen("rom.dmp","wb"); +// printf("Bad opcode %02X\n",opcode); +// pc--; +// dumpregs65816(); + //printf("%02X %06X\n",readmem(0x3F8A82),rom[((0x3F8A82>>16)*0x8000)+(((0x3F8A82>>12)&3)*0x2000)+(0x3F8A82&0x1FFF)]); +// fwrite(rom,2048*1024,1,f); +// fclose(f); +// exit(-1); +} + +static void makeopcodetable65816() +{ + int c,d; + for (c=0;c<256;c++) + { + for (d=0;d<5;d++) + { + opcodes[c][d]=badopcode; + } + } + /*LDA group*/ + opcodes[0xA9][0]=opcodes[0xA9][2]=opcodes[0xA9][4]=ldaImm8; + opcodes[0xA9][1]=opcodes[0xA9][3]=ldaImm16; + opcodes[0xA5][0]=opcodes[0xA5][2]=opcodes[0xA5][4]=ldaZp8; + opcodes[0xA5][1]=opcodes[0xA5][3]=ldaZp16; + opcodes[0xB5][0]=opcodes[0xB5][2]=opcodes[0xB5][4]=ldaZpx8; + opcodes[0xB5][1]=opcodes[0xB5][3]=ldaZpx16; + opcodes[0xA3][0]=opcodes[0xA3][2]=opcodes[0xA3][4]=ldaSp8; + opcodes[0xA3][1]=opcodes[0xA3][3]=ldaSp16; + opcodes[0xB3][0]=opcodes[0xB3][2]=opcodes[0xB3][4]=ldaSIndirecty8; + opcodes[0xB3][1]=opcodes[0xB3][3]=ldaSIndirecty16; + opcodes[0xAD][0]=opcodes[0xAD][2]=opcodes[0xAD][4]=ldaAbs8; + opcodes[0xAD][1]=opcodes[0xAD][3]=ldaAbs16; + opcodes[0xBD][0]=opcodes[0xBD][2]=opcodes[0xBD][4]=ldaAbsx8; + opcodes[0xBD][1]=opcodes[0xBD][3]=ldaAbsx16; + opcodes[0xB9][0]=opcodes[0xB9][2]=opcodes[0xB9][4]=ldaAbsy8; + opcodes[0xB9][1]=opcodes[0xB9][3]=ldaAbsy16; + opcodes[0xAF][0]=opcodes[0xAF][2]=opcodes[0xAF][4]=ldaLong8; + opcodes[0xAF][1]=opcodes[0xAF][3]=ldaLong16; + opcodes[0xBF][0]=opcodes[0xBF][2]=opcodes[0xBF][4]=ldaLongx8; + opcodes[0xBF][1]=opcodes[0xBF][3]=ldaLongx16; + opcodes[0xB2][0]=opcodes[0xB2][2]=opcodes[0xB2][4]=ldaIndirect8; + opcodes[0xB2][1]=opcodes[0xB2][3]=ldaIndirect16; + opcodes[0xA1][0]=opcodes[0xA1][2]=opcodes[0xA1][4]=ldaIndirectx8; + opcodes[0xA1][1]=opcodes[0xA1][3]=ldaIndirectx16; + opcodes[0xB1][0]=opcodes[0xB1][2]=opcodes[0xB1][4]=ldaIndirecty8; + opcodes[0xB1][1]=opcodes[0xB1][3]=ldaIndirecty16; + opcodes[0xA7][0]=opcodes[0xA7][2]=opcodes[0xA7][4]=ldaIndirectLong8; + opcodes[0xA7][1]=opcodes[0xA7][3]=ldaIndirectLong16; + opcodes[0xB7][0]=opcodes[0xB7][2]=opcodes[0xB7][4]=ldaIndirectLongy8; + opcodes[0xB7][1]=opcodes[0xB7][3]=ldaIndirectLongy16; + /*LDX group*/ + opcodes[0xA2][0]=opcodes[0xA2][1]=opcodes[0xA2][4]=ldxImm8; + opcodes[0xA2][2]=opcodes[0xA2][3]=ldxImm16; + opcodes[0xA6][0]=opcodes[0xA6][1]=opcodes[0xA6][4]=ldxZp8; + opcodes[0xA6][2]=opcodes[0xA6][3]=ldxZp16; + opcodes[0xB6][0]=opcodes[0xB6][1]=opcodes[0xB6][4]=ldxZpy8; + opcodes[0xB6][2]=opcodes[0xB6][3]=ldxZpy16; + opcodes[0xAE][0]=opcodes[0xAE][1]=opcodes[0xAE][4]=ldxAbs8; + opcodes[0xAE][2]=opcodes[0xAE][3]=ldxAbs16; + opcodes[0xBE][0]=opcodes[0xBE][1]=opcodes[0xBE][4]=ldxAbsy8; + opcodes[0xBE][2]=opcodes[0xBE][3]=ldxAbsy16; + /*LDY group*/ + opcodes[0xA0][0]=opcodes[0xA0][1]=opcodes[0xA0][4]=ldyImm8; + opcodes[0xA0][2]=opcodes[0xA0][3]=ldyImm16; + opcodes[0xA4][0]=opcodes[0xA4][1]=opcodes[0xA4][4]=ldyZp8; + opcodes[0xA4][2]=opcodes[0xA4][3]=ldyZp16; + opcodes[0xB4][0]=opcodes[0xB4][1]=opcodes[0xB4][4]=ldyZpx8; + opcodes[0xB4][2]=opcodes[0xB4][3]=ldyZpx16; + opcodes[0xAC][0]=opcodes[0xAC][1]=opcodes[0xAC][4]=ldyAbs8; + opcodes[0xAC][2]=opcodes[0xAC][3]=ldyAbs16; + opcodes[0xBC][0]=opcodes[0xBC][1]=opcodes[0xBC][4]=ldyAbsx8; + opcodes[0xBC][2]=opcodes[0xBC][3]=ldyAbsx16; + + /*STA group*/ + opcodes[0x85][0]=opcodes[0x85][2]=opcodes[0x85][4]=staZp8; + opcodes[0x85][1]=opcodes[0x85][3]=staZp16; + opcodes[0x95][0]=opcodes[0x95][2]=opcodes[0x95][4]=staZpx8; + opcodes[0x95][1]=opcodes[0x95][3]=staZpx16; + opcodes[0x8D][0]=opcodes[0x8D][2]=opcodes[0x8D][4]=staAbs8; + opcodes[0x8D][1]=opcodes[0x8D][3]=staAbs16; + opcodes[0x9D][0]=opcodes[0x9D][2]=opcodes[0x9D][4]=staAbsx8; + opcodes[0x9D][1]=opcodes[0x9D][3]=staAbsx16; + opcodes[0x99][0]=opcodes[0x99][2]=opcodes[0x99][4]=staAbsy8; + opcodes[0x99][1]=opcodes[0x99][3]=staAbsy16; + opcodes[0x8F][0]=opcodes[0x8F][2]=opcodes[0x8F][4]=staLong8; + opcodes[0x8F][1]=opcodes[0x8F][3]=staLong16; + opcodes[0x9F][0]=opcodes[0x9F][2]=opcodes[0x9F][4]=staLongx8; + opcodes[0x9F][1]=opcodes[0x9F][3]=staLongx16; + opcodes[0x92][0]=opcodes[0x92][2]=opcodes[0x92][4]=staIndirect8; + opcodes[0x92][1]=opcodes[0x92][3]=staIndirect16; + opcodes[0x81][0]=opcodes[0x81][2]=opcodes[0x81][4]=staIndirectx8; + opcodes[0x81][1]=opcodes[0x81][3]=staIndirectx16; + opcodes[0x91][0]=opcodes[0x91][2]=opcodes[0x91][4]=staIndirecty8; + opcodes[0x91][1]=opcodes[0x91][3]=staIndirecty16; + opcodes[0x87][0]=opcodes[0x87][2]=opcodes[0x87][4]=staIndirectLong8; + opcodes[0x87][1]=opcodes[0x87][3]=staIndirectLong16; + opcodes[0x97][0]=opcodes[0x97][2]=opcodes[0x97][4]=staIndirectLongy8; + opcodes[0x97][1]=opcodes[0x97][3]=staIndirectLongy16; + opcodes[0x83][0]=opcodes[0x83][2]=opcodes[0x83][4]=staSp8; + opcodes[0x83][1]=opcodes[0x83][3]=staSp16; + opcodes[0x93][0]=opcodes[0x93][2]=opcodes[0x93][4]=staSIndirecty8; + opcodes[0x93][1]=opcodes[0x93][3]=staSIndirecty16; + /*STX group*/ + opcodes[0x86][0]=opcodes[0x86][1]=opcodes[0x86][4]=stxZp8; + opcodes[0x86][2]=opcodes[0x86][3]=stxZp16; + opcodes[0x96][0]=opcodes[0x96][1]=opcodes[0x96][4]=stxZpy8; + opcodes[0x96][2]=opcodes[0x96][3]=stxZpy16; + opcodes[0x8E][0]=opcodes[0x8E][1]=opcodes[0x8E][4]=stxAbs8; + opcodes[0x8E][2]=opcodes[0x8E][3]=stxAbs16; + /*STY group*/ + opcodes[0x84][0]=opcodes[0x84][1]=opcodes[0x84][4]=styZp8; + opcodes[0x84][2]=opcodes[0x84][3]=styZp16; + opcodes[0x94][0]=opcodes[0x94][1]=opcodes[0x94][4]=styZpx8; + opcodes[0x94][2]=opcodes[0x94][3]=styZpx16; + opcodes[0x8C][0]=opcodes[0x8C][1]=opcodes[0x8C][4]=styAbs8; + opcodes[0x8C][2]=opcodes[0x8C][3]=styAbs16; + /*STZ group*/ + opcodes[0x64][0]=opcodes[0x64][2]=opcodes[0x64][4]=stzZp8; + opcodes[0x64][1]=opcodes[0x64][3]=stzZp16; + opcodes[0x74][0]=opcodes[0x74][2]=opcodes[0x74][4]=stzZpx8; + opcodes[0x74][1]=opcodes[0x74][3]=stzZpx16; + opcodes[0x9C][0]=opcodes[0x9C][2]=opcodes[0x9C][4]=stzAbs8; + opcodes[0x9C][1]=opcodes[0x9C][3]=stzAbs16; + opcodes[0x9E][0]=opcodes[0x9E][2]=opcodes[0x9E][4]=stzAbsx8; + opcodes[0x9E][1]=opcodes[0x9E][3]=stzAbsx16; + + opcodes[0x3A][0]=opcodes[0x3A][2]=opcodes[0x3A][4]=deca8; + opcodes[0x3A][1]=opcodes[0x3A][3]=deca16; + opcodes[0xCA][0]=opcodes[0xCA][1]=opcodes[0xCA][4]=dex8; + opcodes[0xCA][2]=opcodes[0xCA][3]=dex16; + opcodes[0x88][0]=opcodes[0x88][1]=opcodes[0x88][4]=dey8; + opcodes[0x88][2]=opcodes[0x88][3]=dey16; + opcodes[0x1A][0]=opcodes[0x1A][2]=opcodes[0x1A][4]=inca8; + opcodes[0x1A][1]=opcodes[0x1A][3]=inca16; + opcodes[0xE8][0]=opcodes[0xE8][1]=opcodes[0xE8][4]=inx8; + opcodes[0xE8][2]=opcodes[0xE8][3]=inx16; + opcodes[0xC8][0]=opcodes[0xC8][1]=opcodes[0xC8][4]=iny8; + opcodes[0xC8][2]=opcodes[0xC8][3]=iny16; + + /*INC group*/ + opcodes[0xE6][0]=opcodes[0xE6][2]=opcodes[0xE6][4]=incZp8; + opcodes[0xE6][1]=opcodes[0xE6][3]=incZp16; + opcodes[0xF6][0]=opcodes[0xF6][2]=opcodes[0xF6][4]=incZpx8; + opcodes[0xF6][1]=opcodes[0xF6][3]=incZpx16; + opcodes[0xEE][0]=opcodes[0xEE][2]=opcodes[0xEE][4]=incAbs8; + opcodes[0xEE][1]=opcodes[0xEE][3]=incAbs16; + opcodes[0xFE][0]=opcodes[0xFE][2]=opcodes[0xFE][4]=incAbsx8; + opcodes[0xFE][1]=opcodes[0xFE][3]=incAbsx16; + + /*DEC group*/ + opcodes[0xC6][0]=opcodes[0xC6][2]=opcodes[0xC6][4]=decZp8; + opcodes[0xC6][1]=opcodes[0xC6][3]=decZp16; + opcodes[0xD6][0]=opcodes[0xD6][2]=opcodes[0xD6][4]=decZpx8; + opcodes[0xD6][1]=opcodes[0xD6][3]=decZpx16; + opcodes[0xCE][0]=opcodes[0xCE][2]=opcodes[0xCE][4]=decAbs8; + opcodes[0xCE][1]=opcodes[0xCE][3]=decAbs16; + opcodes[0xDE][0]=opcodes[0xDE][2]=opcodes[0xDE][4]=decAbsx8; + opcodes[0xDE][1]=opcodes[0xDE][3]=decAbsx16; + + /*AND group*/ + opcodes[0x29][0]=opcodes[0x29][2]=opcodes[0x29][4]=andImm8; + opcodes[0x29][1]=opcodes[0x29][3]=andImm16; + opcodes[0x25][0]=opcodes[0x25][2]=opcodes[0x25][4]=andZp8; + opcodes[0x25][1]=opcodes[0x25][3]=andZp16; + opcodes[0x35][0]=opcodes[0x35][2]=opcodes[0x35][4]=andZpx8; + opcodes[0x35][1]=opcodes[0x35][3]=andZpx16; + opcodes[0x23][0]=opcodes[0x23][2]=opcodes[0x23][4]=andSp8; + opcodes[0x23][1]=opcodes[0x23][3]=andSp16; + opcodes[0x2D][0]=opcodes[0x2D][2]=opcodes[0x2D][4]=andAbs8; + opcodes[0x2D][1]=opcodes[0x2D][3]=andAbs16; + opcodes[0x3D][0]=opcodes[0x3D][2]=opcodes[0x3D][4]=andAbsx8; + opcodes[0x3D][1]=opcodes[0x3D][3]=andAbsx16; + opcodes[0x39][0]=opcodes[0x39][2]=opcodes[0x39][4]=andAbsy8; + opcodes[0x39][1]=opcodes[0x39][3]=andAbsy16; + opcodes[0x2F][0]=opcodes[0x2F][2]=opcodes[0x2F][4]=andLong8; + opcodes[0x2F][1]=opcodes[0x2F][3]=andLong16; + opcodes[0x3F][0]=opcodes[0x3F][2]=opcodes[0x3F][4]=andLongx8; + opcodes[0x3F][1]=opcodes[0x3F][3]=andLongx16; + opcodes[0x32][0]=opcodes[0x32][2]=opcodes[0x32][4]=andIndirect8; + opcodes[0x32][1]=opcodes[0x32][3]=andIndirect16; + opcodes[0x21][0]=opcodes[0x21][2]=opcodes[0x21][4]=andIndirectx8; + opcodes[0x21][1]=opcodes[0x21][3]=andIndirectx16; + opcodes[0x31][0]=opcodes[0x31][2]=opcodes[0x31][4]=andIndirecty8; + opcodes[0x31][1]=opcodes[0x31][3]=andIndirecty16; + opcodes[0x33][0]=opcodes[0x33][2]=opcodes[0x33][4]=andsIndirecty8; + opcodes[0x33][1]=opcodes[0x33][3]=andsIndirecty16; + opcodes[0x27][0]=opcodes[0x27][2]=opcodes[0x27][4]=andIndirectLong8; + opcodes[0x27][1]=opcodes[0x27][3]=andIndirectLong16; + opcodes[0x37][0]=opcodes[0x37][2]=opcodes[0x37][4]=andIndirectLongy8; + opcodes[0x37][1]=opcodes[0x37][3]=andIndirectLongy16; + + /*EOR group*/ + opcodes[0x49][0]=opcodes[0x49][2]=opcodes[0x49][4]=eorImm8; + opcodes[0x49][1]=opcodes[0x49][3]=eorImm16; + opcodes[0x45][0]=opcodes[0x45][2]=opcodes[0x45][4]=eorZp8; + opcodes[0x45][1]=opcodes[0x45][3]=eorZp16; + opcodes[0x55][0]=opcodes[0x55][2]=opcodes[0x55][4]=eorZpx8; + opcodes[0x55][1]=opcodes[0x55][3]=eorZpx16; + opcodes[0x43][0]=opcodes[0x43][2]=opcodes[0x43][4]=eorSp8; + opcodes[0x43][1]=opcodes[0x43][3]=eorSp16; + opcodes[0x4D][0]=opcodes[0x4D][2]=opcodes[0x4D][4]=eorAbs8; + opcodes[0x4D][1]=opcodes[0x4D][3]=eorAbs16; + opcodes[0x5D][0]=opcodes[0x5D][2]=opcodes[0x5D][4]=eorAbsx8; + opcodes[0x5D][1]=opcodes[0x5D][3]=eorAbsx16; + opcodes[0x59][0]=opcodes[0x59][2]=opcodes[0x59][4]=eorAbsy8; + opcodes[0x59][1]=opcodes[0x59][3]=eorAbsy16; + opcodes[0x4F][0]=opcodes[0x4F][2]=opcodes[0x4F][4]=eorLong8; + opcodes[0x4F][1]=opcodes[0x4F][3]=eorLong16; + opcodes[0x5F][0]=opcodes[0x5F][2]=opcodes[0x5F][4]=eorLongx8; + opcodes[0x5F][1]=opcodes[0x5F][3]=eorLongx16; + opcodes[0x52][0]=opcodes[0x52][2]=opcodes[0x52][4]=eorIndirect8; + opcodes[0x52][1]=opcodes[0x52][3]=eorIndirect16; + opcodes[0x41][0]=opcodes[0x41][2]=opcodes[0x41][4]=eorIndirectx8; + opcodes[0x41][1]=opcodes[0x41][3]=eorIndirectx16; + opcodes[0x51][0]=opcodes[0x51][2]=opcodes[0x51][4]=eorIndirecty8; + opcodes[0x51][1]=opcodes[0x51][3]=eorIndirecty16; + opcodes[0x53][0]=opcodes[0x53][2]=opcodes[0x53][4]=eorsIndirecty8; + opcodes[0x53][1]=opcodes[0x53][3]=eorsIndirecty16; + opcodes[0x47][0]=opcodes[0x47][2]=opcodes[0x47][4]=eorIndirectLong8; + opcodes[0x47][1]=opcodes[0x47][3]=eorIndirectLong16; + opcodes[0x57][0]=opcodes[0x57][2]=opcodes[0x57][4]=eorIndirectLongy8; + opcodes[0x57][1]=opcodes[0x57][3]=eorIndirectLongy16; + + /*ORA group*/ + opcodes[0x09][0]=opcodes[0x09][2]=opcodes[0x09][4]=oraImm8; + opcodes[0x09][1]=opcodes[0x09][3]=oraImm16; + opcodes[0x05][0]=opcodes[0x05][2]=opcodes[0x05][4]=oraZp8; + opcodes[0x05][1]=opcodes[0x05][3]=oraZp16; + opcodes[0x15][0]=opcodes[0x15][2]=opcodes[0x15][4]=oraZpx8; + opcodes[0x15][1]=opcodes[0x15][3]=oraZpx16; + opcodes[0x03][0]=opcodes[0x03][2]=opcodes[0x03][4]=oraSp8; + opcodes[0x03][1]=opcodes[0x03][3]=oraSp16; + opcodes[0x0D][0]=opcodes[0x0D][2]=opcodes[0x0D][4]=oraAbs8; + opcodes[0x0D][1]=opcodes[0x0D][3]=oraAbs16; + opcodes[0x1D][0]=opcodes[0x1D][2]=opcodes[0x1D][4]=oraAbsx8; + opcodes[0x1D][1]=opcodes[0x1D][3]=oraAbsx16; + opcodes[0x19][0]=opcodes[0x19][2]=opcodes[0x19][4]=oraAbsy8; + opcodes[0x19][1]=opcodes[0x19][3]=oraAbsy16; + opcodes[0x0F][0]=opcodes[0x0F][2]=opcodes[0x0F][4]=oraLong8; + opcodes[0x0F][1]=opcodes[0x0F][3]=oraLong16; + opcodes[0x1F][0]=opcodes[0x1F][2]=opcodes[0x1F][4]=oraLongx8; + opcodes[0x1F][1]=opcodes[0x1F][3]=oraLongx16; + opcodes[0x12][0]=opcodes[0x12][2]=opcodes[0x12][4]=oraIndirect8; + opcodes[0x12][1]=opcodes[0x12][3]=oraIndirect16; + opcodes[0x01][0]=opcodes[0x01][2]=opcodes[0x01][4]=oraIndirectx8; + opcodes[0x01][1]=opcodes[0x01][3]=oraIndirectx16; + opcodes[0x11][0]=opcodes[0x11][2]=opcodes[0x11][4]=oraIndirecty8; + opcodes[0x11][1]=opcodes[0x11][3]=oraIndirecty16; + opcodes[0x13][0]=opcodes[0x13][2]=opcodes[0x13][4]=orasIndirecty8; + opcodes[0x13][1]=opcodes[0x13][3]=orasIndirecty16; + opcodes[0x07][0]=opcodes[0x07][2]=opcodes[0x07][4]=oraIndirectLong8; + opcodes[0x07][1]=opcodes[0x07][3]=oraIndirectLong16; + opcodes[0x17][0]=opcodes[0x17][2]=opcodes[0x17][4]=oraIndirectLongy8; + opcodes[0x17][1]=opcodes[0x17][3]=oraIndirectLongy16; + + /*ADC group*/ + opcodes[0x69][0]=opcodes[0x69][2]=opcodes[0x69][4]=adcImm8; + opcodes[0x69][1]=opcodes[0x69][3]=adcImm16; + opcodes[0x65][0]=opcodes[0x65][2]=opcodes[0x65][4]=adcZp8; + opcodes[0x65][1]=opcodes[0x65][3]=adcZp16; + opcodes[0x75][0]=opcodes[0x75][2]=opcodes[0x75][4]=adcZpx8; + opcodes[0x75][1]=opcodes[0x75][3]=adcZpx16; + opcodes[0x63][0]=opcodes[0x63][2]=opcodes[0x63][4]=adcSp8; + opcodes[0x63][1]=opcodes[0x63][3]=adcSp16; + opcodes[0x6D][0]=opcodes[0x6D][2]=opcodes[0x6D][4]=adcAbs8; + opcodes[0x6D][1]=opcodes[0x6D][3]=adcAbs16; + opcodes[0x7D][0]=opcodes[0x7D][2]=opcodes[0x7D][4]=adcAbsx8; + opcodes[0x7D][1]=opcodes[0x7D][3]=adcAbsx16; + opcodes[0x79][0]=opcodes[0x79][2]=opcodes[0x79][4]=adcAbsy8; + opcodes[0x79][1]=opcodes[0x79][3]=adcAbsy16; + opcodes[0x6F][0]=opcodes[0x6F][2]=opcodes[0x6F][4]=adcLong8; + opcodes[0x6F][1]=opcodes[0x6F][3]=adcLong16; + opcodes[0x7F][0]=opcodes[0x7F][2]=opcodes[0x7F][4]=adcLongx8; + opcodes[0x7F][1]=opcodes[0x7F][3]=adcLongx16; + opcodes[0x72][0]=opcodes[0x72][2]=opcodes[0x72][4]=adcIndirect8; + opcodes[0x72][1]=opcodes[0x72][3]=adcIndirect16; + opcodes[0x61][0]=opcodes[0x61][2]=opcodes[0x61][4]=adcIndirectx8; + opcodes[0x61][1]=opcodes[0x61][3]=adcIndirectx16; + opcodes[0x71][0]=opcodes[0x71][2]=opcodes[0x71][4]=adcIndirecty8; + opcodes[0x71][1]=opcodes[0x71][3]=adcIndirecty16; + opcodes[0x73][0]=opcodes[0x73][2]=opcodes[0x73][4]=adcsIndirecty8; + opcodes[0x73][1]=opcodes[0x73][3]=adcsIndirecty16; + opcodes[0x67][0]=opcodes[0x67][2]=opcodes[0x67][4]=adcIndirectLong8; + opcodes[0x67][1]=opcodes[0x67][3]=adcIndirectLong16; + opcodes[0x77][0]=opcodes[0x77][2]=opcodes[0x77][4]=adcIndirectLongy8; + opcodes[0x77][1]=opcodes[0x77][3]=adcIndirectLongy16; + + /*SBC group*/ + opcodes[0xE9][0]=opcodes[0xE9][2]=opcodes[0xE9][4]=sbcImm8; + opcodes[0xE9][1]=opcodes[0xE9][3]=sbcImm16; + opcodes[0xE5][0]=opcodes[0xE5][2]=opcodes[0xE5][4]=sbcZp8; + opcodes[0xE5][1]=opcodes[0xE5][3]=sbcZp16; + opcodes[0xE3][0]=opcodes[0xE3][2]=opcodes[0xE3][4]=sbcSp8; + opcodes[0xE3][1]=opcodes[0xE3][3]=sbcSp16; + opcodes[0xF5][0]=opcodes[0xF5][2]=opcodes[0xF5][4]=sbcZpx8; + opcodes[0xF5][1]=opcodes[0xF5][3]=sbcZpx16; + opcodes[0xED][0]=opcodes[0xED][2]=opcodes[0xED][4]=sbcAbs8; + opcodes[0xED][1]=opcodes[0xED][3]=sbcAbs16; + opcodes[0xFD][0]=opcodes[0xFD][2]=opcodes[0xFD][4]=sbcAbsx8; + opcodes[0xFD][1]=opcodes[0xFD][3]=sbcAbsx16; + opcodes[0xF9][0]=opcodes[0xF9][2]=opcodes[0xF9][4]=sbcAbsy8; + opcodes[0xF9][1]=opcodes[0xF9][3]=sbcAbsy16; + opcodes[0xEF][0]=opcodes[0xEF][2]=opcodes[0xEF][4]=sbcLong8; + opcodes[0xEF][1]=opcodes[0xEF][3]=sbcLong16; + opcodes[0xFF][0]=opcodes[0xFF][2]=opcodes[0xFF][4]=sbcLongx8; + opcodes[0xFF][1]=opcodes[0xFF][3]=sbcLongx16; + opcodes[0xF2][0]=opcodes[0xF2][2]=opcodes[0xF2][4]=sbcIndirect8; + opcodes[0xF2][1]=opcodes[0xF2][3]=sbcIndirect16; + opcodes[0xE1][0]=opcodes[0xE1][2]=opcodes[0xE1][4]=sbcIndirectx8; + opcodes[0xE1][1]=opcodes[0xE1][3]=sbcIndirectx16; + opcodes[0xF1][0]=opcodes[0xF1][2]=opcodes[0xF1][4]=sbcIndirecty8; + opcodes[0xF1][1]=opcodes[0xF1][3]=sbcIndirecty16; + opcodes[0xF3][0]=opcodes[0xF3][2]=opcodes[0xF3][4]=sbcsIndirecty8; + opcodes[0xF3][1]=opcodes[0xF3][3]=sbcsIndirecty16; + opcodes[0xE7][0]=opcodes[0xE7][2]=opcodes[0xE7][4]=sbcIndirectLong8; + opcodes[0xE7][1]=opcodes[0xE7][3]=sbcIndirectLong16; + opcodes[0xF7][0]=opcodes[0xF7][2]=opcodes[0xF7][4]=sbcIndirectLongy8; + opcodes[0xF7][1]=opcodes[0xF7][3]=sbcIndirectLongy16; + + /*Transfer group*/ + opcodes[0xAA][0]=opcodes[0xAA][1]=opcodes[0xAA][4]=tax8; + opcodes[0xAA][2]=opcodes[0xAA][3]=tax16; + opcodes[0xA8][0]=opcodes[0xA8][1]=opcodes[0xA8][4]=tay8; + opcodes[0xA8][2]=opcodes[0xA8][3]=tay16; + opcodes[0x8A][0]=opcodes[0x8A][2]=opcodes[0x8A][4]=txa8; + opcodes[0x8A][1]=opcodes[0x8A][3]=txa16; + opcodes[0x98][0]=opcodes[0x98][2]=opcodes[0x98][4]=tya8; + opcodes[0x98][1]=opcodes[0x98][3]=tya16; + opcodes[0x9B][0]=opcodes[0x9B][1]=opcodes[0x9B][4]=txy8; + opcodes[0x9B][2]=opcodes[0x9B][3]=txy16; + opcodes[0xBB][0]=opcodes[0xBB][1]=opcodes[0xBB][4]=tyx8; + opcodes[0xBB][2]=opcodes[0xBB][3]=tyx16; + opcodes[0xBA][0]=opcodes[0xBA][1]=opcodes[0xBA][4]=tsx8; + opcodes[0xBA][2]=opcodes[0xBA][3]=tsx16; + opcodes[0x9A][0]=opcodes[0x9A][1]=opcodes[0x9A][4]=txs8; + opcodes[0x9A][2]=opcodes[0x9A][3]=txs16; + + /*Flag Group*/ + opcodes[0x18][0]=opcodes[0x18][1]=opcodes[0x18][2]= + opcodes[0x18][3]=opcodes[0x18][4]=clc; + opcodes[0xD8][0]=opcodes[0xD8][1]=opcodes[0xD8][2]= + opcodes[0xD8][3]=opcodes[0xD8][4]=cld; + opcodes[0x58][0]=opcodes[0x58][1]=opcodes[0x58][2]= + opcodes[0x58][3]=opcodes[0x58][4]=cli; + opcodes[0xB8][0]=opcodes[0xB8][1]=opcodes[0xB8][2]= + opcodes[0xB8][3]=opcodes[0xB8][4]=clv; + opcodes[0x38][0]=opcodes[0x38][1]=opcodes[0x38][2]= + opcodes[0x38][3]=opcodes[0x38][4]=sec; + opcodes[0xF8][0]=opcodes[0xF8][1]=opcodes[0xF8][2]= + opcodes[0xF8][3]=opcodes[0xF8][4]=sed; + opcodes[0x78][0]=opcodes[0x78][1]=opcodes[0x78][2]= + opcodes[0x78][3]=opcodes[0x78][4]=sei; + opcodes[0xFB][0]=opcodes[0xFB][1]=opcodes[0xFB][2]= + opcodes[0xFB][3]=opcodes[0xFB][4]=xce; + opcodes[0xE2][0]=opcodes[0xE2][1]=opcodes[0xE2][2]= + opcodes[0xE2][3]=opcodes[0xE2][4]=sep; + opcodes[0xC2][0]=opcodes[0xC2][1]=opcodes[0xC2][2]= + opcodes[0xC2][3]=opcodes[0xC2][4]=rep65816; + + /*Stack group*/ + opcodes[0x8B][0]=opcodes[0x8B][1]=opcodes[0x8B][2]= + opcodes[0x8B][3]=phb; + opcodes[0x8B][4]=phbe; + opcodes[0x4B][0]=opcodes[0x4B][1]=opcodes[0x4B][2]= + opcodes[0x4B][3]=phk; + opcodes[0x4B][4]=phke; + opcodes[0xAB][0]=opcodes[0xAB][1]=opcodes[0xAB][2]= + opcodes[0xAB][3]=plb; + opcodes[0xAB][4]=plbe; + opcodes[0x08][0]=opcodes[0x08][1]=opcodes[0x08][2]= + opcodes[0x08][3]=php; + opcodes[0x08][4]=phpe; + opcodes[0x28][0]=opcodes[0x28][1]=opcodes[0x28][2]= + opcodes[0x28][3]=plp; + opcodes[0x28][4]=plpe; + opcodes[0x48][0]=opcodes[0x48][2]=opcodes[0x48][4]=pha8; + opcodes[0x48][1]=opcodes[0x48][3]=pha16; + opcodes[0xDA][0]=opcodes[0xDA][1]=opcodes[0xDA][4]=phx8; + opcodes[0xDA][2]=opcodes[0xDA][3]=phx16; + opcodes[0x5A][0]=opcodes[0x5A][1]=opcodes[0x5A][4]=phy8; + opcodes[0x5A][2]=opcodes[0x5A][3]=phy16; + opcodes[0x68][0]=opcodes[0x68][2]=opcodes[0x68][4]=pla8; + opcodes[0x68][1]=opcodes[0x68][3]=pla16; + opcodes[0xFA][0]=opcodes[0xFA][1]=opcodes[0xFA][4]=plx8; + opcodes[0xFA][2]=opcodes[0xFA][3]=plx16; + opcodes[0x7A][0]=opcodes[0x7A][1]=opcodes[0x7A][4]=ply8; + opcodes[0x7A][2]=opcodes[0x7A][3]=ply16; + opcodes[0xD4][0]=opcodes[0xD4][1]=opcodes[0xD4][2]= + opcodes[0xD4][3]=opcodes[0xD4][4]=pei; + opcodes[0xF4][0]=opcodes[0xF4][1]=opcodes[0xF4][2]= + opcodes[0xF4][3]=opcodes[0xF4][4]=pea; + opcodes[0x62][0]=opcodes[0x62][1]=opcodes[0x62][2]= + opcodes[0x62][3]=opcodes[0x62][4]=per; + opcodes[0x0B][0]=opcodes[0x0B][1]=opcodes[0x0B][2]= + opcodes[0x0B][3]=opcodes[0x0B][4]=phd; + opcodes[0x2B][0]=opcodes[0x2B][1]=opcodes[0x2B][2]= + opcodes[0x2B][3]=opcodes[0x2B][4]=pld; + + /*CMP group*/ + opcodes[0xC9][0]=opcodes[0xC9][2]=opcodes[0xC9][4]=cmpImm8; + opcodes[0xC9][1]=opcodes[0xC9][3]=cmpImm16; + opcodes[0xC5][0]=opcodes[0xC5][2]=opcodes[0xC5][4]=cmpZp8; + opcodes[0xC5][1]=opcodes[0xC5][3]=cmpZp16; + opcodes[0xC3][0]=opcodes[0xC3][2]=opcodes[0xC3][4]=cmpSp8; + opcodes[0xC3][1]=opcodes[0xC3][3]=cmpSp16; + opcodes[0xD5][0]=opcodes[0xD5][2]=opcodes[0xD5][4]=cmpZpx8; + opcodes[0xD5][1]=opcodes[0xD5][3]=cmpZpx16; + opcodes[0xCD][0]=opcodes[0xCD][2]=opcodes[0xCD][4]=cmpAbs8; + opcodes[0xCD][1]=opcodes[0xCD][3]=cmpAbs16; + opcodes[0xDD][0]=opcodes[0xDD][2]=opcodes[0xDD][4]=cmpAbsx8; + opcodes[0xDD][1]=opcodes[0xDD][3]=cmpAbsx16; + opcodes[0xD9][0]=opcodes[0xD9][2]=opcodes[0xD9][4]=cmpAbsy8; + opcodes[0xD9][1]=opcodes[0xD9][3]=cmpAbsy16; + opcodes[0xCF][0]=opcodes[0xCF][2]=opcodes[0xCF][4]=cmpLong8; + opcodes[0xCF][1]=opcodes[0xCF][3]=cmpLong16; + opcodes[0xDF][0]=opcodes[0xDF][2]=opcodes[0xDF][4]=cmpLongx8; + opcodes[0xDF][1]=opcodes[0xDF][3]=cmpLongx16; + opcodes[0xD2][0]=opcodes[0xD2][2]=opcodes[0xD2][4]=cmpIndirect8; + opcodes[0xD2][1]=opcodes[0xD2][3]=cmpIndirect16; + opcodes[0xC1][0]=opcodes[0xC1][2]=opcodes[0xC1][4]=cmpIndirectx8; + opcodes[0xC1][1]=opcodes[0xC1][3]=cmpIndirectx16; + opcodes[0xD1][0]=opcodes[0xD1][2]=opcodes[0xD1][4]=cmpIndirecty8; + opcodes[0xD1][1]=opcodes[0xD1][3]=cmpIndirecty16; + opcodes[0xD3][0]=opcodes[0xD3][2]=opcodes[0xD3][4]=cmpsIndirecty8; + opcodes[0xD3][1]=opcodes[0xD3][3]=cmpsIndirecty16; + opcodes[0xC7][0]=opcodes[0xC7][2]=opcodes[0xC7][4]=cmpIndirectLong8; + opcodes[0xC7][1]=opcodes[0xC7][3]=cmpIndirectLong16; + opcodes[0xD7][0]=opcodes[0xD7][2]=opcodes[0xD7][4]=cmpIndirectLongy8; + opcodes[0xD7][1]=opcodes[0xD7][3]=cmpIndirectLongy16; + + /*CPX group*/ + opcodes[0xE0][0]=opcodes[0xE0][1]=opcodes[0xE0][4]=cpxImm8; + opcodes[0xE0][2]=opcodes[0xE0][3]=cpxImm16; + opcodes[0xE4][0]=opcodes[0xE4][1]=opcodes[0xE4][4]=cpxZp8; + opcodes[0xE4][2]=opcodes[0xE4][3]=cpxZp16; + opcodes[0xEC][0]=opcodes[0xEC][1]=opcodes[0xEC][4]=cpxAbs8; + opcodes[0xEC][2]=opcodes[0xEC][3]=cpxAbs16; + + /*CPY group*/ + opcodes[0xC0][0]=opcodes[0xC0][1]=opcodes[0xC0][4]=cpyImm8; + opcodes[0xC0][2]=opcodes[0xC0][3]=cpyImm16; + opcodes[0xC4][0]=opcodes[0xC4][1]=opcodes[0xC4][4]=cpyZp8; + opcodes[0xC4][2]=opcodes[0xC4][3]=cpyZp16; + opcodes[0xCC][0]=opcodes[0xCC][1]=opcodes[0xCC][4]=cpyAbs8; + opcodes[0xCC][2]=opcodes[0xCC][3]=cpyAbs16; + + /*Branch group*/ + opcodes[0x90][0]=opcodes[0x90][1]=opcodes[0x90][2]= + opcodes[0x90][3]=opcodes[0x90][4]=bcc; + opcodes[0xB0][0]=opcodes[0xB0][1]=opcodes[0xB0][2]= + opcodes[0xB0][3]=opcodes[0xB0][4]=bcs; + opcodes[0xF0][0]=opcodes[0xF0][1]=opcodes[0xF0][2]= + opcodes[0xF0][3]=opcodes[0xF0][4]=beq; + opcodes[0xD0][0]=opcodes[0xD0][1]=opcodes[0xD0][2]= + opcodes[0xD0][3]=opcodes[0xD0][4]=bne; + opcodes[0x80][0]=opcodes[0x80][1]=opcodes[0x80][2]= + opcodes[0x80][3]=opcodes[0x80][4]=bra; + opcodes[0x82][0]=opcodes[0x82][1]=opcodes[0x82][2]= + opcodes[0x82][3]=opcodes[0x82][4]=brl; + opcodes[0x10][0]=opcodes[0x10][1]=opcodes[0x10][2]= + opcodes[0x10][3]=opcodes[0x10][4]=bpl; + opcodes[0x30][0]=opcodes[0x30][1]=opcodes[0x30][2]= + opcodes[0x30][3]=opcodes[0x30][4]=bmi; + opcodes[0x50][0]=opcodes[0x50][1]=opcodes[0x50][2]= + opcodes[0x50][3]=opcodes[0x50][4]=bvc; + opcodes[0x70][0]=opcodes[0x70][1]=opcodes[0x70][2]= + opcodes[0x70][3]=opcodes[0x70][4]=bvs; + + /*Jump group*/ + opcodes[0x4C][0]=opcodes[0x4C][1]=opcodes[0x4C][2]= + opcodes[0x4C][3]=opcodes[0x4C][4]=jmp; + opcodes[0x5C][0]=opcodes[0x5C][1]=opcodes[0x5C][2]= + opcodes[0x5C][3]=opcodes[0x5C][4]=jmplong; + opcodes[0x6C][0]=opcodes[0x6C][1]=opcodes[0x6C][2]= + opcodes[0x6C][3]=opcodes[0x6C][4]=jmpind; + opcodes[0x7C][0]=opcodes[0x7C][1]=opcodes[0x7C][2]= + opcodes[0x7C][3]=opcodes[0x7C][4]=jmpindx; + opcodes[0xDC][0]=opcodes[0xDC][1]=opcodes[0xDC][2]= + opcodes[0xDC][3]=opcodes[0xDC][4]=jmlind; + opcodes[0x20][0]=opcodes[0x20][1]=opcodes[0x20][2]= + opcodes[0x20][3]=jsr; + opcodes[0x20][4]=jsre; + opcodes[0xFC][0]=opcodes[0xFC][1]=opcodes[0xFC][2]= + opcodes[0xFC][3]=jsrIndx; + opcodes[0xFC][4]=jsrIndxe; + opcodes[0x60][0]=opcodes[0x60][1]=opcodes[0x60][2]= + opcodes[0x60][3]=rts; + opcodes[0x60][4]=rtse; + opcodes[0x6B][0]=opcodes[0x6B][1]=opcodes[0x6B][2]= + opcodes[0x6B][3]=rtl; + opcodes[0x6B][4]=rtle; + opcodes[0x40][0]=opcodes[0x40][1]=opcodes[0x40][2]= + opcodes[0x40][3]=rti; + opcodes[0x40][4]=rtie; + opcodes[0x22][0]=opcodes[0x22][1]=opcodes[0x22][2]= + opcodes[0x22][3]=jsl; + opcodes[0x22][4]=jsle; + + /*Shift group*/ + opcodes[0x0A][0]=opcodes[0x0A][2]=opcodes[0x0A][4]=asla8; + opcodes[0x0A][1]=opcodes[0x0A][3]=asla16; + opcodes[0x06][0]=opcodes[0x06][2]=opcodes[0x06][4]=aslZp8; + opcodes[0x06][1]=opcodes[0x06][3]=aslZp16; + opcodes[0x16][0]=opcodes[0x16][2]=opcodes[0x16][4]=aslZpx8; + opcodes[0x16][1]=opcodes[0x16][3]=aslZpx16; + opcodes[0x0E][0]=opcodes[0x0E][2]=opcodes[0x0E][4]=aslAbs8; + opcodes[0x0E][1]=opcodes[0x0E][3]=aslAbs16; + opcodes[0x1E][0]=opcodes[0x1E][2]=opcodes[0x1E][4]=aslAbsx8; + opcodes[0x1E][1]=opcodes[0x1E][3]=aslAbsx16; + + opcodes[0x4A][0]=opcodes[0x4A][2]=opcodes[0x4A][4]=lsra8; + opcodes[0x4A][1]=opcodes[0x4A][3]=lsra16; + opcodes[0x46][0]=opcodes[0x46][2]=opcodes[0x46][4]=lsrZp8; + opcodes[0x46][1]=opcodes[0x46][3]=lsrZp16; + opcodes[0x56][0]=opcodes[0x56][2]=opcodes[0x56][4]=lsrZpx8; + opcodes[0x56][1]=opcodes[0x56][3]=lsrZpx16; + opcodes[0x4E][0]=opcodes[0x4E][2]=opcodes[0x4E][4]=lsrAbs8; + opcodes[0x4E][1]=opcodes[0x4E][3]=lsrAbs16; + opcodes[0x5E][0]=opcodes[0x5E][2]=opcodes[0x5E][4]=lsrAbsx8; + opcodes[0x5E][1]=opcodes[0x5E][3]=lsrAbsx16; + + opcodes[0x2A][0]=opcodes[0x2A][2]=opcodes[0x2A][4]=rola8; + opcodes[0x2A][1]=opcodes[0x2A][3]=rola16; + opcodes[0x26][0]=opcodes[0x26][2]=opcodes[0x26][4]=rolZp8; + opcodes[0x26][1]=opcodes[0x26][3]=rolZp16; + opcodes[0x36][0]=opcodes[0x36][2]=opcodes[0x36][4]=rolZpx8; + opcodes[0x36][1]=opcodes[0x36][3]=rolZpx16; + opcodes[0x2E][0]=opcodes[0x2E][2]=opcodes[0x2E][4]=rolAbs8; + opcodes[0x2E][1]=opcodes[0x2E][3]=rolAbs16; + opcodes[0x3E][0]=opcodes[0x3E][2]=opcodes[0x3E][4]=rolAbsx8; + opcodes[0x3E][1]=opcodes[0x3E][3]=rolAbsx16; + + opcodes[0x6A][0]=opcodes[0x6A][2]=opcodes[0x6A][4]=rora8; + opcodes[0x6A][1]=opcodes[0x6A][3]=rora16; + opcodes[0x66][0]=opcodes[0x66][2]=opcodes[0x66][4]=rorZp8; + opcodes[0x66][1]=opcodes[0x66][3]=rorZp16; + opcodes[0x76][0]=opcodes[0x76][2]=opcodes[0x76][4]=rorZpx8; + opcodes[0x76][1]=opcodes[0x76][3]=rorZpx16; + opcodes[0x6E][0]=opcodes[0x6E][2]=opcodes[0x6E][4]=rorAbs8; + opcodes[0x6E][1]=opcodes[0x6E][3]=rorAbs16; + opcodes[0x7E][0]=opcodes[0x7E][2]=opcodes[0x7E][4]=rorAbsx8; + opcodes[0x7E][1]=opcodes[0x7E][3]=rorAbsx16; + + /*BIT group*/ + opcodes[0x89][0]=opcodes[0x89][2]=opcodes[0x89][4]=bitImm8; + opcodes[0x89][1]=opcodes[0x89][3]=bitImm16; + opcodes[0x24][0]=opcodes[0x24][2]=opcodes[0x24][4]=bitZp8; + opcodes[0x24][1]=opcodes[0x24][3]=bitZp16; + opcodes[0x34][0]=opcodes[0x34][2]=opcodes[0x34][4]=bitZpx8; + opcodes[0x34][1]=opcodes[0x34][3]=bitZpx16; + opcodes[0x2C][0]=opcodes[0x2C][2]=opcodes[0x2C][4]=bitAbs8; + opcodes[0x2C][1]=opcodes[0x2C][3]=bitAbs16; + opcodes[0x3C][0]=opcodes[0x3C][2]=opcodes[0x3C][4]=bitAbsx8; + opcodes[0x3C][1]=opcodes[0x3C][3]=bitAbsx16; + + /*Misc group*/ + opcodes[0x00][0]=opcodes[0x00][1]=opcodes[0x00][2]= + opcodes[0x00][3]=op_brk; + opcodes[0x00][4]=brke; + opcodes[0x02][0]=opcodes[0x02][1]=opcodes[0x02][2]= + opcodes[0x02][3]=cop; + opcodes[0x02][4]=cope; + opcodes[0xEB][0]=opcodes[0xEB][1]=opcodes[0xEB][2]= + opcodes[0xEB][3]=opcodes[0xEB][4]=xba; + opcodes[0xEA][0]=opcodes[0xEA][1]=opcodes[0xEA][2]= + opcodes[0xEA][3]=opcodes[0xEA][4]=nop; + opcodes[0x5B][0]=opcodes[0x5B][1]=opcodes[0x5B][2]= + opcodes[0x5B][3]=opcodes[0x5B][4]=tcd; + opcodes[0x7B][0]=opcodes[0x7B][1]=opcodes[0x7B][2]= + opcodes[0x7B][3]=opcodes[0x7B][4]=tdc; + opcodes[0x1B][0]=opcodes[0x1B][1]=opcodes[0x1B][2]= + opcodes[0x1B][3]=opcodes[0x1B][4]=tcs; + opcodes[0x3B][0]=opcodes[0x3B][1]=opcodes[0x3B][2]= + opcodes[0x3B][3]=opcodes[0x3B][4]=tsc; + opcodes[0xCB][0]=opcodes[0xCB][1]=opcodes[0xCB][2]= + opcodes[0xCB][3]=opcodes[0xCB][4]=wai; + opcodes[0x44][0]=opcodes[0x44][1]=opcodes[0x44][2]= + opcodes[0x44][3]=opcodes[0x44][4]=mvp; + opcodes[0x54][0]=opcodes[0x54][1]=opcodes[0x54][2]= + opcodes[0x54][3]=opcodes[0x54][4]=mvn; + opcodes[0x04][0]=opcodes[0x04][2]=opcodes[0x04][4]=tsbZp8; + opcodes[0x04][1]=opcodes[0x04][3]=tsbZp16; + opcodes[0x0C][0]=opcodes[0x0C][2]=opcodes[0x0C][4]=tsbAbs8; + opcodes[0x0C][1]=opcodes[0x0C][3]=tsbAbs16; + opcodes[0x14][0]=opcodes[0x14][2]=opcodes[0x14][4]=trbZp8; + opcodes[0x14][1]=opcodes[0x14][3]=trbZp16; + opcodes[0x1C][0]=opcodes[0x1C][2]=opcodes[0x1C][4]=trbAbs8; + opcodes[0x1C][1]=opcodes[0x1C][3]=trbAbs16; + opcodes[0x42][0]=opcodes[0x42][1]=opcodes[0x42][2]= + opcodes[0x42][3]=opcodes[0x42][4]=wdm; + opcodes[0xDB][0]=opcodes[0xDB][1]=opcodes[0xDB][2]= + opcodes[0xDB][3]=opcodes[0xDB][4]=stp; +} + +void w65816_init() +{ + FILE *f; + char fn[512]; + if (!w65816rom) w65816rom=malloc(0x8000); + if (!w65816ram) w65816ram=malloc(0x80000); + append_filename(fn,exedir,"roms/tube/ReCo6502ROM_816",511); + f=fopen(fn,"rb"); + fread(w65816rom,0x8000,1,f); + fclose(f); + makeopcodetable65816(); +} + +void w65816_close() +{ + if (w65816ram) free(w65816ram); + if (w65816rom) free(w65816rom); +} + +static void updatecpumode() +{ + if (p.e) + { + cpumode=4; + x.b.h=y.b.h=0; + } + else + { + cpumode=0; + if (!p.m) cpumode|=1; + if (!p.ex) cpumode|=2; + if (p.ex) x.b.h=y.b.h=0; + } +} + +static void nmi65816() +{ + uint8_t temp=0; +// printf("NMI %i %i %i\n",p.i,inwai,irqenable); + readmem(pbr|pc); + cycles--; clockspc(6); + if (inwai) pc++; + inwai=0; + if (!p.e) + { +// //printf("%02X -> %04X\n",pbr>>16,s.w); + writemem(s.w,pbr>>16); s.w--; +// //printf("%02X -> %04X\n",pc>>8,s.w); + writemem(s.w,pc>>8); s.w--; +// //printf("%02X -> %04X\n",pc&0xFF,s.w); + writemem(s.w,pc&0xFF); s.w--; + if (p.c) temp|=1; + if (p.z) temp|=2; + if (p.i) temp|=4; + if (p.d) temp|=8; + if (p.ex) temp|=0x10; + if (p.m) temp|=0x20; + if (p.v) temp|=0x40; + if (p.n) temp|=0x80; +// //printf("%02X -> %04X\n",temp,s.w); + writemem(s.w,temp); s.w--; + pc=readmemw(0xFFEA); + pbr=0; + p.i=1; + p.d=0; +// printf("NMI\n"); + } + else + { + writemem(s.w,pc>>8); s.b.l--; + writemem(s.w,pc&0xFF); s.b.l--; + if (p.c) temp|=1; + if (p.z) temp|=2; + if (p.i) temp|=4; + if (p.d) temp|=8; + if (p.v) temp|=0x40; + if (p.n) temp|=0x80; + writemem(s.w,temp|0x30); s.b.l--; + pc=readmemw(0xFFFA); + pbr=0; + p.i=1; + p.d=0; +// printf("Emulation mode NMI\n"); +// dumpregs(); +// exit(-1); + } +} + +static int toutput=0; +static void irq65816() +{ + uint8_t temp=0; +// printf("IRQ %i %i %i\n",p.i,inwai,irqenable); + readmem(pbr|pc); + cycles--; clockspc(6); + if (inwai && p.i) + { + pc++; + inwai=0; + return; + } + if (inwai) pc++; + inwai=0; + if (!p.e) + { + writemem(s.w,pbr>>16); s.w--; + writemem(s.w,pc>>8); s.w--; + writemem(s.w,pc&0xFF); s.w--; + if (p.c) temp|=1; + if (p.z) temp|=2; + if (p.i) temp|=4; + if (p.d) temp|=8; + if (p.ex) temp|=0x10; + if (p.m) temp|=0x20; + if (p.v) temp|=0x40; + if (p.n) temp|=0x80; + writemem(s.w,temp); s.w--; + pc=readmemw(0xFFEE); + pbr=0; + p.i=1; + p.d=0; +// printf("IRQ\n"); + } + else + { + writemem(s.w,pc>>8); s.b.l--; + writemem(s.w,pc&0xFF); s.b.l--; + if (p.c) temp|=1; + if (p.z) temp|=2; + if (p.i) temp|=4; + if (p.d) temp|=8; + if (p.v) temp|=0x40; + if (p.n) temp|=0x80; + writemem(s.w,temp|0x20); s.b.l--; + pc=readmemw(0xFFFE); + pbr=0; + p.i=1; + p.d=0; +// rpclog("Emulation mode IRQ %04X\n",pc); +// toutput=1; +// dumpregs(); +// exit(-1); + } +} + +static int woldnmi=0; +static uint16_t toldpc; +void w65816_exec() +{ + while (tubecycles>0) + { + opcode=readmem(pbr|pc); pc++; + if (toutput) rpclog("%i : %02X:%04X %04X %02X %i %04X %04X %04X %04X\n",wins,pbr,pc-1,toldpc,opcode,cycles,s.b.l,a.w,x.w,y.w); + toldpc=pc-1; + opcodes[opcode][cpumode](); +// if (pc==0xffee) toutput=1; + wins++; + if ((tube_irq&2) && !woldnmi) nmi65816(); + else if ((tube_irq&1) && !p.i) irq65816(); + woldnmi=tube_irq&2; +// if (pc==0x10C) toutput=1; +/* if (pc==0xfff7) + { + dumpregs65816(); + exit(-1); + }*/ +// if (pc==0xCB63) toutput=1; +// if (wins==4236000) toutput=1; +// if (wins==4236050) toutput=0; + } +} diff --git a/src/65816.h b/src/65816.h index b2cd3930..5b661cb3 100644 --- a/src/65816.h +++ b/src/65816.h @@ -1,4 +1,4 @@ -void w65816_init(); -void w65816_reset(); -void w65816_exec(); -void w65816_close(); +void w65816_init(); +void w65816_reset(); +void w65816_exec(); +void w65816_close(); diff --git a/src/Makefile b/src/Makefile index 2b1c7d94..2471c687 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,28 +1,1472 @@ -VPATH = . resid-fp -CPP = g++.exe -CC = gcc.exe -WINDRES = windres.exe -CFLAGS = -O3 -OBJ = 6502.o 6502tube.o 32016.o 65816.o acia.o adc.o adf.o arm.o cmos.o compact_joystick.o compactcmos.o config.o csw.o ddnoise.o debugger.o disc.o fdi2raw.o fdi.o i8271.o ide.o keyboard.o main.o mem.o model.o mouse.o pal.o savestate.o serial.o sn76489.o sound.o soundopenal.o ssd.o sysvia.o tape.o tapenoise.o tube.o uef.o uservia.o via.o vidalleg.o video.o wd1770.o win.o win-catalogue.o win-keydefine.o x86.o z80.o resid.o b-em.res -SIDOBJ = convolve.o envelope.o extfilt.o filter.o pot.o sid.o voice.o wave6581__ST.o wave6581_P_T.o wave6581_PS_.o wave6581_PST.o wave8580__ST.o wave8580_P_T.o wave8580_PS_.o wave8580_PST.o wave.o - -LIBS = -mwindows -lalleg -lz -lalut -lopenal32 -lgdi32 -lwinmm -lstdc++ - -b-em.exe: $(OBJ) $(SIDOBJ) - $(CC) $(OBJ) $(SIDOBJ) -o "b-em.exe" $(LIBS) - -all : b-em.exe - -clean : - del *.o - del *.exe - del *.res - -%.o : %.c - $(CC) $(CFLAGS) -c $< - -%.o : %.cc - $(CPP) $(CFLAGS) -c $< - -b-em.res: b-em.rc - $(WINDRES) -i b-em.rc --input-format=rc -o b-em.res -O coff \ No newline at end of file +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# src/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. + + + +# Makefile.am for B-em + + + +pkgdatadir = $(datadir)/b-em +pkgincludedir = $(includedir)/b-em +pkglibdir = $(libdir)/b-em +pkglibexecdir = $(libexecdir)/b-em +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +bin_PROGRAMS = b-em$(EXEEXT) +subdir = src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_b_em_OBJECTS = b_em-32016.$(OBJEXT) b_em-6502.$(OBJEXT) \ + b_em-6502tube.$(OBJEXT) b_em-65816.$(OBJEXT) \ + b_em-acia.$(OBJEXT) b_em-adc.$(OBJEXT) b_em-adf.$(OBJEXT) \ + b_em-arm.$(OBJEXT) b_em-cmos.$(OBJEXT) \ + b_em-compactcmos.$(OBJEXT) b_em-compact_joystick.$(OBJEXT) \ + b_em-config.$(OBJEXT) b_em-csw.$(OBJEXT) \ + b_em-ddnoise.$(OBJEXT) b_em-debugger.$(OBJEXT) \ + b_em-disc.$(OBJEXT) b_em-fdi.$(OBJEXT) b_em-fdi2raw.$(OBJEXT) \ + b_em-i8271.$(OBJEXT) b_em-ide.$(OBJEXT) \ + b_em-keyboard.$(OBJEXT) b_em-linux.$(OBJEXT) \ + b_em-linux-gui.$(OBJEXT) b_em-linux-keydefine.$(OBJEXT) \ + b_em-main.$(OBJEXT) b_em-mem.$(OBJEXT) b_em-model.$(OBJEXT) \ + b_em-mouse.$(OBJEXT) b_em-savestate.$(OBJEXT) \ + b_em-serial.$(OBJEXT) b_em-sn76489.$(OBJEXT) \ + b_em-sound.$(OBJEXT) b_em-soundopenal.$(OBJEXT) \ + b_em-ssd.$(OBJEXT) b_em-sysvia.$(OBJEXT) b_em-tape.$(OBJEXT) \ + b_em-tapenoise.$(OBJEXT) b_em-tube.$(OBJEXT) \ + b_em-uef.$(OBJEXT) b_em-uservia.$(OBJEXT) b_em-via.$(OBJEXT) \ + b_em-vidalleg.$(OBJEXT) b_em-video.$(OBJEXT) \ + b_em-wd1770.$(OBJEXT) b_em-x86.$(OBJEXT) b_em-Z80.$(OBJEXT) \ + resid.$(OBJEXT) convolve.$(OBJEXT) convolve-sse.$(OBJEXT) \ + envelope.$(OBJEXT) extfilt.$(OBJEXT) filter.$(OBJEXT) \ + pot.$(OBJEXT) sid.$(OBJEXT) voice.$(OBJEXT) \ + wave6581_PS_.$(OBJEXT) wave6581_PST.$(OBJEXT) \ + wave6581_P_T.$(OBJEXT) wave6581__ST.$(OBJEXT) \ + wave8580_PS_.$(OBJEXT) wave8580_PST.$(OBJEXT) \ + wave8580_P_T.$(OBJEXT) wave8580__ST.$(OBJEXT) wave.$(OBJEXT) +b_em_OBJECTS = $(am_b_em_OBJECTS) +am__DEPENDENCIES_1 = +b_em_DEPENDENCIES = $(am__DEPENDENCIES_1) +SCRIPTS = $(noinst_SCRIPTS) +DEFAULT_INCLUDES = -I. +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +SOURCES = $(b_em_SOURCES) +DIST_SOURCES = $(b_em_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /home/mesa/b-em/test/missing --run aclocal-1.11 +ALLEGRO_CONFIG = /usr/bin/allegro-config +AMTAR = ${SHELL} /home/mesa/b-em/test/missing --run tar +AUTOCONF = ${SHELL} /home/mesa/b-em/test/missing --run autoconf +AUTOHEADER = ${SHELL} /home/mesa/b-em/test/missing --run autoheader +AUTOMAKE = ${SHELL} /home/mesa/b-em/test/missing --run automake-1.11 +AWK = mawk +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 -O3 +CPPFLAGS = +CXX = g++ +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -g -O2 +CYGPATH_W = echo +DEFS = -DPACKAGE_NAME=\"B-em\" -DPACKAGE_TARNAME=\"b-em\" -DPACKAGE_VERSION=\"2.2\" -DPACKAGE_STRING=\"B-em\ 2.2\" -DPACKAGE_BUGREPORT=\"Tom\ Walker\ \\" -DPACKAGE_URL=\"\" -DPACKAGE=\"b-em\" -DVERSION=\"2.2\" -DHAVE_LIBZ=1 -DHAVE_LIBOPENAL=1 -DHAVE_LIBALUT=1 +DEPDIR = .deps +ECHO_C = +ECHO_N = -n +ECHO_T = +EXEEXT = +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LDFLAGS = +LIBOBJS = +LIBS = -lalut -lopenal -lz +LTLIBOBJS = +MAKEINFO = ${SHELL} /home/mesa/b-em/test/missing --run makeinfo +MKDIR_P = /bin/mkdir -p +OBJEXT = o +PACKAGE = b-em +PACKAGE_BUGREPORT = Tom Walker +PACKAGE_NAME = B-em +PACKAGE_STRING = B-em 2.2 +PACKAGE_TARNAME = b-em +PACKAGE_URL = +PACKAGE_VERSION = 2.2 +PATH_SEPARATOR = : +SET_MAKE = +SHELL = /bin/bash +STRIP = +VERSION = 2.2 +abs_builddir = /home/mesa/b-em/test/src +abs_srcdir = /home/mesa/b-em/test/src +abs_top_builddir = /home/mesa/b-em/test +abs_top_srcdir = /home/mesa/b-em/test +ac_ct_CC = gcc +ac_ct_CXX = g++ +allegro_CFLAGS = -I/usr/include +allegro_LIBS = -L/usr/lib -Wl,-Bsymbolic-functions -lalleg-4.2.2 +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build_alias = +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host_alias = +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /home/mesa/b-em/test/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target_alias = +top_build_prefix = ../ +top_builddir = .. +top_srcdir = .. +noinst_SCRIPTS = ../b-em +CLEANFILES = $(noinst_SCRIPTS) +b_em_CFLAGS = $(allegro_CFLAGS) +b_em_LDADD = $(allegro_LIBS) -lz -lopenal -lalut + +# workaround for Win32 Allegro, which has `allegro-config' missing +#b_em_LDADD = -lalleg -lz -lopenal -lalut +b_em_SOURCES = 32016.c 6502.c 6502tube.c 65816.c acia.c adc.c \ +adf.c arm.c cmos.c compactcmos.c compact_joystick.c config.c csw.c ddnoise.c \ +debugger.c disc.c fdi.c fdi2raw.c i8271.c ide.c keyboard.c linux.c linux-gui.c \ +linux-keydefine.c main.c mem.c model.c mouse.c savestate.c serial.c sn76489.c \ +sound.c soundopenal.c ssd.c sysvia.c tape.c tapenoise.c tube.c uef.c uservia.c \ +via.c vidalleg.c video.c wd1770.c x86.c Z80.c resid.cc \ +resid-fp/convolve.cc resid-fp/convolve-sse.cc resid-fp/envelope.cc \ +resid-fp/extfilt.cc resid-fp/filter.cc resid-fp/pot.cc resid-fp/sid.cc \ +resid-fp/voice.cc resid-fp/wave6581_PS_.cc resid-fp/wave6581_PST.cc \ +resid-fp/wave6581_P_T.cc resid-fp/wave6581__ST.cc resid-fp/wave8580_PS_.cc \ +resid-fp/wave8580_PST.cc resid-fp/wave8580_P_T.cc resid-fp/wave8580__ST.cc \ +resid-fp/wave.cc + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .cc .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +b-em$(EXEEXT): $(b_em_OBJECTS) $(b_em_DEPENDENCIES) + @rm -f b-em$(EXEEXT) + $(CXXLINK) $(b_em_OBJECTS) $(b_em_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/b_em-32016.Po +include ./$(DEPDIR)/b_em-6502.Po +include ./$(DEPDIR)/b_em-6502tube.Po +include ./$(DEPDIR)/b_em-65816.Po +include ./$(DEPDIR)/b_em-Z80.Po +include ./$(DEPDIR)/b_em-acia.Po +include ./$(DEPDIR)/b_em-adc.Po +include ./$(DEPDIR)/b_em-adf.Po +include ./$(DEPDIR)/b_em-arm.Po +include ./$(DEPDIR)/b_em-cmos.Po +include ./$(DEPDIR)/b_em-compact_joystick.Po +include ./$(DEPDIR)/b_em-compactcmos.Po +include ./$(DEPDIR)/b_em-config.Po +include ./$(DEPDIR)/b_em-csw.Po +include ./$(DEPDIR)/b_em-ddnoise.Po +include ./$(DEPDIR)/b_em-debugger.Po +include ./$(DEPDIR)/b_em-disc.Po +include ./$(DEPDIR)/b_em-fdi.Po +include ./$(DEPDIR)/b_em-fdi2raw.Po +include ./$(DEPDIR)/b_em-i8271.Po +include ./$(DEPDIR)/b_em-ide.Po +include ./$(DEPDIR)/b_em-keyboard.Po +include ./$(DEPDIR)/b_em-linux-gui.Po +include ./$(DEPDIR)/b_em-linux-keydefine.Po +include ./$(DEPDIR)/b_em-linux.Po +include ./$(DEPDIR)/b_em-main.Po +include ./$(DEPDIR)/b_em-mem.Po +include ./$(DEPDIR)/b_em-model.Po +include ./$(DEPDIR)/b_em-mouse.Po +include ./$(DEPDIR)/b_em-savestate.Po +include ./$(DEPDIR)/b_em-serial.Po +include ./$(DEPDIR)/b_em-sn76489.Po +include ./$(DEPDIR)/b_em-sound.Po +include ./$(DEPDIR)/b_em-soundopenal.Po +include ./$(DEPDIR)/b_em-ssd.Po +include ./$(DEPDIR)/b_em-sysvia.Po +include ./$(DEPDIR)/b_em-tape.Po +include ./$(DEPDIR)/b_em-tapenoise.Po +include ./$(DEPDIR)/b_em-tube.Po +include ./$(DEPDIR)/b_em-uef.Po +include ./$(DEPDIR)/b_em-uservia.Po +include ./$(DEPDIR)/b_em-via.Po +include ./$(DEPDIR)/b_em-vidalleg.Po +include ./$(DEPDIR)/b_em-video.Po +include ./$(DEPDIR)/b_em-wd1770.Po +include ./$(DEPDIR)/b_em-x86.Po +include ./$(DEPDIR)/convolve-sse.Po +include ./$(DEPDIR)/convolve.Po +include ./$(DEPDIR)/envelope.Po +include ./$(DEPDIR)/extfilt.Po +include ./$(DEPDIR)/filter.Po +include ./$(DEPDIR)/pot.Po +include ./$(DEPDIR)/resid.Po +include ./$(DEPDIR)/sid.Po +include ./$(DEPDIR)/voice.Po +include ./$(DEPDIR)/wave.Po +include ./$(DEPDIR)/wave6581_PST.Po +include ./$(DEPDIR)/wave6581_PS_.Po +include ./$(DEPDIR)/wave6581_P_T.Po +include ./$(DEPDIR)/wave6581__ST.Po +include ./$(DEPDIR)/wave8580_PST.Po +include ./$(DEPDIR)/wave8580_PS_.Po +include ./$(DEPDIR)/wave8580_P_T.Po +include ./$(DEPDIR)/wave8580__ST.Po + +.c.o: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c $< + +.c.obj: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c `$(CYGPATH_W) '$<'` + +b_em-32016.o: 32016.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-32016.o -MD -MP -MF $(DEPDIR)/b_em-32016.Tpo -c -o b_em-32016.o `test -f '32016.c' || echo '$(srcdir)/'`32016.c + $(am__mv) $(DEPDIR)/b_em-32016.Tpo $(DEPDIR)/b_em-32016.Po +# source='32016.c' object='b_em-32016.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-32016.o `test -f '32016.c' || echo '$(srcdir)/'`32016.c + +b_em-32016.obj: 32016.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-32016.obj -MD -MP -MF $(DEPDIR)/b_em-32016.Tpo -c -o b_em-32016.obj `if test -f '32016.c'; then $(CYGPATH_W) '32016.c'; else $(CYGPATH_W) '$(srcdir)/32016.c'; fi` + $(am__mv) $(DEPDIR)/b_em-32016.Tpo $(DEPDIR)/b_em-32016.Po +# source='32016.c' object='b_em-32016.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-32016.obj `if test -f '32016.c'; then $(CYGPATH_W) '32016.c'; else $(CYGPATH_W) '$(srcdir)/32016.c'; fi` + +b_em-6502.o: 6502.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-6502.o -MD -MP -MF $(DEPDIR)/b_em-6502.Tpo -c -o b_em-6502.o `test -f '6502.c' || echo '$(srcdir)/'`6502.c + $(am__mv) $(DEPDIR)/b_em-6502.Tpo $(DEPDIR)/b_em-6502.Po +# source='6502.c' object='b_em-6502.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-6502.o `test -f '6502.c' || echo '$(srcdir)/'`6502.c + +b_em-6502.obj: 6502.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-6502.obj -MD -MP -MF $(DEPDIR)/b_em-6502.Tpo -c -o b_em-6502.obj `if test -f '6502.c'; then $(CYGPATH_W) '6502.c'; else $(CYGPATH_W) '$(srcdir)/6502.c'; fi` + $(am__mv) $(DEPDIR)/b_em-6502.Tpo $(DEPDIR)/b_em-6502.Po +# source='6502.c' object='b_em-6502.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-6502.obj `if test -f '6502.c'; then $(CYGPATH_W) '6502.c'; else $(CYGPATH_W) '$(srcdir)/6502.c'; fi` + +b_em-6502tube.o: 6502tube.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-6502tube.o -MD -MP -MF $(DEPDIR)/b_em-6502tube.Tpo -c -o b_em-6502tube.o `test -f '6502tube.c' || echo '$(srcdir)/'`6502tube.c + $(am__mv) $(DEPDIR)/b_em-6502tube.Tpo $(DEPDIR)/b_em-6502tube.Po +# source='6502tube.c' object='b_em-6502tube.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-6502tube.o `test -f '6502tube.c' || echo '$(srcdir)/'`6502tube.c + +b_em-6502tube.obj: 6502tube.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-6502tube.obj -MD -MP -MF $(DEPDIR)/b_em-6502tube.Tpo -c -o b_em-6502tube.obj `if test -f '6502tube.c'; then $(CYGPATH_W) '6502tube.c'; else $(CYGPATH_W) '$(srcdir)/6502tube.c'; fi` + $(am__mv) $(DEPDIR)/b_em-6502tube.Tpo $(DEPDIR)/b_em-6502tube.Po +# source='6502tube.c' object='b_em-6502tube.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-6502tube.obj `if test -f '6502tube.c'; then $(CYGPATH_W) '6502tube.c'; else $(CYGPATH_W) '$(srcdir)/6502tube.c'; fi` + +b_em-65816.o: 65816.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-65816.o -MD -MP -MF $(DEPDIR)/b_em-65816.Tpo -c -o b_em-65816.o `test -f '65816.c' || echo '$(srcdir)/'`65816.c + $(am__mv) $(DEPDIR)/b_em-65816.Tpo $(DEPDIR)/b_em-65816.Po +# source='65816.c' object='b_em-65816.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-65816.o `test -f '65816.c' || echo '$(srcdir)/'`65816.c + +b_em-65816.obj: 65816.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-65816.obj -MD -MP -MF $(DEPDIR)/b_em-65816.Tpo -c -o b_em-65816.obj `if test -f '65816.c'; then $(CYGPATH_W) '65816.c'; else $(CYGPATH_W) '$(srcdir)/65816.c'; fi` + $(am__mv) $(DEPDIR)/b_em-65816.Tpo $(DEPDIR)/b_em-65816.Po +# source='65816.c' object='b_em-65816.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-65816.obj `if test -f '65816.c'; then $(CYGPATH_W) '65816.c'; else $(CYGPATH_W) '$(srcdir)/65816.c'; fi` + +b_em-acia.o: acia.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-acia.o -MD -MP -MF $(DEPDIR)/b_em-acia.Tpo -c -o b_em-acia.o `test -f 'acia.c' || echo '$(srcdir)/'`acia.c + $(am__mv) $(DEPDIR)/b_em-acia.Tpo $(DEPDIR)/b_em-acia.Po +# source='acia.c' object='b_em-acia.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-acia.o `test -f 'acia.c' || echo '$(srcdir)/'`acia.c + +b_em-acia.obj: acia.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-acia.obj -MD -MP -MF $(DEPDIR)/b_em-acia.Tpo -c -o b_em-acia.obj `if test -f 'acia.c'; then $(CYGPATH_W) 'acia.c'; else $(CYGPATH_W) '$(srcdir)/acia.c'; fi` + $(am__mv) $(DEPDIR)/b_em-acia.Tpo $(DEPDIR)/b_em-acia.Po +# source='acia.c' object='b_em-acia.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-acia.obj `if test -f 'acia.c'; then $(CYGPATH_W) 'acia.c'; else $(CYGPATH_W) '$(srcdir)/acia.c'; fi` + +b_em-adc.o: adc.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-adc.o -MD -MP -MF $(DEPDIR)/b_em-adc.Tpo -c -o b_em-adc.o `test -f 'adc.c' || echo '$(srcdir)/'`adc.c + $(am__mv) $(DEPDIR)/b_em-adc.Tpo $(DEPDIR)/b_em-adc.Po +# source='adc.c' object='b_em-adc.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-adc.o `test -f 'adc.c' || echo '$(srcdir)/'`adc.c + +b_em-adc.obj: adc.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-adc.obj -MD -MP -MF $(DEPDIR)/b_em-adc.Tpo -c -o b_em-adc.obj `if test -f 'adc.c'; then $(CYGPATH_W) 'adc.c'; else $(CYGPATH_W) '$(srcdir)/adc.c'; fi` + $(am__mv) $(DEPDIR)/b_em-adc.Tpo $(DEPDIR)/b_em-adc.Po +# source='adc.c' object='b_em-adc.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-adc.obj `if test -f 'adc.c'; then $(CYGPATH_W) 'adc.c'; else $(CYGPATH_W) '$(srcdir)/adc.c'; fi` + +b_em-adf.o: adf.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-adf.o -MD -MP -MF $(DEPDIR)/b_em-adf.Tpo -c -o b_em-adf.o `test -f 'adf.c' || echo '$(srcdir)/'`adf.c + $(am__mv) $(DEPDIR)/b_em-adf.Tpo $(DEPDIR)/b_em-adf.Po +# source='adf.c' object='b_em-adf.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-adf.o `test -f 'adf.c' || echo '$(srcdir)/'`adf.c + +b_em-adf.obj: adf.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-adf.obj -MD -MP -MF $(DEPDIR)/b_em-adf.Tpo -c -o b_em-adf.obj `if test -f 'adf.c'; then $(CYGPATH_W) 'adf.c'; else $(CYGPATH_W) '$(srcdir)/adf.c'; fi` + $(am__mv) $(DEPDIR)/b_em-adf.Tpo $(DEPDIR)/b_em-adf.Po +# source='adf.c' object='b_em-adf.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-adf.obj `if test -f 'adf.c'; then $(CYGPATH_W) 'adf.c'; else $(CYGPATH_W) '$(srcdir)/adf.c'; fi` + +b_em-arm.o: arm.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-arm.o -MD -MP -MF $(DEPDIR)/b_em-arm.Tpo -c -o b_em-arm.o `test -f 'arm.c' || echo '$(srcdir)/'`arm.c + $(am__mv) $(DEPDIR)/b_em-arm.Tpo $(DEPDIR)/b_em-arm.Po +# source='arm.c' object='b_em-arm.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-arm.o `test -f 'arm.c' || echo '$(srcdir)/'`arm.c + +b_em-arm.obj: arm.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-arm.obj -MD -MP -MF $(DEPDIR)/b_em-arm.Tpo -c -o b_em-arm.obj `if test -f 'arm.c'; then $(CYGPATH_W) 'arm.c'; else $(CYGPATH_W) '$(srcdir)/arm.c'; fi` + $(am__mv) $(DEPDIR)/b_em-arm.Tpo $(DEPDIR)/b_em-arm.Po +# source='arm.c' object='b_em-arm.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-arm.obj `if test -f 'arm.c'; then $(CYGPATH_W) 'arm.c'; else $(CYGPATH_W) '$(srcdir)/arm.c'; fi` + +b_em-cmos.o: cmos.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-cmos.o -MD -MP -MF $(DEPDIR)/b_em-cmos.Tpo -c -o b_em-cmos.o `test -f 'cmos.c' || echo '$(srcdir)/'`cmos.c + $(am__mv) $(DEPDIR)/b_em-cmos.Tpo $(DEPDIR)/b_em-cmos.Po +# source='cmos.c' object='b_em-cmos.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-cmos.o `test -f 'cmos.c' || echo '$(srcdir)/'`cmos.c + +b_em-cmos.obj: cmos.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-cmos.obj -MD -MP -MF $(DEPDIR)/b_em-cmos.Tpo -c -o b_em-cmos.obj `if test -f 'cmos.c'; then $(CYGPATH_W) 'cmos.c'; else $(CYGPATH_W) '$(srcdir)/cmos.c'; fi` + $(am__mv) $(DEPDIR)/b_em-cmos.Tpo $(DEPDIR)/b_em-cmos.Po +# source='cmos.c' object='b_em-cmos.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-cmos.obj `if test -f 'cmos.c'; then $(CYGPATH_W) 'cmos.c'; else $(CYGPATH_W) '$(srcdir)/cmos.c'; fi` + +b_em-compactcmos.o: compactcmos.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-compactcmos.o -MD -MP -MF $(DEPDIR)/b_em-compactcmos.Tpo -c -o b_em-compactcmos.o `test -f 'compactcmos.c' || echo '$(srcdir)/'`compactcmos.c + $(am__mv) $(DEPDIR)/b_em-compactcmos.Tpo $(DEPDIR)/b_em-compactcmos.Po +# source='compactcmos.c' object='b_em-compactcmos.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-compactcmos.o `test -f 'compactcmos.c' || echo '$(srcdir)/'`compactcmos.c + +b_em-compactcmos.obj: compactcmos.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-compactcmos.obj -MD -MP -MF $(DEPDIR)/b_em-compactcmos.Tpo -c -o b_em-compactcmos.obj `if test -f 'compactcmos.c'; then $(CYGPATH_W) 'compactcmos.c'; else $(CYGPATH_W) '$(srcdir)/compactcmos.c'; fi` + $(am__mv) $(DEPDIR)/b_em-compactcmos.Tpo $(DEPDIR)/b_em-compactcmos.Po +# source='compactcmos.c' object='b_em-compactcmos.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-compactcmos.obj `if test -f 'compactcmos.c'; then $(CYGPATH_W) 'compactcmos.c'; else $(CYGPATH_W) '$(srcdir)/compactcmos.c'; fi` + +b_em-compact_joystick.o: compact_joystick.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-compact_joystick.o -MD -MP -MF $(DEPDIR)/b_em-compact_joystick.Tpo -c -o b_em-compact_joystick.o `test -f 'compact_joystick.c' || echo '$(srcdir)/'`compact_joystick.c + $(am__mv) $(DEPDIR)/b_em-compact_joystick.Tpo $(DEPDIR)/b_em-compact_joystick.Po +# source='compact_joystick.c' object='b_em-compact_joystick.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-compact_joystick.o `test -f 'compact_joystick.c' || echo '$(srcdir)/'`compact_joystick.c + +b_em-compact_joystick.obj: compact_joystick.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-compact_joystick.obj -MD -MP -MF $(DEPDIR)/b_em-compact_joystick.Tpo -c -o b_em-compact_joystick.obj `if test -f 'compact_joystick.c'; then $(CYGPATH_W) 'compact_joystick.c'; else $(CYGPATH_W) '$(srcdir)/compact_joystick.c'; fi` + $(am__mv) $(DEPDIR)/b_em-compact_joystick.Tpo $(DEPDIR)/b_em-compact_joystick.Po +# source='compact_joystick.c' object='b_em-compact_joystick.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-compact_joystick.obj `if test -f 'compact_joystick.c'; then $(CYGPATH_W) 'compact_joystick.c'; else $(CYGPATH_W) '$(srcdir)/compact_joystick.c'; fi` + +b_em-config.o: config.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-config.o -MD -MP -MF $(DEPDIR)/b_em-config.Tpo -c -o b_em-config.o `test -f 'config.c' || echo '$(srcdir)/'`config.c + $(am__mv) $(DEPDIR)/b_em-config.Tpo $(DEPDIR)/b_em-config.Po +# source='config.c' object='b_em-config.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-config.o `test -f 'config.c' || echo '$(srcdir)/'`config.c + +b_em-config.obj: config.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-config.obj -MD -MP -MF $(DEPDIR)/b_em-config.Tpo -c -o b_em-config.obj `if test -f 'config.c'; then $(CYGPATH_W) 'config.c'; else $(CYGPATH_W) '$(srcdir)/config.c'; fi` + $(am__mv) $(DEPDIR)/b_em-config.Tpo $(DEPDIR)/b_em-config.Po +# source='config.c' object='b_em-config.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-config.obj `if test -f 'config.c'; then $(CYGPATH_W) 'config.c'; else $(CYGPATH_W) '$(srcdir)/config.c'; fi` + +b_em-csw.o: csw.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-csw.o -MD -MP -MF $(DEPDIR)/b_em-csw.Tpo -c -o b_em-csw.o `test -f 'csw.c' || echo '$(srcdir)/'`csw.c + $(am__mv) $(DEPDIR)/b_em-csw.Tpo $(DEPDIR)/b_em-csw.Po +# source='csw.c' object='b_em-csw.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-csw.o `test -f 'csw.c' || echo '$(srcdir)/'`csw.c + +b_em-csw.obj: csw.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-csw.obj -MD -MP -MF $(DEPDIR)/b_em-csw.Tpo -c -o b_em-csw.obj `if test -f 'csw.c'; then $(CYGPATH_W) 'csw.c'; else $(CYGPATH_W) '$(srcdir)/csw.c'; fi` + $(am__mv) $(DEPDIR)/b_em-csw.Tpo $(DEPDIR)/b_em-csw.Po +# source='csw.c' object='b_em-csw.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-csw.obj `if test -f 'csw.c'; then $(CYGPATH_W) 'csw.c'; else $(CYGPATH_W) '$(srcdir)/csw.c'; fi` + +b_em-ddnoise.o: ddnoise.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-ddnoise.o -MD -MP -MF $(DEPDIR)/b_em-ddnoise.Tpo -c -o b_em-ddnoise.o `test -f 'ddnoise.c' || echo '$(srcdir)/'`ddnoise.c + $(am__mv) $(DEPDIR)/b_em-ddnoise.Tpo $(DEPDIR)/b_em-ddnoise.Po +# source='ddnoise.c' object='b_em-ddnoise.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-ddnoise.o `test -f 'ddnoise.c' || echo '$(srcdir)/'`ddnoise.c + +b_em-ddnoise.obj: ddnoise.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-ddnoise.obj -MD -MP -MF $(DEPDIR)/b_em-ddnoise.Tpo -c -o b_em-ddnoise.obj `if test -f 'ddnoise.c'; then $(CYGPATH_W) 'ddnoise.c'; else $(CYGPATH_W) '$(srcdir)/ddnoise.c'; fi` + $(am__mv) $(DEPDIR)/b_em-ddnoise.Tpo $(DEPDIR)/b_em-ddnoise.Po +# source='ddnoise.c' object='b_em-ddnoise.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-ddnoise.obj `if test -f 'ddnoise.c'; then $(CYGPATH_W) 'ddnoise.c'; else $(CYGPATH_W) '$(srcdir)/ddnoise.c'; fi` + +b_em-debugger.o: debugger.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-debugger.o -MD -MP -MF $(DEPDIR)/b_em-debugger.Tpo -c -o b_em-debugger.o `test -f 'debugger.c' || echo '$(srcdir)/'`debugger.c + $(am__mv) $(DEPDIR)/b_em-debugger.Tpo $(DEPDIR)/b_em-debugger.Po +# source='debugger.c' object='b_em-debugger.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-debugger.o `test -f 'debugger.c' || echo '$(srcdir)/'`debugger.c + +b_em-debugger.obj: debugger.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-debugger.obj -MD -MP -MF $(DEPDIR)/b_em-debugger.Tpo -c -o b_em-debugger.obj `if test -f 'debugger.c'; then $(CYGPATH_W) 'debugger.c'; else $(CYGPATH_W) '$(srcdir)/debugger.c'; fi` + $(am__mv) $(DEPDIR)/b_em-debugger.Tpo $(DEPDIR)/b_em-debugger.Po +# source='debugger.c' object='b_em-debugger.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-debugger.obj `if test -f 'debugger.c'; then $(CYGPATH_W) 'debugger.c'; else $(CYGPATH_W) '$(srcdir)/debugger.c'; fi` + +b_em-disc.o: disc.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-disc.o -MD -MP -MF $(DEPDIR)/b_em-disc.Tpo -c -o b_em-disc.o `test -f 'disc.c' || echo '$(srcdir)/'`disc.c + $(am__mv) $(DEPDIR)/b_em-disc.Tpo $(DEPDIR)/b_em-disc.Po +# source='disc.c' object='b_em-disc.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-disc.o `test -f 'disc.c' || echo '$(srcdir)/'`disc.c + +b_em-disc.obj: disc.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-disc.obj -MD -MP -MF $(DEPDIR)/b_em-disc.Tpo -c -o b_em-disc.obj `if test -f 'disc.c'; then $(CYGPATH_W) 'disc.c'; else $(CYGPATH_W) '$(srcdir)/disc.c'; fi` + $(am__mv) $(DEPDIR)/b_em-disc.Tpo $(DEPDIR)/b_em-disc.Po +# source='disc.c' object='b_em-disc.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-disc.obj `if test -f 'disc.c'; then $(CYGPATH_W) 'disc.c'; else $(CYGPATH_W) '$(srcdir)/disc.c'; fi` + +b_em-fdi.o: fdi.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-fdi.o -MD -MP -MF $(DEPDIR)/b_em-fdi.Tpo -c -o b_em-fdi.o `test -f 'fdi.c' || echo '$(srcdir)/'`fdi.c + $(am__mv) $(DEPDIR)/b_em-fdi.Tpo $(DEPDIR)/b_em-fdi.Po +# source='fdi.c' object='b_em-fdi.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-fdi.o `test -f 'fdi.c' || echo '$(srcdir)/'`fdi.c + +b_em-fdi.obj: fdi.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-fdi.obj -MD -MP -MF $(DEPDIR)/b_em-fdi.Tpo -c -o b_em-fdi.obj `if test -f 'fdi.c'; then $(CYGPATH_W) 'fdi.c'; else $(CYGPATH_W) '$(srcdir)/fdi.c'; fi` + $(am__mv) $(DEPDIR)/b_em-fdi.Tpo $(DEPDIR)/b_em-fdi.Po +# source='fdi.c' object='b_em-fdi.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-fdi.obj `if test -f 'fdi.c'; then $(CYGPATH_W) 'fdi.c'; else $(CYGPATH_W) '$(srcdir)/fdi.c'; fi` + +b_em-fdi2raw.o: fdi2raw.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-fdi2raw.o -MD -MP -MF $(DEPDIR)/b_em-fdi2raw.Tpo -c -o b_em-fdi2raw.o `test -f 'fdi2raw.c' || echo '$(srcdir)/'`fdi2raw.c + $(am__mv) $(DEPDIR)/b_em-fdi2raw.Tpo $(DEPDIR)/b_em-fdi2raw.Po +# source='fdi2raw.c' object='b_em-fdi2raw.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-fdi2raw.o `test -f 'fdi2raw.c' || echo '$(srcdir)/'`fdi2raw.c + +b_em-fdi2raw.obj: fdi2raw.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-fdi2raw.obj -MD -MP -MF $(DEPDIR)/b_em-fdi2raw.Tpo -c -o b_em-fdi2raw.obj `if test -f 'fdi2raw.c'; then $(CYGPATH_W) 'fdi2raw.c'; else $(CYGPATH_W) '$(srcdir)/fdi2raw.c'; fi` + $(am__mv) $(DEPDIR)/b_em-fdi2raw.Tpo $(DEPDIR)/b_em-fdi2raw.Po +# source='fdi2raw.c' object='b_em-fdi2raw.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-fdi2raw.obj `if test -f 'fdi2raw.c'; then $(CYGPATH_W) 'fdi2raw.c'; else $(CYGPATH_W) '$(srcdir)/fdi2raw.c'; fi` + +b_em-i8271.o: i8271.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-i8271.o -MD -MP -MF $(DEPDIR)/b_em-i8271.Tpo -c -o b_em-i8271.o `test -f 'i8271.c' || echo '$(srcdir)/'`i8271.c + $(am__mv) $(DEPDIR)/b_em-i8271.Tpo $(DEPDIR)/b_em-i8271.Po +# source='i8271.c' object='b_em-i8271.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-i8271.o `test -f 'i8271.c' || echo '$(srcdir)/'`i8271.c + +b_em-i8271.obj: i8271.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-i8271.obj -MD -MP -MF $(DEPDIR)/b_em-i8271.Tpo -c -o b_em-i8271.obj `if test -f 'i8271.c'; then $(CYGPATH_W) 'i8271.c'; else $(CYGPATH_W) '$(srcdir)/i8271.c'; fi` + $(am__mv) $(DEPDIR)/b_em-i8271.Tpo $(DEPDIR)/b_em-i8271.Po +# source='i8271.c' object='b_em-i8271.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-i8271.obj `if test -f 'i8271.c'; then $(CYGPATH_W) 'i8271.c'; else $(CYGPATH_W) '$(srcdir)/i8271.c'; fi` + +b_em-ide.o: ide.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-ide.o -MD -MP -MF $(DEPDIR)/b_em-ide.Tpo -c -o b_em-ide.o `test -f 'ide.c' || echo '$(srcdir)/'`ide.c + $(am__mv) $(DEPDIR)/b_em-ide.Tpo $(DEPDIR)/b_em-ide.Po +# source='ide.c' object='b_em-ide.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-ide.o `test -f 'ide.c' || echo '$(srcdir)/'`ide.c + +b_em-ide.obj: ide.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-ide.obj -MD -MP -MF $(DEPDIR)/b_em-ide.Tpo -c -o b_em-ide.obj `if test -f 'ide.c'; then $(CYGPATH_W) 'ide.c'; else $(CYGPATH_W) '$(srcdir)/ide.c'; fi` + $(am__mv) $(DEPDIR)/b_em-ide.Tpo $(DEPDIR)/b_em-ide.Po +# source='ide.c' object='b_em-ide.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-ide.obj `if test -f 'ide.c'; then $(CYGPATH_W) 'ide.c'; else $(CYGPATH_W) '$(srcdir)/ide.c'; fi` + +b_em-keyboard.o: keyboard.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-keyboard.o -MD -MP -MF $(DEPDIR)/b_em-keyboard.Tpo -c -o b_em-keyboard.o `test -f 'keyboard.c' || echo '$(srcdir)/'`keyboard.c + $(am__mv) $(DEPDIR)/b_em-keyboard.Tpo $(DEPDIR)/b_em-keyboard.Po +# source='keyboard.c' object='b_em-keyboard.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-keyboard.o `test -f 'keyboard.c' || echo '$(srcdir)/'`keyboard.c + +b_em-keyboard.obj: keyboard.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-keyboard.obj -MD -MP -MF $(DEPDIR)/b_em-keyboard.Tpo -c -o b_em-keyboard.obj `if test -f 'keyboard.c'; then $(CYGPATH_W) 'keyboard.c'; else $(CYGPATH_W) '$(srcdir)/keyboard.c'; fi` + $(am__mv) $(DEPDIR)/b_em-keyboard.Tpo $(DEPDIR)/b_em-keyboard.Po +# source='keyboard.c' object='b_em-keyboard.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-keyboard.obj `if test -f 'keyboard.c'; then $(CYGPATH_W) 'keyboard.c'; else $(CYGPATH_W) '$(srcdir)/keyboard.c'; fi` + +b_em-linux.o: linux.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-linux.o -MD -MP -MF $(DEPDIR)/b_em-linux.Tpo -c -o b_em-linux.o `test -f 'linux.c' || echo '$(srcdir)/'`linux.c + $(am__mv) $(DEPDIR)/b_em-linux.Tpo $(DEPDIR)/b_em-linux.Po +# source='linux.c' object='b_em-linux.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-linux.o `test -f 'linux.c' || echo '$(srcdir)/'`linux.c + +b_em-linux.obj: linux.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-linux.obj -MD -MP -MF $(DEPDIR)/b_em-linux.Tpo -c -o b_em-linux.obj `if test -f 'linux.c'; then $(CYGPATH_W) 'linux.c'; else $(CYGPATH_W) '$(srcdir)/linux.c'; fi` + $(am__mv) $(DEPDIR)/b_em-linux.Tpo $(DEPDIR)/b_em-linux.Po +# source='linux.c' object='b_em-linux.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-linux.obj `if test -f 'linux.c'; then $(CYGPATH_W) 'linux.c'; else $(CYGPATH_W) '$(srcdir)/linux.c'; fi` + +b_em-linux-gui.o: linux-gui.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-linux-gui.o -MD -MP -MF $(DEPDIR)/b_em-linux-gui.Tpo -c -o b_em-linux-gui.o `test -f 'linux-gui.c' || echo '$(srcdir)/'`linux-gui.c + $(am__mv) $(DEPDIR)/b_em-linux-gui.Tpo $(DEPDIR)/b_em-linux-gui.Po +# source='linux-gui.c' object='b_em-linux-gui.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-linux-gui.o `test -f 'linux-gui.c' || echo '$(srcdir)/'`linux-gui.c + +b_em-linux-gui.obj: linux-gui.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-linux-gui.obj -MD -MP -MF $(DEPDIR)/b_em-linux-gui.Tpo -c -o b_em-linux-gui.obj `if test -f 'linux-gui.c'; then $(CYGPATH_W) 'linux-gui.c'; else $(CYGPATH_W) '$(srcdir)/linux-gui.c'; fi` + $(am__mv) $(DEPDIR)/b_em-linux-gui.Tpo $(DEPDIR)/b_em-linux-gui.Po +# source='linux-gui.c' object='b_em-linux-gui.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-linux-gui.obj `if test -f 'linux-gui.c'; then $(CYGPATH_W) 'linux-gui.c'; else $(CYGPATH_W) '$(srcdir)/linux-gui.c'; fi` + +b_em-linux-keydefine.o: linux-keydefine.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-linux-keydefine.o -MD -MP -MF $(DEPDIR)/b_em-linux-keydefine.Tpo -c -o b_em-linux-keydefine.o `test -f 'linux-keydefine.c' || echo '$(srcdir)/'`linux-keydefine.c + $(am__mv) $(DEPDIR)/b_em-linux-keydefine.Tpo $(DEPDIR)/b_em-linux-keydefine.Po +# source='linux-keydefine.c' object='b_em-linux-keydefine.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-linux-keydefine.o `test -f 'linux-keydefine.c' || echo '$(srcdir)/'`linux-keydefine.c + +b_em-linux-keydefine.obj: linux-keydefine.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-linux-keydefine.obj -MD -MP -MF $(DEPDIR)/b_em-linux-keydefine.Tpo -c -o b_em-linux-keydefine.obj `if test -f 'linux-keydefine.c'; then $(CYGPATH_W) 'linux-keydefine.c'; else $(CYGPATH_W) '$(srcdir)/linux-keydefine.c'; fi` + $(am__mv) $(DEPDIR)/b_em-linux-keydefine.Tpo $(DEPDIR)/b_em-linux-keydefine.Po +# source='linux-keydefine.c' object='b_em-linux-keydefine.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-linux-keydefine.obj `if test -f 'linux-keydefine.c'; then $(CYGPATH_W) 'linux-keydefine.c'; else $(CYGPATH_W) '$(srcdir)/linux-keydefine.c'; fi` + +b_em-main.o: main.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-main.o -MD -MP -MF $(DEPDIR)/b_em-main.Tpo -c -o b_em-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c + $(am__mv) $(DEPDIR)/b_em-main.Tpo $(DEPDIR)/b_em-main.Po +# source='main.c' object='b_em-main.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c + +b_em-main.obj: main.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-main.obj -MD -MP -MF $(DEPDIR)/b_em-main.Tpo -c -o b_em-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` + $(am__mv) $(DEPDIR)/b_em-main.Tpo $(DEPDIR)/b_em-main.Po +# source='main.c' object='b_em-main.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` + +b_em-mem.o: mem.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-mem.o -MD -MP -MF $(DEPDIR)/b_em-mem.Tpo -c -o b_em-mem.o `test -f 'mem.c' || echo '$(srcdir)/'`mem.c + $(am__mv) $(DEPDIR)/b_em-mem.Tpo $(DEPDIR)/b_em-mem.Po +# source='mem.c' object='b_em-mem.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-mem.o `test -f 'mem.c' || echo '$(srcdir)/'`mem.c + +b_em-mem.obj: mem.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-mem.obj -MD -MP -MF $(DEPDIR)/b_em-mem.Tpo -c -o b_em-mem.obj `if test -f 'mem.c'; then $(CYGPATH_W) 'mem.c'; else $(CYGPATH_W) '$(srcdir)/mem.c'; fi` + $(am__mv) $(DEPDIR)/b_em-mem.Tpo $(DEPDIR)/b_em-mem.Po +# source='mem.c' object='b_em-mem.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-mem.obj `if test -f 'mem.c'; then $(CYGPATH_W) 'mem.c'; else $(CYGPATH_W) '$(srcdir)/mem.c'; fi` + +b_em-model.o: model.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-model.o -MD -MP -MF $(DEPDIR)/b_em-model.Tpo -c -o b_em-model.o `test -f 'model.c' || echo '$(srcdir)/'`model.c + $(am__mv) $(DEPDIR)/b_em-model.Tpo $(DEPDIR)/b_em-model.Po +# source='model.c' object='b_em-model.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-model.o `test -f 'model.c' || echo '$(srcdir)/'`model.c + +b_em-model.obj: model.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-model.obj -MD -MP -MF $(DEPDIR)/b_em-model.Tpo -c -o b_em-model.obj `if test -f 'model.c'; then $(CYGPATH_W) 'model.c'; else $(CYGPATH_W) '$(srcdir)/model.c'; fi` + $(am__mv) $(DEPDIR)/b_em-model.Tpo $(DEPDIR)/b_em-model.Po +# source='model.c' object='b_em-model.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-model.obj `if test -f 'model.c'; then $(CYGPATH_W) 'model.c'; else $(CYGPATH_W) '$(srcdir)/model.c'; fi` + +b_em-mouse.o: mouse.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-mouse.o -MD -MP -MF $(DEPDIR)/b_em-mouse.Tpo -c -o b_em-mouse.o `test -f 'mouse.c' || echo '$(srcdir)/'`mouse.c + $(am__mv) $(DEPDIR)/b_em-mouse.Tpo $(DEPDIR)/b_em-mouse.Po +# source='mouse.c' object='b_em-mouse.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-mouse.o `test -f 'mouse.c' || echo '$(srcdir)/'`mouse.c + +b_em-mouse.obj: mouse.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-mouse.obj -MD -MP -MF $(DEPDIR)/b_em-mouse.Tpo -c -o b_em-mouse.obj `if test -f 'mouse.c'; then $(CYGPATH_W) 'mouse.c'; else $(CYGPATH_W) '$(srcdir)/mouse.c'; fi` + $(am__mv) $(DEPDIR)/b_em-mouse.Tpo $(DEPDIR)/b_em-mouse.Po +# source='mouse.c' object='b_em-mouse.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-mouse.obj `if test -f 'mouse.c'; then $(CYGPATH_W) 'mouse.c'; else $(CYGPATH_W) '$(srcdir)/mouse.c'; fi` + +b_em-savestate.o: savestate.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-savestate.o -MD -MP -MF $(DEPDIR)/b_em-savestate.Tpo -c -o b_em-savestate.o `test -f 'savestate.c' || echo '$(srcdir)/'`savestate.c + $(am__mv) $(DEPDIR)/b_em-savestate.Tpo $(DEPDIR)/b_em-savestate.Po +# source='savestate.c' object='b_em-savestate.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-savestate.o `test -f 'savestate.c' || echo '$(srcdir)/'`savestate.c + +b_em-savestate.obj: savestate.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-savestate.obj -MD -MP -MF $(DEPDIR)/b_em-savestate.Tpo -c -o b_em-savestate.obj `if test -f 'savestate.c'; then $(CYGPATH_W) 'savestate.c'; else $(CYGPATH_W) '$(srcdir)/savestate.c'; fi` + $(am__mv) $(DEPDIR)/b_em-savestate.Tpo $(DEPDIR)/b_em-savestate.Po +# source='savestate.c' object='b_em-savestate.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-savestate.obj `if test -f 'savestate.c'; then $(CYGPATH_W) 'savestate.c'; else $(CYGPATH_W) '$(srcdir)/savestate.c'; fi` + +b_em-serial.o: serial.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-serial.o -MD -MP -MF $(DEPDIR)/b_em-serial.Tpo -c -o b_em-serial.o `test -f 'serial.c' || echo '$(srcdir)/'`serial.c + $(am__mv) $(DEPDIR)/b_em-serial.Tpo $(DEPDIR)/b_em-serial.Po +# source='serial.c' object='b_em-serial.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-serial.o `test -f 'serial.c' || echo '$(srcdir)/'`serial.c + +b_em-serial.obj: serial.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-serial.obj -MD -MP -MF $(DEPDIR)/b_em-serial.Tpo -c -o b_em-serial.obj `if test -f 'serial.c'; then $(CYGPATH_W) 'serial.c'; else $(CYGPATH_W) '$(srcdir)/serial.c'; fi` + $(am__mv) $(DEPDIR)/b_em-serial.Tpo $(DEPDIR)/b_em-serial.Po +# source='serial.c' object='b_em-serial.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-serial.obj `if test -f 'serial.c'; then $(CYGPATH_W) 'serial.c'; else $(CYGPATH_W) '$(srcdir)/serial.c'; fi` + +b_em-sn76489.o: sn76489.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-sn76489.o -MD -MP -MF $(DEPDIR)/b_em-sn76489.Tpo -c -o b_em-sn76489.o `test -f 'sn76489.c' || echo '$(srcdir)/'`sn76489.c + $(am__mv) $(DEPDIR)/b_em-sn76489.Tpo $(DEPDIR)/b_em-sn76489.Po +# source='sn76489.c' object='b_em-sn76489.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-sn76489.o `test -f 'sn76489.c' || echo '$(srcdir)/'`sn76489.c + +b_em-sn76489.obj: sn76489.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-sn76489.obj -MD -MP -MF $(DEPDIR)/b_em-sn76489.Tpo -c -o b_em-sn76489.obj `if test -f 'sn76489.c'; then $(CYGPATH_W) 'sn76489.c'; else $(CYGPATH_W) '$(srcdir)/sn76489.c'; fi` + $(am__mv) $(DEPDIR)/b_em-sn76489.Tpo $(DEPDIR)/b_em-sn76489.Po +# source='sn76489.c' object='b_em-sn76489.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-sn76489.obj `if test -f 'sn76489.c'; then $(CYGPATH_W) 'sn76489.c'; else $(CYGPATH_W) '$(srcdir)/sn76489.c'; fi` + +b_em-sound.o: sound.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-sound.o -MD -MP -MF $(DEPDIR)/b_em-sound.Tpo -c -o b_em-sound.o `test -f 'sound.c' || echo '$(srcdir)/'`sound.c + $(am__mv) $(DEPDIR)/b_em-sound.Tpo $(DEPDIR)/b_em-sound.Po +# source='sound.c' object='b_em-sound.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-sound.o `test -f 'sound.c' || echo '$(srcdir)/'`sound.c + +b_em-sound.obj: sound.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-sound.obj -MD -MP -MF $(DEPDIR)/b_em-sound.Tpo -c -o b_em-sound.obj `if test -f 'sound.c'; then $(CYGPATH_W) 'sound.c'; else $(CYGPATH_W) '$(srcdir)/sound.c'; fi` + $(am__mv) $(DEPDIR)/b_em-sound.Tpo $(DEPDIR)/b_em-sound.Po +# source='sound.c' object='b_em-sound.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-sound.obj `if test -f 'sound.c'; then $(CYGPATH_W) 'sound.c'; else $(CYGPATH_W) '$(srcdir)/sound.c'; fi` + +b_em-soundopenal.o: soundopenal.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-soundopenal.o -MD -MP -MF $(DEPDIR)/b_em-soundopenal.Tpo -c -o b_em-soundopenal.o `test -f 'soundopenal.c' || echo '$(srcdir)/'`soundopenal.c + $(am__mv) $(DEPDIR)/b_em-soundopenal.Tpo $(DEPDIR)/b_em-soundopenal.Po +# source='soundopenal.c' object='b_em-soundopenal.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-soundopenal.o `test -f 'soundopenal.c' || echo '$(srcdir)/'`soundopenal.c + +b_em-soundopenal.obj: soundopenal.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-soundopenal.obj -MD -MP -MF $(DEPDIR)/b_em-soundopenal.Tpo -c -o b_em-soundopenal.obj `if test -f 'soundopenal.c'; then $(CYGPATH_W) 'soundopenal.c'; else $(CYGPATH_W) '$(srcdir)/soundopenal.c'; fi` + $(am__mv) $(DEPDIR)/b_em-soundopenal.Tpo $(DEPDIR)/b_em-soundopenal.Po +# source='soundopenal.c' object='b_em-soundopenal.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-soundopenal.obj `if test -f 'soundopenal.c'; then $(CYGPATH_W) 'soundopenal.c'; else $(CYGPATH_W) '$(srcdir)/soundopenal.c'; fi` + +b_em-ssd.o: ssd.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-ssd.o -MD -MP -MF $(DEPDIR)/b_em-ssd.Tpo -c -o b_em-ssd.o `test -f 'ssd.c' || echo '$(srcdir)/'`ssd.c + $(am__mv) $(DEPDIR)/b_em-ssd.Tpo $(DEPDIR)/b_em-ssd.Po +# source='ssd.c' object='b_em-ssd.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-ssd.o `test -f 'ssd.c' || echo '$(srcdir)/'`ssd.c + +b_em-ssd.obj: ssd.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-ssd.obj -MD -MP -MF $(DEPDIR)/b_em-ssd.Tpo -c -o b_em-ssd.obj `if test -f 'ssd.c'; then $(CYGPATH_W) 'ssd.c'; else $(CYGPATH_W) '$(srcdir)/ssd.c'; fi` + $(am__mv) $(DEPDIR)/b_em-ssd.Tpo $(DEPDIR)/b_em-ssd.Po +# source='ssd.c' object='b_em-ssd.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-ssd.obj `if test -f 'ssd.c'; then $(CYGPATH_W) 'ssd.c'; else $(CYGPATH_W) '$(srcdir)/ssd.c'; fi` + +b_em-sysvia.o: sysvia.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-sysvia.o -MD -MP -MF $(DEPDIR)/b_em-sysvia.Tpo -c -o b_em-sysvia.o `test -f 'sysvia.c' || echo '$(srcdir)/'`sysvia.c + $(am__mv) $(DEPDIR)/b_em-sysvia.Tpo $(DEPDIR)/b_em-sysvia.Po +# source='sysvia.c' object='b_em-sysvia.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-sysvia.o `test -f 'sysvia.c' || echo '$(srcdir)/'`sysvia.c + +b_em-sysvia.obj: sysvia.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-sysvia.obj -MD -MP -MF $(DEPDIR)/b_em-sysvia.Tpo -c -o b_em-sysvia.obj `if test -f 'sysvia.c'; then $(CYGPATH_W) 'sysvia.c'; else $(CYGPATH_W) '$(srcdir)/sysvia.c'; fi` + $(am__mv) $(DEPDIR)/b_em-sysvia.Tpo $(DEPDIR)/b_em-sysvia.Po +# source='sysvia.c' object='b_em-sysvia.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-sysvia.obj `if test -f 'sysvia.c'; then $(CYGPATH_W) 'sysvia.c'; else $(CYGPATH_W) '$(srcdir)/sysvia.c'; fi` + +b_em-tape.o: tape.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-tape.o -MD -MP -MF $(DEPDIR)/b_em-tape.Tpo -c -o b_em-tape.o `test -f 'tape.c' || echo '$(srcdir)/'`tape.c + $(am__mv) $(DEPDIR)/b_em-tape.Tpo $(DEPDIR)/b_em-tape.Po +# source='tape.c' object='b_em-tape.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-tape.o `test -f 'tape.c' || echo '$(srcdir)/'`tape.c + +b_em-tape.obj: tape.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-tape.obj -MD -MP -MF $(DEPDIR)/b_em-tape.Tpo -c -o b_em-tape.obj `if test -f 'tape.c'; then $(CYGPATH_W) 'tape.c'; else $(CYGPATH_W) '$(srcdir)/tape.c'; fi` + $(am__mv) $(DEPDIR)/b_em-tape.Tpo $(DEPDIR)/b_em-tape.Po +# source='tape.c' object='b_em-tape.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-tape.obj `if test -f 'tape.c'; then $(CYGPATH_W) 'tape.c'; else $(CYGPATH_W) '$(srcdir)/tape.c'; fi` + +b_em-tapenoise.o: tapenoise.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-tapenoise.o -MD -MP -MF $(DEPDIR)/b_em-tapenoise.Tpo -c -o b_em-tapenoise.o `test -f 'tapenoise.c' || echo '$(srcdir)/'`tapenoise.c + $(am__mv) $(DEPDIR)/b_em-tapenoise.Tpo $(DEPDIR)/b_em-tapenoise.Po +# source='tapenoise.c' object='b_em-tapenoise.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-tapenoise.o `test -f 'tapenoise.c' || echo '$(srcdir)/'`tapenoise.c + +b_em-tapenoise.obj: tapenoise.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-tapenoise.obj -MD -MP -MF $(DEPDIR)/b_em-tapenoise.Tpo -c -o b_em-tapenoise.obj `if test -f 'tapenoise.c'; then $(CYGPATH_W) 'tapenoise.c'; else $(CYGPATH_W) '$(srcdir)/tapenoise.c'; fi` + $(am__mv) $(DEPDIR)/b_em-tapenoise.Tpo $(DEPDIR)/b_em-tapenoise.Po +# source='tapenoise.c' object='b_em-tapenoise.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-tapenoise.obj `if test -f 'tapenoise.c'; then $(CYGPATH_W) 'tapenoise.c'; else $(CYGPATH_W) '$(srcdir)/tapenoise.c'; fi` + +b_em-tube.o: tube.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-tube.o -MD -MP -MF $(DEPDIR)/b_em-tube.Tpo -c -o b_em-tube.o `test -f 'tube.c' || echo '$(srcdir)/'`tube.c + $(am__mv) $(DEPDIR)/b_em-tube.Tpo $(DEPDIR)/b_em-tube.Po +# source='tube.c' object='b_em-tube.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-tube.o `test -f 'tube.c' || echo '$(srcdir)/'`tube.c + +b_em-tube.obj: tube.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-tube.obj -MD -MP -MF $(DEPDIR)/b_em-tube.Tpo -c -o b_em-tube.obj `if test -f 'tube.c'; then $(CYGPATH_W) 'tube.c'; else $(CYGPATH_W) '$(srcdir)/tube.c'; fi` + $(am__mv) $(DEPDIR)/b_em-tube.Tpo $(DEPDIR)/b_em-tube.Po +# source='tube.c' object='b_em-tube.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-tube.obj `if test -f 'tube.c'; then $(CYGPATH_W) 'tube.c'; else $(CYGPATH_W) '$(srcdir)/tube.c'; fi` + +b_em-uef.o: uef.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-uef.o -MD -MP -MF $(DEPDIR)/b_em-uef.Tpo -c -o b_em-uef.o `test -f 'uef.c' || echo '$(srcdir)/'`uef.c + $(am__mv) $(DEPDIR)/b_em-uef.Tpo $(DEPDIR)/b_em-uef.Po +# source='uef.c' object='b_em-uef.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-uef.o `test -f 'uef.c' || echo '$(srcdir)/'`uef.c + +b_em-uef.obj: uef.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-uef.obj -MD -MP -MF $(DEPDIR)/b_em-uef.Tpo -c -o b_em-uef.obj `if test -f 'uef.c'; then $(CYGPATH_W) 'uef.c'; else $(CYGPATH_W) '$(srcdir)/uef.c'; fi` + $(am__mv) $(DEPDIR)/b_em-uef.Tpo $(DEPDIR)/b_em-uef.Po +# source='uef.c' object='b_em-uef.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-uef.obj `if test -f 'uef.c'; then $(CYGPATH_W) 'uef.c'; else $(CYGPATH_W) '$(srcdir)/uef.c'; fi` + +b_em-uservia.o: uservia.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-uservia.o -MD -MP -MF $(DEPDIR)/b_em-uservia.Tpo -c -o b_em-uservia.o `test -f 'uservia.c' || echo '$(srcdir)/'`uservia.c + $(am__mv) $(DEPDIR)/b_em-uservia.Tpo $(DEPDIR)/b_em-uservia.Po +# source='uservia.c' object='b_em-uservia.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-uservia.o `test -f 'uservia.c' || echo '$(srcdir)/'`uservia.c + +b_em-uservia.obj: uservia.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-uservia.obj -MD -MP -MF $(DEPDIR)/b_em-uservia.Tpo -c -o b_em-uservia.obj `if test -f 'uservia.c'; then $(CYGPATH_W) 'uservia.c'; else $(CYGPATH_W) '$(srcdir)/uservia.c'; fi` + $(am__mv) $(DEPDIR)/b_em-uservia.Tpo $(DEPDIR)/b_em-uservia.Po +# source='uservia.c' object='b_em-uservia.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-uservia.obj `if test -f 'uservia.c'; then $(CYGPATH_W) 'uservia.c'; else $(CYGPATH_W) '$(srcdir)/uservia.c'; fi` + +b_em-via.o: via.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-via.o -MD -MP -MF $(DEPDIR)/b_em-via.Tpo -c -o b_em-via.o `test -f 'via.c' || echo '$(srcdir)/'`via.c + $(am__mv) $(DEPDIR)/b_em-via.Tpo $(DEPDIR)/b_em-via.Po +# source='via.c' object='b_em-via.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-via.o `test -f 'via.c' || echo '$(srcdir)/'`via.c + +b_em-via.obj: via.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-via.obj -MD -MP -MF $(DEPDIR)/b_em-via.Tpo -c -o b_em-via.obj `if test -f 'via.c'; then $(CYGPATH_W) 'via.c'; else $(CYGPATH_W) '$(srcdir)/via.c'; fi` + $(am__mv) $(DEPDIR)/b_em-via.Tpo $(DEPDIR)/b_em-via.Po +# source='via.c' object='b_em-via.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-via.obj `if test -f 'via.c'; then $(CYGPATH_W) 'via.c'; else $(CYGPATH_W) '$(srcdir)/via.c'; fi` + +b_em-vidalleg.o: vidalleg.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-vidalleg.o -MD -MP -MF $(DEPDIR)/b_em-vidalleg.Tpo -c -o b_em-vidalleg.o `test -f 'vidalleg.c' || echo '$(srcdir)/'`vidalleg.c + $(am__mv) $(DEPDIR)/b_em-vidalleg.Tpo $(DEPDIR)/b_em-vidalleg.Po +# source='vidalleg.c' object='b_em-vidalleg.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-vidalleg.o `test -f 'vidalleg.c' || echo '$(srcdir)/'`vidalleg.c + +b_em-vidalleg.obj: vidalleg.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-vidalleg.obj -MD -MP -MF $(DEPDIR)/b_em-vidalleg.Tpo -c -o b_em-vidalleg.obj `if test -f 'vidalleg.c'; then $(CYGPATH_W) 'vidalleg.c'; else $(CYGPATH_W) '$(srcdir)/vidalleg.c'; fi` + $(am__mv) $(DEPDIR)/b_em-vidalleg.Tpo $(DEPDIR)/b_em-vidalleg.Po +# source='vidalleg.c' object='b_em-vidalleg.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-vidalleg.obj `if test -f 'vidalleg.c'; then $(CYGPATH_W) 'vidalleg.c'; else $(CYGPATH_W) '$(srcdir)/vidalleg.c'; fi` + +b_em-video.o: video.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-video.o -MD -MP -MF $(DEPDIR)/b_em-video.Tpo -c -o b_em-video.o `test -f 'video.c' || echo '$(srcdir)/'`video.c + $(am__mv) $(DEPDIR)/b_em-video.Tpo $(DEPDIR)/b_em-video.Po +# source='video.c' object='b_em-video.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-video.o `test -f 'video.c' || echo '$(srcdir)/'`video.c + +b_em-video.obj: video.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-video.obj -MD -MP -MF $(DEPDIR)/b_em-video.Tpo -c -o b_em-video.obj `if test -f 'video.c'; then $(CYGPATH_W) 'video.c'; else $(CYGPATH_W) '$(srcdir)/video.c'; fi` + $(am__mv) $(DEPDIR)/b_em-video.Tpo $(DEPDIR)/b_em-video.Po +# source='video.c' object='b_em-video.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-video.obj `if test -f 'video.c'; then $(CYGPATH_W) 'video.c'; else $(CYGPATH_W) '$(srcdir)/video.c'; fi` + +b_em-wd1770.o: wd1770.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-wd1770.o -MD -MP -MF $(DEPDIR)/b_em-wd1770.Tpo -c -o b_em-wd1770.o `test -f 'wd1770.c' || echo '$(srcdir)/'`wd1770.c + $(am__mv) $(DEPDIR)/b_em-wd1770.Tpo $(DEPDIR)/b_em-wd1770.Po +# source='wd1770.c' object='b_em-wd1770.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-wd1770.o `test -f 'wd1770.c' || echo '$(srcdir)/'`wd1770.c + +b_em-wd1770.obj: wd1770.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-wd1770.obj -MD -MP -MF $(DEPDIR)/b_em-wd1770.Tpo -c -o b_em-wd1770.obj `if test -f 'wd1770.c'; then $(CYGPATH_W) 'wd1770.c'; else $(CYGPATH_W) '$(srcdir)/wd1770.c'; fi` + $(am__mv) $(DEPDIR)/b_em-wd1770.Tpo $(DEPDIR)/b_em-wd1770.Po +# source='wd1770.c' object='b_em-wd1770.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-wd1770.obj `if test -f 'wd1770.c'; then $(CYGPATH_W) 'wd1770.c'; else $(CYGPATH_W) '$(srcdir)/wd1770.c'; fi` + +b_em-x86.o: x86.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-x86.o -MD -MP -MF $(DEPDIR)/b_em-x86.Tpo -c -o b_em-x86.o `test -f 'x86.c' || echo '$(srcdir)/'`x86.c + $(am__mv) $(DEPDIR)/b_em-x86.Tpo $(DEPDIR)/b_em-x86.Po +# source='x86.c' object='b_em-x86.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-x86.o `test -f 'x86.c' || echo '$(srcdir)/'`x86.c + +b_em-x86.obj: x86.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-x86.obj -MD -MP -MF $(DEPDIR)/b_em-x86.Tpo -c -o b_em-x86.obj `if test -f 'x86.c'; then $(CYGPATH_W) 'x86.c'; else $(CYGPATH_W) '$(srcdir)/x86.c'; fi` + $(am__mv) $(DEPDIR)/b_em-x86.Tpo $(DEPDIR)/b_em-x86.Po +# source='x86.c' object='b_em-x86.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-x86.obj `if test -f 'x86.c'; then $(CYGPATH_W) 'x86.c'; else $(CYGPATH_W) '$(srcdir)/x86.c'; fi` + +b_em-Z80.o: Z80.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-Z80.o -MD -MP -MF $(DEPDIR)/b_em-Z80.Tpo -c -o b_em-Z80.o `test -f 'Z80.c' || echo '$(srcdir)/'`Z80.c + $(am__mv) $(DEPDIR)/b_em-Z80.Tpo $(DEPDIR)/b_em-Z80.Po +# source='Z80.c' object='b_em-Z80.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-Z80.o `test -f 'Z80.c' || echo '$(srcdir)/'`Z80.c + +b_em-Z80.obj: Z80.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-Z80.obj -MD -MP -MF $(DEPDIR)/b_em-Z80.Tpo -c -o b_em-Z80.obj `if test -f 'Z80.c'; then $(CYGPATH_W) 'Z80.c'; else $(CYGPATH_W) '$(srcdir)/Z80.c'; fi` + $(am__mv) $(DEPDIR)/b_em-Z80.Tpo $(DEPDIR)/b_em-Z80.Po +# source='Z80.c' object='b_em-Z80.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-Z80.obj `if test -f 'Z80.c'; then $(CYGPATH_W) 'Z80.c'; else $(CYGPATH_W) '$(srcdir)/Z80.c'; fi` + +.cc.o: + $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXXCOMPILE) -c -o $@ $< + +.cc.obj: + $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +convolve.o: resid-fp/convolve.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT convolve.o -MD -MP -MF $(DEPDIR)/convolve.Tpo -c -o convolve.o `test -f 'resid-fp/convolve.cc' || echo '$(srcdir)/'`resid-fp/convolve.cc + $(am__mv) $(DEPDIR)/convolve.Tpo $(DEPDIR)/convolve.Po +# source='resid-fp/convolve.cc' object='convolve.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o convolve.o `test -f 'resid-fp/convolve.cc' || echo '$(srcdir)/'`resid-fp/convolve.cc + +convolve.obj: resid-fp/convolve.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT convolve.obj -MD -MP -MF $(DEPDIR)/convolve.Tpo -c -o convolve.obj `if test -f 'resid-fp/convolve.cc'; then $(CYGPATH_W) 'resid-fp/convolve.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/convolve.cc'; fi` + $(am__mv) $(DEPDIR)/convolve.Tpo $(DEPDIR)/convolve.Po +# source='resid-fp/convolve.cc' object='convolve.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o convolve.obj `if test -f 'resid-fp/convolve.cc'; then $(CYGPATH_W) 'resid-fp/convolve.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/convolve.cc'; fi` + +convolve-sse.o: resid-fp/convolve-sse.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT convolve-sse.o -MD -MP -MF $(DEPDIR)/convolve-sse.Tpo -c -o convolve-sse.o `test -f 'resid-fp/convolve-sse.cc' || echo '$(srcdir)/'`resid-fp/convolve-sse.cc + $(am__mv) $(DEPDIR)/convolve-sse.Tpo $(DEPDIR)/convolve-sse.Po +# source='resid-fp/convolve-sse.cc' object='convolve-sse.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o convolve-sse.o `test -f 'resid-fp/convolve-sse.cc' || echo '$(srcdir)/'`resid-fp/convolve-sse.cc + +convolve-sse.obj: resid-fp/convolve-sse.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT convolve-sse.obj -MD -MP -MF $(DEPDIR)/convolve-sse.Tpo -c -o convolve-sse.obj `if test -f 'resid-fp/convolve-sse.cc'; then $(CYGPATH_W) 'resid-fp/convolve-sse.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/convolve-sse.cc'; fi` + $(am__mv) $(DEPDIR)/convolve-sse.Tpo $(DEPDIR)/convolve-sse.Po +# source='resid-fp/convolve-sse.cc' object='convolve-sse.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o convolve-sse.obj `if test -f 'resid-fp/convolve-sse.cc'; then $(CYGPATH_W) 'resid-fp/convolve-sse.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/convolve-sse.cc'; fi` + +envelope.o: resid-fp/envelope.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT envelope.o -MD -MP -MF $(DEPDIR)/envelope.Tpo -c -o envelope.o `test -f 'resid-fp/envelope.cc' || echo '$(srcdir)/'`resid-fp/envelope.cc + $(am__mv) $(DEPDIR)/envelope.Tpo $(DEPDIR)/envelope.Po +# source='resid-fp/envelope.cc' object='envelope.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o envelope.o `test -f 'resid-fp/envelope.cc' || echo '$(srcdir)/'`resid-fp/envelope.cc + +envelope.obj: resid-fp/envelope.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT envelope.obj -MD -MP -MF $(DEPDIR)/envelope.Tpo -c -o envelope.obj `if test -f 'resid-fp/envelope.cc'; then $(CYGPATH_W) 'resid-fp/envelope.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/envelope.cc'; fi` + $(am__mv) $(DEPDIR)/envelope.Tpo $(DEPDIR)/envelope.Po +# source='resid-fp/envelope.cc' object='envelope.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o envelope.obj `if test -f 'resid-fp/envelope.cc'; then $(CYGPATH_W) 'resid-fp/envelope.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/envelope.cc'; fi` + +extfilt.o: resid-fp/extfilt.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT extfilt.o -MD -MP -MF $(DEPDIR)/extfilt.Tpo -c -o extfilt.o `test -f 'resid-fp/extfilt.cc' || echo '$(srcdir)/'`resid-fp/extfilt.cc + $(am__mv) $(DEPDIR)/extfilt.Tpo $(DEPDIR)/extfilt.Po +# source='resid-fp/extfilt.cc' object='extfilt.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o extfilt.o `test -f 'resid-fp/extfilt.cc' || echo '$(srcdir)/'`resid-fp/extfilt.cc + +extfilt.obj: resid-fp/extfilt.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT extfilt.obj -MD -MP -MF $(DEPDIR)/extfilt.Tpo -c -o extfilt.obj `if test -f 'resid-fp/extfilt.cc'; then $(CYGPATH_W) 'resid-fp/extfilt.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/extfilt.cc'; fi` + $(am__mv) $(DEPDIR)/extfilt.Tpo $(DEPDIR)/extfilt.Po +# source='resid-fp/extfilt.cc' object='extfilt.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o extfilt.obj `if test -f 'resid-fp/extfilt.cc'; then $(CYGPATH_W) 'resid-fp/extfilt.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/extfilt.cc'; fi` + +filter.o: resid-fp/filter.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT filter.o -MD -MP -MF $(DEPDIR)/filter.Tpo -c -o filter.o `test -f 'resid-fp/filter.cc' || echo '$(srcdir)/'`resid-fp/filter.cc + $(am__mv) $(DEPDIR)/filter.Tpo $(DEPDIR)/filter.Po +# source='resid-fp/filter.cc' object='filter.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o filter.o `test -f 'resid-fp/filter.cc' || echo '$(srcdir)/'`resid-fp/filter.cc + +filter.obj: resid-fp/filter.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT filter.obj -MD -MP -MF $(DEPDIR)/filter.Tpo -c -o filter.obj `if test -f 'resid-fp/filter.cc'; then $(CYGPATH_W) 'resid-fp/filter.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/filter.cc'; fi` + $(am__mv) $(DEPDIR)/filter.Tpo $(DEPDIR)/filter.Po +# source='resid-fp/filter.cc' object='filter.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o filter.obj `if test -f 'resid-fp/filter.cc'; then $(CYGPATH_W) 'resid-fp/filter.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/filter.cc'; fi` + +pot.o: resid-fp/pot.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT pot.o -MD -MP -MF $(DEPDIR)/pot.Tpo -c -o pot.o `test -f 'resid-fp/pot.cc' || echo '$(srcdir)/'`resid-fp/pot.cc + $(am__mv) $(DEPDIR)/pot.Tpo $(DEPDIR)/pot.Po +# source='resid-fp/pot.cc' object='pot.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o pot.o `test -f 'resid-fp/pot.cc' || echo '$(srcdir)/'`resid-fp/pot.cc + +pot.obj: resid-fp/pot.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT pot.obj -MD -MP -MF $(DEPDIR)/pot.Tpo -c -o pot.obj `if test -f 'resid-fp/pot.cc'; then $(CYGPATH_W) 'resid-fp/pot.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/pot.cc'; fi` + $(am__mv) $(DEPDIR)/pot.Tpo $(DEPDIR)/pot.Po +# source='resid-fp/pot.cc' object='pot.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o pot.obj `if test -f 'resid-fp/pot.cc'; then $(CYGPATH_W) 'resid-fp/pot.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/pot.cc'; fi` + +sid.o: resid-fp/sid.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sid.o -MD -MP -MF $(DEPDIR)/sid.Tpo -c -o sid.o `test -f 'resid-fp/sid.cc' || echo '$(srcdir)/'`resid-fp/sid.cc + $(am__mv) $(DEPDIR)/sid.Tpo $(DEPDIR)/sid.Po +# source='resid-fp/sid.cc' object='sid.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sid.o `test -f 'resid-fp/sid.cc' || echo '$(srcdir)/'`resid-fp/sid.cc + +sid.obj: resid-fp/sid.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sid.obj -MD -MP -MF $(DEPDIR)/sid.Tpo -c -o sid.obj `if test -f 'resid-fp/sid.cc'; then $(CYGPATH_W) 'resid-fp/sid.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/sid.cc'; fi` + $(am__mv) $(DEPDIR)/sid.Tpo $(DEPDIR)/sid.Po +# source='resid-fp/sid.cc' object='sid.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sid.obj `if test -f 'resid-fp/sid.cc'; then $(CYGPATH_W) 'resid-fp/sid.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/sid.cc'; fi` + +voice.o: resid-fp/voice.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT voice.o -MD -MP -MF $(DEPDIR)/voice.Tpo -c -o voice.o `test -f 'resid-fp/voice.cc' || echo '$(srcdir)/'`resid-fp/voice.cc + $(am__mv) $(DEPDIR)/voice.Tpo $(DEPDIR)/voice.Po +# source='resid-fp/voice.cc' object='voice.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o voice.o `test -f 'resid-fp/voice.cc' || echo '$(srcdir)/'`resid-fp/voice.cc + +voice.obj: resid-fp/voice.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT voice.obj -MD -MP -MF $(DEPDIR)/voice.Tpo -c -o voice.obj `if test -f 'resid-fp/voice.cc'; then $(CYGPATH_W) 'resid-fp/voice.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/voice.cc'; fi` + $(am__mv) $(DEPDIR)/voice.Tpo $(DEPDIR)/voice.Po +# source='resid-fp/voice.cc' object='voice.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o voice.obj `if test -f 'resid-fp/voice.cc'; then $(CYGPATH_W) 'resid-fp/voice.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/voice.cc'; fi` + +wave6581_PS_.o: resid-fp/wave6581_PS_.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave6581_PS_.o -MD -MP -MF $(DEPDIR)/wave6581_PS_.Tpo -c -o wave6581_PS_.o `test -f 'resid-fp/wave6581_PS_.cc' || echo '$(srcdir)/'`resid-fp/wave6581_PS_.cc + $(am__mv) $(DEPDIR)/wave6581_PS_.Tpo $(DEPDIR)/wave6581_PS_.Po +# source='resid-fp/wave6581_PS_.cc' object='wave6581_PS_.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave6581_PS_.o `test -f 'resid-fp/wave6581_PS_.cc' || echo '$(srcdir)/'`resid-fp/wave6581_PS_.cc + +wave6581_PS_.obj: resid-fp/wave6581_PS_.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave6581_PS_.obj -MD -MP -MF $(DEPDIR)/wave6581_PS_.Tpo -c -o wave6581_PS_.obj `if test -f 'resid-fp/wave6581_PS_.cc'; then $(CYGPATH_W) 'resid-fp/wave6581_PS_.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave6581_PS_.cc'; fi` + $(am__mv) $(DEPDIR)/wave6581_PS_.Tpo $(DEPDIR)/wave6581_PS_.Po +# source='resid-fp/wave6581_PS_.cc' object='wave6581_PS_.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave6581_PS_.obj `if test -f 'resid-fp/wave6581_PS_.cc'; then $(CYGPATH_W) 'resid-fp/wave6581_PS_.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave6581_PS_.cc'; fi` + +wave6581_PST.o: resid-fp/wave6581_PST.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave6581_PST.o -MD -MP -MF $(DEPDIR)/wave6581_PST.Tpo -c -o wave6581_PST.o `test -f 'resid-fp/wave6581_PST.cc' || echo '$(srcdir)/'`resid-fp/wave6581_PST.cc + $(am__mv) $(DEPDIR)/wave6581_PST.Tpo $(DEPDIR)/wave6581_PST.Po +# source='resid-fp/wave6581_PST.cc' object='wave6581_PST.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave6581_PST.o `test -f 'resid-fp/wave6581_PST.cc' || echo '$(srcdir)/'`resid-fp/wave6581_PST.cc + +wave6581_PST.obj: resid-fp/wave6581_PST.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave6581_PST.obj -MD -MP -MF $(DEPDIR)/wave6581_PST.Tpo -c -o wave6581_PST.obj `if test -f 'resid-fp/wave6581_PST.cc'; then $(CYGPATH_W) 'resid-fp/wave6581_PST.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave6581_PST.cc'; fi` + $(am__mv) $(DEPDIR)/wave6581_PST.Tpo $(DEPDIR)/wave6581_PST.Po +# source='resid-fp/wave6581_PST.cc' object='wave6581_PST.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave6581_PST.obj `if test -f 'resid-fp/wave6581_PST.cc'; then $(CYGPATH_W) 'resid-fp/wave6581_PST.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave6581_PST.cc'; fi` + +wave6581_P_T.o: resid-fp/wave6581_P_T.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave6581_P_T.o -MD -MP -MF $(DEPDIR)/wave6581_P_T.Tpo -c -o wave6581_P_T.o `test -f 'resid-fp/wave6581_P_T.cc' || echo '$(srcdir)/'`resid-fp/wave6581_P_T.cc + $(am__mv) $(DEPDIR)/wave6581_P_T.Tpo $(DEPDIR)/wave6581_P_T.Po +# source='resid-fp/wave6581_P_T.cc' object='wave6581_P_T.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave6581_P_T.o `test -f 'resid-fp/wave6581_P_T.cc' || echo '$(srcdir)/'`resid-fp/wave6581_P_T.cc + +wave6581_P_T.obj: resid-fp/wave6581_P_T.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave6581_P_T.obj -MD -MP -MF $(DEPDIR)/wave6581_P_T.Tpo -c -o wave6581_P_T.obj `if test -f 'resid-fp/wave6581_P_T.cc'; then $(CYGPATH_W) 'resid-fp/wave6581_P_T.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave6581_P_T.cc'; fi` + $(am__mv) $(DEPDIR)/wave6581_P_T.Tpo $(DEPDIR)/wave6581_P_T.Po +# source='resid-fp/wave6581_P_T.cc' object='wave6581_P_T.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave6581_P_T.obj `if test -f 'resid-fp/wave6581_P_T.cc'; then $(CYGPATH_W) 'resid-fp/wave6581_P_T.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave6581_P_T.cc'; fi` + +wave6581__ST.o: resid-fp/wave6581__ST.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave6581__ST.o -MD -MP -MF $(DEPDIR)/wave6581__ST.Tpo -c -o wave6581__ST.o `test -f 'resid-fp/wave6581__ST.cc' || echo '$(srcdir)/'`resid-fp/wave6581__ST.cc + $(am__mv) $(DEPDIR)/wave6581__ST.Tpo $(DEPDIR)/wave6581__ST.Po +# source='resid-fp/wave6581__ST.cc' object='wave6581__ST.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave6581__ST.o `test -f 'resid-fp/wave6581__ST.cc' || echo '$(srcdir)/'`resid-fp/wave6581__ST.cc + +wave6581__ST.obj: resid-fp/wave6581__ST.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave6581__ST.obj -MD -MP -MF $(DEPDIR)/wave6581__ST.Tpo -c -o wave6581__ST.obj `if test -f 'resid-fp/wave6581__ST.cc'; then $(CYGPATH_W) 'resid-fp/wave6581__ST.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave6581__ST.cc'; fi` + $(am__mv) $(DEPDIR)/wave6581__ST.Tpo $(DEPDIR)/wave6581__ST.Po +# source='resid-fp/wave6581__ST.cc' object='wave6581__ST.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave6581__ST.obj `if test -f 'resid-fp/wave6581__ST.cc'; then $(CYGPATH_W) 'resid-fp/wave6581__ST.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave6581__ST.cc'; fi` + +wave8580_PS_.o: resid-fp/wave8580_PS_.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave8580_PS_.o -MD -MP -MF $(DEPDIR)/wave8580_PS_.Tpo -c -o wave8580_PS_.o `test -f 'resid-fp/wave8580_PS_.cc' || echo '$(srcdir)/'`resid-fp/wave8580_PS_.cc + $(am__mv) $(DEPDIR)/wave8580_PS_.Tpo $(DEPDIR)/wave8580_PS_.Po +# source='resid-fp/wave8580_PS_.cc' object='wave8580_PS_.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave8580_PS_.o `test -f 'resid-fp/wave8580_PS_.cc' || echo '$(srcdir)/'`resid-fp/wave8580_PS_.cc + +wave8580_PS_.obj: resid-fp/wave8580_PS_.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave8580_PS_.obj -MD -MP -MF $(DEPDIR)/wave8580_PS_.Tpo -c -o wave8580_PS_.obj `if test -f 'resid-fp/wave8580_PS_.cc'; then $(CYGPATH_W) 'resid-fp/wave8580_PS_.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave8580_PS_.cc'; fi` + $(am__mv) $(DEPDIR)/wave8580_PS_.Tpo $(DEPDIR)/wave8580_PS_.Po +# source='resid-fp/wave8580_PS_.cc' object='wave8580_PS_.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave8580_PS_.obj `if test -f 'resid-fp/wave8580_PS_.cc'; then $(CYGPATH_W) 'resid-fp/wave8580_PS_.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave8580_PS_.cc'; fi` + +wave8580_PST.o: resid-fp/wave8580_PST.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave8580_PST.o -MD -MP -MF $(DEPDIR)/wave8580_PST.Tpo -c -o wave8580_PST.o `test -f 'resid-fp/wave8580_PST.cc' || echo '$(srcdir)/'`resid-fp/wave8580_PST.cc + $(am__mv) $(DEPDIR)/wave8580_PST.Tpo $(DEPDIR)/wave8580_PST.Po +# source='resid-fp/wave8580_PST.cc' object='wave8580_PST.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave8580_PST.o `test -f 'resid-fp/wave8580_PST.cc' || echo '$(srcdir)/'`resid-fp/wave8580_PST.cc + +wave8580_PST.obj: resid-fp/wave8580_PST.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave8580_PST.obj -MD -MP -MF $(DEPDIR)/wave8580_PST.Tpo -c -o wave8580_PST.obj `if test -f 'resid-fp/wave8580_PST.cc'; then $(CYGPATH_W) 'resid-fp/wave8580_PST.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave8580_PST.cc'; fi` + $(am__mv) $(DEPDIR)/wave8580_PST.Tpo $(DEPDIR)/wave8580_PST.Po +# source='resid-fp/wave8580_PST.cc' object='wave8580_PST.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave8580_PST.obj `if test -f 'resid-fp/wave8580_PST.cc'; then $(CYGPATH_W) 'resid-fp/wave8580_PST.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave8580_PST.cc'; fi` + +wave8580_P_T.o: resid-fp/wave8580_P_T.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave8580_P_T.o -MD -MP -MF $(DEPDIR)/wave8580_P_T.Tpo -c -o wave8580_P_T.o `test -f 'resid-fp/wave8580_P_T.cc' || echo '$(srcdir)/'`resid-fp/wave8580_P_T.cc + $(am__mv) $(DEPDIR)/wave8580_P_T.Tpo $(DEPDIR)/wave8580_P_T.Po +# source='resid-fp/wave8580_P_T.cc' object='wave8580_P_T.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave8580_P_T.o `test -f 'resid-fp/wave8580_P_T.cc' || echo '$(srcdir)/'`resid-fp/wave8580_P_T.cc + +wave8580_P_T.obj: resid-fp/wave8580_P_T.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave8580_P_T.obj -MD -MP -MF $(DEPDIR)/wave8580_P_T.Tpo -c -o wave8580_P_T.obj `if test -f 'resid-fp/wave8580_P_T.cc'; then $(CYGPATH_W) 'resid-fp/wave8580_P_T.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave8580_P_T.cc'; fi` + $(am__mv) $(DEPDIR)/wave8580_P_T.Tpo $(DEPDIR)/wave8580_P_T.Po +# source='resid-fp/wave8580_P_T.cc' object='wave8580_P_T.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave8580_P_T.obj `if test -f 'resid-fp/wave8580_P_T.cc'; then $(CYGPATH_W) 'resid-fp/wave8580_P_T.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave8580_P_T.cc'; fi` + +wave8580__ST.o: resid-fp/wave8580__ST.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave8580__ST.o -MD -MP -MF $(DEPDIR)/wave8580__ST.Tpo -c -o wave8580__ST.o `test -f 'resid-fp/wave8580__ST.cc' || echo '$(srcdir)/'`resid-fp/wave8580__ST.cc + $(am__mv) $(DEPDIR)/wave8580__ST.Tpo $(DEPDIR)/wave8580__ST.Po +# source='resid-fp/wave8580__ST.cc' object='wave8580__ST.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave8580__ST.o `test -f 'resid-fp/wave8580__ST.cc' || echo '$(srcdir)/'`resid-fp/wave8580__ST.cc + +wave8580__ST.obj: resid-fp/wave8580__ST.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave8580__ST.obj -MD -MP -MF $(DEPDIR)/wave8580__ST.Tpo -c -o wave8580__ST.obj `if test -f 'resid-fp/wave8580__ST.cc'; then $(CYGPATH_W) 'resid-fp/wave8580__ST.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave8580__ST.cc'; fi` + $(am__mv) $(DEPDIR)/wave8580__ST.Tpo $(DEPDIR)/wave8580__ST.Po +# source='resid-fp/wave8580__ST.cc' object='wave8580__ST.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave8580__ST.obj `if test -f 'resid-fp/wave8580__ST.cc'; then $(CYGPATH_W) 'resid-fp/wave8580__ST.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave8580__ST.cc'; fi` + +wave.o: resid-fp/wave.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave.o -MD -MP -MF $(DEPDIR)/wave.Tpo -c -o wave.o `test -f 'resid-fp/wave.cc' || echo '$(srcdir)/'`resid-fp/wave.cc + $(am__mv) $(DEPDIR)/wave.Tpo $(DEPDIR)/wave.Po +# source='resid-fp/wave.cc' object='wave.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave.o `test -f 'resid-fp/wave.cc' || echo '$(srcdir)/'`resid-fp/wave.cc + +wave.obj: resid-fp/wave.cc + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave.obj -MD -MP -MF $(DEPDIR)/wave.Tpo -c -o wave.obj `if test -f 'resid-fp/wave.cc'; then $(CYGPATH_W) 'resid-fp/wave.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave.cc'; fi` + $(am__mv) $(DEPDIR)/wave.Tpo $(DEPDIR)/wave.Po +# source='resid-fp/wave.cc' object='wave.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave.obj `if test -f 'resid-fp/wave.cc'; then $(CYGPATH_W) 'resid-fp/wave.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave.cc'; fi` + +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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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) $(SCRIPTS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS + + +../b-em: b-em + cp b-em .. + +amrefresh: + +# 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: diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 00000000..a03396e7 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,35 @@ +# Makefile.am for B-em + +bin_PROGRAMS = b-em +noinst_SCRIPTS = ../b-em +CLEANFILES = $(noinst_SCRIPTS) + +../b-em: b-em + cp b-em .. + +amrefresh: + + +b_em_CFLAGS = $(allegro_CFLAGS) + +# workaround for Win32 Allegro, which has `allegro-config' missing +if OS_WIN +b_em_LDADD = -lalleg -lz -lopenal -lalut +else +b_em_LDADD = $(allegro_LIBS) -lz -lopenal -lalut +endif + +b_em_SOURCES = 32016.c 6502.c 6502tube.c 65816.c acia.c adc.c \ +adf.c arm.c cmos.c compactcmos.c compact_joystick.c config.c csw.c ddnoise.c \ +debugger.c disc.c fdi.c fdi2raw.c i8271.c ide.c keyboard.c linux.c linux-gui.c \ +linux-keydefine.c main.c mem.c model.c mouse.c savestate.c serial.c sn76489.c \ +sound.c soundopenal.c ssd.c sysvia.c tape.c tapenoise.c tube.c uef.c uservia.c \ +via.c vidalleg.c video.c wd1770.c x86.c Z80.c resid.cc \ +resid-fp/convolve.cc resid-fp/convolve-sse.cc resid-fp/envelope.cc \ +resid-fp/extfilt.cc resid-fp/filter.cc resid-fp/pot.cc resid-fp/sid.cc \ +resid-fp/voice.cc resid-fp/wave6581_PS_.cc resid-fp/wave6581_PST.cc \ +resid-fp/wave6581_P_T.cc resid-fp/wave6581__ST.cc resid-fp/wave8580_PS_.cc \ +resid-fp/wave8580_PST.cc resid-fp/wave8580_P_T.cc resid-fp/wave8580__ST.cc \ +resid-fp/wave.cc + + diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 00000000..3345c0eb --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,1472 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ + +# Makefile.am for B-em + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +bin_PROGRAMS = b-em$(EXEEXT) +subdir = src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_b_em_OBJECTS = b_em-32016.$(OBJEXT) b_em-6502.$(OBJEXT) \ + b_em-6502tube.$(OBJEXT) b_em-65816.$(OBJEXT) \ + b_em-acia.$(OBJEXT) b_em-adc.$(OBJEXT) b_em-adf.$(OBJEXT) \ + b_em-arm.$(OBJEXT) b_em-cmos.$(OBJEXT) \ + b_em-compactcmos.$(OBJEXT) b_em-compact_joystick.$(OBJEXT) \ + b_em-config.$(OBJEXT) b_em-csw.$(OBJEXT) \ + b_em-ddnoise.$(OBJEXT) b_em-debugger.$(OBJEXT) \ + b_em-disc.$(OBJEXT) b_em-fdi.$(OBJEXT) b_em-fdi2raw.$(OBJEXT) \ + b_em-i8271.$(OBJEXT) b_em-ide.$(OBJEXT) \ + b_em-keyboard.$(OBJEXT) b_em-linux.$(OBJEXT) \ + b_em-linux-gui.$(OBJEXT) b_em-linux-keydefine.$(OBJEXT) \ + b_em-main.$(OBJEXT) b_em-mem.$(OBJEXT) b_em-model.$(OBJEXT) \ + b_em-mouse.$(OBJEXT) b_em-savestate.$(OBJEXT) \ + b_em-serial.$(OBJEXT) b_em-sn76489.$(OBJEXT) \ + b_em-sound.$(OBJEXT) b_em-soundopenal.$(OBJEXT) \ + b_em-ssd.$(OBJEXT) b_em-sysvia.$(OBJEXT) b_em-tape.$(OBJEXT) \ + b_em-tapenoise.$(OBJEXT) b_em-tube.$(OBJEXT) \ + b_em-uef.$(OBJEXT) b_em-uservia.$(OBJEXT) b_em-via.$(OBJEXT) \ + b_em-vidalleg.$(OBJEXT) b_em-video.$(OBJEXT) \ + b_em-wd1770.$(OBJEXT) b_em-x86.$(OBJEXT) b_em-Z80.$(OBJEXT) \ + resid.$(OBJEXT) convolve.$(OBJEXT) convolve-sse.$(OBJEXT) \ + envelope.$(OBJEXT) extfilt.$(OBJEXT) filter.$(OBJEXT) \ + pot.$(OBJEXT) sid.$(OBJEXT) voice.$(OBJEXT) \ + wave6581_PS_.$(OBJEXT) wave6581_PST.$(OBJEXT) \ + wave6581_P_T.$(OBJEXT) wave6581__ST.$(OBJEXT) \ + wave8580_PS_.$(OBJEXT) wave8580_PST.$(OBJEXT) \ + wave8580_P_T.$(OBJEXT) wave8580__ST.$(OBJEXT) wave.$(OBJEXT) +b_em_OBJECTS = $(am_b_em_OBJECTS) +am__DEPENDENCIES_1 = +@OS_WIN_FALSE@b_em_DEPENDENCIES = $(am__DEPENDENCIES_1) +SCRIPTS = $(noinst_SCRIPTS) +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +SOURCES = $(b_em_SOURCES) +DIST_SOURCES = $(b_em_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLEGRO_CONFIG = @ALLEGRO_CONFIG@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +allegro_CFLAGS = @allegro_CFLAGS@ +allegro_LIBS = @allegro_LIBS@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_SCRIPTS = ../b-em +CLEANFILES = $(noinst_SCRIPTS) +b_em_CFLAGS = $(allegro_CFLAGS) +@OS_WIN_FALSE@b_em_LDADD = $(allegro_LIBS) -lz -lopenal -lalut + +# workaround for Win32 Allegro, which has `allegro-config' missing +@OS_WIN_TRUE@b_em_LDADD = -lalleg -lz -lopenal -lalut +b_em_SOURCES = 32016.c 6502.c 6502tube.c 65816.c acia.c adc.c \ +adf.c arm.c cmos.c compactcmos.c compact_joystick.c config.c csw.c ddnoise.c \ +debugger.c disc.c fdi.c fdi2raw.c i8271.c ide.c keyboard.c linux.c linux-gui.c \ +linux-keydefine.c main.c mem.c model.c mouse.c savestate.c serial.c sn76489.c \ +sound.c soundopenal.c ssd.c sysvia.c tape.c tapenoise.c tube.c uef.c uservia.c \ +via.c vidalleg.c video.c wd1770.c x86.c Z80.c resid.cc \ +resid-fp/convolve.cc resid-fp/convolve-sse.cc resid-fp/envelope.cc \ +resid-fp/extfilt.cc resid-fp/filter.cc resid-fp/pot.cc resid-fp/sid.cc \ +resid-fp/voice.cc resid-fp/wave6581_PS_.cc resid-fp/wave6581_PST.cc \ +resid-fp/wave6581_P_T.cc resid-fp/wave6581__ST.cc resid-fp/wave8580_PS_.cc \ +resid-fp/wave8580_PST.cc resid-fp/wave8580_P_T.cc resid-fp/wave8580__ST.cc \ +resid-fp/wave.cc + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .cc .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +b-em$(EXEEXT): $(b_em_OBJECTS) $(b_em_DEPENDENCIES) + @rm -f b-em$(EXEEXT) + $(CXXLINK) $(b_em_OBJECTS) $(b_em_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-32016.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-6502.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-6502tube.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-65816.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-Z80.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-acia.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-adc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-adf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-arm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-cmos.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-compact_joystick.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-compactcmos.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-config.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-csw.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-ddnoise.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-debugger.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-disc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-fdi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-fdi2raw.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-i8271.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-ide.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-keyboard.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-linux-gui.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-linux-keydefine.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-linux.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-mem.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-model.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-mouse.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-savestate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-serial.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-sn76489.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-sound.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-soundopenal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-ssd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-sysvia.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-tape.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-tapenoise.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-tube.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-uef.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-uservia.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-via.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-vidalleg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-video.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-wd1770.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_em-x86.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convolve-sse.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convolve.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/envelope.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extfilt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pot.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/voice.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave6581_PST.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave6581_PS_.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave6581_P_T.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave6581__ST.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave8580_PST.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave8580_PS_.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave8580_P_T.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave8580__ST.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +b_em-32016.o: 32016.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-32016.o -MD -MP -MF $(DEPDIR)/b_em-32016.Tpo -c -o b_em-32016.o `test -f '32016.c' || echo '$(srcdir)/'`32016.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-32016.Tpo $(DEPDIR)/b_em-32016.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='32016.c' object='b_em-32016.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-32016.o `test -f '32016.c' || echo '$(srcdir)/'`32016.c + +b_em-32016.obj: 32016.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-32016.obj -MD -MP -MF $(DEPDIR)/b_em-32016.Tpo -c -o b_em-32016.obj `if test -f '32016.c'; then $(CYGPATH_W) '32016.c'; else $(CYGPATH_W) '$(srcdir)/32016.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-32016.Tpo $(DEPDIR)/b_em-32016.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='32016.c' object='b_em-32016.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-32016.obj `if test -f '32016.c'; then $(CYGPATH_W) '32016.c'; else $(CYGPATH_W) '$(srcdir)/32016.c'; fi` + +b_em-6502.o: 6502.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-6502.o -MD -MP -MF $(DEPDIR)/b_em-6502.Tpo -c -o b_em-6502.o `test -f '6502.c' || echo '$(srcdir)/'`6502.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-6502.Tpo $(DEPDIR)/b_em-6502.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='6502.c' object='b_em-6502.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-6502.o `test -f '6502.c' || echo '$(srcdir)/'`6502.c + +b_em-6502.obj: 6502.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-6502.obj -MD -MP -MF $(DEPDIR)/b_em-6502.Tpo -c -o b_em-6502.obj `if test -f '6502.c'; then $(CYGPATH_W) '6502.c'; else $(CYGPATH_W) '$(srcdir)/6502.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-6502.Tpo $(DEPDIR)/b_em-6502.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='6502.c' object='b_em-6502.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-6502.obj `if test -f '6502.c'; then $(CYGPATH_W) '6502.c'; else $(CYGPATH_W) '$(srcdir)/6502.c'; fi` + +b_em-6502tube.o: 6502tube.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-6502tube.o -MD -MP -MF $(DEPDIR)/b_em-6502tube.Tpo -c -o b_em-6502tube.o `test -f '6502tube.c' || echo '$(srcdir)/'`6502tube.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-6502tube.Tpo $(DEPDIR)/b_em-6502tube.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='6502tube.c' object='b_em-6502tube.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-6502tube.o `test -f '6502tube.c' || echo '$(srcdir)/'`6502tube.c + +b_em-6502tube.obj: 6502tube.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-6502tube.obj -MD -MP -MF $(DEPDIR)/b_em-6502tube.Tpo -c -o b_em-6502tube.obj `if test -f '6502tube.c'; then $(CYGPATH_W) '6502tube.c'; else $(CYGPATH_W) '$(srcdir)/6502tube.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-6502tube.Tpo $(DEPDIR)/b_em-6502tube.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='6502tube.c' object='b_em-6502tube.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-6502tube.obj `if test -f '6502tube.c'; then $(CYGPATH_W) '6502tube.c'; else $(CYGPATH_W) '$(srcdir)/6502tube.c'; fi` + +b_em-65816.o: 65816.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-65816.o -MD -MP -MF $(DEPDIR)/b_em-65816.Tpo -c -o b_em-65816.o `test -f '65816.c' || echo '$(srcdir)/'`65816.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-65816.Tpo $(DEPDIR)/b_em-65816.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='65816.c' object='b_em-65816.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-65816.o `test -f '65816.c' || echo '$(srcdir)/'`65816.c + +b_em-65816.obj: 65816.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-65816.obj -MD -MP -MF $(DEPDIR)/b_em-65816.Tpo -c -o b_em-65816.obj `if test -f '65816.c'; then $(CYGPATH_W) '65816.c'; else $(CYGPATH_W) '$(srcdir)/65816.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-65816.Tpo $(DEPDIR)/b_em-65816.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='65816.c' object='b_em-65816.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-65816.obj `if test -f '65816.c'; then $(CYGPATH_W) '65816.c'; else $(CYGPATH_W) '$(srcdir)/65816.c'; fi` + +b_em-acia.o: acia.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-acia.o -MD -MP -MF $(DEPDIR)/b_em-acia.Tpo -c -o b_em-acia.o `test -f 'acia.c' || echo '$(srcdir)/'`acia.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-acia.Tpo $(DEPDIR)/b_em-acia.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='acia.c' object='b_em-acia.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-acia.o `test -f 'acia.c' || echo '$(srcdir)/'`acia.c + +b_em-acia.obj: acia.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-acia.obj -MD -MP -MF $(DEPDIR)/b_em-acia.Tpo -c -o b_em-acia.obj `if test -f 'acia.c'; then $(CYGPATH_W) 'acia.c'; else $(CYGPATH_W) '$(srcdir)/acia.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-acia.Tpo $(DEPDIR)/b_em-acia.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='acia.c' object='b_em-acia.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-acia.obj `if test -f 'acia.c'; then $(CYGPATH_W) 'acia.c'; else $(CYGPATH_W) '$(srcdir)/acia.c'; fi` + +b_em-adc.o: adc.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-adc.o -MD -MP -MF $(DEPDIR)/b_em-adc.Tpo -c -o b_em-adc.o `test -f 'adc.c' || echo '$(srcdir)/'`adc.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-adc.Tpo $(DEPDIR)/b_em-adc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc.c' object='b_em-adc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-adc.o `test -f 'adc.c' || echo '$(srcdir)/'`adc.c + +b_em-adc.obj: adc.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-adc.obj -MD -MP -MF $(DEPDIR)/b_em-adc.Tpo -c -o b_em-adc.obj `if test -f 'adc.c'; then $(CYGPATH_W) 'adc.c'; else $(CYGPATH_W) '$(srcdir)/adc.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-adc.Tpo $(DEPDIR)/b_em-adc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adc.c' object='b_em-adc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-adc.obj `if test -f 'adc.c'; then $(CYGPATH_W) 'adc.c'; else $(CYGPATH_W) '$(srcdir)/adc.c'; fi` + +b_em-adf.o: adf.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-adf.o -MD -MP -MF $(DEPDIR)/b_em-adf.Tpo -c -o b_em-adf.o `test -f 'adf.c' || echo '$(srcdir)/'`adf.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-adf.Tpo $(DEPDIR)/b_em-adf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adf.c' object='b_em-adf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-adf.o `test -f 'adf.c' || echo '$(srcdir)/'`adf.c + +b_em-adf.obj: adf.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-adf.obj -MD -MP -MF $(DEPDIR)/b_em-adf.Tpo -c -o b_em-adf.obj `if test -f 'adf.c'; then $(CYGPATH_W) 'adf.c'; else $(CYGPATH_W) '$(srcdir)/adf.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-adf.Tpo $(DEPDIR)/b_em-adf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adf.c' object='b_em-adf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-adf.obj `if test -f 'adf.c'; then $(CYGPATH_W) 'adf.c'; else $(CYGPATH_W) '$(srcdir)/adf.c'; fi` + +b_em-arm.o: arm.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-arm.o -MD -MP -MF $(DEPDIR)/b_em-arm.Tpo -c -o b_em-arm.o `test -f 'arm.c' || echo '$(srcdir)/'`arm.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-arm.Tpo $(DEPDIR)/b_em-arm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='arm.c' object='b_em-arm.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-arm.o `test -f 'arm.c' || echo '$(srcdir)/'`arm.c + +b_em-arm.obj: arm.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-arm.obj -MD -MP -MF $(DEPDIR)/b_em-arm.Tpo -c -o b_em-arm.obj `if test -f 'arm.c'; then $(CYGPATH_W) 'arm.c'; else $(CYGPATH_W) '$(srcdir)/arm.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-arm.Tpo $(DEPDIR)/b_em-arm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='arm.c' object='b_em-arm.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-arm.obj `if test -f 'arm.c'; then $(CYGPATH_W) 'arm.c'; else $(CYGPATH_W) '$(srcdir)/arm.c'; fi` + +b_em-cmos.o: cmos.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-cmos.o -MD -MP -MF $(DEPDIR)/b_em-cmos.Tpo -c -o b_em-cmos.o `test -f 'cmos.c' || echo '$(srcdir)/'`cmos.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-cmos.Tpo $(DEPDIR)/b_em-cmos.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cmos.c' object='b_em-cmos.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-cmos.o `test -f 'cmos.c' || echo '$(srcdir)/'`cmos.c + +b_em-cmos.obj: cmos.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-cmos.obj -MD -MP -MF $(DEPDIR)/b_em-cmos.Tpo -c -o b_em-cmos.obj `if test -f 'cmos.c'; then $(CYGPATH_W) 'cmos.c'; else $(CYGPATH_W) '$(srcdir)/cmos.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-cmos.Tpo $(DEPDIR)/b_em-cmos.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cmos.c' object='b_em-cmos.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-cmos.obj `if test -f 'cmos.c'; then $(CYGPATH_W) 'cmos.c'; else $(CYGPATH_W) '$(srcdir)/cmos.c'; fi` + +b_em-compactcmos.o: compactcmos.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-compactcmos.o -MD -MP -MF $(DEPDIR)/b_em-compactcmos.Tpo -c -o b_em-compactcmos.o `test -f 'compactcmos.c' || echo '$(srcdir)/'`compactcmos.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-compactcmos.Tpo $(DEPDIR)/b_em-compactcmos.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='compactcmos.c' object='b_em-compactcmos.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-compactcmos.o `test -f 'compactcmos.c' || echo '$(srcdir)/'`compactcmos.c + +b_em-compactcmos.obj: compactcmos.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-compactcmos.obj -MD -MP -MF $(DEPDIR)/b_em-compactcmos.Tpo -c -o b_em-compactcmos.obj `if test -f 'compactcmos.c'; then $(CYGPATH_W) 'compactcmos.c'; else $(CYGPATH_W) '$(srcdir)/compactcmos.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-compactcmos.Tpo $(DEPDIR)/b_em-compactcmos.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='compactcmos.c' object='b_em-compactcmos.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-compactcmos.obj `if test -f 'compactcmos.c'; then $(CYGPATH_W) 'compactcmos.c'; else $(CYGPATH_W) '$(srcdir)/compactcmos.c'; fi` + +b_em-compact_joystick.o: compact_joystick.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-compact_joystick.o -MD -MP -MF $(DEPDIR)/b_em-compact_joystick.Tpo -c -o b_em-compact_joystick.o `test -f 'compact_joystick.c' || echo '$(srcdir)/'`compact_joystick.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-compact_joystick.Tpo $(DEPDIR)/b_em-compact_joystick.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='compact_joystick.c' object='b_em-compact_joystick.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-compact_joystick.o `test -f 'compact_joystick.c' || echo '$(srcdir)/'`compact_joystick.c + +b_em-compact_joystick.obj: compact_joystick.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-compact_joystick.obj -MD -MP -MF $(DEPDIR)/b_em-compact_joystick.Tpo -c -o b_em-compact_joystick.obj `if test -f 'compact_joystick.c'; then $(CYGPATH_W) 'compact_joystick.c'; else $(CYGPATH_W) '$(srcdir)/compact_joystick.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-compact_joystick.Tpo $(DEPDIR)/b_em-compact_joystick.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='compact_joystick.c' object='b_em-compact_joystick.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-compact_joystick.obj `if test -f 'compact_joystick.c'; then $(CYGPATH_W) 'compact_joystick.c'; else $(CYGPATH_W) '$(srcdir)/compact_joystick.c'; fi` + +b_em-config.o: config.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-config.o -MD -MP -MF $(DEPDIR)/b_em-config.Tpo -c -o b_em-config.o `test -f 'config.c' || echo '$(srcdir)/'`config.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-config.Tpo $(DEPDIR)/b_em-config.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='config.c' object='b_em-config.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-config.o `test -f 'config.c' || echo '$(srcdir)/'`config.c + +b_em-config.obj: config.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-config.obj -MD -MP -MF $(DEPDIR)/b_em-config.Tpo -c -o b_em-config.obj `if test -f 'config.c'; then $(CYGPATH_W) 'config.c'; else $(CYGPATH_W) '$(srcdir)/config.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-config.Tpo $(DEPDIR)/b_em-config.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='config.c' object='b_em-config.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-config.obj `if test -f 'config.c'; then $(CYGPATH_W) 'config.c'; else $(CYGPATH_W) '$(srcdir)/config.c'; fi` + +b_em-csw.o: csw.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-csw.o -MD -MP -MF $(DEPDIR)/b_em-csw.Tpo -c -o b_em-csw.o `test -f 'csw.c' || echo '$(srcdir)/'`csw.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-csw.Tpo $(DEPDIR)/b_em-csw.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='csw.c' object='b_em-csw.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-csw.o `test -f 'csw.c' || echo '$(srcdir)/'`csw.c + +b_em-csw.obj: csw.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-csw.obj -MD -MP -MF $(DEPDIR)/b_em-csw.Tpo -c -o b_em-csw.obj `if test -f 'csw.c'; then $(CYGPATH_W) 'csw.c'; else $(CYGPATH_W) '$(srcdir)/csw.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-csw.Tpo $(DEPDIR)/b_em-csw.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='csw.c' object='b_em-csw.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-csw.obj `if test -f 'csw.c'; then $(CYGPATH_W) 'csw.c'; else $(CYGPATH_W) '$(srcdir)/csw.c'; fi` + +b_em-ddnoise.o: ddnoise.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-ddnoise.o -MD -MP -MF $(DEPDIR)/b_em-ddnoise.Tpo -c -o b_em-ddnoise.o `test -f 'ddnoise.c' || echo '$(srcdir)/'`ddnoise.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-ddnoise.Tpo $(DEPDIR)/b_em-ddnoise.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ddnoise.c' object='b_em-ddnoise.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-ddnoise.o `test -f 'ddnoise.c' || echo '$(srcdir)/'`ddnoise.c + +b_em-ddnoise.obj: ddnoise.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-ddnoise.obj -MD -MP -MF $(DEPDIR)/b_em-ddnoise.Tpo -c -o b_em-ddnoise.obj `if test -f 'ddnoise.c'; then $(CYGPATH_W) 'ddnoise.c'; else $(CYGPATH_W) '$(srcdir)/ddnoise.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-ddnoise.Tpo $(DEPDIR)/b_em-ddnoise.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ddnoise.c' object='b_em-ddnoise.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-ddnoise.obj `if test -f 'ddnoise.c'; then $(CYGPATH_W) 'ddnoise.c'; else $(CYGPATH_W) '$(srcdir)/ddnoise.c'; fi` + +b_em-debugger.o: debugger.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-debugger.o -MD -MP -MF $(DEPDIR)/b_em-debugger.Tpo -c -o b_em-debugger.o `test -f 'debugger.c' || echo '$(srcdir)/'`debugger.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-debugger.Tpo $(DEPDIR)/b_em-debugger.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='debugger.c' object='b_em-debugger.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-debugger.o `test -f 'debugger.c' || echo '$(srcdir)/'`debugger.c + +b_em-debugger.obj: debugger.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-debugger.obj -MD -MP -MF $(DEPDIR)/b_em-debugger.Tpo -c -o b_em-debugger.obj `if test -f 'debugger.c'; then $(CYGPATH_W) 'debugger.c'; else $(CYGPATH_W) '$(srcdir)/debugger.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-debugger.Tpo $(DEPDIR)/b_em-debugger.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='debugger.c' object='b_em-debugger.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-debugger.obj `if test -f 'debugger.c'; then $(CYGPATH_W) 'debugger.c'; else $(CYGPATH_W) '$(srcdir)/debugger.c'; fi` + +b_em-disc.o: disc.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-disc.o -MD -MP -MF $(DEPDIR)/b_em-disc.Tpo -c -o b_em-disc.o `test -f 'disc.c' || echo '$(srcdir)/'`disc.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-disc.Tpo $(DEPDIR)/b_em-disc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='disc.c' object='b_em-disc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-disc.o `test -f 'disc.c' || echo '$(srcdir)/'`disc.c + +b_em-disc.obj: disc.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-disc.obj -MD -MP -MF $(DEPDIR)/b_em-disc.Tpo -c -o b_em-disc.obj `if test -f 'disc.c'; then $(CYGPATH_W) 'disc.c'; else $(CYGPATH_W) '$(srcdir)/disc.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-disc.Tpo $(DEPDIR)/b_em-disc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='disc.c' object='b_em-disc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-disc.obj `if test -f 'disc.c'; then $(CYGPATH_W) 'disc.c'; else $(CYGPATH_W) '$(srcdir)/disc.c'; fi` + +b_em-fdi.o: fdi.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-fdi.o -MD -MP -MF $(DEPDIR)/b_em-fdi.Tpo -c -o b_em-fdi.o `test -f 'fdi.c' || echo '$(srcdir)/'`fdi.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-fdi.Tpo $(DEPDIR)/b_em-fdi.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fdi.c' object='b_em-fdi.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-fdi.o `test -f 'fdi.c' || echo '$(srcdir)/'`fdi.c + +b_em-fdi.obj: fdi.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-fdi.obj -MD -MP -MF $(DEPDIR)/b_em-fdi.Tpo -c -o b_em-fdi.obj `if test -f 'fdi.c'; then $(CYGPATH_W) 'fdi.c'; else $(CYGPATH_W) '$(srcdir)/fdi.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-fdi.Tpo $(DEPDIR)/b_em-fdi.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fdi.c' object='b_em-fdi.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-fdi.obj `if test -f 'fdi.c'; then $(CYGPATH_W) 'fdi.c'; else $(CYGPATH_W) '$(srcdir)/fdi.c'; fi` + +b_em-fdi2raw.o: fdi2raw.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-fdi2raw.o -MD -MP -MF $(DEPDIR)/b_em-fdi2raw.Tpo -c -o b_em-fdi2raw.o `test -f 'fdi2raw.c' || echo '$(srcdir)/'`fdi2raw.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-fdi2raw.Tpo $(DEPDIR)/b_em-fdi2raw.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fdi2raw.c' object='b_em-fdi2raw.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-fdi2raw.o `test -f 'fdi2raw.c' || echo '$(srcdir)/'`fdi2raw.c + +b_em-fdi2raw.obj: fdi2raw.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-fdi2raw.obj -MD -MP -MF $(DEPDIR)/b_em-fdi2raw.Tpo -c -o b_em-fdi2raw.obj `if test -f 'fdi2raw.c'; then $(CYGPATH_W) 'fdi2raw.c'; else $(CYGPATH_W) '$(srcdir)/fdi2raw.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-fdi2raw.Tpo $(DEPDIR)/b_em-fdi2raw.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fdi2raw.c' object='b_em-fdi2raw.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-fdi2raw.obj `if test -f 'fdi2raw.c'; then $(CYGPATH_W) 'fdi2raw.c'; else $(CYGPATH_W) '$(srcdir)/fdi2raw.c'; fi` + +b_em-i8271.o: i8271.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-i8271.o -MD -MP -MF $(DEPDIR)/b_em-i8271.Tpo -c -o b_em-i8271.o `test -f 'i8271.c' || echo '$(srcdir)/'`i8271.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-i8271.Tpo $(DEPDIR)/b_em-i8271.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='i8271.c' object='b_em-i8271.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-i8271.o `test -f 'i8271.c' || echo '$(srcdir)/'`i8271.c + +b_em-i8271.obj: i8271.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-i8271.obj -MD -MP -MF $(DEPDIR)/b_em-i8271.Tpo -c -o b_em-i8271.obj `if test -f 'i8271.c'; then $(CYGPATH_W) 'i8271.c'; else $(CYGPATH_W) '$(srcdir)/i8271.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-i8271.Tpo $(DEPDIR)/b_em-i8271.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='i8271.c' object='b_em-i8271.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-i8271.obj `if test -f 'i8271.c'; then $(CYGPATH_W) 'i8271.c'; else $(CYGPATH_W) '$(srcdir)/i8271.c'; fi` + +b_em-ide.o: ide.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-ide.o -MD -MP -MF $(DEPDIR)/b_em-ide.Tpo -c -o b_em-ide.o `test -f 'ide.c' || echo '$(srcdir)/'`ide.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-ide.Tpo $(DEPDIR)/b_em-ide.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ide.c' object='b_em-ide.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-ide.o `test -f 'ide.c' || echo '$(srcdir)/'`ide.c + +b_em-ide.obj: ide.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-ide.obj -MD -MP -MF $(DEPDIR)/b_em-ide.Tpo -c -o b_em-ide.obj `if test -f 'ide.c'; then $(CYGPATH_W) 'ide.c'; else $(CYGPATH_W) '$(srcdir)/ide.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-ide.Tpo $(DEPDIR)/b_em-ide.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ide.c' object='b_em-ide.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-ide.obj `if test -f 'ide.c'; then $(CYGPATH_W) 'ide.c'; else $(CYGPATH_W) '$(srcdir)/ide.c'; fi` + +b_em-keyboard.o: keyboard.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-keyboard.o -MD -MP -MF $(DEPDIR)/b_em-keyboard.Tpo -c -o b_em-keyboard.o `test -f 'keyboard.c' || echo '$(srcdir)/'`keyboard.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-keyboard.Tpo $(DEPDIR)/b_em-keyboard.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='keyboard.c' object='b_em-keyboard.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-keyboard.o `test -f 'keyboard.c' || echo '$(srcdir)/'`keyboard.c + +b_em-keyboard.obj: keyboard.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-keyboard.obj -MD -MP -MF $(DEPDIR)/b_em-keyboard.Tpo -c -o b_em-keyboard.obj `if test -f 'keyboard.c'; then $(CYGPATH_W) 'keyboard.c'; else $(CYGPATH_W) '$(srcdir)/keyboard.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-keyboard.Tpo $(DEPDIR)/b_em-keyboard.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='keyboard.c' object='b_em-keyboard.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-keyboard.obj `if test -f 'keyboard.c'; then $(CYGPATH_W) 'keyboard.c'; else $(CYGPATH_W) '$(srcdir)/keyboard.c'; fi` + +b_em-linux.o: linux.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-linux.o -MD -MP -MF $(DEPDIR)/b_em-linux.Tpo -c -o b_em-linux.o `test -f 'linux.c' || echo '$(srcdir)/'`linux.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-linux.Tpo $(DEPDIR)/b_em-linux.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='linux.c' object='b_em-linux.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-linux.o `test -f 'linux.c' || echo '$(srcdir)/'`linux.c + +b_em-linux.obj: linux.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-linux.obj -MD -MP -MF $(DEPDIR)/b_em-linux.Tpo -c -o b_em-linux.obj `if test -f 'linux.c'; then $(CYGPATH_W) 'linux.c'; else $(CYGPATH_W) '$(srcdir)/linux.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-linux.Tpo $(DEPDIR)/b_em-linux.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='linux.c' object='b_em-linux.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-linux.obj `if test -f 'linux.c'; then $(CYGPATH_W) 'linux.c'; else $(CYGPATH_W) '$(srcdir)/linux.c'; fi` + +b_em-linux-gui.o: linux-gui.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-linux-gui.o -MD -MP -MF $(DEPDIR)/b_em-linux-gui.Tpo -c -o b_em-linux-gui.o `test -f 'linux-gui.c' || echo '$(srcdir)/'`linux-gui.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-linux-gui.Tpo $(DEPDIR)/b_em-linux-gui.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='linux-gui.c' object='b_em-linux-gui.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-linux-gui.o `test -f 'linux-gui.c' || echo '$(srcdir)/'`linux-gui.c + +b_em-linux-gui.obj: linux-gui.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-linux-gui.obj -MD -MP -MF $(DEPDIR)/b_em-linux-gui.Tpo -c -o b_em-linux-gui.obj `if test -f 'linux-gui.c'; then $(CYGPATH_W) 'linux-gui.c'; else $(CYGPATH_W) '$(srcdir)/linux-gui.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-linux-gui.Tpo $(DEPDIR)/b_em-linux-gui.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='linux-gui.c' object='b_em-linux-gui.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-linux-gui.obj `if test -f 'linux-gui.c'; then $(CYGPATH_W) 'linux-gui.c'; else $(CYGPATH_W) '$(srcdir)/linux-gui.c'; fi` + +b_em-linux-keydefine.o: linux-keydefine.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-linux-keydefine.o -MD -MP -MF $(DEPDIR)/b_em-linux-keydefine.Tpo -c -o b_em-linux-keydefine.o `test -f 'linux-keydefine.c' || echo '$(srcdir)/'`linux-keydefine.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-linux-keydefine.Tpo $(DEPDIR)/b_em-linux-keydefine.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='linux-keydefine.c' object='b_em-linux-keydefine.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-linux-keydefine.o `test -f 'linux-keydefine.c' || echo '$(srcdir)/'`linux-keydefine.c + +b_em-linux-keydefine.obj: linux-keydefine.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-linux-keydefine.obj -MD -MP -MF $(DEPDIR)/b_em-linux-keydefine.Tpo -c -o b_em-linux-keydefine.obj `if test -f 'linux-keydefine.c'; then $(CYGPATH_W) 'linux-keydefine.c'; else $(CYGPATH_W) '$(srcdir)/linux-keydefine.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-linux-keydefine.Tpo $(DEPDIR)/b_em-linux-keydefine.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='linux-keydefine.c' object='b_em-linux-keydefine.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-linux-keydefine.obj `if test -f 'linux-keydefine.c'; then $(CYGPATH_W) 'linux-keydefine.c'; else $(CYGPATH_W) '$(srcdir)/linux-keydefine.c'; fi` + +b_em-main.o: main.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-main.o -MD -MP -MF $(DEPDIR)/b_em-main.Tpo -c -o b_em-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-main.Tpo $(DEPDIR)/b_em-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='b_em-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c + +b_em-main.obj: main.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-main.obj -MD -MP -MF $(DEPDIR)/b_em-main.Tpo -c -o b_em-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-main.Tpo $(DEPDIR)/b_em-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='b_em-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` + +b_em-mem.o: mem.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-mem.o -MD -MP -MF $(DEPDIR)/b_em-mem.Tpo -c -o b_em-mem.o `test -f 'mem.c' || echo '$(srcdir)/'`mem.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-mem.Tpo $(DEPDIR)/b_em-mem.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mem.c' object='b_em-mem.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-mem.o `test -f 'mem.c' || echo '$(srcdir)/'`mem.c + +b_em-mem.obj: mem.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-mem.obj -MD -MP -MF $(DEPDIR)/b_em-mem.Tpo -c -o b_em-mem.obj `if test -f 'mem.c'; then $(CYGPATH_W) 'mem.c'; else $(CYGPATH_W) '$(srcdir)/mem.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-mem.Tpo $(DEPDIR)/b_em-mem.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mem.c' object='b_em-mem.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-mem.obj `if test -f 'mem.c'; then $(CYGPATH_W) 'mem.c'; else $(CYGPATH_W) '$(srcdir)/mem.c'; fi` + +b_em-model.o: model.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-model.o -MD -MP -MF $(DEPDIR)/b_em-model.Tpo -c -o b_em-model.o `test -f 'model.c' || echo '$(srcdir)/'`model.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-model.Tpo $(DEPDIR)/b_em-model.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='model.c' object='b_em-model.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-model.o `test -f 'model.c' || echo '$(srcdir)/'`model.c + +b_em-model.obj: model.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-model.obj -MD -MP -MF $(DEPDIR)/b_em-model.Tpo -c -o b_em-model.obj `if test -f 'model.c'; then $(CYGPATH_W) 'model.c'; else $(CYGPATH_W) '$(srcdir)/model.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-model.Tpo $(DEPDIR)/b_em-model.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='model.c' object='b_em-model.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-model.obj `if test -f 'model.c'; then $(CYGPATH_W) 'model.c'; else $(CYGPATH_W) '$(srcdir)/model.c'; fi` + +b_em-mouse.o: mouse.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-mouse.o -MD -MP -MF $(DEPDIR)/b_em-mouse.Tpo -c -o b_em-mouse.o `test -f 'mouse.c' || echo '$(srcdir)/'`mouse.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-mouse.Tpo $(DEPDIR)/b_em-mouse.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mouse.c' object='b_em-mouse.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-mouse.o `test -f 'mouse.c' || echo '$(srcdir)/'`mouse.c + +b_em-mouse.obj: mouse.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-mouse.obj -MD -MP -MF $(DEPDIR)/b_em-mouse.Tpo -c -o b_em-mouse.obj `if test -f 'mouse.c'; then $(CYGPATH_W) 'mouse.c'; else $(CYGPATH_W) '$(srcdir)/mouse.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-mouse.Tpo $(DEPDIR)/b_em-mouse.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mouse.c' object='b_em-mouse.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-mouse.obj `if test -f 'mouse.c'; then $(CYGPATH_W) 'mouse.c'; else $(CYGPATH_W) '$(srcdir)/mouse.c'; fi` + +b_em-savestate.o: savestate.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-savestate.o -MD -MP -MF $(DEPDIR)/b_em-savestate.Tpo -c -o b_em-savestate.o `test -f 'savestate.c' || echo '$(srcdir)/'`savestate.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-savestate.Tpo $(DEPDIR)/b_em-savestate.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='savestate.c' object='b_em-savestate.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-savestate.o `test -f 'savestate.c' || echo '$(srcdir)/'`savestate.c + +b_em-savestate.obj: savestate.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-savestate.obj -MD -MP -MF $(DEPDIR)/b_em-savestate.Tpo -c -o b_em-savestate.obj `if test -f 'savestate.c'; then $(CYGPATH_W) 'savestate.c'; else $(CYGPATH_W) '$(srcdir)/savestate.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-savestate.Tpo $(DEPDIR)/b_em-savestate.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='savestate.c' object='b_em-savestate.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-savestate.obj `if test -f 'savestate.c'; then $(CYGPATH_W) 'savestate.c'; else $(CYGPATH_W) '$(srcdir)/savestate.c'; fi` + +b_em-serial.o: serial.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-serial.o -MD -MP -MF $(DEPDIR)/b_em-serial.Tpo -c -o b_em-serial.o `test -f 'serial.c' || echo '$(srcdir)/'`serial.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-serial.Tpo $(DEPDIR)/b_em-serial.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='serial.c' object='b_em-serial.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-serial.o `test -f 'serial.c' || echo '$(srcdir)/'`serial.c + +b_em-serial.obj: serial.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-serial.obj -MD -MP -MF $(DEPDIR)/b_em-serial.Tpo -c -o b_em-serial.obj `if test -f 'serial.c'; then $(CYGPATH_W) 'serial.c'; else $(CYGPATH_W) '$(srcdir)/serial.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-serial.Tpo $(DEPDIR)/b_em-serial.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='serial.c' object='b_em-serial.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-serial.obj `if test -f 'serial.c'; then $(CYGPATH_W) 'serial.c'; else $(CYGPATH_W) '$(srcdir)/serial.c'; fi` + +b_em-sn76489.o: sn76489.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-sn76489.o -MD -MP -MF $(DEPDIR)/b_em-sn76489.Tpo -c -o b_em-sn76489.o `test -f 'sn76489.c' || echo '$(srcdir)/'`sn76489.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-sn76489.Tpo $(DEPDIR)/b_em-sn76489.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sn76489.c' object='b_em-sn76489.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-sn76489.o `test -f 'sn76489.c' || echo '$(srcdir)/'`sn76489.c + +b_em-sn76489.obj: sn76489.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-sn76489.obj -MD -MP -MF $(DEPDIR)/b_em-sn76489.Tpo -c -o b_em-sn76489.obj `if test -f 'sn76489.c'; then $(CYGPATH_W) 'sn76489.c'; else $(CYGPATH_W) '$(srcdir)/sn76489.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-sn76489.Tpo $(DEPDIR)/b_em-sn76489.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sn76489.c' object='b_em-sn76489.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-sn76489.obj `if test -f 'sn76489.c'; then $(CYGPATH_W) 'sn76489.c'; else $(CYGPATH_W) '$(srcdir)/sn76489.c'; fi` + +b_em-sound.o: sound.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-sound.o -MD -MP -MF $(DEPDIR)/b_em-sound.Tpo -c -o b_em-sound.o `test -f 'sound.c' || echo '$(srcdir)/'`sound.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-sound.Tpo $(DEPDIR)/b_em-sound.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sound.c' object='b_em-sound.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-sound.o `test -f 'sound.c' || echo '$(srcdir)/'`sound.c + +b_em-sound.obj: sound.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-sound.obj -MD -MP -MF $(DEPDIR)/b_em-sound.Tpo -c -o b_em-sound.obj `if test -f 'sound.c'; then $(CYGPATH_W) 'sound.c'; else $(CYGPATH_W) '$(srcdir)/sound.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-sound.Tpo $(DEPDIR)/b_em-sound.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sound.c' object='b_em-sound.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-sound.obj `if test -f 'sound.c'; then $(CYGPATH_W) 'sound.c'; else $(CYGPATH_W) '$(srcdir)/sound.c'; fi` + +b_em-soundopenal.o: soundopenal.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-soundopenal.o -MD -MP -MF $(DEPDIR)/b_em-soundopenal.Tpo -c -o b_em-soundopenal.o `test -f 'soundopenal.c' || echo '$(srcdir)/'`soundopenal.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-soundopenal.Tpo $(DEPDIR)/b_em-soundopenal.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='soundopenal.c' object='b_em-soundopenal.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-soundopenal.o `test -f 'soundopenal.c' || echo '$(srcdir)/'`soundopenal.c + +b_em-soundopenal.obj: soundopenal.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-soundopenal.obj -MD -MP -MF $(DEPDIR)/b_em-soundopenal.Tpo -c -o b_em-soundopenal.obj `if test -f 'soundopenal.c'; then $(CYGPATH_W) 'soundopenal.c'; else $(CYGPATH_W) '$(srcdir)/soundopenal.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-soundopenal.Tpo $(DEPDIR)/b_em-soundopenal.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='soundopenal.c' object='b_em-soundopenal.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-soundopenal.obj `if test -f 'soundopenal.c'; then $(CYGPATH_W) 'soundopenal.c'; else $(CYGPATH_W) '$(srcdir)/soundopenal.c'; fi` + +b_em-ssd.o: ssd.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-ssd.o -MD -MP -MF $(DEPDIR)/b_em-ssd.Tpo -c -o b_em-ssd.o `test -f 'ssd.c' || echo '$(srcdir)/'`ssd.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-ssd.Tpo $(DEPDIR)/b_em-ssd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ssd.c' object='b_em-ssd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-ssd.o `test -f 'ssd.c' || echo '$(srcdir)/'`ssd.c + +b_em-ssd.obj: ssd.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-ssd.obj -MD -MP -MF $(DEPDIR)/b_em-ssd.Tpo -c -o b_em-ssd.obj `if test -f 'ssd.c'; then $(CYGPATH_W) 'ssd.c'; else $(CYGPATH_W) '$(srcdir)/ssd.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-ssd.Tpo $(DEPDIR)/b_em-ssd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ssd.c' object='b_em-ssd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-ssd.obj `if test -f 'ssd.c'; then $(CYGPATH_W) 'ssd.c'; else $(CYGPATH_W) '$(srcdir)/ssd.c'; fi` + +b_em-sysvia.o: sysvia.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-sysvia.o -MD -MP -MF $(DEPDIR)/b_em-sysvia.Tpo -c -o b_em-sysvia.o `test -f 'sysvia.c' || echo '$(srcdir)/'`sysvia.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-sysvia.Tpo $(DEPDIR)/b_em-sysvia.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sysvia.c' object='b_em-sysvia.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-sysvia.o `test -f 'sysvia.c' || echo '$(srcdir)/'`sysvia.c + +b_em-sysvia.obj: sysvia.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-sysvia.obj -MD -MP -MF $(DEPDIR)/b_em-sysvia.Tpo -c -o b_em-sysvia.obj `if test -f 'sysvia.c'; then $(CYGPATH_W) 'sysvia.c'; else $(CYGPATH_W) '$(srcdir)/sysvia.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-sysvia.Tpo $(DEPDIR)/b_em-sysvia.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sysvia.c' object='b_em-sysvia.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-sysvia.obj `if test -f 'sysvia.c'; then $(CYGPATH_W) 'sysvia.c'; else $(CYGPATH_W) '$(srcdir)/sysvia.c'; fi` + +b_em-tape.o: tape.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-tape.o -MD -MP -MF $(DEPDIR)/b_em-tape.Tpo -c -o b_em-tape.o `test -f 'tape.c' || echo '$(srcdir)/'`tape.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-tape.Tpo $(DEPDIR)/b_em-tape.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tape.c' object='b_em-tape.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-tape.o `test -f 'tape.c' || echo '$(srcdir)/'`tape.c + +b_em-tape.obj: tape.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-tape.obj -MD -MP -MF $(DEPDIR)/b_em-tape.Tpo -c -o b_em-tape.obj `if test -f 'tape.c'; then $(CYGPATH_W) 'tape.c'; else $(CYGPATH_W) '$(srcdir)/tape.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-tape.Tpo $(DEPDIR)/b_em-tape.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tape.c' object='b_em-tape.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-tape.obj `if test -f 'tape.c'; then $(CYGPATH_W) 'tape.c'; else $(CYGPATH_W) '$(srcdir)/tape.c'; fi` + +b_em-tapenoise.o: tapenoise.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-tapenoise.o -MD -MP -MF $(DEPDIR)/b_em-tapenoise.Tpo -c -o b_em-tapenoise.o `test -f 'tapenoise.c' || echo '$(srcdir)/'`tapenoise.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-tapenoise.Tpo $(DEPDIR)/b_em-tapenoise.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tapenoise.c' object='b_em-tapenoise.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-tapenoise.o `test -f 'tapenoise.c' || echo '$(srcdir)/'`tapenoise.c + +b_em-tapenoise.obj: tapenoise.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-tapenoise.obj -MD -MP -MF $(DEPDIR)/b_em-tapenoise.Tpo -c -o b_em-tapenoise.obj `if test -f 'tapenoise.c'; then $(CYGPATH_W) 'tapenoise.c'; else $(CYGPATH_W) '$(srcdir)/tapenoise.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-tapenoise.Tpo $(DEPDIR)/b_em-tapenoise.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tapenoise.c' object='b_em-tapenoise.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-tapenoise.obj `if test -f 'tapenoise.c'; then $(CYGPATH_W) 'tapenoise.c'; else $(CYGPATH_W) '$(srcdir)/tapenoise.c'; fi` + +b_em-tube.o: tube.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-tube.o -MD -MP -MF $(DEPDIR)/b_em-tube.Tpo -c -o b_em-tube.o `test -f 'tube.c' || echo '$(srcdir)/'`tube.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-tube.Tpo $(DEPDIR)/b_em-tube.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tube.c' object='b_em-tube.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-tube.o `test -f 'tube.c' || echo '$(srcdir)/'`tube.c + +b_em-tube.obj: tube.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-tube.obj -MD -MP -MF $(DEPDIR)/b_em-tube.Tpo -c -o b_em-tube.obj `if test -f 'tube.c'; then $(CYGPATH_W) 'tube.c'; else $(CYGPATH_W) '$(srcdir)/tube.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-tube.Tpo $(DEPDIR)/b_em-tube.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tube.c' object='b_em-tube.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-tube.obj `if test -f 'tube.c'; then $(CYGPATH_W) 'tube.c'; else $(CYGPATH_W) '$(srcdir)/tube.c'; fi` + +b_em-uef.o: uef.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-uef.o -MD -MP -MF $(DEPDIR)/b_em-uef.Tpo -c -o b_em-uef.o `test -f 'uef.c' || echo '$(srcdir)/'`uef.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-uef.Tpo $(DEPDIR)/b_em-uef.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uef.c' object='b_em-uef.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-uef.o `test -f 'uef.c' || echo '$(srcdir)/'`uef.c + +b_em-uef.obj: uef.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-uef.obj -MD -MP -MF $(DEPDIR)/b_em-uef.Tpo -c -o b_em-uef.obj `if test -f 'uef.c'; then $(CYGPATH_W) 'uef.c'; else $(CYGPATH_W) '$(srcdir)/uef.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-uef.Tpo $(DEPDIR)/b_em-uef.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uef.c' object='b_em-uef.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-uef.obj `if test -f 'uef.c'; then $(CYGPATH_W) 'uef.c'; else $(CYGPATH_W) '$(srcdir)/uef.c'; fi` + +b_em-uservia.o: uservia.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-uservia.o -MD -MP -MF $(DEPDIR)/b_em-uservia.Tpo -c -o b_em-uservia.o `test -f 'uservia.c' || echo '$(srcdir)/'`uservia.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-uservia.Tpo $(DEPDIR)/b_em-uservia.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uservia.c' object='b_em-uservia.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-uservia.o `test -f 'uservia.c' || echo '$(srcdir)/'`uservia.c + +b_em-uservia.obj: uservia.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-uservia.obj -MD -MP -MF $(DEPDIR)/b_em-uservia.Tpo -c -o b_em-uservia.obj `if test -f 'uservia.c'; then $(CYGPATH_W) 'uservia.c'; else $(CYGPATH_W) '$(srcdir)/uservia.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-uservia.Tpo $(DEPDIR)/b_em-uservia.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uservia.c' object='b_em-uservia.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-uservia.obj `if test -f 'uservia.c'; then $(CYGPATH_W) 'uservia.c'; else $(CYGPATH_W) '$(srcdir)/uservia.c'; fi` + +b_em-via.o: via.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-via.o -MD -MP -MF $(DEPDIR)/b_em-via.Tpo -c -o b_em-via.o `test -f 'via.c' || echo '$(srcdir)/'`via.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-via.Tpo $(DEPDIR)/b_em-via.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='via.c' object='b_em-via.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-via.o `test -f 'via.c' || echo '$(srcdir)/'`via.c + +b_em-via.obj: via.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-via.obj -MD -MP -MF $(DEPDIR)/b_em-via.Tpo -c -o b_em-via.obj `if test -f 'via.c'; then $(CYGPATH_W) 'via.c'; else $(CYGPATH_W) '$(srcdir)/via.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-via.Tpo $(DEPDIR)/b_em-via.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='via.c' object='b_em-via.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-via.obj `if test -f 'via.c'; then $(CYGPATH_W) 'via.c'; else $(CYGPATH_W) '$(srcdir)/via.c'; fi` + +b_em-vidalleg.o: vidalleg.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-vidalleg.o -MD -MP -MF $(DEPDIR)/b_em-vidalleg.Tpo -c -o b_em-vidalleg.o `test -f 'vidalleg.c' || echo '$(srcdir)/'`vidalleg.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-vidalleg.Tpo $(DEPDIR)/b_em-vidalleg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='vidalleg.c' object='b_em-vidalleg.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-vidalleg.o `test -f 'vidalleg.c' || echo '$(srcdir)/'`vidalleg.c + +b_em-vidalleg.obj: vidalleg.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-vidalleg.obj -MD -MP -MF $(DEPDIR)/b_em-vidalleg.Tpo -c -o b_em-vidalleg.obj `if test -f 'vidalleg.c'; then $(CYGPATH_W) 'vidalleg.c'; else $(CYGPATH_W) '$(srcdir)/vidalleg.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-vidalleg.Tpo $(DEPDIR)/b_em-vidalleg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='vidalleg.c' object='b_em-vidalleg.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-vidalleg.obj `if test -f 'vidalleg.c'; then $(CYGPATH_W) 'vidalleg.c'; else $(CYGPATH_W) '$(srcdir)/vidalleg.c'; fi` + +b_em-video.o: video.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-video.o -MD -MP -MF $(DEPDIR)/b_em-video.Tpo -c -o b_em-video.o `test -f 'video.c' || echo '$(srcdir)/'`video.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-video.Tpo $(DEPDIR)/b_em-video.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='video.c' object='b_em-video.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-video.o `test -f 'video.c' || echo '$(srcdir)/'`video.c + +b_em-video.obj: video.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-video.obj -MD -MP -MF $(DEPDIR)/b_em-video.Tpo -c -o b_em-video.obj `if test -f 'video.c'; then $(CYGPATH_W) 'video.c'; else $(CYGPATH_W) '$(srcdir)/video.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-video.Tpo $(DEPDIR)/b_em-video.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='video.c' object='b_em-video.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-video.obj `if test -f 'video.c'; then $(CYGPATH_W) 'video.c'; else $(CYGPATH_W) '$(srcdir)/video.c'; fi` + +b_em-wd1770.o: wd1770.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-wd1770.o -MD -MP -MF $(DEPDIR)/b_em-wd1770.Tpo -c -o b_em-wd1770.o `test -f 'wd1770.c' || echo '$(srcdir)/'`wd1770.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-wd1770.Tpo $(DEPDIR)/b_em-wd1770.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wd1770.c' object='b_em-wd1770.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-wd1770.o `test -f 'wd1770.c' || echo '$(srcdir)/'`wd1770.c + +b_em-wd1770.obj: wd1770.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-wd1770.obj -MD -MP -MF $(DEPDIR)/b_em-wd1770.Tpo -c -o b_em-wd1770.obj `if test -f 'wd1770.c'; then $(CYGPATH_W) 'wd1770.c'; else $(CYGPATH_W) '$(srcdir)/wd1770.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-wd1770.Tpo $(DEPDIR)/b_em-wd1770.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wd1770.c' object='b_em-wd1770.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-wd1770.obj `if test -f 'wd1770.c'; then $(CYGPATH_W) 'wd1770.c'; else $(CYGPATH_W) '$(srcdir)/wd1770.c'; fi` + +b_em-x86.o: x86.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-x86.o -MD -MP -MF $(DEPDIR)/b_em-x86.Tpo -c -o b_em-x86.o `test -f 'x86.c' || echo '$(srcdir)/'`x86.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-x86.Tpo $(DEPDIR)/b_em-x86.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='x86.c' object='b_em-x86.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-x86.o `test -f 'x86.c' || echo '$(srcdir)/'`x86.c + +b_em-x86.obj: x86.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-x86.obj -MD -MP -MF $(DEPDIR)/b_em-x86.Tpo -c -o b_em-x86.obj `if test -f 'x86.c'; then $(CYGPATH_W) 'x86.c'; else $(CYGPATH_W) '$(srcdir)/x86.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-x86.Tpo $(DEPDIR)/b_em-x86.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='x86.c' object='b_em-x86.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-x86.obj `if test -f 'x86.c'; then $(CYGPATH_W) 'x86.c'; else $(CYGPATH_W) '$(srcdir)/x86.c'; fi` + +b_em-Z80.o: Z80.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-Z80.o -MD -MP -MF $(DEPDIR)/b_em-Z80.Tpo -c -o b_em-Z80.o `test -f 'Z80.c' || echo '$(srcdir)/'`Z80.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-Z80.Tpo $(DEPDIR)/b_em-Z80.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Z80.c' object='b_em-Z80.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-Z80.o `test -f 'Z80.c' || echo '$(srcdir)/'`Z80.c + +b_em-Z80.obj: Z80.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -MT b_em-Z80.obj -MD -MP -MF $(DEPDIR)/b_em-Z80.Tpo -c -o b_em-Z80.obj `if test -f 'Z80.c'; then $(CYGPATH_W) 'Z80.c'; else $(CYGPATH_W) '$(srcdir)/Z80.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/b_em-Z80.Tpo $(DEPDIR)/b_em-Z80.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Z80.c' object='b_em-Z80.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(b_em_CFLAGS) $(CFLAGS) -c -o b_em-Z80.obj `if test -f 'Z80.c'; then $(CYGPATH_W) 'Z80.c'; else $(CYGPATH_W) '$(srcdir)/Z80.c'; fi` + +.cc.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +convolve.o: resid-fp/convolve.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT convolve.o -MD -MP -MF $(DEPDIR)/convolve.Tpo -c -o convolve.o `test -f 'resid-fp/convolve.cc' || echo '$(srcdir)/'`resid-fp/convolve.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/convolve.Tpo $(DEPDIR)/convolve.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/convolve.cc' object='convolve.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o convolve.o `test -f 'resid-fp/convolve.cc' || echo '$(srcdir)/'`resid-fp/convolve.cc + +convolve.obj: resid-fp/convolve.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT convolve.obj -MD -MP -MF $(DEPDIR)/convolve.Tpo -c -o convolve.obj `if test -f 'resid-fp/convolve.cc'; then $(CYGPATH_W) 'resid-fp/convolve.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/convolve.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/convolve.Tpo $(DEPDIR)/convolve.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/convolve.cc' object='convolve.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o convolve.obj `if test -f 'resid-fp/convolve.cc'; then $(CYGPATH_W) 'resid-fp/convolve.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/convolve.cc'; fi` + +convolve-sse.o: resid-fp/convolve-sse.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT convolve-sse.o -MD -MP -MF $(DEPDIR)/convolve-sse.Tpo -c -o convolve-sse.o `test -f 'resid-fp/convolve-sse.cc' || echo '$(srcdir)/'`resid-fp/convolve-sse.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/convolve-sse.Tpo $(DEPDIR)/convolve-sse.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/convolve-sse.cc' object='convolve-sse.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o convolve-sse.o `test -f 'resid-fp/convolve-sse.cc' || echo '$(srcdir)/'`resid-fp/convolve-sse.cc + +convolve-sse.obj: resid-fp/convolve-sse.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT convolve-sse.obj -MD -MP -MF $(DEPDIR)/convolve-sse.Tpo -c -o convolve-sse.obj `if test -f 'resid-fp/convolve-sse.cc'; then $(CYGPATH_W) 'resid-fp/convolve-sse.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/convolve-sse.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/convolve-sse.Tpo $(DEPDIR)/convolve-sse.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/convolve-sse.cc' object='convolve-sse.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o convolve-sse.obj `if test -f 'resid-fp/convolve-sse.cc'; then $(CYGPATH_W) 'resid-fp/convolve-sse.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/convolve-sse.cc'; fi` + +envelope.o: resid-fp/envelope.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT envelope.o -MD -MP -MF $(DEPDIR)/envelope.Tpo -c -o envelope.o `test -f 'resid-fp/envelope.cc' || echo '$(srcdir)/'`resid-fp/envelope.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/envelope.Tpo $(DEPDIR)/envelope.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/envelope.cc' object='envelope.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o envelope.o `test -f 'resid-fp/envelope.cc' || echo '$(srcdir)/'`resid-fp/envelope.cc + +envelope.obj: resid-fp/envelope.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT envelope.obj -MD -MP -MF $(DEPDIR)/envelope.Tpo -c -o envelope.obj `if test -f 'resid-fp/envelope.cc'; then $(CYGPATH_W) 'resid-fp/envelope.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/envelope.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/envelope.Tpo $(DEPDIR)/envelope.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/envelope.cc' object='envelope.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o envelope.obj `if test -f 'resid-fp/envelope.cc'; then $(CYGPATH_W) 'resid-fp/envelope.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/envelope.cc'; fi` + +extfilt.o: resid-fp/extfilt.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT extfilt.o -MD -MP -MF $(DEPDIR)/extfilt.Tpo -c -o extfilt.o `test -f 'resid-fp/extfilt.cc' || echo '$(srcdir)/'`resid-fp/extfilt.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/extfilt.Tpo $(DEPDIR)/extfilt.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/extfilt.cc' object='extfilt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o extfilt.o `test -f 'resid-fp/extfilt.cc' || echo '$(srcdir)/'`resid-fp/extfilt.cc + +extfilt.obj: resid-fp/extfilt.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT extfilt.obj -MD -MP -MF $(DEPDIR)/extfilt.Tpo -c -o extfilt.obj `if test -f 'resid-fp/extfilt.cc'; then $(CYGPATH_W) 'resid-fp/extfilt.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/extfilt.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/extfilt.Tpo $(DEPDIR)/extfilt.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/extfilt.cc' object='extfilt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o extfilt.obj `if test -f 'resid-fp/extfilt.cc'; then $(CYGPATH_W) 'resid-fp/extfilt.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/extfilt.cc'; fi` + +filter.o: resid-fp/filter.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT filter.o -MD -MP -MF $(DEPDIR)/filter.Tpo -c -o filter.o `test -f 'resid-fp/filter.cc' || echo '$(srcdir)/'`resid-fp/filter.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/filter.Tpo $(DEPDIR)/filter.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/filter.cc' object='filter.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o filter.o `test -f 'resid-fp/filter.cc' || echo '$(srcdir)/'`resid-fp/filter.cc + +filter.obj: resid-fp/filter.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT filter.obj -MD -MP -MF $(DEPDIR)/filter.Tpo -c -o filter.obj `if test -f 'resid-fp/filter.cc'; then $(CYGPATH_W) 'resid-fp/filter.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/filter.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/filter.Tpo $(DEPDIR)/filter.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/filter.cc' object='filter.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o filter.obj `if test -f 'resid-fp/filter.cc'; then $(CYGPATH_W) 'resid-fp/filter.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/filter.cc'; fi` + +pot.o: resid-fp/pot.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT pot.o -MD -MP -MF $(DEPDIR)/pot.Tpo -c -o pot.o `test -f 'resid-fp/pot.cc' || echo '$(srcdir)/'`resid-fp/pot.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/pot.Tpo $(DEPDIR)/pot.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/pot.cc' object='pot.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o pot.o `test -f 'resid-fp/pot.cc' || echo '$(srcdir)/'`resid-fp/pot.cc + +pot.obj: resid-fp/pot.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT pot.obj -MD -MP -MF $(DEPDIR)/pot.Tpo -c -o pot.obj `if test -f 'resid-fp/pot.cc'; then $(CYGPATH_W) 'resid-fp/pot.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/pot.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/pot.Tpo $(DEPDIR)/pot.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/pot.cc' object='pot.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o pot.obj `if test -f 'resid-fp/pot.cc'; then $(CYGPATH_W) 'resid-fp/pot.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/pot.cc'; fi` + +sid.o: resid-fp/sid.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sid.o -MD -MP -MF $(DEPDIR)/sid.Tpo -c -o sid.o `test -f 'resid-fp/sid.cc' || echo '$(srcdir)/'`resid-fp/sid.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/sid.Tpo $(DEPDIR)/sid.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/sid.cc' object='sid.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sid.o `test -f 'resid-fp/sid.cc' || echo '$(srcdir)/'`resid-fp/sid.cc + +sid.obj: resid-fp/sid.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sid.obj -MD -MP -MF $(DEPDIR)/sid.Tpo -c -o sid.obj `if test -f 'resid-fp/sid.cc'; then $(CYGPATH_W) 'resid-fp/sid.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/sid.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/sid.Tpo $(DEPDIR)/sid.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/sid.cc' object='sid.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sid.obj `if test -f 'resid-fp/sid.cc'; then $(CYGPATH_W) 'resid-fp/sid.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/sid.cc'; fi` + +voice.o: resid-fp/voice.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT voice.o -MD -MP -MF $(DEPDIR)/voice.Tpo -c -o voice.o `test -f 'resid-fp/voice.cc' || echo '$(srcdir)/'`resid-fp/voice.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/voice.Tpo $(DEPDIR)/voice.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/voice.cc' object='voice.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o voice.o `test -f 'resid-fp/voice.cc' || echo '$(srcdir)/'`resid-fp/voice.cc + +voice.obj: resid-fp/voice.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT voice.obj -MD -MP -MF $(DEPDIR)/voice.Tpo -c -o voice.obj `if test -f 'resid-fp/voice.cc'; then $(CYGPATH_W) 'resid-fp/voice.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/voice.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/voice.Tpo $(DEPDIR)/voice.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/voice.cc' object='voice.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o voice.obj `if test -f 'resid-fp/voice.cc'; then $(CYGPATH_W) 'resid-fp/voice.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/voice.cc'; fi` + +wave6581_PS_.o: resid-fp/wave6581_PS_.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave6581_PS_.o -MD -MP -MF $(DEPDIR)/wave6581_PS_.Tpo -c -o wave6581_PS_.o `test -f 'resid-fp/wave6581_PS_.cc' || echo '$(srcdir)/'`resid-fp/wave6581_PS_.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/wave6581_PS_.Tpo $(DEPDIR)/wave6581_PS_.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/wave6581_PS_.cc' object='wave6581_PS_.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave6581_PS_.o `test -f 'resid-fp/wave6581_PS_.cc' || echo '$(srcdir)/'`resid-fp/wave6581_PS_.cc + +wave6581_PS_.obj: resid-fp/wave6581_PS_.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave6581_PS_.obj -MD -MP -MF $(DEPDIR)/wave6581_PS_.Tpo -c -o wave6581_PS_.obj `if test -f 'resid-fp/wave6581_PS_.cc'; then $(CYGPATH_W) 'resid-fp/wave6581_PS_.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave6581_PS_.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/wave6581_PS_.Tpo $(DEPDIR)/wave6581_PS_.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/wave6581_PS_.cc' object='wave6581_PS_.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave6581_PS_.obj `if test -f 'resid-fp/wave6581_PS_.cc'; then $(CYGPATH_W) 'resid-fp/wave6581_PS_.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave6581_PS_.cc'; fi` + +wave6581_PST.o: resid-fp/wave6581_PST.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave6581_PST.o -MD -MP -MF $(DEPDIR)/wave6581_PST.Tpo -c -o wave6581_PST.o `test -f 'resid-fp/wave6581_PST.cc' || echo '$(srcdir)/'`resid-fp/wave6581_PST.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/wave6581_PST.Tpo $(DEPDIR)/wave6581_PST.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/wave6581_PST.cc' object='wave6581_PST.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave6581_PST.o `test -f 'resid-fp/wave6581_PST.cc' || echo '$(srcdir)/'`resid-fp/wave6581_PST.cc + +wave6581_PST.obj: resid-fp/wave6581_PST.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave6581_PST.obj -MD -MP -MF $(DEPDIR)/wave6581_PST.Tpo -c -o wave6581_PST.obj `if test -f 'resid-fp/wave6581_PST.cc'; then $(CYGPATH_W) 'resid-fp/wave6581_PST.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave6581_PST.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/wave6581_PST.Tpo $(DEPDIR)/wave6581_PST.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/wave6581_PST.cc' object='wave6581_PST.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave6581_PST.obj `if test -f 'resid-fp/wave6581_PST.cc'; then $(CYGPATH_W) 'resid-fp/wave6581_PST.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave6581_PST.cc'; fi` + +wave6581_P_T.o: resid-fp/wave6581_P_T.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave6581_P_T.o -MD -MP -MF $(DEPDIR)/wave6581_P_T.Tpo -c -o wave6581_P_T.o `test -f 'resid-fp/wave6581_P_T.cc' || echo '$(srcdir)/'`resid-fp/wave6581_P_T.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/wave6581_P_T.Tpo $(DEPDIR)/wave6581_P_T.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/wave6581_P_T.cc' object='wave6581_P_T.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave6581_P_T.o `test -f 'resid-fp/wave6581_P_T.cc' || echo '$(srcdir)/'`resid-fp/wave6581_P_T.cc + +wave6581_P_T.obj: resid-fp/wave6581_P_T.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave6581_P_T.obj -MD -MP -MF $(DEPDIR)/wave6581_P_T.Tpo -c -o wave6581_P_T.obj `if test -f 'resid-fp/wave6581_P_T.cc'; then $(CYGPATH_W) 'resid-fp/wave6581_P_T.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave6581_P_T.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/wave6581_P_T.Tpo $(DEPDIR)/wave6581_P_T.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/wave6581_P_T.cc' object='wave6581_P_T.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave6581_P_T.obj `if test -f 'resid-fp/wave6581_P_T.cc'; then $(CYGPATH_W) 'resid-fp/wave6581_P_T.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave6581_P_T.cc'; fi` + +wave6581__ST.o: resid-fp/wave6581__ST.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave6581__ST.o -MD -MP -MF $(DEPDIR)/wave6581__ST.Tpo -c -o wave6581__ST.o `test -f 'resid-fp/wave6581__ST.cc' || echo '$(srcdir)/'`resid-fp/wave6581__ST.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/wave6581__ST.Tpo $(DEPDIR)/wave6581__ST.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/wave6581__ST.cc' object='wave6581__ST.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave6581__ST.o `test -f 'resid-fp/wave6581__ST.cc' || echo '$(srcdir)/'`resid-fp/wave6581__ST.cc + +wave6581__ST.obj: resid-fp/wave6581__ST.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave6581__ST.obj -MD -MP -MF $(DEPDIR)/wave6581__ST.Tpo -c -o wave6581__ST.obj `if test -f 'resid-fp/wave6581__ST.cc'; then $(CYGPATH_W) 'resid-fp/wave6581__ST.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave6581__ST.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/wave6581__ST.Tpo $(DEPDIR)/wave6581__ST.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/wave6581__ST.cc' object='wave6581__ST.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave6581__ST.obj `if test -f 'resid-fp/wave6581__ST.cc'; then $(CYGPATH_W) 'resid-fp/wave6581__ST.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave6581__ST.cc'; fi` + +wave8580_PS_.o: resid-fp/wave8580_PS_.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave8580_PS_.o -MD -MP -MF $(DEPDIR)/wave8580_PS_.Tpo -c -o wave8580_PS_.o `test -f 'resid-fp/wave8580_PS_.cc' || echo '$(srcdir)/'`resid-fp/wave8580_PS_.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/wave8580_PS_.Tpo $(DEPDIR)/wave8580_PS_.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/wave8580_PS_.cc' object='wave8580_PS_.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave8580_PS_.o `test -f 'resid-fp/wave8580_PS_.cc' || echo '$(srcdir)/'`resid-fp/wave8580_PS_.cc + +wave8580_PS_.obj: resid-fp/wave8580_PS_.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave8580_PS_.obj -MD -MP -MF $(DEPDIR)/wave8580_PS_.Tpo -c -o wave8580_PS_.obj `if test -f 'resid-fp/wave8580_PS_.cc'; then $(CYGPATH_W) 'resid-fp/wave8580_PS_.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave8580_PS_.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/wave8580_PS_.Tpo $(DEPDIR)/wave8580_PS_.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/wave8580_PS_.cc' object='wave8580_PS_.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave8580_PS_.obj `if test -f 'resid-fp/wave8580_PS_.cc'; then $(CYGPATH_W) 'resid-fp/wave8580_PS_.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave8580_PS_.cc'; fi` + +wave8580_PST.o: resid-fp/wave8580_PST.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave8580_PST.o -MD -MP -MF $(DEPDIR)/wave8580_PST.Tpo -c -o wave8580_PST.o `test -f 'resid-fp/wave8580_PST.cc' || echo '$(srcdir)/'`resid-fp/wave8580_PST.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/wave8580_PST.Tpo $(DEPDIR)/wave8580_PST.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/wave8580_PST.cc' object='wave8580_PST.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave8580_PST.o `test -f 'resid-fp/wave8580_PST.cc' || echo '$(srcdir)/'`resid-fp/wave8580_PST.cc + +wave8580_PST.obj: resid-fp/wave8580_PST.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave8580_PST.obj -MD -MP -MF $(DEPDIR)/wave8580_PST.Tpo -c -o wave8580_PST.obj `if test -f 'resid-fp/wave8580_PST.cc'; then $(CYGPATH_W) 'resid-fp/wave8580_PST.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave8580_PST.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/wave8580_PST.Tpo $(DEPDIR)/wave8580_PST.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/wave8580_PST.cc' object='wave8580_PST.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave8580_PST.obj `if test -f 'resid-fp/wave8580_PST.cc'; then $(CYGPATH_W) 'resid-fp/wave8580_PST.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave8580_PST.cc'; fi` + +wave8580_P_T.o: resid-fp/wave8580_P_T.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave8580_P_T.o -MD -MP -MF $(DEPDIR)/wave8580_P_T.Tpo -c -o wave8580_P_T.o `test -f 'resid-fp/wave8580_P_T.cc' || echo '$(srcdir)/'`resid-fp/wave8580_P_T.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/wave8580_P_T.Tpo $(DEPDIR)/wave8580_P_T.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/wave8580_P_T.cc' object='wave8580_P_T.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave8580_P_T.o `test -f 'resid-fp/wave8580_P_T.cc' || echo '$(srcdir)/'`resid-fp/wave8580_P_T.cc + +wave8580_P_T.obj: resid-fp/wave8580_P_T.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave8580_P_T.obj -MD -MP -MF $(DEPDIR)/wave8580_P_T.Tpo -c -o wave8580_P_T.obj `if test -f 'resid-fp/wave8580_P_T.cc'; then $(CYGPATH_W) 'resid-fp/wave8580_P_T.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave8580_P_T.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/wave8580_P_T.Tpo $(DEPDIR)/wave8580_P_T.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/wave8580_P_T.cc' object='wave8580_P_T.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave8580_P_T.obj `if test -f 'resid-fp/wave8580_P_T.cc'; then $(CYGPATH_W) 'resid-fp/wave8580_P_T.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave8580_P_T.cc'; fi` + +wave8580__ST.o: resid-fp/wave8580__ST.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave8580__ST.o -MD -MP -MF $(DEPDIR)/wave8580__ST.Tpo -c -o wave8580__ST.o `test -f 'resid-fp/wave8580__ST.cc' || echo '$(srcdir)/'`resid-fp/wave8580__ST.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/wave8580__ST.Tpo $(DEPDIR)/wave8580__ST.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/wave8580__ST.cc' object='wave8580__ST.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave8580__ST.o `test -f 'resid-fp/wave8580__ST.cc' || echo '$(srcdir)/'`resid-fp/wave8580__ST.cc + +wave8580__ST.obj: resid-fp/wave8580__ST.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave8580__ST.obj -MD -MP -MF $(DEPDIR)/wave8580__ST.Tpo -c -o wave8580__ST.obj `if test -f 'resid-fp/wave8580__ST.cc'; then $(CYGPATH_W) 'resid-fp/wave8580__ST.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave8580__ST.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/wave8580__ST.Tpo $(DEPDIR)/wave8580__ST.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/wave8580__ST.cc' object='wave8580__ST.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave8580__ST.obj `if test -f 'resid-fp/wave8580__ST.cc'; then $(CYGPATH_W) 'resid-fp/wave8580__ST.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave8580__ST.cc'; fi` + +wave.o: resid-fp/wave.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave.o -MD -MP -MF $(DEPDIR)/wave.Tpo -c -o wave.o `test -f 'resid-fp/wave.cc' || echo '$(srcdir)/'`resid-fp/wave.cc +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/wave.Tpo $(DEPDIR)/wave.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/wave.cc' object='wave.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave.o `test -f 'resid-fp/wave.cc' || echo '$(srcdir)/'`resid-fp/wave.cc + +wave.obj: resid-fp/wave.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT wave.obj -MD -MP -MF $(DEPDIR)/wave.Tpo -c -o wave.obj `if test -f 'resid-fp/wave.cc'; then $(CYGPATH_W) 'resid-fp/wave.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave.cc'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/wave.Tpo $(DEPDIR)/wave.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='resid-fp/wave.cc' object='wave.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o wave.obj `if test -f 'resid-fp/wave.cc'; then $(CYGPATH_W) 'resid-fp/wave.cc'; else $(CYGPATH_W) '$(srcdir)/resid-fp/wave.cc'; fi` + +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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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) $(SCRIPTS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS + + +../b-em: b-em + cp b-em .. + +amrefresh: + +# 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: diff --git a/src/Makefile.mingw b/src/Makefile.mingw new file mode 100644 index 00000000..be47ec4d --- /dev/null +++ b/src/Makefile.mingw @@ -0,0 +1,28 @@ +VPATH = . resid-fp +CPP = g++.exe +CC = gcc.exe +WINDRES = windres.exe +CFLAGS = -O3 +OBJ = 6502.o 6502tube.o 32016.o 65816.o acia.o adc.o adf.o arm.o cmos.o compact_joystick.o compactcmos.o config.o csw.o ddnoise.o debugger.o disc.o fdi2raw.o fdi.o i8271.o ide.o keyboard.o main.o mem.o model.o mouse.o pal.o savestate.o serial.o sn76489.o sound.o soundopenal.o ssd.o sysvia.o tape.o tapenoise.o tube.o uef.o uservia.o via.o vidalleg.o video.o wd1770.o win.o win-catalogue.o win-keydefine.o x86.o z80.o resid.o b-em.res +SIDOBJ = convolve.o envelope.o extfilt.o filter.o pot.o sid.o voice.o wave6581__ST.o wave6581_P_T.o wave6581_PS_.o wave6581_PST.o wave8580__ST.o wave8580_P_T.o wave8580_PS_.o wave8580_PST.o wave.o + +LIBS = -mwindows -lalleg -lz -lalut -lopenal32 -lgdi32 -lwinmm -lstdc++ + +b-em.exe: $(OBJ) $(SIDOBJ) + $(CC) $(OBJ) $(SIDOBJ) -o "b-em.exe" $(LIBS) + +all : b-em.exe + +clean : + del *.o + del *.exe + del *.res + +%.o : %.c + $(CC) $(CFLAGS) -c $< + +%.o : %.cc + $(CPP) $(CFLAGS) -c $< + +b-em.res: b-em.rc + $(WINDRES) -i b-em.rc --input-format=rc -o b-em.res -O coff \ No newline at end of file diff --git a/src/z80.c b/src/Z80.c similarity index 95% rename from src/z80.c rename to src/Z80.c index 49196790..dd6d8335 100644 --- a/src/z80.c +++ b/src/Z80.c @@ -1,2864 +1,2864 @@ -/*B-em v2.2 by Tom Walker - Z80 emulation - I can't remember what emulator I originally wrote this for... probably ZX82 - I think a few bugs left*/ - -#include -#include - -#include "b-em.h" -#include "tube.h" -#include "z80.h" -#include "daa.h" - -#define pc z80pc -#define ins z80ins -#define output z80output -#define cyc z80cyc -#define cycles z80cycles - -#define printf rpclog - -/*CPU*/ -typedef union -{ - uint16_t w; - struct - { - uint8_t l,h; - } b; -} z80reg; - -static z80reg af,bc,de,hl,ix,iy,ir,saf,sbc,sde,shl; -static uint16_t pc,sp; -static int iff1,iff2; -static int z80int; -static int im; -static uint8_t z80ram[0x10000]; -static uint8_t z80rom[4096]; - -static int z80_oldnmi; - -#define N_FLAG 0x80 -#define Z_FLAG 0x40 -#define H_FLAG 0x10 -#define P_FLAG 0x04 -#define V_FLAG 0x04 -#define S_FLAG 0x02 -#define C_FLAG 0x01 - -static int cycles; -static uint16_t opc,oopc; -static int tempc; -static int output=0; -static int ins=0; -static uint8_t znptable[256],znptablenv[256],znptable16[65536]; -static uint8_t intreg; - -static int tuberomin; - -static inline uint8_t z80_readmem(uint16_t a) -{ -// printf("Read Z80 %04X %i\n",a,tuberomin); - if (a>=0x8000) tuberomin=0; - if (tuberomin && a<0x1000) return z80rom[a&0xFFF]; - return z80ram[a]; -} - -static inline void z80_writemem(uint16_t a, uint8_t v) -{ -// printf("Write Z80 %04X %02X %04X\n",a,v,pc); - z80ram[a]=v; -} - -int endtimeslice; -static void z80out(uint16_t a, uint8_t v) -{ - if ((a&0xFF)<8) - { -// printf("Z80 out %04X %02X\n",a,v); - tube_parasite_write(a,v); - endtimeslice=1; - } -} - -static uint8_t z80in(uint16_t a) -{ - if ((a&0xFF)<8) - { -// printf("Z80 read tube %04X\n",a); - if ((a&0xFF)==2) tuberomin=1; - if ((a&0xFF)==6) tuberomin=0; - return tube_parasite_read(a); - } - return 0; -} - -static inline void setzn(uint8_t v) -{ - af.b.l=znptable[v]; -/* af.b.l&=~(N_FLAG|Z_FLAG|V_FLAG|0x28|C_FLAG); - af.b.l|=znptable[v];*/ -} - -static inline void setand(uint8_t v) -{ - af.b.l=znptable[v]|H_FLAG; -/* af.b.l&=~(N_FLAG|Z_FLAG|V_FLAG|0x28|C_FLAG); - af.b.l|=znptable[v];*/ -} - -static inline void setbit(uint8_t v) -{ - af.b.l=((znptable[v]|H_FLAG)&0xFE)|(af.b.l&1); -} - -static inline void setbit2(uint8_t v, uint8_t v2) -{ - af.b.l=((znptable[v]|H_FLAG)&0xD6)|(af.b.l&1)|(v2&0x28); -} - -static inline void setznc(uint8_t v) -{ - af.b.l&=~(N_FLAG|Z_FLAG|V_FLAG|0x28); - af.b.l|=znptable[v]; -} - -static inline void z80_setadd(uint8_t a, uint8_t b) -{ - uint8_t r=a+b; - af.b.l = (r) ? ((r & 0x80) ? N_FLAG : 0) : Z_FLAG; - af.b.l |= (r & 0x28); /* undocumented flag bits 5+3 */ - if( (r & 0x0f) < (a & 0x0f) ) af.b.l |= H_FLAG; - if( r < a ) af.b.l |= C_FLAG; - if( (b^a^0x80) & (b^r) & 0x80 ) af.b.l |= V_FLAG; -} - -static inline void setinc(uint8_t v) -{ - af.b.l&=~(N_FLAG|Z_FLAG|V_FLAG|0x28|H_FLAG); - af.b.l|=znptable[(v+1)&0xFF]; - if (v==0x7F) af.b.l|=V_FLAG; - else af.b.l&=~V_FLAG; - if (((v&0xF)+1)&0x10) af.b.l|=H_FLAG; -} - -static inline void setdec(uint8_t v) -{ - af.b.l&=~(N_FLAG|Z_FLAG|V_FLAG|0x28|H_FLAG); - af.b.l|=znptable[(v-1)&0xFF]|S_FLAG; - if (v==0x80) af.b.l|=V_FLAG; - else af.b.l&=~V_FLAG; - if (!(v&8) && ((v-1)&8)) af.b.l|=H_FLAG; -} - -static inline void setadc(uint8_t a, uint8_t b) -{ - uint8_t r=a+b+(af.b.l&C_FLAG); - if (af.b.l&C_FLAG) - { - af.b.l = (r) ? ((r & 0x80) ? N_FLAG : 0) : Z_FLAG; - af.b.l |= (r & 0x28); /* undocumented flag bits 5+3 */ - if( (r & 0x0f) <= (a & 0x0f) ) af.b.l |= H_FLAG; - if( r <= a ) af.b.l |= C_FLAG; - if( (b^a^0x80) & (b^r) & 0x80 ) af.b.l |= V_FLAG; - } - else - { - af.b.l = (r) ? ((r & 0x80) ? N_FLAG : 0) : Z_FLAG; - af.b.l |= (r & 0x28); /* undocumented flag bits 5+3 */ - if( (r & 0x0f) < (a & 0x0f) ) af.b.l |= H_FLAG; - if( r < a ) af.b.l |= C_FLAG; - if( (b^a^0x80) & (b^r) & 0x80 ) af.b.l |= V_FLAG; - } -} - -static inline void setadc16(uint16_t a, uint16_t b) -{ - uint32_t r=a+b+(af.b.l&1); - af.b.l = (((a ^ r ^ b) >> 8) & H_FLAG) | - ((r >> 16) & C_FLAG) | - ((r >> 8) & (N_FLAG | 0x28)) | - ((r & 0xffff) ? 0 : Z_FLAG) | - (((b ^ a ^ 0x8000) & (b ^ r) & 0x8000) >> 13); -} - -static inline void z80_setadd16(uint16_t a, uint16_t b) -{ - uint32_t r=a+b; - af.b.l = (af.b.l & (N_FLAG | Z_FLAG | V_FLAG)) | - (((a ^ r ^ b) >> 8) & H_FLAG) | - ((r >> 16) & C_FLAG) | ((r >> 8) & 0x28); -} - -static inline void setsbc(uint8_t a, uint8_t b) -{ - uint8_t r=a-(b+(af.b.l&C_FLAG)); - if (af.b.l&C_FLAG) - { - af.b.l = S_FLAG | ((r) ? ((r & 0x80) ? N_FLAG : 0) : Z_FLAG); - af.b.l |= (r & 0x28); /* undocumented flag bits 5+3 */ - if( (r & 0x0f) >= (a & 0x0f) ) af.b.l |= H_FLAG; - if( r >= a ) af.b.l |= C_FLAG; - if( (b^a) & (a^r) & 0x80 ) af.b.l |= V_FLAG; - } - else - { - af.b.l = S_FLAG | ((r) ? ((r & 0x80) ? N_FLAG : 0) : Z_FLAG); - af.b.l |= (r & 0x28); /* undocumented flag bits 5+3 */ - if( (r & 0x0f) > (a & 0x0f) ) af.b.l |= H_FLAG; - if( r > a ) af.b.l |= C_FLAG; - if( (b^a) & (a^r) & 0x80 ) af.b.l |= V_FLAG; - } -} - -static inline void setsbc16(uint16_t a, uint16_t b) -{ - uint32_t r = a - b - (af.b.l & C_FLAG); - af.b.l = (((a ^ r ^ b) >> 8) & H_FLAG) | S_FLAG | - ((r >> 16) & C_FLAG) | - ((r >> 8) & (N_FLAG | 0x28)) | - ((r & 0xffff) ? 0 : Z_FLAG) | - (((b ^ a) & (a ^ r) &0x8000) >> 13); -} - -static inline void setcpED(uint8_t a, uint8_t b) -{ - uint8_t r=a-b; - af.b.l&=C_FLAG; - af.b.l |= S_FLAG | ((r) ? ((r & 0x80) ? N_FLAG : 0) : Z_FLAG); - af.b.l |= (b & 0x28); /* undocumented flag bits 5+3 */ - if( (r & 0x0f) > (a & 0x0f) ) af.b.l |= H_FLAG; - if( (b^a) & (a^r) & 0x80 ) af.b.l |= V_FLAG; -} - -static inline void setcp(uint8_t a, uint8_t b) -{ - uint8_t r=a-b; - af.b.l = S_FLAG | ((r) ? ((r & 0x80) ? N_FLAG : 0) : Z_FLAG); - af.b.l |= (b & 0x28); /* undocumented flag bits 5+3 */ - if( (r & 0x0f) > (a & 0x0f) ) af.b.l |= H_FLAG; - if( r > a ) af.b.l |= C_FLAG; - if( (b^a) & (a^r) & 0x80 ) af.b.l |= V_FLAG; -} - -static inline void z80_setsub(uint8_t a, uint8_t b) -{ - uint8_t r=a-b; - af.b.l = S_FLAG | ((r) ? ((r & 0x80) ? N_FLAG : 0) : Z_FLAG); - af.b.l |= (r & 0x28); /* undocumented flag bits 5+3 */ - if( (r & 0x0f) > (a & 0x0f) ) af.b.l |= H_FLAG; - if( r > a ) af.b.l |= C_FLAG; - if( (b^a) & (a^r) & 0x80 ) af.b.l |= V_FLAG; -} - -static void makeznptable() -{ - int c,d,e,f,g; - for (c=0;c<256;c++) - { -// d|=(c&0xA8); - e=c; - f=0; - for (g=0;g<8;g++) - { - if (e&1) f++; - e>>=1; - } - d=c ? (c&N_FLAG) : Z_FLAG; - d|=(c&0x28); - d|=(f&1)?0:V_FLAG; -/* if (!(f&1)) - d|=4;*/ - znptable[c]=d; - znptablenv[c]=d&~V_FLAG; - } -// znptable[0]|=0x40; - for (c=0;c<65536;c++) - { - d=0; - if (c&0x8000) d|=0x80; - e=c; - f=0; - for (g=0;g<16;g++) - { - if (e&1) f++; - e>>=1; - } - if (!(f&1)) - d|=4; - znptable16[c]=d; - } - znptable16[0]|=0x40; -} - -void z80_init() -{ - FILE *f; - char fn[512]; - append_filename(fn,exedir,"roms/tube/Z80_120.rom",511); - f=fopen(fn,"rb"); - fread(z80rom,0x1000,1,f); - fclose(f); - makeznptable(); -} - -void z80_close() -{ -} - -void z80_dumpregs() -{ - printf("AF =%04X BC =%04X DE =%04X HL =%04X IX=%04X IY=%04X\n",af.w,bc.w,de.w,hl.w,ix.w,iy.w); - printf("AF'=%04X BC'=%04X DE'=%04X HL'=%04X IR=%04X\n",saf.w,sbc.w,sde.w,shl.w,ir.w); - printf("%c%c%c%c%c%c PC =%04X SP =%04X\n",(af.b.l&N_FLAG)?'N':' ',(af.b.l&Z_FLAG)?'Z':' ',(af.b.l&H_FLAG)?'H':' ',(af.b.l&V_FLAG)?'V':' ',(af.b.l&S_FLAG)?'S':' ',(af.b.l&C_FLAG)?'C':' ',pc,sp); - printf("%i ins IFF1=%i IFF2=%i %04X %04X\n",ins,iff1,iff2,opc,oopc); -// error(s); -} - -void z80_mem_dump() -{ - FILE *f=fopen("z80ram.dmp","wb"); - fwrite(z80ram,0x10000,1,f); - fclose(f); -// atexit(z80_dumpregs); -} - -void z80_reset() -{ - pc=0; -// atexit(z80_mem_dump); - tuberomin=1; -} - -static uint16_t oopc,opc; - -void z80_exec() -{ - uint8_t opcode,temp; - uint16_t addr; - int enterint=0; -// tubecycles+=(cy<<1); - while (tubecycles>0) - { - oopc=opc; - opc=pc; - if ((tube_irq&1) && iff1) enterint=1; - cycles=0; - tempc=af.b.l&C_FLAG; - opcode=z80_readmem(pc++); - ir.b.l=((ir.b.l+1)&0x7F)|(ir.b.l&0x80); - switch (opcode) - { - case 0x00: /*NOP*/ - cycles+=4; -// printf("NOP!\n"); -// z80_dumpregs(); -// exit(-1); - break; - case 0x01: /*LD BC,nn*/ - cycles+=4; bc.b.l=z80_readmem(pc++); - cycles+=3; bc.b.h=z80_readmem(pc++); - cycles+=3; - break; - case 0x02: /*LD (BC),A*/ - cycles+=4; z80_writemem(bc.w,af.b.h); - cycles+=3; - break; - case 0x03: /*INC BC*/ - bc.w++; - cycles+=6; - break; - case 0x04: /*INC B*/ - setinc(bc.b.h); - bc.b.h++; - cycles+=4; - break; - case 0x05: /*DEC B*/ - setdec(bc.b.h); - bc.b.h--; - cycles+=4; - break; - case 0x06: /*LD B,nn*/ - cycles+=4; bc.b.h=z80_readmem(pc++); - cycles+=3; - break; - case 0x07: /*RLCA*/ - temp=af.b.h&0x80; - af.b.h<<=1; - if (temp) af.b.h|=1; -// setzn(af.b.h); - if (temp) af.b.l|=C_FLAG; - else af.b.l&=~C_FLAG; - cycles+=4; - break; - case 0x08: /*EX AF,AF'*/ - addr=af.w; af.w=saf.w; saf.w=addr; - cycles+=4; - break; - case 0x09: /*ADD HL,BC*/ - intreg=hl.b.h; - z80_setadd16(hl.w,bc.w); - hl.w+=bc.w; - cycles+=11; - break; - case 0x0A: /*LD A,(BC)*/ - cycles+=4; af.b.h=z80_readmem(bc.w); - cycles+=3; - break; - case 0x0B: /*DEC BC*/ - bc.w--; - cycles+=6; - break; - case 0x0C: /*INC C*/ - setinc(bc.b.l); - bc.b.l++; - cycles+=4; - break; - case 0x0D: /*DEC C*/ - setdec(bc.b.l); - bc.b.l--; - cycles+=4; - break; - case 0x0E: /*LD C,nn*/ - cycles+=4; bc.b.l=z80_readmem(pc++); - cycles+=3; - break; - case 0x0F: /*RRCA*/ - temp=af.b.h&1; - af.b.h>>=1; - if (temp) af.b.h|=0x80; -// setzn(af.b.h); - if (temp) af.b.l|=C_FLAG; - else af.b.l&=~C_FLAG; - cycles+=4; - break; - - case 0x10: /*DJNZ*/ - cycles+=5; addr=z80_readmem(pc++); - if (addr&0x80) addr|=0xFF00; - if (--bc.b.h) - { - pc+=addr; - cycles+=8; - } - else - cycles+=3; - break; - case 0x11: /*LD DE,nn*/ - cycles+=4; de.b.l=z80_readmem(pc++); - cycles+=3; de.b.h=z80_readmem(pc++); - cycles+=3; - break; - case 0x12: /*LD (DE),A*/ - cycles+=4; z80_writemem(de.w,af.b.h); - cycles+=3; - break; - case 0x13: /*INC DE*/ - de.w++; - cycles+=6; - break; - case 0x14: /*INC D*/ - setinc(de.b.h); - de.b.h++; - cycles+=4; - break; - case 0x15: /*DEC D*/ - setdec(de.b.h); - de.b.h--; - cycles+=4; - break; - case 0x16: /*LD D,nn*/ - cycles+=4; de.b.h=z80_readmem(pc++); - cycles+=3; - break; - case 0x17: /*RLA*/ - temp=af.b.h&0x80; - af.b.h<<=1; - if (tempc) af.b.h|=1; -// setzn(af.b.h); - if (temp) af.b.l|=C_FLAG; - else af.b.l&=~C_FLAG; - cycles+=4; - break; - case 0x18: /*JR*/ - cycles+=4; addr=z80_readmem(pc++); - if (addr&0x80) addr|=0xFF00; - pc+=addr; - intreg=pc>>8; - cycles+=8; - break; - case 0x19: /*ADD HL,DE*/ - intreg=hl.b.h; - z80_setadd16(hl.w,de.w); - hl.w+=de.w; - cycles+=11; - break; - case 0x1A: /*LD A,(DE)*/ - cycles+=4; af.b.h=z80_readmem(de.w); - cycles+=3; - break; - case 0x1B: /*DEC DE*/ - de.w--; - cycles+=6; - break; - case 0x1C: /*INC E*/ - setinc(de.b.l); - de.b.l++; - cycles+=4; - break; - case 0x1D: /*DEC E*/ - setdec(de.b.l); - de.b.l--; - cycles+=4; - break; - case 0x1E: /*LD E,nn*/ - cycles+=4; de.b.l=z80_readmem(pc++); - cycles+=3; - break; - case 0x1F: /*RRA*/ - temp=af.b.h&1; - af.b.h>>=1; - if (tempc) af.b.h|=0x80; -// setzn(af.b.h); - if (temp) af.b.l|=C_FLAG; - else af.b.l&=~C_FLAG; - cycles+=4; - break; - - case 0x20: /*JR NZ*/ - cycles+=4; addr=z80_readmem(pc++); - if (addr&0x80) addr|=0xFF00; - if (!(af.b.l&Z_FLAG)) - { - pc+=addr; - cycles+=8; - } - else - cycles+=3; - break; - case 0x21: /*LD HL,nn*/ - cycles+=4; hl.b.l=z80_readmem(pc++); - cycles+=3; hl.b.h=z80_readmem(pc++); - cycles+=3; - break; - case 0x22: /*LD (nn),HL*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - cycles+=3; z80_writemem(addr,hl.b.l); - cycles+=3; z80_writemem(addr+1,hl.b.h); - cycles+=3; - break; - case 0x23: /*INC HL*/ - hl.w++; - cycles+=6; - break; - case 0x24: /*INC H*/ - setinc(hl.b.h); - hl.b.h++; - cycles+=4; - break; - case 0x25: /*DEC H*/ - setdec(hl.b.h); - hl.b.h--; - cycles+=4; - break; - case 0x26: /*LD H,nn*/ - cycles+=4; hl.b.h=z80_readmem(pc++); - cycles+=3; - break; - case 0x27: /*DAA*/ - addr=af.b.h; - if (af.b.l&C_FLAG) addr|=256; - if (af.b.l&H_FLAG) addr|=512; - if (af.b.l&S_FLAG) addr|=1024; - af.w=DAATable[addr]; - cycles+=4; - break; - case 0x28: /*JR Z*/ - cycles+=4; addr=z80_readmem(pc++); - if (addr&0x80) addr|=0xFF00; - if (af.b.l&Z_FLAG) - { - pc+=addr; - cycles+=8; - } - else - cycles+=3; - break; - case 0x29: /*ADD HL,HL*/ - intreg=hl.b.h; - z80_setadd16(hl.w,hl.w); - hl.w+=hl.w; - cycles+=11; - break; - case 0x2A: /*LD HL,(nn)*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - cycles+=3; hl.b.l=z80_readmem(addr); - cycles+=3; hl.b.h=z80_readmem(addr+1); - cycles+=3; - break; - case 0x2B: /*DEC HL*/ - hl.w--; - cycles+=6; - break; - case 0x2C: /*INC L*/ - setinc(hl.b.l); - hl.b.l++; - cycles+=4; - break; - case 0x2D: /*DEC L*/ - setdec(hl.b.l); - hl.b.l--; - cycles+=4; - break; - case 0x2E: /*LD L,nn*/ - cycles+=4; hl.b.l=z80_readmem(pc++); - cycles+=3; - break; - case 0x2F: /*CPL*/ - af.b.h^=0xFF; - af.b.l|=(H_FLAG|S_FLAG); - cycles+=4; - break; - case 0x30: /*JR NC*/ - cycles+=4; addr=z80_readmem(pc++); - if (addr&0x80) addr|=0xFF00; - if (!(af.b.l&C_FLAG)) - { - pc+=addr; - cycles+=8; - } - else - cycles+=3; - break; - case 0x31: /*LD SP,nn*/ - cycles+=4; temp=z80_readmem(pc++); - cycles+=3; sp=(z80_readmem(pc++)<<8)|temp; - cycles+=3; - break; - case 0x32: /*LD (nn),A*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - cycles+=3; z80_writemem(addr,af.b.h); - cycles+=3; - break; - case 0x33: /*INC SP*/ - sp++; - cycles+=6; - break; - case 0x34: /*INC (HL)*/ - cycles+=4; temp=z80_readmem(hl.w); - setinc(temp); - cycles+=3; z80_writemem(hl.w,temp+1); - cycles+=3; - break; - case 0x35: /*DEC (HL)*/ - cycles+=4; temp=z80_readmem(hl.w); - setdec(temp); - cycles+=3; z80_writemem(hl.w,temp-1); - cycles+=3; - break; - case 0x36: /*LD (HL),nn*/ - cycles+=4; temp=z80_readmem(pc++); - cycles+=3; z80_writemem(hl.w,temp); - cycles+=3; - break; - case 0x37: /*SCF*/ - af.b.l|=C_FLAG; - cycles+=4; - break; - case 0x38: /*JR C*/ - cycles+=4; addr=z80_readmem(pc++); - if (addr&0x80) addr|=0xFF00; - if (af.b.l&C_FLAG) - { - pc+=addr; - cycles+=8; - } - else - cycles+=3; - break; - case 0x39: /*ADD HL,SP*/ - intreg=hl.b.h; - z80_setadd16(hl.w,sp); - hl.w+=sp; - cycles+=11; - break; - case 0x3A: /*LD A,(nn)*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - cycles+=3; af.b.h=z80_readmem(addr); - cycles+=3; - break; - case 0x3B: /*DEC SP*/ - sp--; - cycles+=6; - break; - case 0x3C: /*INC A*/ - setinc(af.b.h); - af.b.h++; - cycles+=4; - break; - case 0x3D: /*DEC A*/ - setdec(af.b.h); - af.b.h--; - cycles+=4; - break; - case 0x3E: /*LD A,nn*/ - cycles+=4; af.b.h=z80_readmem(pc++); - cycles+=3; - break; - case 0x3F: /*CCF*/ - af.b.l^=C_FLAG; - cycles+=4; - break; - - case 0x40: bc.b.h=bc.b.h; cycles+=4; break; /*LD B,B*/ - case 0x41: bc.b.h=bc.b.l; cycles+=4; break; /*LD B,C*/ - case 0x42: bc.b.h=de.b.h; cycles+=4; break; /*LD B,D*/ - case 0x43: bc.b.h=de.b.l; cycles+=4; break; /*LD B,E*/ - case 0x44: bc.b.h=hl.b.h; cycles+=4; break; /*LD B,H*/ - case 0x45: bc.b.h=hl.b.l; cycles+=4; break; /*LD B,L*/ - case 0x46: cycles+=4; bc.b.h=z80_readmem(hl.w); cycles+=3; break; /*LD B,(HL)*/ - case 0x47: bc.b.h=af.b.h; cycles+=4; break; /*LD B,A*/ - case 0x48: bc.b.l=bc.b.h; cycles+=4; break; /*LD C,B*/ - case 0x49: bc.b.l=bc.b.l; cycles+=4; break; /*LD C,C*/ - case 0x4A: bc.b.l=de.b.h; cycles+=4; break; /*LD C,D*/ - case 0x4B: bc.b.l=de.b.l; cycles+=4; break; /*LD C,E*/ - case 0x4C: bc.b.l=hl.b.h; cycles+=4; break; /*LD C,H*/ - case 0x4D: bc.b.l=hl.b.l; cycles+=4; break; /*LD C,L*/ - case 0x4E: cycles+=4; bc.b.l=z80_readmem(hl.w); cycles+=3; break; /*LD C,(HL)*/ - case 0x4F: bc.b.l=af.b.h; cycles+=4; break; /*LD C,A*/ - case 0x50: de.b.h=bc.b.h; cycles+=4; break; /*LD D,B*/ - case 0x51: de.b.h=bc.b.l; cycles+=4; break; /*LD D,C*/ - case 0x52: de.b.h=de.b.h; cycles+=4; break; /*LD D,D*/ - case 0x53: de.b.h=de.b.l; cycles+=4; break; /*LD D,E*/ - case 0x54: de.b.h=hl.b.h; cycles+=4; break; /*LD D,H*/ - case 0x55: de.b.h=hl.b.l; cycles+=4; break; /*LD D,L*/ - case 0x56: cycles+=4; de.b.h=z80_readmem(hl.w); cycles+=3; break; /*LD D,(HL)*/ - case 0x57: de.b.h=af.b.h; cycles+=4; break; /*LD D,A*/ - case 0x58: de.b.l=bc.b.h; cycles+=4; break; /*LD E,B*/ - case 0x59: de.b.l=bc.b.l; cycles+=4; break; /*LD E,C*/ - case 0x5A: de.b.l=de.b.h; cycles+=4; break; /*LD E,D*/ - case 0x5B: de.b.l=de.b.l; cycles+=4; break; /*LD E,E*/ - case 0x5C: de.b.l=hl.b.h; cycles+=4; break; /*LD E,H*/ - case 0x5D: de.b.l=hl.b.l; cycles+=4; break; /*LD E,L*/ - case 0x5E: cycles+=4; de.b.l=z80_readmem(hl.w); cycles+=3; break; /*LD E,(HL)*/ - case 0x5F: de.b.l=af.b.h; cycles+=4; break; /*LD E,A*/ - case 0x60: hl.b.h=bc.b.h; cycles+=4; break; /*LD H,B*/ - case 0x61: hl.b.h=bc.b.l; cycles+=4; break; /*LD H,C*/ - case 0x62: hl.b.h=de.b.h; cycles+=4; break; /*LD H,D*/ - case 0x63: hl.b.h=de.b.l; cycles+=4; break; /*LD H,E*/ - case 0x64: hl.b.h=hl.b.h; cycles+=4; break; /*LD H,H*/ - case 0x65: hl.b.h=hl.b.l; cycles+=4; break; /*LD H,L*/ - case 0x66: cycles+=4; hl.b.h=z80_readmem(hl.w); cycles+=3; break; /*LD H,(HL)*/ - case 0x67: hl.b.h=af.b.h; cycles+=4; break; /*LD H,A*/ - case 0x68: hl.b.l=bc.b.h; cycles+=4; break; /*LD L,B*/ - case 0x69: hl.b.l=bc.b.l; cycles+=4; break; /*LD L,C*/ - case 0x6A: hl.b.l=de.b.h; cycles+=4; break; /*LD L,D*/ - case 0x6B: hl.b.l=de.b.l; cycles+=4; break; /*LD L,E*/ - case 0x6C: hl.b.l=hl.b.h; cycles+=4; break; /*LD L,H*/ - case 0x6D: hl.b.l=hl.b.l; cycles+=4; break; /*LD L,L*/ - case 0x6E: cycles+=4; hl.b.l=z80_readmem(hl.w); cycles+=3; break; /*LD L,(HL)*/ - case 0x6F: hl.b.l=af.b.h; cycles+=4; break; /*LD L,A*/ - case 0x70: cycles+=4; z80_writemem(hl.w,bc.b.h); cycles+=3; break; /*LD (HL),B*/ - case 0x71: cycles+=4; z80_writemem(hl.w,bc.b.l); cycles+=3; break; /*LD (HL),C*/ - case 0x72: cycles+=4; z80_writemem(hl.w,de.b.h); cycles+=3; break; /*LD (HL),D*/ - case 0x73: cycles+=4; z80_writemem(hl.w,de.b.l); cycles+=3; break; /*LD (HL),E*/ - case 0x74: cycles+=4; z80_writemem(hl.w,hl.b.h); cycles+=3; break; /*LD (HL),H*/ - case 0x75: cycles+=4; z80_writemem(hl.w,hl.b.l); cycles+=3; break; /*LD (HL),L*/ - case 0x77: cycles+=4; z80_writemem(hl.w,af.b.h); cycles+=3; break; /*LD (HL),A*/ - case 0x78: af.b.h=bc.b.h; cycles+=4; break; /*LD A,B*/ - case 0x79: af.b.h=bc.b.l; cycles+=4; break; /*LD A,C*/ - case 0x7A: af.b.h=de.b.h; cycles+=4; break; /*LD A,D*/ - case 0x7B: af.b.h=de.b.l; cycles+=4; break; /*LD A,E*/ - case 0x7C: af.b.h=hl.b.h; cycles+=4; break; /*LD A,H*/ - case 0x7D: af.b.h=hl.b.l; cycles+=4; break; /*LD A,L*/ - case 0x7E: cycles+=4; af.b.h=z80_readmem(hl.w); cycles+=3; break; /*LD A,(HL)*/ - case 0x7F: af.b.h=af.b.h; cycles+=4; break; /*LD A,A*/ - - case 0x76: /*HALT*/ - if (!enterint) pc--; -// else printf("HALT %02X\n",bc.b.h); - cycles+=4; - break; - - case 0x80: z80_setadd(af.b.h,bc.b.h); af.b.h+=bc.b.h; cycles+=4; break; /*ADD B*/ - case 0x81: z80_setadd(af.b.h,bc.b.l); af.b.h+=bc.b.l; cycles+=4; break; /*ADD C*/ - case 0x82: z80_setadd(af.b.h,de.b.h); af.b.h+=de.b.h; cycles+=4; break; /*ADD D*/ - case 0x83: z80_setadd(af.b.h,de.b.l); af.b.h+=de.b.l; cycles+=4; break; /*ADD E*/ - case 0x84: z80_setadd(af.b.h,hl.b.h); af.b.h+=hl.b.h; cycles+=4; break; /*ADD H*/ - case 0x85: z80_setadd(af.b.h,hl.b.l); af.b.h+=hl.b.l; cycles+=4; break; /*ADD L*/ - case 0x86: cycles+=4; temp=z80_readmem(hl.w); z80_setadd(af.b.h,temp); af.b.h+=temp; cycles+=3; break; /*ADD (HL)*/ - case 0x87: z80_setadd(af.b.h,af.b.h); af.b.h+=af.b.h; cycles+=4; break; /*ADD A*/ - case 0x88: setadc(af.b.h,bc.b.h); af.b.h+=bc.b.h+tempc; cycles+=4; break; /*ADC B*/ - case 0x89: setadc(af.b.h,bc.b.l); af.b.h+=bc.b.l+tempc; cycles+=4; break; /*ADC C*/ - case 0x8A: setadc(af.b.h,de.b.h); af.b.h+=de.b.h+tempc; cycles+=4; break; /*ADC D*/ - case 0x8B: setadc(af.b.h,de.b.l); af.b.h+=de.b.l+tempc; cycles+=4; break; /*ADC E*/ - case 0x8C: setadc(af.b.h,hl.b.h); af.b.h+=hl.b.h+tempc; cycles+=4; break; /*ADC H*/ - case 0x8D: setadc(af.b.h,hl.b.l); af.b.h+=hl.b.l+tempc; cycles+=4; break; /*ADC L*/ - case 0x8E: cycles+=4; temp=z80_readmem(hl.w); setadc(af.b.h,temp); af.b.h+=temp+tempc; cycles+=3; break; /*ADC (HL)*/ - case 0x8F: setadc(af.b.h,af.b.h); af.b.h+=af.b.h+tempc; cycles+=4; break; /*ADC A*/ - - case 0x90: z80_setsub(af.b.h,bc.b.h); af.b.h-=bc.b.h; cycles+=4; break; /*SUB B*/ - case 0x91: z80_setsub(af.b.h,bc.b.l); af.b.h-=bc.b.l; cycles+=4; break; /*SUB C*/ - case 0x92: z80_setsub(af.b.h,de.b.h); af.b.h-=de.b.h; cycles+=4; break; /*SUB D*/ - case 0x93: z80_setsub(af.b.h,de.b.l); af.b.h-=de.b.l; cycles+=4; break; /*SUB E*/ - case 0x94: z80_setsub(af.b.h,hl.b.h); af.b.h-=hl.b.h; cycles+=4; break; /*SUB H*/ - case 0x95: z80_setsub(af.b.h,hl.b.l); af.b.h-=hl.b.l; cycles+=4; break; /*SUB L*/ - case 0x96: cycles+=4; temp=z80_readmem(hl.w); z80_setsub(af.b.h,temp); af.b.h-=temp; cycles+=3; break; /*SUB (HL)*/ - case 0x97: z80_setsub(af.b.h,af.b.h); af.b.h-=af.b.h; cycles+=4; break; /*SUB A*/ - case 0x98: setsbc(af.b.h,bc.b.h); af.b.h-=(bc.b.h+tempc); cycles+=4; break; /*SBC B*/ - case 0x99: setsbc(af.b.h,bc.b.l); af.b.h-=(bc.b.l+tempc); cycles+=4; break; /*SBC C*/ - case 0x9A: setsbc(af.b.h,de.b.h); af.b.h-=(de.b.h+tempc); cycles+=4; break; /*SBC D*/ - case 0x9B: setsbc(af.b.h,de.b.l); af.b.h-=(de.b.l+tempc); cycles+=4; break; /*SBC E*/ - case 0x9C: setsbc(af.b.h,hl.b.h); af.b.h-=(hl.b.h+tempc); cycles+=4; break; /*SBC H*/ - case 0x9D: setsbc(af.b.h,hl.b.l); af.b.h-=(hl.b.l+tempc); cycles+=4; break; /*SBC L*/ - case 0x9E: cycles+=4; temp=z80_readmem(hl.w); setsbc(af.b.h,temp); af.b.h-=(temp+tempc); cycles+=3; break; /*SBC (HL)*/ - case 0x9F: setsbc(af.b.h,af.b.h); af.b.h-=(af.b.h+tempc); cycles+=4; break; /*SBC A*/ - - case 0xA0: af.b.h&=bc.b.h; setand(af.b.h); cycles+=4; break; /*AND B*/ - case 0xA1: af.b.h&=bc.b.l; setand(af.b.h); cycles+=4; break; /*AND C*/ - case 0xA2: af.b.h&=de.b.h; setand(af.b.h); cycles+=4; break; /*AND D*/ - case 0xA3: af.b.h&=de.b.l; setand(af.b.h); cycles+=4; break; /*AND E*/ - case 0xA4: af.b.h&=hl.b.h; setand(af.b.h); cycles+=4; break; /*AND H*/ - case 0xA5: af.b.h&=hl.b.l; setand(af.b.h); cycles+=4; break; /*AND L*/ - case 0xA6: cycles+=4; af.b.h&=z80_readmem(hl.w); setand(af.b.h); cycles+=3; break; /*AND (HL)*/ - case 0xA7: af.b.h&=af.b.h; setand(af.b.h); cycles+=4; break; /*AND A*/ - case 0xA8: af.b.h^=bc.b.h; setzn(af.b.h); cycles+=4; break; /*XOR B*/ - case 0xA9: af.b.h^=bc.b.l; setzn(af.b.h); cycles+=4; break; /*XOR C*/ - case 0xAA: af.b.h^=de.b.h; setzn(af.b.h); cycles+=4; break; /*XOR D*/ - case 0xAB: af.b.h^=de.b.l; setzn(af.b.h); cycles+=4; break; /*XOR E*/ - case 0xAC: af.b.h^=hl.b.h; setzn(af.b.h); cycles+=4; break; /*XOR H*/ - case 0xAD: af.b.h^=hl.b.l; setzn(af.b.h); cycles+=4; break; /*XOR L*/ - case 0xAE: cycles+=4; af.b.h^=z80_readmem(hl.w); setzn(af.b.h); cycles+=3; break; /*XOR (HL)*/ - case 0xAF: af.b.h^=af.b.h; setzn(af.b.h); cycles+=4; break; /*XOR A*/ - case 0xB0: af.b.h|=bc.b.h; setzn(af.b.h); cycles+=4; break; /*OR B*/ - case 0xB1: af.b.h|=bc.b.l; setzn(af.b.h); cycles+=4; break; /*OR C*/ - case 0xB2: af.b.h|=de.b.h; setzn(af.b.h); cycles+=4; break; /*OR D*/ - case 0xB3: af.b.h|=de.b.l; setzn(af.b.h); cycles+=4; break; /*OR E*/ - case 0xB4: af.b.h|=hl.b.h; setzn(af.b.h); cycles+=4; break; /*OR H*/ - case 0xB5: af.b.h|=hl.b.l; setzn(af.b.h); cycles+=4; break; /*OR L*/ - case 0xB6: cycles+=4; af.b.h|=z80_readmem(hl.w); setzn(af.b.h); cycles+=3; break; /*OR (HL)*/ - case 0xB7: af.b.h|=af.b.h; setzn(af.b.h); cycles+=4; break; /*OR A*/ - case 0xB8: setcp(af.b.h,bc.b.h); cycles+=4; break; /*CP B*/ - case 0xB9: setcp(af.b.h,bc.b.l); cycles+=4; break; /*CP C*/ - case 0xBA: setcp(af.b.h,de.b.h); cycles+=4; break; /*CP D*/ - case 0xBB: setcp(af.b.h,de.b.l); cycles+=4; break; /*CP E*/ - case 0xBC: setcp(af.b.h,hl.b.h); cycles+=4; break; /*CP H*/ - case 0xBD: setcp(af.b.h,hl.b.l); cycles+=4; break; /*CP L*/ - case 0xBE: cycles+=4; temp=z80_readmem(hl.w); setcp(af.b.h,temp); cycles+=3; break; /*CP (HL)*/ - case 0xBF: setcp(af.b.h,af.b.h); cycles+=4; break; /*CP A*/ - - case 0xC0: /*RET NZ*/ - cycles+=5; - if (!(af.b.l&Z_FLAG)) - { - pc=z80_readmem(sp); sp++; - cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; - cycles+=3; - } - break; - case 0xC1: /*POP BC*/ - cycles+=4; bc.b.l=z80_readmem(sp); sp++; - cycles+=3; bc.b.h=z80_readmem(sp); sp++; - cycles+=3; - break; - case 0xC2: /*JP NZ*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - if (!(af.b.l&Z_FLAG)) - pc=addr; - cycles+=3; - break; - case 0xC3: /*JP xxxx*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); - pc=addr; - cycles+=3; - break; - case 0xC4: /*CALL NZ,xxxx*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - if (!(af.b.l&Z_FLAG)) - { - cycles+=4; sp--; z80_writemem(sp,pc>>8); - cycles+=3; sp--; z80_writemem(sp,pc&0xFF); - pc=addr; - cycles+=3; - } - else - cycles+=3; - break; - case 0xC5: /*PUSH BC*/ - cycles+=5; sp--; z80_writemem(sp,bc.b.h); - cycles+=3; sp--; z80_writemem(sp,bc.b.l); - cycles+=3; - break; - case 0xC6: /*ADD A,nn*/ - cycles+=4; temp=z80_readmem(pc++); -// printf("%04X : ADD %02X %02X - ",pc-1,af.b.h,temp); - z80_setadd(af.b.h,temp); - af.b.h+=temp; - cycles+=3; -// printf("%04X\n",af.w); - break; - case 0xC7: /*RST 0*/ - cycles+=5; sp--; z80_writemem(sp,pc>>8); - cycles+=3; sp--; z80_writemem(sp,pc&0xFF); - pc=0x00; - cycles+=3; - break; - case 0xC8: /*RET Z*/ - cycles+=5; - if (af.b.l&Z_FLAG) - { - pc=z80_readmem(sp); sp++; - cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; - cycles+=3; - } - break; - case 0xC9: /*RET*/ - cycles+=4; pc=z80_readmem(sp); sp++; - cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; - cycles+=3; - break; - case 0xCA: /*JP Z*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - if (af.b.l&Z_FLAG) - pc=addr; - cycles+=3; - break; - - case 0xCB: /*More opcodes*/ - ir.b.l=((ir.b.l+1)&0x7F)|(ir.b.l&0x80); - cycles+=4; - opcode=z80_readmem(pc++); - switch (opcode) - { - case 0x00: temp=bc.b.h&0x80; bc.b.h<<=1; if (temp) bc.b.h|=1; setzn(bc.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RLC B*/ - case 0x01: temp=bc.b.l&0x80; bc.b.l<<=1; if (temp) bc.b.l|=1; setzn(bc.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RLC C*/ - case 0x02: temp=de.b.h&0x80; de.b.h<<=1; if (temp) de.b.h|=1; setzn(de.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RLC D*/ - case 0x03: temp=de.b.l&0x80; de.b.l<<=1; if (temp) de.b.l|=1; setzn(de.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RLC E*/ - case 0x04: temp=hl.b.h&0x80; hl.b.h<<=1; if (temp) hl.b.h|=1; setzn(hl.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RLC H*/ - case 0x05: temp=hl.b.l&0x80; hl.b.l<<=1; if (temp) hl.b.l|=1; setzn(hl.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RLC L*/ - case 0x07: temp=af.b.h&0x80; af.b.h<<=1; if (temp) af.b.h|=1; setzn(af.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RLC A*/ - case 0x06: /*RLC (HL)*/ - cycles+=4; temp=z80_readmem(hl.w); - tempc=temp&0x80; - temp<<=1; - if (tempc) temp|=1; - setzn(temp); - if (tempc) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(hl.w,temp); - cycles+=3; - break; - - case 0x08: temp=bc.b.h&1; bc.b.h>>=1; if (temp) bc.b.h|=0x80; setzn(bc.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RRC B*/ - case 0x09: temp=bc.b.l&1; bc.b.l>>=1; if (temp) bc.b.l|=0x80; setzn(bc.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RRC C*/ - case 0x0A: temp=de.b.h&1; de.b.h>>=1; if (temp) de.b.h|=0x80; setzn(de.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RRC D*/ - case 0x0B: temp=de.b.l&1; de.b.l>>=1; if (temp) de.b.l|=0x80; setzn(de.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RRC E*/ - case 0x0C: temp=hl.b.h&1; hl.b.h>>=1; if (temp) hl.b.h|=0x80; setzn(hl.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RRC H*/ - case 0x0D: temp=hl.b.l&1; hl.b.l>>=1; if (temp) hl.b.l|=0x80; setzn(hl.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RRC L*/ - case 0x0F: temp=af.b.h&1; af.b.h>>=1; if (temp) af.b.h|=0x80; setzn(af.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RRC A*/ - case 0x0E: /*RRC (HL)*/ - cycles+=4; temp=z80_readmem(hl.w); - tempc=temp&1; - temp>>=1; - if (tempc) temp|=0x80; - setzn(temp); - if (tempc) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(hl.w,temp); - cycles+=3; - break; - - case 0x10: temp=bc.b.h&0x80; bc.b.h<<=1; if (tempc) bc.b.h|=1; setzn(bc.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RL B*/ - case 0x11: temp=bc.b.l&0x80; bc.b.l<<=1; if (tempc) bc.b.l|=1; setzn(bc.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RL C*/ - case 0x12: temp=de.b.h&0x80; de.b.h<<=1; if (tempc) de.b.h|=1; setzn(de.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RL D*/ - case 0x13: temp=de.b.l&0x80; de.b.l<<=1; if (tempc) de.b.l|=1; setzn(de.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RL E*/ - case 0x14: temp=hl.b.h&0x80; hl.b.h<<=1; if (tempc) hl.b.h|=1; setzn(hl.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RL H*/ - case 0x15: temp=hl.b.l&0x80; hl.b.l<<=1; if (tempc) hl.b.l|=1; setzn(hl.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RL L*/ - case 0x17: temp=af.b.h&0x80; af.b.h<<=1; if (tempc) af.b.h|=1; setzn(af.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RL A*/ - case 0x16: /*RL (HL)*/ - cycles+=4; temp=z80_readmem(hl.w); - addr=temp&0x80; - temp<<=1; - if (tempc) temp|=1; - setzn(temp); - if (addr) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(hl.w,temp); - cycles+=3; - break; - - case 0x18: temp=bc.b.h&1; bc.b.h>>=1; if (tempc) bc.b.h|=0x80; setzn(bc.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RR B*/ - case 0x19: temp=bc.b.l&1; bc.b.l>>=1; if (tempc) bc.b.l|=0x80; setzn(bc.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RR C*/ - case 0x1A: temp=de.b.h&1; de.b.h>>=1; if (tempc) de.b.h|=0x80; setzn(de.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RR D*/ - case 0x1B: temp=de.b.l&1; de.b.l>>=1; if (tempc) de.b.l|=0x80; setzn(de.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RR E*/ - case 0x1C: temp=hl.b.h&1; hl.b.h>>=1; if (tempc) hl.b.h|=0x80; setzn(hl.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RR H*/ - case 0x1D: temp=hl.b.l&1; hl.b.l>>=1; if (tempc) hl.b.l|=0x80; setzn(hl.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RR L*/ - case 0x1F: temp=af.b.h&1; af.b.h>>=1; if (tempc) af.b.h|=0x80; setzn(af.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RR A*/ - case 0x1E: /*RR (HL)*/ - cycles+=4; temp=z80_readmem(hl.w); - addr=temp&1; - temp>>=1; - if (tempc) temp|=0x80; - setzn(temp); - if (addr) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(hl.w,temp); - cycles+=3; - break; - - case 0x20: temp=bc.b.h&0x80; bc.b.h<<=1; setzn(bc.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLA B*/ - case 0x21: temp=bc.b.l&0x80; bc.b.l<<=1; setzn(bc.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLA C*/ - case 0x22: temp=de.b.h&0x80; de.b.h<<=1; setzn(de.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLA D*/ - case 0x23: temp=de.b.l&0x80; de.b.l<<=1; setzn(de.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLA E*/ - case 0x24: temp=hl.b.h&0x80; hl.b.h<<=1; setzn(hl.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLA H*/ - case 0x25: temp=hl.b.l&0x80; hl.b.l<<=1; setzn(hl.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLA L*/ - case 0x27: temp=af.b.h&0x80; af.b.h<<=1; setzn(af.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLA H*/ - case 0x26: /*SLA (HL)*/ - cycles+=4; temp=z80_readmem(hl.w); - tempc=temp&0x80; - temp<<=1; - setzn(temp); - if (tempc) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(hl.w,temp); - cycles+=3; - break; - - case 0x28: temp=bc.b.h&1; bc.b.h>>=1; if (bc.b.h&0x40) bc.b.h|=0x80; setzn(bc.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRA B*/ - case 0x29: temp=bc.b.l&1; bc.b.l>>=1; if (bc.b.l&0x40) bc.b.l|=0x80; setzn(bc.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRA C*/ - case 0x2A: temp=de.b.h&1; de.b.h>>=1; if (de.b.h&0x40) de.b.h|=0x80; setzn(de.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRA D*/ - case 0x2B: temp=de.b.l&1; de.b.l>>=1; if (de.b.l&0x40) de.b.l|=0x80; setzn(de.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRA E*/ - case 0x2C: temp=hl.b.h&1; hl.b.h>>=1; if (hl.b.h&0x40) hl.b.h|=0x80; setzn(hl.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRA H*/ - case 0x2D: temp=hl.b.l&1; hl.b.l>>=1; if (hl.b.l&0x40) hl.b.l|=0x80; setzn(hl.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRA L*/ - case 0x2F: temp=af.b.h&1; af.b.h>>=1; if (af.b.h&0x40) af.b.h|=0x80; setzn(af.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRA A*/ - case 0x2E: /*SRA (HL)*/ - cycles+=4; temp=z80_readmem(hl.w); - tempc=temp&1; - temp>>=1; - if (temp&0x40) temp|=0x80; - setzn(temp); - if (tempc) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(hl.w,temp); - cycles+=3; - break; - - case 0x30: temp=bc.b.h&0x80; bc.b.h<<=1; bc.b.h|=1; setzn(bc.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLL B*/ - case 0x31: temp=bc.b.l&0x80; bc.b.l<<=1; bc.b.l|=1; setzn(bc.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLL C*/ - case 0x32: temp=de.b.h&0x80; de.b.h<<=1; de.b.h|=1; setzn(de.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLL D*/ - case 0x33: temp=de.b.l&0x80; de.b.l<<=1; de.b.l|=1; setzn(de.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLL E*/ - case 0x34: temp=hl.b.h&0x80; hl.b.h<<=1; hl.b.h|=1; setzn(hl.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLL H*/ - case 0x35: temp=hl.b.l&0x80; hl.b.l<<=1; hl.b.l|=1; setzn(hl.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLL L*/ - case 0x37: temp=af.b.h&0x80; af.b.h<<=1; af.b.h|=1; setzn(af.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLL H*/ - case 0x36: /*SLL (HL)*/ - cycles+=4; temp=z80_readmem(hl.w); - tempc=temp&0x80; - temp<<=1; - temp|=1; - setzn(temp); - if (tempc) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(hl.w,temp); - cycles+=3; - break; - - case 0x38: temp=bc.b.h&1; bc.b.h>>=1; setzn(bc.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRL B*/ - case 0x39: temp=bc.b.l&1; bc.b.l>>=1; setzn(bc.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRL C*/ - case 0x3A: temp=de.b.h&1; de.b.h>>=1; setzn(de.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRL D*/ - case 0x3B: temp=de.b.l&1; de.b.l>>=1; setzn(de.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRL E*/ - case 0x3C: temp=hl.b.h&1; hl.b.h>>=1; setzn(hl.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRL H*/ - case 0x3D: temp=hl.b.l&1; hl.b.l>>=1; setzn(hl.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRL L*/ - case 0x3F: temp=af.b.h&1; af.b.h>>=1; setzn(af.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRL H*/ - case 0x3E: /*SRL (HL)*/ - cycles+=4; temp=z80_readmem(hl.w); - tempc=temp&1; - temp>>=1; - setzn(temp); - if (tempc) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(hl.w,temp); - cycles+=3; - break; - - case 0x40: setbit(bc.b.h&0x01); cycles+=4; break; /*BIT 0,B*/ - case 0x41: setbit(bc.b.l&0x01); cycles+=4; break; /*BIT 0,C*/ - case 0x42: setbit(de.b.h&0x01); cycles+=4; break; /*BIT 0,D*/ - case 0x43: setbit(de.b.l&0x01); cycles+=4; break; /*BIT 0,E*/ - case 0x44: setbit(hl.b.h&0x01); cycles+=4; break; /*BIT 0,H*/ - case 0x45: setbit(hl.b.l&0x01); cycles+=4; break; /*BIT 0,L*/ - case 0x47: setbit(af.b.h&0x01); cycles+=4; break; /*BIT 0,A*/ - case 0x48: setbit(bc.b.h&0x02); cycles+=4; break; /*BIT 1,B*/ - case 0x49: setbit(bc.b.l&0x02); cycles+=4; break; /*BIT 1,C*/ - case 0x4A: setbit(de.b.h&0x02); cycles+=4; break; /*BIT 1,D*/ - case 0x4B: setbit(de.b.l&0x02); cycles+=4; break; /*BIT 1,E*/ - case 0x4C: setbit(hl.b.h&0x02); cycles+=4; break; /*BIT 1,H*/ - case 0x4D: setbit(hl.b.l&0x02); cycles+=4; break; /*BIT 1,L*/ - case 0x4F: setbit(af.b.h&0x02); cycles+=4; break; /*BIT 1,A*/ - case 0x50: setbit(bc.b.h&0x04); cycles+=4; break; /*BIT 2,B*/ - case 0x51: setbit(bc.b.l&0x04); cycles+=4; break; /*BIT 2,C*/ - case 0x52: setbit(de.b.h&0x04); cycles+=4; break; /*BIT 2,D*/ - case 0x53: setbit(de.b.l&0x04); cycles+=4; break; /*BIT 2,E*/ - case 0x54: setbit(hl.b.h&0x04); cycles+=4; break; /*BIT 2,H*/ - case 0x55: setbit(hl.b.l&0x04); cycles+=4; break; /*BIT 2,L*/ - case 0x57: setbit(af.b.h&0x04); cycles+=4; break; /*BIT 2,A*/ - case 0x58: setbit(bc.b.h&0x08); cycles+=4; break; /*BIT 3,B*/ - case 0x59: setbit(bc.b.l&0x08); cycles+=4; break; /*BIT 3,C*/ - case 0x5A: setbit(de.b.h&0x08); cycles+=4; break; /*BIT 3,D*/ - case 0x5B: setbit(de.b.l&0x08); cycles+=4; break; /*BIT 3,E*/ - case 0x5C: setbit(hl.b.h&0x08); cycles+=4; break; /*BIT 3,H*/ - case 0x5D: setbit(hl.b.l&0x08); cycles+=4; break; /*BIT 3,L*/ - case 0x5F: setbit(af.b.h&0x08); cycles+=4; break; /*BIT 3,A*/ - case 0x60: setbit(bc.b.h&0x10); cycles+=4; break; /*BIT 4,B*/ - case 0x61: setbit(bc.b.l&0x10); cycles+=4; break; /*BIT 4,C*/ - case 0x62: setbit(de.b.h&0x10); cycles+=4; break; /*BIT 4,D*/ - case 0x63: setbit(de.b.l&0x10); cycles+=4; break; /*BIT 4,E*/ - case 0x64: setbit(hl.b.h&0x10); cycles+=4; break; /*BIT 4,H*/ - case 0x65: setbit(hl.b.l&0x10); cycles+=4; break; /*BIT 4,L*/ - case 0x67: setbit(af.b.h&0x10); cycles+=4; break; /*BIT 4,A*/ - case 0x68: setbit(bc.b.h&0x20); cycles+=4; break; /*BIT 5,B*/ - case 0x69: setbit(bc.b.l&0x20); cycles+=4; break; /*BIT 5,C*/ - case 0x6A: setbit(de.b.h&0x20); cycles+=4; break; /*BIT 5,D*/ - case 0x6B: setbit(de.b.l&0x20); cycles+=4; break; /*BIT 5,E*/ - case 0x6C: setbit(hl.b.h&0x20); cycles+=4; break; /*BIT 5,H*/ - case 0x6D: setbit(hl.b.l&0x20); cycles+=4; break; /*BIT 5,L*/ - case 0x6F: setbit(af.b.h&0x20); cycles+=4; break; /*BIT 5,A*/ - case 0x70: setbit(bc.b.h&0x40); cycles+=4; break; /*BIT 6,B*/ - case 0x71: setbit(bc.b.l&0x40); cycles+=4; break; /*BIT 6,C*/ - case 0x72: setbit(de.b.h&0x40); cycles+=4; break; /*BIT 6,D*/ - case 0x73: setbit(de.b.l&0x40); cycles+=4; break; /*BIT 6,E*/ - case 0x74: setbit(hl.b.h&0x40); cycles+=4; break; /*BIT 6,H*/ - case 0x75: setbit(hl.b.l&0x40); cycles+=4; break; /*BIT 6,L*/ - case 0x77: setbit(af.b.h&0x40); cycles+=4; break; /*BIT 6,A*/ - case 0x78: setbit(bc.b.h&0x80); cycles+=4; break; /*BIT 7,B*/ - case 0x79: setbit(bc.b.l&0x80); cycles+=4; break; /*BIT 7,C*/ - case 0x7A: setbit(de.b.h&0x80); cycles+=4; break; /*BIT 7,D*/ - case 0x7B: setbit(de.b.l&0x80); cycles+=4; break; /*BIT 7,E*/ - case 0x7C: setbit(hl.b.h&0x80); cycles+=4; break; /*BIT 7,H*/ - case 0x7D: setbit(hl.b.l&0x80); cycles+=4; break; /*BIT 7,L*/ - case 0x7F: setbit(af.b.h&0x80); cycles+=4; break; /*BIT 7,A*/ - - case 0x46: cycles+=4; temp=z80_readmem(hl.w); setbit2(temp&0x01,intreg); cycles+=4; break; /*BIT 0,(HL)*/ - case 0x4E: cycles+=4; temp=z80_readmem(hl.w); setbit2(temp&0x02,intreg); cycles+=4; break; /*BIT 1,(HL)*/ - case 0x56: cycles+=4; temp=z80_readmem(hl.w); setbit2(temp&0x04,intreg); cycles+=4; break; /*BIT 2,(HL)*/ - case 0x5E: cycles+=4; temp=z80_readmem(hl.w); setbit2(temp&0x08,intreg); cycles+=4; break; /*BIT 3,(HL)*/ - case 0x66: cycles+=4; temp=z80_readmem(hl.w); setbit2(temp&0x10,intreg); cycles+=4; break; /*BIT 4,(HL)*/ - case 0x6E: cycles+=4; temp=z80_readmem(hl.w); setbit2(temp&0x20,intreg); cycles+=4; break; /*BIT 5,(HL)*/ - case 0x76: cycles+=4; temp=z80_readmem(hl.w); setbit2(temp&0x40,intreg); cycles+=4; break; /*BIT 6,(HL)*/ - case 0x7E: cycles+=4; temp=z80_readmem(hl.w); setbit2(temp&0x80,intreg); cycles+=4; break; /*BIT 7,(HL)*/ - - case 0x80: bc.b.h&=~0x01; cycles+=4; break; /*RES 0,B*/ - case 0x81: bc.b.l&=~0x01; cycles+=4; break; /*RES 0,C*/ - case 0x82: de.b.h&=~0x01; cycles+=4; break; /*RES 0,D*/ - case 0x83: de.b.l&=~0x01; cycles+=4; break; /*RES 0,E*/ - case 0x84: hl.b.h&=~0x01; cycles+=4; break; /*RES 0,H*/ - case 0x85: hl.b.l&=~0x01; cycles+=4; break; /*RES 0,L*/ - case 0x87: af.b.h&=~0x01; cycles+=4; break; /*RES 0,A*/ - case 0x88: bc.b.h&=~0x02; cycles+=4; break; /*RES 1,B*/ - case 0x89: bc.b.l&=~0x02; cycles+=4; break; /*RES 1,C*/ - case 0x8A: de.b.h&=~0x02; cycles+=4; break; /*RES 1,D*/ - case 0x8B: de.b.l&=~0x02; cycles+=4; break; /*RES 1,E*/ - case 0x8C: hl.b.h&=~0x02; cycles+=4; break; /*RES 1,H*/ - case 0x8D: hl.b.l&=~0x02; cycles+=4; break; /*RES 1,L*/ - case 0x8F: af.b.h&=~0x02; cycles+=4; break; /*RES 1,A*/ - case 0x90: bc.b.h&=~0x04; cycles+=4; break; /*RES 2,B*/ - case 0x91: bc.b.l&=~0x04; cycles+=4; break; /*RES 2,C*/ - case 0x92: de.b.h&=~0x04; cycles+=4; break; /*RES 2,D*/ - case 0x93: de.b.l&=~0x04; cycles+=4; break; /*RES 2,E*/ - case 0x94: hl.b.h&=~0x04; cycles+=4; break; /*RES 2,H*/ - case 0x95: hl.b.l&=~0x04; cycles+=4; break; /*RES 2,L*/ - case 0x97: af.b.h&=~0x04; cycles+=4; break; /*RES 2,A*/ - case 0x98: bc.b.h&=~0x08; cycles+=4; break; /*RES 3,B*/ - case 0x99: bc.b.l&=~0x08; cycles+=4; break; /*RES 3,C*/ - case 0x9A: de.b.h&=~0x08; cycles+=4; break; /*RES 3,D*/ - case 0x9B: de.b.l&=~0x08; cycles+=4; break; /*RES 3,E*/ - case 0x9C: hl.b.h&=~0x08; cycles+=4; break; /*RES 3,H*/ - case 0x9D: hl.b.l&=~0x08; cycles+=4; break; /*RES 3,L*/ - case 0x9F: af.b.h&=~0x08; cycles+=4; break; /*RES 3,A*/ - case 0xA0: bc.b.h&=~0x10; cycles+=4; break; /*RES 4,B*/ - case 0xA1: bc.b.l&=~0x10; cycles+=4; break; /*RES 4,C*/ - case 0xA2: de.b.h&=~0x10; cycles+=4; break; /*RES 4,D*/ - case 0xA3: de.b.l&=~0x10; cycles+=4; break; /*RES 4,E*/ - case 0xA4: hl.b.h&=~0x10; cycles+=4; break; /*RES 4,H*/ - case 0xA5: hl.b.l&=~0x10; cycles+=4; break; /*RES 4,L*/ - case 0xA7: af.b.h&=~0x10; cycles+=4; break; /*RES 4,A*/ - case 0xA8: bc.b.h&=~0x20; cycles+=4; break; /*RES 5,B*/ - case 0xA9: bc.b.l&=~0x20; cycles+=4; break; /*RES 5,C*/ - case 0xAA: de.b.h&=~0x20; cycles+=4; break; /*RES 5,D*/ - case 0xAB: de.b.l&=~0x20; cycles+=4; break; /*RES 5,E*/ - case 0xAC: hl.b.h&=~0x20; cycles+=4; break; /*RES 5,H*/ - case 0xAD: hl.b.l&=~0x20; cycles+=4; break; /*RES 5,L*/ - case 0xAF: af.b.h&=~0x20; cycles+=4; break; /*RES 5,A*/ - case 0xB0: bc.b.h&=~0x40; cycles+=4; break; /*RES 6,B*/ - case 0xB1: bc.b.l&=~0x40; cycles+=4; break; /*RES 6,C*/ - case 0xB2: de.b.h&=~0x40; cycles+=4; break; /*RES 6,D*/ - case 0xB3: de.b.l&=~0x40; cycles+=4; break; /*RES 6,E*/ - case 0xB4: hl.b.h&=~0x40; cycles+=4; break; /*RES 6,H*/ - case 0xB5: hl.b.l&=~0x40; cycles+=4; break; /*RES 6,L*/ - case 0xB7: af.b.h&=~0x40; cycles+=4; break; /*RES 6,A*/ - case 0xB8: bc.b.h&=~0x80; cycles+=4; break; /*RES 7,B*/ - case 0xB9: bc.b.l&=~0x80; cycles+=4; break; /*RES 7,C*/ - case 0xBA: de.b.h&=~0x80; cycles+=4; break; /*RES 7,D*/ - case 0xBB: de.b.l&=~0x80; cycles+=4; break; /*RES 7,E*/ - case 0xBC: hl.b.h&=~0x80; cycles+=4; break; /*RES 7,H*/ - case 0xBD: hl.b.l&=~0x80; cycles+=4; break; /*RES 7,L*/ - case 0xBF: af.b.h&=~0x80; cycles+=4; break; /*RES 7,A*/ - - case 0x86: cycles+=4; temp=z80_readmem(hl.w)&~0x01; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*RES 0,(HL)*/ - case 0x8E: cycles+=4; temp=z80_readmem(hl.w)&~0x02; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*RES 1,(HL)*/ - case 0x96: cycles+=4; temp=z80_readmem(hl.w)&~0x04; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*RES 2,(HL)*/ - case 0x9E: cycles+=4; temp=z80_readmem(hl.w)&~0x08; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*RES 3,(HL)*/ - case 0xA6: cycles+=4; temp=z80_readmem(hl.w)&~0x10; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*RES 4,(HL)*/ - case 0xAE: cycles+=4; temp=z80_readmem(hl.w)&~0x20; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*RES 5,(HL)*/ - case 0xB6: cycles+=4; temp=z80_readmem(hl.w)&~0x40; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*RES 6,(HL)*/ - case 0xBE: cycles+=4; temp=z80_readmem(hl.w)&~0x80; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*RES 7,(HL)*/ - - case 0xC0: bc.b.h|=0x01; cycles+=4; break; /*SET 0,B*/ - case 0xC1: bc.b.l|=0x01; cycles+=4; break; /*SET 0,C*/ - case 0xC2: de.b.h|=0x01; cycles+=4; break; /*SET 0,D*/ - case 0xC3: de.b.l|=0x01; cycles+=4; break; /*SET 0,E*/ - case 0xC4: hl.b.h|=0x01; cycles+=4; break; /*SET 0,H*/ - case 0xC5: hl.b.l|=0x01; cycles+=4; break; /*SET 0,L*/ - case 0xC7: af.b.h|=0x01; cycles+=4; break; /*SET 0,A*/ - case 0xC8: bc.b.h|=0x02; cycles+=4; break; /*SET 1,B*/ - case 0xC9: bc.b.l|=0x02; cycles+=4; break; /*SET 1,C*/ - case 0xCA: de.b.h|=0x02; cycles+=4; break; /*SET 1,D*/ - case 0xCB: de.b.l|=0x02; cycles+=4; break; /*SET 1,E*/ - case 0xCC: hl.b.h|=0x02; cycles+=4; break; /*SET 1,H*/ - case 0xCD: hl.b.l|=0x02; cycles+=4; break; /*SET 1,L*/ - case 0xCF: af.b.h|=0x02; cycles+=4; break; /*SET 1,A*/ - case 0xD0: bc.b.h|=0x04; cycles+=4; break; /*SET 2,B*/ - case 0xD1: bc.b.l|=0x04; cycles+=4; break; /*SET 2,C*/ - case 0xD2: de.b.h|=0x04; cycles+=4; break; /*SET 2,D*/ - case 0xD3: de.b.l|=0x04; cycles+=4; break; /*SET 2,E*/ - case 0xD4: hl.b.h|=0x04; cycles+=4; break; /*SET 2,H*/ - case 0xD5: hl.b.l|=0x04; cycles+=4; break; /*SET 2,L*/ - case 0xD7: af.b.h|=0x04; cycles+=4; break; /*SET 2,A*/ - case 0xD8: bc.b.h|=0x08; cycles+=4; break; /*SET 3,B*/ - case 0xD9: bc.b.l|=0x08; cycles+=4; break; /*SET 3,C*/ - case 0xDA: de.b.h|=0x08; cycles+=4; break; /*SET 3,D*/ - case 0xDB: de.b.l|=0x08; cycles+=4; break; /*SET 3,E*/ - case 0xDC: hl.b.h|=0x08; cycles+=4; break; /*SET 3,H*/ - case 0xDD: hl.b.l|=0x08; cycles+=4; break; /*SET 3,L*/ - case 0xDF: af.b.h|=0x08; cycles+=4; break; /*SET 3,A*/ - case 0xE0: bc.b.h|=0x10; cycles+=4; break; /*SET 4,B*/ - case 0xE1: bc.b.l|=0x10; cycles+=4; break; /*SET 4,C*/ - case 0xE2: de.b.h|=0x10; cycles+=4; break; /*SET 4,D*/ - case 0xE3: de.b.l|=0x10; cycles+=4; break; /*SET 4,E*/ - case 0xE4: hl.b.h|=0x10; cycles+=4; break; /*SET 4,H*/ - case 0xE5: hl.b.l|=0x10; cycles+=4; break; /*SET 4,L*/ - case 0xE7: af.b.h|=0x10; cycles+=4; break; /*SET 4,A*/ - case 0xE8: bc.b.h|=0x20; cycles+=4; break; /*SET 5,B*/ - case 0xE9: bc.b.l|=0x20; cycles+=4; break; /*SET 5,C*/ - case 0xEA: de.b.h|=0x20; cycles+=4; break; /*SET 5,D*/ - case 0xEB: de.b.l|=0x20; cycles+=4; break; /*SET 5,E*/ - case 0xEC: hl.b.h|=0x20; cycles+=4; break; /*SET 5,H*/ - case 0xED: hl.b.l|=0x20; cycles+=4; break; /*SET 5,L*/ - case 0xEF: af.b.h|=0x20; cycles+=4; break; /*SET 5,A*/ - case 0xF0: bc.b.h|=0x40; cycles+=4; break; /*SET 6,B*/ - case 0xF1: bc.b.l|=0x40; cycles+=4; break; /*SET 6,C*/ - case 0xF2: de.b.h|=0x40; cycles+=4; break; /*SET 6,D*/ - case 0xF3: de.b.l|=0x40; cycles+=4; break; /*SET 6,E*/ - case 0xF4: hl.b.h|=0x40; cycles+=4; break; /*SET 6,H*/ - case 0xF5: hl.b.l|=0x40; cycles+=4; break; /*SET 6,L*/ - case 0xF7: af.b.h|=0x40; cycles+=4; break; /*SET 6,A*/ - case 0xF8: bc.b.h|=0x80; cycles+=4; break; /*SET 7,B*/ - case 0xF9: bc.b.l|=0x80; cycles+=4; break; /*SET 7,C*/ - case 0xFA: de.b.h|=0x80; cycles+=4; break; /*SET 7,D*/ - case 0xFB: de.b.l|=0x80; cycles+=4; break; /*SET 7,E*/ - case 0xFC: hl.b.h|=0x80; cycles+=4; break; /*SET 7,H*/ - case 0xFD: hl.b.l|=0x80; cycles+=4; break; /*SET 7,L*/ - case 0xFF: af.b.h|=0x80; cycles+=4; break; /*SET 7,A*/ - - case 0xC6: cycles+=4; temp=z80_readmem(hl.w)|0x01; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*SET 0,(HL)*/ - case 0xCE: cycles+=4; temp=z80_readmem(hl.w)|0x02; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*SET 1,(HL)*/ - case 0xD6: cycles+=4; temp=z80_readmem(hl.w)|0x04; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*SET 2,(HL)*/ - case 0xDE: cycles+=4; temp=z80_readmem(hl.w)|0x08; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*SET 3,(HL)*/ - case 0xE6: cycles+=4; temp=z80_readmem(hl.w)|0x10; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*SET 4,(HL)*/ - case 0xEE: cycles+=4; temp=z80_readmem(hl.w)|0x20; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*SET 5,(HL)*/ - case 0xF6: cycles+=4; temp=z80_readmem(hl.w)|0x40; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*SET 6,(HL)*/ - case 0xFE: cycles+=4; temp=z80_readmem(hl.w)|0x80; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*SET 7,(HL)*/ - - default: - break; -// printf("Bad CB opcode %02X at %04X\n",opcode,pc); -// z80_dumpregs(); -// exit(-1); - } - break; - - case 0xCC: /*CALL Z,xxxx*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - if (af.b.l&Z_FLAG) - { - cycles+=4; sp--; z80_writemem(sp,pc>>8); - cycles+=3; sp--; z80_writemem(sp,pc&0xFF); - pc=addr; - cycles+=3; - } - else - cycles+=3; - break; - case 0xCD: /*CALL xxxx*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - cycles+=4; sp--; z80_writemem(sp,pc>>8); - cycles+=3; sp--; z80_writemem(sp,pc&0xFF); - pc=addr; - cycles+=3; - break; - case 0xCE: /*ADC A,nn*/ - cycles+=4; temp=z80_readmem(pc++); - setadc(af.b.h,temp); - af.b.h+=temp+tempc; - cycles+=3; - break; - case 0xCF: /*RST 8*/ - cycles+=5; sp--; z80_writemem(sp,pc>>8); - cycles+=3; sp--; z80_writemem(sp,pc&0xFF); - pc=0x08; - cycles+=3; - break; - - case 0xD0: /*RET NC*/ - cycles+=5; - if (!(af.b.l&C_FLAG)) - { - pc=z80_readmem(sp); sp++; - cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; - cycles+=3; - } - break; - case 0xD1: /*POP DE*/ - cycles+=4; de.b.l=z80_readmem(sp); sp++; - cycles+=3; de.b.h=z80_readmem(sp); sp++; - cycles+=3; - break; - case 0xD2: /*JP NC*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - if (!(af.b.l&C_FLAG)) - pc=addr; - cycles+=3; - break; - case 0xD3: /*OUT (nn),A*/ - cycles+=4; addr=z80_readmem(pc++); - cycles+=3; z80out(addr,af.b.h); - cycles+=4; - break; - case 0xD4: /*CALL NC,xxxx*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - if (!(af.b.l&C_FLAG)) - { - cycles+=4; sp--; z80_writemem(sp,pc>>8); - cycles+=3; sp--; z80_writemem(sp,pc&0xFF); - pc=addr; - cycles+=3; - } - else - cycles+=3; - break; - case 0xD5: /*PUSH DE*/ - cycles+=5; sp--; z80_writemem(sp,de.b.h); - cycles+=3; sp--; z80_writemem(sp,de.b.l); - cycles+=3; - break; - case 0xD6: /*SUB A,nn*/ - cycles+=4; temp=z80_readmem(pc++); - z80_setsub(af.b.h,temp); - af.b.h-=temp; - cycles+=3; - break; - case 0xD7: /*RST 10*/ - cycles+=5; sp--; z80_writemem(sp,pc>>8); - cycles+=3; sp--; z80_writemem(sp,pc&0xFF); - pc=0x10; - cycles+=3; - break; - case 0xD8: /*RET C*/ - cycles+=5; - if (af.b.l&C_FLAG) - { - pc=z80_readmem(sp); sp++; - cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; - cycles+=3; - } - break; - case 0xD9: /*EXX*/ - addr=bc.w; bc.w=sbc.w; sbc.w=addr; - addr=de.w; de.w=sde.w; sde.w=addr; - addr=hl.w; hl.w=shl.w; shl.w=addr; - cycles+=4; - break; - case 0xDA: /*JP C*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - if (af.b.l&C_FLAG) - pc=addr; - cycles+=3; - break; - case 0xDB: /*IN A,(n)*/ - cycles+=4; temp=z80_readmem(pc++); - cycles+=3; af.b.h=z80in((af.b.h<<8)|temp); - cycles+=4; - break; - case 0xDC: /*CALL C,xxxx*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - if (af.b.l&C_FLAG) - { - cycles+=4; sp--; z80_writemem(sp,pc>>8); - cycles+=3; sp--; z80_writemem(sp,pc&0xFF); - pc=addr; - cycles+=3; - } - else - cycles+=3; - break; - - case 0xDD: /*More opcodes*/ - ir.b.l=((ir.b.l+1)&0x7F)|(ir.b.l&0x80); - cycles+=4; - opcode=z80_readmem(pc++); - switch (opcode) - { - case 0xCD: - pc--; -// cycles+=4; - break; - case 0x09: /*ADD IX,BC*/ - z80_setadd16(ix.w,bc.w); - ix.w+=bc.w; - cycles+=11; - break; - case 0x19: /*ADD IX,DE*/ - z80_setadd16(ix.w,de.w); - ix.w+=de.w; - cycles+=11; - break; - case 0x21: /*LD IX,nn*/ - cycles+=4; ix.b.l=z80_readmem(pc++); - cycles+=3; ix.b.h=z80_readmem(pc++); - cycles+=3; - break; - case 0x22: /*LD (nn),IX*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - cycles+=3; z80_writemem(addr,ix.b.l); - cycles+=3; z80_writemem(addr+1,ix.b.h); - cycles+=3; - break; - case 0x23: /*INC IX*/ - ix.w++; - cycles+=6; - break; - case 0x24: /*INC IXh*/ - setinc(ix.b.h); - ix.b.h++; - cycles+=4; - break; - case 0x25: /*DEC IXh*/ - setdec(ix.b.h); - ix.b.h--; - cycles+=4; - break; - case 0x26: /*LD IXh,nn*/ - cycles+=4; ix.b.h=z80_readmem(pc++); - cycles+=3; - break; - case 0x29: /*ADD IX,IX*/ - z80_setadd16(ix.w,ix.w); - ix.w+=ix.w; - cycles+=11; - break; - case 0x2A: /*LD IX,(nn)*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - cycles+=3; ix.b.l=z80_readmem(addr); - cycles+=3; ix.b.h=z80_readmem(addr+1); - cycles+=3; - break; - case 0x2B: /*DEC IX*/ - ix.w--; - cycles+=6; - break; - case 0x2C: /*INC IXl*/ - setinc(ix.b.l); - ix.b.l++; - cycles+=4; - break; - case 0x2D: /*DEC IXl*/ - setdec(ix.b.l); - ix.b.l--; - cycles+=4; - break; - case 0x2E: /*LD IXl,nn*/ - cycles+=4; ix.b.l=z80_readmem(pc++); - cycles+=3; - break; - case 0x34: /*INC (IX+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - addr+=ix.w; - cycles+=3; temp=z80_readmem(addr); - setinc(temp); - cycles+=5; z80_writemem(addr,temp+1); - cycles+=7; - break; - case 0x35: /*DEC (IX+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - addr+=ix.w; - cycles+=3; temp=z80_readmem(addr); - setdec(temp); - cycles+=5; z80_writemem(addr,temp-1); - cycles+=7; - break; - case 0x36: /*LD (IX+nn),nn*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=3; temp=z80_readmem(pc++); - cycles+=5; z80_writemem(ix.w+addr,temp); - cycles+=3; - break; - case 0x39: /*ADD IX,SP*/ - z80_setadd16(ix.w,sp); - ix.w+=sp; - cycles+=11; - break; - - case 0x46: /*LD B,(IX+nn)*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - intreg=(ix.w+addr)>>8; - cycles+=7; bc.b.h=z80_readmem(ix.w+addr); - cycles+=8; - break; - case 0x4E: /*LD C,(IX+nn)*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - intreg=(ix.w+addr)>>8; - cycles+=7; bc.b.l=z80_readmem(ix.w+addr); - cycles+=8; - break; - case 0x56: /*LD D,(IX+nn)*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - intreg=(ix.w+addr)>>8; - cycles+=7; de.b.h=z80_readmem(ix.w+addr); - cycles+=8; - break; - case 0x44: bc.b.h=ix.b.h; cycles+=3; break; /*LD B,IXh*/ - case 0x45: bc.b.h=ix.b.l; cycles+=3; break; /*LD B,IXl*/ - case 0x54: de.b.h=ix.b.h; cycles+=3; break; /*LD D,IXh*/ - case 0x55: de.b.h=ix.b.l; cycles+=3; break; /*LD D,IXl*/ - case 0x5C: de.b.l=ix.b.h; cycles+=3; break; /*LD E,IXh*/ - case 0x5D: de.b.l=ix.b.l; cycles+=3; break; /*LD E,IXl*/ - case 0x5E: /*LD E,(IX+nn)*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - intreg=(ix.w+addr)>>8; - cycles+=7; de.b.l=z80_readmem(ix.w+addr); - cycles+=8; - break; - case 0x66: /*LD H,(IX+nn)*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - intreg=(ix.w+addr)>>8; - cycles+=7; hl.b.h=z80_readmem(ix.w+addr); - cycles+=8; - break; - case 0x6E: /*LD L,(IX+nn)*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - intreg=(ix.w+addr)>>8; - cycles+=7; hl.b.l=z80_readmem(ix.w+addr); - cycles+=8; - break; - case 0x60: ix.b.h=bc.b.h; cycles+=3; break; /*LD IXh,B*/ - case 0x61: ix.b.h=bc.b.l; cycles+=3; break; /*LD IXh,C*/ - case 0x62: ix.b.h=de.b.h; cycles+=3; break; /*LD IXh,D*/ - case 0x63: ix.b.h=de.b.l; cycles+=3; break; /*LD IXh,E*/ - case 0x64: ix.b.h=hl.b.h; cycles+=3; break; /*LD IXh,H*/ - case 0x65: ix.b.h=hl.b.l; cycles+=3; break; /*LD IXh,L*/ - case 0x67: ix.b.h=af.b.h; cycles+=3; break; /*LD IXh,A*/ - case 0x68: ix.b.l=bc.b.h; cycles+=3; break; /*LD IXl,B*/ - case 0x69: ix.b.l=bc.b.l; cycles+=3; break; /*LD IXl,C*/ - case 0x6A: ix.b.l=de.b.h; cycles+=3; break; /*LD IXl,D*/ - case 0x6B: ix.b.l=de.b.l; cycles+=3; break; /*LD IXl,E*/ - case 0x6C: ix.b.l=hl.b.h; cycles+=3; break; /*LD IXl,H*/ - case 0x6D: ix.b.l=hl.b.l; cycles+=3; break; /*LD IXl,L*/ - case 0x6F: ix.b.l=af.b.h; cycles+=3; break; /*LD IXl,A*/ - case 0x70: /*LD (IX+nn),B*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=7; z80_writemem(ix.w+addr,bc.b.h); - cycles+=8; - break; - case 0x71: /*LD (IX+nn),C*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=7; z80_writemem(ix.w+addr,bc.b.l); - cycles+=8; - break; - case 0x72: /*LD (IX+nn),D*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=7; z80_writemem(ix.w+addr,de.b.h); - cycles+=8; - break; - case 0x73: /*LD (IX+nn),E*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=7; z80_writemem(ix.w+addr,de.b.l); - cycles+=8; - break; - case 0x74: /*LD (IX+nn),H*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=7; z80_writemem(ix.w+addr,hl.b.h); - cycles+=8; - break; - case 0x75: /*LD (IX+nn),L*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=7; z80_writemem(ix.w+addr,hl.b.l); - cycles+=8; - break; - case 0x77: /*LD (IX+nn),A*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=7; z80_writemem(ix.w+addr,af.b.h); - cycles+=8; - break; - case 0x7E: /*LD A,(IX+nn)*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=7; af.b.h=z80_readmem(ix.w+addr); - cycles+=8; - break; - case 0x7C: af.b.h=ix.b.h; cycles+=3; break; /*LD A,IXh*/ - case 0x7D: af.b.h=ix.b.l; cycles+=3; break; /*LD A,IXl*/ - - case 0x84: z80_setadd(af.b.h,ix.b.h); af.b.h+=ix.b.h; cycles+=3; break; /*ADD IXh*/ - case 0x85: z80_setadd(af.b.h,ix.b.l); af.b.h+=ix.b.l; cycles+=3; break; /*ADD IXl*/ - case 0x8C: setadc(af.b.h,ix.b.h); af.b.h+=ix.b.h+tempc; cycles+=3; break; /*ADC IXh*/ - case 0x8D: setadc(af.b.h,ix.b.l); af.b.h+=ix.b.l+tempc; cycles+=3; break; /*ADC IXl*/ - case 0x94: z80_setsub(af.b.h,ix.b.h); af.b.h-=ix.b.h; cycles+=3; break; /*SUB IXh*/ - case 0x95: z80_setsub(af.b.h,ix.b.l); af.b.h-=ix.b.l; cycles+=3; break; /*SUB IXl*/ - case 0x9C: setsbc(af.b.h,ix.b.h); af.b.h-=(ix.b.h+tempc); cycles+=3; break; /*SBC IXh*/ - case 0x9D: setsbc(af.b.h,ix.b.l); af.b.h-=(ix.b.l+tempc); cycles+=3; break; /*SBC IXl*/ - case 0xA4: setand(af.b.h&ix.b.h); af.b.h&=ix.b.h; cycles+=3; break; /*AND IXh*/ - case 0xA5: setand(af.b.h&ix.b.l); af.b.h&=ix.b.l; cycles+=3; break; /*AND IXl*/ - case 0xAC: setzn(af.b.h^ix.b.h); af.b.h^=ix.b.h; cycles+=3; break; /*XOR IXh*/ - case 0xAD: setzn(af.b.h^ix.b.l); af.b.h^=ix.b.l; cycles+=3; break; /*XOR IXl*/ - case 0xB4: setzn(af.b.h|ix.b.h); af.b.h|=ix.b.h; cycles+=3; break; /*OR IXh*/ - case 0xB5: setzn(af.b.h|ix.b.l); af.b.h|=ix.b.l; cycles+=3; break; /*OR IXl*/ - case 0xBC: setcp(af.b.h,ix.b.h); cycles+=3; break; /*CP IXh*/ - case 0xBD: setcp(af.b.h,ix.b.l); cycles+=3; break; /*CP IXl*/ - - case 0x86: /*ADD (IX+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=3; temp=z80_readmem(ix.w+addr); - z80_setadd(af.b.h,temp); - af.b.h+=temp; - cycles+=8; - break; - case 0x8E: /*ADC (IX+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=3; temp=z80_readmem(ix.w+addr); - setadc(af.b.h,temp); - af.b.h+=(temp+tempc); - cycles+=8; - break; - case 0x96: /*SUB (IX+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=3; temp=z80_readmem(ix.w+addr); - z80_setsub(af.b.h,temp); - af.b.h-=temp; - cycles+=8; - break; - case 0x9E: /*SBC (IX+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=3; temp=z80_readmem(ix.w+addr); - setsbc(af.b.h,temp); - af.b.h-=(temp+tempc); - cycles+=8; - break; - case 0xA6: /*AND (IX+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=3; temp=z80_readmem(ix.w+addr); - setand(af.b.h); - cycles+=8; - break; - case 0xAE: /*XOR (IX+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=3; temp=z80_readmem(ix.w+addr); - setzn(af.b.h); - cycles+=8; - break; - case 0xB6: /*OR (IX+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=3; temp=z80_readmem(ix.w+addr); - setzn(af.b.h); - cycles+=8; - break; - case 0xBE: /*CP (IX+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=3; temp=z80_readmem(ix.w+addr); - setcp(af.b.h,temp); - cycles+=8; - break; - - case 0xCB: /*More opcodes*/ - ir.b.l=((ir.b.l+1)&0x7F)|(ir.b.l&0x80); - cycles+=4; addr=z80_readmem(pc++); - if (addr&0x80) addr|=0xFF00; - cycles+=3; opcode=z80_readmem(pc++); - switch (opcode) - { - case 0x06: /*RLC (IX+nn)*/ - cycles+=5; temp=z80_readmem(addr+ix.w); - tempc=temp&0x80; - temp<<=1; - if (tempc) temp|=1; - setzn(temp); - if (tempc) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(addr+ix.w,temp); - cycles+=3; - break; - case 0x0E: /*RRC (IX+nn)*/ - cycles+=5; temp=z80_readmem(addr+ix.w); - tempc=temp&1; - temp>>=1; - if (tempc) temp|=0x80; - setzn(temp); - if (tempc) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(addr+ix.w,temp); - cycles+=3; - break; - case 0x16: /*RL (IX+nn)*/ - cycles+=5; temp=z80_readmem(addr+ix.w); - addr=temp&0x80; - temp<<=1; - if (tempc) temp|=1; - setzn(temp); - if (addr) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(addr+ix.w,temp); - cycles+=3; - break; - case 0x1E: /*RR (IX+nn)*/ - cycles+=5; temp=z80_readmem(addr+ix.w); - addr=temp&1; - temp>>=1; - if (tempc) temp|=0x80; - setzn(temp); - if (addr) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(addr+ix.w,temp); - cycles+=3; - break; - case 0x26: /*SLA (IX+nn)*/ - cycles+=5; temp=z80_readmem(addr+ix.w); - tempc=temp&0x80; - temp<<=1; - setzn(temp); - if (tempc) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(addr+ix.w,temp); - cycles+=3; - break; - case 0x2E: /*SRA (IX+nn)*/ - cycles+=5; temp=z80_readmem(addr+ix.w); - tempc=temp&1; - temp>>=1; - if (temp&0x40) temp|=0x80; - setzn(temp); - if (tempc) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(addr+ix.w,temp); - cycles+=3; - break; - case 0x3E: /*SRL (IX+nn)*/ - cycles+=5; temp=z80_readmem(addr+ix.w); - tempc=temp&1; - temp>>=1; - setzn(temp); - if (tempc) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(addr+ix.w,temp); - cycles+=3; - break; - - - case 0x46: cycles+=5; temp=z80_readmem(ix.w+addr); setbit2(temp&1,ix.w+addr); cycles+=4; break; /*BIT 0,(IX+nn)*/ - case 0x4E: cycles+=5; temp=z80_readmem(ix.w+addr); setbit2(temp&2,ix.w+addr); cycles+=4; break; /*BIT 1,(IX+nn)*/ - case 0x56: cycles+=5; temp=z80_readmem(ix.w+addr); setbit2(temp&4,ix.w+addr); cycles+=4; break; /*BIT 2,(IX+nn)*/ - case 0x5E: cycles+=5; temp=z80_readmem(ix.w+addr); setbit2(temp&8,ix.w+addr); cycles+=4; break; /*BIT 3,(IX+nn)*/ - case 0x66: cycles+=5; temp=z80_readmem(ix.w+addr); setbit2(temp&0x10,ix.w+addr); cycles+=4; break; /*BIT 4,(IX+nn)*/ - case 0x6E: cycles+=5; temp=z80_readmem(ix.w+addr); setbit2(temp&0x20,ix.w+addr); cycles+=4; break; /*BIT 5,(IX+nn)*/ - case 0x76: cycles+=5; temp=z80_readmem(ix.w+addr); setbit2(temp&0x40,ix.w+addr); cycles+=4; break; /*BIT 6,(IX+nn)*/ - case 0x7E: cycles+=5; temp=z80_readmem(ix.w+addr); setbit2(temp&0x80,ix.w+addr); cycles+=4; break; /*BIT 7,(IX+nn)*/ - - case 0x86: cycles+=5; temp=z80_readmem(ix.w+addr)&~1; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*RES 0,(IX+nn)*/ - case 0x8E: cycles+=5; temp=z80_readmem(ix.w+addr)&~2; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*RES 1,(IX+nn)*/ - case 0x96: cycles+=5; temp=z80_readmem(ix.w+addr)&~4; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*RES 2,(IX+nn)*/ - case 0x9E: cycles+=5; temp=z80_readmem(ix.w+addr)&~8; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*RES 3,(IX+nn)*/ - case 0xA6: cycles+=5; temp=z80_readmem(ix.w+addr)&~0x10; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*RES 4,(IX+nn)*/ - case 0xAE: cycles+=5; temp=z80_readmem(ix.w+addr)&~0x20; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*RES 5,(IX+nn)*/ - case 0xB6: cycles+=5; temp=z80_readmem(ix.w+addr)&~0x40; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*RES 6,(IX+nn)*/ - case 0xBE: cycles+=5; temp=z80_readmem(ix.w+addr)&~0x80; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*RES 7,(IX+nn)*/ - case 0xC6: cycles+=5; temp=z80_readmem(ix.w+addr)|1; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*SET 0,(IX+nn)*/ - case 0xCE: cycles+=5; temp=z80_readmem(ix.w+addr)|2; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*SET 1,(IX+nn)*/ - case 0xD6: cycles+=5; temp=z80_readmem(ix.w+addr)|4; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*SET 2,(IX+nn)*/ - case 0xDE: cycles+=5; temp=z80_readmem(ix.w+addr)|8; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*SET 3,(IX+nn)*/ - case 0xE6: cycles+=5; temp=z80_readmem(ix.w+addr)|0x10; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*SET 4,(IX+nn)*/ - case 0xEE: cycles+=5; temp=z80_readmem(ix.w+addr)|0x20; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*SET 5,(IX+nn)*/ - case 0xF6: cycles+=5; temp=z80_readmem(ix.w+addr)|0x40; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*SET 6,(IX+nn)*/ - case 0xFE: cycles+=5; temp=z80_readmem(ix.w+addr)|0x80; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*SET 7,(IX+nn)*/ - - default: - break; -// printf("Bad DD CB opcode %02X at %04X\n",opcode,pc); -// z80_dumpregs(); -// exit(-1); - } - break; - - case 0xE1: /*POP IX*/ - cycles+=4; ix.b.l=z80_readmem(sp); sp++; - cycles+=3; ix.b.h=z80_readmem(sp); sp++; - cycles+=3; - break; - case 0xE3: /*EX (SP),IX*/ - cycles+=4; addr=z80_readmem(sp); - cycles+=3; addr|=(z80_readmem(sp+1)<<8); - cycles+=4; z80_writemem(sp,ix.b.l); - cycles+=3; z80_writemem(sp+1,ix.b.h); - ix.w=addr; - cycles+=5; - break; - case 0xE5: /*PUSH IX*/ - cycles+=5; sp--; z80_writemem(sp,ix.b.h); - cycles+=3; sp--; z80_writemem(sp,ix.b.l); - cycles+=3; - break; - case 0xE9: /*JP (IX)*/ - pc=ix.w; - cycles+=4; - break; - - case 0xF9: /*LD SP,IX*/ - sp=ix.w; - cycles+=6; - break; - - default: - break; -// printf("Bad DD opcode %02X at %04X\n",opcode,pc); -// z80_dumpregs(); -// exit(-1); - } - break; - - case 0xDE: /*SBC A,nn*/ - cycles+=4; temp=z80_readmem(pc++); - setsbc(af.b.h,temp); - af.b.h-=(temp+tempc); - cycles+=3; - break; - case 0xDF: /*RST 18*/ - cycles+=5; sp--; z80_writemem(sp,pc>>8); - cycles+=3; sp--; z80_writemem(sp,pc&0xFF); - pc=0x18; - cycles+=3; - break; - - case 0xE0: /*RET PO*/ - cycles+=5; - if (!(af.b.l&V_FLAG)) - { - pc=z80_readmem(sp); sp++; - cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; - cycles+=3; - } - break; - case 0xE1: /*POP HL*/ - cycles+=4; hl.b.l=z80_readmem(sp); sp++; - cycles+=3; hl.b.h=z80_readmem(sp); sp++; - cycles+=3; - break; - case 0xE2: /*JP PO*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - if (!(af.b.l&V_FLAG)) - pc=addr; - cycles+=3; - break; - case 0xE3: /*EX (SP),HL*/ - cycles+=4; addr=z80_readmem(sp); - cycles+=3; addr|=(z80_readmem(sp+1)<<8); - cycles+=4; z80_writemem(sp,hl.b.l); - cycles+=3; z80_writemem(sp+1,hl.b.h); - hl.w=addr; - cycles+=5; - break; - case 0xE4: /*CALL PO,xxxx*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - if (!(af.b.l&V_FLAG)) - { - cycles+=4; sp--; z80_writemem(sp,pc>>8); - cycles+=3; sp--; z80_writemem(sp,pc&0xFF); - pc=addr; - cycles+=3; - } - else - cycles+=3; - break; - case 0xE5: /*PUSH HL*/ - cycles+=5; sp--; z80_writemem(sp,hl.b.h); - cycles+=3; sp--; z80_writemem(sp,hl.b.l); - cycles+=3; - break; - case 0xE6: /*AND nn*/ - cycles+=4; af.b.h&=z80_readmem(pc++); - setand(af.b.h); - cycles+=3; - break; - case 0xE7: /*RST 20*/ - cycles+=5; sp--; z80_writemem(sp,pc>>8); - cycles+=3; sp--; z80_writemem(sp,pc&0xFF); - pc=0x20; - cycles+=3; - break; - case 0xE8: /*RET PE*/ - cycles+=5; - if (af.b.l&V_FLAG) - { - pc=z80_readmem(sp); sp++; - cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; - cycles+=3; - } - break; - case 0xE9: /*JP (HL)*/ - pc=hl.w; - cycles+=4; - break; - case 0xEA: /*JP PE*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - if (af.b.l&V_FLAG) - pc=addr; - cycles+=3; - break; - case 0xEB: /*EX DE,HL*/ - addr=de.w; de.w=hl.w; hl.w=addr; - cycles+=4; - break; - case 0xEC: /*CALL PE,xxxx*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - if (af.b.l&V_FLAG) - { - cycles+=4; sp--; z80_writemem(sp,pc>>8); - cycles+=3; sp--; z80_writemem(sp,pc&0xFF); - pc=addr; - cycles+=3; - } - else - cycles+=3; - break; - - case 0xED: /*More opcodes*/ - ir.b.l=((ir.b.l+1)&0x7F)|(ir.b.l&0x80); - cycles+=4; - opcode=z80_readmem(pc++); - switch (opcode) - { - case 0x40: /*IN B,(C)*/ - cycles+=4; bc.b.h=z80in(bc.w); - setzn(bc.b.h); - cycles+=4; - break; - case 0x42: /*SBC HL,BC*/ - setsbc16(hl.w,bc.w); - hl.w-=(bc.w+tempc); - cycles+=11; - break; - case 0x43: /*LD (nn),BC*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - cycles+=3; z80_writemem(addr,bc.b.l); - cycles+=3; z80_writemem(addr+1,bc.b.h); - cycles+=3; - break; - case 0x44: /*NEG*/ - z80_setsub(0,af.b.h); - af.b.h=0-af.b.h; - cycles+=4; - break; - case 0x45: /*RETN*/ - output=0; - iff1=iff2; - cycles+=4; pc=z80_readmem(sp); sp++; - cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; - cycles+=3; - break; - case 0x47: /*LD I,A*/ - ir.b.h=af.b.h; - printf("I now %02X %04X\n",ir.b.h,ir.w); - cycles+=5; - break; - case 0x4A: /*ADC HL,BC*/ - setadc16(hl.w,bc.w); - hl.w+=(bc.w+tempc); - cycles+=11; - break; - case 0x4B: /*LD BC,(nn)*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - cycles+=3; bc.b.l=z80_readmem(addr); - cycles+=3; bc.b.h=z80_readmem(addr+1); - cycles+=3; - break; - case 0x4D: /*RETI*/ - cycles+=4; pc=z80_readmem(sp); sp++; - cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; - cycles+=3; - break; - case 0x4F: /*LD R,A*/ - ir.b.l=af.b.h; - cycles+=5; - break; - case 0x50: /*IN D,(C)*/ - cycles+=4; de.b.h=z80in(bc.w); - setzn(de.b.h); - cycles+=4; - break; - case 0x51: /*OUT (C),D*/ - cycles+=4; z80out(bc.w,de.b.h); - cycles+=4; - break; - case 0x52: /*SBC HL,DE*/ - setsbc16(hl.w,de.w); - hl.w-=(de.w+tempc); - cycles+=11; - break; - case 0x53: /*LD (nn),DE*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - cycles+=3; z80_writemem(addr,de.b.l); - cycles+=3; z80_writemem(addr+1,de.b.h); - cycles+=3; - break; - case 0x56: /*IM 1*/ - im=1; - cycles+=4; - break; - case 0x57: /*LD A,I*/ - af.b.h=ir.b.h; - cycles+=5; - break; - case 0x58: /*IN E,(C)*/ - cycles+=4; de.b.l=z80in(bc.w); - setzn(de.b.l); - cycles+=4; - break; - case 0x59: /*OUT (C),E*/ - cycles+=4; z80out(bc.w,de.b.l); - cycles+=4; - break; - case 0x5A: /*ADC HL,DE*/ - setadc16(hl.w,de.w); - hl.w+=(de.w+tempc); - cycles+=11; - break; - case 0x5B: /*LD DE,(nn)*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - cycles+=3; de.b.l=z80_readmem(addr); - cycles+=3; de.b.h=z80_readmem(addr+1); - cycles+=3; - break; - case 0x5E: /*IM 2*/ -// printf("IM 2\n"); - im=2; - cycles+=4; - break; - case 0x5F: /*LD A,R*/ - af.b.h=ir.b.l; - af.b.l&=C_FLAG; - af.b.l|=(af.b.h&0xA8); - if (!af.b.h) af.b.l|=Z_FLAG; - if (iff2 && !enterint) af.b.l|=V_FLAG; - cycles+=5; - break; - case 0x60: /*IN H,(C)*/ - cycles+=4; hl.b.h=z80in(bc.w); - setzn(hl.b.h); - cycles+=4; - break; - case 0x61: /*OUT (C),H*/ - cycles+=4; z80out(bc.w,hl.b.h); - cycles+=4; - break; - case 0x62: /*SBC HL,HL*/ - setsbc16(hl.w,hl.w); - hl.w-=(hl.w+tempc); - cycles+=11; - break; - case 0x67: /*RRD*/ - cycles+=4; addr=z80_readmem(hl.w)|((af.b.h&0xF)<<8); - addr=(addr>>4)|((addr<<8)&0xF00); - cycles+=3; z80_writemem(hl.w,addr&0xFF); - af.b.h=(af.b.h&0xF0)|(addr>>8); - setznc(af.b.h); - cycles+=7; - break; - case 0x69: /*OUT (C),L*/ - cycles+=4; z80out(bc.w,hl.b.l); - cycles+=4; - break; - case 0x6A: /*ADC HL,HL*/ - setadc16(hl.w,hl.w); - hl.w+=(hl.w+tempc); - cycles+=11; - break; - case 0x6F: /*RLD*/ - cycles+=4; addr=z80_readmem(hl.w)|((af.b.h&0xF)<<8); - addr=((addr<<4)&0xFF0)|(addr>>8); - cycles+=3; z80_writemem(hl.w,addr&0xFF); - af.b.h=(af.b.h&0xF0)|(addr>>8); - setznc(af.b.h); - cycles+=7; - break; - case 0x72: /*SBC HL,SP*/ - setsbc16(hl.w,sp); - hl.w-=(sp+tempc); - cycles+=11; - break; - case 0x73: /*LD (nn),SP*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - cycles+=3; z80_writemem(addr,sp); - cycles+=3; z80_writemem(addr+1,sp>>8); - cycles+=3; - break; - case 0x78: /*IN A,(C)*/ - cycles+=4; af.b.h=z80in(bc.w); - setzn(af.b.h); - cycles+=4; - break; - case 0x79: /*OUT (C),A*/ - cycles+=4; z80out(bc.w,af.b.h); - cycles+=4; - break; - case 0x7A: /*ADC HL,SP*/ - setadc16(hl.w,sp); - hl.w+=(sp+tempc); - cycles+=11; - break; - case 0x7B: /*LD SP,(nn)*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - cycles+=3; sp=z80_readmem(addr); - cycles+=3; sp|=(z80_readmem(addr+1)<<8); - cycles+=3; - break; - case 0xA0: /*LDI*/ - cycles+=4; temp=z80_readmem(hl.w++); - cycles+=3; z80_writemem(de.w,temp); de.w++; - bc.w--; - af.b.l&=~(H_FLAG|S_FLAG|V_FLAG); - if (bc.w) af.b.l|=V_FLAG; - cycles+=5; - break; - case 0xA1: /*CPI*/ - cycles+=4; temp=z80_readmem(hl.w++); - setcpED(af.b.h,temp); - bc.w--; - if (bc.w) af.b.l|=V_FLAG; - else af.b.l&=~V_FLAG; - cycles+=8; - break; - case 0xA2: /*INI*/ - cycles+=5; temp=z80in(bc.w); //z80_readmem(hl.w++); - cycles+=3; z80_writemem(hl.w++,temp); - af.b.l|=N_FLAG; - bc.b.h--; - if (!bc.b.h) af.b.l|=Z_FLAG; - else af.b.l&=~Z_FLAG; - af.b.l|=S_FLAG; - cycles+=4; - break; - case 0xA3: /*OUTI*/ - cycles+=5; temp=z80_readmem(hl.w++); - cycles+=3; z80out(bc.w,temp); - bc.b.h--; - if (!bc.b.h) af.b.l|=Z_FLAG; - else af.b.l&=~Z_FLAG; - af.b.l|=S_FLAG; - cycles+=4; - break; - case 0xA8: /*LDD*/ - cycles+=4; temp=z80_readmem(hl.w--); - cycles+=3; z80_writemem(de.w,temp); de.w--; - bc.w--; - af.b.l&=~(H_FLAG|S_FLAG|V_FLAG); - if (bc.w) af.b.l|=V_FLAG; - cycles+=5; - break; - case 0xAB: /*OUTD*/ - cycles+=5; temp=z80_readmem(hl.w--); - cycles+=3; z80out(bc.w,temp); - bc.b.h--; - if (!bc.b.h) af.b.l|=Z_FLAG; - else af.b.l&=~Z_FLAG; - af.b.l|=S_FLAG; - cycles+=4; - break; - case 0xB0: /*LDIR*/ - cycles+=4; temp=z80_readmem(hl.w++); - cycles+=3; z80_writemem(de.w,temp); de.w++; - bc.w--; - if (bc.w) { pc-=2; cycles+=5; } - af.b.l&=~(H_FLAG|S_FLAG|V_FLAG); - cycles+=5; - break; - case 0xB1: /*CPIR*/ - cycles+=4; temp=z80_readmem(hl.w++); - bc.w--; - setcpED(af.b.h,temp); - if (bc.w && (af.b.h!=temp)) - { - pc-=2; - cycles+=13; - af.b.l&=~V_FLAG; - } - else - { - af.b.l|=V_FLAG; - cycles+=8; - } - break; - case 0xB8: /*LDDR*/ - cycles+=4; temp=z80_readmem(hl.w--); - cycles+=3; z80_writemem(de.w,temp); de.w--; - bc.w--; - if (bc.w) { pc-=2; cycles+=5; } - af.b.l&=~(H_FLAG|S_FLAG|V_FLAG); - cycles+=5; - break; - case 0xB9: /*CPDR*/ - cycles+=4; temp=z80_readmem(hl.w--); - bc.w--; - setcpED(af.b.h,temp); - if (bc.w && (af.b.h!=temp)) - { - pc-=2; - cycles+=13; - af.b.l&=~V_FLAG; - } - else - { - af.b.l|=V_FLAG; - cycles+=8; - } - break; - - default: - break; -// printf("Bad ED opcode %02X at %04X\n",opcode,pc); -// z80_dumpregs(); -// exit(-1); - } - break; - - case 0xEE: /*XOR nn*/ - cycles+=4; af.b.h^=z80_readmem(pc++); - af.b.l&=~3; - setzn(af.b.h); - cycles+=3; - break; - case 0xEF: /*RST 28*/ - cycles+=5; sp--; z80_writemem(sp,pc>>8); - cycles+=3; sp--; z80_writemem(sp,pc&0xFF); - pc=0x28; - cycles+=3; - break; - - case 0xF0: /*RET P*/ - cycles+=5; - if (!(af.b.l&N_FLAG)) - { - pc=z80_readmem(sp); sp++; - cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; - cycles+=3; - } - break; - case 0xF1: /*POP AF*/ - cycles+=4; af.b.l=z80_readmem(sp); sp++; - cycles+=3; af.b.h=z80_readmem(sp); sp++; - cycles+=3; - break; - case 0xF2: /*JP P*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - if (!(af.b.l&N_FLAG)) - pc=addr; - cycles+=3; - break; - case 0xF3: /*DI*/ - iff1=iff2=0; - cycles+=4; - break; - case 0xF4: /*CALL P,xxxx*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - if (!(af.b.l&N_FLAG)) - { - cycles+=4; sp--; z80_writemem(sp,pc>>8); - cycles+=3; sp--; z80_writemem(sp,pc&0xFF); - pc=addr; - cycles+=3; - } - else - cycles+=3; - break; - case 0xF5: /*PUSH AF*/ - cycles+=5; sp--; z80_writemem(sp,af.b.h); - cycles+=3; sp--; z80_writemem(sp,af.b.l); - cycles+=3; - break; - case 0xF6: /*OR nn*/ - cycles+=4; af.b.h|=z80_readmem(pc++); - af.b.l&=~3; - setzn(af.b.h); - cycles+=3; - break; - case 0xF7: /*RST 30*/ - cycles+=5; sp--; z80_writemem(sp,pc>>8); - cycles+=3; sp--; z80_writemem(sp,pc&0xFF); - pc=0x30; - cycles+=3; - break; - case 0xF8: /*RET M*/ - cycles+=5; - if (af.b.l&N_FLAG) - { - pc=z80_readmem(sp); sp++; - cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; - cycles+=3; - } - break; - case 0xF9: /*LD SP,HL*/ - sp=hl.w; - cycles+=6; - break; - case 0xFA: /*JP M*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - if (af.b.l&N_FLAG) - pc=addr; - cycles+=3; - break; - case 0xFB: /*EI*/ - iff1=iff2=1; - cycles+=4; - break; - case 0xFC: /*CALL M,xxxx*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - if (af.b.l&N_FLAG) - { - cycles+=4; sp--; z80_writemem(sp,pc>>8); - cycles+=3; sp--; z80_writemem(sp,pc&0xFF); - pc=addr; - cycles+=3; - } - else - cycles+=3; - break; - - case 0xFD: /*More opcodes*/ - ir.b.l=((ir.b.l+1)&0x7F)|(ir.b.l&0x80); - cycles+=4; - opcode=z80_readmem(pc++); - switch (opcode) - { - case 0x3A: - pc--; - break; - - case 0x09: /*ADD IY,BC*/ - z80_setadd16(iy.w,bc.w); - iy.w+=bc.w; - cycles+=11; - break; - case 0x19: /*ADD IY,DE*/ - z80_setadd16(iy.w,de.w); - iy.w+=de.w; - cycles+=11; - break; - case 0x21: /*LD IY,nn*/ - cycles+=4; iy.b.l=z80_readmem(pc++); - cycles+=3; iy.b.h=z80_readmem(pc++); - cycles+=3; - break; - case 0x22: /*LD (nn),IY*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - cycles+=3; z80_writemem(addr,iy.b.l); - cycles+=3; z80_writemem(addr+1,iy.b.h); - cycles+=3; - break; - case 0x23: /*INC IY*/ - iy.w++; - cycles+=6; - break; - case 0x24: /*INC IYh*/ - setinc(iy.b.h); - iy.b.h++; - cycles+=4; - break; - case 0x25: /*DEC IYh*/ - setdec(iy.b.h); - iy.b.h--; - cycles+=4; - break; - case 0x26: /*LD IYh,nn*/ - cycles+=4; iy.b.h=z80_readmem(pc++); - cycles+=3; - break; - case 0x29: /*ADD IY,IY*/ - z80_setadd16(iy.w,iy.w); - iy.w+=iy.w; - cycles+=11; - break; - case 0x2A: /*LD IY,(nn)*/ - cycles+=4; addr=z80_readmem(pc); - cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; - cycles+=3; iy.b.l=z80_readmem(addr); - cycles+=3; iy.b.h=z80_readmem(addr+1); - cycles+=3; - break; - case 0x2B: /*DEC IY*/ - iy.w--; - cycles+=6; - break; - case 0x2C: /*INC IYl*/ - setinc(iy.b.l); - iy.b.l++; - cycles+=4; - break; - case 0x2D: /*DEC IYl*/ - setdec(iy.b.l); - iy.b.l--; - cycles+=4; - break; - case 0x2E: /*LD IYl,nn*/ - cycles+=4; iy.b.l=z80_readmem(pc++); - cycles+=3; - break; - case 0x34: /*INC (IY+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - addr+=iy.w; - cycles+=3; temp=z80_readmem(addr); - setinc(temp); - cycles+=5; z80_writemem(addr,temp+1); - cycles+=7; - break; - case 0x35: /*DEC (IY+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - addr+=iy.w; - cycles+=3; temp=z80_readmem(addr); - setdec(temp); - cycles+=5; z80_writemem(addr,temp-1); - cycles+=7; - break; - case 0x36: /*LD (IY+nn),nn*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=3; temp=z80_readmem(pc++); - cycles+=5; z80_writemem(iy.w+addr,temp); - cycles+=3; - break; - case 0x39: /*ADD IY,SP*/ -// output=1; - z80_setadd16(iy.w,sp); - iy.w+=sp; - cycles+=11; - break; - - case 0x44: bc.b.h=iy.b.h; cycles+=3; break; /*LD B,IYh*/ - case 0x45: bc.b.h=iy.b.l; cycles+=3; break; /*LD B,IYl*/ - case 0x4C: bc.b.l=iy.b.h; cycles+=3; break; /*LD C,IYh*/ - case 0x4D: bc.b.l=iy.b.l; cycles+=3; break; /*LD C,IYl*/ - case 0x54: de.b.h=iy.b.h; cycles+=3; break; /*LD D,IYh*/ - case 0x55: de.b.h=iy.b.l; cycles+=3; break; /*LD D,IYl*/ - case 0x5C: de.b.l=iy.b.h; cycles+=3; break; /*LD E,IYh*/ - case 0x5D: de.b.l=iy.b.l; cycles+=3; break; /*LD E,IYl*/ - - case 0x46: /*LD B,(IY+nn)*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - intreg=(iy.w+addr)>>8; - cycles+=7; bc.b.h=z80_readmem(iy.w+addr); - cycles+=8; - break; - case 0x4E: /*LD C,(IY+nn)*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - intreg=(iy.w+addr)>>8; - cycles+=7; bc.b.l=z80_readmem(iy.w+addr); - cycles+=8; - break; - case 0x56: /*LD D,(IY+nn)*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - intreg=(iy.w+addr)>>8; - cycles+=7; de.b.h=z80_readmem(iy.w+addr); - cycles+=8; - break; - case 0x5E: /*LD E,(IY+nn)*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - intreg=(iy.w+addr)>>8; - cycles+=7; de.b.l=z80_readmem(iy.w+addr); - cycles+=8; - break; - case 0x66: /*LD H,(IY+nn)*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - intreg=(iy.w+addr)>>8; - cycles+=7; hl.b.h=z80_readmem(iy.w+addr); - cycles+=8; - break; - case 0x6E: /*LD L,(IY+nn)*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - intreg=(iy.w+addr)>>8; - cycles+=7; hl.b.l=z80_readmem(iy.w+addr); - cycles+=8; - break; - case 0x60: iy.b.h=bc.b.h; cycles+=3; break; /*LD IYh,B*/ - case 0x61: iy.b.h=bc.b.l; cycles+=3; break; /*LD IYh,C*/ - case 0x62: iy.b.h=de.b.h; cycles+=3; break; /*LD IYh,D*/ - case 0x63: iy.b.h=de.b.l; cycles+=3; break; /*LD IYh,E*/ - case 0x64: iy.b.h=hl.b.h; cycles+=3; break; /*LD IYh,H*/ - case 0x65: iy.b.h=hl.b.l; cycles+=3; break; /*LD IYh,L*/ - case 0x67: iy.b.h=af.b.h; cycles+=3; break; /*LD IYh,A*/ - case 0x68: iy.b.l=bc.b.h; cycles+=3; break; /*LD IYl,B*/ - case 0x69: iy.b.l=bc.b.l; cycles+=3; break; /*LD IYl,C*/ - case 0x6A: iy.b.l=de.b.h; cycles+=3; break; /*LD IYl,D*/ - case 0x6B: iy.b.l=de.b.l; cycles+=3; break; /*LD IYl,E*/ - case 0x6C: iy.b.l=hl.b.h; cycles+=3; break; /*LD IYl,H*/ - case 0x6D: iy.b.l=hl.b.l; cycles+=3; break; /*LD IYl,L*/ - case 0x6F: iy.b.l=af.b.h; cycles+=3; break; /*LD IYl,A*/ - - case 0x84: z80_setadd(af.b.h,iy.b.h); af.b.h+=iy.b.h; cycles+=3; break; /*ADD IYh*/ - case 0x85: z80_setadd(af.b.h,iy.b.l); af.b.h+=iy.b.l; cycles+=3; break; /*ADD IYl*/ - case 0x8C: setadc(af.b.h,iy.b.h); af.b.h+=iy.b.h+tempc; cycles+=3; break; /*ADC IYh*/ - case 0x8D: setadc(af.b.h,iy.b.l); af.b.h+=iy.b.l+tempc; cycles+=3; break; /*ADC IYl*/ - case 0x94: z80_setsub(af.b.h,iy.b.h); af.b.h-=iy.b.h; cycles+=3; break; /*SUB IYh*/ - case 0x95: z80_setsub(af.b.h,iy.b.l); af.b.h-=iy.b.l; cycles+=3; break; /*SUB IYl*/ - case 0x9C: setsbc(af.b.h,iy.b.h); af.b.h-=(iy.b.h+tempc); cycles+=3; break; /*SBC IYh*/ - case 0x9D: setsbc(af.b.h,iy.b.l); af.b.h-=(iy.b.l+tempc); cycles+=3; break; /*SBC IYl*/ - case 0xA4: setand(af.b.h&iy.b.h); af.b.h&=iy.b.h; cycles+=3; break; /*AND IYh*/ - case 0xA5: setand(af.b.h&iy.b.l); af.b.h&=iy.b.l; cycles+=3; break; /*AND IYl*/ - case 0xAC: setzn(af.b.h^iy.b.h); af.b.h^=iy.b.h; cycles+=3; break; /*XOR IYh*/ - case 0xAD: setzn(af.b.h^iy.b.l); af.b.h^=iy.b.l; cycles+=3; break; /*XOR IYl*/ - case 0xB4: setzn(af.b.h|iy.b.h); af.b.h|=iy.b.h; cycles+=3; break; /*OR IYh*/ - case 0xB5: setzn(af.b.h|iy.b.l); af.b.h|=iy.b.l; cycles+=3; break; /*OR IYl*/ - case 0xBC: setcp(af.b.h,iy.b.h); cycles+=3; break; /*CP IYh*/ - case 0xBD: setcp(af.b.h,iy.b.l); cycles+=3; break; /*CP IYl*/ - - case 0x70: /*LD (IY+nn),B*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=7; z80_writemem(iy.w+addr,bc.b.h); - cycles+=8; - break; - case 0x71: /*LD (IY+nn),C*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=7; z80_writemem(iy.w+addr,bc.b.l); - cycles+=8; - break; - case 0x72: /*LD (IY+nn),D*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=7; z80_writemem(iy.w+addr,de.b.h); - cycles+=8; - break; - case 0x73: /*LD (IY+nn),E*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=7; z80_writemem(iy.w+addr,de.b.l); - cycles+=8; - break; - case 0x74: /*LD (IY+nn),H*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=7; z80_writemem(iy.w+addr,hl.b.h); - cycles+=8; - break; - case 0x75: /*LD (IY+nn),L*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=7; z80_writemem(iy.w+addr,hl.b.l); - cycles+=8; - break; - case 0x77: /*LD (IY+nn),A*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=7; z80_writemem(iy.w+addr,af.b.h); - cycles+=8; - break; - case 0x7E: /*LD A,(IY+nn)*/ - addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=7; af.b.h=z80_readmem(iy.w+addr); - cycles+=8; - break; - - case 0x7C: af.b.h=iy.b.h; cycles+=3; break; /*LD A,IYh*/ - case 0x7D: af.b.h=iy.b.l; cycles+=3; break; /*LD A,IYl*/ - - case 0x86: /*ADD (IY+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=3; temp=z80_readmem(iy.w+addr); - z80_setadd(af.b.h,temp); - af.b.h+=temp; - cycles+=8; - break; - case 0x8E: /*ADC (IY+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=3; temp=z80_readmem(iy.w+addr); - setadc(af.b.h,temp); - af.b.h+=(temp+tempc); - cycles+=8; - break; - case 0x96: /*SUB (IY+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=3; temp=z80_readmem(iy.w+addr); - z80_setsub(af.b.h,temp); - af.b.h-=temp; - cycles+=8; - break; - case 0x9E: /*SBC (IY+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=3; temp=z80_readmem(iy.w+addr); - setsbc(af.b.h,temp); - af.b.h-=(temp+tempc); - cycles+=8; - break; - case 0xA6: /*AND (IY+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=3; af.b.h&=z80_readmem(iy.w+addr); - setand(af.b.h); - cycles+=8; - break; - case 0xAE: /*XOR (IY+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=3; af.b.h^=z80_readmem(iy.w+addr); - setzn(af.b.h); - cycles+=8; - break; - case 0xB6: /*OR (IY+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=3; af.b.h|=z80_readmem(iy.w+addr); - setzn(af.b.h); - cycles+=8; - break; - case 0xBE: /*CP (IY+nn)*/ - cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; - cycles+=3; temp=z80_readmem(iy.w+addr); - setcp(af.b.h,temp); - cycles+=8; - break; - - case 0xCB: /*More opcodes*/ - ir.b.l=((ir.b.l+1)&0x7F)|(ir.b.l&0x80); - cycles+=4; addr=z80_readmem(pc++); - if (addr&0x80) addr|=0xFF00; - cycles+=3; opcode=z80_readmem(pc++); - switch (opcode) - { - case 0x06: /*RLC (IY+nn)*/ - cycles+=5; temp=z80_readmem(addr+iy.w); - tempc=temp&0x80; - temp<<=1; - if (tempc) temp|=1; - setzn(temp); - if (tempc) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(addr+iy.w,temp); - cycles+=3; - break; - case 0x0E: /*RRC (IY+nn)*/ - cycles+=5; temp=z80_readmem(addr+iy.w); - tempc=temp&1; - temp>>=1; - if (tempc) temp|=0x80; - setzn(temp); - if (tempc) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(addr+iy.w,temp); - cycles+=3; - break; - case 0x16: /*RL (IY+nn)*/ - cycles+=5; temp=z80_readmem(addr+iy.w); - addr=temp&0x80; - temp<<=1; - if (tempc) temp|=1; - setzn(temp); - if (addr) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(addr+iy.w,temp); - cycles+=3; - break; - case 0x1E: /*RR (IY+nn)*/ - cycles+=5; temp=z80_readmem(addr+iy.w); - addr=temp&1; - temp>>=1; - if (tempc) temp|=0x80; - setzn(temp); - if (addr) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(addr+iy.w,temp); - cycles+=3; - break; - case 0x2E: /*SRA (IY+nn)*/ - cycles+=5; temp=z80_readmem(addr+iy.w); - tempc=temp&1; - temp>>=1; - if (temp&0x40) temp|=0x80; - setzn(temp); - if (tempc) af.b.l|=C_FLAG; - cycles+=4; z80_writemem(addr+iy.w,temp); - cycles+=3; - break; - - case 0x46: cycles+=5; temp=z80_readmem(iy.w+addr); setbit2(temp&1,iy.w+addr); cycles+=4; break; /*BIT 0,(iy+nn)*/ - case 0x4E: cycles+=5; temp=z80_readmem(iy.w+addr); setbit2(temp&2,iy.w+addr); cycles+=4; break; /*BIT 1,(iy+nn)*/ - case 0x56: cycles+=5; temp=z80_readmem(iy.w+addr); setbit2(temp&4,iy.w+addr); cycles+=4; break; /*BIT 2,(iy+nn)*/ - case 0x5E: cycles+=5; temp=z80_readmem(iy.w+addr); setbit2(temp&8,iy.w+addr); cycles+=4; break; /*BIT 3,(iy+nn)*/ - case 0x66: cycles+=5; temp=z80_readmem(iy.w+addr); setbit2(temp&0x10,iy.w+addr); cycles+=4; break; /*BIT 4,(iy+nn)*/ - case 0x6E: cycles+=5; temp=z80_readmem(iy.w+addr); setbit2(temp&0x20,iy.w+addr); cycles+=4; break; /*BIT 5,(iy+nn)*/ - case 0x76: cycles+=5; temp=z80_readmem(iy.w+addr); setbit2(temp&0x40,iy.w+addr); cycles+=4; break; /*BIT 6,(iy+nn)*/ - case 0x7E: cycles+=5; temp=z80_readmem(iy.w+addr); setbit2(temp&0x80,iy.w+addr); cycles+=4; break; /*BIT 7,(iy+nn)*/ - - case 0x86: cycles+=5; temp=z80_readmem(iy.w+addr)&~1; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*RES 0,(iy+nn)*/ - case 0x8E: cycles+=5; temp=z80_readmem(iy.w+addr)&~2; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*RES 1,(iy+nn)*/ - case 0x96: cycles+=5; temp=z80_readmem(iy.w+addr)&~4; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*RES 2,(iy+nn)*/ - case 0x9E: cycles+=5; temp=z80_readmem(iy.w+addr)&~8; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*RES 3,(iy+nn)*/ - case 0xA6: cycles+=5; temp=z80_readmem(iy.w+addr)&~0x10; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*RES 4,(iy+nn)*/ - case 0xAE: cycles+=5; temp=z80_readmem(iy.w+addr)&~0x20; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*RES 5,(iy+nn)*/ - case 0xB6: cycles+=5; temp=z80_readmem(iy.w+addr)&~0x40; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*RES 6,(iy+nn)*/ - case 0xBE: cycles+=5; temp=z80_readmem(iy.w+addr)&~0x80; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*RES 7,(iy+nn)*/ - case 0xC6: cycles+=5; temp=z80_readmem(iy.w+addr)|1; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*SET 0,(iy+nn)*/ - case 0xCE: cycles+=5; temp=z80_readmem(iy.w+addr)|2; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*SET 1,(iy+nn)*/ - case 0xD6: cycles+=5; temp=z80_readmem(iy.w+addr)|4; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*SET 2,(iy+nn)*/ - case 0xDE: cycles+=5; temp=z80_readmem(iy.w+addr)|8; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*SET 3,(iy+nn)*/ - case 0xE6: cycles+=5; temp=z80_readmem(iy.w+addr)|0x10; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*SET 4,(iy+nn)*/ - case 0xEE: cycles+=5; temp=z80_readmem(iy.w+addr)|0x20; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*SET 5,(iy+nn)*/ - case 0xF6: cycles+=5; temp=z80_readmem(iy.w+addr)|0x40; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*SET 6,(iy+nn)*/ - case 0xFE: cycles+=5; temp=z80_readmem(iy.w+addr)|0x80; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*SET 7,(iy+nn)*/ - - default: - break; -// printf("Bad FD CB opcode %02X at %04X\n",opcode,pc); -// z80_dumpregs(); -// exit(-1); - } - break; - - case 0xE1: /*POP IY*/ - cycles+=4; iy.b.l=z80_readmem(sp); sp++; - cycles+=3; iy.b.h=z80_readmem(sp); sp++; - cycles+=3; - break; - case 0xE3: /*EX (SP),IY*/ - cycles+=4; addr=z80_readmem(sp); - cycles+=3; addr|=(z80_readmem(sp+1)<<8); - cycles+=4; z80_writemem(sp,iy.b.l); - cycles+=3; z80_writemem(sp+1,iy.b.h); - iy.w=addr; - cycles+=5; - break; - case 0xE5: /*PUSH IY*/ - cycles+=5; sp--; z80_writemem(sp,iy.b.h); - cycles+=3; sp--; z80_writemem(sp,iy.b.l); - cycles+=3; - break; - case 0xE9: /*JP (IY)*/ - pc=iy.w; - cycles+=4; - break; - - case 0xF9: /*LD SP,IY*/ - sp=iy.w; - cycles+=6; - break; - -/* case 0x95: - ir.b.l--; - pc--; - cycles+=4; - break;*/ - - default: - break; -// printf("Bad FD opcode %02X at %04X\n",opcode,pc); -// z80_dumpregs(); -// exit(-1); - } - break; - - case 0xFE: /*CP nn*/ - cycles+=4; temp=z80_readmem(pc++); - setcp(af.b.h,temp); - cycles+=3; - break; - case 0xFF: /*RST 38*/ - cycles+=5; sp--; z80_writemem(sp,pc>>8); - cycles+=3; sp--; z80_writemem(sp,pc&0xFF); - pc=0x38; - cycles+=3; - break; - - default: - break; -// printf("Bad opcode %02X at %04X\n",opcode,pc); -// z80_dumpregs(); -// z80_mem_dump(); -// exit(-1); - } -/* if (pc==0) - { - printf("PC = 0\n"); - z80_dumpregs(); - exit(-1); - }*/ -// if (ins==200000) { z80_dumpregs(); exit(-1); } -// if (pc==0xC3CF) output=1; -// if (pc==0x90B7) { z80_dumpregs(); exit(-1); } -// if (pc==0x8066) { z80_dumpregs(); exit(-1); } -// if (output) ins++; - ins++; -// if (ins==107000) output=1; -// if (ins==108000) output=0; -// if (pc==0xC8D7) output=1; -// if (pc==0xC8E7) output=0; -// if (ins==11329) output=1; - if (output) printf("%04X : %04X %04X %04X %04X %04X %04X %04X %04X %02X\n",pc,af.w&0xFF00,bc.w,de.w,hl.w,ix.w,iy.w,sp,ir.w,opcode); -// if ((pc<0x37) && !(pc&7)) printf("RST %02X\n",pc); -// if (pc==8) { z80_dumpregs(); exit(-1); } -// if (pc==0xC3DC) output=1; -// if (ins==500) { z80_dumpregs(); exit(-1); } - if (enterint) - { -// printf("Interrupt at %04X IM %i\n",pc,im); - iff2=iff1; - iff1=0; - sp--; z80_writemem(sp,pc>>8); - sp--; z80_writemem(sp,pc&0xFF); - switch (im) - { - case 0: case 1: pc=0x38; break; - case 2: -// printf("IM2 %04X %02X %02X %02X\n",ir.w,z80_readmem(ir.w|0xFF),z80_readmem(ir.w&~0xFF),z80_readmem((ir.w|0xFF)+1)); - pc=z80_readmem(0xFFFE)|(z80_readmem(0xFFFF)<<8); -// pc=z80_readmem(ir.w|0xFF); -// pc|=(z80_readmem((ir.w|0xFF)+1)<<8); -// printf("PC now %04X\n",pc); - cycles+=8; - break; - } -// printf("PC now %04X\n",pc); - z80int=enterint=0; - cycles+=11; - } - if (tube_irq&2 && !z80_oldnmi) - { -// printf("NMI at %04X IM %i\n",pc,im); - iff2=iff1; - iff1=0; - sp--; z80_writemem(sp,pc>>8); - sp--; z80_writemem(sp,pc&0xFF); - pc=0x66; - tuberomin=1; -// printf("PC now %04X\n",pc); - z80int=enterint=0; - cycles+=11; -// output=1; - } - z80_oldnmi=tube_irq&2; -// pollula(cycles); - tubecycles-=cycles; - } -} +/*B-em v2.2 by Tom Walker + Z80 emulation + I can't remember what emulator I originally wrote this for... probably ZX82 + I think a few bugs left*/ + +#include +#include + +#include "b-em.h" +#include "tube.h" +#include "z80.h" +#include "daa.h" + +#define pc z80pc +#define ins z80ins +#define output z80output +#define cyc z80cyc +#define cycles z80cycles + +#define printf rpclog + +/*CPU*/ +typedef union +{ + uint16_t w; + struct + { + uint8_t l,h; + } b; +} z80reg; + +static z80reg af,bc,de,hl,ix,iy,ir,saf,sbc,sde,shl; +static uint16_t pc,sp; +static int iff1,iff2; +static int z80int; +static int im; +static uint8_t z80ram[0x10000]; +static uint8_t z80rom[4096]; + +static int z80_oldnmi; + +#define N_FLAG 0x80 +#define Z_FLAG 0x40 +#define H_FLAG 0x10 +#define P_FLAG 0x04 +#define V_FLAG 0x04 +#define S_FLAG 0x02 +#define C_FLAG 0x01 + +static int cycles; +static uint16_t opc,oopc; +static int tempc; +static int output=0; +static int ins=0; +static uint8_t znptable[256],znptablenv[256],znptable16[65536]; +static uint8_t intreg; + +static int tuberomin; + +static inline uint8_t z80_readmem(uint16_t a) +{ +// printf("Read Z80 %04X %i\n",a,tuberomin); + if (a>=0x8000) tuberomin=0; + if (tuberomin && a<0x1000) return z80rom[a&0xFFF]; + return z80ram[a]; +} + +static inline void z80_writemem(uint16_t a, uint8_t v) +{ +// printf("Write Z80 %04X %02X %04X\n",a,v,pc); + z80ram[a]=v; +} + +int endtimeslice; +static void z80out(uint16_t a, uint8_t v) +{ + if ((a&0xFF)<8) + { +// printf("Z80 out %04X %02X\n",a,v); + tube_parasite_write(a,v); + endtimeslice=1; + } +} + +static uint8_t z80in(uint16_t a) +{ + if ((a&0xFF)<8) + { +// printf("Z80 read tube %04X\n",a); + if ((a&0xFF)==2) tuberomin=1; + if ((a&0xFF)==6) tuberomin=0; + return tube_parasite_read(a); + } + return 0; +} + +static inline void setzn(uint8_t v) +{ + af.b.l=znptable[v]; +/* af.b.l&=~(N_FLAG|Z_FLAG|V_FLAG|0x28|C_FLAG); + af.b.l|=znptable[v];*/ +} + +static inline void setand(uint8_t v) +{ + af.b.l=znptable[v]|H_FLAG; +/* af.b.l&=~(N_FLAG|Z_FLAG|V_FLAG|0x28|C_FLAG); + af.b.l|=znptable[v];*/ +} + +static inline void setbit(uint8_t v) +{ + af.b.l=((znptable[v]|H_FLAG)&0xFE)|(af.b.l&1); +} + +static inline void setbit2(uint8_t v, uint8_t v2) +{ + af.b.l=((znptable[v]|H_FLAG)&0xD6)|(af.b.l&1)|(v2&0x28); +} + +static inline void setznc(uint8_t v) +{ + af.b.l&=~(N_FLAG|Z_FLAG|V_FLAG|0x28); + af.b.l|=znptable[v]; +} + +static inline void z80_setadd(uint8_t a, uint8_t b) +{ + uint8_t r=a+b; + af.b.l = (r) ? ((r & 0x80) ? N_FLAG : 0) : Z_FLAG; + af.b.l |= (r & 0x28); /* undocumented flag bits 5+3 */ + if( (r & 0x0f) < (a & 0x0f) ) af.b.l |= H_FLAG; + if( r < a ) af.b.l |= C_FLAG; + if( (b^a^0x80) & (b^r) & 0x80 ) af.b.l |= V_FLAG; +} + +static inline void setinc(uint8_t v) +{ + af.b.l&=~(N_FLAG|Z_FLAG|V_FLAG|0x28|H_FLAG); + af.b.l|=znptable[(v+1)&0xFF]; + if (v==0x7F) af.b.l|=V_FLAG; + else af.b.l&=~V_FLAG; + if (((v&0xF)+1)&0x10) af.b.l|=H_FLAG; +} + +static inline void setdec(uint8_t v) +{ + af.b.l&=~(N_FLAG|Z_FLAG|V_FLAG|0x28|H_FLAG); + af.b.l|=znptable[(v-1)&0xFF]|S_FLAG; + if (v==0x80) af.b.l|=V_FLAG; + else af.b.l&=~V_FLAG; + if (!(v&8) && ((v-1)&8)) af.b.l|=H_FLAG; +} + +static inline void setadc(uint8_t a, uint8_t b) +{ + uint8_t r=a+b+(af.b.l&C_FLAG); + if (af.b.l&C_FLAG) + { + af.b.l = (r) ? ((r & 0x80) ? N_FLAG : 0) : Z_FLAG; + af.b.l |= (r & 0x28); /* undocumented flag bits 5+3 */ + if( (r & 0x0f) <= (a & 0x0f) ) af.b.l |= H_FLAG; + if( r <= a ) af.b.l |= C_FLAG; + if( (b^a^0x80) & (b^r) & 0x80 ) af.b.l |= V_FLAG; + } + else + { + af.b.l = (r) ? ((r & 0x80) ? N_FLAG : 0) : Z_FLAG; + af.b.l |= (r & 0x28); /* undocumented flag bits 5+3 */ + if( (r & 0x0f) < (a & 0x0f) ) af.b.l |= H_FLAG; + if( r < a ) af.b.l |= C_FLAG; + if( (b^a^0x80) & (b^r) & 0x80 ) af.b.l |= V_FLAG; + } +} + +static inline void setadc16(uint16_t a, uint16_t b) +{ + uint32_t r=a+b+(af.b.l&1); + af.b.l = (((a ^ r ^ b) >> 8) & H_FLAG) | + ((r >> 16) & C_FLAG) | + ((r >> 8) & (N_FLAG | 0x28)) | + ((r & 0xffff) ? 0 : Z_FLAG) | + (((b ^ a ^ 0x8000) & (b ^ r) & 0x8000) >> 13); +} + +static inline void z80_setadd16(uint16_t a, uint16_t b) +{ + uint32_t r=a+b; + af.b.l = (af.b.l & (N_FLAG | Z_FLAG | V_FLAG)) | + (((a ^ r ^ b) >> 8) & H_FLAG) | + ((r >> 16) & C_FLAG) | ((r >> 8) & 0x28); +} + +static inline void setsbc(uint8_t a, uint8_t b) +{ + uint8_t r=a-(b+(af.b.l&C_FLAG)); + if (af.b.l&C_FLAG) + { + af.b.l = S_FLAG | ((r) ? ((r & 0x80) ? N_FLAG : 0) : Z_FLAG); + af.b.l |= (r & 0x28); /* undocumented flag bits 5+3 */ + if( (r & 0x0f) >= (a & 0x0f) ) af.b.l |= H_FLAG; + if( r >= a ) af.b.l |= C_FLAG; + if( (b^a) & (a^r) & 0x80 ) af.b.l |= V_FLAG; + } + else + { + af.b.l = S_FLAG | ((r) ? ((r & 0x80) ? N_FLAG : 0) : Z_FLAG); + af.b.l |= (r & 0x28); /* undocumented flag bits 5+3 */ + if( (r & 0x0f) > (a & 0x0f) ) af.b.l |= H_FLAG; + if( r > a ) af.b.l |= C_FLAG; + if( (b^a) & (a^r) & 0x80 ) af.b.l |= V_FLAG; + } +} + +static inline void setsbc16(uint16_t a, uint16_t b) +{ + uint32_t r = a - b - (af.b.l & C_FLAG); + af.b.l = (((a ^ r ^ b) >> 8) & H_FLAG) | S_FLAG | + ((r >> 16) & C_FLAG) | + ((r >> 8) & (N_FLAG | 0x28)) | + ((r & 0xffff) ? 0 : Z_FLAG) | + (((b ^ a) & (a ^ r) &0x8000) >> 13); +} + +static inline void setcpED(uint8_t a, uint8_t b) +{ + uint8_t r=a-b; + af.b.l&=C_FLAG; + af.b.l |= S_FLAG | ((r) ? ((r & 0x80) ? N_FLAG : 0) : Z_FLAG); + af.b.l |= (b & 0x28); /* undocumented flag bits 5+3 */ + if( (r & 0x0f) > (a & 0x0f) ) af.b.l |= H_FLAG; + if( (b^a) & (a^r) & 0x80 ) af.b.l |= V_FLAG; +} + +static inline void setcp(uint8_t a, uint8_t b) +{ + uint8_t r=a-b; + af.b.l = S_FLAG | ((r) ? ((r & 0x80) ? N_FLAG : 0) : Z_FLAG); + af.b.l |= (b & 0x28); /* undocumented flag bits 5+3 */ + if( (r & 0x0f) > (a & 0x0f) ) af.b.l |= H_FLAG; + if( r > a ) af.b.l |= C_FLAG; + if( (b^a) & (a^r) & 0x80 ) af.b.l |= V_FLAG; +} + +static inline void z80_setsub(uint8_t a, uint8_t b) +{ + uint8_t r=a-b; + af.b.l = S_FLAG | ((r) ? ((r & 0x80) ? N_FLAG : 0) : Z_FLAG); + af.b.l |= (r & 0x28); /* undocumented flag bits 5+3 */ + if( (r & 0x0f) > (a & 0x0f) ) af.b.l |= H_FLAG; + if( r > a ) af.b.l |= C_FLAG; + if( (b^a) & (a^r) & 0x80 ) af.b.l |= V_FLAG; +} + +static void makeznptable() +{ + int c,d,e,f,g; + for (c=0;c<256;c++) + { +// d|=(c&0xA8); + e=c; + f=0; + for (g=0;g<8;g++) + { + if (e&1) f++; + e>>=1; + } + d=c ? (c&N_FLAG) : Z_FLAG; + d|=(c&0x28); + d|=(f&1)?0:V_FLAG; +/* if (!(f&1)) + d|=4;*/ + znptable[c]=d; + znptablenv[c]=d&~V_FLAG; + } +// znptable[0]|=0x40; + for (c=0;c<65536;c++) + { + d=0; + if (c&0x8000) d|=0x80; + e=c; + f=0; + for (g=0;g<16;g++) + { + if (e&1) f++; + e>>=1; + } + if (!(f&1)) + d|=4; + znptable16[c]=d; + } + znptable16[0]|=0x40; +} + +void z80_init() +{ + FILE *f; + char fn[512]; + append_filename(fn,exedir,"roms/tube/Z80_120.rom",511); + f=fopen(fn,"rb"); + fread(z80rom,0x1000,1,f); + fclose(f); + makeznptable(); +} + +void z80_close() +{ +} + +void z80_dumpregs() +{ + printf("AF =%04X BC =%04X DE =%04X HL =%04X IX=%04X IY=%04X\n",af.w,bc.w,de.w,hl.w,ix.w,iy.w); + printf("AF'=%04X BC'=%04X DE'=%04X HL'=%04X IR=%04X\n",saf.w,sbc.w,sde.w,shl.w,ir.w); + printf("%c%c%c%c%c%c PC =%04X SP =%04X\n",(af.b.l&N_FLAG)?'N':' ',(af.b.l&Z_FLAG)?'Z':' ',(af.b.l&H_FLAG)?'H':' ',(af.b.l&V_FLAG)?'V':' ',(af.b.l&S_FLAG)?'S':' ',(af.b.l&C_FLAG)?'C':' ',pc,sp); + printf("%i ins IFF1=%i IFF2=%i %04X %04X\n",ins,iff1,iff2,opc,oopc); +// error(s); +} + +void z80_mem_dump() +{ + FILE *f=fopen("z80ram.dmp","wb"); + fwrite(z80ram,0x10000,1,f); + fclose(f); +// atexit(z80_dumpregs); +} + +void z80_reset() +{ + pc=0; +// atexit(z80_mem_dump); + tuberomin=1; +} + +static uint16_t oopc,opc; + +void z80_exec() +{ + uint8_t opcode,temp; + uint16_t addr; + int enterint=0; +// tubecycles+=(cy<<1); + while (tubecycles>0) + { + oopc=opc; + opc=pc; + if ((tube_irq&1) && iff1) enterint=1; + cycles=0; + tempc=af.b.l&C_FLAG; + opcode=z80_readmem(pc++); + ir.b.l=((ir.b.l+1)&0x7F)|(ir.b.l&0x80); + switch (opcode) + { + case 0x00: /*NOP*/ + cycles+=4; +// printf("NOP!\n"); +// z80_dumpregs(); +// exit(-1); + break; + case 0x01: /*LD BC,nn*/ + cycles+=4; bc.b.l=z80_readmem(pc++); + cycles+=3; bc.b.h=z80_readmem(pc++); + cycles+=3; + break; + case 0x02: /*LD (BC),A*/ + cycles+=4; z80_writemem(bc.w,af.b.h); + cycles+=3; + break; + case 0x03: /*INC BC*/ + bc.w++; + cycles+=6; + break; + case 0x04: /*INC B*/ + setinc(bc.b.h); + bc.b.h++; + cycles+=4; + break; + case 0x05: /*DEC B*/ + setdec(bc.b.h); + bc.b.h--; + cycles+=4; + break; + case 0x06: /*LD B,nn*/ + cycles+=4; bc.b.h=z80_readmem(pc++); + cycles+=3; + break; + case 0x07: /*RLCA*/ + temp=af.b.h&0x80; + af.b.h<<=1; + if (temp) af.b.h|=1; +// setzn(af.b.h); + if (temp) af.b.l|=C_FLAG; + else af.b.l&=~C_FLAG; + cycles+=4; + break; + case 0x08: /*EX AF,AF'*/ + addr=af.w; af.w=saf.w; saf.w=addr; + cycles+=4; + break; + case 0x09: /*ADD HL,BC*/ + intreg=hl.b.h; + z80_setadd16(hl.w,bc.w); + hl.w+=bc.w; + cycles+=11; + break; + case 0x0A: /*LD A,(BC)*/ + cycles+=4; af.b.h=z80_readmem(bc.w); + cycles+=3; + break; + case 0x0B: /*DEC BC*/ + bc.w--; + cycles+=6; + break; + case 0x0C: /*INC C*/ + setinc(bc.b.l); + bc.b.l++; + cycles+=4; + break; + case 0x0D: /*DEC C*/ + setdec(bc.b.l); + bc.b.l--; + cycles+=4; + break; + case 0x0E: /*LD C,nn*/ + cycles+=4; bc.b.l=z80_readmem(pc++); + cycles+=3; + break; + case 0x0F: /*RRCA*/ + temp=af.b.h&1; + af.b.h>>=1; + if (temp) af.b.h|=0x80; +// setzn(af.b.h); + if (temp) af.b.l|=C_FLAG; + else af.b.l&=~C_FLAG; + cycles+=4; + break; + + case 0x10: /*DJNZ*/ + cycles+=5; addr=z80_readmem(pc++); + if (addr&0x80) addr|=0xFF00; + if (--bc.b.h) + { + pc+=addr; + cycles+=8; + } + else + cycles+=3; + break; + case 0x11: /*LD DE,nn*/ + cycles+=4; de.b.l=z80_readmem(pc++); + cycles+=3; de.b.h=z80_readmem(pc++); + cycles+=3; + break; + case 0x12: /*LD (DE),A*/ + cycles+=4; z80_writemem(de.w,af.b.h); + cycles+=3; + break; + case 0x13: /*INC DE*/ + de.w++; + cycles+=6; + break; + case 0x14: /*INC D*/ + setinc(de.b.h); + de.b.h++; + cycles+=4; + break; + case 0x15: /*DEC D*/ + setdec(de.b.h); + de.b.h--; + cycles+=4; + break; + case 0x16: /*LD D,nn*/ + cycles+=4; de.b.h=z80_readmem(pc++); + cycles+=3; + break; + case 0x17: /*RLA*/ + temp=af.b.h&0x80; + af.b.h<<=1; + if (tempc) af.b.h|=1; +// setzn(af.b.h); + if (temp) af.b.l|=C_FLAG; + else af.b.l&=~C_FLAG; + cycles+=4; + break; + case 0x18: /*JR*/ + cycles+=4; addr=z80_readmem(pc++); + if (addr&0x80) addr|=0xFF00; + pc+=addr; + intreg=pc>>8; + cycles+=8; + break; + case 0x19: /*ADD HL,DE*/ + intreg=hl.b.h; + z80_setadd16(hl.w,de.w); + hl.w+=de.w; + cycles+=11; + break; + case 0x1A: /*LD A,(DE)*/ + cycles+=4; af.b.h=z80_readmem(de.w); + cycles+=3; + break; + case 0x1B: /*DEC DE*/ + de.w--; + cycles+=6; + break; + case 0x1C: /*INC E*/ + setinc(de.b.l); + de.b.l++; + cycles+=4; + break; + case 0x1D: /*DEC E*/ + setdec(de.b.l); + de.b.l--; + cycles+=4; + break; + case 0x1E: /*LD E,nn*/ + cycles+=4; de.b.l=z80_readmem(pc++); + cycles+=3; + break; + case 0x1F: /*RRA*/ + temp=af.b.h&1; + af.b.h>>=1; + if (tempc) af.b.h|=0x80; +// setzn(af.b.h); + if (temp) af.b.l|=C_FLAG; + else af.b.l&=~C_FLAG; + cycles+=4; + break; + + case 0x20: /*JR NZ*/ + cycles+=4; addr=z80_readmem(pc++); + if (addr&0x80) addr|=0xFF00; + if (!(af.b.l&Z_FLAG)) + { + pc+=addr; + cycles+=8; + } + else + cycles+=3; + break; + case 0x21: /*LD HL,nn*/ + cycles+=4; hl.b.l=z80_readmem(pc++); + cycles+=3; hl.b.h=z80_readmem(pc++); + cycles+=3; + break; + case 0x22: /*LD (nn),HL*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + cycles+=3; z80_writemem(addr,hl.b.l); + cycles+=3; z80_writemem(addr+1,hl.b.h); + cycles+=3; + break; + case 0x23: /*INC HL*/ + hl.w++; + cycles+=6; + break; + case 0x24: /*INC H*/ + setinc(hl.b.h); + hl.b.h++; + cycles+=4; + break; + case 0x25: /*DEC H*/ + setdec(hl.b.h); + hl.b.h--; + cycles+=4; + break; + case 0x26: /*LD H,nn*/ + cycles+=4; hl.b.h=z80_readmem(pc++); + cycles+=3; + break; + case 0x27: /*DAA*/ + addr=af.b.h; + if (af.b.l&C_FLAG) addr|=256; + if (af.b.l&H_FLAG) addr|=512; + if (af.b.l&S_FLAG) addr|=1024; + af.w=DAATable[addr]; + cycles+=4; + break; + case 0x28: /*JR Z*/ + cycles+=4; addr=z80_readmem(pc++); + if (addr&0x80) addr|=0xFF00; + if (af.b.l&Z_FLAG) + { + pc+=addr; + cycles+=8; + } + else + cycles+=3; + break; + case 0x29: /*ADD HL,HL*/ + intreg=hl.b.h; + z80_setadd16(hl.w,hl.w); + hl.w+=hl.w; + cycles+=11; + break; + case 0x2A: /*LD HL,(nn)*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + cycles+=3; hl.b.l=z80_readmem(addr); + cycles+=3; hl.b.h=z80_readmem(addr+1); + cycles+=3; + break; + case 0x2B: /*DEC HL*/ + hl.w--; + cycles+=6; + break; + case 0x2C: /*INC L*/ + setinc(hl.b.l); + hl.b.l++; + cycles+=4; + break; + case 0x2D: /*DEC L*/ + setdec(hl.b.l); + hl.b.l--; + cycles+=4; + break; + case 0x2E: /*LD L,nn*/ + cycles+=4; hl.b.l=z80_readmem(pc++); + cycles+=3; + break; + case 0x2F: /*CPL*/ + af.b.h^=0xFF; + af.b.l|=(H_FLAG|S_FLAG); + cycles+=4; + break; + case 0x30: /*JR NC*/ + cycles+=4; addr=z80_readmem(pc++); + if (addr&0x80) addr|=0xFF00; + if (!(af.b.l&C_FLAG)) + { + pc+=addr; + cycles+=8; + } + else + cycles+=3; + break; + case 0x31: /*LD SP,nn*/ + cycles+=4; temp=z80_readmem(pc++); + cycles+=3; sp=(z80_readmem(pc++)<<8)|temp; + cycles+=3; + break; + case 0x32: /*LD (nn),A*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + cycles+=3; z80_writemem(addr,af.b.h); + cycles+=3; + break; + case 0x33: /*INC SP*/ + sp++; + cycles+=6; + break; + case 0x34: /*INC (HL)*/ + cycles+=4; temp=z80_readmem(hl.w); + setinc(temp); + cycles+=3; z80_writemem(hl.w,temp+1); + cycles+=3; + break; + case 0x35: /*DEC (HL)*/ + cycles+=4; temp=z80_readmem(hl.w); + setdec(temp); + cycles+=3; z80_writemem(hl.w,temp-1); + cycles+=3; + break; + case 0x36: /*LD (HL),nn*/ + cycles+=4; temp=z80_readmem(pc++); + cycles+=3; z80_writemem(hl.w,temp); + cycles+=3; + break; + case 0x37: /*SCF*/ + af.b.l|=C_FLAG; + cycles+=4; + break; + case 0x38: /*JR C*/ + cycles+=4; addr=z80_readmem(pc++); + if (addr&0x80) addr|=0xFF00; + if (af.b.l&C_FLAG) + { + pc+=addr; + cycles+=8; + } + else + cycles+=3; + break; + case 0x39: /*ADD HL,SP*/ + intreg=hl.b.h; + z80_setadd16(hl.w,sp); + hl.w+=sp; + cycles+=11; + break; + case 0x3A: /*LD A,(nn)*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + cycles+=3; af.b.h=z80_readmem(addr); + cycles+=3; + break; + case 0x3B: /*DEC SP*/ + sp--; + cycles+=6; + break; + case 0x3C: /*INC A*/ + setinc(af.b.h); + af.b.h++; + cycles+=4; + break; + case 0x3D: /*DEC A*/ + setdec(af.b.h); + af.b.h--; + cycles+=4; + break; + case 0x3E: /*LD A,nn*/ + cycles+=4; af.b.h=z80_readmem(pc++); + cycles+=3; + break; + case 0x3F: /*CCF*/ + af.b.l^=C_FLAG; + cycles+=4; + break; + + case 0x40: bc.b.h=bc.b.h; cycles+=4; break; /*LD B,B*/ + case 0x41: bc.b.h=bc.b.l; cycles+=4; break; /*LD B,C*/ + case 0x42: bc.b.h=de.b.h; cycles+=4; break; /*LD B,D*/ + case 0x43: bc.b.h=de.b.l; cycles+=4; break; /*LD B,E*/ + case 0x44: bc.b.h=hl.b.h; cycles+=4; break; /*LD B,H*/ + case 0x45: bc.b.h=hl.b.l; cycles+=4; break; /*LD B,L*/ + case 0x46: cycles+=4; bc.b.h=z80_readmem(hl.w); cycles+=3; break; /*LD B,(HL)*/ + case 0x47: bc.b.h=af.b.h; cycles+=4; break; /*LD B,A*/ + case 0x48: bc.b.l=bc.b.h; cycles+=4; break; /*LD C,B*/ + case 0x49: bc.b.l=bc.b.l; cycles+=4; break; /*LD C,C*/ + case 0x4A: bc.b.l=de.b.h; cycles+=4; break; /*LD C,D*/ + case 0x4B: bc.b.l=de.b.l; cycles+=4; break; /*LD C,E*/ + case 0x4C: bc.b.l=hl.b.h; cycles+=4; break; /*LD C,H*/ + case 0x4D: bc.b.l=hl.b.l; cycles+=4; break; /*LD C,L*/ + case 0x4E: cycles+=4; bc.b.l=z80_readmem(hl.w); cycles+=3; break; /*LD C,(HL)*/ + case 0x4F: bc.b.l=af.b.h; cycles+=4; break; /*LD C,A*/ + case 0x50: de.b.h=bc.b.h; cycles+=4; break; /*LD D,B*/ + case 0x51: de.b.h=bc.b.l; cycles+=4; break; /*LD D,C*/ + case 0x52: de.b.h=de.b.h; cycles+=4; break; /*LD D,D*/ + case 0x53: de.b.h=de.b.l; cycles+=4; break; /*LD D,E*/ + case 0x54: de.b.h=hl.b.h; cycles+=4; break; /*LD D,H*/ + case 0x55: de.b.h=hl.b.l; cycles+=4; break; /*LD D,L*/ + case 0x56: cycles+=4; de.b.h=z80_readmem(hl.w); cycles+=3; break; /*LD D,(HL)*/ + case 0x57: de.b.h=af.b.h; cycles+=4; break; /*LD D,A*/ + case 0x58: de.b.l=bc.b.h; cycles+=4; break; /*LD E,B*/ + case 0x59: de.b.l=bc.b.l; cycles+=4; break; /*LD E,C*/ + case 0x5A: de.b.l=de.b.h; cycles+=4; break; /*LD E,D*/ + case 0x5B: de.b.l=de.b.l; cycles+=4; break; /*LD E,E*/ + case 0x5C: de.b.l=hl.b.h; cycles+=4; break; /*LD E,H*/ + case 0x5D: de.b.l=hl.b.l; cycles+=4; break; /*LD E,L*/ + case 0x5E: cycles+=4; de.b.l=z80_readmem(hl.w); cycles+=3; break; /*LD E,(HL)*/ + case 0x5F: de.b.l=af.b.h; cycles+=4; break; /*LD E,A*/ + case 0x60: hl.b.h=bc.b.h; cycles+=4; break; /*LD H,B*/ + case 0x61: hl.b.h=bc.b.l; cycles+=4; break; /*LD H,C*/ + case 0x62: hl.b.h=de.b.h; cycles+=4; break; /*LD H,D*/ + case 0x63: hl.b.h=de.b.l; cycles+=4; break; /*LD H,E*/ + case 0x64: hl.b.h=hl.b.h; cycles+=4; break; /*LD H,H*/ + case 0x65: hl.b.h=hl.b.l; cycles+=4; break; /*LD H,L*/ + case 0x66: cycles+=4; hl.b.h=z80_readmem(hl.w); cycles+=3; break; /*LD H,(HL)*/ + case 0x67: hl.b.h=af.b.h; cycles+=4; break; /*LD H,A*/ + case 0x68: hl.b.l=bc.b.h; cycles+=4; break; /*LD L,B*/ + case 0x69: hl.b.l=bc.b.l; cycles+=4; break; /*LD L,C*/ + case 0x6A: hl.b.l=de.b.h; cycles+=4; break; /*LD L,D*/ + case 0x6B: hl.b.l=de.b.l; cycles+=4; break; /*LD L,E*/ + case 0x6C: hl.b.l=hl.b.h; cycles+=4; break; /*LD L,H*/ + case 0x6D: hl.b.l=hl.b.l; cycles+=4; break; /*LD L,L*/ + case 0x6E: cycles+=4; hl.b.l=z80_readmem(hl.w); cycles+=3; break; /*LD L,(HL)*/ + case 0x6F: hl.b.l=af.b.h; cycles+=4; break; /*LD L,A*/ + case 0x70: cycles+=4; z80_writemem(hl.w,bc.b.h); cycles+=3; break; /*LD (HL),B*/ + case 0x71: cycles+=4; z80_writemem(hl.w,bc.b.l); cycles+=3; break; /*LD (HL),C*/ + case 0x72: cycles+=4; z80_writemem(hl.w,de.b.h); cycles+=3; break; /*LD (HL),D*/ + case 0x73: cycles+=4; z80_writemem(hl.w,de.b.l); cycles+=3; break; /*LD (HL),E*/ + case 0x74: cycles+=4; z80_writemem(hl.w,hl.b.h); cycles+=3; break; /*LD (HL),H*/ + case 0x75: cycles+=4; z80_writemem(hl.w,hl.b.l); cycles+=3; break; /*LD (HL),L*/ + case 0x77: cycles+=4; z80_writemem(hl.w,af.b.h); cycles+=3; break; /*LD (HL),A*/ + case 0x78: af.b.h=bc.b.h; cycles+=4; break; /*LD A,B*/ + case 0x79: af.b.h=bc.b.l; cycles+=4; break; /*LD A,C*/ + case 0x7A: af.b.h=de.b.h; cycles+=4; break; /*LD A,D*/ + case 0x7B: af.b.h=de.b.l; cycles+=4; break; /*LD A,E*/ + case 0x7C: af.b.h=hl.b.h; cycles+=4; break; /*LD A,H*/ + case 0x7D: af.b.h=hl.b.l; cycles+=4; break; /*LD A,L*/ + case 0x7E: cycles+=4; af.b.h=z80_readmem(hl.w); cycles+=3; break; /*LD A,(HL)*/ + case 0x7F: af.b.h=af.b.h; cycles+=4; break; /*LD A,A*/ + + case 0x76: /*HALT*/ + if (!enterint) pc--; +// else printf("HALT %02X\n",bc.b.h); + cycles+=4; + break; + + case 0x80: z80_setadd(af.b.h,bc.b.h); af.b.h+=bc.b.h; cycles+=4; break; /*ADD B*/ + case 0x81: z80_setadd(af.b.h,bc.b.l); af.b.h+=bc.b.l; cycles+=4; break; /*ADD C*/ + case 0x82: z80_setadd(af.b.h,de.b.h); af.b.h+=de.b.h; cycles+=4; break; /*ADD D*/ + case 0x83: z80_setadd(af.b.h,de.b.l); af.b.h+=de.b.l; cycles+=4; break; /*ADD E*/ + case 0x84: z80_setadd(af.b.h,hl.b.h); af.b.h+=hl.b.h; cycles+=4; break; /*ADD H*/ + case 0x85: z80_setadd(af.b.h,hl.b.l); af.b.h+=hl.b.l; cycles+=4; break; /*ADD L*/ + case 0x86: cycles+=4; temp=z80_readmem(hl.w); z80_setadd(af.b.h,temp); af.b.h+=temp; cycles+=3; break; /*ADD (HL)*/ + case 0x87: z80_setadd(af.b.h,af.b.h); af.b.h+=af.b.h; cycles+=4; break; /*ADD A*/ + case 0x88: setadc(af.b.h,bc.b.h); af.b.h+=bc.b.h+tempc; cycles+=4; break; /*ADC B*/ + case 0x89: setadc(af.b.h,bc.b.l); af.b.h+=bc.b.l+tempc; cycles+=4; break; /*ADC C*/ + case 0x8A: setadc(af.b.h,de.b.h); af.b.h+=de.b.h+tempc; cycles+=4; break; /*ADC D*/ + case 0x8B: setadc(af.b.h,de.b.l); af.b.h+=de.b.l+tempc; cycles+=4; break; /*ADC E*/ + case 0x8C: setadc(af.b.h,hl.b.h); af.b.h+=hl.b.h+tempc; cycles+=4; break; /*ADC H*/ + case 0x8D: setadc(af.b.h,hl.b.l); af.b.h+=hl.b.l+tempc; cycles+=4; break; /*ADC L*/ + case 0x8E: cycles+=4; temp=z80_readmem(hl.w); setadc(af.b.h,temp); af.b.h+=temp+tempc; cycles+=3; break; /*ADC (HL)*/ + case 0x8F: setadc(af.b.h,af.b.h); af.b.h+=af.b.h+tempc; cycles+=4; break; /*ADC A*/ + + case 0x90: z80_setsub(af.b.h,bc.b.h); af.b.h-=bc.b.h; cycles+=4; break; /*SUB B*/ + case 0x91: z80_setsub(af.b.h,bc.b.l); af.b.h-=bc.b.l; cycles+=4; break; /*SUB C*/ + case 0x92: z80_setsub(af.b.h,de.b.h); af.b.h-=de.b.h; cycles+=4; break; /*SUB D*/ + case 0x93: z80_setsub(af.b.h,de.b.l); af.b.h-=de.b.l; cycles+=4; break; /*SUB E*/ + case 0x94: z80_setsub(af.b.h,hl.b.h); af.b.h-=hl.b.h; cycles+=4; break; /*SUB H*/ + case 0x95: z80_setsub(af.b.h,hl.b.l); af.b.h-=hl.b.l; cycles+=4; break; /*SUB L*/ + case 0x96: cycles+=4; temp=z80_readmem(hl.w); z80_setsub(af.b.h,temp); af.b.h-=temp; cycles+=3; break; /*SUB (HL)*/ + case 0x97: z80_setsub(af.b.h,af.b.h); af.b.h-=af.b.h; cycles+=4; break; /*SUB A*/ + case 0x98: setsbc(af.b.h,bc.b.h); af.b.h-=(bc.b.h+tempc); cycles+=4; break; /*SBC B*/ + case 0x99: setsbc(af.b.h,bc.b.l); af.b.h-=(bc.b.l+tempc); cycles+=4; break; /*SBC C*/ + case 0x9A: setsbc(af.b.h,de.b.h); af.b.h-=(de.b.h+tempc); cycles+=4; break; /*SBC D*/ + case 0x9B: setsbc(af.b.h,de.b.l); af.b.h-=(de.b.l+tempc); cycles+=4; break; /*SBC E*/ + case 0x9C: setsbc(af.b.h,hl.b.h); af.b.h-=(hl.b.h+tempc); cycles+=4; break; /*SBC H*/ + case 0x9D: setsbc(af.b.h,hl.b.l); af.b.h-=(hl.b.l+tempc); cycles+=4; break; /*SBC L*/ + case 0x9E: cycles+=4; temp=z80_readmem(hl.w); setsbc(af.b.h,temp); af.b.h-=(temp+tempc); cycles+=3; break; /*SBC (HL)*/ + case 0x9F: setsbc(af.b.h,af.b.h); af.b.h-=(af.b.h+tempc); cycles+=4; break; /*SBC A*/ + + case 0xA0: af.b.h&=bc.b.h; setand(af.b.h); cycles+=4; break; /*AND B*/ + case 0xA1: af.b.h&=bc.b.l; setand(af.b.h); cycles+=4; break; /*AND C*/ + case 0xA2: af.b.h&=de.b.h; setand(af.b.h); cycles+=4; break; /*AND D*/ + case 0xA3: af.b.h&=de.b.l; setand(af.b.h); cycles+=4; break; /*AND E*/ + case 0xA4: af.b.h&=hl.b.h; setand(af.b.h); cycles+=4; break; /*AND H*/ + case 0xA5: af.b.h&=hl.b.l; setand(af.b.h); cycles+=4; break; /*AND L*/ + case 0xA6: cycles+=4; af.b.h&=z80_readmem(hl.w); setand(af.b.h); cycles+=3; break; /*AND (HL)*/ + case 0xA7: af.b.h&=af.b.h; setand(af.b.h); cycles+=4; break; /*AND A*/ + case 0xA8: af.b.h^=bc.b.h; setzn(af.b.h); cycles+=4; break; /*XOR B*/ + case 0xA9: af.b.h^=bc.b.l; setzn(af.b.h); cycles+=4; break; /*XOR C*/ + case 0xAA: af.b.h^=de.b.h; setzn(af.b.h); cycles+=4; break; /*XOR D*/ + case 0xAB: af.b.h^=de.b.l; setzn(af.b.h); cycles+=4; break; /*XOR E*/ + case 0xAC: af.b.h^=hl.b.h; setzn(af.b.h); cycles+=4; break; /*XOR H*/ + case 0xAD: af.b.h^=hl.b.l; setzn(af.b.h); cycles+=4; break; /*XOR L*/ + case 0xAE: cycles+=4; af.b.h^=z80_readmem(hl.w); setzn(af.b.h); cycles+=3; break; /*XOR (HL)*/ + case 0xAF: af.b.h^=af.b.h; setzn(af.b.h); cycles+=4; break; /*XOR A*/ + case 0xB0: af.b.h|=bc.b.h; setzn(af.b.h); cycles+=4; break; /*OR B*/ + case 0xB1: af.b.h|=bc.b.l; setzn(af.b.h); cycles+=4; break; /*OR C*/ + case 0xB2: af.b.h|=de.b.h; setzn(af.b.h); cycles+=4; break; /*OR D*/ + case 0xB3: af.b.h|=de.b.l; setzn(af.b.h); cycles+=4; break; /*OR E*/ + case 0xB4: af.b.h|=hl.b.h; setzn(af.b.h); cycles+=4; break; /*OR H*/ + case 0xB5: af.b.h|=hl.b.l; setzn(af.b.h); cycles+=4; break; /*OR L*/ + case 0xB6: cycles+=4; af.b.h|=z80_readmem(hl.w); setzn(af.b.h); cycles+=3; break; /*OR (HL)*/ + case 0xB7: af.b.h|=af.b.h; setzn(af.b.h); cycles+=4; break; /*OR A*/ + case 0xB8: setcp(af.b.h,bc.b.h); cycles+=4; break; /*CP B*/ + case 0xB9: setcp(af.b.h,bc.b.l); cycles+=4; break; /*CP C*/ + case 0xBA: setcp(af.b.h,de.b.h); cycles+=4; break; /*CP D*/ + case 0xBB: setcp(af.b.h,de.b.l); cycles+=4; break; /*CP E*/ + case 0xBC: setcp(af.b.h,hl.b.h); cycles+=4; break; /*CP H*/ + case 0xBD: setcp(af.b.h,hl.b.l); cycles+=4; break; /*CP L*/ + case 0xBE: cycles+=4; temp=z80_readmem(hl.w); setcp(af.b.h,temp); cycles+=3; break; /*CP (HL)*/ + case 0xBF: setcp(af.b.h,af.b.h); cycles+=4; break; /*CP A*/ + + case 0xC0: /*RET NZ*/ + cycles+=5; + if (!(af.b.l&Z_FLAG)) + { + pc=z80_readmem(sp); sp++; + cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; + cycles+=3; + } + break; + case 0xC1: /*POP BC*/ + cycles+=4; bc.b.l=z80_readmem(sp); sp++; + cycles+=3; bc.b.h=z80_readmem(sp); sp++; + cycles+=3; + break; + case 0xC2: /*JP NZ*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + if (!(af.b.l&Z_FLAG)) + pc=addr; + cycles+=3; + break; + case 0xC3: /*JP xxxx*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); + pc=addr; + cycles+=3; + break; + case 0xC4: /*CALL NZ,xxxx*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + if (!(af.b.l&Z_FLAG)) + { + cycles+=4; sp--; z80_writemem(sp,pc>>8); + cycles+=3; sp--; z80_writemem(sp,pc&0xFF); + pc=addr; + cycles+=3; + } + else + cycles+=3; + break; + case 0xC5: /*PUSH BC*/ + cycles+=5; sp--; z80_writemem(sp,bc.b.h); + cycles+=3; sp--; z80_writemem(sp,bc.b.l); + cycles+=3; + break; + case 0xC6: /*ADD A,nn*/ + cycles+=4; temp=z80_readmem(pc++); +// printf("%04X : ADD %02X %02X - ",pc-1,af.b.h,temp); + z80_setadd(af.b.h,temp); + af.b.h+=temp; + cycles+=3; +// printf("%04X\n",af.w); + break; + case 0xC7: /*RST 0*/ + cycles+=5; sp--; z80_writemem(sp,pc>>8); + cycles+=3; sp--; z80_writemem(sp,pc&0xFF); + pc=0x00; + cycles+=3; + break; + case 0xC8: /*RET Z*/ + cycles+=5; + if (af.b.l&Z_FLAG) + { + pc=z80_readmem(sp); sp++; + cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; + cycles+=3; + } + break; + case 0xC9: /*RET*/ + cycles+=4; pc=z80_readmem(sp); sp++; + cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; + cycles+=3; + break; + case 0xCA: /*JP Z*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + if (af.b.l&Z_FLAG) + pc=addr; + cycles+=3; + break; + + case 0xCB: /*More opcodes*/ + ir.b.l=((ir.b.l+1)&0x7F)|(ir.b.l&0x80); + cycles+=4; + opcode=z80_readmem(pc++); + switch (opcode) + { + case 0x00: temp=bc.b.h&0x80; bc.b.h<<=1; if (temp) bc.b.h|=1; setzn(bc.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RLC B*/ + case 0x01: temp=bc.b.l&0x80; bc.b.l<<=1; if (temp) bc.b.l|=1; setzn(bc.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RLC C*/ + case 0x02: temp=de.b.h&0x80; de.b.h<<=1; if (temp) de.b.h|=1; setzn(de.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RLC D*/ + case 0x03: temp=de.b.l&0x80; de.b.l<<=1; if (temp) de.b.l|=1; setzn(de.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RLC E*/ + case 0x04: temp=hl.b.h&0x80; hl.b.h<<=1; if (temp) hl.b.h|=1; setzn(hl.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RLC H*/ + case 0x05: temp=hl.b.l&0x80; hl.b.l<<=1; if (temp) hl.b.l|=1; setzn(hl.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RLC L*/ + case 0x07: temp=af.b.h&0x80; af.b.h<<=1; if (temp) af.b.h|=1; setzn(af.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RLC A*/ + case 0x06: /*RLC (HL)*/ + cycles+=4; temp=z80_readmem(hl.w); + tempc=temp&0x80; + temp<<=1; + if (tempc) temp|=1; + setzn(temp); + if (tempc) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(hl.w,temp); + cycles+=3; + break; + + case 0x08: temp=bc.b.h&1; bc.b.h>>=1; if (temp) bc.b.h|=0x80; setzn(bc.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RRC B*/ + case 0x09: temp=bc.b.l&1; bc.b.l>>=1; if (temp) bc.b.l|=0x80; setzn(bc.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RRC C*/ + case 0x0A: temp=de.b.h&1; de.b.h>>=1; if (temp) de.b.h|=0x80; setzn(de.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RRC D*/ + case 0x0B: temp=de.b.l&1; de.b.l>>=1; if (temp) de.b.l|=0x80; setzn(de.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RRC E*/ + case 0x0C: temp=hl.b.h&1; hl.b.h>>=1; if (temp) hl.b.h|=0x80; setzn(hl.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RRC H*/ + case 0x0D: temp=hl.b.l&1; hl.b.l>>=1; if (temp) hl.b.l|=0x80; setzn(hl.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RRC L*/ + case 0x0F: temp=af.b.h&1; af.b.h>>=1; if (temp) af.b.h|=0x80; setzn(af.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RRC A*/ + case 0x0E: /*RRC (HL)*/ + cycles+=4; temp=z80_readmem(hl.w); + tempc=temp&1; + temp>>=1; + if (tempc) temp|=0x80; + setzn(temp); + if (tempc) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(hl.w,temp); + cycles+=3; + break; + + case 0x10: temp=bc.b.h&0x80; bc.b.h<<=1; if (tempc) bc.b.h|=1; setzn(bc.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RL B*/ + case 0x11: temp=bc.b.l&0x80; bc.b.l<<=1; if (tempc) bc.b.l|=1; setzn(bc.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RL C*/ + case 0x12: temp=de.b.h&0x80; de.b.h<<=1; if (tempc) de.b.h|=1; setzn(de.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RL D*/ + case 0x13: temp=de.b.l&0x80; de.b.l<<=1; if (tempc) de.b.l|=1; setzn(de.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RL E*/ + case 0x14: temp=hl.b.h&0x80; hl.b.h<<=1; if (tempc) hl.b.h|=1; setzn(hl.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RL H*/ + case 0x15: temp=hl.b.l&0x80; hl.b.l<<=1; if (tempc) hl.b.l|=1; setzn(hl.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RL L*/ + case 0x17: temp=af.b.h&0x80; af.b.h<<=1; if (tempc) af.b.h|=1; setzn(af.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RL A*/ + case 0x16: /*RL (HL)*/ + cycles+=4; temp=z80_readmem(hl.w); + addr=temp&0x80; + temp<<=1; + if (tempc) temp|=1; + setzn(temp); + if (addr) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(hl.w,temp); + cycles+=3; + break; + + case 0x18: temp=bc.b.h&1; bc.b.h>>=1; if (tempc) bc.b.h|=0x80; setzn(bc.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RR B*/ + case 0x19: temp=bc.b.l&1; bc.b.l>>=1; if (tempc) bc.b.l|=0x80; setzn(bc.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RR C*/ + case 0x1A: temp=de.b.h&1; de.b.h>>=1; if (tempc) de.b.h|=0x80; setzn(de.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RR D*/ + case 0x1B: temp=de.b.l&1; de.b.l>>=1; if (tempc) de.b.l|=0x80; setzn(de.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RR E*/ + case 0x1C: temp=hl.b.h&1; hl.b.h>>=1; if (tempc) hl.b.h|=0x80; setzn(hl.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RR H*/ + case 0x1D: temp=hl.b.l&1; hl.b.l>>=1; if (tempc) hl.b.l|=0x80; setzn(hl.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RR L*/ + case 0x1F: temp=af.b.h&1; af.b.h>>=1; if (tempc) af.b.h|=0x80; setzn(af.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*RR A*/ + case 0x1E: /*RR (HL)*/ + cycles+=4; temp=z80_readmem(hl.w); + addr=temp&1; + temp>>=1; + if (tempc) temp|=0x80; + setzn(temp); + if (addr) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(hl.w,temp); + cycles+=3; + break; + + case 0x20: temp=bc.b.h&0x80; bc.b.h<<=1; setzn(bc.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLA B*/ + case 0x21: temp=bc.b.l&0x80; bc.b.l<<=1; setzn(bc.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLA C*/ + case 0x22: temp=de.b.h&0x80; de.b.h<<=1; setzn(de.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLA D*/ + case 0x23: temp=de.b.l&0x80; de.b.l<<=1; setzn(de.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLA E*/ + case 0x24: temp=hl.b.h&0x80; hl.b.h<<=1; setzn(hl.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLA H*/ + case 0x25: temp=hl.b.l&0x80; hl.b.l<<=1; setzn(hl.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLA L*/ + case 0x27: temp=af.b.h&0x80; af.b.h<<=1; setzn(af.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLA H*/ + case 0x26: /*SLA (HL)*/ + cycles+=4; temp=z80_readmem(hl.w); + tempc=temp&0x80; + temp<<=1; + setzn(temp); + if (tempc) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(hl.w,temp); + cycles+=3; + break; + + case 0x28: temp=bc.b.h&1; bc.b.h>>=1; if (bc.b.h&0x40) bc.b.h|=0x80; setzn(bc.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRA B*/ + case 0x29: temp=bc.b.l&1; bc.b.l>>=1; if (bc.b.l&0x40) bc.b.l|=0x80; setzn(bc.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRA C*/ + case 0x2A: temp=de.b.h&1; de.b.h>>=1; if (de.b.h&0x40) de.b.h|=0x80; setzn(de.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRA D*/ + case 0x2B: temp=de.b.l&1; de.b.l>>=1; if (de.b.l&0x40) de.b.l|=0x80; setzn(de.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRA E*/ + case 0x2C: temp=hl.b.h&1; hl.b.h>>=1; if (hl.b.h&0x40) hl.b.h|=0x80; setzn(hl.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRA H*/ + case 0x2D: temp=hl.b.l&1; hl.b.l>>=1; if (hl.b.l&0x40) hl.b.l|=0x80; setzn(hl.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRA L*/ + case 0x2F: temp=af.b.h&1; af.b.h>>=1; if (af.b.h&0x40) af.b.h|=0x80; setzn(af.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRA A*/ + case 0x2E: /*SRA (HL)*/ + cycles+=4; temp=z80_readmem(hl.w); + tempc=temp&1; + temp>>=1; + if (temp&0x40) temp|=0x80; + setzn(temp); + if (tempc) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(hl.w,temp); + cycles+=3; + break; + + case 0x30: temp=bc.b.h&0x80; bc.b.h<<=1; bc.b.h|=1; setzn(bc.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLL B*/ + case 0x31: temp=bc.b.l&0x80; bc.b.l<<=1; bc.b.l|=1; setzn(bc.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLL C*/ + case 0x32: temp=de.b.h&0x80; de.b.h<<=1; de.b.h|=1; setzn(de.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLL D*/ + case 0x33: temp=de.b.l&0x80; de.b.l<<=1; de.b.l|=1; setzn(de.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLL E*/ + case 0x34: temp=hl.b.h&0x80; hl.b.h<<=1; hl.b.h|=1; setzn(hl.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLL H*/ + case 0x35: temp=hl.b.l&0x80; hl.b.l<<=1; hl.b.l|=1; setzn(hl.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLL L*/ + case 0x37: temp=af.b.h&0x80; af.b.h<<=1; af.b.h|=1; setzn(af.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SLL H*/ + case 0x36: /*SLL (HL)*/ + cycles+=4; temp=z80_readmem(hl.w); + tempc=temp&0x80; + temp<<=1; + temp|=1; + setzn(temp); + if (tempc) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(hl.w,temp); + cycles+=3; + break; + + case 0x38: temp=bc.b.h&1; bc.b.h>>=1; setzn(bc.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRL B*/ + case 0x39: temp=bc.b.l&1; bc.b.l>>=1; setzn(bc.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRL C*/ + case 0x3A: temp=de.b.h&1; de.b.h>>=1; setzn(de.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRL D*/ + case 0x3B: temp=de.b.l&1; de.b.l>>=1; setzn(de.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRL E*/ + case 0x3C: temp=hl.b.h&1; hl.b.h>>=1; setzn(hl.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRL H*/ + case 0x3D: temp=hl.b.l&1; hl.b.l>>=1; setzn(hl.b.l); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRL L*/ + case 0x3F: temp=af.b.h&1; af.b.h>>=1; setzn(af.b.h); if (temp) af.b.l|=C_FLAG; cycles+=4; break; /*SRL H*/ + case 0x3E: /*SRL (HL)*/ + cycles+=4; temp=z80_readmem(hl.w); + tempc=temp&1; + temp>>=1; + setzn(temp); + if (tempc) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(hl.w,temp); + cycles+=3; + break; + + case 0x40: setbit(bc.b.h&0x01); cycles+=4; break; /*BIT 0,B*/ + case 0x41: setbit(bc.b.l&0x01); cycles+=4; break; /*BIT 0,C*/ + case 0x42: setbit(de.b.h&0x01); cycles+=4; break; /*BIT 0,D*/ + case 0x43: setbit(de.b.l&0x01); cycles+=4; break; /*BIT 0,E*/ + case 0x44: setbit(hl.b.h&0x01); cycles+=4; break; /*BIT 0,H*/ + case 0x45: setbit(hl.b.l&0x01); cycles+=4; break; /*BIT 0,L*/ + case 0x47: setbit(af.b.h&0x01); cycles+=4; break; /*BIT 0,A*/ + case 0x48: setbit(bc.b.h&0x02); cycles+=4; break; /*BIT 1,B*/ + case 0x49: setbit(bc.b.l&0x02); cycles+=4; break; /*BIT 1,C*/ + case 0x4A: setbit(de.b.h&0x02); cycles+=4; break; /*BIT 1,D*/ + case 0x4B: setbit(de.b.l&0x02); cycles+=4; break; /*BIT 1,E*/ + case 0x4C: setbit(hl.b.h&0x02); cycles+=4; break; /*BIT 1,H*/ + case 0x4D: setbit(hl.b.l&0x02); cycles+=4; break; /*BIT 1,L*/ + case 0x4F: setbit(af.b.h&0x02); cycles+=4; break; /*BIT 1,A*/ + case 0x50: setbit(bc.b.h&0x04); cycles+=4; break; /*BIT 2,B*/ + case 0x51: setbit(bc.b.l&0x04); cycles+=4; break; /*BIT 2,C*/ + case 0x52: setbit(de.b.h&0x04); cycles+=4; break; /*BIT 2,D*/ + case 0x53: setbit(de.b.l&0x04); cycles+=4; break; /*BIT 2,E*/ + case 0x54: setbit(hl.b.h&0x04); cycles+=4; break; /*BIT 2,H*/ + case 0x55: setbit(hl.b.l&0x04); cycles+=4; break; /*BIT 2,L*/ + case 0x57: setbit(af.b.h&0x04); cycles+=4; break; /*BIT 2,A*/ + case 0x58: setbit(bc.b.h&0x08); cycles+=4; break; /*BIT 3,B*/ + case 0x59: setbit(bc.b.l&0x08); cycles+=4; break; /*BIT 3,C*/ + case 0x5A: setbit(de.b.h&0x08); cycles+=4; break; /*BIT 3,D*/ + case 0x5B: setbit(de.b.l&0x08); cycles+=4; break; /*BIT 3,E*/ + case 0x5C: setbit(hl.b.h&0x08); cycles+=4; break; /*BIT 3,H*/ + case 0x5D: setbit(hl.b.l&0x08); cycles+=4; break; /*BIT 3,L*/ + case 0x5F: setbit(af.b.h&0x08); cycles+=4; break; /*BIT 3,A*/ + case 0x60: setbit(bc.b.h&0x10); cycles+=4; break; /*BIT 4,B*/ + case 0x61: setbit(bc.b.l&0x10); cycles+=4; break; /*BIT 4,C*/ + case 0x62: setbit(de.b.h&0x10); cycles+=4; break; /*BIT 4,D*/ + case 0x63: setbit(de.b.l&0x10); cycles+=4; break; /*BIT 4,E*/ + case 0x64: setbit(hl.b.h&0x10); cycles+=4; break; /*BIT 4,H*/ + case 0x65: setbit(hl.b.l&0x10); cycles+=4; break; /*BIT 4,L*/ + case 0x67: setbit(af.b.h&0x10); cycles+=4; break; /*BIT 4,A*/ + case 0x68: setbit(bc.b.h&0x20); cycles+=4; break; /*BIT 5,B*/ + case 0x69: setbit(bc.b.l&0x20); cycles+=4; break; /*BIT 5,C*/ + case 0x6A: setbit(de.b.h&0x20); cycles+=4; break; /*BIT 5,D*/ + case 0x6B: setbit(de.b.l&0x20); cycles+=4; break; /*BIT 5,E*/ + case 0x6C: setbit(hl.b.h&0x20); cycles+=4; break; /*BIT 5,H*/ + case 0x6D: setbit(hl.b.l&0x20); cycles+=4; break; /*BIT 5,L*/ + case 0x6F: setbit(af.b.h&0x20); cycles+=4; break; /*BIT 5,A*/ + case 0x70: setbit(bc.b.h&0x40); cycles+=4; break; /*BIT 6,B*/ + case 0x71: setbit(bc.b.l&0x40); cycles+=4; break; /*BIT 6,C*/ + case 0x72: setbit(de.b.h&0x40); cycles+=4; break; /*BIT 6,D*/ + case 0x73: setbit(de.b.l&0x40); cycles+=4; break; /*BIT 6,E*/ + case 0x74: setbit(hl.b.h&0x40); cycles+=4; break; /*BIT 6,H*/ + case 0x75: setbit(hl.b.l&0x40); cycles+=4; break; /*BIT 6,L*/ + case 0x77: setbit(af.b.h&0x40); cycles+=4; break; /*BIT 6,A*/ + case 0x78: setbit(bc.b.h&0x80); cycles+=4; break; /*BIT 7,B*/ + case 0x79: setbit(bc.b.l&0x80); cycles+=4; break; /*BIT 7,C*/ + case 0x7A: setbit(de.b.h&0x80); cycles+=4; break; /*BIT 7,D*/ + case 0x7B: setbit(de.b.l&0x80); cycles+=4; break; /*BIT 7,E*/ + case 0x7C: setbit(hl.b.h&0x80); cycles+=4; break; /*BIT 7,H*/ + case 0x7D: setbit(hl.b.l&0x80); cycles+=4; break; /*BIT 7,L*/ + case 0x7F: setbit(af.b.h&0x80); cycles+=4; break; /*BIT 7,A*/ + + case 0x46: cycles+=4; temp=z80_readmem(hl.w); setbit2(temp&0x01,intreg); cycles+=4; break; /*BIT 0,(HL)*/ + case 0x4E: cycles+=4; temp=z80_readmem(hl.w); setbit2(temp&0x02,intreg); cycles+=4; break; /*BIT 1,(HL)*/ + case 0x56: cycles+=4; temp=z80_readmem(hl.w); setbit2(temp&0x04,intreg); cycles+=4; break; /*BIT 2,(HL)*/ + case 0x5E: cycles+=4; temp=z80_readmem(hl.w); setbit2(temp&0x08,intreg); cycles+=4; break; /*BIT 3,(HL)*/ + case 0x66: cycles+=4; temp=z80_readmem(hl.w); setbit2(temp&0x10,intreg); cycles+=4; break; /*BIT 4,(HL)*/ + case 0x6E: cycles+=4; temp=z80_readmem(hl.w); setbit2(temp&0x20,intreg); cycles+=4; break; /*BIT 5,(HL)*/ + case 0x76: cycles+=4; temp=z80_readmem(hl.w); setbit2(temp&0x40,intreg); cycles+=4; break; /*BIT 6,(HL)*/ + case 0x7E: cycles+=4; temp=z80_readmem(hl.w); setbit2(temp&0x80,intreg); cycles+=4; break; /*BIT 7,(HL)*/ + + case 0x80: bc.b.h&=~0x01; cycles+=4; break; /*RES 0,B*/ + case 0x81: bc.b.l&=~0x01; cycles+=4; break; /*RES 0,C*/ + case 0x82: de.b.h&=~0x01; cycles+=4; break; /*RES 0,D*/ + case 0x83: de.b.l&=~0x01; cycles+=4; break; /*RES 0,E*/ + case 0x84: hl.b.h&=~0x01; cycles+=4; break; /*RES 0,H*/ + case 0x85: hl.b.l&=~0x01; cycles+=4; break; /*RES 0,L*/ + case 0x87: af.b.h&=~0x01; cycles+=4; break; /*RES 0,A*/ + case 0x88: bc.b.h&=~0x02; cycles+=4; break; /*RES 1,B*/ + case 0x89: bc.b.l&=~0x02; cycles+=4; break; /*RES 1,C*/ + case 0x8A: de.b.h&=~0x02; cycles+=4; break; /*RES 1,D*/ + case 0x8B: de.b.l&=~0x02; cycles+=4; break; /*RES 1,E*/ + case 0x8C: hl.b.h&=~0x02; cycles+=4; break; /*RES 1,H*/ + case 0x8D: hl.b.l&=~0x02; cycles+=4; break; /*RES 1,L*/ + case 0x8F: af.b.h&=~0x02; cycles+=4; break; /*RES 1,A*/ + case 0x90: bc.b.h&=~0x04; cycles+=4; break; /*RES 2,B*/ + case 0x91: bc.b.l&=~0x04; cycles+=4; break; /*RES 2,C*/ + case 0x92: de.b.h&=~0x04; cycles+=4; break; /*RES 2,D*/ + case 0x93: de.b.l&=~0x04; cycles+=4; break; /*RES 2,E*/ + case 0x94: hl.b.h&=~0x04; cycles+=4; break; /*RES 2,H*/ + case 0x95: hl.b.l&=~0x04; cycles+=4; break; /*RES 2,L*/ + case 0x97: af.b.h&=~0x04; cycles+=4; break; /*RES 2,A*/ + case 0x98: bc.b.h&=~0x08; cycles+=4; break; /*RES 3,B*/ + case 0x99: bc.b.l&=~0x08; cycles+=4; break; /*RES 3,C*/ + case 0x9A: de.b.h&=~0x08; cycles+=4; break; /*RES 3,D*/ + case 0x9B: de.b.l&=~0x08; cycles+=4; break; /*RES 3,E*/ + case 0x9C: hl.b.h&=~0x08; cycles+=4; break; /*RES 3,H*/ + case 0x9D: hl.b.l&=~0x08; cycles+=4; break; /*RES 3,L*/ + case 0x9F: af.b.h&=~0x08; cycles+=4; break; /*RES 3,A*/ + case 0xA0: bc.b.h&=~0x10; cycles+=4; break; /*RES 4,B*/ + case 0xA1: bc.b.l&=~0x10; cycles+=4; break; /*RES 4,C*/ + case 0xA2: de.b.h&=~0x10; cycles+=4; break; /*RES 4,D*/ + case 0xA3: de.b.l&=~0x10; cycles+=4; break; /*RES 4,E*/ + case 0xA4: hl.b.h&=~0x10; cycles+=4; break; /*RES 4,H*/ + case 0xA5: hl.b.l&=~0x10; cycles+=4; break; /*RES 4,L*/ + case 0xA7: af.b.h&=~0x10; cycles+=4; break; /*RES 4,A*/ + case 0xA8: bc.b.h&=~0x20; cycles+=4; break; /*RES 5,B*/ + case 0xA9: bc.b.l&=~0x20; cycles+=4; break; /*RES 5,C*/ + case 0xAA: de.b.h&=~0x20; cycles+=4; break; /*RES 5,D*/ + case 0xAB: de.b.l&=~0x20; cycles+=4; break; /*RES 5,E*/ + case 0xAC: hl.b.h&=~0x20; cycles+=4; break; /*RES 5,H*/ + case 0xAD: hl.b.l&=~0x20; cycles+=4; break; /*RES 5,L*/ + case 0xAF: af.b.h&=~0x20; cycles+=4; break; /*RES 5,A*/ + case 0xB0: bc.b.h&=~0x40; cycles+=4; break; /*RES 6,B*/ + case 0xB1: bc.b.l&=~0x40; cycles+=4; break; /*RES 6,C*/ + case 0xB2: de.b.h&=~0x40; cycles+=4; break; /*RES 6,D*/ + case 0xB3: de.b.l&=~0x40; cycles+=4; break; /*RES 6,E*/ + case 0xB4: hl.b.h&=~0x40; cycles+=4; break; /*RES 6,H*/ + case 0xB5: hl.b.l&=~0x40; cycles+=4; break; /*RES 6,L*/ + case 0xB7: af.b.h&=~0x40; cycles+=4; break; /*RES 6,A*/ + case 0xB8: bc.b.h&=~0x80; cycles+=4; break; /*RES 7,B*/ + case 0xB9: bc.b.l&=~0x80; cycles+=4; break; /*RES 7,C*/ + case 0xBA: de.b.h&=~0x80; cycles+=4; break; /*RES 7,D*/ + case 0xBB: de.b.l&=~0x80; cycles+=4; break; /*RES 7,E*/ + case 0xBC: hl.b.h&=~0x80; cycles+=4; break; /*RES 7,H*/ + case 0xBD: hl.b.l&=~0x80; cycles+=4; break; /*RES 7,L*/ + case 0xBF: af.b.h&=~0x80; cycles+=4; break; /*RES 7,A*/ + + case 0x86: cycles+=4; temp=z80_readmem(hl.w)&~0x01; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*RES 0,(HL)*/ + case 0x8E: cycles+=4; temp=z80_readmem(hl.w)&~0x02; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*RES 1,(HL)*/ + case 0x96: cycles+=4; temp=z80_readmem(hl.w)&~0x04; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*RES 2,(HL)*/ + case 0x9E: cycles+=4; temp=z80_readmem(hl.w)&~0x08; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*RES 3,(HL)*/ + case 0xA6: cycles+=4; temp=z80_readmem(hl.w)&~0x10; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*RES 4,(HL)*/ + case 0xAE: cycles+=4; temp=z80_readmem(hl.w)&~0x20; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*RES 5,(HL)*/ + case 0xB6: cycles+=4; temp=z80_readmem(hl.w)&~0x40; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*RES 6,(HL)*/ + case 0xBE: cycles+=4; temp=z80_readmem(hl.w)&~0x80; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*RES 7,(HL)*/ + + case 0xC0: bc.b.h|=0x01; cycles+=4; break; /*SET 0,B*/ + case 0xC1: bc.b.l|=0x01; cycles+=4; break; /*SET 0,C*/ + case 0xC2: de.b.h|=0x01; cycles+=4; break; /*SET 0,D*/ + case 0xC3: de.b.l|=0x01; cycles+=4; break; /*SET 0,E*/ + case 0xC4: hl.b.h|=0x01; cycles+=4; break; /*SET 0,H*/ + case 0xC5: hl.b.l|=0x01; cycles+=4; break; /*SET 0,L*/ + case 0xC7: af.b.h|=0x01; cycles+=4; break; /*SET 0,A*/ + case 0xC8: bc.b.h|=0x02; cycles+=4; break; /*SET 1,B*/ + case 0xC9: bc.b.l|=0x02; cycles+=4; break; /*SET 1,C*/ + case 0xCA: de.b.h|=0x02; cycles+=4; break; /*SET 1,D*/ + case 0xCB: de.b.l|=0x02; cycles+=4; break; /*SET 1,E*/ + case 0xCC: hl.b.h|=0x02; cycles+=4; break; /*SET 1,H*/ + case 0xCD: hl.b.l|=0x02; cycles+=4; break; /*SET 1,L*/ + case 0xCF: af.b.h|=0x02; cycles+=4; break; /*SET 1,A*/ + case 0xD0: bc.b.h|=0x04; cycles+=4; break; /*SET 2,B*/ + case 0xD1: bc.b.l|=0x04; cycles+=4; break; /*SET 2,C*/ + case 0xD2: de.b.h|=0x04; cycles+=4; break; /*SET 2,D*/ + case 0xD3: de.b.l|=0x04; cycles+=4; break; /*SET 2,E*/ + case 0xD4: hl.b.h|=0x04; cycles+=4; break; /*SET 2,H*/ + case 0xD5: hl.b.l|=0x04; cycles+=4; break; /*SET 2,L*/ + case 0xD7: af.b.h|=0x04; cycles+=4; break; /*SET 2,A*/ + case 0xD8: bc.b.h|=0x08; cycles+=4; break; /*SET 3,B*/ + case 0xD9: bc.b.l|=0x08; cycles+=4; break; /*SET 3,C*/ + case 0xDA: de.b.h|=0x08; cycles+=4; break; /*SET 3,D*/ + case 0xDB: de.b.l|=0x08; cycles+=4; break; /*SET 3,E*/ + case 0xDC: hl.b.h|=0x08; cycles+=4; break; /*SET 3,H*/ + case 0xDD: hl.b.l|=0x08; cycles+=4; break; /*SET 3,L*/ + case 0xDF: af.b.h|=0x08; cycles+=4; break; /*SET 3,A*/ + case 0xE0: bc.b.h|=0x10; cycles+=4; break; /*SET 4,B*/ + case 0xE1: bc.b.l|=0x10; cycles+=4; break; /*SET 4,C*/ + case 0xE2: de.b.h|=0x10; cycles+=4; break; /*SET 4,D*/ + case 0xE3: de.b.l|=0x10; cycles+=4; break; /*SET 4,E*/ + case 0xE4: hl.b.h|=0x10; cycles+=4; break; /*SET 4,H*/ + case 0xE5: hl.b.l|=0x10; cycles+=4; break; /*SET 4,L*/ + case 0xE7: af.b.h|=0x10; cycles+=4; break; /*SET 4,A*/ + case 0xE8: bc.b.h|=0x20; cycles+=4; break; /*SET 5,B*/ + case 0xE9: bc.b.l|=0x20; cycles+=4; break; /*SET 5,C*/ + case 0xEA: de.b.h|=0x20; cycles+=4; break; /*SET 5,D*/ + case 0xEB: de.b.l|=0x20; cycles+=4; break; /*SET 5,E*/ + case 0xEC: hl.b.h|=0x20; cycles+=4; break; /*SET 5,H*/ + case 0xED: hl.b.l|=0x20; cycles+=4; break; /*SET 5,L*/ + case 0xEF: af.b.h|=0x20; cycles+=4; break; /*SET 5,A*/ + case 0xF0: bc.b.h|=0x40; cycles+=4; break; /*SET 6,B*/ + case 0xF1: bc.b.l|=0x40; cycles+=4; break; /*SET 6,C*/ + case 0xF2: de.b.h|=0x40; cycles+=4; break; /*SET 6,D*/ + case 0xF3: de.b.l|=0x40; cycles+=4; break; /*SET 6,E*/ + case 0xF4: hl.b.h|=0x40; cycles+=4; break; /*SET 6,H*/ + case 0xF5: hl.b.l|=0x40; cycles+=4; break; /*SET 6,L*/ + case 0xF7: af.b.h|=0x40; cycles+=4; break; /*SET 6,A*/ + case 0xF8: bc.b.h|=0x80; cycles+=4; break; /*SET 7,B*/ + case 0xF9: bc.b.l|=0x80; cycles+=4; break; /*SET 7,C*/ + case 0xFA: de.b.h|=0x80; cycles+=4; break; /*SET 7,D*/ + case 0xFB: de.b.l|=0x80; cycles+=4; break; /*SET 7,E*/ + case 0xFC: hl.b.h|=0x80; cycles+=4; break; /*SET 7,H*/ + case 0xFD: hl.b.l|=0x80; cycles+=4; break; /*SET 7,L*/ + case 0xFF: af.b.h|=0x80; cycles+=4; break; /*SET 7,A*/ + + case 0xC6: cycles+=4; temp=z80_readmem(hl.w)|0x01; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*SET 0,(HL)*/ + case 0xCE: cycles+=4; temp=z80_readmem(hl.w)|0x02; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*SET 1,(HL)*/ + case 0xD6: cycles+=4; temp=z80_readmem(hl.w)|0x04; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*SET 2,(HL)*/ + case 0xDE: cycles+=4; temp=z80_readmem(hl.w)|0x08; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*SET 3,(HL)*/ + case 0xE6: cycles+=4; temp=z80_readmem(hl.w)|0x10; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*SET 4,(HL)*/ + case 0xEE: cycles+=4; temp=z80_readmem(hl.w)|0x20; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*SET 5,(HL)*/ + case 0xF6: cycles+=4; temp=z80_readmem(hl.w)|0x40; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*SET 6,(HL)*/ + case 0xFE: cycles+=4; temp=z80_readmem(hl.w)|0x80; cycles+=4; z80_writemem(hl.w,temp); cycles+=3; break; /*SET 7,(HL)*/ + + default: + break; +// printf("Bad CB opcode %02X at %04X\n",opcode,pc); +// z80_dumpregs(); +// exit(-1); + } + break; + + case 0xCC: /*CALL Z,xxxx*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + if (af.b.l&Z_FLAG) + { + cycles+=4; sp--; z80_writemem(sp,pc>>8); + cycles+=3; sp--; z80_writemem(sp,pc&0xFF); + pc=addr; + cycles+=3; + } + else + cycles+=3; + break; + case 0xCD: /*CALL xxxx*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + cycles+=4; sp--; z80_writemem(sp,pc>>8); + cycles+=3; sp--; z80_writemem(sp,pc&0xFF); + pc=addr; + cycles+=3; + break; + case 0xCE: /*ADC A,nn*/ + cycles+=4; temp=z80_readmem(pc++); + setadc(af.b.h,temp); + af.b.h+=temp+tempc; + cycles+=3; + break; + case 0xCF: /*RST 8*/ + cycles+=5; sp--; z80_writemem(sp,pc>>8); + cycles+=3; sp--; z80_writemem(sp,pc&0xFF); + pc=0x08; + cycles+=3; + break; + + case 0xD0: /*RET NC*/ + cycles+=5; + if (!(af.b.l&C_FLAG)) + { + pc=z80_readmem(sp); sp++; + cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; + cycles+=3; + } + break; + case 0xD1: /*POP DE*/ + cycles+=4; de.b.l=z80_readmem(sp); sp++; + cycles+=3; de.b.h=z80_readmem(sp); sp++; + cycles+=3; + break; + case 0xD2: /*JP NC*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + if (!(af.b.l&C_FLAG)) + pc=addr; + cycles+=3; + break; + case 0xD3: /*OUT (nn),A*/ + cycles+=4; addr=z80_readmem(pc++); + cycles+=3; z80out(addr,af.b.h); + cycles+=4; + break; + case 0xD4: /*CALL NC,xxxx*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + if (!(af.b.l&C_FLAG)) + { + cycles+=4; sp--; z80_writemem(sp,pc>>8); + cycles+=3; sp--; z80_writemem(sp,pc&0xFF); + pc=addr; + cycles+=3; + } + else + cycles+=3; + break; + case 0xD5: /*PUSH DE*/ + cycles+=5; sp--; z80_writemem(sp,de.b.h); + cycles+=3; sp--; z80_writemem(sp,de.b.l); + cycles+=3; + break; + case 0xD6: /*SUB A,nn*/ + cycles+=4; temp=z80_readmem(pc++); + z80_setsub(af.b.h,temp); + af.b.h-=temp; + cycles+=3; + break; + case 0xD7: /*RST 10*/ + cycles+=5; sp--; z80_writemem(sp,pc>>8); + cycles+=3; sp--; z80_writemem(sp,pc&0xFF); + pc=0x10; + cycles+=3; + break; + case 0xD8: /*RET C*/ + cycles+=5; + if (af.b.l&C_FLAG) + { + pc=z80_readmem(sp); sp++; + cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; + cycles+=3; + } + break; + case 0xD9: /*EXX*/ + addr=bc.w; bc.w=sbc.w; sbc.w=addr; + addr=de.w; de.w=sde.w; sde.w=addr; + addr=hl.w; hl.w=shl.w; shl.w=addr; + cycles+=4; + break; + case 0xDA: /*JP C*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + if (af.b.l&C_FLAG) + pc=addr; + cycles+=3; + break; + case 0xDB: /*IN A,(n)*/ + cycles+=4; temp=z80_readmem(pc++); + cycles+=3; af.b.h=z80in((af.b.h<<8)|temp); + cycles+=4; + break; + case 0xDC: /*CALL C,xxxx*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + if (af.b.l&C_FLAG) + { + cycles+=4; sp--; z80_writemem(sp,pc>>8); + cycles+=3; sp--; z80_writemem(sp,pc&0xFF); + pc=addr; + cycles+=3; + } + else + cycles+=3; + break; + + case 0xDD: /*More opcodes*/ + ir.b.l=((ir.b.l+1)&0x7F)|(ir.b.l&0x80); + cycles+=4; + opcode=z80_readmem(pc++); + switch (opcode) + { + case 0xCD: + pc--; +// cycles+=4; + break; + case 0x09: /*ADD IX,BC*/ + z80_setadd16(ix.w,bc.w); + ix.w+=bc.w; + cycles+=11; + break; + case 0x19: /*ADD IX,DE*/ + z80_setadd16(ix.w,de.w); + ix.w+=de.w; + cycles+=11; + break; + case 0x21: /*LD IX,nn*/ + cycles+=4; ix.b.l=z80_readmem(pc++); + cycles+=3; ix.b.h=z80_readmem(pc++); + cycles+=3; + break; + case 0x22: /*LD (nn),IX*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + cycles+=3; z80_writemem(addr,ix.b.l); + cycles+=3; z80_writemem(addr+1,ix.b.h); + cycles+=3; + break; + case 0x23: /*INC IX*/ + ix.w++; + cycles+=6; + break; + case 0x24: /*INC IXh*/ + setinc(ix.b.h); + ix.b.h++; + cycles+=4; + break; + case 0x25: /*DEC IXh*/ + setdec(ix.b.h); + ix.b.h--; + cycles+=4; + break; + case 0x26: /*LD IXh,nn*/ + cycles+=4; ix.b.h=z80_readmem(pc++); + cycles+=3; + break; + case 0x29: /*ADD IX,IX*/ + z80_setadd16(ix.w,ix.w); + ix.w+=ix.w; + cycles+=11; + break; + case 0x2A: /*LD IX,(nn)*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + cycles+=3; ix.b.l=z80_readmem(addr); + cycles+=3; ix.b.h=z80_readmem(addr+1); + cycles+=3; + break; + case 0x2B: /*DEC IX*/ + ix.w--; + cycles+=6; + break; + case 0x2C: /*INC IXl*/ + setinc(ix.b.l); + ix.b.l++; + cycles+=4; + break; + case 0x2D: /*DEC IXl*/ + setdec(ix.b.l); + ix.b.l--; + cycles+=4; + break; + case 0x2E: /*LD IXl,nn*/ + cycles+=4; ix.b.l=z80_readmem(pc++); + cycles+=3; + break; + case 0x34: /*INC (IX+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + addr+=ix.w; + cycles+=3; temp=z80_readmem(addr); + setinc(temp); + cycles+=5; z80_writemem(addr,temp+1); + cycles+=7; + break; + case 0x35: /*DEC (IX+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + addr+=ix.w; + cycles+=3; temp=z80_readmem(addr); + setdec(temp); + cycles+=5; z80_writemem(addr,temp-1); + cycles+=7; + break; + case 0x36: /*LD (IX+nn),nn*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=3; temp=z80_readmem(pc++); + cycles+=5; z80_writemem(ix.w+addr,temp); + cycles+=3; + break; + case 0x39: /*ADD IX,SP*/ + z80_setadd16(ix.w,sp); + ix.w+=sp; + cycles+=11; + break; + + case 0x46: /*LD B,(IX+nn)*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + intreg=(ix.w+addr)>>8; + cycles+=7; bc.b.h=z80_readmem(ix.w+addr); + cycles+=8; + break; + case 0x4E: /*LD C,(IX+nn)*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + intreg=(ix.w+addr)>>8; + cycles+=7; bc.b.l=z80_readmem(ix.w+addr); + cycles+=8; + break; + case 0x56: /*LD D,(IX+nn)*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + intreg=(ix.w+addr)>>8; + cycles+=7; de.b.h=z80_readmem(ix.w+addr); + cycles+=8; + break; + case 0x44: bc.b.h=ix.b.h; cycles+=3; break; /*LD B,IXh*/ + case 0x45: bc.b.h=ix.b.l; cycles+=3; break; /*LD B,IXl*/ + case 0x54: de.b.h=ix.b.h; cycles+=3; break; /*LD D,IXh*/ + case 0x55: de.b.h=ix.b.l; cycles+=3; break; /*LD D,IXl*/ + case 0x5C: de.b.l=ix.b.h; cycles+=3; break; /*LD E,IXh*/ + case 0x5D: de.b.l=ix.b.l; cycles+=3; break; /*LD E,IXl*/ + case 0x5E: /*LD E,(IX+nn)*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + intreg=(ix.w+addr)>>8; + cycles+=7; de.b.l=z80_readmem(ix.w+addr); + cycles+=8; + break; + case 0x66: /*LD H,(IX+nn)*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + intreg=(ix.w+addr)>>8; + cycles+=7; hl.b.h=z80_readmem(ix.w+addr); + cycles+=8; + break; + case 0x6E: /*LD L,(IX+nn)*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + intreg=(ix.w+addr)>>8; + cycles+=7; hl.b.l=z80_readmem(ix.w+addr); + cycles+=8; + break; + case 0x60: ix.b.h=bc.b.h; cycles+=3; break; /*LD IXh,B*/ + case 0x61: ix.b.h=bc.b.l; cycles+=3; break; /*LD IXh,C*/ + case 0x62: ix.b.h=de.b.h; cycles+=3; break; /*LD IXh,D*/ + case 0x63: ix.b.h=de.b.l; cycles+=3; break; /*LD IXh,E*/ + case 0x64: ix.b.h=hl.b.h; cycles+=3; break; /*LD IXh,H*/ + case 0x65: ix.b.h=hl.b.l; cycles+=3; break; /*LD IXh,L*/ + case 0x67: ix.b.h=af.b.h; cycles+=3; break; /*LD IXh,A*/ + case 0x68: ix.b.l=bc.b.h; cycles+=3; break; /*LD IXl,B*/ + case 0x69: ix.b.l=bc.b.l; cycles+=3; break; /*LD IXl,C*/ + case 0x6A: ix.b.l=de.b.h; cycles+=3; break; /*LD IXl,D*/ + case 0x6B: ix.b.l=de.b.l; cycles+=3; break; /*LD IXl,E*/ + case 0x6C: ix.b.l=hl.b.h; cycles+=3; break; /*LD IXl,H*/ + case 0x6D: ix.b.l=hl.b.l; cycles+=3; break; /*LD IXl,L*/ + case 0x6F: ix.b.l=af.b.h; cycles+=3; break; /*LD IXl,A*/ + case 0x70: /*LD (IX+nn),B*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=7; z80_writemem(ix.w+addr,bc.b.h); + cycles+=8; + break; + case 0x71: /*LD (IX+nn),C*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=7; z80_writemem(ix.w+addr,bc.b.l); + cycles+=8; + break; + case 0x72: /*LD (IX+nn),D*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=7; z80_writemem(ix.w+addr,de.b.h); + cycles+=8; + break; + case 0x73: /*LD (IX+nn),E*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=7; z80_writemem(ix.w+addr,de.b.l); + cycles+=8; + break; + case 0x74: /*LD (IX+nn),H*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=7; z80_writemem(ix.w+addr,hl.b.h); + cycles+=8; + break; + case 0x75: /*LD (IX+nn),L*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=7; z80_writemem(ix.w+addr,hl.b.l); + cycles+=8; + break; + case 0x77: /*LD (IX+nn),A*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=7; z80_writemem(ix.w+addr,af.b.h); + cycles+=8; + break; + case 0x7E: /*LD A,(IX+nn)*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=7; af.b.h=z80_readmem(ix.w+addr); + cycles+=8; + break; + case 0x7C: af.b.h=ix.b.h; cycles+=3; break; /*LD A,IXh*/ + case 0x7D: af.b.h=ix.b.l; cycles+=3; break; /*LD A,IXl*/ + + case 0x84: z80_setadd(af.b.h,ix.b.h); af.b.h+=ix.b.h; cycles+=3; break; /*ADD IXh*/ + case 0x85: z80_setadd(af.b.h,ix.b.l); af.b.h+=ix.b.l; cycles+=3; break; /*ADD IXl*/ + case 0x8C: setadc(af.b.h,ix.b.h); af.b.h+=ix.b.h+tempc; cycles+=3; break; /*ADC IXh*/ + case 0x8D: setadc(af.b.h,ix.b.l); af.b.h+=ix.b.l+tempc; cycles+=3; break; /*ADC IXl*/ + case 0x94: z80_setsub(af.b.h,ix.b.h); af.b.h-=ix.b.h; cycles+=3; break; /*SUB IXh*/ + case 0x95: z80_setsub(af.b.h,ix.b.l); af.b.h-=ix.b.l; cycles+=3; break; /*SUB IXl*/ + case 0x9C: setsbc(af.b.h,ix.b.h); af.b.h-=(ix.b.h+tempc); cycles+=3; break; /*SBC IXh*/ + case 0x9D: setsbc(af.b.h,ix.b.l); af.b.h-=(ix.b.l+tempc); cycles+=3; break; /*SBC IXl*/ + case 0xA4: setand(af.b.h&ix.b.h); af.b.h&=ix.b.h; cycles+=3; break; /*AND IXh*/ + case 0xA5: setand(af.b.h&ix.b.l); af.b.h&=ix.b.l; cycles+=3; break; /*AND IXl*/ + case 0xAC: setzn(af.b.h^ix.b.h); af.b.h^=ix.b.h; cycles+=3; break; /*XOR IXh*/ + case 0xAD: setzn(af.b.h^ix.b.l); af.b.h^=ix.b.l; cycles+=3; break; /*XOR IXl*/ + case 0xB4: setzn(af.b.h|ix.b.h); af.b.h|=ix.b.h; cycles+=3; break; /*OR IXh*/ + case 0xB5: setzn(af.b.h|ix.b.l); af.b.h|=ix.b.l; cycles+=3; break; /*OR IXl*/ + case 0xBC: setcp(af.b.h,ix.b.h); cycles+=3; break; /*CP IXh*/ + case 0xBD: setcp(af.b.h,ix.b.l); cycles+=3; break; /*CP IXl*/ + + case 0x86: /*ADD (IX+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=3; temp=z80_readmem(ix.w+addr); + z80_setadd(af.b.h,temp); + af.b.h+=temp; + cycles+=8; + break; + case 0x8E: /*ADC (IX+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=3; temp=z80_readmem(ix.w+addr); + setadc(af.b.h,temp); + af.b.h+=(temp+tempc); + cycles+=8; + break; + case 0x96: /*SUB (IX+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=3; temp=z80_readmem(ix.w+addr); + z80_setsub(af.b.h,temp); + af.b.h-=temp; + cycles+=8; + break; + case 0x9E: /*SBC (IX+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=3; temp=z80_readmem(ix.w+addr); + setsbc(af.b.h,temp); + af.b.h-=(temp+tempc); + cycles+=8; + break; + case 0xA6: /*AND (IX+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=3; temp=z80_readmem(ix.w+addr); + setand(af.b.h); + cycles+=8; + break; + case 0xAE: /*XOR (IX+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=3; temp=z80_readmem(ix.w+addr); + setzn(af.b.h); + cycles+=8; + break; + case 0xB6: /*OR (IX+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=3; temp=z80_readmem(ix.w+addr); + setzn(af.b.h); + cycles+=8; + break; + case 0xBE: /*CP (IX+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=3; temp=z80_readmem(ix.w+addr); + setcp(af.b.h,temp); + cycles+=8; + break; + + case 0xCB: /*More opcodes*/ + ir.b.l=((ir.b.l+1)&0x7F)|(ir.b.l&0x80); + cycles+=4; addr=z80_readmem(pc++); + if (addr&0x80) addr|=0xFF00; + cycles+=3; opcode=z80_readmem(pc++); + switch (opcode) + { + case 0x06: /*RLC (IX+nn)*/ + cycles+=5; temp=z80_readmem(addr+ix.w); + tempc=temp&0x80; + temp<<=1; + if (tempc) temp|=1; + setzn(temp); + if (tempc) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(addr+ix.w,temp); + cycles+=3; + break; + case 0x0E: /*RRC (IX+nn)*/ + cycles+=5; temp=z80_readmem(addr+ix.w); + tempc=temp&1; + temp>>=1; + if (tempc) temp|=0x80; + setzn(temp); + if (tempc) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(addr+ix.w,temp); + cycles+=3; + break; + case 0x16: /*RL (IX+nn)*/ + cycles+=5; temp=z80_readmem(addr+ix.w); + addr=temp&0x80; + temp<<=1; + if (tempc) temp|=1; + setzn(temp); + if (addr) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(addr+ix.w,temp); + cycles+=3; + break; + case 0x1E: /*RR (IX+nn)*/ + cycles+=5; temp=z80_readmem(addr+ix.w); + addr=temp&1; + temp>>=1; + if (tempc) temp|=0x80; + setzn(temp); + if (addr) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(addr+ix.w,temp); + cycles+=3; + break; + case 0x26: /*SLA (IX+nn)*/ + cycles+=5; temp=z80_readmem(addr+ix.w); + tempc=temp&0x80; + temp<<=1; + setzn(temp); + if (tempc) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(addr+ix.w,temp); + cycles+=3; + break; + case 0x2E: /*SRA (IX+nn)*/ + cycles+=5; temp=z80_readmem(addr+ix.w); + tempc=temp&1; + temp>>=1; + if (temp&0x40) temp|=0x80; + setzn(temp); + if (tempc) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(addr+ix.w,temp); + cycles+=3; + break; + case 0x3E: /*SRL (IX+nn)*/ + cycles+=5; temp=z80_readmem(addr+ix.w); + tempc=temp&1; + temp>>=1; + setzn(temp); + if (tempc) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(addr+ix.w,temp); + cycles+=3; + break; + + + case 0x46: cycles+=5; temp=z80_readmem(ix.w+addr); setbit2(temp&1,ix.w+addr); cycles+=4; break; /*BIT 0,(IX+nn)*/ + case 0x4E: cycles+=5; temp=z80_readmem(ix.w+addr); setbit2(temp&2,ix.w+addr); cycles+=4; break; /*BIT 1,(IX+nn)*/ + case 0x56: cycles+=5; temp=z80_readmem(ix.w+addr); setbit2(temp&4,ix.w+addr); cycles+=4; break; /*BIT 2,(IX+nn)*/ + case 0x5E: cycles+=5; temp=z80_readmem(ix.w+addr); setbit2(temp&8,ix.w+addr); cycles+=4; break; /*BIT 3,(IX+nn)*/ + case 0x66: cycles+=5; temp=z80_readmem(ix.w+addr); setbit2(temp&0x10,ix.w+addr); cycles+=4; break; /*BIT 4,(IX+nn)*/ + case 0x6E: cycles+=5; temp=z80_readmem(ix.w+addr); setbit2(temp&0x20,ix.w+addr); cycles+=4; break; /*BIT 5,(IX+nn)*/ + case 0x76: cycles+=5; temp=z80_readmem(ix.w+addr); setbit2(temp&0x40,ix.w+addr); cycles+=4; break; /*BIT 6,(IX+nn)*/ + case 0x7E: cycles+=5; temp=z80_readmem(ix.w+addr); setbit2(temp&0x80,ix.w+addr); cycles+=4; break; /*BIT 7,(IX+nn)*/ + + case 0x86: cycles+=5; temp=z80_readmem(ix.w+addr)&~1; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*RES 0,(IX+nn)*/ + case 0x8E: cycles+=5; temp=z80_readmem(ix.w+addr)&~2; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*RES 1,(IX+nn)*/ + case 0x96: cycles+=5; temp=z80_readmem(ix.w+addr)&~4; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*RES 2,(IX+nn)*/ + case 0x9E: cycles+=5; temp=z80_readmem(ix.w+addr)&~8; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*RES 3,(IX+nn)*/ + case 0xA6: cycles+=5; temp=z80_readmem(ix.w+addr)&~0x10; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*RES 4,(IX+nn)*/ + case 0xAE: cycles+=5; temp=z80_readmem(ix.w+addr)&~0x20; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*RES 5,(IX+nn)*/ + case 0xB6: cycles+=5; temp=z80_readmem(ix.w+addr)&~0x40; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*RES 6,(IX+nn)*/ + case 0xBE: cycles+=5; temp=z80_readmem(ix.w+addr)&~0x80; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*RES 7,(IX+nn)*/ + case 0xC6: cycles+=5; temp=z80_readmem(ix.w+addr)|1; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*SET 0,(IX+nn)*/ + case 0xCE: cycles+=5; temp=z80_readmem(ix.w+addr)|2; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*SET 1,(IX+nn)*/ + case 0xD6: cycles+=5; temp=z80_readmem(ix.w+addr)|4; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*SET 2,(IX+nn)*/ + case 0xDE: cycles+=5; temp=z80_readmem(ix.w+addr)|8; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*SET 3,(IX+nn)*/ + case 0xE6: cycles+=5; temp=z80_readmem(ix.w+addr)|0x10; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*SET 4,(IX+nn)*/ + case 0xEE: cycles+=5; temp=z80_readmem(ix.w+addr)|0x20; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*SET 5,(IX+nn)*/ + case 0xF6: cycles+=5; temp=z80_readmem(ix.w+addr)|0x40; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*SET 6,(IX+nn)*/ + case 0xFE: cycles+=5; temp=z80_readmem(ix.w+addr)|0x80; cycles+=4; z80_writemem(ix.w+addr,temp); cycles+=3; break; /*SET 7,(IX+nn)*/ + + default: + break; +// printf("Bad DD CB opcode %02X at %04X\n",opcode,pc); +// z80_dumpregs(); +// exit(-1); + } + break; + + case 0xE1: /*POP IX*/ + cycles+=4; ix.b.l=z80_readmem(sp); sp++; + cycles+=3; ix.b.h=z80_readmem(sp); sp++; + cycles+=3; + break; + case 0xE3: /*EX (SP),IX*/ + cycles+=4; addr=z80_readmem(sp); + cycles+=3; addr|=(z80_readmem(sp+1)<<8); + cycles+=4; z80_writemem(sp,ix.b.l); + cycles+=3; z80_writemem(sp+1,ix.b.h); + ix.w=addr; + cycles+=5; + break; + case 0xE5: /*PUSH IX*/ + cycles+=5; sp--; z80_writemem(sp,ix.b.h); + cycles+=3; sp--; z80_writemem(sp,ix.b.l); + cycles+=3; + break; + case 0xE9: /*JP (IX)*/ + pc=ix.w; + cycles+=4; + break; + + case 0xF9: /*LD SP,IX*/ + sp=ix.w; + cycles+=6; + break; + + default: + break; +// printf("Bad DD opcode %02X at %04X\n",opcode,pc); +// z80_dumpregs(); +// exit(-1); + } + break; + + case 0xDE: /*SBC A,nn*/ + cycles+=4; temp=z80_readmem(pc++); + setsbc(af.b.h,temp); + af.b.h-=(temp+tempc); + cycles+=3; + break; + case 0xDF: /*RST 18*/ + cycles+=5; sp--; z80_writemem(sp,pc>>8); + cycles+=3; sp--; z80_writemem(sp,pc&0xFF); + pc=0x18; + cycles+=3; + break; + + case 0xE0: /*RET PO*/ + cycles+=5; + if (!(af.b.l&V_FLAG)) + { + pc=z80_readmem(sp); sp++; + cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; + cycles+=3; + } + break; + case 0xE1: /*POP HL*/ + cycles+=4; hl.b.l=z80_readmem(sp); sp++; + cycles+=3; hl.b.h=z80_readmem(sp); sp++; + cycles+=3; + break; + case 0xE2: /*JP PO*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + if (!(af.b.l&V_FLAG)) + pc=addr; + cycles+=3; + break; + case 0xE3: /*EX (SP),HL*/ + cycles+=4; addr=z80_readmem(sp); + cycles+=3; addr|=(z80_readmem(sp+1)<<8); + cycles+=4; z80_writemem(sp,hl.b.l); + cycles+=3; z80_writemem(sp+1,hl.b.h); + hl.w=addr; + cycles+=5; + break; + case 0xE4: /*CALL PO,xxxx*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + if (!(af.b.l&V_FLAG)) + { + cycles+=4; sp--; z80_writemem(sp,pc>>8); + cycles+=3; sp--; z80_writemem(sp,pc&0xFF); + pc=addr; + cycles+=3; + } + else + cycles+=3; + break; + case 0xE5: /*PUSH HL*/ + cycles+=5; sp--; z80_writemem(sp,hl.b.h); + cycles+=3; sp--; z80_writemem(sp,hl.b.l); + cycles+=3; + break; + case 0xE6: /*AND nn*/ + cycles+=4; af.b.h&=z80_readmem(pc++); + setand(af.b.h); + cycles+=3; + break; + case 0xE7: /*RST 20*/ + cycles+=5; sp--; z80_writemem(sp,pc>>8); + cycles+=3; sp--; z80_writemem(sp,pc&0xFF); + pc=0x20; + cycles+=3; + break; + case 0xE8: /*RET PE*/ + cycles+=5; + if (af.b.l&V_FLAG) + { + pc=z80_readmem(sp); sp++; + cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; + cycles+=3; + } + break; + case 0xE9: /*JP (HL)*/ + pc=hl.w; + cycles+=4; + break; + case 0xEA: /*JP PE*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + if (af.b.l&V_FLAG) + pc=addr; + cycles+=3; + break; + case 0xEB: /*EX DE,HL*/ + addr=de.w; de.w=hl.w; hl.w=addr; + cycles+=4; + break; + case 0xEC: /*CALL PE,xxxx*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + if (af.b.l&V_FLAG) + { + cycles+=4; sp--; z80_writemem(sp,pc>>8); + cycles+=3; sp--; z80_writemem(sp,pc&0xFF); + pc=addr; + cycles+=3; + } + else + cycles+=3; + break; + + case 0xED: /*More opcodes*/ + ir.b.l=((ir.b.l+1)&0x7F)|(ir.b.l&0x80); + cycles+=4; + opcode=z80_readmem(pc++); + switch (opcode) + { + case 0x40: /*IN B,(C)*/ + cycles+=4; bc.b.h=z80in(bc.w); + setzn(bc.b.h); + cycles+=4; + break; + case 0x42: /*SBC HL,BC*/ + setsbc16(hl.w,bc.w); + hl.w-=(bc.w+tempc); + cycles+=11; + break; + case 0x43: /*LD (nn),BC*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + cycles+=3; z80_writemem(addr,bc.b.l); + cycles+=3; z80_writemem(addr+1,bc.b.h); + cycles+=3; + break; + case 0x44: /*NEG*/ + z80_setsub(0,af.b.h); + af.b.h=0-af.b.h; + cycles+=4; + break; + case 0x45: /*RETN*/ + output=0; + iff1=iff2; + cycles+=4; pc=z80_readmem(sp); sp++; + cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; + cycles+=3; + break; + case 0x47: /*LD I,A*/ + ir.b.h=af.b.h; + printf("I now %02X %04X\n",ir.b.h,ir.w); + cycles+=5; + break; + case 0x4A: /*ADC HL,BC*/ + setadc16(hl.w,bc.w); + hl.w+=(bc.w+tempc); + cycles+=11; + break; + case 0x4B: /*LD BC,(nn)*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + cycles+=3; bc.b.l=z80_readmem(addr); + cycles+=3; bc.b.h=z80_readmem(addr+1); + cycles+=3; + break; + case 0x4D: /*RETI*/ + cycles+=4; pc=z80_readmem(sp); sp++; + cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; + cycles+=3; + break; + case 0x4F: /*LD R,A*/ + ir.b.l=af.b.h; + cycles+=5; + break; + case 0x50: /*IN D,(C)*/ + cycles+=4; de.b.h=z80in(bc.w); + setzn(de.b.h); + cycles+=4; + break; + case 0x51: /*OUT (C),D*/ + cycles+=4; z80out(bc.w,de.b.h); + cycles+=4; + break; + case 0x52: /*SBC HL,DE*/ + setsbc16(hl.w,de.w); + hl.w-=(de.w+tempc); + cycles+=11; + break; + case 0x53: /*LD (nn),DE*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + cycles+=3; z80_writemem(addr,de.b.l); + cycles+=3; z80_writemem(addr+1,de.b.h); + cycles+=3; + break; + case 0x56: /*IM 1*/ + im=1; + cycles+=4; + break; + case 0x57: /*LD A,I*/ + af.b.h=ir.b.h; + cycles+=5; + break; + case 0x58: /*IN E,(C)*/ + cycles+=4; de.b.l=z80in(bc.w); + setzn(de.b.l); + cycles+=4; + break; + case 0x59: /*OUT (C),E*/ + cycles+=4; z80out(bc.w,de.b.l); + cycles+=4; + break; + case 0x5A: /*ADC HL,DE*/ + setadc16(hl.w,de.w); + hl.w+=(de.w+tempc); + cycles+=11; + break; + case 0x5B: /*LD DE,(nn)*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + cycles+=3; de.b.l=z80_readmem(addr); + cycles+=3; de.b.h=z80_readmem(addr+1); + cycles+=3; + break; + case 0x5E: /*IM 2*/ +// printf("IM 2\n"); + im=2; + cycles+=4; + break; + case 0x5F: /*LD A,R*/ + af.b.h=ir.b.l; + af.b.l&=C_FLAG; + af.b.l|=(af.b.h&0xA8); + if (!af.b.h) af.b.l|=Z_FLAG; + if (iff2 && !enterint) af.b.l|=V_FLAG; + cycles+=5; + break; + case 0x60: /*IN H,(C)*/ + cycles+=4; hl.b.h=z80in(bc.w); + setzn(hl.b.h); + cycles+=4; + break; + case 0x61: /*OUT (C),H*/ + cycles+=4; z80out(bc.w,hl.b.h); + cycles+=4; + break; + case 0x62: /*SBC HL,HL*/ + setsbc16(hl.w,hl.w); + hl.w-=(hl.w+tempc); + cycles+=11; + break; + case 0x67: /*RRD*/ + cycles+=4; addr=z80_readmem(hl.w)|((af.b.h&0xF)<<8); + addr=(addr>>4)|((addr<<8)&0xF00); + cycles+=3; z80_writemem(hl.w,addr&0xFF); + af.b.h=(af.b.h&0xF0)|(addr>>8); + setznc(af.b.h); + cycles+=7; + break; + case 0x69: /*OUT (C),L*/ + cycles+=4; z80out(bc.w,hl.b.l); + cycles+=4; + break; + case 0x6A: /*ADC HL,HL*/ + setadc16(hl.w,hl.w); + hl.w+=(hl.w+tempc); + cycles+=11; + break; + case 0x6F: /*RLD*/ + cycles+=4; addr=z80_readmem(hl.w)|((af.b.h&0xF)<<8); + addr=((addr<<4)&0xFF0)|(addr>>8); + cycles+=3; z80_writemem(hl.w,addr&0xFF); + af.b.h=(af.b.h&0xF0)|(addr>>8); + setznc(af.b.h); + cycles+=7; + break; + case 0x72: /*SBC HL,SP*/ + setsbc16(hl.w,sp); + hl.w-=(sp+tempc); + cycles+=11; + break; + case 0x73: /*LD (nn),SP*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + cycles+=3; z80_writemem(addr,sp); + cycles+=3; z80_writemem(addr+1,sp>>8); + cycles+=3; + break; + case 0x78: /*IN A,(C)*/ + cycles+=4; af.b.h=z80in(bc.w); + setzn(af.b.h); + cycles+=4; + break; + case 0x79: /*OUT (C),A*/ + cycles+=4; z80out(bc.w,af.b.h); + cycles+=4; + break; + case 0x7A: /*ADC HL,SP*/ + setadc16(hl.w,sp); + hl.w+=(sp+tempc); + cycles+=11; + break; + case 0x7B: /*LD SP,(nn)*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + cycles+=3; sp=z80_readmem(addr); + cycles+=3; sp|=(z80_readmem(addr+1)<<8); + cycles+=3; + break; + case 0xA0: /*LDI*/ + cycles+=4; temp=z80_readmem(hl.w++); + cycles+=3; z80_writemem(de.w,temp); de.w++; + bc.w--; + af.b.l&=~(H_FLAG|S_FLAG|V_FLAG); + if (bc.w) af.b.l|=V_FLAG; + cycles+=5; + break; + case 0xA1: /*CPI*/ + cycles+=4; temp=z80_readmem(hl.w++); + setcpED(af.b.h,temp); + bc.w--; + if (bc.w) af.b.l|=V_FLAG; + else af.b.l&=~V_FLAG; + cycles+=8; + break; + case 0xA2: /*INI*/ + cycles+=5; temp=z80in(bc.w); //z80_readmem(hl.w++); + cycles+=3; z80_writemem(hl.w++,temp); + af.b.l|=N_FLAG; + bc.b.h--; + if (!bc.b.h) af.b.l|=Z_FLAG; + else af.b.l&=~Z_FLAG; + af.b.l|=S_FLAG; + cycles+=4; + break; + case 0xA3: /*OUTI*/ + cycles+=5; temp=z80_readmem(hl.w++); + cycles+=3; z80out(bc.w,temp); + bc.b.h--; + if (!bc.b.h) af.b.l|=Z_FLAG; + else af.b.l&=~Z_FLAG; + af.b.l|=S_FLAG; + cycles+=4; + break; + case 0xA8: /*LDD*/ + cycles+=4; temp=z80_readmem(hl.w--); + cycles+=3; z80_writemem(de.w,temp); de.w--; + bc.w--; + af.b.l&=~(H_FLAG|S_FLAG|V_FLAG); + if (bc.w) af.b.l|=V_FLAG; + cycles+=5; + break; + case 0xAB: /*OUTD*/ + cycles+=5; temp=z80_readmem(hl.w--); + cycles+=3; z80out(bc.w,temp); + bc.b.h--; + if (!bc.b.h) af.b.l|=Z_FLAG; + else af.b.l&=~Z_FLAG; + af.b.l|=S_FLAG; + cycles+=4; + break; + case 0xB0: /*LDIR*/ + cycles+=4; temp=z80_readmem(hl.w++); + cycles+=3; z80_writemem(de.w,temp); de.w++; + bc.w--; + if (bc.w) { pc-=2; cycles+=5; } + af.b.l&=~(H_FLAG|S_FLAG|V_FLAG); + cycles+=5; + break; + case 0xB1: /*CPIR*/ + cycles+=4; temp=z80_readmem(hl.w++); + bc.w--; + setcpED(af.b.h,temp); + if (bc.w && (af.b.h!=temp)) + { + pc-=2; + cycles+=13; + af.b.l&=~V_FLAG; + } + else + { + af.b.l|=V_FLAG; + cycles+=8; + } + break; + case 0xB8: /*LDDR*/ + cycles+=4; temp=z80_readmem(hl.w--); + cycles+=3; z80_writemem(de.w,temp); de.w--; + bc.w--; + if (bc.w) { pc-=2; cycles+=5; } + af.b.l&=~(H_FLAG|S_FLAG|V_FLAG); + cycles+=5; + break; + case 0xB9: /*CPDR*/ + cycles+=4; temp=z80_readmem(hl.w--); + bc.w--; + setcpED(af.b.h,temp); + if (bc.w && (af.b.h!=temp)) + { + pc-=2; + cycles+=13; + af.b.l&=~V_FLAG; + } + else + { + af.b.l|=V_FLAG; + cycles+=8; + } + break; + + default: + break; +// printf("Bad ED opcode %02X at %04X\n",opcode,pc); +// z80_dumpregs(); +// exit(-1); + } + break; + + case 0xEE: /*XOR nn*/ + cycles+=4; af.b.h^=z80_readmem(pc++); + af.b.l&=~3; + setzn(af.b.h); + cycles+=3; + break; + case 0xEF: /*RST 28*/ + cycles+=5; sp--; z80_writemem(sp,pc>>8); + cycles+=3; sp--; z80_writemem(sp,pc&0xFF); + pc=0x28; + cycles+=3; + break; + + case 0xF0: /*RET P*/ + cycles+=5; + if (!(af.b.l&N_FLAG)) + { + pc=z80_readmem(sp); sp++; + cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; + cycles+=3; + } + break; + case 0xF1: /*POP AF*/ + cycles+=4; af.b.l=z80_readmem(sp); sp++; + cycles+=3; af.b.h=z80_readmem(sp); sp++; + cycles+=3; + break; + case 0xF2: /*JP P*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + if (!(af.b.l&N_FLAG)) + pc=addr; + cycles+=3; + break; + case 0xF3: /*DI*/ + iff1=iff2=0; + cycles+=4; + break; + case 0xF4: /*CALL P,xxxx*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + if (!(af.b.l&N_FLAG)) + { + cycles+=4; sp--; z80_writemem(sp,pc>>8); + cycles+=3; sp--; z80_writemem(sp,pc&0xFF); + pc=addr; + cycles+=3; + } + else + cycles+=3; + break; + case 0xF5: /*PUSH AF*/ + cycles+=5; sp--; z80_writemem(sp,af.b.h); + cycles+=3; sp--; z80_writemem(sp,af.b.l); + cycles+=3; + break; + case 0xF6: /*OR nn*/ + cycles+=4; af.b.h|=z80_readmem(pc++); + af.b.l&=~3; + setzn(af.b.h); + cycles+=3; + break; + case 0xF7: /*RST 30*/ + cycles+=5; sp--; z80_writemem(sp,pc>>8); + cycles+=3; sp--; z80_writemem(sp,pc&0xFF); + pc=0x30; + cycles+=3; + break; + case 0xF8: /*RET M*/ + cycles+=5; + if (af.b.l&N_FLAG) + { + pc=z80_readmem(sp); sp++; + cycles+=3; pc|=(z80_readmem(sp)<<8); sp++; + cycles+=3; + } + break; + case 0xF9: /*LD SP,HL*/ + sp=hl.w; + cycles+=6; + break; + case 0xFA: /*JP M*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + if (af.b.l&N_FLAG) + pc=addr; + cycles+=3; + break; + case 0xFB: /*EI*/ + iff1=iff2=1; + cycles+=4; + break; + case 0xFC: /*CALL M,xxxx*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + if (af.b.l&N_FLAG) + { + cycles+=4; sp--; z80_writemem(sp,pc>>8); + cycles+=3; sp--; z80_writemem(sp,pc&0xFF); + pc=addr; + cycles+=3; + } + else + cycles+=3; + break; + + case 0xFD: /*More opcodes*/ + ir.b.l=((ir.b.l+1)&0x7F)|(ir.b.l&0x80); + cycles+=4; + opcode=z80_readmem(pc++); + switch (opcode) + { + case 0x3A: + pc--; + break; + + case 0x09: /*ADD IY,BC*/ + z80_setadd16(iy.w,bc.w); + iy.w+=bc.w; + cycles+=11; + break; + case 0x19: /*ADD IY,DE*/ + z80_setadd16(iy.w,de.w); + iy.w+=de.w; + cycles+=11; + break; + case 0x21: /*LD IY,nn*/ + cycles+=4; iy.b.l=z80_readmem(pc++); + cycles+=3; iy.b.h=z80_readmem(pc++); + cycles+=3; + break; + case 0x22: /*LD (nn),IY*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + cycles+=3; z80_writemem(addr,iy.b.l); + cycles+=3; z80_writemem(addr+1,iy.b.h); + cycles+=3; + break; + case 0x23: /*INC IY*/ + iy.w++; + cycles+=6; + break; + case 0x24: /*INC IYh*/ + setinc(iy.b.h); + iy.b.h++; + cycles+=4; + break; + case 0x25: /*DEC IYh*/ + setdec(iy.b.h); + iy.b.h--; + cycles+=4; + break; + case 0x26: /*LD IYh,nn*/ + cycles+=4; iy.b.h=z80_readmem(pc++); + cycles+=3; + break; + case 0x29: /*ADD IY,IY*/ + z80_setadd16(iy.w,iy.w); + iy.w+=iy.w; + cycles+=11; + break; + case 0x2A: /*LD IY,(nn)*/ + cycles+=4; addr=z80_readmem(pc); + cycles+=3; addr|=(z80_readmem(pc+1)<<8); pc+=2; + cycles+=3; iy.b.l=z80_readmem(addr); + cycles+=3; iy.b.h=z80_readmem(addr+1); + cycles+=3; + break; + case 0x2B: /*DEC IY*/ + iy.w--; + cycles+=6; + break; + case 0x2C: /*INC IYl*/ + setinc(iy.b.l); + iy.b.l++; + cycles+=4; + break; + case 0x2D: /*DEC IYl*/ + setdec(iy.b.l); + iy.b.l--; + cycles+=4; + break; + case 0x2E: /*LD IYl,nn*/ + cycles+=4; iy.b.l=z80_readmem(pc++); + cycles+=3; + break; + case 0x34: /*INC (IY+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + addr+=iy.w; + cycles+=3; temp=z80_readmem(addr); + setinc(temp); + cycles+=5; z80_writemem(addr,temp+1); + cycles+=7; + break; + case 0x35: /*DEC (IY+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + addr+=iy.w; + cycles+=3; temp=z80_readmem(addr); + setdec(temp); + cycles+=5; z80_writemem(addr,temp-1); + cycles+=7; + break; + case 0x36: /*LD (IY+nn),nn*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=3; temp=z80_readmem(pc++); + cycles+=5; z80_writemem(iy.w+addr,temp); + cycles+=3; + break; + case 0x39: /*ADD IY,SP*/ +// output=1; + z80_setadd16(iy.w,sp); + iy.w+=sp; + cycles+=11; + break; + + case 0x44: bc.b.h=iy.b.h; cycles+=3; break; /*LD B,IYh*/ + case 0x45: bc.b.h=iy.b.l; cycles+=3; break; /*LD B,IYl*/ + case 0x4C: bc.b.l=iy.b.h; cycles+=3; break; /*LD C,IYh*/ + case 0x4D: bc.b.l=iy.b.l; cycles+=3; break; /*LD C,IYl*/ + case 0x54: de.b.h=iy.b.h; cycles+=3; break; /*LD D,IYh*/ + case 0x55: de.b.h=iy.b.l; cycles+=3; break; /*LD D,IYl*/ + case 0x5C: de.b.l=iy.b.h; cycles+=3; break; /*LD E,IYh*/ + case 0x5D: de.b.l=iy.b.l; cycles+=3; break; /*LD E,IYl*/ + + case 0x46: /*LD B,(IY+nn)*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + intreg=(iy.w+addr)>>8; + cycles+=7; bc.b.h=z80_readmem(iy.w+addr); + cycles+=8; + break; + case 0x4E: /*LD C,(IY+nn)*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + intreg=(iy.w+addr)>>8; + cycles+=7; bc.b.l=z80_readmem(iy.w+addr); + cycles+=8; + break; + case 0x56: /*LD D,(IY+nn)*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + intreg=(iy.w+addr)>>8; + cycles+=7; de.b.h=z80_readmem(iy.w+addr); + cycles+=8; + break; + case 0x5E: /*LD E,(IY+nn)*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + intreg=(iy.w+addr)>>8; + cycles+=7; de.b.l=z80_readmem(iy.w+addr); + cycles+=8; + break; + case 0x66: /*LD H,(IY+nn)*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + intreg=(iy.w+addr)>>8; + cycles+=7; hl.b.h=z80_readmem(iy.w+addr); + cycles+=8; + break; + case 0x6E: /*LD L,(IY+nn)*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + intreg=(iy.w+addr)>>8; + cycles+=7; hl.b.l=z80_readmem(iy.w+addr); + cycles+=8; + break; + case 0x60: iy.b.h=bc.b.h; cycles+=3; break; /*LD IYh,B*/ + case 0x61: iy.b.h=bc.b.l; cycles+=3; break; /*LD IYh,C*/ + case 0x62: iy.b.h=de.b.h; cycles+=3; break; /*LD IYh,D*/ + case 0x63: iy.b.h=de.b.l; cycles+=3; break; /*LD IYh,E*/ + case 0x64: iy.b.h=hl.b.h; cycles+=3; break; /*LD IYh,H*/ + case 0x65: iy.b.h=hl.b.l; cycles+=3; break; /*LD IYh,L*/ + case 0x67: iy.b.h=af.b.h; cycles+=3; break; /*LD IYh,A*/ + case 0x68: iy.b.l=bc.b.h; cycles+=3; break; /*LD IYl,B*/ + case 0x69: iy.b.l=bc.b.l; cycles+=3; break; /*LD IYl,C*/ + case 0x6A: iy.b.l=de.b.h; cycles+=3; break; /*LD IYl,D*/ + case 0x6B: iy.b.l=de.b.l; cycles+=3; break; /*LD IYl,E*/ + case 0x6C: iy.b.l=hl.b.h; cycles+=3; break; /*LD IYl,H*/ + case 0x6D: iy.b.l=hl.b.l; cycles+=3; break; /*LD IYl,L*/ + case 0x6F: iy.b.l=af.b.h; cycles+=3; break; /*LD IYl,A*/ + + case 0x84: z80_setadd(af.b.h,iy.b.h); af.b.h+=iy.b.h; cycles+=3; break; /*ADD IYh*/ + case 0x85: z80_setadd(af.b.h,iy.b.l); af.b.h+=iy.b.l; cycles+=3; break; /*ADD IYl*/ + case 0x8C: setadc(af.b.h,iy.b.h); af.b.h+=iy.b.h+tempc; cycles+=3; break; /*ADC IYh*/ + case 0x8D: setadc(af.b.h,iy.b.l); af.b.h+=iy.b.l+tempc; cycles+=3; break; /*ADC IYl*/ + case 0x94: z80_setsub(af.b.h,iy.b.h); af.b.h-=iy.b.h; cycles+=3; break; /*SUB IYh*/ + case 0x95: z80_setsub(af.b.h,iy.b.l); af.b.h-=iy.b.l; cycles+=3; break; /*SUB IYl*/ + case 0x9C: setsbc(af.b.h,iy.b.h); af.b.h-=(iy.b.h+tempc); cycles+=3; break; /*SBC IYh*/ + case 0x9D: setsbc(af.b.h,iy.b.l); af.b.h-=(iy.b.l+tempc); cycles+=3; break; /*SBC IYl*/ + case 0xA4: setand(af.b.h&iy.b.h); af.b.h&=iy.b.h; cycles+=3; break; /*AND IYh*/ + case 0xA5: setand(af.b.h&iy.b.l); af.b.h&=iy.b.l; cycles+=3; break; /*AND IYl*/ + case 0xAC: setzn(af.b.h^iy.b.h); af.b.h^=iy.b.h; cycles+=3; break; /*XOR IYh*/ + case 0xAD: setzn(af.b.h^iy.b.l); af.b.h^=iy.b.l; cycles+=3; break; /*XOR IYl*/ + case 0xB4: setzn(af.b.h|iy.b.h); af.b.h|=iy.b.h; cycles+=3; break; /*OR IYh*/ + case 0xB5: setzn(af.b.h|iy.b.l); af.b.h|=iy.b.l; cycles+=3; break; /*OR IYl*/ + case 0xBC: setcp(af.b.h,iy.b.h); cycles+=3; break; /*CP IYh*/ + case 0xBD: setcp(af.b.h,iy.b.l); cycles+=3; break; /*CP IYl*/ + + case 0x70: /*LD (IY+nn),B*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=7; z80_writemem(iy.w+addr,bc.b.h); + cycles+=8; + break; + case 0x71: /*LD (IY+nn),C*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=7; z80_writemem(iy.w+addr,bc.b.l); + cycles+=8; + break; + case 0x72: /*LD (IY+nn),D*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=7; z80_writemem(iy.w+addr,de.b.h); + cycles+=8; + break; + case 0x73: /*LD (IY+nn),E*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=7; z80_writemem(iy.w+addr,de.b.l); + cycles+=8; + break; + case 0x74: /*LD (IY+nn),H*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=7; z80_writemem(iy.w+addr,hl.b.h); + cycles+=8; + break; + case 0x75: /*LD (IY+nn),L*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=7; z80_writemem(iy.w+addr,hl.b.l); + cycles+=8; + break; + case 0x77: /*LD (IY+nn),A*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=7; z80_writemem(iy.w+addr,af.b.h); + cycles+=8; + break; + case 0x7E: /*LD A,(IY+nn)*/ + addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=7; af.b.h=z80_readmem(iy.w+addr); + cycles+=8; + break; + + case 0x7C: af.b.h=iy.b.h; cycles+=3; break; /*LD A,IYh*/ + case 0x7D: af.b.h=iy.b.l; cycles+=3; break; /*LD A,IYl*/ + + case 0x86: /*ADD (IY+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=3; temp=z80_readmem(iy.w+addr); + z80_setadd(af.b.h,temp); + af.b.h+=temp; + cycles+=8; + break; + case 0x8E: /*ADC (IY+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=3; temp=z80_readmem(iy.w+addr); + setadc(af.b.h,temp); + af.b.h+=(temp+tempc); + cycles+=8; + break; + case 0x96: /*SUB (IY+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=3; temp=z80_readmem(iy.w+addr); + z80_setsub(af.b.h,temp); + af.b.h-=temp; + cycles+=8; + break; + case 0x9E: /*SBC (IY+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=3; temp=z80_readmem(iy.w+addr); + setsbc(af.b.h,temp); + af.b.h-=(temp+tempc); + cycles+=8; + break; + case 0xA6: /*AND (IY+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=3; af.b.h&=z80_readmem(iy.w+addr); + setand(af.b.h); + cycles+=8; + break; + case 0xAE: /*XOR (IY+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=3; af.b.h^=z80_readmem(iy.w+addr); + setzn(af.b.h); + cycles+=8; + break; + case 0xB6: /*OR (IY+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=3; af.b.h|=z80_readmem(iy.w+addr); + setzn(af.b.h); + cycles+=8; + break; + case 0xBE: /*CP (IY+nn)*/ + cycles+=4; addr=z80_readmem(pc++); if (addr&0x80) addr|=0xFF00; + cycles+=3; temp=z80_readmem(iy.w+addr); + setcp(af.b.h,temp); + cycles+=8; + break; + + case 0xCB: /*More opcodes*/ + ir.b.l=((ir.b.l+1)&0x7F)|(ir.b.l&0x80); + cycles+=4; addr=z80_readmem(pc++); + if (addr&0x80) addr|=0xFF00; + cycles+=3; opcode=z80_readmem(pc++); + switch (opcode) + { + case 0x06: /*RLC (IY+nn)*/ + cycles+=5; temp=z80_readmem(addr+iy.w); + tempc=temp&0x80; + temp<<=1; + if (tempc) temp|=1; + setzn(temp); + if (tempc) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(addr+iy.w,temp); + cycles+=3; + break; + case 0x0E: /*RRC (IY+nn)*/ + cycles+=5; temp=z80_readmem(addr+iy.w); + tempc=temp&1; + temp>>=1; + if (tempc) temp|=0x80; + setzn(temp); + if (tempc) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(addr+iy.w,temp); + cycles+=3; + break; + case 0x16: /*RL (IY+nn)*/ + cycles+=5; temp=z80_readmem(addr+iy.w); + addr=temp&0x80; + temp<<=1; + if (tempc) temp|=1; + setzn(temp); + if (addr) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(addr+iy.w,temp); + cycles+=3; + break; + case 0x1E: /*RR (IY+nn)*/ + cycles+=5; temp=z80_readmem(addr+iy.w); + addr=temp&1; + temp>>=1; + if (tempc) temp|=0x80; + setzn(temp); + if (addr) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(addr+iy.w,temp); + cycles+=3; + break; + case 0x2E: /*SRA (IY+nn)*/ + cycles+=5; temp=z80_readmem(addr+iy.w); + tempc=temp&1; + temp>>=1; + if (temp&0x40) temp|=0x80; + setzn(temp); + if (tempc) af.b.l|=C_FLAG; + cycles+=4; z80_writemem(addr+iy.w,temp); + cycles+=3; + break; + + case 0x46: cycles+=5; temp=z80_readmem(iy.w+addr); setbit2(temp&1,iy.w+addr); cycles+=4; break; /*BIT 0,(iy+nn)*/ + case 0x4E: cycles+=5; temp=z80_readmem(iy.w+addr); setbit2(temp&2,iy.w+addr); cycles+=4; break; /*BIT 1,(iy+nn)*/ + case 0x56: cycles+=5; temp=z80_readmem(iy.w+addr); setbit2(temp&4,iy.w+addr); cycles+=4; break; /*BIT 2,(iy+nn)*/ + case 0x5E: cycles+=5; temp=z80_readmem(iy.w+addr); setbit2(temp&8,iy.w+addr); cycles+=4; break; /*BIT 3,(iy+nn)*/ + case 0x66: cycles+=5; temp=z80_readmem(iy.w+addr); setbit2(temp&0x10,iy.w+addr); cycles+=4; break; /*BIT 4,(iy+nn)*/ + case 0x6E: cycles+=5; temp=z80_readmem(iy.w+addr); setbit2(temp&0x20,iy.w+addr); cycles+=4; break; /*BIT 5,(iy+nn)*/ + case 0x76: cycles+=5; temp=z80_readmem(iy.w+addr); setbit2(temp&0x40,iy.w+addr); cycles+=4; break; /*BIT 6,(iy+nn)*/ + case 0x7E: cycles+=5; temp=z80_readmem(iy.w+addr); setbit2(temp&0x80,iy.w+addr); cycles+=4; break; /*BIT 7,(iy+nn)*/ + + case 0x86: cycles+=5; temp=z80_readmem(iy.w+addr)&~1; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*RES 0,(iy+nn)*/ + case 0x8E: cycles+=5; temp=z80_readmem(iy.w+addr)&~2; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*RES 1,(iy+nn)*/ + case 0x96: cycles+=5; temp=z80_readmem(iy.w+addr)&~4; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*RES 2,(iy+nn)*/ + case 0x9E: cycles+=5; temp=z80_readmem(iy.w+addr)&~8; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*RES 3,(iy+nn)*/ + case 0xA6: cycles+=5; temp=z80_readmem(iy.w+addr)&~0x10; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*RES 4,(iy+nn)*/ + case 0xAE: cycles+=5; temp=z80_readmem(iy.w+addr)&~0x20; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*RES 5,(iy+nn)*/ + case 0xB6: cycles+=5; temp=z80_readmem(iy.w+addr)&~0x40; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*RES 6,(iy+nn)*/ + case 0xBE: cycles+=5; temp=z80_readmem(iy.w+addr)&~0x80; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*RES 7,(iy+nn)*/ + case 0xC6: cycles+=5; temp=z80_readmem(iy.w+addr)|1; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*SET 0,(iy+nn)*/ + case 0xCE: cycles+=5; temp=z80_readmem(iy.w+addr)|2; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*SET 1,(iy+nn)*/ + case 0xD6: cycles+=5; temp=z80_readmem(iy.w+addr)|4; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*SET 2,(iy+nn)*/ + case 0xDE: cycles+=5; temp=z80_readmem(iy.w+addr)|8; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*SET 3,(iy+nn)*/ + case 0xE6: cycles+=5; temp=z80_readmem(iy.w+addr)|0x10; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*SET 4,(iy+nn)*/ + case 0xEE: cycles+=5; temp=z80_readmem(iy.w+addr)|0x20; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*SET 5,(iy+nn)*/ + case 0xF6: cycles+=5; temp=z80_readmem(iy.w+addr)|0x40; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*SET 6,(iy+nn)*/ + case 0xFE: cycles+=5; temp=z80_readmem(iy.w+addr)|0x80; cycles+=4; z80_writemem(iy.w+addr,temp); cycles+=3; break; /*SET 7,(iy+nn)*/ + + default: + break; +// printf("Bad FD CB opcode %02X at %04X\n",opcode,pc); +// z80_dumpregs(); +// exit(-1); + } + break; + + case 0xE1: /*POP IY*/ + cycles+=4; iy.b.l=z80_readmem(sp); sp++; + cycles+=3; iy.b.h=z80_readmem(sp); sp++; + cycles+=3; + break; + case 0xE3: /*EX (SP),IY*/ + cycles+=4; addr=z80_readmem(sp); + cycles+=3; addr|=(z80_readmem(sp+1)<<8); + cycles+=4; z80_writemem(sp,iy.b.l); + cycles+=3; z80_writemem(sp+1,iy.b.h); + iy.w=addr; + cycles+=5; + break; + case 0xE5: /*PUSH IY*/ + cycles+=5; sp--; z80_writemem(sp,iy.b.h); + cycles+=3; sp--; z80_writemem(sp,iy.b.l); + cycles+=3; + break; + case 0xE9: /*JP (IY)*/ + pc=iy.w; + cycles+=4; + break; + + case 0xF9: /*LD SP,IY*/ + sp=iy.w; + cycles+=6; + break; + +/* case 0x95: + ir.b.l--; + pc--; + cycles+=4; + break;*/ + + default: + break; +// printf("Bad FD opcode %02X at %04X\n",opcode,pc); +// z80_dumpregs(); +// exit(-1); + } + break; + + case 0xFE: /*CP nn*/ + cycles+=4; temp=z80_readmem(pc++); + setcp(af.b.h,temp); + cycles+=3; + break; + case 0xFF: /*RST 38*/ + cycles+=5; sp--; z80_writemem(sp,pc>>8); + cycles+=3; sp--; z80_writemem(sp,pc&0xFF); + pc=0x38; + cycles+=3; + break; + + default: + break; +// printf("Bad opcode %02X at %04X\n",opcode,pc); +// z80_dumpregs(); +// z80_mem_dump(); +// exit(-1); + } +/* if (pc==0) + { + printf("PC = 0\n"); + z80_dumpregs(); + exit(-1); + }*/ +// if (ins==200000) { z80_dumpregs(); exit(-1); } +// if (pc==0xC3CF) output=1; +// if (pc==0x90B7) { z80_dumpregs(); exit(-1); } +// if (pc==0x8066) { z80_dumpregs(); exit(-1); } +// if (output) ins++; + ins++; +// if (ins==107000) output=1; +// if (ins==108000) output=0; +// if (pc==0xC8D7) output=1; +// if (pc==0xC8E7) output=0; +// if (ins==11329) output=1; + if (output) printf("%04X : %04X %04X %04X %04X %04X %04X %04X %04X %02X\n",pc,af.w&0xFF00,bc.w,de.w,hl.w,ix.w,iy.w,sp,ir.w,opcode); +// if ((pc<0x37) && !(pc&7)) printf("RST %02X\n",pc); +// if (pc==8) { z80_dumpregs(); exit(-1); } +// if (pc==0xC3DC) output=1; +// if (ins==500) { z80_dumpregs(); exit(-1); } + if (enterint) + { +// printf("Interrupt at %04X IM %i\n",pc,im); + iff2=iff1; + iff1=0; + sp--; z80_writemem(sp,pc>>8); + sp--; z80_writemem(sp,pc&0xFF); + switch (im) + { + case 0: case 1: pc=0x38; break; + case 2: +// printf("IM2 %04X %02X %02X %02X\n",ir.w,z80_readmem(ir.w|0xFF),z80_readmem(ir.w&~0xFF),z80_readmem((ir.w|0xFF)+1)); + pc=z80_readmem(0xFFFE)|(z80_readmem(0xFFFF)<<8); +// pc=z80_readmem(ir.w|0xFF); +// pc|=(z80_readmem((ir.w|0xFF)+1)<<8); +// printf("PC now %04X\n",pc); + cycles+=8; + break; + } +// printf("PC now %04X\n",pc); + z80int=enterint=0; + cycles+=11; + } + if (tube_irq&2 && !z80_oldnmi) + { +// printf("NMI at %04X IM %i\n",pc,im); + iff2=iff1; + iff1=0; + sp--; z80_writemem(sp,pc>>8); + sp--; z80_writemem(sp,pc&0xFF); + pc=0x66; + tuberomin=1; +// printf("PC now %04X\n",pc); + z80int=enterint=0; + cycles+=11; +// output=1; + } + z80_oldnmi=tube_irq&2; +// pollula(cycles); + tubecycles-=cycles; + } +} diff --git a/src/acia.c b/src/acia.c index fd7ecf25..fff64d81 100644 --- a/src/acia.c +++ b/src/acia.c @@ -1,130 +1,130 @@ -/*B-em v2.2 by Tom Walker - 6850 ACIA emulation*/ - -#include -#include "b-em.h" -#include "6502.h" -#include "acia.h" -#include "serial.h" -#include "csw.h" -#include "uef.h" -#include "tapenoise.h" - -#define DCD 4 -#define RECIEVE 1 - -int acia_tapespeed=0; - -uint8_t acia_sr; -static uint8_t acia_cr, acia_dr; - -void acia_updateint() -{ - if ((acia_sr&0x80) && (acia_cr&0x80)) - interrupt|=4; - else - interrupt&=~4; -} - -void acia_reset() -{ - acia_sr = (acia_sr & 8) | 4; - acia_updateint(); -} - -uint8_t acia_read(uint16_t addr) -{ - uint8_t temp; - if (addr & 1) - { - temp = acia_dr; - acia_sr &= ~0x81; - acia_updateint(); - return temp; - } - else - { - return (acia_sr & 0x7F) | (acia_sr & acia_cr & 0x80) | 2; - } -} - -void acia_write(uint16_t addr, uint8_t val) -{ - if (addr & 1) - { - acia_sr &= 0xFD; - acia_updateint(); - } - else - { - acia_cr = val; - if (val == 3) - acia_reset(); - switch (val & 3) - { - case 1: acia_tapespeed=0; break; - case 2: acia_tapespeed=1; break; - } - } -} - -void dcd() -{ - if (acia_sr & DCD) return; - acia_sr |= DCD | 0x80; - acia_updateint(); -} - -void dcdlow() -{ - acia_sr &= ~DCD; - acia_updateint(); -} - -static uint16_t newdat; - -void acia_receive(uint8_t val) /*Called when the acia recives some data*/ -{ - acia_dr = val; - acia_sr |= RECIEVE | 0x80; - acia_updateint(); - - newdat=val|0x100; -} - -/*Every 128 clocks, ie 15.625khz*/ -/*Div by 13 gives roughly 1200hz*/ - -extern int ueftoneon,cswtoneon; -void acia_poll() -{ -// int c; -// printf("Poll tape %i %i\n",motor,cswena); - if (motor) - { - startblit(); - if (csw_ena) csw_poll(); - else uef_poll(); - endblit(); - - if (newdat&0x100) - { - newdat&=0xFF; - tapenoise_adddat(newdat); - } - else if (csw_toneon || uef_toneon) tapenoise_addhigh(); - } -// polltape(); -} - -void acia_savestate(FILE *f) -{ - putc(acia_cr,f); - putc(acia_sr,f); -} - -void acia_loadstate(FILE *f) -{ - acia_cr=getc(f); - acia_sr=getc(f); -} +/*B-em v2.2 by Tom Walker + 6850 ACIA emulation*/ + +#include +#include "b-em.h" +#include "6502.h" +#include "acia.h" +#include "serial.h" +#include "csw.h" +#include "uef.h" +#include "tapenoise.h" + +#define DCD 4 +#define RECIEVE 1 + +int acia_tapespeed=0; + +uint8_t acia_sr; +static uint8_t acia_cr, acia_dr; + +void acia_updateint() +{ + if ((acia_sr&0x80) && (acia_cr&0x80)) + interrupt|=4; + else + interrupt&=~4; +} + +void acia_reset() +{ + acia_sr = (acia_sr & 8) | 4; + acia_updateint(); +} + +uint8_t acia_read(uint16_t addr) +{ + uint8_t temp; + if (addr & 1) + { + temp = acia_dr; + acia_sr &= ~0x81; + acia_updateint(); + return temp; + } + else + { + return (acia_sr & 0x7F) | (acia_sr & acia_cr & 0x80) | 2; + } +} + +void acia_write(uint16_t addr, uint8_t val) +{ + if (addr & 1) + { + acia_sr &= 0xFD; + acia_updateint(); + } + else + { + acia_cr = val; + if (val == 3) + acia_reset(); + switch (val & 3) + { + case 1: acia_tapespeed=0; break; + case 2: acia_tapespeed=1; break; + } + } +} + +void dcd() +{ + if (acia_sr & DCD) return; + acia_sr |= DCD | 0x80; + acia_updateint(); +} + +void dcdlow() +{ + acia_sr &= ~DCD; + acia_updateint(); +} + +static uint16_t newdat; + +void acia_receive(uint8_t val) /*Called when the acia recives some data*/ +{ + acia_dr = val; + acia_sr |= RECIEVE | 0x80; + acia_updateint(); + + newdat=val|0x100; +} + +/*Every 128 clocks, ie 15.625khz*/ +/*Div by 13 gives roughly 1200hz*/ + +extern int ueftoneon,cswtoneon; +void acia_poll() +{ +// int c; +// printf("Poll tape %i %i\n",motor,cswena); + if (motor) + { + startblit(); + if (csw_ena) csw_poll(); + else uef_poll(); + endblit(); + + if (newdat&0x100) + { + newdat&=0xFF; + tapenoise_adddat(newdat); + } + else if (csw_toneon || uef_toneon) tapenoise_addhigh(); + } +// polltape(); +} + +void acia_savestate(FILE *f) +{ + putc(acia_cr,f); + putc(acia_sr,f); +} + +void acia_loadstate(FILE *f) +{ + acia_cr=getc(f); + acia_sr=getc(f); +} diff --git a/src/acia.h b/src/acia.h index de81bd98..9d78ca96 100644 --- a/src/acia.h +++ b/src/acia.h @@ -1,14 +1,14 @@ -void acia_reset(); -uint8_t acia_read(uint16_t addr); -void acia_write(uint16_t addr, uint8_t val); -void acia_poll(); -void acia_receive(uint8_t val); - -void acia_savestate(FILE *f); -void acia_loadstate(FILE *f); - -extern int acia_tapespeed; -extern uint8_t acia_sr; - -void dcd(); -void dcdlow(); +void acia_reset(); +uint8_t acia_read(uint16_t addr); +void acia_write(uint16_t addr, uint8_t val); +void acia_poll(); +void acia_receive(uint8_t val); + +void acia_savestate(FILE *f); +void acia_loadstate(FILE *f); + +extern int acia_tapespeed; +extern uint8_t acia_sr; + +void dcd(); +void dcdlow(); diff --git a/src/adc.c b/src/adc.c index 47b89d5f..ea6be5eb 100644 --- a/src/adc.c +++ b/src/adc.c @@ -1,90 +1,90 @@ -/*B-em v2.2 by Tom Walker - ADC emulation*/ - -#include -#include -#include "b-em.h" -#include "adc.h" -#include "via.h" -#include "sysvia.h" - -static uint8_t adc_status,adc_high,adc_low,adc_latch; -int adc_time; - -uint8_t adc_read(uint16_t addr) -{ - switch (addr & 3) - { - case 0: - return adc_status; - break; - case 1: - return adc_high; - break; - case 2: - return adc_low; - break; - } - return 0x40; -} - -void adc_write(uint16_t addr, uint8_t val) -{ - if (!(addr & 3)) - { - adc_latch = val; - adc_time = 60; - adc_status = (val & 0xF) | 0x80; /*Busy, converting*/ - sysvia_set_cb1(1); -// printf("ADC conversion - %02X\n",val); - } -} - -void adc_poll() -{ - uint32_t val; -// printf("%i\n",joy[0].stick[0].axis[0].pos); - switch (adc_status & 3) - { - case 0: val = (128 - joy[0].stick[0].axis[0].pos) * 256; break; - case 1: val = (128 - joy[0].stick[0].axis[1].pos) * 256; break; - case 2: val = (128 - joy[1].stick[0].axis[0].pos) * 256; break; - case 3: val = (128 - joy[1].stick[0].axis[1].pos) * 256; break; - } - if (val > 0xFFFF) val = 0xFFFF; - if (val < 0) val = 0; -// val^=0xFFFF; -// val++; -// if (val==0x10000) val=0xFFFF; - adc_status =(adc_status & 0xF) | 0x40; /*Not busy, conversion complete*/ - adc_status|=(val & 0xC000) >> 10; - adc_high = val >> 8; - adc_low = val & 0xFF; - sysvia_set_cb1(0); -} - -void adc_init() -{ - adc_status = 0x40; /*Not busy, conversion complete*/ - adc_high = adc_low = adc_latch = 0; - adc_time = 0; - install_joystick(JOY_TYPE_AUTODETECT); -} - -void adc_savestate(FILE *f) -{ - putc(adc_status,f); - putc(adc_low,f); - putc(adc_high,f); - putc(adc_latch,f); - putc(adc_time,f); -} - -void adc_loadstate(FILE *f) -{ - adc_status = getc(f); - adc_low = getc(f); - adc_high = getc(f); - adc_latch = getc(f); - adc_time = getc(f); -} +/*B-em v2.2 by Tom Walker + ADC emulation*/ + +#include +#include +#include "b-em.h" +#include "adc.h" +#include "via.h" +#include "sysvia.h" + +static uint8_t adc_status,adc_high,adc_low,adc_latch; +int adc_time; + +uint8_t adc_read(uint16_t addr) +{ + switch (addr & 3) + { + case 0: + return adc_status; + break; + case 1: + return adc_high; + break; + case 2: + return adc_low; + break; + } + return 0x40; +} + +void adc_write(uint16_t addr, uint8_t val) +{ + if (!(addr & 3)) + { + adc_latch = val; + adc_time = 60; + adc_status = (val & 0xF) | 0x80; /*Busy, converting*/ + sysvia_set_cb1(1); +// printf("ADC conversion - %02X\n",val); + } +} + +void adc_poll() +{ + uint32_t val; +// printf("%i\n",joy[0].stick[0].axis[0].pos); + switch (adc_status & 3) + { + case 0: val = (128 - joy[0].stick[0].axis[0].pos) * 256; break; + case 1: val = (128 - joy[0].stick[0].axis[1].pos) * 256; break; + case 2: val = (128 - joy[1].stick[0].axis[0].pos) * 256; break; + case 3: val = (128 - joy[1].stick[0].axis[1].pos) * 256; break; + } + if (val > 0xFFFF) val = 0xFFFF; + if (val < 0) val = 0; +// val^=0xFFFF; +// val++; +// if (val==0x10000) val=0xFFFF; + adc_status =(adc_status & 0xF) | 0x40; /*Not busy, conversion complete*/ + adc_status|=(val & 0xC000) >> 10; + adc_high = val >> 8; + adc_low = val & 0xFF; + sysvia_set_cb1(0); +} + +void adc_init() +{ + adc_status = 0x40; /*Not busy, conversion complete*/ + adc_high = adc_low = adc_latch = 0; + adc_time = 0; + install_joystick(JOY_TYPE_AUTODETECT); +} + +void adc_savestate(FILE *f) +{ + putc(adc_status,f); + putc(adc_low,f); + putc(adc_high,f); + putc(adc_latch,f); + putc(adc_time,f); +} + +void adc_loadstate(FILE *f) +{ + adc_status = getc(f); + adc_low = getc(f); + adc_high = getc(f); + adc_latch = getc(f); + adc_time = getc(f); +} diff --git a/src/adc.h b/src/adc.h index 4d22d670..0c890576 100644 --- a/src/adc.h +++ b/src/adc.h @@ -1,9 +1,9 @@ -void adc_init(); -void adc_poll(); -uint8_t adc_read(uint16_t addr); -void adc_write(uint16_t addr, uint8_t val); - -void adc_savestate(FILE *f); -void adc_loadstate(FILE *f); - -extern int adc_time; +void adc_init(); +void adc_poll(); +uint8_t adc_read(uint16_t addr); +void adc_write(uint16_t addr, uint8_t val); + +void adc_savestate(FILE *f); +void adc_loadstate(FILE *f); + +extern int adc_time; diff --git a/src/adf.c b/src/adf.c index 0d2279e9..deb3c713 100644 --- a/src/adf.c +++ b/src/adf.c @@ -1,319 +1,319 @@ -/*B-em v2.2 by Tom Walker - ADFS disc support (really all double-density formats)*/ - -#include -#include "b-em.h" -#include "adf.h" -#include "disc.h" - -static FILE *adf_f[2]; -static uint8_t trackinfoa[2][2][20*256]; -static int adl[2]; -static int adf_sectors[2], adf_size[2], adf_trackc[2]; -static int adf_dblstep[2]; - -static int adf_sector, adf_track, adf_side, adf_drive; -static int adf_inread, adf_readpos, adf_inwrite, adf_inreadaddr; -static int adf_time; -static int adf_notfound; -static int adf_rsector=0; -static int adf_informat=0; - -void adf_init() -{ - adf_f[0] = adf_f[1] = 0; - adl[0] = adl[1] = 0; - adf_notfound = 0; -} - -void adf_load(int drive, char *fn) -{ - writeprot[drive] = 0; - adf_f[drive] = fopen(fn, "rb+"); - if (!adf_f[drive]) - { - adf_f[drive] = fopen(fn, "rb"); - if (!adf_f[drive]) return; - writeprot[drive] = 1; - } - fwriteprot[drive] = writeprot[drive]; - fseek(adf_f[drive], -1, SEEK_END); - if (ftell(adf_f[drive]) > (700 * 1024)) - { - adl[drive] = 1; - adf_sectors[drive] = 5; - adf_size[drive] = 1024; - } - else - { - adl[drive] = 0; - adf_sectors[drive] = 16; - adf_size[drive] = 256; - } - drives[drive].seek = adf_seek; - drives[drive].readsector = adf_readsector; - drives[drive].writesector = adf_writesector; - drives[drive].readaddress = adf_readaddress; - drives[drive].poll = adf_poll; - drives[drive].format = adf_format; - adf_dblstep[drive] = 0; -} - -void adl_load(int drive, char *fn) -{ - writeprot[drive] = 0; - adf_f[drive] = fopen(fn, "rb+"); - if (!adf_f[drive]) - { - adf_f[drive] = fopen(fn, "rb"); - if (!adf_f[drive]) return; - writeprot[drive] = 1; - } - fwriteprot[drive] = writeprot[drive]; - adl[drive] = 1; - drives[drive].seek = adf_seek; - drives[drive].readsector = adf_readsector; - drives[drive].writesector = adf_writesector; - drives[drive].readaddress = adf_readaddress; - drives[drive].poll = adf_poll; - drives[drive].format = adf_format; - adf_sectors[drive] = 16; - adf_size[drive] = 256; - adf_dblstep[drive] = 0; -} - -void adl_loadex(int drive, char *fn, int sectors, int size, int dblstep) -{ - writeprot[drive] = 0; - adf_f[drive] = fopen(fn, "rb+"); - if (!adf_f[drive]) - { - adf_f[drive] = fopen(fn, "rb"); - if (!adf_f[drive]) return; - writeprot[drive] = 1; - } - fwriteprot[drive] = writeprot[drive]; - fseek(adf_f[drive], -1, SEEK_END); - adl[drive] = 1; - drives[drive].seek = adf_seek; - drives[drive].readsector = adf_readsector; - drives[drive].writesector = adf_writesector; - drives[drive].readaddress = adf_readaddress; - drives[drive].poll = adf_poll; - drives[drive].format = adf_format; - adf_sectors[drive] = sectors; - adf_size[drive] = size; - adf_dblstep[drive] = dblstep; -} - -void adf_close(int drive) -{ - if (adf_f[drive]) fclose(adf_f[drive]); - adf_f[drive] = NULL; -} - -void adf_seek(int drive, int track) -{ - if (!adf_f[drive]) return; -// rpclog("Seek %i %i %i %i %i %i\n",drive,track,adfsectors[drive],adfsize[drive],adl[drive],adfsectors[drive]*adfsize[drive]); - if (adf_dblstep[drive]) track /= 2; - adf_trackc[drive] = track; - if (adl[drive]) - { - fseek(adf_f[drive], track * adf_sectors[drive] * adf_size[drive] * 2, SEEK_SET); - fread(trackinfoa[drive][0], adf_sectors[drive] * adf_size[drive], 1, adf_f[drive]); - fread(trackinfoa[drive][1], adf_sectors[drive] * adf_size[drive], 1, adf_f[drive]); - } - else - { - fseek(adf_f[drive], track * adf_sectors[drive] * adf_size[drive], SEEK_SET); - fread(trackinfoa[drive][0], adf_sectors[drive] * adf_size[drive], 1, adf_f[drive]); - } -} -void adf_writeback(int drive, int track) -{ - if (!adf_f[drive]) return; - if (adf_dblstep[drive]) track /= 2; - if (adl[drive]) - { - fseek(adf_f[drive], track * adf_sectors[drive] * adf_size[drive] * 2, SEEK_SET); - fwrite(trackinfoa[drive][0], adf_sectors[drive] * adf_size[drive], 1, adf_f[drive]); - fwrite(trackinfoa[drive][1], adf_sectors[drive] * adf_size[drive], 1, adf_f[drive]); - } - else - { - fseek(adf_f[drive], track * adf_sectors[drive] * adf_size[drive], SEEK_SET); - fwrite(trackinfoa[drive][0], adf_sectors[drive] * adf_size[drive], 1, adf_f[drive]); - } -} - -void adf_readsector(int drive, int sector, int track, int side, int density) -{ - adf_sector = sector; - adf_track = track; - adf_side = side; - adf_drive = drive; - if (adf_size[drive] != 256) adf_sector--; -// printf("ADFS Read sector %i %i %i %i %i\n",drive,side,track,sector,adftrackc[drive]); - - if (!adf_f[drive] || (side && !adl[drive]) || !density || (track != adf_trackc[drive])) - { -// printf("Not found! %08X (%i %i) %i (%i %i)\n",adff[drive],side,adl[drive],density,track,adftrackc[drive]); - adf_notfound=500; - return; - } -// printf("Found\n"); - adf_inread = 1; - adf_readpos = 0; -} - -void adf_writesector(int drive, int sector, int track, int side, int density) -{ -// if (adfdblstep[drive]) track/=2; - adf_sector = sector; - adf_track = track; - adf_side = side; - adf_drive = drive; - if (adf_size[drive] != 256) adf_sector--; -// printf("ADFS Write sector %i %i %i %i\n",drive,side,track,sector); - - if (!adf_f[drive] || (side && !adl[drive]) || !density || (track != adf_trackc[drive])) - { - adf_notfound = 500; - return; - } - adf_inwrite = 1; - adf_readpos = 0; -} - -void adf_readaddress(int drive, int track, int side, int density) -{ - if (adf_dblstep[drive]) track /= 2; - adf_drive = drive; - adf_track = track; - adf_side = side; -// rpclog("Read address %i %i %i\n",drive,side,track); - - if (!adf_f[drive] || (side && !adl[drive]) || !density || (track != adf_trackc[drive])) - { - adf_notfound=500; - return; - } - adf_inreadaddr = 1; - adf_readpos = 0; -} - -void adf_format(int drive, int track, int side, int density) -{ - if (adf_dblstep[drive]) track /= 2; - adf_drive = drive; - adf_track = track; - adf_side = side; - - if (!adf_f[drive] || (side && !adl[drive]) || !density || track != adf_trackc[drive]) - { - adf_notfound = 500; - return; - } - adf_sector = 0; - adf_readpos = 0; - adf_informat = 1; -} - -void adf_poll() -{ - int c; - adf_time++; - if (adf_time<16) return; - adf_time=0; - - if (adf_notfound) - { - adf_notfound--; - if (!adf_notfound) - { -// rpclog("Not found!\n"); - fdc_notfound(); - } - } - if (adf_inread && adf_f[adf_drive]) - { -// if (!adfreadpos) rpclog("%i\n",adfsector*adfsize[adfdrive]); - fdc_data(trackinfoa[adf_drive][adf_side][(adf_sector * adf_size[adf_drive]) + adf_readpos]); - adf_readpos++; - if (adf_readpos == adf_size[adf_drive]) - { -// rpclog("Read %i bytes\n",adfreadpos); - adf_inread = 0; - fdc_finishread(); - } - } - if (adf_inwrite && adf_f[adf_drive]) - { - if (writeprot[adf_drive]) - { - fdc_writeprotect(); - adf_inwrite = 0; - return; - } -// printf("Write data %i\n",adfreadpos); - c = fdc_getdata(adf_readpos == 255); - if (c == -1) - { -//Carlo Concari: do not write if data not ready yet - return; -// printf("Data overflow!\n"); -// exit(-1); - } - trackinfoa[adf_drive][adf_side][(adf_sector * adf_size[adf_drive]) + adf_readpos] = c; - adf_readpos++; - if (adf_readpos == adf_size[adf_drive]) - { - adf_inwrite = 0; - fdc_finishread(); - adf_writeback(adf_drive, adf_track); - } - } - if (adf_inreadaddr && adf_f[adf_drive]) - { - switch (adf_readpos) - { - case 0: fdc_data(adf_track); break; - case 1: fdc_data(adf_side); break; - case 2: fdc_data(adf_rsector + (adf_size[adf_drive] != 256) ? 1 : 0); break; - case 3: fdc_data((adf_size[adf_drive] == 256) ? 1 : ((adf_size[adf_drive] == 512) ? 2 : 3)); break; - case 4: fdc_data(0); break; - case 5: fdc_data(0); break; - case 6: - adf_inreadaddr = 0; - fdc_finishread(); -// rpclog("Read addr - %i %i %i %i 1 0 0\n",adfdrive,adftrack,adfside,adfsector); - adf_rsector++; - if (adf_rsector == adf_sectors[adf_drive]) adf_rsector=0; - break; - } - adf_readpos++; - } - if (adf_informat && adf_f[adf_drive]) - { - if (writeprot[adf_drive]) - { - fdc_writeprotect(); - adf_informat = 0; - return; - } - trackinfoa[adf_drive][adf_side][(adf_sector * adf_size[adf_drive]) + adf_readpos] = 0; - adf_readpos++; - if (adf_readpos == adf_size[adf_drive]) - { - adf_readpos = 0; - adf_sector++; - if (adf_sector == adf_sectors[adf_drive]) - { - adf_informat = 0; - fdc_finishread(); - adf_writeback(adf_drive, adf_track); - } - } - } -} +/*B-em v2.2 by Tom Walker + ADFS disc support (really all double-density formats)*/ + +#include +#include "b-em.h" +#include "adf.h" +#include "disc.h" + +static FILE *adf_f[2]; +static uint8_t trackinfoa[2][2][20*256]; +static int adl[2]; +static int adf_sectors[2], adf_size[2], adf_trackc[2]; +static int adf_dblstep[2]; + +static int adf_sector, adf_track, adf_side, adf_drive; +static int adf_inread, adf_readpos, adf_inwrite, adf_inreadaddr; +static int adf_time; +static int adf_notfound; +static int adf_rsector=0; +static int adf_informat=0; + +void adf_init() +{ + adf_f[0] = adf_f[1] = 0; + adl[0] = adl[1] = 0; + adf_notfound = 0; +} + +void adf_load(int drive, char *fn) +{ + writeprot[drive] = 0; + adf_f[drive] = fopen(fn, "rb+"); + if (!adf_f[drive]) + { + adf_f[drive] = fopen(fn, "rb"); + if (!adf_f[drive]) return; + writeprot[drive] = 1; + } + fwriteprot[drive] = writeprot[drive]; + fseek(adf_f[drive], -1, SEEK_END); + if (ftell(adf_f[drive]) > (700 * 1024)) + { + adl[drive] = 1; + adf_sectors[drive] = 5; + adf_size[drive] = 1024; + } + else + { + adl[drive] = 0; + adf_sectors[drive] = 16; + adf_size[drive] = 256; + } + drives[drive].seek = adf_seek; + drives[drive].readsector = adf_readsector; + drives[drive].writesector = adf_writesector; + drives[drive].readaddress = adf_readaddress; + drives[drive].poll = adf_poll; + drives[drive].format = adf_format; + adf_dblstep[drive] = 0; +} + +void adl_load(int drive, char *fn) +{ + writeprot[drive] = 0; + adf_f[drive] = fopen(fn, "rb+"); + if (!adf_f[drive]) + { + adf_f[drive] = fopen(fn, "rb"); + if (!adf_f[drive]) return; + writeprot[drive] = 1; + } + fwriteprot[drive] = writeprot[drive]; + adl[drive] = 1; + drives[drive].seek = adf_seek; + drives[drive].readsector = adf_readsector; + drives[drive].writesector = adf_writesector; + drives[drive].readaddress = adf_readaddress; + drives[drive].poll = adf_poll; + drives[drive].format = adf_format; + adf_sectors[drive] = 16; + adf_size[drive] = 256; + adf_dblstep[drive] = 0; +} + +void adl_loadex(int drive, char *fn, int sectors, int size, int dblstep) +{ + writeprot[drive] = 0; + adf_f[drive] = fopen(fn, "rb+"); + if (!adf_f[drive]) + { + adf_f[drive] = fopen(fn, "rb"); + if (!adf_f[drive]) return; + writeprot[drive] = 1; + } + fwriteprot[drive] = writeprot[drive]; + fseek(adf_f[drive], -1, SEEK_END); + adl[drive] = 1; + drives[drive].seek = adf_seek; + drives[drive].readsector = adf_readsector; + drives[drive].writesector = adf_writesector; + drives[drive].readaddress = adf_readaddress; + drives[drive].poll = adf_poll; + drives[drive].format = adf_format; + adf_sectors[drive] = sectors; + adf_size[drive] = size; + adf_dblstep[drive] = dblstep; +} + +void adf_close(int drive) +{ + if (adf_f[drive]) fclose(adf_f[drive]); + adf_f[drive] = NULL; +} + +void adf_seek(int drive, int track) +{ + if (!adf_f[drive]) return; +// rpclog("Seek %i %i %i %i %i %i\n",drive,track,adfsectors[drive],adfsize[drive],adl[drive],adfsectors[drive]*adfsize[drive]); + if (adf_dblstep[drive]) track /= 2; + adf_trackc[drive] = track; + if (adl[drive]) + { + fseek(adf_f[drive], track * adf_sectors[drive] * adf_size[drive] * 2, SEEK_SET); + fread(trackinfoa[drive][0], adf_sectors[drive] * adf_size[drive], 1, adf_f[drive]); + fread(trackinfoa[drive][1], adf_sectors[drive] * adf_size[drive], 1, adf_f[drive]); + } + else + { + fseek(adf_f[drive], track * adf_sectors[drive] * adf_size[drive], SEEK_SET); + fread(trackinfoa[drive][0], adf_sectors[drive] * adf_size[drive], 1, adf_f[drive]); + } +} +void adf_writeback(int drive, int track) +{ + if (!adf_f[drive]) return; + if (adf_dblstep[drive]) track /= 2; + if (adl[drive]) + { + fseek(adf_f[drive], track * adf_sectors[drive] * adf_size[drive] * 2, SEEK_SET); + fwrite(trackinfoa[drive][0], adf_sectors[drive] * adf_size[drive], 1, adf_f[drive]); + fwrite(trackinfoa[drive][1], adf_sectors[drive] * adf_size[drive], 1, adf_f[drive]); + } + else + { + fseek(adf_f[drive], track * adf_sectors[drive] * adf_size[drive], SEEK_SET); + fwrite(trackinfoa[drive][0], adf_sectors[drive] * adf_size[drive], 1, adf_f[drive]); + } +} + +void adf_readsector(int drive, int sector, int track, int side, int density) +{ + adf_sector = sector; + adf_track = track; + adf_side = side; + adf_drive = drive; + if (adf_size[drive] != 256) adf_sector--; +// printf("ADFS Read sector %i %i %i %i %i\n",drive,side,track,sector,adftrackc[drive]); + + if (!adf_f[drive] || (side && !adl[drive]) || !density || (track != adf_trackc[drive])) + { +// printf("Not found! %08X (%i %i) %i (%i %i)\n",adff[drive],side,adl[drive],density,track,adftrackc[drive]); + adf_notfound=500; + return; + } +// printf("Found\n"); + adf_inread = 1; + adf_readpos = 0; +} + +void adf_writesector(int drive, int sector, int track, int side, int density) +{ +// if (adfdblstep[drive]) track/=2; + adf_sector = sector; + adf_track = track; + adf_side = side; + adf_drive = drive; + if (adf_size[drive] != 256) adf_sector--; +// printf("ADFS Write sector %i %i %i %i\n",drive,side,track,sector); + + if (!adf_f[drive] || (side && !adl[drive]) || !density || (track != adf_trackc[drive])) + { + adf_notfound = 500; + return; + } + adf_inwrite = 1; + adf_readpos = 0; +} + +void adf_readaddress(int drive, int track, int side, int density) +{ + if (adf_dblstep[drive]) track /= 2; + adf_drive = drive; + adf_track = track; + adf_side = side; +// rpclog("Read address %i %i %i\n",drive,side,track); + + if (!adf_f[drive] || (side && !adl[drive]) || !density || (track != adf_trackc[drive])) + { + adf_notfound=500; + return; + } + adf_inreadaddr = 1; + adf_readpos = 0; +} + +void adf_format(int drive, int track, int side, int density) +{ + if (adf_dblstep[drive]) track /= 2; + adf_drive = drive; + adf_track = track; + adf_side = side; + + if (!adf_f[drive] || (side && !adl[drive]) || !density || track != adf_trackc[drive]) + { + adf_notfound = 500; + return; + } + adf_sector = 0; + adf_readpos = 0; + adf_informat = 1; +} + +void adf_poll() +{ + int c; + adf_time++; + if (adf_time<16) return; + adf_time=0; + + if (adf_notfound) + { + adf_notfound--; + if (!adf_notfound) + { +// rpclog("Not found!\n"); + fdc_notfound(); + } + } + if (adf_inread && adf_f[adf_drive]) + { +// if (!adfreadpos) rpclog("%i\n",adfsector*adfsize[adfdrive]); + fdc_data(trackinfoa[adf_drive][adf_side][(adf_sector * adf_size[adf_drive]) + adf_readpos]); + adf_readpos++; + if (adf_readpos == adf_size[adf_drive]) + { +// rpclog("Read %i bytes\n",adfreadpos); + adf_inread = 0; + fdc_finishread(); + } + } + if (adf_inwrite && adf_f[adf_drive]) + { + if (writeprot[adf_drive]) + { + fdc_writeprotect(); + adf_inwrite = 0; + return; + } +// printf("Write data %i\n",adfreadpos); + c = fdc_getdata(adf_readpos == 255); + if (c == -1) + { +//Carlo Concari: do not write if data not ready yet + return; +// printf("Data overflow!\n"); +// exit(-1); + } + trackinfoa[adf_drive][adf_side][(adf_sector * adf_size[adf_drive]) + adf_readpos] = c; + adf_readpos++; + if (adf_readpos == adf_size[adf_drive]) + { + adf_inwrite = 0; + fdc_finishread(); + adf_writeback(adf_drive, adf_track); + } + } + if (adf_inreadaddr && adf_f[adf_drive]) + { + switch (adf_readpos) + { + case 0: fdc_data(adf_track); break; + case 1: fdc_data(adf_side); break; + case 2: fdc_data(adf_rsector + (adf_size[adf_drive] != 256) ? 1 : 0); break; + case 3: fdc_data((adf_size[adf_drive] == 256) ? 1 : ((adf_size[adf_drive] == 512) ? 2 : 3)); break; + case 4: fdc_data(0); break; + case 5: fdc_data(0); break; + case 6: + adf_inreadaddr = 0; + fdc_finishread(); +// rpclog("Read addr - %i %i %i %i 1 0 0\n",adfdrive,adftrack,adfside,adfsector); + adf_rsector++; + if (adf_rsector == adf_sectors[adf_drive]) adf_rsector=0; + break; + } + adf_readpos++; + } + if (adf_informat && adf_f[adf_drive]) + { + if (writeprot[adf_drive]) + { + fdc_writeprotect(); + adf_informat = 0; + return; + } + trackinfoa[adf_drive][adf_side][(adf_sector * adf_size[adf_drive]) + adf_readpos] = 0; + adf_readpos++; + if (adf_readpos == adf_size[adf_drive]) + { + adf_readpos = 0; + adf_sector++; + if (adf_sector == adf_sectors[adf_drive]) + { + adf_informat = 0; + fdc_finishread(); + adf_writeback(adf_drive, adf_track); + } + } + } +} diff --git a/src/adf.h b/src/adf.h index 378ea930..6d0af55e 100644 --- a/src/adf.h +++ b/src/adf.h @@ -1,11 +1,11 @@ -void adf_init(); -void adf_load(int drive, char *fn); -void adf_close(int drive); -void adl_load(int drive, char *fn); -void adl_loadex(int drive, char *fn, int sectors, int size, int dblstep); -void adf_seek(int drive, int track); -void adf_readsector(int drive, int sector, int track, int side, int density); -void adf_writesector(int drive, int sector, int track, int side, int density); -void adf_readaddress(int drive, int sector, int side, int density); -void adf_format(int drive, int sector, int side, int density); -void adf_poll(); +void adf_init(); +void adf_load(int drive, char *fn); +void adf_close(int drive); +void adl_load(int drive, char *fn); +void adl_loadex(int drive, char *fn, int sectors, int size, int dblstep); +void adf_seek(int drive, int track); +void adf_readsector(int drive, int sector, int track, int side, int density); +void adf_writesector(int drive, int sector, int track, int side, int density); +void adf_readaddress(int drive, int sector, int side, int density); +void adf_format(int drive, int sector, int side, int density); +void adf_poll(); diff --git a/src/arm.c b/src/arm.c index c26a277a..892b08d2 100644 --- a/src/arm.c +++ b/src/arm.c @@ -1,2025 +1,2025 @@ -/*B-em v2.2 by Tom Walker - ARM1 parasite CPU emulation - Originally from Arculator*/ - -#include -#include -#include -#include "b-em.h" -#include "arm.h" -#include "tube.h" - - -uint32_t *usrregs[16],userregs[16],superregs[16],fiqregs[16],irqregs[16]; -uint32_t armregs[16]; - -#define PC ((armregs[15])&0x3FFFFFC) - -static uint32_t opcode2,opcode3; - -static int armirq=0; -static int databort; -static uint32_t *armrom,*armram; -static uint8_t *armromb,*armramb; -#define USER 0 -#define FIQ 1 -#define IRQ 2 -#define SUPERVISOR 3 - -#define NFSET ((armregs[15]&0x80000000)?1:0) -#define ZFSET ((armregs[15]&0x40000000)?1:0) -#define CFSET ((armregs[15]&0x20000000)?1:0) -#define VFSET ((armregs[15]&0x10000000)?1:0) - -#define NFLAG 0x80000000 -#define ZFLAG 0x40000000 -#define CFLAG 0x20000000 -#define VFLAG 0x10000000 -#define IFLAG 0x08000000 - -#define RD ((opcode>>12)&0xF) -#define RN ((opcode>>16)&0xF) -#define RM (opcode&0xF) - -#define MULRD ((opcode>>16)&0xF) -#define MULRN ((opcode>>12)&0xF) -#define MULRS ((opcode>>8)&0xF) -#define MULRM (opcode&0xF) - -#define GETADDR(r) ((r==15)?(armregs[15]&0x3FFFFFC):armregs[r]) -#define LOADREG(r,v) if (r==15) { armregs[15]=(armregs[15]&0xFC000003)|((v+4)&0x3FFFFFC); refillpipeline(); } else armregs[r]=v; -#define GETREG(r) ((r==15) ? armregs[15]+4 : armregs[r]) -#define LDRRESULT(a,v) ((a&3)?(v>>((a&3)<<3))|(v<<(((a&3)^3)<<3)):v) - -#define undefined()\ - templ=armregs[15]-4; \ - armregs[15]|=3;\ - updatemode(SUPERVISOR);\ - armregs[14]=templ;\ - armregs[15]&=0xFC000003;\ - armregs[15]|=0x08000008;\ - refillpipeline();\ - tubecycles-- - -static int mode; -static int osmode=0,memmode; - -static void updatemode(int m) -{ - int c; - usrregs[15]=&armregs[15]; - switch (mode) /*Store back registers*/ - { - case USER: - for (c=8;c<15;c++) userregs[c]=armregs[c]; - break; - case IRQ: - for (c=8;c<13;c++) userregs[c]=armregs[c]; - irqregs[0]=armregs[13]; - irqregs[1]=armregs[14]; - break; - case FIQ: - for (c=8;c<15;c++) fiqregs[c]=armregs[c]; - break; - case SUPERVISOR: - for (c=8;c<13;c++) userregs[c]=armregs[c]; - superregs[0]=armregs[13]; - superregs[1]=armregs[14]; - break; - } - mode=m; - switch (m) - { - case USER: - for (c=8;c<15;c++) armregs[c]=userregs[c]; - memmode=osmode; - for (c=0;c<15;c++) usrregs[c]=&armregs[c]; - break; - case IRQ: - for (c=8;c<13;c++) armregs[c]=userregs[c]; - armregs[13]=irqregs[0]; - armregs[14]=irqregs[1]; - for (c=0;c<13;c++) usrregs[c]=&armregs[c]; - for (c=13;c<15;c++) usrregs[c]=&userregs[c]; - memmode=2; - break; - case FIQ: - for (c=8;c<15;c++) armregs[c]=fiqregs[c]; - for (c=0;c<8;c++) usrregs[c]=&armregs[c]; - for (c=8;c<15;c++) usrregs[c]=&userregs[c]; - memmode=2; - break; - case SUPERVISOR: - for (c=8;c<13;c++) armregs[c]=userregs[c]; - armregs[13]=superregs[0]; - armregs[14]=superregs[1]; - for (c=0;c<13;c++) usrregs[c]=&armregs[c]; - for (c=13;c<15;c++) usrregs[c]=&userregs[c]; - memmode=2; - break; - } -} - -static uint8_t flaglookup[16][16]; -static uint32_t rotatelookup[4096]; - -static void refillpipeline2(); - -#define countbits(c) countbitstable[c] -static int countbitstable[65536]; -void arm_reset() -{ - int c,d,exec,data; - uint32_t rotval,rotamount; - for (c=0;c<65536;c++) - { - countbitstable[c]=0; - for (d=0;d<16;d++) - { - if (c&(1<>8)&0xF)<<1; - rotval=(rotval>>rotamount)|(rotval<<(32-rotamount)); - rotatelookup[data]=rotval; - } - updatemode(SUPERVISOR); - armregs[15]=0x0C00000B; - mode=3; - memmode=2; - memcpy(armramb,armromb,0x4000); - refillpipeline2(); -} - -void arm_dumpregs() -{ - FILE *f=fopen("armram.dmp","wb"); - fwrite(armram,0x10000,1,f); - fclose(f); - rpclog("R 0=%08X R 4=%08X R 8=%08X R12=%08X\n",armregs[0],armregs[4],armregs[8],armregs[12]); - rpclog("R 1=%08X R 5=%08X R 9=%08X R13=%08X\n",armregs[1],armregs[5],armregs[9],armregs[13]); - rpclog("R 2=%08X R 6=%08X R10=%08X R14=%08X\n",armregs[2],armregs[6],armregs[10],armregs[14]); - rpclog("R 3=%08X R 7=%08X R11=%08X R15=%08X\n",armregs[3],armregs[7],armregs[11],armregs[15]); - rpclog("f12=%08X ",fiqregs[12]); - rpclog("PC =%07X\n",PC); -} - -static uint32_t *armread[64]; -static uint32_t armmask[64]; -void arm_init() -{ - FILE *f; - int c; - char fn[256]; - if (!armrom) armrom=(uint32_t *)malloc(0x4000); - if (!armram) armram=(uint32_t *)malloc(0x400000); - armromb=(uint8_t *)armrom; - armramb=(uint8_t *)armram; - append_filename(fn,exedir,"roms/tube/ARMeval_100.rom",511); - f=fopen(fn,"rb"); - fread(armromb,0x4000,1,f); - fclose(f); - memcpy(armramb,armromb,0x4000); - for (c=0;c<64;c++) armread[c]=0; - for (c=0;c<4;c++) armread[c]=&armram[c*0x40000]; - armread[48]=armrom; - for (c=0;c<64;c++) armmask[c]=0xFFFFF; - armmask[48]=0x3FFF; -} - -void arm_close() -{ - if (armrom) free(armrom); - if (armram) free(armram); -} - -int endtimeslice=0; -static uint32_t readarmfl(uint32_t addr); -static uint32_t readarml(uint32_t a) -{ - if (armread[(a>>20)&63]) - return armread[(a>>20)&63][(a&0xFFFFF)>>2]; - return readarmfl(a); -} -//#define readarml(a) ((armread[(a>>20)&63])?armread[(a>>20)&63][(a&0xFFFFF)>>2]:readarmfl(a)) - -static uint8_t readarmb(uint32_t addr) -{ - if (addr<0x400000) return armramb[addr]; - if ((addr&~0x1F)==0x1000000) - { - //rpclog("Read %08X\n",addr); - return tube_parasite_read((addr&0x1C)>>2); - } - if ((addr>=0x3000000) && (addr<0x3004000)) return armromb[addr&0x3FFF]; - return 0xFF; -/* rpclog("Bad ARM read byte %08X\n",addr); - dumparmregs(); - exit(-1);*/ -} -static uint32_t readarmfl(uint32_t addr) -{ - if (addr<0x400000) return armram[addr>>2]; - if (addr<0x400010) return 0xFFFFFFFF; - if ((addr>=0x3000000) && (addr<0x3004000)) return armrom[(addr&0x3FFC)>>2]; - return 0xFFFFFFFF; -/* rpclog("Bad ARM read long %08X\n",addr); - dumparmregs(); - exit(-1);*/ -} - -static void writearmb(uint32_t addr, uint8_t val) -{ - if (addr<0x400000) - { - armramb[addr]=val; - return; - } - if ((addr&~0x1F)==0x1000000) - { -// rpclog("Write %08X %02X\n",addr,val); - tube_parasite_write((addr&0x1C)>>2,val); - endtimeslice=1; - return; - } -/* rpclog("Bad ARM write byte %08X %02X\n",addr,val); - dumparmregs(); - exit(-1);*/ -} -static void writearml(uint32_t addr, uint32_t val) -{ - if (addr<0x400000) - { - armram[addr>>2]=val; - return; - } -/* if (addr<0x400010) return; - rpclog("Bad ARM write long %08X %08X\n",addr,val); - dumparmregs(); - exit(-1);*/ -} - -#define checkneg(v) (v&0x80000000) -#define checkpos(v) !(v&0x80000000) - -static inline void setadd(uint32_t op1, uint32_t op2, uint32_t res) -{ - armregs[15]&=0xFFFFFFF; - if ((checkneg(op1) && checkneg(op2)) || - (checkneg(op1) && checkpos(res)) || - (checkneg(op2) && checkpos(res))) armregs[15]|=CFLAG; - if ((checkneg(op1) && checkneg(op2) && checkpos(res)) || - (checkpos(op1) && checkpos(op2) && checkneg(res))) - armregs[15]|=VFLAG; - if (!res) armregs[15]|=ZFLAG; - else if (checkneg(res)) armregs[15]|=NFLAG; -} - -static inline void setsub(uint32_t op1, uint32_t op2, uint32_t res) -{ - armregs[15]&=0xFFFFFFF; - if ((checkneg(op1) && checkpos(op2)) || - (checkneg(op1) && checkpos(res)) || - (checkpos(op2) && checkpos(res))) armregs[15]|=CFLAG; - if (!res) armregs[15]|=ZFLAG; - else if (checkneg(res)) armregs[15]|=NFLAG; - if ((checkneg(op1) && checkpos(op2) && checkpos(res)) || - (checkpos(op1) && checkneg(op2) && checkneg(res))) - armregs[15]|=VFLAG; -} - -static inline void setsbc(uint32_t op1, uint32_t op2, uint32_t res) -{ - armregs[15]&=0xFFFFFFF; - if (!res) armregs[15]|=ZFLAG; - else if (checkneg(res)) armregs[15]|=NFLAG; - if ((checkneg(op1) && checkpos(op2)) || - (checkneg(op1) && checkpos(res)) || - (checkpos(op2) && checkpos(res))) armregs[15]|=CFLAG; - if ((checkneg(op1) && checkpos(op2) && checkpos(res)) || - (checkpos(op1) && checkneg(op2) && checkneg(res))) - armregs[15]|=VFLAG; -} - -static inline void setadc(uint32_t op1, uint32_t op2, uint32_t res) -{ - armregs[15]&=0xFFFFFFF; - if ((checkneg(op1) && checkneg(op2)) || - (checkneg(op1) && checkpos(res)) || - (checkneg(op2) && checkpos(res))) armregs[15]|=CFLAG; - if ((checkneg(op1) && checkneg(op2) && checkpos(res)) || - (checkpos(op1) && checkpos(op2) && checkneg(res))) - armregs[15]|=VFLAG; - if (!res) armregs[15]|=ZFLAG; - else if (checkneg(res)) armregs[15]|=NFLAG; -} - -static inline void setarmzn(uint32_t op) -{ - armregs[15]&=0x3FFFFFFF; - if (!op) armregs[15]|=ZFLAG; - else if (checkneg(op)) armregs[15]|=NFLAG; -} - -static inline uint32_t shift(uint32_t opcode) -{ - uint32_t shiftmode=(opcode>>5)&3; - uint32_t shiftamount=(opcode>>7)&31; - uint32_t temp; - int cflag=CFSET; - if (!(opcode&0xFF0)) return armregs[RM]; - if (opcode&0x10) - { - shiftamount=armregs[(opcode>>8)&15]&0xFF; - if (shiftmode==3) - shiftamount&=0x1F; -// cycles--; - } - temp=armregs[RM]; -// if (RM==15) temp+=4; - if (opcode&0x100000 && shiftamount) armregs[15]&=~CFLAG; - switch (shiftmode) - { - case 0: /*LSL*/ - if (!shiftamount) return temp; - if (shiftamount==32) - { - if (temp&1 && opcode&0x100000) armregs[15]|=CFLAG; - return 0; - } - if (shiftamount>32) return 0; - if (opcode&0x100000) - { - if ((temp<<(shiftamount-1))&0x80000000) armregs[15]|=CFLAG; - } - return temp<32) return 0; - if (opcode&0x100000) - { - if ((temp>>(shiftamount-1))&1) armregs[15]|=CFLAG; - } - return temp>>shiftamount; - - case 2: /*ASR*/ - if (!shiftamount) - { - if (opcode&0x10) return temp; - } - if (shiftamount>=32 || !shiftamount) - { - if (temp&0x80000000 && opcode&0x100000) armregs[15]|=CFLAG; - else if (opcode&0x100000) armregs[15]&=~CFLAG; - if (temp&0x80000000) return 0xFFFFFFFF; - return 0; - } - if (opcode&0x100000) - { - if (((int)temp>>(shiftamount-1))&1) armregs[15]|=CFLAG; - } - return (int)temp>>shiftamount; - - case 3: /*ROR*/ - if (opcode&0x100000) armregs[15]&=~CFLAG; - if (!shiftamount && !(opcode&0x10)) - { - if (opcode&0x100000 && temp&1) armregs[15]|=CFLAG; - return (((cflag)?1:0)<<31)|(temp>>1); - } - if (!shiftamount) - { - if (opcode&0x100000) armregs[15]|=cflag; - return temp; - } - if (!(shiftamount&0x1F)) - { - if (opcode&0x100000 && temp&0x80000000) armregs[15]|=CFLAG; - return temp; - } - if (opcode&0x100000) - { - if (((temp>>shiftamount)|(temp<<(32-shiftamount)))&0x80000000) armregs[15]|=CFLAG; - } - return (temp>>shiftamount)|(temp<<(32-shiftamount)); - } - return 0; /*Should never reach here*/ -} - -static inline unsigned shift2(unsigned opcode) -{ - unsigned shiftmode=(opcode>>5)&3; - unsigned shiftamount=(opcode>>7)&31; - uint32_t temp; - int cflag=CFSET; - if (!(opcode&0xFF0)) return armregs[RM]; - if (opcode&0x10) - { - shiftamount=armregs[(opcode>>8)&15]&0xFF; - if (shiftmode==3) - shiftamount&=0x1F; - } - temp=armregs[RM]; -// if (RM==15) temp+=4; - switch (shiftmode) - { - case 0: /*LSL*/ - if (!shiftamount) return temp; - if (shiftamount>=32) return 0; - return temp<=32) return 0; - return temp>>shiftamount; - - case 2: /*ASR*/ - if (!shiftamount && !(opcode&0x10)) shiftamount=32; - if (shiftamount>=32) - { - if (temp&0x80000000) - return 0xFFFFFFFF; - return 0; - } - return (int)temp>>shiftamount; - - case 3: /*ROR*/ - if (!shiftamount && !(opcode&0x10)) return (((cflag)?1:0)<<31)|(temp>>1); - if (!shiftamount) return temp; - return (temp>>shiftamount)|(temp<<(32-shiftamount)); - } - return 0; /*Should never reach here*/ -} - -static inline unsigned rotate(unsigned data) -{ - uint32_t rotval; - rotval=rotatelookup[data&4095]; - if (data&0x100000 && data&0xF00) - { - if (rotval&0x80000000) armregs[15]|=CFLAG; - else armregs[15]&=~CFLAG; - } - return rotval; -} - -#define rotate2(v) rotatelookup[v&4095] - -static int ldrlookup[4]={0,8,16,24}; - -#define ldrresult(v,a) ((v>>ldrlookup[addr&3])|(v<<(32-ldrlookup[addr&3]))) - -static void refillpipeline() -{ - opcode2=readarml(PC-4); - opcode3=readarml(PC); -} - -static void refillpipeline2() -{ - opcode2=readarml(PC-8); - opcode3=readarml(PC-4); -} - -int accc=0; -void arm_exec() -{ - uint32_t opcode,templ,templ2,mask,addr,addr2; - int c; - while (tubecycles>0) - { - opcode=opcode2; - opcode2=opcode3; - opcode3=readarml(PC); - if (flaglookup[opcode>>28][armregs[15]>>28]) - { - switch ((opcode>>20)&0xFF) - { - case 0x00: /*AND reg*/ -// if (((opcode&0xF0)==0x90)) /*MUL*/ -// { -// armregs[MULRD]=(armregs[MULRM])*(armregs[MULRS]); -// if (MULRD==MULRM) armregs[MULRD]=0; -// cycles-=17; -// } -// else -// { - if (RD==15) - { - templ=shift2(opcode); - armregs[15]=(((GETADDR(RN)&templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ=shift2(opcode); - armregs[RD]=GETADDR(RN)&templ; - } - tubecycles--; -// } - break; - case 0x01: /*ANDS reg*/ -// if (((opcode&0xF0)==0x90)) /*MULS*/ -// { -// armregs[MULRD]=(armregs[MULRM])*(armregs[MULRS]); -// if (MULRD==MULRM) armregs[MULRD]=0; -// setarmzn(armregs[MULRD]); -// tubecycles-=17; -// } -// else -// { - if (RD==15) - { - templ=shift2(opcode); - armregs[15]=(GETADDR(RN)&templ)+4; - refillpipeline(); - } - else - { - templ=shift(opcode); - armregs[RD]=GETADDR(RN)&templ; - setarmzn(armregs[RD]); - } - tubecycles--; -// } - break; - - case 0x02: /*EOR reg*/ -// if (((opcode&0xF0)==0x90)) /*MLA*/ -/// { -// armregs[MULRD]=((armregs[MULRM])*(armregs[MULRS]))+armregs[MULRN]; -// if (MULRD==MULRM) armregs[MULRD]=0; -// tubecycles-=17; -// } -// else -// { - if (RD==15) - { - templ=shift2(opcode); - armregs[15]=(((GETADDR(RN)^templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ=shift2(opcode); - armregs[RD]=GETADDR(RN)^templ; - } - tubecycles--; -// } - break; - case 0x03: /*EORS reg*/ -// if (((opcode&0xF0)==0x90)) /*MLAS*/ -// { -// armregs[MULRD]=((armregs[MULRM])*(armregs[MULRS]))+armregs[MULRN]; -// if (MULRD==MULRM) armregs[MULRD]=0; -// setarmzn(armregs[MULRD]); -// tubecycles-=17; -// } -// else -// { - if (RD==15) - { - templ=shift2(opcode); - armregs[15]=(GETADDR(RN)^templ)+4; - refillpipeline(); - } - else - { - templ=shift(opcode); - armregs[RD]=GETADDR(RN)^templ; - setarmzn(armregs[RD]); - } - tubecycles--; -// } - break; - - case 0x04: /*SUB reg*/ - if (RD==15) - { - templ=shift2(opcode); - armregs[15]=(((GETADDR(RN)-templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ=shift2(opcode); - armregs[RD]=GETADDR(RN)-templ; - } - tubecycles--; - break; - case 0x05: /*SUBS reg*/ - if (RD==15) - { - templ=shift2(opcode); - armregs[15]=(GETADDR(RN)-templ)+4; - refillpipeline(); - } - else - { - templ=shift2(opcode); - setsub(GETADDR(RN),templ,GETADDR(RN)-templ); - armregs[RD]=GETADDR(RN)-templ; - } - tubecycles--; - break; - - case 0x06: /*RSB reg*/ - if (RD==15) - { - templ=shift2(opcode); - armregs[15]=(((templ-GETADDR(RN))+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ=shift2(opcode); - armregs[RD]=templ-GETADDR(RN); - } - tubecycles--; - break; - case 0x07: /*RSBS reg*/ - if (RD==15) - { - templ=shift2(opcode); - armregs[15]=(templ-GETADDR(RN))+4; - refillpipeline(); - } - else - { - templ=shift2(opcode); - setsub(templ,GETADDR(RN),templ-GETADDR(RN)); - armregs[RD]=templ-GETADDR(RN); - } - tubecycles--; - break; - - case 0x08: /*ADD reg*/ - if (RD==15) - { - templ=shift2(opcode); - armregs[15]=((GETADDR(RN)+templ+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ=shift2(opcode); - armregs[RD]=GETADDR(RN)+templ; - } - tubecycles--; - break; - case 0x09: /*ADDS reg*/ - if (RD==15) - { - templ=shift2(opcode); - armregs[15]=GETADDR(RN)+templ+4; - refillpipeline(); - } - else - { - templ=shift2(opcode); - setadd(GETADDR(RN),templ,GETADDR(RN)+templ); - armregs[RD]=GETADDR(RN)+templ; - } - tubecycles--; - break; - - case 0x0A: /*ADC reg*/ - if (RD==15) - { - templ2=CFSET; - templ=shift2(opcode); - armregs[15]=((GETADDR(RN)+templ+templ2+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ2=CFSET; - templ=shift2(opcode); - armregs[RD]=GETADDR(RN)+templ+templ2; - } - tubecycles--; - break; - case 0x0B: /*ADCS reg*/ - if (RD==15) - { - templ2=CFSET; - templ=shift2(opcode); - armregs[15]=GETADDR(RN)+templ+templ2+4; - refillpipeline(); - } - else - { - templ2=CFSET; - templ=shift2(opcode); - setadc(GETADDR(RN),templ,GETADDR(RN)+templ+templ2); - armregs[RD]=GETADDR(RN)+templ+templ2; - } - tubecycles--; - break; - - case 0x0C: /*SBC reg*/ - templ2=(CFSET)?0:1; - if (RD==15) - { - templ=shift2(opcode); - armregs[15]=(((GETADDR(RN)-(templ+templ2))+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ=shift2(opcode); - armregs[RD]=GETADDR(RN)-(templ+templ2); - } - tubecycles--; - break; - case 0x0D: /*SBCS reg*/ - templ2=(CFSET)?0:1; - if (RD==15) - { - templ=shift2(opcode); - armregs[15]=(GETADDR(RN)-(templ+templ2))+4; - refillpipeline(); - } - else - { - templ=shift2(opcode); - setsbc(GETADDR(RN),templ,GETADDR(RN)-(templ+templ2)); - armregs[RD]=GETADDR(RN)-(templ+templ2); - } - tubecycles--; - break; - case 0x0E: /*RSC reg*/ - templ2=(CFSET)?0:1; - if (RD==15) - { - templ=shift2(opcode); - armregs[15]=(((templ-(GETADDR(RN)+templ2))+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ=shift2(opcode); - armregs[RD]=templ-(GETADDR(RN)+templ2); - } - tubecycles--; - break; - case 0x0F: /*RSCS reg*/ - templ2=(CFSET)?0:1; - if (RD==15) - { - templ=shift2(opcode); - armregs[15]=(templ-(GETADDR(RN)+templ2))+4; - refillpipeline(); - } - else - { - templ=shift2(opcode); - setsbc(templ,GETADDR(RN),templ-(GETADDR(RN)+templ2)); - armregs[RD]=templ-(GETADDR(RN)+templ2); - } - tubecycles--; - break; - - case 0x10: /*SWP word*/ - break; - - case 0x11: /*TST reg*/ - if (RD==15) - { - if (armregs[15]&3) - { - templ=armregs[15]&0x3FFFFFC; - armregs[15]=((GETADDR(RN)&shift2(opcode))&0xFC000003)|templ; - } - else - { - templ=armregs[15]&0x0FFFFFFF; - armregs[15]=((GETADDR(RN)&shift2(opcode))&0xF0000000)|templ; - } - } - else - { - setarmzn(GETADDR(RN)&shift(opcode)); - } - tubecycles--; - break; - - case 0x12: - break; - - case 0x13: /*TEQ reg*/ - if (RD==15) - { - if (armregs[15]&3) - { - templ=armregs[15]&0x3FFFFFC; - armregs[15]=((GETADDR(RN)^shift2(opcode))&0xFC000003)|templ; - } - else - { - templ=armregs[15]&0x0FFFFFFF; - armregs[15]=((GETADDR(RN)^shift2(opcode))&0xF0000000)|templ; - } - } - else - { - setarmzn(GETADDR(RN)^shift(opcode)); - } - tubecycles--; - break; - - case 0x14: /*SWPB*/ - break; - - case 0x15: /*CMP reg*/ - if (RD==15) - { - if (armregs[15]&3) - { - templ=armregs[15]&0x3FFFFFC; - armregs[15]=((GETADDR(RN)-shift2(opcode))&0xFC000003)|templ; - } - else - { - templ=armregs[15]&0x0FFFFFFF; - armregs[15]=((GETADDR(RN)-shift2(opcode))&0xF0000000)|templ; - } - } - else - setsub(GETADDR(RN),shift(opcode),GETADDR(RN)-shift2(opcode)); - tubecycles--; - break; - - case 0x17: /*CMN reg*/ - if (RD==15) - { - if (armregs[15]&3) - { - templ=armregs[15]&0x3FFFFFC; - armregs[15]=((GETADDR(RN)+shift2(opcode))&0xFC000003)|templ; - } - else - { - templ=armregs[15]&0x0FFFFFFF; - armregs[15]=((GETADDR(RN)+shift2(opcode))&0xF0000000)|templ; - } - } - else - setadd(GETADDR(RN),shift2(opcode),GETADDR(RN)+shift2(opcode)); - tubecycles--; - break; - - case 0x18: /*ORR reg*/ - if (RD==15) - { - templ=shift2(opcode); - armregs[15]=(((GETADDR(RN)|templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ=shift2(opcode); - armregs[RD]=GETADDR(RN)|templ; - } - tubecycles--; - break; - case 0x19: /*ORRS reg*/ - if (RD==15) - { - templ=shift2(opcode); - armregs[15]=(GETADDR(RN)|templ)+4; - refillpipeline(); - } - else - { - templ=shift(opcode); - armregs[RD]=GETADDR(RN)|templ; - setarmzn(armregs[RD]); - } - tubecycles--; - break; - - case 0x1A: /*MOV reg*/ - if (RD==15) - { - armregs[15]=(armregs[15]&0xFC000003)|((shift2(opcode)+4)&0x3FFFFFC); - refillpipeline(); - } - else - armregs[RD]=shift2(opcode); - tubecycles--; - break; - case 0x1B: /*MOVS reg*/ - if (RD==15) - { - if (armregs[15]&3) armregs[15]=shift2(opcode)+4; - else armregs[15]=((shift2(opcode)+4)&0xF3FFFFFC)|(armregs[15]&0xC000003); - refillpipeline(); - } - else - { - armregs[RD]=shift(opcode); - setarmzn(armregs[RD]); - } - tubecycles--; - break; - - case 0x1C: /*BIC reg*/ - if (RD==15) - { - templ=shift2(opcode); - armregs[15]=(((GETADDR(RN)&~templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ=shift2(opcode); - armregs[RD]=GETADDR(RN)&~templ; - } - tubecycles--; - break; - case 0x1D: /*BICS reg*/ - if (RD==15) - { - templ=shift2(opcode); - armregs[15]=(GETADDR(RN)&~templ)+4; - refillpipeline(); - } - else - { - templ=shift(opcode); - armregs[RD]=GETADDR(RN)&~templ; - setarmzn(armregs[RD]); - } - tubecycles--; - break; - - case 0x1E: /*MVN reg*/ - if (RD==15) - { - armregs[15]=(armregs[15]&0xFC000003)|(((~shift2(opcode))+4)&0x3FFFFFC); - refillpipeline(); - } - else - armregs[RD]=~shift2(opcode); - tubecycles--; - break; - case 0x1F: /*MVNS reg*/ - if (RD==15) - { - armregs[15]=(~shift2(opcode))+4; - refillpipeline(); - } - else - { - armregs[RD]=~shift(opcode); - setarmzn(armregs[RD]); - } - tubecycles--; - break; - - case 0x20: /*AND imm*/ - if (RD==15) - { - templ=rotate2(opcode); - armregs[15]=(((GETADDR(RN)&templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ=rotate2(opcode); - armregs[RD]=GETADDR(RN)&templ; - } - tubecycles--; - break; - case 0x21: /*ANDS imm*/ - if (RD==15) - { - templ=rotate2(opcode); - armregs[15]=(GETADDR(RN)&templ)+4; - refillpipeline(); - } - else - { - templ=rotate(opcode); - armregs[RD]=GETADDR(RN)&templ; - setarmzn(armregs[RD]); - } - tubecycles--; - break; - - case 0x22: /*EOR imm*/ - if (RD==15) - { - templ=rotate2(opcode); - armregs[15]=(((GETADDR(RN)^templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ=rotate2(opcode); - armregs[RD]=GETADDR(RN)^templ; - } - tubecycles--; - break; - case 0x23: /*EORS imm*/ - if (RD==15) - { - templ=rotate2(opcode); - armregs[15]=(GETADDR(RN)^templ)+4; - refillpipeline(); - } - else - { - templ=rotate(opcode); - armregs[RD]=GETADDR(RN)^templ; - setarmzn(armregs[RD]); - } - tubecycles--; - break; - - case 0x24: /*SUB imm*/ - if (RD==15) - { - templ=rotate2(opcode); - armregs[15]=(((GETADDR(RN)-templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ=rotate2(opcode); - armregs[RD]=GETADDR(RN)-templ; - } - tubecycles--; - break; - case 0x25: /*SUBS imm*/ - if (RD==15) - { - templ=rotate2(opcode); - armregs[15]=(GETADDR(RN)-templ)+4; - refillpipeline(); - } - else - { - templ=rotate2(opcode); - setsub(GETADDR(RN),templ,GETADDR(RN)-templ); - armregs[RD]=GETADDR(RN)-templ; - } - tubecycles--; - break; - - case 0x26: /*RSB imm*/ - if (RD==15) - { - templ=rotate2(opcode); - armregs[15]=(((templ-GETADDR(RN))+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ=rotate2(opcode); - armregs[RD]=templ-GETADDR(RN); - } - tubecycles--; - break; - case 0x27: /*RSBS imm*/ - if (RD==15) - { - templ=rotate2(opcode); - armregs[15]=(templ-GETADDR(RN))+4; - refillpipeline(); - } - else - { - templ=rotate2(opcode); - setsub(templ,GETADDR(RN),templ-GETADDR(RN)); - armregs[RD]=templ-GETADDR(RN); - } - tubecycles--; - break; - - case 0x28: /*ADD imm*/ - if (RD==15) - { - templ=rotate2(opcode); - armregs[15]=(((GETADDR(RN)+templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ=rotate2(opcode); - armregs[RD]=GETADDR(RN)+templ; - } - tubecycles--; - break; - case 0x29: /*ADDS imm*/ - if (RD==15) - { - templ=rotate2(opcode); - armregs[15]=GETADDR(RN)+templ+4; - refillpipeline(); - } - else - { - templ=rotate2(opcode); - setadd(GETADDR(RN),templ,GETADDR(RN)+templ); - armregs[RD]=GETADDR(RN)+templ; - } - tubecycles--; - break; - - case 0x2A: /*ADC imm*/ - if (RD==15) - { - templ2=CFSET; - templ=rotate2(opcode); - armregs[15]=((GETADDR(RN)+templ+templ2+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ2=CFSET; - templ=rotate2(opcode); - armregs[RD]=GETADDR(RN)+templ+templ2; - } - tubecycles--; - break; - case 0x2B: /*ADCS imm*/ - if (RD==15) - { - templ2=CFSET; - templ=rotate2(opcode); - armregs[15]=GETADDR(RN)+templ+templ2+4; - refillpipeline(); - } - else - { - templ2=CFSET; - templ=rotate2(opcode); - setadc(GETADDR(RN),templ,GETADDR(RN)+templ+templ2); - armregs[RD]=GETADDR(RN)+templ+templ2; - } - tubecycles--; - break; - - case 0x2C: /*SBC imm*/ - templ2=(CFSET)?0:1; - if (RD==15) - { - templ=rotate2(opcode); - armregs[15]=(((GETADDR(RN)-(templ+templ2))+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ=rotate2(opcode); - armregs[RD]=GETADDR(RN)-(templ+templ2); - } - tubecycles--; - break; - case 0x2D: /*SBCS imm*/ - templ2=(CFSET)?0:1; - if (RD==15) - { - templ=rotate2(opcode); - armregs[15]=(GETADDR(RN)-(templ+templ2))+4; - refillpipeline(); - } - else - { - templ=rotate2(opcode); - setsbc(GETADDR(RN),templ,GETADDR(RN)-(templ+templ2)); - armregs[RD]=GETADDR(RN)-(templ+templ2); - } - tubecycles--; - break; - case 0x2E: /*RSC imm*/ - templ2=(CFSET)?0:1; - if (RD==15) - { - templ=rotate2(opcode); - armregs[15]=(((templ-(GETADDR(RN)+templ2))+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ=rotate2(opcode); - armregs[RD]=templ-(GETADDR(RN)+templ2); - } - tubecycles--; - break; - case 0x2F: /*RSCS imm*/ - templ2=(CFSET)?0:1; - if (RD==15) - { - templ=rotate2(opcode); - armregs[15]=(templ-(GETADDR(RN)+templ2))+4; - refillpipeline(); - } - else - { - templ=rotate2(opcode); - setsbc(templ,GETADDR(RN),templ-(GETADDR(RN)+templ2)); -// setsub(templ,GETADDR(RN),templ-(GETADDR(RN)+templ2)); - armregs[RD]=templ-(GETADDR(RN)+templ2); - } - tubecycles--; - break; - - case 0x31: /*TST imm*/ - if (RD==15) - { - if (armregs[15]&3) - { - templ=armregs[15]&0x3FFFFFC; - armregs[15]=((GETADDR(RN)&rotate2(opcode))&0xFC000003)|templ; - } - else - { - templ=armregs[15]&0x0FFFFFFF; - armregs[15]=((GETADDR(RN)&rotate2(opcode))&0xF0000000)|templ; - } - } - else - { - setarmzn(GETADDR(RN)&rotate(opcode)); - } - tubecycles--; - break; - - case 0x33: /*TEQ imm*/ - if (RD==15) - { - opcode&=~0x100000; - if (armregs[15]&3) - { - templ=armregs[15]&0x3FFFFFC; - armregs[15]=((GETADDR(RN)^rotate2(opcode))&0xFC000003)|templ; - } - else - { - templ=armregs[15]&0x0FFFFFFF; - armregs[15]=((GETADDR(RN)^rotate2(opcode))&0xF0000000)|templ; - } - } - else - { - setarmzn(GETADDR(RN)^rotate(opcode)); -// rpclog("TEQ %08X %08X\n",GETADDR(RN),rotate(opcode)); - } - tubecycles--; - break; - - case 0x34: - break; - case 0x35: /*CMP imm*/ - if (RD==15) - { - if (armregs[15]&3) - { - templ=armregs[15]&0x3FFFFFC; - armregs[15]=((GETADDR(RN)-rotate2(opcode))&0xFC000003)|templ; - } - else - { - templ=armregs[15]&0x0FFFFFFF; - armregs[15]=((GETADDR(RN)-rotate2(opcode))&0xF0000000)|templ; - } - } - else - setsub(GETADDR(RN),rotate2(opcode),GETADDR(RN)-rotate2(opcode)); - tubecycles--; - break; - - case 0x37: /*CMN imm*/ - if (RD==15) - { - if (armregs[15]&3) - { - templ=armregs[15]&0x3FFFFFC; - armregs[15]=((GETADDR(RN)+rotate2(opcode))&0xFC000003)|templ; - } - else - { - templ=armregs[15]&0x0FFFFFFF; - armregs[15]=((GETADDR(RN)+rotate2(opcode))&0xF0000000)|templ; - } - } - else - setadd(GETADDR(RN),rotate2(opcode),GETADDR(RN)+rotate2(opcode)); - tubecycles--; - break; - - case 0x38: /*ORR imm*/ - if (RD==15) - { - templ=rotate2(opcode); - armregs[15]=(((GETADDR(RN)|templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ=rotate2(opcode); - armregs[RD]=GETADDR(RN)|templ; - } - tubecycles--; - break; - case 0x39: /*ORRS imm*/ - if (RD==15) - { - templ=rotate2(opcode); - if (armregs[15]&3) - armregs[15]=(GETADDR(RN)|templ)+4; - else - armregs[15]=(((GETADDR(RN)|templ)+4)&0xF3FFFFFC)|(armregs[15]&0xC000003); - refillpipeline(); - } - else - { - templ=rotate(opcode); - armregs[RD]=GETADDR(RN)|templ; - setarmzn(armregs[RD]); - } - tubecycles--; - break; - - case 0x3A: /*MOV imm*/ - if (RD==15) - { - armregs[15]=(armregs[15]&0xFC000003)|((rotate2(opcode)+4)&0x3FFFFFC); - refillpipeline(); - } - else - armregs[RD]=rotate2(opcode); - tubecycles--; - break; - case 0x3B: /*MOVS imm*/ - if (RD==15) - { - armregs[15]=rotate2(opcode)+4; - refillpipeline(); - } - else - { - armregs[RD]=rotate(opcode); - setarmzn(armregs[RD]); - } - tubecycles--; - break; - - case 0x3C: /*BIC imm*/ - if (RD==15) - { - templ=rotate2(opcode); - armregs[15]=(((GETADDR(RN)&~templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - } - else - { - templ=rotate2(opcode); - armregs[RD]=GETADDR(RN)&~templ; - } - tubecycles--; - break; - case 0x3D: /*BICS imm*/ - if (RD==15) - { - templ=rotate2(opcode); - if (armregs[15]&3) armregs[15]=(GETADDR(RN)&~templ)+4; - else armregs[15]=(((GETADDR(RN)&~templ)+4)&0xF3FFFFFC)|(armregs[15]&0xC000003); - refillpipeline(); - } - else - { - templ=rotate(opcode); - armregs[RD]=GETADDR(RN)&~templ; - setarmzn(armregs[RD]); - } - tubecycles--; - break; - - case 0x3E: /*MVN imm*/ - if (RD==15) - { - armregs[15]=(armregs[15]&0xFC000003)|(((~rotate2(opcode))+4)&0x3FFFFFC); - refillpipeline(); - } - else - armregs[RD]=~rotate2(opcode); - tubecycles--; - break; - case 0x3F: /*MVNS imm*/ - if (RD==15) - { - armregs[15]=(~rotate2(opcode))+4; - refillpipeline(); - } - else - { - armregs[RD]=~rotate(opcode); - setarmzn(armregs[RD]); - } - tubecycles--; - break; - - case 0x47: case 0x4F: /*LDRBT*/ - addr=GETADDR(RN); - if (opcode&0x2000000) addr2=shift2(opcode); - else addr2=opcode&0xFFF; - if (!(opcode&0x800000)) addr2=-addr2; - if (opcode&0x1000000) - { - addr+=addr2; - } - templ=memmode; - memmode=0; - templ2=readarmb(addr); - memmode=templ; - if (databort) break; - LOADREG(RD,templ2); - if (!(opcode&0x1000000)) - { - addr+=addr2; - armregs[RN]=addr; - } - else - { - if (opcode&0x200000) armregs[RN]=addr; - } - tubecycles-=4; - break; - - case 0x41: case 0x49: case 0x61: case 0x69: /*LDR Rd,[Rn],offset*/ - addr=GETADDR(RN); - if (opcode&0x2000000) addr2=shift2(opcode); - else addr2=opcode&0xFFF; - templ2=ldrresult(readarml(addr),addr); - if (databort) break; - LOADREG(RD,templ2); - if (opcode&0x800000) armregs[RN]+=addr2; - else armregs[RN]-=addr2; - tubecycles-=4; - break; - case 0x43: case 0x4B: case 0x63: case 0x6B: /*LDRT Rd,[Rn],offset*/ - addr=GETADDR(RN); - if (opcode&0x2000000) addr2=shift2(opcode); - else addr2=opcode&0xFFF; - templ=memmode; memmode=0; - templ2=ldrresult(readarml(addr),addr); - memmode=templ; - if (databort) break; - LOADREG(RD,templ2); - if (opcode&0x800000) armregs[RN]+=addr2; - else armregs[RN]-=addr2; - tubecycles-=4; - break; - - case 0x40: case 0x48: case 0x60: case 0x68: /*STR Rd,[Rn],offset*/ - addr=GETADDR(RN); - if (opcode&0x2000000) addr2=shift2(opcode); - else addr2=opcode&0xFFF; - if (RD==15) { writearml(addr,armregs[RD]+4); } - else { writearml(addr,armregs[RD]); } - if (databort) break; - if (opcode&0x800000) armregs[RN]+=addr2; - else armregs[RN]-=addr2; - tubecycles-=3; - break; - case 0x42: case 0x4A: case 0x62: case 0x6A: /*STRT Rd,[Rn],offset*/ - addr=GETADDR(RN); - if (opcode&0x2000000) addr2=shift2(opcode); - else addr2=opcode&0xFFF; - if (RD==15) { writearml(addr,armregs[RD]+4); } - else { writearml(addr,armregs[RD]); } - templ=memmode; memmode=0; - if (databort) break; - memmode=templ; - if (opcode&0x800000) armregs[RN]+=addr2; - else armregs[RN]-=addr2; - tubecycles-=3; - break; - case 0x50: case 0x58: case 0x70: case 0x78: /*STR Rd,[Rn,offset]*/ - case 0x52: case 0x5A: case 0x72: case 0x7A: /*STR Rd,[Rn,offset]!*/ - if (opcode&0x2000000) addr2=shift2(opcode); - else addr2=opcode&0xFFF; - if (opcode&0x800000) addr=GETADDR(RN)+addr2; - else addr=GETADDR(RN)-addr2; - if (RD==15) { writearml(addr,armregs[RD]+4); } - else { writearml(addr,armregs[RD]); } - if (databort) break; - if (opcode&0x200000) armregs[RN]=addr; - tubecycles-=3; - break; - - case 0x44: case 0x4C: case 0x64: case 0x6C: /*STRB Rd,[Rn],offset*/ - addr=GETADDR(RN); - if (opcode&0x2000000) addr2=shift2(opcode); - else addr2=opcode&0xFFF; - writearmb(addr,armregs[RD]); - if (databort) break; - if (opcode&0x800000) armregs[RN]+=addr2; - else armregs[RN]-=addr2; - tubecycles-=3; - break; - case 0x46: case 0x4E: case 0x66: case 0x6E: /*STRBT Rd,[Rn],offset*/ - addr=GETADDR(RN); - if (opcode&0x2000000) addr2=shift2(opcode); - else addr2=opcode&0xFFF; - writearmb(addr,armregs[RD]); - templ=memmode; - memmode=0; - if (databort) break; - memmode=templ; - if (opcode&0x800000) armregs[RN]+=addr2; - else armregs[RN]-=addr2; - tubecycles-=3; - break; - case 0x54: case 0x5C: case 0x74: case 0x7C: /*STRB Rd,[Rn,offset]*/ - case 0x56: case 0x5E: case 0x76: case 0x7E: /*STRB Rd,[Rn,offset]!*/ - if (opcode&0x2000000) addr2=shift2(opcode); - else addr2=opcode&0xFFF; - if (opcode&0x800000) addr=GETADDR(RN)+addr2; - else addr=GETADDR(RN)-addr2; - writearmb(addr,armregs[RD]); - if (databort) break; - if (opcode&0x200000) armregs[RN]=addr; - tubecycles-=3; - break; - - -// case 0x41: case 0x49: /*LDR*/ - case 0x51: case 0x53: case 0x59: case 0x5B: -// case 0x61: case 0x69: - case 0x71: case 0x73: case 0x79: case 0x7B: - if ((opcode&0x2000010)==0x2000010) - { - undefined(); - break; - } - addr=GETADDR(RN); - if (opcode&0x2000000) addr2=shift2(opcode); - else addr2=opcode&0xFFF; - if (!(opcode&0x800000)) addr2=-addr2; - if (opcode&0x1000000) - { - addr+=addr2; - } - templ=readarml(addr); - templ=ldrresult(templ,addr); - if (databort) break; - if (!(opcode&0x1000000)) - { - addr+=addr2; - armregs[RN]=addr; - } - else - { - if (opcode&0x200000) armregs[RN]=addr; - } - LOADREG(RD,templ); -// if (RD==15) refillpipeline(); - tubecycles-=4; -/* if (RD==7) - { - if (!olog) olog=fopen("armlog.txt","wt"); - srpclog(s,"LDR R7 %08X,%07X\n",armregs[7],PC); - fputs(s,olog); - }*/ - break; - - case 0x65: case 0x6D: - case 0x75: case 0x77: case 0x7D: case 0x7F: - if (opcode&0x10) - { - undefined(); - break; - } - case 0x45: case 0x4D: /*LDRB*/ - case 0x55: case 0x57: case 0x5D: case 0x5F: - addr=GETADDR(RN); - if (opcode&0x2000000) addr2=shift2(opcode); - else addr2=opcode&0xFFF; - if (!(opcode&0x800000)) addr2=-addr2; - if (opcode&0x1000000) - { - addr+=addr2; - } - templ=readarmb(addr); - if (databort) break; - if (!(opcode&0x1000000)) - { - addr+=addr2; - armregs[RN]=addr; - } - else - { - if (opcode&0x200000) armregs[RN]=addr; - } - armregs[RD]=templ; - tubecycles-=4; - break; - -#define STMfirst() mask=1; \ - for (c=0;c<15;c++) \ - { \ - if (opcode&mask) \ - { \ - if (!(addr&0xC)) tubecycles--; \ - if (c==15) { writearml(addr,armregs[c]+4); } \ - else { writearml(addr,armregs[c]); } \ - addr+=4; \ - tubecycles--; \ - break; \ - } \ - mask<<=1; \ - } \ - mask<<=1; c++; - -#define STMall() for (;c<15;c++) \ - { \ - if (opcode&mask) \ - { \ - if (!(addr&0xC)) tubecycles--; \ - writearml(addr,armregs[c]); \ - addr+=4; \ - tubecycles--; \ - } \ - mask<<=1; \ - } \ - if (opcode&0x8000) \ - { \ - if (!(addr&0xC)) tubecycles--; \ - writearml(addr,armregs[15]+4); \ - tubecycles--; \ - } - -#define STMfirstS() mask=1; \ - for (c=0;c<15;c++) \ - { \ - if (opcode&mask) \ - { \ - if (!(addr&0xC)) tubecycles--; \ - if (c==15) { writearml(addr,armregs[c]+4); } \ - else { writearml(addr,*usrregs[c]); } \ - addr+=4; \ - tubecycles--; \ - break; \ - } \ - mask<<=1; \ - } \ - mask<<=1; c++; - -#define STMallS() for (;c<15;c++) \ - { \ - if (opcode&mask) \ - { \ - if (!(addr&0xC)) tubecycles--; \ - writearml(addr,*usrregs[c]); \ - addr+=4; \ - tubecycles--; \ - } \ - mask<<=1; \ - } \ - if (opcode&0x8000) \ - { \ - if (!(addr&0xC)) tubecycles--; \ - writearml(addr,armregs[15]+4); \ - tubecycles--; \ - } - -#define LDMall() mask=1; \ - for (c=0;c<15;c++) \ - { \ - if (opcode&mask) \ - { \ - if (!(addr&0xC)) tubecycles--; \ - templ=readarml(addr); if (!databort) armregs[c]=templ; \ - addr+=4; \ - tubecycles--; \ - } \ - mask<<=1; \ - } \ - if (opcode&0x8000) \ - { \ - if (!(addr&0xC)) tubecycles--; \ - templ=readarml(addr); \ - if (!databort) armregs[15]=(armregs[15]&0xFC000003)|((templ+4)&0x3FFFFFC); \ - tubecycles--; \ - refillpipeline(); \ - } - -#define LDMallS() mask=1; \ - if (opcode&0x8000) \ - { \ - for (c=0;c<15;c++) \ - { \ - if (opcode&mask) \ - { \ - if (!(addr&0xC)) tubecycles--; \ - templ=readarml(addr); if (!databort) armregs[c]=templ; \ - addr+=4; \ - tubecycles--; \ - } \ - mask<<=1; \ - } \ - if (!(addr&0xC)) tubecycles--; \ - templ=readarml(addr); \ - if (!databort) \ - { \ - if (armregs[15]&3) armregs[15]=(templ+4); \ - else armregs[15]=(armregs[15]&0x0C000003)|((templ+4)&0xF3FFFFFC); \ - } \ - tubecycles--; \ - refillpipeline(); \ - } \ - else \ - { \ - for (c=0;c<15;c++) \ - { \ - if (opcode&mask) \ - { \ - if (!(addr&0xC)) tubecycles--; \ - templ=readarml(addr); if (!databort) *usrregs[c]=templ; \ - addr+=4; \ - tubecycles--; \ - } \ - mask<<=1; \ - } \ - } - - case 0x80: /*STMDA*/ - case 0x82: /*STMDA !*/ - case 0x90: /*STMDB*/ - case 0x92: /*STMDB !*/ - addr=armregs[RN]-countbits(opcode&0xFFFF); - if (!(opcode&0x1000000)) addr+=4; - STMfirst(); - if (opcode&0x200000) armregs[RN]-=countbits(opcode&0xFFFF); - STMall() - tubecycles--; - break; - case 0x88: /*STMIA*/ - case 0x8A: /*STMIA !*/ - case 0x98: /*STMIB*/ - case 0x9A: /*STMIB !*/ - addr=armregs[RN]; - if (opcode&0x1000000) addr+=4; - STMfirst(); - if (opcode&0x200000) armregs[RN]+=countbits(opcode&0xFFFF); - STMall(); - tubecycles--; - break; - case 0x84: /*STMDA ^*/ - case 0x86: /*STMDA ^!*/ - case 0x94: /*STMDB ^*/ - case 0x96: /*STMDB ^!*/ - addr=armregs[RN]-countbits(opcode&0xFFFF); - if (!(opcode&0x1000000)) addr+=4; - STMfirstS(); - if (opcode&0x200000) armregs[RN]-=countbits(opcode&0xFFFF); - STMallS() - tubecycles--; - break; - case 0x8C: /*STMIA ^*/ - case 0x8E: /*STMIA ^!*/ - case 0x9C: /*STMIB ^*/ - case 0x9E: /*STMIB ^!*/ - addr=armregs[RN]; - if (opcode&0x1000000) addr+=4; - STMfirstS(); - if (opcode&0x200000) armregs[RN]+=countbits(opcode&0xFFFF); - STMallS(); - tubecycles--; - break; - - case 0x81: /*LDMDA*/ - case 0x83: /*LDMDA !*/ - case 0x91: /*LDMDB*/ - case 0x93: /*LDMDB !*/ - addr=armregs[RN]-countbits(opcode&0xFFFF); -// rpclog("LDMDB %08X\n",addr); - if (!(opcode&0x1000000)) addr+=4; - if (opcode&0x200000) armregs[RN]-=countbits(opcode&0xFFFF); - LDMall(); - tubecycles-=2; - break; - case 0x89: /*LDMIA*/ - case 0x8B: /*LDMIA !*/ - case 0x99: /*LDMIB*/ - case 0x9B: /*LDMIB !*/ - addr=armregs[RN]; - if (opcode&0x1000000) addr+=4; - if (opcode&0x200000) armregs[RN]+=countbits(opcode&0xFFFF); - LDMall(); - tubecycles-=2; - break; - case 0x85: /*LDMDA ^*/ - case 0x87: /*LDMDA ^!*/ - case 0x95: /*LDMDB ^*/ - case 0x97: /*LDMDB ^!*/ - addr=armregs[RN]-countbits(opcode&0xFFFF); - if (!(opcode&0x1000000)) addr+=4; - if (opcode&0x200000) armregs[RN]-=countbits(opcode&0xFFFF); - LDMallS(); - tubecycles-=2; - break; - case 0x8D: /*LDMIA ^*/ - case 0x8F: /*LDMIA ^!*/ - case 0x9D: /*LDMIB ^*/ - case 0x9F: /*LDMIB ^!*/ - addr=armregs[RN]; - if (opcode&0x1000000) addr+=4; - if (opcode&0x200000) armregs[RN]+=countbits(opcode&0xFFFF); - LDMallS(); - tubecycles-=2; - break; - - case 0xB0: case 0xB1: case 0xB2: case 0xB3: /*BL*/ - case 0xB4: case 0xB5: case 0xB6: case 0xB7: - case 0xB8: case 0xB9: case 0xBA: case 0xBB: - case 0xBC: case 0xBD: case 0xBE: case 0xBF: - templ=(opcode&0xFFFFFF)<<2; - armregs[14]=armregs[15]-4; - armregs[15]=((armregs[15]+templ+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - tubecycles-=4; - break; - - case 0xA0: case 0xA1: case 0xA2: case 0xA3: /*B*/ - case 0xA4: case 0xA5: case 0xA6: case 0xA7: - case 0xA8: case 0xA9: case 0xAA: case 0xAB: - case 0xAC: case 0xAD: case 0xAE: case 0xAF: - templ=(opcode&0xFFFFFF)<<2; - armregs[15]=((armregs[15]+templ+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); - refillpipeline(); - tubecycles-=4; - break; - - case 0xE0: case 0xE2: case 0xE4: case 0xE6: /*MCR*/ - case 0xE8: case 0xEA: case 0xEC: case 0xEE: - templ=armregs[15]-4; - armregs[15]|=3; - updatemode(SUPERVISOR); - armregs[14]=templ; - armregs[15]&=0xFC000003; - armregs[15]|=0x08000008; - tubecycles-=4; - refillpipeline(); - break; - - case 0xE1: case 0xE3: case 0xE5: case 0xE7: /*MRC*/ - case 0xE9: case 0xEB: case 0xED: case 0xEF: - templ=armregs[15]-4; - armregs[15]|=3; - updatemode(SUPERVISOR); - armregs[14]=templ; - armregs[15]&=0xFC000003; - armregs[15]|=0x08000008; - tubecycles-=4; - refillpipeline(); - break; - - case 0xC0: case 0xC1: case 0xC2: case 0xC3: /*Co-pro*/ - case 0xC4: case 0xC5: case 0xC6: case 0xC7: - case 0xC8: case 0xC9: case 0xCA: case 0xCB: - case 0xCC: case 0xCD: case 0xCE: case 0xCF: - case 0xD0: case 0xD1: case 0xD2: case 0xD3: - case 0xD4: case 0xD5: case 0xD6: case 0xD7: - case 0xD8: case 0xD9: case 0xDA: case 0xDB: - case 0xDC: case 0xDD: case 0xDE: case 0xDF: - templ=armregs[15]-4; - armregs[15]|=3; - updatemode(SUPERVISOR); - armregs[14]=templ; - armregs[15]&=0xFC000003; - armregs[15]|=0x08000008; - tubecycles-=4; - refillpipeline(); - break; - - case 0xF0: case 0xF1: case 0xF2: case 0xF3: /*SWI*/ - case 0xF4: case 0xF5: case 0xF6: case 0xF7: - case 0xF8: case 0xF9: case 0xFA: case 0xFB: - case 0xFC: case 0xFD: case 0xFE: case 0xFF: - templ=armregs[15]-4; - armregs[15]|=3; - updatemode(SUPERVISOR); - armregs[14]=templ; - armregs[15]&=0xFC000003; - armregs[15]|=0x0800000C; - tubecycles-=4; - refillpipeline(); - break; - - default: - break; - } - } - if (databort|armirq|tube_irq) - { - if (databort==1) /*Data abort*/ - { - templ=armregs[15]; - armregs[15]|=3; - updatemode(SUPERVISOR); - armregs[14]=templ; - armregs[15]&=0xFC000003; - armregs[15]|=0x08000014; - refillpipeline(); - databort=0; - } - else if (databort==2) /*Address Exception*/ - { - templ=armregs[15]; - armregs[15]|=3; - updatemode(SUPERVISOR); - armregs[14]=templ; - armregs[15]&=0xFC000003; - armregs[15]|=0x08000018; - refillpipeline(); - databort=0; - } - else if ((armirq&2) && !(armregs[15]&0x4000000)) /*FIQ*/ - { - templ=armregs[15]; - armregs[15]|=3; - updatemode(FIQ); - armregs[14]=templ; - armregs[15]&=0xFC000001; - armregs[15]|=0x0C000020; - refillpipeline(); -// rpclog("FIQ\n"); - } - else if ((armirq&1) && !(armregs[15]&0x8000000)) /*IRQ*/ - { - templ=armregs[15]; - armregs[15]|=3; - updatemode(IRQ); - armregs[14]=templ; - armregs[15]&=0xFC000002; - armregs[15]|=0x0800001C; - refillpipeline(); -// rpclog("IRQ\n"); - } - } -// if (armregs[12]==0x1000000) rpclog("R12=1000000 %08X %i\n",PC,armins); - armirq=tube_irq; - if ((armregs[15]&3)!=mode) updatemode(armregs[15]&3); - armregs[15]+=4; -// rpclog("%08X : %08X %08X %08X %08X\n",PC,armregs[0],armregs[1],armregs[2],opcode); -/* if (!PC) - { - rpclog("Branch through zero\n"); - dumpregs(); - exit(-1); - }*/ - if (endtimeslice) - { - endtimeslice=0; - return; - } -// if (output && !(*armregs[15]&0x8000000) && PC<0x2000000) rpclog("%07X : %08X %08X %08X %08X %08X %08X %08X %08X\n%08i: %08X %08X %08X %08X %08X %08X %08X %08X\n",PC,*armregs[0],*armregs[1],*armregs[2],*armregs[3],*armregs[4],*armregs[5],*armregs[6],*armregs[7],inscount,*armregs[8],*armregs[9],*armregs[10],*armregs[11],*armregs[12],*armregs[13],*armregs[14],*armregs[15]); - } -} +/*B-em v2.2 by Tom Walker + ARM1 parasite CPU emulation + Originally from Arculator*/ + +#include +#include +#include +#include "b-em.h" +#include "arm.h" +#include "tube.h" + + +uint32_t *usrregs[16],userregs[16],superregs[16],fiqregs[16],irqregs[16]; +uint32_t armregs[16]; + +#define PC ((armregs[15])&0x3FFFFFC) + +static uint32_t opcode2,opcode3; + +static int armirq=0; +static int databort; +static uint32_t *armrom,*armram; +static uint8_t *armromb,*armramb; +#define USER 0 +#define FIQ 1 +#define IRQ 2 +#define SUPERVISOR 3 + +#define NFSET ((armregs[15]&0x80000000)?1:0) +#define ZFSET ((armregs[15]&0x40000000)?1:0) +#define CFSET ((armregs[15]&0x20000000)?1:0) +#define VFSET ((armregs[15]&0x10000000)?1:0) + +#define NFLAG 0x80000000 +#define ZFLAG 0x40000000 +#define CFLAG 0x20000000 +#define VFLAG 0x10000000 +#define IFLAG 0x08000000 + +#define RD ((opcode>>12)&0xF) +#define RN ((opcode>>16)&0xF) +#define RM (opcode&0xF) + +#define MULRD ((opcode>>16)&0xF) +#define MULRN ((opcode>>12)&0xF) +#define MULRS ((opcode>>8)&0xF) +#define MULRM (opcode&0xF) + +#define GETADDR(r) ((r==15)?(armregs[15]&0x3FFFFFC):armregs[r]) +#define LOADREG(r,v) if (r==15) { armregs[15]=(armregs[15]&0xFC000003)|((v+4)&0x3FFFFFC); refillpipeline(); } else armregs[r]=v; +#define GETREG(r) ((r==15) ? armregs[15]+4 : armregs[r]) +#define LDRRESULT(a,v) ((a&3)?(v>>((a&3)<<3))|(v<<(((a&3)^3)<<3)):v) + +#define undefined()\ + templ=armregs[15]-4; \ + armregs[15]|=3;\ + updatemode(SUPERVISOR);\ + armregs[14]=templ;\ + armregs[15]&=0xFC000003;\ + armregs[15]|=0x08000008;\ + refillpipeline();\ + tubecycles-- + +static int mode; +static int osmode=0,memmode; + +static void updatemode(int m) +{ + int c; + usrregs[15]=&armregs[15]; + switch (mode) /*Store back registers*/ + { + case USER: + for (c=8;c<15;c++) userregs[c]=armregs[c]; + break; + case IRQ: + for (c=8;c<13;c++) userregs[c]=armregs[c]; + irqregs[0]=armregs[13]; + irqregs[1]=armregs[14]; + break; + case FIQ: + for (c=8;c<15;c++) fiqregs[c]=armregs[c]; + break; + case SUPERVISOR: + for (c=8;c<13;c++) userregs[c]=armregs[c]; + superregs[0]=armregs[13]; + superregs[1]=armregs[14]; + break; + } + mode=m; + switch (m) + { + case USER: + for (c=8;c<15;c++) armregs[c]=userregs[c]; + memmode=osmode; + for (c=0;c<15;c++) usrregs[c]=&armregs[c]; + break; + case IRQ: + for (c=8;c<13;c++) armregs[c]=userregs[c]; + armregs[13]=irqregs[0]; + armregs[14]=irqregs[1]; + for (c=0;c<13;c++) usrregs[c]=&armregs[c]; + for (c=13;c<15;c++) usrregs[c]=&userregs[c]; + memmode=2; + break; + case FIQ: + for (c=8;c<15;c++) armregs[c]=fiqregs[c]; + for (c=0;c<8;c++) usrregs[c]=&armregs[c]; + for (c=8;c<15;c++) usrregs[c]=&userregs[c]; + memmode=2; + break; + case SUPERVISOR: + for (c=8;c<13;c++) armregs[c]=userregs[c]; + armregs[13]=superregs[0]; + armregs[14]=superregs[1]; + for (c=0;c<13;c++) usrregs[c]=&armregs[c]; + for (c=13;c<15;c++) usrregs[c]=&userregs[c]; + memmode=2; + break; + } +} + +static uint8_t flaglookup[16][16]; +static uint32_t rotatelookup[4096]; + +static void refillpipeline2(); + +#define countbits(c) countbitstable[c] +static int countbitstable[65536]; +void arm_reset() +{ + int c,d,exec,data; + uint32_t rotval,rotamount; + for (c=0;c<65536;c++) + { + countbitstable[c]=0; + for (d=0;d<16;d++) + { + if (c&(1<>8)&0xF)<<1; + rotval=(rotval>>rotamount)|(rotval<<(32-rotamount)); + rotatelookup[data]=rotval; + } + updatemode(SUPERVISOR); + armregs[15]=0x0C00000B; + mode=3; + memmode=2; + memcpy(armramb,armromb,0x4000); + refillpipeline2(); +} + +void arm_dumpregs() +{ + FILE *f=fopen("armram.dmp","wb"); + fwrite(armram,0x10000,1,f); + fclose(f); + rpclog("R 0=%08X R 4=%08X R 8=%08X R12=%08X\n",armregs[0],armregs[4],armregs[8],armregs[12]); + rpclog("R 1=%08X R 5=%08X R 9=%08X R13=%08X\n",armregs[1],armregs[5],armregs[9],armregs[13]); + rpclog("R 2=%08X R 6=%08X R10=%08X R14=%08X\n",armregs[2],armregs[6],armregs[10],armregs[14]); + rpclog("R 3=%08X R 7=%08X R11=%08X R15=%08X\n",armregs[3],armregs[7],armregs[11],armregs[15]); + rpclog("f12=%08X ",fiqregs[12]); + rpclog("PC =%07X\n",PC); +} + +static uint32_t *armread[64]; +static uint32_t armmask[64]; +void arm_init() +{ + FILE *f; + int c; + char fn[256]; + if (!armrom) armrom=(uint32_t *)malloc(0x4000); + if (!armram) armram=(uint32_t *)malloc(0x400000); + armromb=(uint8_t *)armrom; + armramb=(uint8_t *)armram; + append_filename(fn,exedir,"roms/tube/ARMeval_100.rom",511); + f=fopen(fn,"rb"); + fread(armromb,0x4000,1,f); + fclose(f); + memcpy(armramb,armromb,0x4000); + for (c=0;c<64;c++) armread[c]=0; + for (c=0;c<4;c++) armread[c]=&armram[c*0x40000]; + armread[48]=armrom; + for (c=0;c<64;c++) armmask[c]=0xFFFFF; + armmask[48]=0x3FFF; +} + +void arm_close() +{ + if (armrom) free(armrom); + if (armram) free(armram); +} + +int endtimeslice=0; +static uint32_t readarmfl(uint32_t addr); +static uint32_t readarml(uint32_t a) +{ + if (armread[(a>>20)&63]) + return armread[(a>>20)&63][(a&0xFFFFF)>>2]; + return readarmfl(a); +} +//#define readarml(a) ((armread[(a>>20)&63])?armread[(a>>20)&63][(a&0xFFFFF)>>2]:readarmfl(a)) + +static uint8_t readarmb(uint32_t addr) +{ + if (addr<0x400000) return armramb[addr]; + if ((addr&~0x1F)==0x1000000) + { + //rpclog("Read %08X\n",addr); + return tube_parasite_read((addr&0x1C)>>2); + } + if ((addr>=0x3000000) && (addr<0x3004000)) return armromb[addr&0x3FFF]; + return 0xFF; +/* rpclog("Bad ARM read byte %08X\n",addr); + dumparmregs(); + exit(-1);*/ +} +static uint32_t readarmfl(uint32_t addr) +{ + if (addr<0x400000) return armram[addr>>2]; + if (addr<0x400010) return 0xFFFFFFFF; + if ((addr>=0x3000000) && (addr<0x3004000)) return armrom[(addr&0x3FFC)>>2]; + return 0xFFFFFFFF; +/* rpclog("Bad ARM read long %08X\n",addr); + dumparmregs(); + exit(-1);*/ +} + +static void writearmb(uint32_t addr, uint8_t val) +{ + if (addr<0x400000) + { + armramb[addr]=val; + return; + } + if ((addr&~0x1F)==0x1000000) + { +// rpclog("Write %08X %02X\n",addr,val); + tube_parasite_write((addr&0x1C)>>2,val); + endtimeslice=1; + return; + } +/* rpclog("Bad ARM write byte %08X %02X\n",addr,val); + dumparmregs(); + exit(-1);*/ +} +static void writearml(uint32_t addr, uint32_t val) +{ + if (addr<0x400000) + { + armram[addr>>2]=val; + return; + } +/* if (addr<0x400010) return; + rpclog("Bad ARM write long %08X %08X\n",addr,val); + dumparmregs(); + exit(-1);*/ +} + +#define checkneg(v) (v&0x80000000) +#define checkpos(v) !(v&0x80000000) + +static inline void setadd(uint32_t op1, uint32_t op2, uint32_t res) +{ + armregs[15]&=0xFFFFFFF; + if ((checkneg(op1) && checkneg(op2)) || + (checkneg(op1) && checkpos(res)) || + (checkneg(op2) && checkpos(res))) armregs[15]|=CFLAG; + if ((checkneg(op1) && checkneg(op2) && checkpos(res)) || + (checkpos(op1) && checkpos(op2) && checkneg(res))) + armregs[15]|=VFLAG; + if (!res) armregs[15]|=ZFLAG; + else if (checkneg(res)) armregs[15]|=NFLAG; +} + +static inline void setsub(uint32_t op1, uint32_t op2, uint32_t res) +{ + armregs[15]&=0xFFFFFFF; + if ((checkneg(op1) && checkpos(op2)) || + (checkneg(op1) && checkpos(res)) || + (checkpos(op2) && checkpos(res))) armregs[15]|=CFLAG; + if (!res) armregs[15]|=ZFLAG; + else if (checkneg(res)) armregs[15]|=NFLAG; + if ((checkneg(op1) && checkpos(op2) && checkpos(res)) || + (checkpos(op1) && checkneg(op2) && checkneg(res))) + armregs[15]|=VFLAG; +} + +static inline void setsbc(uint32_t op1, uint32_t op2, uint32_t res) +{ + armregs[15]&=0xFFFFFFF; + if (!res) armregs[15]|=ZFLAG; + else if (checkneg(res)) armregs[15]|=NFLAG; + if ((checkneg(op1) && checkpos(op2)) || + (checkneg(op1) && checkpos(res)) || + (checkpos(op2) && checkpos(res))) armregs[15]|=CFLAG; + if ((checkneg(op1) && checkpos(op2) && checkpos(res)) || + (checkpos(op1) && checkneg(op2) && checkneg(res))) + armregs[15]|=VFLAG; +} + +static inline void setadc(uint32_t op1, uint32_t op2, uint32_t res) +{ + armregs[15]&=0xFFFFFFF; + if ((checkneg(op1) && checkneg(op2)) || + (checkneg(op1) && checkpos(res)) || + (checkneg(op2) && checkpos(res))) armregs[15]|=CFLAG; + if ((checkneg(op1) && checkneg(op2) && checkpos(res)) || + (checkpos(op1) && checkpos(op2) && checkneg(res))) + armregs[15]|=VFLAG; + if (!res) armregs[15]|=ZFLAG; + else if (checkneg(res)) armregs[15]|=NFLAG; +} + +static inline void setarmzn(uint32_t op) +{ + armregs[15]&=0x3FFFFFFF; + if (!op) armregs[15]|=ZFLAG; + else if (checkneg(op)) armregs[15]|=NFLAG; +} + +static inline uint32_t shift(uint32_t opcode) +{ + uint32_t shiftmode=(opcode>>5)&3; + uint32_t shiftamount=(opcode>>7)&31; + uint32_t temp; + int cflag=CFSET; + if (!(opcode&0xFF0)) return armregs[RM]; + if (opcode&0x10) + { + shiftamount=armregs[(opcode>>8)&15]&0xFF; + if (shiftmode==3) + shiftamount&=0x1F; +// cycles--; + } + temp=armregs[RM]; +// if (RM==15) temp+=4; + if (opcode&0x100000 && shiftamount) armregs[15]&=~CFLAG; + switch (shiftmode) + { + case 0: /*LSL*/ + if (!shiftamount) return temp; + if (shiftamount==32) + { + if (temp&1 && opcode&0x100000) armregs[15]|=CFLAG; + return 0; + } + if (shiftamount>32) return 0; + if (opcode&0x100000) + { + if ((temp<<(shiftamount-1))&0x80000000) armregs[15]|=CFLAG; + } + return temp<32) return 0; + if (opcode&0x100000) + { + if ((temp>>(shiftamount-1))&1) armregs[15]|=CFLAG; + } + return temp>>shiftamount; + + case 2: /*ASR*/ + if (!shiftamount) + { + if (opcode&0x10) return temp; + } + if (shiftamount>=32 || !shiftamount) + { + if (temp&0x80000000 && opcode&0x100000) armregs[15]|=CFLAG; + else if (opcode&0x100000) armregs[15]&=~CFLAG; + if (temp&0x80000000) return 0xFFFFFFFF; + return 0; + } + if (opcode&0x100000) + { + if (((int)temp>>(shiftamount-1))&1) armregs[15]|=CFLAG; + } + return (int)temp>>shiftamount; + + case 3: /*ROR*/ + if (opcode&0x100000) armregs[15]&=~CFLAG; + if (!shiftamount && !(opcode&0x10)) + { + if (opcode&0x100000 && temp&1) armregs[15]|=CFLAG; + return (((cflag)?1:0)<<31)|(temp>>1); + } + if (!shiftamount) + { + if (opcode&0x100000) armregs[15]|=cflag; + return temp; + } + if (!(shiftamount&0x1F)) + { + if (opcode&0x100000 && temp&0x80000000) armregs[15]|=CFLAG; + return temp; + } + if (opcode&0x100000) + { + if (((temp>>shiftamount)|(temp<<(32-shiftamount)))&0x80000000) armregs[15]|=CFLAG; + } + return (temp>>shiftamount)|(temp<<(32-shiftamount)); + } + return 0; /*Should never reach here*/ +} + +static inline unsigned shift2(unsigned opcode) +{ + unsigned shiftmode=(opcode>>5)&3; + unsigned shiftamount=(opcode>>7)&31; + uint32_t temp; + int cflag=CFSET; + if (!(opcode&0xFF0)) return armregs[RM]; + if (opcode&0x10) + { + shiftamount=armregs[(opcode>>8)&15]&0xFF; + if (shiftmode==3) + shiftamount&=0x1F; + } + temp=armregs[RM]; +// if (RM==15) temp+=4; + switch (shiftmode) + { + case 0: /*LSL*/ + if (!shiftamount) return temp; + if (shiftamount>=32) return 0; + return temp<=32) return 0; + return temp>>shiftamount; + + case 2: /*ASR*/ + if (!shiftamount && !(opcode&0x10)) shiftamount=32; + if (shiftamount>=32) + { + if (temp&0x80000000) + return 0xFFFFFFFF; + return 0; + } + return (int)temp>>shiftamount; + + case 3: /*ROR*/ + if (!shiftamount && !(opcode&0x10)) return (((cflag)?1:0)<<31)|(temp>>1); + if (!shiftamount) return temp; + return (temp>>shiftamount)|(temp<<(32-shiftamount)); + } + return 0; /*Should never reach here*/ +} + +static inline unsigned rotate(unsigned data) +{ + uint32_t rotval; + rotval=rotatelookup[data&4095]; + if (data&0x100000 && data&0xF00) + { + if (rotval&0x80000000) armregs[15]|=CFLAG; + else armregs[15]&=~CFLAG; + } + return rotval; +} + +#define rotate2(v) rotatelookup[v&4095] + +static int ldrlookup[4]={0,8,16,24}; + +#define ldrresult(v,a) ((v>>ldrlookup[addr&3])|(v<<(32-ldrlookup[addr&3]))) + +static void refillpipeline() +{ + opcode2=readarml(PC-4); + opcode3=readarml(PC); +} + +static void refillpipeline2() +{ + opcode2=readarml(PC-8); + opcode3=readarml(PC-4); +} + +int accc=0; +void arm_exec() +{ + uint32_t opcode,templ,templ2,mask,addr,addr2; + int c; + while (tubecycles>0) + { + opcode=opcode2; + opcode2=opcode3; + opcode3=readarml(PC); + if (flaglookup[opcode>>28][armregs[15]>>28]) + { + switch ((opcode>>20)&0xFF) + { + case 0x00: /*AND reg*/ +// if (((opcode&0xF0)==0x90)) /*MUL*/ +// { +// armregs[MULRD]=(armregs[MULRM])*(armregs[MULRS]); +// if (MULRD==MULRM) armregs[MULRD]=0; +// cycles-=17; +// } +// else +// { + if (RD==15) + { + templ=shift2(opcode); + armregs[15]=(((GETADDR(RN)&templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ=shift2(opcode); + armregs[RD]=GETADDR(RN)&templ; + } + tubecycles--; +// } + break; + case 0x01: /*ANDS reg*/ +// if (((opcode&0xF0)==0x90)) /*MULS*/ +// { +// armregs[MULRD]=(armregs[MULRM])*(armregs[MULRS]); +// if (MULRD==MULRM) armregs[MULRD]=0; +// setarmzn(armregs[MULRD]); +// tubecycles-=17; +// } +// else +// { + if (RD==15) + { + templ=shift2(opcode); + armregs[15]=(GETADDR(RN)&templ)+4; + refillpipeline(); + } + else + { + templ=shift(opcode); + armregs[RD]=GETADDR(RN)&templ; + setarmzn(armregs[RD]); + } + tubecycles--; +// } + break; + + case 0x02: /*EOR reg*/ +// if (((opcode&0xF0)==0x90)) /*MLA*/ +/// { +// armregs[MULRD]=((armregs[MULRM])*(armregs[MULRS]))+armregs[MULRN]; +// if (MULRD==MULRM) armregs[MULRD]=0; +// tubecycles-=17; +// } +// else +// { + if (RD==15) + { + templ=shift2(opcode); + armregs[15]=(((GETADDR(RN)^templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ=shift2(opcode); + armregs[RD]=GETADDR(RN)^templ; + } + tubecycles--; +// } + break; + case 0x03: /*EORS reg*/ +// if (((opcode&0xF0)==0x90)) /*MLAS*/ +// { +// armregs[MULRD]=((armregs[MULRM])*(armregs[MULRS]))+armregs[MULRN]; +// if (MULRD==MULRM) armregs[MULRD]=0; +// setarmzn(armregs[MULRD]); +// tubecycles-=17; +// } +// else +// { + if (RD==15) + { + templ=shift2(opcode); + armregs[15]=(GETADDR(RN)^templ)+4; + refillpipeline(); + } + else + { + templ=shift(opcode); + armregs[RD]=GETADDR(RN)^templ; + setarmzn(armregs[RD]); + } + tubecycles--; +// } + break; + + case 0x04: /*SUB reg*/ + if (RD==15) + { + templ=shift2(opcode); + armregs[15]=(((GETADDR(RN)-templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ=shift2(opcode); + armregs[RD]=GETADDR(RN)-templ; + } + tubecycles--; + break; + case 0x05: /*SUBS reg*/ + if (RD==15) + { + templ=shift2(opcode); + armregs[15]=(GETADDR(RN)-templ)+4; + refillpipeline(); + } + else + { + templ=shift2(opcode); + setsub(GETADDR(RN),templ,GETADDR(RN)-templ); + armregs[RD]=GETADDR(RN)-templ; + } + tubecycles--; + break; + + case 0x06: /*RSB reg*/ + if (RD==15) + { + templ=shift2(opcode); + armregs[15]=(((templ-GETADDR(RN))+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ=shift2(opcode); + armregs[RD]=templ-GETADDR(RN); + } + tubecycles--; + break; + case 0x07: /*RSBS reg*/ + if (RD==15) + { + templ=shift2(opcode); + armregs[15]=(templ-GETADDR(RN))+4; + refillpipeline(); + } + else + { + templ=shift2(opcode); + setsub(templ,GETADDR(RN),templ-GETADDR(RN)); + armregs[RD]=templ-GETADDR(RN); + } + tubecycles--; + break; + + case 0x08: /*ADD reg*/ + if (RD==15) + { + templ=shift2(opcode); + armregs[15]=((GETADDR(RN)+templ+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ=shift2(opcode); + armregs[RD]=GETADDR(RN)+templ; + } + tubecycles--; + break; + case 0x09: /*ADDS reg*/ + if (RD==15) + { + templ=shift2(opcode); + armregs[15]=GETADDR(RN)+templ+4; + refillpipeline(); + } + else + { + templ=shift2(opcode); + setadd(GETADDR(RN),templ,GETADDR(RN)+templ); + armregs[RD]=GETADDR(RN)+templ; + } + tubecycles--; + break; + + case 0x0A: /*ADC reg*/ + if (RD==15) + { + templ2=CFSET; + templ=shift2(opcode); + armregs[15]=((GETADDR(RN)+templ+templ2+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ2=CFSET; + templ=shift2(opcode); + armregs[RD]=GETADDR(RN)+templ+templ2; + } + tubecycles--; + break; + case 0x0B: /*ADCS reg*/ + if (RD==15) + { + templ2=CFSET; + templ=shift2(opcode); + armregs[15]=GETADDR(RN)+templ+templ2+4; + refillpipeline(); + } + else + { + templ2=CFSET; + templ=shift2(opcode); + setadc(GETADDR(RN),templ,GETADDR(RN)+templ+templ2); + armregs[RD]=GETADDR(RN)+templ+templ2; + } + tubecycles--; + break; + + case 0x0C: /*SBC reg*/ + templ2=(CFSET)?0:1; + if (RD==15) + { + templ=shift2(opcode); + armregs[15]=(((GETADDR(RN)-(templ+templ2))+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ=shift2(opcode); + armregs[RD]=GETADDR(RN)-(templ+templ2); + } + tubecycles--; + break; + case 0x0D: /*SBCS reg*/ + templ2=(CFSET)?0:1; + if (RD==15) + { + templ=shift2(opcode); + armregs[15]=(GETADDR(RN)-(templ+templ2))+4; + refillpipeline(); + } + else + { + templ=shift2(opcode); + setsbc(GETADDR(RN),templ,GETADDR(RN)-(templ+templ2)); + armregs[RD]=GETADDR(RN)-(templ+templ2); + } + tubecycles--; + break; + case 0x0E: /*RSC reg*/ + templ2=(CFSET)?0:1; + if (RD==15) + { + templ=shift2(opcode); + armregs[15]=(((templ-(GETADDR(RN)+templ2))+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ=shift2(opcode); + armregs[RD]=templ-(GETADDR(RN)+templ2); + } + tubecycles--; + break; + case 0x0F: /*RSCS reg*/ + templ2=(CFSET)?0:1; + if (RD==15) + { + templ=shift2(opcode); + armregs[15]=(templ-(GETADDR(RN)+templ2))+4; + refillpipeline(); + } + else + { + templ=shift2(opcode); + setsbc(templ,GETADDR(RN),templ-(GETADDR(RN)+templ2)); + armregs[RD]=templ-(GETADDR(RN)+templ2); + } + tubecycles--; + break; + + case 0x10: /*SWP word*/ + break; + + case 0x11: /*TST reg*/ + if (RD==15) + { + if (armregs[15]&3) + { + templ=armregs[15]&0x3FFFFFC; + armregs[15]=((GETADDR(RN)&shift2(opcode))&0xFC000003)|templ; + } + else + { + templ=armregs[15]&0x0FFFFFFF; + armregs[15]=((GETADDR(RN)&shift2(opcode))&0xF0000000)|templ; + } + } + else + { + setarmzn(GETADDR(RN)&shift(opcode)); + } + tubecycles--; + break; + + case 0x12: + break; + + case 0x13: /*TEQ reg*/ + if (RD==15) + { + if (armregs[15]&3) + { + templ=armregs[15]&0x3FFFFFC; + armregs[15]=((GETADDR(RN)^shift2(opcode))&0xFC000003)|templ; + } + else + { + templ=armregs[15]&0x0FFFFFFF; + armregs[15]=((GETADDR(RN)^shift2(opcode))&0xF0000000)|templ; + } + } + else + { + setarmzn(GETADDR(RN)^shift(opcode)); + } + tubecycles--; + break; + + case 0x14: /*SWPB*/ + break; + + case 0x15: /*CMP reg*/ + if (RD==15) + { + if (armregs[15]&3) + { + templ=armregs[15]&0x3FFFFFC; + armregs[15]=((GETADDR(RN)-shift2(opcode))&0xFC000003)|templ; + } + else + { + templ=armregs[15]&0x0FFFFFFF; + armregs[15]=((GETADDR(RN)-shift2(opcode))&0xF0000000)|templ; + } + } + else + setsub(GETADDR(RN),shift(opcode),GETADDR(RN)-shift2(opcode)); + tubecycles--; + break; + + case 0x17: /*CMN reg*/ + if (RD==15) + { + if (armregs[15]&3) + { + templ=armregs[15]&0x3FFFFFC; + armregs[15]=((GETADDR(RN)+shift2(opcode))&0xFC000003)|templ; + } + else + { + templ=armregs[15]&0x0FFFFFFF; + armregs[15]=((GETADDR(RN)+shift2(opcode))&0xF0000000)|templ; + } + } + else + setadd(GETADDR(RN),shift2(opcode),GETADDR(RN)+shift2(opcode)); + tubecycles--; + break; + + case 0x18: /*ORR reg*/ + if (RD==15) + { + templ=shift2(opcode); + armregs[15]=(((GETADDR(RN)|templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ=shift2(opcode); + armregs[RD]=GETADDR(RN)|templ; + } + tubecycles--; + break; + case 0x19: /*ORRS reg*/ + if (RD==15) + { + templ=shift2(opcode); + armregs[15]=(GETADDR(RN)|templ)+4; + refillpipeline(); + } + else + { + templ=shift(opcode); + armregs[RD]=GETADDR(RN)|templ; + setarmzn(armregs[RD]); + } + tubecycles--; + break; + + case 0x1A: /*MOV reg*/ + if (RD==15) + { + armregs[15]=(armregs[15]&0xFC000003)|((shift2(opcode)+4)&0x3FFFFFC); + refillpipeline(); + } + else + armregs[RD]=shift2(opcode); + tubecycles--; + break; + case 0x1B: /*MOVS reg*/ + if (RD==15) + { + if (armregs[15]&3) armregs[15]=shift2(opcode)+4; + else armregs[15]=((shift2(opcode)+4)&0xF3FFFFFC)|(armregs[15]&0xC000003); + refillpipeline(); + } + else + { + armregs[RD]=shift(opcode); + setarmzn(armregs[RD]); + } + tubecycles--; + break; + + case 0x1C: /*BIC reg*/ + if (RD==15) + { + templ=shift2(opcode); + armregs[15]=(((GETADDR(RN)&~templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ=shift2(opcode); + armregs[RD]=GETADDR(RN)&~templ; + } + tubecycles--; + break; + case 0x1D: /*BICS reg*/ + if (RD==15) + { + templ=shift2(opcode); + armregs[15]=(GETADDR(RN)&~templ)+4; + refillpipeline(); + } + else + { + templ=shift(opcode); + armregs[RD]=GETADDR(RN)&~templ; + setarmzn(armregs[RD]); + } + tubecycles--; + break; + + case 0x1E: /*MVN reg*/ + if (RD==15) + { + armregs[15]=(armregs[15]&0xFC000003)|(((~shift2(opcode))+4)&0x3FFFFFC); + refillpipeline(); + } + else + armregs[RD]=~shift2(opcode); + tubecycles--; + break; + case 0x1F: /*MVNS reg*/ + if (RD==15) + { + armregs[15]=(~shift2(opcode))+4; + refillpipeline(); + } + else + { + armregs[RD]=~shift(opcode); + setarmzn(armregs[RD]); + } + tubecycles--; + break; + + case 0x20: /*AND imm*/ + if (RD==15) + { + templ=rotate2(opcode); + armregs[15]=(((GETADDR(RN)&templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ=rotate2(opcode); + armregs[RD]=GETADDR(RN)&templ; + } + tubecycles--; + break; + case 0x21: /*ANDS imm*/ + if (RD==15) + { + templ=rotate2(opcode); + armregs[15]=(GETADDR(RN)&templ)+4; + refillpipeline(); + } + else + { + templ=rotate(opcode); + armregs[RD]=GETADDR(RN)&templ; + setarmzn(armregs[RD]); + } + tubecycles--; + break; + + case 0x22: /*EOR imm*/ + if (RD==15) + { + templ=rotate2(opcode); + armregs[15]=(((GETADDR(RN)^templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ=rotate2(opcode); + armregs[RD]=GETADDR(RN)^templ; + } + tubecycles--; + break; + case 0x23: /*EORS imm*/ + if (RD==15) + { + templ=rotate2(opcode); + armregs[15]=(GETADDR(RN)^templ)+4; + refillpipeline(); + } + else + { + templ=rotate(opcode); + armregs[RD]=GETADDR(RN)^templ; + setarmzn(armregs[RD]); + } + tubecycles--; + break; + + case 0x24: /*SUB imm*/ + if (RD==15) + { + templ=rotate2(opcode); + armregs[15]=(((GETADDR(RN)-templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ=rotate2(opcode); + armregs[RD]=GETADDR(RN)-templ; + } + tubecycles--; + break; + case 0x25: /*SUBS imm*/ + if (RD==15) + { + templ=rotate2(opcode); + armregs[15]=(GETADDR(RN)-templ)+4; + refillpipeline(); + } + else + { + templ=rotate2(opcode); + setsub(GETADDR(RN),templ,GETADDR(RN)-templ); + armregs[RD]=GETADDR(RN)-templ; + } + tubecycles--; + break; + + case 0x26: /*RSB imm*/ + if (RD==15) + { + templ=rotate2(opcode); + armregs[15]=(((templ-GETADDR(RN))+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ=rotate2(opcode); + armregs[RD]=templ-GETADDR(RN); + } + tubecycles--; + break; + case 0x27: /*RSBS imm*/ + if (RD==15) + { + templ=rotate2(opcode); + armregs[15]=(templ-GETADDR(RN))+4; + refillpipeline(); + } + else + { + templ=rotate2(opcode); + setsub(templ,GETADDR(RN),templ-GETADDR(RN)); + armregs[RD]=templ-GETADDR(RN); + } + tubecycles--; + break; + + case 0x28: /*ADD imm*/ + if (RD==15) + { + templ=rotate2(opcode); + armregs[15]=(((GETADDR(RN)+templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ=rotate2(opcode); + armregs[RD]=GETADDR(RN)+templ; + } + tubecycles--; + break; + case 0x29: /*ADDS imm*/ + if (RD==15) + { + templ=rotate2(opcode); + armregs[15]=GETADDR(RN)+templ+4; + refillpipeline(); + } + else + { + templ=rotate2(opcode); + setadd(GETADDR(RN),templ,GETADDR(RN)+templ); + armregs[RD]=GETADDR(RN)+templ; + } + tubecycles--; + break; + + case 0x2A: /*ADC imm*/ + if (RD==15) + { + templ2=CFSET; + templ=rotate2(opcode); + armregs[15]=((GETADDR(RN)+templ+templ2+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ2=CFSET; + templ=rotate2(opcode); + armregs[RD]=GETADDR(RN)+templ+templ2; + } + tubecycles--; + break; + case 0x2B: /*ADCS imm*/ + if (RD==15) + { + templ2=CFSET; + templ=rotate2(opcode); + armregs[15]=GETADDR(RN)+templ+templ2+4; + refillpipeline(); + } + else + { + templ2=CFSET; + templ=rotate2(opcode); + setadc(GETADDR(RN),templ,GETADDR(RN)+templ+templ2); + armregs[RD]=GETADDR(RN)+templ+templ2; + } + tubecycles--; + break; + + case 0x2C: /*SBC imm*/ + templ2=(CFSET)?0:1; + if (RD==15) + { + templ=rotate2(opcode); + armregs[15]=(((GETADDR(RN)-(templ+templ2))+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ=rotate2(opcode); + armregs[RD]=GETADDR(RN)-(templ+templ2); + } + tubecycles--; + break; + case 0x2D: /*SBCS imm*/ + templ2=(CFSET)?0:1; + if (RD==15) + { + templ=rotate2(opcode); + armregs[15]=(GETADDR(RN)-(templ+templ2))+4; + refillpipeline(); + } + else + { + templ=rotate2(opcode); + setsbc(GETADDR(RN),templ,GETADDR(RN)-(templ+templ2)); + armregs[RD]=GETADDR(RN)-(templ+templ2); + } + tubecycles--; + break; + case 0x2E: /*RSC imm*/ + templ2=(CFSET)?0:1; + if (RD==15) + { + templ=rotate2(opcode); + armregs[15]=(((templ-(GETADDR(RN)+templ2))+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ=rotate2(opcode); + armregs[RD]=templ-(GETADDR(RN)+templ2); + } + tubecycles--; + break; + case 0x2F: /*RSCS imm*/ + templ2=(CFSET)?0:1; + if (RD==15) + { + templ=rotate2(opcode); + armregs[15]=(templ-(GETADDR(RN)+templ2))+4; + refillpipeline(); + } + else + { + templ=rotate2(opcode); + setsbc(templ,GETADDR(RN),templ-(GETADDR(RN)+templ2)); +// setsub(templ,GETADDR(RN),templ-(GETADDR(RN)+templ2)); + armregs[RD]=templ-(GETADDR(RN)+templ2); + } + tubecycles--; + break; + + case 0x31: /*TST imm*/ + if (RD==15) + { + if (armregs[15]&3) + { + templ=armregs[15]&0x3FFFFFC; + armregs[15]=((GETADDR(RN)&rotate2(opcode))&0xFC000003)|templ; + } + else + { + templ=armregs[15]&0x0FFFFFFF; + armregs[15]=((GETADDR(RN)&rotate2(opcode))&0xF0000000)|templ; + } + } + else + { + setarmzn(GETADDR(RN)&rotate(opcode)); + } + tubecycles--; + break; + + case 0x33: /*TEQ imm*/ + if (RD==15) + { + opcode&=~0x100000; + if (armregs[15]&3) + { + templ=armregs[15]&0x3FFFFFC; + armregs[15]=((GETADDR(RN)^rotate2(opcode))&0xFC000003)|templ; + } + else + { + templ=armregs[15]&0x0FFFFFFF; + armregs[15]=((GETADDR(RN)^rotate2(opcode))&0xF0000000)|templ; + } + } + else + { + setarmzn(GETADDR(RN)^rotate(opcode)); +// rpclog("TEQ %08X %08X\n",GETADDR(RN),rotate(opcode)); + } + tubecycles--; + break; + + case 0x34: + break; + case 0x35: /*CMP imm*/ + if (RD==15) + { + if (armregs[15]&3) + { + templ=armregs[15]&0x3FFFFFC; + armregs[15]=((GETADDR(RN)-rotate2(opcode))&0xFC000003)|templ; + } + else + { + templ=armregs[15]&0x0FFFFFFF; + armregs[15]=((GETADDR(RN)-rotate2(opcode))&0xF0000000)|templ; + } + } + else + setsub(GETADDR(RN),rotate2(opcode),GETADDR(RN)-rotate2(opcode)); + tubecycles--; + break; + + case 0x37: /*CMN imm*/ + if (RD==15) + { + if (armregs[15]&3) + { + templ=armregs[15]&0x3FFFFFC; + armregs[15]=((GETADDR(RN)+rotate2(opcode))&0xFC000003)|templ; + } + else + { + templ=armregs[15]&0x0FFFFFFF; + armregs[15]=((GETADDR(RN)+rotate2(opcode))&0xF0000000)|templ; + } + } + else + setadd(GETADDR(RN),rotate2(opcode),GETADDR(RN)+rotate2(opcode)); + tubecycles--; + break; + + case 0x38: /*ORR imm*/ + if (RD==15) + { + templ=rotate2(opcode); + armregs[15]=(((GETADDR(RN)|templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ=rotate2(opcode); + armregs[RD]=GETADDR(RN)|templ; + } + tubecycles--; + break; + case 0x39: /*ORRS imm*/ + if (RD==15) + { + templ=rotate2(opcode); + if (armregs[15]&3) + armregs[15]=(GETADDR(RN)|templ)+4; + else + armregs[15]=(((GETADDR(RN)|templ)+4)&0xF3FFFFFC)|(armregs[15]&0xC000003); + refillpipeline(); + } + else + { + templ=rotate(opcode); + armregs[RD]=GETADDR(RN)|templ; + setarmzn(armregs[RD]); + } + tubecycles--; + break; + + case 0x3A: /*MOV imm*/ + if (RD==15) + { + armregs[15]=(armregs[15]&0xFC000003)|((rotate2(opcode)+4)&0x3FFFFFC); + refillpipeline(); + } + else + armregs[RD]=rotate2(opcode); + tubecycles--; + break; + case 0x3B: /*MOVS imm*/ + if (RD==15) + { + armregs[15]=rotate2(opcode)+4; + refillpipeline(); + } + else + { + armregs[RD]=rotate(opcode); + setarmzn(armregs[RD]); + } + tubecycles--; + break; + + case 0x3C: /*BIC imm*/ + if (RD==15) + { + templ=rotate2(opcode); + armregs[15]=(((GETADDR(RN)&~templ)+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + } + else + { + templ=rotate2(opcode); + armregs[RD]=GETADDR(RN)&~templ; + } + tubecycles--; + break; + case 0x3D: /*BICS imm*/ + if (RD==15) + { + templ=rotate2(opcode); + if (armregs[15]&3) armregs[15]=(GETADDR(RN)&~templ)+4; + else armregs[15]=(((GETADDR(RN)&~templ)+4)&0xF3FFFFFC)|(armregs[15]&0xC000003); + refillpipeline(); + } + else + { + templ=rotate(opcode); + armregs[RD]=GETADDR(RN)&~templ; + setarmzn(armregs[RD]); + } + tubecycles--; + break; + + case 0x3E: /*MVN imm*/ + if (RD==15) + { + armregs[15]=(armregs[15]&0xFC000003)|(((~rotate2(opcode))+4)&0x3FFFFFC); + refillpipeline(); + } + else + armregs[RD]=~rotate2(opcode); + tubecycles--; + break; + case 0x3F: /*MVNS imm*/ + if (RD==15) + { + armregs[15]=(~rotate2(opcode))+4; + refillpipeline(); + } + else + { + armregs[RD]=~rotate(opcode); + setarmzn(armregs[RD]); + } + tubecycles--; + break; + + case 0x47: case 0x4F: /*LDRBT*/ + addr=GETADDR(RN); + if (opcode&0x2000000) addr2=shift2(opcode); + else addr2=opcode&0xFFF; + if (!(opcode&0x800000)) addr2=-addr2; + if (opcode&0x1000000) + { + addr+=addr2; + } + templ=memmode; + memmode=0; + templ2=readarmb(addr); + memmode=templ; + if (databort) break; + LOADREG(RD,templ2); + if (!(opcode&0x1000000)) + { + addr+=addr2; + armregs[RN]=addr; + } + else + { + if (opcode&0x200000) armregs[RN]=addr; + } + tubecycles-=4; + break; + + case 0x41: case 0x49: case 0x61: case 0x69: /*LDR Rd,[Rn],offset*/ + addr=GETADDR(RN); + if (opcode&0x2000000) addr2=shift2(opcode); + else addr2=opcode&0xFFF; + templ2=ldrresult(readarml(addr),addr); + if (databort) break; + LOADREG(RD,templ2); + if (opcode&0x800000) armregs[RN]+=addr2; + else armregs[RN]-=addr2; + tubecycles-=4; + break; + case 0x43: case 0x4B: case 0x63: case 0x6B: /*LDRT Rd,[Rn],offset*/ + addr=GETADDR(RN); + if (opcode&0x2000000) addr2=shift2(opcode); + else addr2=opcode&0xFFF; + templ=memmode; memmode=0; + templ2=ldrresult(readarml(addr),addr); + memmode=templ; + if (databort) break; + LOADREG(RD,templ2); + if (opcode&0x800000) armregs[RN]+=addr2; + else armregs[RN]-=addr2; + tubecycles-=4; + break; + + case 0x40: case 0x48: case 0x60: case 0x68: /*STR Rd,[Rn],offset*/ + addr=GETADDR(RN); + if (opcode&0x2000000) addr2=shift2(opcode); + else addr2=opcode&0xFFF; + if (RD==15) { writearml(addr,armregs[RD]+4); } + else { writearml(addr,armregs[RD]); } + if (databort) break; + if (opcode&0x800000) armregs[RN]+=addr2; + else armregs[RN]-=addr2; + tubecycles-=3; + break; + case 0x42: case 0x4A: case 0x62: case 0x6A: /*STRT Rd,[Rn],offset*/ + addr=GETADDR(RN); + if (opcode&0x2000000) addr2=shift2(opcode); + else addr2=opcode&0xFFF; + if (RD==15) { writearml(addr,armregs[RD]+4); } + else { writearml(addr,armregs[RD]); } + templ=memmode; memmode=0; + if (databort) break; + memmode=templ; + if (opcode&0x800000) armregs[RN]+=addr2; + else armregs[RN]-=addr2; + tubecycles-=3; + break; + case 0x50: case 0x58: case 0x70: case 0x78: /*STR Rd,[Rn,offset]*/ + case 0x52: case 0x5A: case 0x72: case 0x7A: /*STR Rd,[Rn,offset]!*/ + if (opcode&0x2000000) addr2=shift2(opcode); + else addr2=opcode&0xFFF; + if (opcode&0x800000) addr=GETADDR(RN)+addr2; + else addr=GETADDR(RN)-addr2; + if (RD==15) { writearml(addr,armregs[RD]+4); } + else { writearml(addr,armregs[RD]); } + if (databort) break; + if (opcode&0x200000) armregs[RN]=addr; + tubecycles-=3; + break; + + case 0x44: case 0x4C: case 0x64: case 0x6C: /*STRB Rd,[Rn],offset*/ + addr=GETADDR(RN); + if (opcode&0x2000000) addr2=shift2(opcode); + else addr2=opcode&0xFFF; + writearmb(addr,armregs[RD]); + if (databort) break; + if (opcode&0x800000) armregs[RN]+=addr2; + else armregs[RN]-=addr2; + tubecycles-=3; + break; + case 0x46: case 0x4E: case 0x66: case 0x6E: /*STRBT Rd,[Rn],offset*/ + addr=GETADDR(RN); + if (opcode&0x2000000) addr2=shift2(opcode); + else addr2=opcode&0xFFF; + writearmb(addr,armregs[RD]); + templ=memmode; + memmode=0; + if (databort) break; + memmode=templ; + if (opcode&0x800000) armregs[RN]+=addr2; + else armregs[RN]-=addr2; + tubecycles-=3; + break; + case 0x54: case 0x5C: case 0x74: case 0x7C: /*STRB Rd,[Rn,offset]*/ + case 0x56: case 0x5E: case 0x76: case 0x7E: /*STRB Rd,[Rn,offset]!*/ + if (opcode&0x2000000) addr2=shift2(opcode); + else addr2=opcode&0xFFF; + if (opcode&0x800000) addr=GETADDR(RN)+addr2; + else addr=GETADDR(RN)-addr2; + writearmb(addr,armregs[RD]); + if (databort) break; + if (opcode&0x200000) armregs[RN]=addr; + tubecycles-=3; + break; + + +// case 0x41: case 0x49: /*LDR*/ + case 0x51: case 0x53: case 0x59: case 0x5B: +// case 0x61: case 0x69: + case 0x71: case 0x73: case 0x79: case 0x7B: + if ((opcode&0x2000010)==0x2000010) + { + undefined(); + break; + } + addr=GETADDR(RN); + if (opcode&0x2000000) addr2=shift2(opcode); + else addr2=opcode&0xFFF; + if (!(opcode&0x800000)) addr2=-addr2; + if (opcode&0x1000000) + { + addr+=addr2; + } + templ=readarml(addr); + templ=ldrresult(templ,addr); + if (databort) break; + if (!(opcode&0x1000000)) + { + addr+=addr2; + armregs[RN]=addr; + } + else + { + if (opcode&0x200000) armregs[RN]=addr; + } + LOADREG(RD,templ); +// if (RD==15) refillpipeline(); + tubecycles-=4; +/* if (RD==7) + { + if (!olog) olog=fopen("armlog.txt","wt"); + srpclog(s,"LDR R7 %08X,%07X\n",armregs[7],PC); + fputs(s,olog); + }*/ + break; + + case 0x65: case 0x6D: + case 0x75: case 0x77: case 0x7D: case 0x7F: + if (opcode&0x10) + { + undefined(); + break; + } + case 0x45: case 0x4D: /*LDRB*/ + case 0x55: case 0x57: case 0x5D: case 0x5F: + addr=GETADDR(RN); + if (opcode&0x2000000) addr2=shift2(opcode); + else addr2=opcode&0xFFF; + if (!(opcode&0x800000)) addr2=-addr2; + if (opcode&0x1000000) + { + addr+=addr2; + } + templ=readarmb(addr); + if (databort) break; + if (!(opcode&0x1000000)) + { + addr+=addr2; + armregs[RN]=addr; + } + else + { + if (opcode&0x200000) armregs[RN]=addr; + } + armregs[RD]=templ; + tubecycles-=4; + break; + +#define STMfirst() mask=1; \ + for (c=0;c<15;c++) \ + { \ + if (opcode&mask) \ + { \ + if (!(addr&0xC)) tubecycles--; \ + if (c==15) { writearml(addr,armregs[c]+4); } \ + else { writearml(addr,armregs[c]); } \ + addr+=4; \ + tubecycles--; \ + break; \ + } \ + mask<<=1; \ + } \ + mask<<=1; c++; + +#define STMall() for (;c<15;c++) \ + { \ + if (opcode&mask) \ + { \ + if (!(addr&0xC)) tubecycles--; \ + writearml(addr,armregs[c]); \ + addr+=4; \ + tubecycles--; \ + } \ + mask<<=1; \ + } \ + if (opcode&0x8000) \ + { \ + if (!(addr&0xC)) tubecycles--; \ + writearml(addr,armregs[15]+4); \ + tubecycles--; \ + } + +#define STMfirstS() mask=1; \ + for (c=0;c<15;c++) \ + { \ + if (opcode&mask) \ + { \ + if (!(addr&0xC)) tubecycles--; \ + if (c==15) { writearml(addr,armregs[c]+4); } \ + else { writearml(addr,*usrregs[c]); } \ + addr+=4; \ + tubecycles--; \ + break; \ + } \ + mask<<=1; \ + } \ + mask<<=1; c++; + +#define STMallS() for (;c<15;c++) \ + { \ + if (opcode&mask) \ + { \ + if (!(addr&0xC)) tubecycles--; \ + writearml(addr,*usrregs[c]); \ + addr+=4; \ + tubecycles--; \ + } \ + mask<<=1; \ + } \ + if (opcode&0x8000) \ + { \ + if (!(addr&0xC)) tubecycles--; \ + writearml(addr,armregs[15]+4); \ + tubecycles--; \ + } + +#define LDMall() mask=1; \ + for (c=0;c<15;c++) \ + { \ + if (opcode&mask) \ + { \ + if (!(addr&0xC)) tubecycles--; \ + templ=readarml(addr); if (!databort) armregs[c]=templ; \ + addr+=4; \ + tubecycles--; \ + } \ + mask<<=1; \ + } \ + if (opcode&0x8000) \ + { \ + if (!(addr&0xC)) tubecycles--; \ + templ=readarml(addr); \ + if (!databort) armregs[15]=(armregs[15]&0xFC000003)|((templ+4)&0x3FFFFFC); \ + tubecycles--; \ + refillpipeline(); \ + } + +#define LDMallS() mask=1; \ + if (opcode&0x8000) \ + { \ + for (c=0;c<15;c++) \ + { \ + if (opcode&mask) \ + { \ + if (!(addr&0xC)) tubecycles--; \ + templ=readarml(addr); if (!databort) armregs[c]=templ; \ + addr+=4; \ + tubecycles--; \ + } \ + mask<<=1; \ + } \ + if (!(addr&0xC)) tubecycles--; \ + templ=readarml(addr); \ + if (!databort) \ + { \ + if (armregs[15]&3) armregs[15]=(templ+4); \ + else armregs[15]=(armregs[15]&0x0C000003)|((templ+4)&0xF3FFFFFC); \ + } \ + tubecycles--; \ + refillpipeline(); \ + } \ + else \ + { \ + for (c=0;c<15;c++) \ + { \ + if (opcode&mask) \ + { \ + if (!(addr&0xC)) tubecycles--; \ + templ=readarml(addr); if (!databort) *usrregs[c]=templ; \ + addr+=4; \ + tubecycles--; \ + } \ + mask<<=1; \ + } \ + } + + case 0x80: /*STMDA*/ + case 0x82: /*STMDA !*/ + case 0x90: /*STMDB*/ + case 0x92: /*STMDB !*/ + addr=armregs[RN]-countbits(opcode&0xFFFF); + if (!(opcode&0x1000000)) addr+=4; + STMfirst(); + if (opcode&0x200000) armregs[RN]-=countbits(opcode&0xFFFF); + STMall() + tubecycles--; + break; + case 0x88: /*STMIA*/ + case 0x8A: /*STMIA !*/ + case 0x98: /*STMIB*/ + case 0x9A: /*STMIB !*/ + addr=armregs[RN]; + if (opcode&0x1000000) addr+=4; + STMfirst(); + if (opcode&0x200000) armregs[RN]+=countbits(opcode&0xFFFF); + STMall(); + tubecycles--; + break; + case 0x84: /*STMDA ^*/ + case 0x86: /*STMDA ^!*/ + case 0x94: /*STMDB ^*/ + case 0x96: /*STMDB ^!*/ + addr=armregs[RN]-countbits(opcode&0xFFFF); + if (!(opcode&0x1000000)) addr+=4; + STMfirstS(); + if (opcode&0x200000) armregs[RN]-=countbits(opcode&0xFFFF); + STMallS() + tubecycles--; + break; + case 0x8C: /*STMIA ^*/ + case 0x8E: /*STMIA ^!*/ + case 0x9C: /*STMIB ^*/ + case 0x9E: /*STMIB ^!*/ + addr=armregs[RN]; + if (opcode&0x1000000) addr+=4; + STMfirstS(); + if (opcode&0x200000) armregs[RN]+=countbits(opcode&0xFFFF); + STMallS(); + tubecycles--; + break; + + case 0x81: /*LDMDA*/ + case 0x83: /*LDMDA !*/ + case 0x91: /*LDMDB*/ + case 0x93: /*LDMDB !*/ + addr=armregs[RN]-countbits(opcode&0xFFFF); +// rpclog("LDMDB %08X\n",addr); + if (!(opcode&0x1000000)) addr+=4; + if (opcode&0x200000) armregs[RN]-=countbits(opcode&0xFFFF); + LDMall(); + tubecycles-=2; + break; + case 0x89: /*LDMIA*/ + case 0x8B: /*LDMIA !*/ + case 0x99: /*LDMIB*/ + case 0x9B: /*LDMIB !*/ + addr=armregs[RN]; + if (opcode&0x1000000) addr+=4; + if (opcode&0x200000) armregs[RN]+=countbits(opcode&0xFFFF); + LDMall(); + tubecycles-=2; + break; + case 0x85: /*LDMDA ^*/ + case 0x87: /*LDMDA ^!*/ + case 0x95: /*LDMDB ^*/ + case 0x97: /*LDMDB ^!*/ + addr=armregs[RN]-countbits(opcode&0xFFFF); + if (!(opcode&0x1000000)) addr+=4; + if (opcode&0x200000) armregs[RN]-=countbits(opcode&0xFFFF); + LDMallS(); + tubecycles-=2; + break; + case 0x8D: /*LDMIA ^*/ + case 0x8F: /*LDMIA ^!*/ + case 0x9D: /*LDMIB ^*/ + case 0x9F: /*LDMIB ^!*/ + addr=armregs[RN]; + if (opcode&0x1000000) addr+=4; + if (opcode&0x200000) armregs[RN]+=countbits(opcode&0xFFFF); + LDMallS(); + tubecycles-=2; + break; + + case 0xB0: case 0xB1: case 0xB2: case 0xB3: /*BL*/ + case 0xB4: case 0xB5: case 0xB6: case 0xB7: + case 0xB8: case 0xB9: case 0xBA: case 0xBB: + case 0xBC: case 0xBD: case 0xBE: case 0xBF: + templ=(opcode&0xFFFFFF)<<2; + armregs[14]=armregs[15]-4; + armregs[15]=((armregs[15]+templ+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + tubecycles-=4; + break; + + case 0xA0: case 0xA1: case 0xA2: case 0xA3: /*B*/ + case 0xA4: case 0xA5: case 0xA6: case 0xA7: + case 0xA8: case 0xA9: case 0xAA: case 0xAB: + case 0xAC: case 0xAD: case 0xAE: case 0xAF: + templ=(opcode&0xFFFFFF)<<2; + armregs[15]=((armregs[15]+templ+4)&0x3FFFFFC)|(armregs[15]&0xFC000003); + refillpipeline(); + tubecycles-=4; + break; + + case 0xE0: case 0xE2: case 0xE4: case 0xE6: /*MCR*/ + case 0xE8: case 0xEA: case 0xEC: case 0xEE: + templ=armregs[15]-4; + armregs[15]|=3; + updatemode(SUPERVISOR); + armregs[14]=templ; + armregs[15]&=0xFC000003; + armregs[15]|=0x08000008; + tubecycles-=4; + refillpipeline(); + break; + + case 0xE1: case 0xE3: case 0xE5: case 0xE7: /*MRC*/ + case 0xE9: case 0xEB: case 0xED: case 0xEF: + templ=armregs[15]-4; + armregs[15]|=3; + updatemode(SUPERVISOR); + armregs[14]=templ; + armregs[15]&=0xFC000003; + armregs[15]|=0x08000008; + tubecycles-=4; + refillpipeline(); + break; + + case 0xC0: case 0xC1: case 0xC2: case 0xC3: /*Co-pro*/ + case 0xC4: case 0xC5: case 0xC6: case 0xC7: + case 0xC8: case 0xC9: case 0xCA: case 0xCB: + case 0xCC: case 0xCD: case 0xCE: case 0xCF: + case 0xD0: case 0xD1: case 0xD2: case 0xD3: + case 0xD4: case 0xD5: case 0xD6: case 0xD7: + case 0xD8: case 0xD9: case 0xDA: case 0xDB: + case 0xDC: case 0xDD: case 0xDE: case 0xDF: + templ=armregs[15]-4; + armregs[15]|=3; + updatemode(SUPERVISOR); + armregs[14]=templ; + armregs[15]&=0xFC000003; + armregs[15]|=0x08000008; + tubecycles-=4; + refillpipeline(); + break; + + case 0xF0: case 0xF1: case 0xF2: case 0xF3: /*SWI*/ + case 0xF4: case 0xF5: case 0xF6: case 0xF7: + case 0xF8: case 0xF9: case 0xFA: case 0xFB: + case 0xFC: case 0xFD: case 0xFE: case 0xFF: + templ=armregs[15]-4; + armregs[15]|=3; + updatemode(SUPERVISOR); + armregs[14]=templ; + armregs[15]&=0xFC000003; + armregs[15]|=0x0800000C; + tubecycles-=4; + refillpipeline(); + break; + + default: + break; + } + } + if (databort|armirq|tube_irq) + { + if (databort==1) /*Data abort*/ + { + templ=armregs[15]; + armregs[15]|=3; + updatemode(SUPERVISOR); + armregs[14]=templ; + armregs[15]&=0xFC000003; + armregs[15]|=0x08000014; + refillpipeline(); + databort=0; + } + else if (databort==2) /*Address Exception*/ + { + templ=armregs[15]; + armregs[15]|=3; + updatemode(SUPERVISOR); + armregs[14]=templ; + armregs[15]&=0xFC000003; + armregs[15]|=0x08000018; + refillpipeline(); + databort=0; + } + else if ((armirq&2) && !(armregs[15]&0x4000000)) /*FIQ*/ + { + templ=armregs[15]; + armregs[15]|=3; + updatemode(FIQ); + armregs[14]=templ; + armregs[15]&=0xFC000001; + armregs[15]|=0x0C000020; + refillpipeline(); +// rpclog("FIQ\n"); + } + else if ((armirq&1) && !(armregs[15]&0x8000000)) /*IRQ*/ + { + templ=armregs[15]; + armregs[15]|=3; + updatemode(IRQ); + armregs[14]=templ; + armregs[15]&=0xFC000002; + armregs[15]|=0x0800001C; + refillpipeline(); +// rpclog("IRQ\n"); + } + } +// if (armregs[12]==0x1000000) rpclog("R12=1000000 %08X %i\n",PC,armins); + armirq=tube_irq; + if ((armregs[15]&3)!=mode) updatemode(armregs[15]&3); + armregs[15]+=4; +// rpclog("%08X : %08X %08X %08X %08X\n",PC,armregs[0],armregs[1],armregs[2],opcode); +/* if (!PC) + { + rpclog("Branch through zero\n"); + dumpregs(); + exit(-1); + }*/ + if (endtimeslice) + { + endtimeslice=0; + return; + } +// if (output && !(*armregs[15]&0x8000000) && PC<0x2000000) rpclog("%07X : %08X %08X %08X %08X %08X %08X %08X %08X\n%08i: %08X %08X %08X %08X %08X %08X %08X %08X\n",PC,*armregs[0],*armregs[1],*armregs[2],*armregs[3],*armregs[4],*armregs[5],*armregs[6],*armregs[7],inscount,*armregs[8],*armregs[9],*armregs[10],*armregs[11],*armregs[12],*armregs[13],*armregs[14],*armregs[15]); + } +} diff --git a/src/arm.h b/src/arm.h index 949a601c..cd68806a 100644 --- a/src/arm.h +++ b/src/arm.h @@ -1,13 +1,13 @@ -/*ARM*/ -//uint32_t *usrregs[16],userregs[16],superregs[16],fiqregs[16],irqregs[16]; -//uint32_t armregs[16]; -//int armirq,armfiq; -//#define PC ((armregs[15])&0x3FFFFFC) - -//void dumparmregs(); -//int databort; - -void arm_init(); -void arm_reset(); -void arm_exec(); -void arm_close(); +/*ARM*/ +//uint32_t *usrregs[16],userregs[16],superregs[16],fiqregs[16],irqregs[16]; +//uint32_t armregs[16]; +//int armirq,armfiq; +//#define PC ((armregs[15])&0x3FFFFFC) + +//void dumparmregs(); +//int databort; + +void arm_init(); +void arm_reset(); +void arm_exec(); +void arm_close(); diff --git a/src/b-em.h b/src/b-em.h index a102492b..a6f2c4d3 100644 --- a/src/b-em.h +++ b/src/b-em.h @@ -1,51 +1,49 @@ -/*B-em v2.2 by Tom Walker - Main header file*/ - -#include -#include -#include -#include - -#ifdef _MSC_VER - -#define inline __inline - -#define strcasecmp _stricmp -#define strncasecmp _strnicmp - -#endif - -//#define printf rpclog - -#define B_EM_VERSION "B-em v2.2" - -void updatewindowsize(int x, int y); - -void setejecttext(int drive, char *fn); - -void rpclog(const char *format, ...); - -extern char exedir[512]; - -extern int joybutton[2]; - -void waitforready(); -void resumeready(); - -void setquit(); - -void startblit(); -void endblit(); - -extern int autoboot; - -void cataddname(char *s); -void showcatalogue(); - -void redefinekeys(); - -void bem_error(char *s); - -void changetimerspeed(int i); - -extern int mousecapture; +/*B-em v2.2 by Tom Walker + Main header file*/ + +#include +#include +#include +#include + +#ifdef _MSC_VER + +#define inline __inline + +#define strcasecmp _stricmp +#define strncasecmp _strnicmp + +#endif + +//#define printf rpclog + +void updatewindowsize(int x, int y); + +void setejecttext(int drive, char *fn); + +void rpclog(const char *format, ...); + +extern char exedir[512]; + +extern int joybutton[2]; + +void waitforready(); +void resumeready(); + +void setquit(); + +void startblit(); +void endblit(); + +extern int autoboot; + +void cataddname(char *s); +void showcatalogue(); + +void redefinekeys(); + +void bem_error(char *s); + +void changetimerspeed(int i); + +extern int mousecapture; diff --git a/src/b-em.rc b/src/b-em.rc index 4b9f0014..20c96248 100644 --- a/src/b-em.rc +++ b/src/b-em.rc @@ -1,511 +1,511 @@ -#include -//#include -#include "resources.h" - -#define KEY_A 1 -#define KEY_B 2 -#define KEY_C 3 -#define KEY_D 4 -#define KEY_E 5 -#define KEY_F 6 -#define KEY_G 7 -#define KEY_H 8 -#define KEY_I 9 -#define KEY_J 10 -#define KEY_K 11 -#define KEY_L 12 -#define KEY_M 13 -#define KEY_N 14 -#define KEY_O 15 -#define KEY_P 16 -#define KEY_Q 17 -#define KEY_R 18 -#define KEY_S 19 -#define KEY_T 20 -#define KEY_U 21 -#define KEY_V 22 -#define KEY_W 23 -#define KEY_X 24 -#define KEY_Y 25 -#define KEY_Z 26 -#define KEY_0 27 -#define KEY_1 28 -#define KEY_2 29 -#define KEY_3 30 -#define KEY_4 31 -#define KEY_5 32 -#define KEY_6 33 -#define KEY_7 34 -#define KEY_8 35 -#define KEY_9 36 -#define KEY_0_PAD 37 -#define KEY_1_PAD 38 -#define KEY_2_PAD 39 -#define KEY_3_PAD 40 -#define KEY_4_PAD 41 -#define KEY_5_PAD 42 -#define KEY_6_PAD 43 -#define KEY_7_PAD 44 -#define KEY_8_PAD 45 -#define KEY_9_PAD 46 -#define KEY_F1 47 -#define KEY_F2 48 -#define KEY_F3 49 -#define KEY_F4 50 -#define KEY_F5 51 -#define KEY_F6 52 -#define KEY_F7 53 -#define KEY_F8 54 -#define KEY_F9 55 -#define KEY_F10 56 -#define KEY_F11 57 -#define KEY_F12 58 -#define KEY_ESC 59 -#define KEY_TILDE 60 -#define KEY_MINUS 61 -#define KEY_EQUALS 62 -#define KEY_BACKSPACE 63 -#define KEY_TAB 64 -#define KEY_OPENBRACE 65 -#define KEY_CLOSEBRACE 66 -#define KEY_ENTER 67 -#define KEY_COLON 68 -#define KEY_QUOTE 69 -#define KEY_BACKSLASH 70 -#define KEY_BACKSLASH2 71 -#define KEY_COMMA 72 -#define KEY_STOP 73 -#define KEY_SLASH 74 -#define KEY_SPACE 75 -#define KEY_INSERT 76 -#define KEY_DEL 77 -#define KEY_HOME 78 -#define KEY_END 79 -#define KEY_PGUP 80 -#define KEY_PGDN 81 -#define KEY_LEFT 82 -#define KEY_RIGHT 83 -#define KEY_UP 84 -#define KEY_DOWN 85 -#define KEY_SLASH_PAD 86 -#define KEY_ASTERISK 87 -#define KEY_MINUS_PAD 88 -#define KEY_PLUS_PAD 89 -#define KEY_DEL_PAD 90 -#define KEY_ENTER_PAD 91 -#define KEY_COLON2 101 -#define KEY_EQUALS_PAD 103 -#define KEY_BACKQUOTE 104 -#define KEY_SEMICOLON 105 - -#define KEY_LSHIFT 115 -#define KEY_RSHIFT 116 -#define KEY_LCONTROL 117 -#define KEY_RCONTROL 118 -#define KEY_ALT 119 -#define KEY_ALTGR 120 -#define KEY_LWIN 121 -#define KEY_RWIN 122 -#define KEY_MENU 123 -#define KEY_SCRLOCK 124 -#define KEY_NUMLOCK 125 -#define KEY_CAPSLOCK 126 - -allegro_icon ICON "b-em.ico" - -MainMenu MENU DISCARDABLE -BEGIN - POPUP "&File" - BEGIN - MENUITEM "&Hard Reset", IDM_FILE_RESET - MENUITEM SEPARATOR - MENUITEM "&Load state", IDM_FILE_LSTATE - MENUITEM "&Save state", IDM_FILE_SSTATE - MENUITEM SEPARATOR - MENUITEM "E&xit", IDM_FILE_EXIT - END - POPUP "&Disc" - BEGIN - MENUITEM "&Autoboot disc :0/2...", IDM_DISC_AUTOBOOT - MENUITEM SEPARATOR - MENUITEM "Load disc :&0/2...", IDM_DISC_LOAD_0 - MENUITEM "Load disc :&1/3...", IDM_DISC_LOAD_1 - MENUITEM SEPARATOR - MENUITEM "Eject disc :0/2", IDM_DISC_EJECT_0 - MENUITEM "Eject disc :1/3", IDM_DISC_EJECT_1 - MENUITEM SEPARATOR - MENUITEM "New disc :0/2", IDM_DISC_NEW_0 - MENUITEM "New disc :1/3", IDM_DISC_NEW_1 - MENUITEM SEPARATOR - MENUITEM "Write protect disc :0/2",IDM_DISC_WPROT_0 - MENUITEM "Write protect disc :1/3",IDM_DISC_WPROT_1 - MENUITEM SEPARATOR - MENUITEM "Default write protect", IDM_DISC_WPROT_D - END - POPUP "&Tape" - BEGIN - MENUITEM "&Load tape...", IDM_TAPE_LOAD - MENUITEM SEPARATOR - MENUITEM "&Eject tape", IDM_TAPE_EJECT - MENUITEM SEPARATOR - MENUITEM "&Rewind tape", IDM_TAPE_REWIND - MENUITEM "Show tape &catalogue", IDM_TAPE_CAT - POPUP "&Tape speed" - BEGIN - MENUITEM "Normal", IDM_TAPES_NORMAL - MENUITEM "Fast", IDM_TAPES_FAST - END - END - POPUP "&Settings" - BEGIN - POPUP "&Model" - BEGIN - MENUITEM "BBC A w/OS 0.1", IDM_MODEL_0 - MENUITEM "BBC B w/OS 0.1", IDM_MODEL_0+1 - MENUITEM "BBC A", IDM_MODEL_0+2 - MENUITEM "BBC B w/8271 FDC", IDM_MODEL_0+3 - MENUITEM "BBC B w/8271+SWRAM", IDM_MODEL_0+4 - MENUITEM "BBC B w/1770 FDC", IDM_MODEL_0+5 - MENUITEM "BBC B US", IDM_MODEL_0+6 - MENUITEM "BBC B German", IDM_MODEL_0+7 - MENUITEM "BBC B+ 64K", IDM_MODEL_0+8 - MENUITEM "BBC B+ 128K", IDM_MODEL_0+9 - MENUITEM "BBC Master 128", IDM_MODEL_0+10 - MENUITEM "BBC Master 128 w/MOS 3.5", IDM_MODEL_0+15 - MENUITEM "BBC Master 512", IDM_MODEL_0+11 - MENUITEM "BBC Master Turbo", IDM_MODEL_0+12 - MENUITEM "BBC Master Compact", IDM_MODEL_0+13 - MENUITEM "ARM Evaluation System", IDM_MODEL_0+14 - END - POPUP "&Second Processor" - BEGIN - MENUITEM "None", IDM_TUBE_NONE - MENUITEM "6502", IDM_TUBE_6502 - MENUITEM "65816",IDM_TUBE_65816 - MENUITEM "Z80", IDM_TUBE_Z80 -#ifdef NS32016 - MENUITEM "32016",IDM_TUBE_32016 -#endif - MENUITEM SEPARATOR - POPUP "6502 Tube speed" - BEGIN - MENUITEM "&4mhz", IDM_TUBES_4 - MENUITEM "&8mhz", IDM_TUBES_8 - MENUITEM "&16mhz", IDM_TUBES_16 - MENUITEM "&32mhz", IDM_TUBES_32 - MENUITEM "&64mhz", IDM_TUBES_64 - END - END - POPUP "&Video" - BEGIN - POPUP "&Display type" - BEGIN - MENUITEM "&Software line doubling", IDM_VIDEO_SLINEDBL - MENUITEM "&Hardware line doubling", IDM_VIDEO_LINEDBL - MENUITEM "S&canlines", IDM_VIDEO_SCANLINES - MENUITEM "&Interlaced", IDM_VIDEO_INTERLACED - MENUITEM "&PAL", IDM_VIDEO_PAL - MENUITEM "P&AL Interlaced", IDM_VIDEO_PALI - END - POPUP "&Borders" - BEGIN - MENUITEM "&None", IDM_VIDEO_NOBORDERS - MENUITEM "&Small", IDM_VIDEO_MBORDERS - MENUITEM "&Full", IDM_VIDEO_FBORDERS - END - MENUITEM "Fullscreen", IDM_VIDEO_FULLSCR - MENUITEM "Resizeable window", IDM_VIDEO_RESIZE - END - POPUP "&Sound" - BEGIN - MENUITEM "&Internal sound chip", IDM_SOUND_INTERNAL - MENUITEM "&BeebSID", IDM_SOUND_BEEBSID - MENUITEM "&Printer port DAC", IDM_SOUND_DAC - MENUITEM "&Disc drive noise", IDM_SOUND_DDNOISE - MENUITEM "&Tape noise", IDM_SOUND_TAPE - MENUITEM SEPARATOR - MENUITEM "Internal sound &filter", IDM_SOUND_FILTER - POPUP "Internal sound &waveform" - BEGIN - MENUITEM "Square", IDM_WAVE_SQUARE - MENUITEM "Saw", IDM_WAVE_SAW - MENUITEM "Sine", IDM_WAVE_SINE - MENUITEM "Triangle", IDM_WAVE_TRI - MENUITEM "SID", IDM_WAVE_SID - END - MENUITEM SEPARATOR - POPUP "&reSID configuration" - BEGIN - POPUP "&Model" - BEGIN - MENUITEM "6581", IDM_SID_TYPE+SID_MODEL_6581 - MENUITEM "8580", IDM_SID_TYPE+SID_MODEL_8580 - MENUITEM "8580 + digi boost", IDM_SID_TYPE+SID_MODEL_8580D - MENUITEM "6581R4", IDM_SID_TYPE+SID_MODEL_6581R4 - MENUITEM "6581R3 4885", IDM_SID_TYPE+SID_MODEL_6581R3_4885 - MENUITEM "6581R3 0486S", IDM_SID_TYPE+SID_MODEL_6581R3_0486S - MENUITEM "6581R3 3984", IDM_SID_TYPE+SID_MODEL_6581R3_3984 - MENUITEM "6581R4AR 3789", IDM_SID_TYPE+SID_MODEL_6581R4AR_3789 - MENUITEM "6581R3 4485", IDM_SID_TYPE+SID_MODEL_6581R3_4485 - MENUITEM "6581R4 1986S", IDM_SID_TYPE+SID_MODEL_6581R4_1986S - MENUITEM "8580R5 3691", IDM_SID_TYPE+SID_MODEL_8580R5_3691 - MENUITEM "8580R5 3691 + digi boost", IDM_SID_TYPE+SID_MODEL_8580R5_3691D - MENUITEM "8580R5 1489", IDM_SID_TYPE+SID_MODEL_8580R5_1489 - MENUITEM "8580R5 1489 + digi boost", IDM_SID_TYPE+SID_MODEL_8580R5_1489D - END - POPUP "&Sample method" - BEGIN - MENUITEM "&Interpolating", IDM_SID_INTERP - MENUITEM "&Resampling", IDM_SID_RESAMP - END - END - MENUITEM SEPARATOR - POPUP "Disc drive &type" - BEGIN - MENUITEM "&5.25",IDM_DDT_525 - MENUITEM "&3.5", IDM_DDT_35 - END - POPUP "Disc drive &volume" - BEGIN - MENUITEM "&33%", IDM_DDV_33 - MENUITEM "&66%", IDM_DDV_66 - MENUITEM "&100%", IDM_DDV_100 - END - END - POPUP "&Keyboard" - BEGIN - MENUITEM "&Redefine keys...", IDM_KEY_REDEFINE - MENUITEM SEPARATOR - MENUITEM "&Map CAPS/CTRL to A/S", IDM_KEY_AS - END - POPUP "&Mouse" - BEGIN - MENUITEM "&AMX Mouse", IDM_MOUSE_AMX - END - POPUP "&IDE" - BEGIN - MENUITEM "&Enable IDE hard discs", IDM_IDE_ENABLE - END - END - POPUP "&Misc" - BEGIN - POPUP "&Speed" - BEGIN - MENUITEM "10%", IDM_SPD_10 - MENUITEM "25%", IDM_SPD_25 - MENUITEM "50%", IDM_SPD_50 - MENUITEM "75%", IDM_SPD_75 - MENUITEM "100%", IDM_SPD_100 - MENUITEM "150%", IDM_SPD_150 - MENUITEM "200%", IDM_SPD_200 - MENUITEM "300%", IDM_SPD_300 - MENUITEM "400%", IDM_SPD_400 - MENUITEM "500%", IDM_SPD_500 - END - MENUITEM "&Save screenshot",IDM_SCRSHOT - MENUITEM SEPARATOR - MENUITEM "&Debugger", IDM_DEBUGGER - MENUITEM "&Break", IDM_BREAK - END -END - -Redefine DIALOG 20, 20, 292, 132 -STYLE WS_CAPTION | WS_THICKFRAME -CAPTION "Redefine keys" -FONT 7, "MS Sans Serif" -BEGIN - PUSHBUTTON "ESC", Button1+KEY_ESC, 16, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "1", Button1+KEY_1, 32, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "2", Button1+KEY_2, 48, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "3", Button1+KEY_3, 64, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "4", Button1+KEY_4, 80, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "5", Button1+KEY_5, 96, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "6", Button1+KEY_6, 112, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "7", Button1+KEY_7, 128, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "8", Button1+KEY_8, 144, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "9", Button1+KEY_9, 160, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "0", Button1+KEY_0, 176, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "=", Button1+KEY_MINUS, 192, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "^", Button1+KEY_EQUALS, 208, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "\\", Button1+KEY_BACKSLASH2, 224, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "LFT", Button1+KEY_LEFT, 240, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "RGT", Button1+KEY_RIGHT, 256, 24, 18, 15 , WS_TABSTOP - PUSHBUTTON "TAB", Button1+KEY_TAB, 16, 40, 24, 15 , WS_TABSTOP - PUSHBUTTON "Q", Button1+KEY_Q, 40, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "W", Button1+KEY_W, 56, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "E", Button1+KEY_E, 72, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "R", Button1+KEY_R, 88, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "T", Button1+KEY_T, 104, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "Y", Button1+KEY_Y, 120, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "U", Button1+KEY_U, 136, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "I", Button1+KEY_I, 152, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "O", Button1+KEY_O, 168, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "P", Button1+KEY_P, 184, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "@", Button1+KEY_OPENBRACE, 200, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "[", Button1+KEY_CLOSEBRACE, 216, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "_", Button1+KEY_TILDE, 232, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "UP", Button1+KEY_UP, 248, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "DWN", Button1+KEY_DOWN, 264, 40, 18, 15 , WS_TABSTOP - PUSHBUTTON "CLK", Button1+KEY_CAPSLOCK, 12, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "CTL", Button1+KEY_CAPSLOCK, 28, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "A", Button1+KEY_A, 44, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "S", Button1+KEY_S, 60, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "D", Button1+KEY_D, 76, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "F", Button1+KEY_F, 92, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "G", Button1+KEY_G, 108, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "H", Button1+KEY_H, 124, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "J", Button1+KEY_J, 140, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "K", Button1+KEY_K, 156, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "L", Button1+KEY_L, 172, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON ";", Button1+KEY_SEMICOLON, 188, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON ":", Button1+KEY_QUOTE, 204, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "]", Button1+KEY_BACKSLASH, 220, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "RET", Button1+KEY_ENTER, 236, 56, 32, 15 , WS_TABSTOP - PUSHBUTTON "SLK", Button1+KEY_ALT, 12, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "SHIFT", Button1+KEY_LSHIFT, 28, 72, 24, 15 , WS_TABSTOP - PUSHBUTTON "Z", Button1+KEY_Z, 52, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "X", Button1+KEY_X, 68, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "C", Button1+KEY_C, 84, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "V", Button1+KEY_V, 100, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "B", Button1+KEY_B, 116, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "N", Button1+KEY_N, 132, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "M", Button1+KEY_M, 148, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON ",", Button1+KEY_COMMA, 164, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON ".", Button1+KEY_STOP, 180, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "/", Button1+KEY_SLASH, 196, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "SHIFT", Button1+KEY_RSHIFT, 212, 72, 24, 15 , WS_TABSTOP - PUSHBUTTON "DEL", Button1+KEY_DEL, 236, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "CPY", Button1+KEY_END, 252, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "SPACE", Button1+KEY_SPACE, 68, 88, 128, 15 , WS_TABSTOP - PUSHBUTTON "F0", Button1+KEY_F1, 52, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "F1", Button1+KEY_F2, 68, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "F2", Button1+KEY_F3, 84, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "F3", Button1+KEY_F4, 100, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "F4", Button1+KEY_F5, 116, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "F5", Button1+KEY_F6, 132, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "F6", Button1+KEY_F7, 148, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "F7", Button1+KEY_F8, 164, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "F8", Button1+KEY_F9, 180, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "F9", Button1+KEY_F10, 196, 8, 16, 15 , WS_TABSTOP - - PUSHBUTTON "OK", IDOK, 96, 112, 32, 16, WS_TABSTOP - PUSHBUTTON "Cancel", IDCANCEL, 136, 112, 32, 16, WS_TABSTOP -END - -KeyDlg DIALOG 20,20,100,60 -STYLE WS_CAPTION | WS_THICKFRAME -CAPTION "Press key to define" -FONT 7, "MS Sans Serif" -BEGIN - PUSHBUTTON "Cancel", IDCANCEL, 64, 40, 32, 16, WS_TABSTOP -END - -RedefineM DIALOG 20, 20, 360, 132 -STYLE WS_CAPTION | WS_THICKFRAME -CAPTION "Redefine keys" -FONT 7, "MS Sans Serif" -BEGIN - PUSHBUTTON "ESC", Button1+KEY_ESC, 16, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "1", Button1+KEY_1, 32, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "2", Button1+KEY_2, 48, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "3", Button1+KEY_3, 64, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "4", Button1+KEY_4, 80, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "5", Button1+KEY_5, 96, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "6", Button1+KEY_6, 112, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "7", Button1+KEY_7, 128, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "8", Button1+KEY_8, 144, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "9", Button1+KEY_9, 160, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "0", Button1+KEY_0, 176, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "=", Button1+KEY_MINUS, 192, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "^", Button1+KEY_EQUALS, 208, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "\\", Button1+KEY_BACKSLASH2, 224, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "LFT", Button1+KEY_LEFT, 240, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "RGT", Button1+KEY_RIGHT, 256, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "TAB", Button1+KEY_TAB, 16, 40, 24, 15 , WS_TABSTOP - PUSHBUTTON "Q", Button1+KEY_Q, 40, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "W", Button1+KEY_W, 56, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "E", Button1+KEY_E, 72, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "R", Button1+KEY_R, 88, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "T", Button1+KEY_T, 104, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "Y", Button1+KEY_Y, 120, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "U", Button1+KEY_U, 136, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "I", Button1+KEY_I, 152, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "O", Button1+KEY_O, 168, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "P", Button1+KEY_P, 184, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "@", Button1+KEY_OPENBRACE, 200, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "[", Button1+KEY_CLOSEBRACE, 216, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "_", Button1+KEY_TILDE, 232, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "UP", Button1+KEY_UP, 248, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "DWN", Button1+KEY_DOWN, 248, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "CAPS", Button1+KEY_CAPSLOCK, 12, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "CTRL", Button1+KEY_CAPSLOCK, 28, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "A", Button1+KEY_A, 44, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "S", Button1+KEY_S, 60, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "D", Button1+KEY_D, 76, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "F", Button1+KEY_F, 92, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "G", Button1+KEY_G, 108, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "H", Button1+KEY_H, 124, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "J", Button1+KEY_J, 140, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "K", Button1+KEY_K, 156, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "L", Button1+KEY_L, 172, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON ";", Button1+KEY_SEMICOLON, 188, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON ":", Button1+KEY_QUOTE, 204, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "]", Button1+KEY_BACKSLASH, 220, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "RET", Button1+KEY_ENTER, 236, 56, 32, 15 , WS_TABSTOP - PUSHBUTTON "SHLK", Button1+KEY_ALT, 12, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "SHIFT", Button1+KEY_LSHIFT, 28, 72, 24, 15 , WS_TABSTOP - PUSHBUTTON "Z", Button1+KEY_Z, 52, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "X", Button1+KEY_X, 68, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "C", Button1+KEY_C, 84, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "V", Button1+KEY_V, 100, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "B", Button1+KEY_B, 116, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "N", Button1+KEY_N, 132, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "M", Button1+KEY_M, 148, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON ",", Button1+KEY_COMMA, 164, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON ".", Button1+KEY_STOP, 180, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "/", Button1+KEY_SLASH, 196, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "SHIFT", Button1+KEY_RSHIFT, 212, 72, 24, 15 , WS_TABSTOP - PUSHBUTTON "DEL", Button1+KEY_DEL, 236, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "COPY", Button1+KEY_END, 252, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "SPACE", Button1+KEY_SPACE, 68, 88, 128, 15 , WS_TABSTOP - PUSHBUTTON "F0", Button1+KEY_F1, 40, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "F1", Button1+KEY_F2, 56, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "F2", Button1+KEY_F3, 72, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "F3", Button1+KEY_F4, 88, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "F4", Button1+KEY_F5, 104, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "F5", Button1+KEY_F6, 120, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "F6", Button1+KEY_F7, 136, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "F7", Button1+KEY_F8, 152, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "F8", Button1+KEY_F9, 168, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "F9", Button1+KEY_F10, 184, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "0", Button1+KEY_0_PAD, 284, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON ".", Button1+KEY_PGDN, 300, 72, 16, 15 , WS_TABSTOP - PUSHBUTTON "RET", Button1+KEY_ENTER_PAD, 316, 72, 32, 15 , WS_TABSTOP - PUSHBUTTON "1", Button1+KEY_1_PAD, 284, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "2", Button1+KEY_2_PAD, 300, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "3", Button1+KEY_3_PAD, 316, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON ",", Button1+KEY_HOME, 332, 56, 16, 15 , WS_TABSTOP - PUSHBUTTON "4", Button1+KEY_4_PAD, 284, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "5", Button1+KEY_5_PAD, 300, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "6", Button1+KEY_6_PAD, 316, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "DEL", Button1+KEY_DEL_PAD, 332, 40, 16, 15 , WS_TABSTOP - PUSHBUTTON "7", Button1+KEY_7_PAD, 284, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "8", Button1+KEY_8_PAD, 300, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "9", Button1+KEY_9_PAD, 316, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "#", Button1+KEY_0_PAD, 332, 24, 16, 15 , WS_TABSTOP - PUSHBUTTON "+", Button1+KEY_PLUS_PAD, 284, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "-", Button1+KEY_MINUS_PAD, 300, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "/", Button1+KEY_SLASH_PAD, 316, 8, 16, 15 , WS_TABSTOP - PUSHBUTTON "*", Button1+KEY_ASTERISK, 332, 8, 16, 15 , WS_TABSTOP - - PUSHBUTTON "OK", IDOK, 96, 112, 32, 16, WS_TABSTOP - PUSHBUTTON "Cancel", IDCANCEL, 136, 112, 32, 16, WS_TABSTOP -END - -Catalogue DIALOG 20, 20, 197+64, 241 -STYLE WS_CAPTION | WS_THICKFRAME | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SYSMENU -CAPTION "Tape Catalogue" -FONT 8, "FixedSys" -BEGIN - LISTBOX ListBox1, 7, 5, 179+64, 230, WS_TABSTOP -END +#include +//#include +#include "resources.h" + +#define KEY_A 1 +#define KEY_B 2 +#define KEY_C 3 +#define KEY_D 4 +#define KEY_E 5 +#define KEY_F 6 +#define KEY_G 7 +#define KEY_H 8 +#define KEY_I 9 +#define KEY_J 10 +#define KEY_K 11 +#define KEY_L 12 +#define KEY_M 13 +#define KEY_N 14 +#define KEY_O 15 +#define KEY_P 16 +#define KEY_Q 17 +#define KEY_R 18 +#define KEY_S 19 +#define KEY_T 20 +#define KEY_U 21 +#define KEY_V 22 +#define KEY_W 23 +#define KEY_X 24 +#define KEY_Y 25 +#define KEY_Z 26 +#define KEY_0 27 +#define KEY_1 28 +#define KEY_2 29 +#define KEY_3 30 +#define KEY_4 31 +#define KEY_5 32 +#define KEY_6 33 +#define KEY_7 34 +#define KEY_8 35 +#define KEY_9 36 +#define KEY_0_PAD 37 +#define KEY_1_PAD 38 +#define KEY_2_PAD 39 +#define KEY_3_PAD 40 +#define KEY_4_PAD 41 +#define KEY_5_PAD 42 +#define KEY_6_PAD 43 +#define KEY_7_PAD 44 +#define KEY_8_PAD 45 +#define KEY_9_PAD 46 +#define KEY_F1 47 +#define KEY_F2 48 +#define KEY_F3 49 +#define KEY_F4 50 +#define KEY_F5 51 +#define KEY_F6 52 +#define KEY_F7 53 +#define KEY_F8 54 +#define KEY_F9 55 +#define KEY_F10 56 +#define KEY_F11 57 +#define KEY_F12 58 +#define KEY_ESC 59 +#define KEY_TILDE 60 +#define KEY_MINUS 61 +#define KEY_EQUALS 62 +#define KEY_BACKSPACE 63 +#define KEY_TAB 64 +#define KEY_OPENBRACE 65 +#define KEY_CLOSEBRACE 66 +#define KEY_ENTER 67 +#define KEY_COLON 68 +#define KEY_QUOTE 69 +#define KEY_BACKSLASH 70 +#define KEY_BACKSLASH2 71 +#define KEY_COMMA 72 +#define KEY_STOP 73 +#define KEY_SLASH 74 +#define KEY_SPACE 75 +#define KEY_INSERT 76 +#define KEY_DEL 77 +#define KEY_HOME 78 +#define KEY_END 79 +#define KEY_PGUP 80 +#define KEY_PGDN 81 +#define KEY_LEFT 82 +#define KEY_RIGHT 83 +#define KEY_UP 84 +#define KEY_DOWN 85 +#define KEY_SLASH_PAD 86 +#define KEY_ASTERISK 87 +#define KEY_MINUS_PAD 88 +#define KEY_PLUS_PAD 89 +#define KEY_DEL_PAD 90 +#define KEY_ENTER_PAD 91 +#define KEY_COLON2 101 +#define KEY_EQUALS_PAD 103 +#define KEY_BACKQUOTE 104 +#define KEY_SEMICOLON 105 + +#define KEY_LSHIFT 115 +#define KEY_RSHIFT 116 +#define KEY_LCONTROL 117 +#define KEY_RCONTROL 118 +#define KEY_ALT 119 +#define KEY_ALTGR 120 +#define KEY_LWIN 121 +#define KEY_RWIN 122 +#define KEY_MENU 123 +#define KEY_SCRLOCK 124 +#define KEY_NUMLOCK 125 +#define KEY_CAPSLOCK 126 + +allegro_icon ICON "b-em.ico" + +MainMenu MENU DISCARDABLE +BEGIN + POPUP "&File" + BEGIN + MENUITEM "&Hard Reset", IDM_FILE_RESET + MENUITEM SEPARATOR + MENUITEM "&Load state", IDM_FILE_LSTATE + MENUITEM "&Save state", IDM_FILE_SSTATE + MENUITEM SEPARATOR + MENUITEM "E&xit", IDM_FILE_EXIT + END + POPUP "&Disc" + BEGIN + MENUITEM "&Autoboot disc :0/2...", IDM_DISC_AUTOBOOT + MENUITEM SEPARATOR + MENUITEM "Load disc :&0/2...", IDM_DISC_LOAD_0 + MENUITEM "Load disc :&1/3...", IDM_DISC_LOAD_1 + MENUITEM SEPARATOR + MENUITEM "Eject disc :0/2", IDM_DISC_EJECT_0 + MENUITEM "Eject disc :1/3", IDM_DISC_EJECT_1 + MENUITEM SEPARATOR + MENUITEM "New disc :0/2", IDM_DISC_NEW_0 + MENUITEM "New disc :1/3", IDM_DISC_NEW_1 + MENUITEM SEPARATOR + MENUITEM "Write protect disc :0/2",IDM_DISC_WPROT_0 + MENUITEM "Write protect disc :1/3",IDM_DISC_WPROT_1 + MENUITEM SEPARATOR + MENUITEM "Default write protect", IDM_DISC_WPROT_D + END + POPUP "&Tape" + BEGIN + MENUITEM "&Load tape...", IDM_TAPE_LOAD + MENUITEM SEPARATOR + MENUITEM "&Eject tape", IDM_TAPE_EJECT + MENUITEM SEPARATOR + MENUITEM "&Rewind tape", IDM_TAPE_REWIND + MENUITEM "Show tape &catalogue", IDM_TAPE_CAT + POPUP "&Tape speed" + BEGIN + MENUITEM "Normal", IDM_TAPES_NORMAL + MENUITEM "Fast", IDM_TAPES_FAST + END + END + POPUP "&Settings" + BEGIN + POPUP "&Model" + BEGIN + MENUITEM "BBC A w/OS 0.1", IDM_MODEL_0 + MENUITEM "BBC B w/OS 0.1", IDM_MODEL_0+1 + MENUITEM "BBC A", IDM_MODEL_0+2 + MENUITEM "BBC B w/8271 FDC", IDM_MODEL_0+3 + MENUITEM "BBC B w/8271+SWRAM", IDM_MODEL_0+4 + MENUITEM "BBC B w/1770 FDC", IDM_MODEL_0+5 + MENUITEM "BBC B US", IDM_MODEL_0+6 + MENUITEM "BBC B German", IDM_MODEL_0+7 + MENUITEM "BBC B+ 64K", IDM_MODEL_0+8 + MENUITEM "BBC B+ 128K", IDM_MODEL_0+9 + MENUITEM "BBC Master 128", IDM_MODEL_0+10 + MENUITEM "BBC Master 128 w/MOS 3.5", IDM_MODEL_0+15 + MENUITEM "BBC Master 512", IDM_MODEL_0+11 + MENUITEM "BBC Master Turbo", IDM_MODEL_0+12 + MENUITEM "BBC Master Compact", IDM_MODEL_0+13 + MENUITEM "ARM Evaluation System", IDM_MODEL_0+14 + END + POPUP "&Second Processor" + BEGIN + MENUITEM "None", IDM_TUBE_NONE + MENUITEM "6502", IDM_TUBE_6502 + MENUITEM "65816",IDM_TUBE_65816 + MENUITEM "Z80", IDM_TUBE_Z80 +#ifdef NS32016 + MENUITEM "32016",IDM_TUBE_32016 +#endif + MENUITEM SEPARATOR + POPUP "6502 Tube speed" + BEGIN + MENUITEM "&4mhz", IDM_TUBES_4 + MENUITEM "&8mhz", IDM_TUBES_8 + MENUITEM "&16mhz", IDM_TUBES_16 + MENUITEM "&32mhz", IDM_TUBES_32 + MENUITEM "&64mhz", IDM_TUBES_64 + END + END + POPUP "&Video" + BEGIN + POPUP "&Display type" + BEGIN + MENUITEM "&Software line doubling", IDM_VIDEO_SLINEDBL + MENUITEM "&Hardware line doubling", IDM_VIDEO_LINEDBL + MENUITEM "S&canlines", IDM_VIDEO_SCANLINES + MENUITEM "&Interlaced", IDM_VIDEO_INTERLACED + MENUITEM "&PAL", IDM_VIDEO_PAL + MENUITEM "P&AL Interlaced", IDM_VIDEO_PALI + END + POPUP "&Borders" + BEGIN + MENUITEM "&None", IDM_VIDEO_NOBORDERS + MENUITEM "&Small", IDM_VIDEO_MBORDERS + MENUITEM "&Full", IDM_VIDEO_FBORDERS + END + MENUITEM "Fullscreen", IDM_VIDEO_FULLSCR + MENUITEM "Resizeable window", IDM_VIDEO_RESIZE + END + POPUP "&Sound" + BEGIN + MENUITEM "&Internal sound chip", IDM_SOUND_INTERNAL + MENUITEM "&BeebSID", IDM_SOUND_BEEBSID + MENUITEM "&Printer port DAC", IDM_SOUND_DAC + MENUITEM "&Disc drive noise", IDM_SOUND_DDNOISE + MENUITEM "&Tape noise", IDM_SOUND_TAPE + MENUITEM SEPARATOR + MENUITEM "Internal sound &filter", IDM_SOUND_FILTER + POPUP "Internal sound &waveform" + BEGIN + MENUITEM "Square", IDM_WAVE_SQUARE + MENUITEM "Saw", IDM_WAVE_SAW + MENUITEM "Sine", IDM_WAVE_SINE + MENUITEM "Triangle", IDM_WAVE_TRI + MENUITEM "SID", IDM_WAVE_SID + END + MENUITEM SEPARATOR + POPUP "&reSID configuration" + BEGIN + POPUP "&Model" + BEGIN + MENUITEM "6581", IDM_SID_TYPE+SID_MODEL_6581 + MENUITEM "8580", IDM_SID_TYPE+SID_MODEL_8580 + MENUITEM "8580 + digi boost", IDM_SID_TYPE+SID_MODEL_8580D + MENUITEM "6581R4", IDM_SID_TYPE+SID_MODEL_6581R4 + MENUITEM "6581R3 4885", IDM_SID_TYPE+SID_MODEL_6581R3_4885 + MENUITEM "6581R3 0486S", IDM_SID_TYPE+SID_MODEL_6581R3_0486S + MENUITEM "6581R3 3984", IDM_SID_TYPE+SID_MODEL_6581R3_3984 + MENUITEM "6581R4AR 3789", IDM_SID_TYPE+SID_MODEL_6581R4AR_3789 + MENUITEM "6581R3 4485", IDM_SID_TYPE+SID_MODEL_6581R3_4485 + MENUITEM "6581R4 1986S", IDM_SID_TYPE+SID_MODEL_6581R4_1986S + MENUITEM "8580R5 3691", IDM_SID_TYPE+SID_MODEL_8580R5_3691 + MENUITEM "8580R5 3691 + digi boost", IDM_SID_TYPE+SID_MODEL_8580R5_3691D + MENUITEM "8580R5 1489", IDM_SID_TYPE+SID_MODEL_8580R5_1489 + MENUITEM "8580R5 1489 + digi boost", IDM_SID_TYPE+SID_MODEL_8580R5_1489D + END + POPUP "&Sample method" + BEGIN + MENUITEM "&Interpolating", IDM_SID_INTERP + MENUITEM "&Resampling", IDM_SID_RESAMP + END + END + MENUITEM SEPARATOR + POPUP "Disc drive &type" + BEGIN + MENUITEM "&5.25",IDM_DDT_525 + MENUITEM "&3.5", IDM_DDT_35 + END + POPUP "Disc drive &volume" + BEGIN + MENUITEM "&33%", IDM_DDV_33 + MENUITEM "&66%", IDM_DDV_66 + MENUITEM "&100%", IDM_DDV_100 + END + END + POPUP "&Keyboard" + BEGIN + MENUITEM "&Redefine keys...", IDM_KEY_REDEFINE + MENUITEM SEPARATOR + MENUITEM "&Map CAPS/CTRL to A/S", IDM_KEY_AS + END + POPUP "&Mouse" + BEGIN + MENUITEM "&AMX Mouse", IDM_MOUSE_AMX + END + POPUP "&IDE" + BEGIN + MENUITEM "&Enable IDE hard discs", IDM_IDE_ENABLE + END + END + POPUP "&Misc" + BEGIN + POPUP "&Speed" + BEGIN + MENUITEM "10%", IDM_SPD_10 + MENUITEM "25%", IDM_SPD_25 + MENUITEM "50%", IDM_SPD_50 + MENUITEM "75%", IDM_SPD_75 + MENUITEM "100%", IDM_SPD_100 + MENUITEM "150%", IDM_SPD_150 + MENUITEM "200%", IDM_SPD_200 + MENUITEM "300%", IDM_SPD_300 + MENUITEM "400%", IDM_SPD_400 + MENUITEM "500%", IDM_SPD_500 + END + MENUITEM "&Save screenshot",IDM_SCRSHOT + MENUITEM SEPARATOR + MENUITEM "&Debugger", IDM_DEBUGGER + MENUITEM "&Break", IDM_BREAK + END +END + +Redefine DIALOG 20, 20, 292, 132 +STYLE WS_CAPTION | WS_THICKFRAME +CAPTION "Redefine keys" +FONT 7, "MS Sans Serif" +BEGIN + PUSHBUTTON "ESC", Button1+KEY_ESC, 16, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "1", Button1+KEY_1, 32, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "2", Button1+KEY_2, 48, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "3", Button1+KEY_3, 64, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "4", Button1+KEY_4, 80, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "5", Button1+KEY_5, 96, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "6", Button1+KEY_6, 112, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "7", Button1+KEY_7, 128, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "8", Button1+KEY_8, 144, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "9", Button1+KEY_9, 160, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "0", Button1+KEY_0, 176, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "=", Button1+KEY_MINUS, 192, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "^", Button1+KEY_EQUALS, 208, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "\\", Button1+KEY_BACKSLASH2, 224, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "LFT", Button1+KEY_LEFT, 240, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "RGT", Button1+KEY_RIGHT, 256, 24, 18, 15 , WS_TABSTOP + PUSHBUTTON "TAB", Button1+KEY_TAB, 16, 40, 24, 15 , WS_TABSTOP + PUSHBUTTON "Q", Button1+KEY_Q, 40, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "W", Button1+KEY_W, 56, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "E", Button1+KEY_E, 72, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "R", Button1+KEY_R, 88, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "T", Button1+KEY_T, 104, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "Y", Button1+KEY_Y, 120, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "U", Button1+KEY_U, 136, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "I", Button1+KEY_I, 152, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "O", Button1+KEY_O, 168, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "P", Button1+KEY_P, 184, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "@", Button1+KEY_OPENBRACE, 200, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "[", Button1+KEY_CLOSEBRACE, 216, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "_", Button1+KEY_TILDE, 232, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "UP", Button1+KEY_UP, 248, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "DWN", Button1+KEY_DOWN, 264, 40, 18, 15 , WS_TABSTOP + PUSHBUTTON "CLK", Button1+KEY_CAPSLOCK, 12, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "CTL", Button1+KEY_CAPSLOCK, 28, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "A", Button1+KEY_A, 44, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "S", Button1+KEY_S, 60, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "D", Button1+KEY_D, 76, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "F", Button1+KEY_F, 92, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "G", Button1+KEY_G, 108, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "H", Button1+KEY_H, 124, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "J", Button1+KEY_J, 140, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "K", Button1+KEY_K, 156, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "L", Button1+KEY_L, 172, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON ";", Button1+KEY_SEMICOLON, 188, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON ":", Button1+KEY_QUOTE, 204, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "]", Button1+KEY_BACKSLASH, 220, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "RET", Button1+KEY_ENTER, 236, 56, 32, 15 , WS_TABSTOP + PUSHBUTTON "SLK", Button1+KEY_ALT, 12, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "SHIFT", Button1+KEY_LSHIFT, 28, 72, 24, 15 , WS_TABSTOP + PUSHBUTTON "Z", Button1+KEY_Z, 52, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "X", Button1+KEY_X, 68, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "C", Button1+KEY_C, 84, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "V", Button1+KEY_V, 100, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "B", Button1+KEY_B, 116, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "N", Button1+KEY_N, 132, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "M", Button1+KEY_M, 148, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON ",", Button1+KEY_COMMA, 164, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON ".", Button1+KEY_STOP, 180, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "/", Button1+KEY_SLASH, 196, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "SHIFT", Button1+KEY_RSHIFT, 212, 72, 24, 15 , WS_TABSTOP + PUSHBUTTON "DEL", Button1+KEY_DEL, 236, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "CPY", Button1+KEY_END, 252, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "SPACE", Button1+KEY_SPACE, 68, 88, 128, 15 , WS_TABSTOP + PUSHBUTTON "F0", Button1+KEY_F1, 52, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "F1", Button1+KEY_F2, 68, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "F2", Button1+KEY_F3, 84, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "F3", Button1+KEY_F4, 100, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "F4", Button1+KEY_F5, 116, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "F5", Button1+KEY_F6, 132, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "F6", Button1+KEY_F7, 148, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "F7", Button1+KEY_F8, 164, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "F8", Button1+KEY_F9, 180, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "F9", Button1+KEY_F10, 196, 8, 16, 15 , WS_TABSTOP + + PUSHBUTTON "OK", IDOK, 96, 112, 32, 16, WS_TABSTOP + PUSHBUTTON "Cancel", IDCANCEL, 136, 112, 32, 16, WS_TABSTOP +END + +KeyDlg DIALOG 20,20,100,60 +STYLE WS_CAPTION | WS_THICKFRAME +CAPTION "Press key to define" +FONT 7, "MS Sans Serif" +BEGIN + PUSHBUTTON "Cancel", IDCANCEL, 64, 40, 32, 16, WS_TABSTOP +END + +RedefineM DIALOG 20, 20, 360, 132 +STYLE WS_CAPTION | WS_THICKFRAME +CAPTION "Redefine keys" +FONT 7, "MS Sans Serif" +BEGIN + PUSHBUTTON "ESC", Button1+KEY_ESC, 16, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "1", Button1+KEY_1, 32, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "2", Button1+KEY_2, 48, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "3", Button1+KEY_3, 64, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "4", Button1+KEY_4, 80, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "5", Button1+KEY_5, 96, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "6", Button1+KEY_6, 112, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "7", Button1+KEY_7, 128, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "8", Button1+KEY_8, 144, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "9", Button1+KEY_9, 160, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "0", Button1+KEY_0, 176, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "=", Button1+KEY_MINUS, 192, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "^", Button1+KEY_EQUALS, 208, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "\\", Button1+KEY_BACKSLASH2, 224, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "LFT", Button1+KEY_LEFT, 240, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "RGT", Button1+KEY_RIGHT, 256, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "TAB", Button1+KEY_TAB, 16, 40, 24, 15 , WS_TABSTOP + PUSHBUTTON "Q", Button1+KEY_Q, 40, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "W", Button1+KEY_W, 56, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "E", Button1+KEY_E, 72, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "R", Button1+KEY_R, 88, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "T", Button1+KEY_T, 104, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "Y", Button1+KEY_Y, 120, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "U", Button1+KEY_U, 136, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "I", Button1+KEY_I, 152, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "O", Button1+KEY_O, 168, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "P", Button1+KEY_P, 184, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "@", Button1+KEY_OPENBRACE, 200, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "[", Button1+KEY_CLOSEBRACE, 216, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "_", Button1+KEY_TILDE, 232, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "UP", Button1+KEY_UP, 248, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "DWN", Button1+KEY_DOWN, 248, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "CAPS", Button1+KEY_CAPSLOCK, 12, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "CTRL", Button1+KEY_CAPSLOCK, 28, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "A", Button1+KEY_A, 44, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "S", Button1+KEY_S, 60, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "D", Button1+KEY_D, 76, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "F", Button1+KEY_F, 92, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "G", Button1+KEY_G, 108, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "H", Button1+KEY_H, 124, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "J", Button1+KEY_J, 140, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "K", Button1+KEY_K, 156, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "L", Button1+KEY_L, 172, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON ";", Button1+KEY_SEMICOLON, 188, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON ":", Button1+KEY_QUOTE, 204, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "]", Button1+KEY_BACKSLASH, 220, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "RET", Button1+KEY_ENTER, 236, 56, 32, 15 , WS_TABSTOP + PUSHBUTTON "SHLK", Button1+KEY_ALT, 12, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "SHIFT", Button1+KEY_LSHIFT, 28, 72, 24, 15 , WS_TABSTOP + PUSHBUTTON "Z", Button1+KEY_Z, 52, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "X", Button1+KEY_X, 68, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "C", Button1+KEY_C, 84, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "V", Button1+KEY_V, 100, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "B", Button1+KEY_B, 116, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "N", Button1+KEY_N, 132, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "M", Button1+KEY_M, 148, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON ",", Button1+KEY_COMMA, 164, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON ".", Button1+KEY_STOP, 180, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "/", Button1+KEY_SLASH, 196, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "SHIFT", Button1+KEY_RSHIFT, 212, 72, 24, 15 , WS_TABSTOP + PUSHBUTTON "DEL", Button1+KEY_DEL, 236, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "COPY", Button1+KEY_END, 252, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "SPACE", Button1+KEY_SPACE, 68, 88, 128, 15 , WS_TABSTOP + PUSHBUTTON "F0", Button1+KEY_F1, 40, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "F1", Button1+KEY_F2, 56, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "F2", Button1+KEY_F3, 72, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "F3", Button1+KEY_F4, 88, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "F4", Button1+KEY_F5, 104, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "F5", Button1+KEY_F6, 120, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "F6", Button1+KEY_F7, 136, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "F7", Button1+KEY_F8, 152, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "F8", Button1+KEY_F9, 168, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "F9", Button1+KEY_F10, 184, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "0", Button1+KEY_0_PAD, 284, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON ".", Button1+KEY_PGDN, 300, 72, 16, 15 , WS_TABSTOP + PUSHBUTTON "RET", Button1+KEY_ENTER_PAD, 316, 72, 32, 15 , WS_TABSTOP + PUSHBUTTON "1", Button1+KEY_1_PAD, 284, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "2", Button1+KEY_2_PAD, 300, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "3", Button1+KEY_3_PAD, 316, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON ",", Button1+KEY_HOME, 332, 56, 16, 15 , WS_TABSTOP + PUSHBUTTON "4", Button1+KEY_4_PAD, 284, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "5", Button1+KEY_5_PAD, 300, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "6", Button1+KEY_6_PAD, 316, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "DEL", Button1+KEY_DEL_PAD, 332, 40, 16, 15 , WS_TABSTOP + PUSHBUTTON "7", Button1+KEY_7_PAD, 284, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "8", Button1+KEY_8_PAD, 300, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "9", Button1+KEY_9_PAD, 316, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "#", Button1+KEY_0_PAD, 332, 24, 16, 15 , WS_TABSTOP + PUSHBUTTON "+", Button1+KEY_PLUS_PAD, 284, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "-", Button1+KEY_MINUS_PAD, 300, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "/", Button1+KEY_SLASH_PAD, 316, 8, 16, 15 , WS_TABSTOP + PUSHBUTTON "*", Button1+KEY_ASTERISK, 332, 8, 16, 15 , WS_TABSTOP + + PUSHBUTTON "OK", IDOK, 96, 112, 32, 16, WS_TABSTOP + PUSHBUTTON "Cancel", IDCANCEL, 136, 112, 32, 16, WS_TABSTOP +END + +Catalogue DIALOG 20, 20, 197+64, 241 +STYLE WS_CAPTION | WS_THICKFRAME | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SYSMENU +CAPTION "Tape Catalogue" +FONT 8, "FixedSys" +BEGIN + LISTBOX ListBox1, 7, 5, 179+64, 230, WS_TABSTOP +END diff --git a/src/b-em.vcxproj b/src/b-em.vcxproj index ee2aefe8..aaf47070 100644 --- a/src/b-em.vcxproj +++ b/src/b-em.vcxproj @@ -1,225 +1,225 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {28E2DE55-0A88-47FA-92DC-3F96D72608F9} - Win32Proj - bem - - - - Application - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - true - - - false - - - - - - TurnOffAllWarnings - Disabled - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - UNICODE;_UNICODE;%(UndefinePreprocessorDefinitions) - - - Windows - true - alleg.lib;zlib.lib;OpenAL32.lib;alut.lib;winmm.lib;%(AdditionalDependencies) - - - - - TurnOffAllWarnings - - - MaxSpeed - true - true - WIN32;_WINDOWS;%(PreprocessorDefinitions) - UNICODE;_UNICODE;%(UndefinePreprocessorDefinitions) - MultiThreadedDLL - - - Windows - false - true - true - alleg.lib;zlib.lib;OpenAL32.lib;alut.lib;winmm.lib;%(AdditionalDependencies) - MSVCRTD.lib;%(IgnoreSpecificDefaultLibraries) - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + + {28E2DE55-0A88-47FA-92DC-3F96D72608F9} + Win32Proj + bem + + + + Application + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + true + + + false + + + + + + TurnOffAllWarnings + Disabled + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + UNICODE;_UNICODE;%(UndefinePreprocessorDefinitions) + + + Windows + true + alleg.lib;zlib.lib;OpenAL32.lib;alut.lib;winmm.lib;%(AdditionalDependencies) + + + + + TurnOffAllWarnings + + + MaxSpeed + true + true + WIN32;_WINDOWS;%(PreprocessorDefinitions) + UNICODE;_UNICODE;%(UndefinePreprocessorDefinitions) + MultiThreadedDLL + + + Windows + false + true + true + alleg.lib;zlib.lib;OpenAL32.lib;alut.lib;winmm.lib;%(AdditionalDependencies) + MSVCRTD.lib;%(IgnoreSpecificDefaultLibraries) + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/b-em.vcxproj.filters b/src/b-em.vcxproj.filters index b5386a04..94653ebb 100644 --- a/src/b-em.vcxproj.filters +++ b/src/b-em.vcxproj.filters @@ -1,418 +1,418 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Resource Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Source Files - - - + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Resource Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Source Files + + + \ No newline at end of file diff --git a/src/b-em.vcxproj.user b/src/b-em.vcxproj.user new file mode 100644 index 00000000..695b5c78 --- /dev/null +++ b/src/b-em.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/bbctext.h b/src/bbctext.h index 22603c15..2740d03e 100644 --- a/src/bbctext.h +++ b/src/bbctext.h @@ -1,3278 +1,3278 @@ -/* Normal Character Set */ - -static uint8_t teletext_characters[96*60]={ - // 0x20 ' ' - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,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,1, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, // 0x79 'y' - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,0,1,1,1,1, - 0,0,0,0,0,1, - 0,0,1,1,1,0 -, // 0x7a 'z' - 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,1,0, - 0,0,0,1,0,0, - 0,0,1,0,0,0, - 0,1,1,1,1,1, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, // 0x7b 'one fourth symbol' - 0,0,0,0,0,0, - 0,0,1,0,0,0, - 0,0,1,0,0,0, - 0,0,1,0,0,0, - 0,0,1,0,0,1, - 0,0,0,0,1,1, - 0,0,0,1,0,1, - 0,0,0,1,1,1, - 0,0,0,0,0,1, - 0,0,0,0,0,0 -, // 0x7c '|' - 0,0,0,0,0,0, - 0,0,1,0,1,0, - 0,0,1,0,1,0, - 0,0,1,0,1,0, - 0,0,1,0,1,0, - 0,0,1,0,1,0, - 0,0,1,0,1,0, - 0,0,1,0,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, // 0x7d ' three fourths symbol' - 0,0,0,0,0,0, - 0,1,1,0,0,0, - 0,0,0,1,0,0, - 0,1,1,0,0,0, - 0,0,0,1,0,0, - 0,1,1,0,0,1, - 0,0,0,0,1,1, - 0,0,0,1,0,1, - 0,0,0,1,1,1, - 0,0,0,0,0,1 -, // 0x7e Divide - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,1,0,0, - 0,0,0,0,0,0, - 0,1,1,1,1,1, - 0,0,0,0,0,0, - 0,0,0,1,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, // 0x7f Block - 0,0,0,0,0,0, - 0,1,1,1,1,1, - 0,1,1,1,1,1, - 0,1,1,1,1,1, - 0,1,1,1,1,1, - 0,1,1,1,1,1, - 0,1,1,1,1,1, - 0,1,1,1,1,1, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -}; - - -/* Graphics Character Set */ - -static uint8_t teletext_graphics[96*60]={ - // 0x20 - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, // 0x21 - 1,1,1,0,0,0, - 1,1,1,0,0,0, - 1,1,1,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, // 0x22 - 0,0,0,1,1,1, - 0,0,0,1,1,1, - 0,0,0,1,1,1, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, // 0x23 - 1,1,1,1,1,1, - 1,1,1,1,1,1, - 1,1,1,1,1,1, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, // 0x24 - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 1,1,1,0,0,0, - 1,1,1,0,0,0, - 1,1,1,0,0,0, - 1,1,1,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, // 0x25 - 1,1,1,0,0,0, - 1,1,1,0,0,0, - 1,1,1,0,0,0, - 1,1,1,0,0,0, - 1,1,1,0,0,0, - 1,1,1,0,0,0, - 1,1,1,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, // 0x26 - 0,0,0,1,1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1,1,1, - 1,1,1,1,1,1, - 1,1,1,1,1,1, - 1,1,1,1,1,1, - 1,1,1,1,1,1, - 1,1,1,1,1,1, - 1,1,1,1,1,1, - 1,1,1,1,1,1 -}; - -/* Separated Graphics Character Set */ - -static uint8_t teletext_separated_graphics[96*60]={ - // Character ' ' (32) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '!' (33) - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '"' (34) - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '#' (35) - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '$' (36) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '%' (37) - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '&' (38) - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character ''' (39) - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '(' (40) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character ')' (41) - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '*' (42) - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '+' (43) - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character ',' (44) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '-' (45) - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '.' (46) - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '/' (47) - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '0' (48) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 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,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '1' (49) - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 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,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '2' (50) - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 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,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '3' (51) - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 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,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '4' (52) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '5' (53) - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '6' (54) - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '7' (55) - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '8' (56) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '9' (57) - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0 -, - // Character ':' (58) - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0 -, - // Character ';' (59) - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '<' (60) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '=' (61) - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '>' (62) - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '?' (63) - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '@' (64) - 0,0,0,0,0,0, - 0,0,1,1,1,0, - 0,1,0,0,0,1, - 0,1,0,1,1,1, - 0,1,0,1,0,1, - 0,1,0,1,1,1, - 0,1,0,0,0,0, - 0,0,1,1,1,1, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'A' (65) - 0,0,0,0,0,0, - 0,0,0,1,0,0, - 0,0,1,0,1,0, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,1,1,1,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'B' (66) - 0,0,0,0,0,0, - 0,1,1,1,1,0, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,1,1,1,0, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,1,1,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'C' (67) - 0,0,0,0,0,0, - 0,0,1,1,1,0, - 0,1,0,0,0,1, - 0,1,0,0,0,0, - 0,1,0,0,0,0, - 0,1,0,0,0,0, - 0,1,0,0,0,1, - 0,0,1,1,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'D' (68) - 0,0,0,0,0,0, - 0,1,1,1,1,0, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,1,1,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'E' (69) - 0,0,0,0,0,0, - 0,1,1,1,1,1, - 0,1,0,0,0,0, - 0,1,0,0,0,0, - 0,1,1,1,1,0, - 0,1,0,0,0,0, - 0,1,0,0,0,0, - 0,1,1,1,1,1, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'F' (70) - 0,0,0,0,0,0, - 0,1,1,1,1,1, - 0,1,0,0,0,0, - 0,1,0,0,0,0, - 0,1,1,1,1,0, - 0,1,0,0,0,0, - 0,1,0,0,0,0, - 0,1,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'G' (71) - 0,0,0,0,0,0, - 0,0,1,1,1,0, - 0,1,0,0,0,1, - 0,1,0,0,0,0, - 0,1,0,0,0,0, - 0,1,0,0,1,1, - 0,1,0,0,0,1, - 0,0,1,1,1,1, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'H' (72) - 0,0,0,0,0,0, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,1,1,1,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'I' (73) - 0,0,0,0,0,0, - 0,0,1,1,1,0, - 0,0,0,1,0,0, - 0,0,0,1,0,0, - 0,0,0,1,0,0, - 0,0,0,1,0,0, - 0,0,0,1,0,0, - 0,0,1,1,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'J' (74) - 0,0,0,0,0,0, - 0,0,0,0,0,1, - 0,0,0,0,0,1, - 0,0,0,0,0,1, - 0,0,0,0,0,1, - 0,0,0,0,0,1, - 0,1,0,0,0,1, - 0,0,1,1,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'K' (75) - 0,0,0,0,0,0, - 0,1,0,0,0,1, - 0,1,0,0,1,0, - 0,1,0,1,0,0, - 0,1,1,0,0,0, - 0,1,0,1,0,0, - 0,1,0,0,1,0, - 0,1,0,0,0,1, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'L' (76) - 0,0,0,0,0,0, - 0,1,0,0,0,0, - 0,1,0,0,0,0, - 0,1,0,0,0,0, - 0,1,0,0,0,0, - 0,1,0,0,0,0, - 0,1,0,0,0,0, - 0,1,1,1,1,1, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'M' (77) - 0,0,0,0,0,0, - 0,1,0,0,0,1, - 0,1,1,0,1,1, - 0,1,0,1,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'N' (78) - 0,0,0,0,0,0, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,1,0,0,1, - 0,1,0,1,0,1, - 0,1,0,0,1,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'O' (79) - 0,0,0,0,0,0, - 0,0,1,1,1,0, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,0,1,1,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'P' (80) - 0,0,0,0,0,0, - 0,1,1,1,1,0, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,1,1,1,0, - 0,1,0,0,0,0, - 0,1,0,0,0,0, - 0,1,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'Q' (81) - 0,0,0,0,0,0, - 0,0,1,1,1,0, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,1,0,1, - 0,1,0,0,1,0, - 0,0,1,1,0,1, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'R' (82) - 0,0,0,0,0,0, - 0,1,1,1,1,0, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,1,1,1,0, - 0,1,0,1,0,0, - 0,1,0,0,1,0, - 0,1,0,0,0,1, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'S' (83) - 0,0,0,0,0,0, - 0,0,1,1,1,0, - 0,1,0,0,0,1, - 0,1,0,0,0,0, - 0,0,1,1,1,0, - 0,0,0,0,0,1, - 0,1,0,0,0,1, - 0,0,1,1,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'T' (84) - 0,0,0,0,0,0, - 0,1,1,1,1,1, - 0,0,0,1,0,0, - 0,0,0,1,0,0, - 0,0,0,1,0,0, - 0,0,0,1,0,0, - 0,0,0,1,0,0, - 0,0,0,1,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'U' (85) - 0,0,0,0,0,0, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,0,1,1,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'V' (86) - 0,0,0,0,0,0, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,0,1,0,1,0, - 0,0,1,0,1,0, - 0,0,0,1,0,0, - 0,0,0,1,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'W' (87) - 0,0,0,0,0,0, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,1,0,1,0,1, - 0,1,0,1,0,1, - 0,1,0,1,0,1, - 0,0,1,0,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'X' (88) - 0,0,0,0,0,0, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,0,1,0,1,0, - 0,0,0,1,0,0, - 0,0,1,0,1,0, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'Y' (89) - 0,0,0,0,0,0, - 0,1,0,0,0,1, - 0,1,0,0,0,1, - 0,0,1,0,1,0, - 0,0,0,1,0,0, - 0,0,0,1,0,0, - 0,0,0,1,0,0, - 0,0,0,1,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character 'Z' (90) - 0,0,0,0,0,0, - 0,1,1,1,1,1, - 0,0,0,0,0,1, - 0,0,0,0,1,0, - 0,0,0,1,0,0, - 0,0,1,0,0,0, - 0,1,0,0,0,0, - 0,1,1,1,1,1, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '[' (91) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,1,0,0, - 0,0,1,0,0,0, - 0,1,1,1,1,1, - 0,0,1,0,0,0, - 0,0,0,1,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '\' (92) - 0,0,0,0,0,0, - 0,1,0,0,0,0, - 0,1,0,0,0,0, - 0,1,0,0,0,0, - 0,1,0,1,1,0, - 0,0,0,0,0,1, - 0,0,0,0,1,0, - 0,0,0,1,0,0, - 0,0,0,1,1,1, - 0,0,0,0,0,0 -, - // Character ']' (93) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,1,0,0, - 0,0,0,0,1,0, - 0,1,1,1,1,1, - 0,0,0,0,1,0, - 0,0,0,1,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '^' (94) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,1,0,0, - 0,0,1,1,1,0, - 0,1,0,1,0,1, - 0,0,0,1,0,0, - 0,0,0,1,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '_' (95) - 0,0,0,0,0,0, - 0,0,1,0,1,0, - 0,0,1,0,1,0, - 0,1,1,1,1,1, - 0,0,1,0,1,0, - 0,1,1,1,1,1, - 0,0,1,0,1,0, - 0,0,1,0,1,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0 -, - // Character '`' (96) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,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,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'a' (97) - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,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,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'b' (98) - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,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,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'c' (99) - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,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,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'd' (100) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'e' (101) - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'f' (102) - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'g' (103) - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'h' (104) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'i' (105) - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'j' (106) - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'k' (107) - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'l' (108) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'm' (109) - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'n' (110) - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'o' (111) - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'p' (112) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 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,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'q' (113) - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 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,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'r' (114) - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 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,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 's' (115) - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 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,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 't' (116) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'u' (117) - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'v' (118) - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'w' (119) - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'x' (120) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0 -, - // Character 'y' (121) - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 1,1,1,1,1,0, - 1,1,1,1,1,0, - 0,0,0,0,0,0 -, - // Character 'z' (122) - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0 -, - // Character '{' (123) - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0 -, - // Character '|' (124) - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0 -, - // Character '}' (125) - 1,1,0,0,0,0, - 1,1,0,0,0,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0 -, - // Character '~' (126) - 0,0,0,1,1,0, - 0,0,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0 -, - // Character '' (127) - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0, - 1,1,0,1,1,0, - 1,1,0,1,1,0, - 0,0,0,0,0,0 -}; +/* Normal Character Set */ + +static uint8_t teletext_characters[96*60]={ + // 0x20 ' ' + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, // 0x21 '!' + 0,0,0,0,0,0, + 0,0,0,1,0,0, + 0,0,0,1,0,0, + 0,0,0,1,0,0, + 0,0,0,1,0,0, + 0,0,0,1,0,0, + 0,0,0,0,0,0, + 0,0,0,1,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, // 0x22 '"' + 0,0,0,0,0,0, + 0,0,1,0,1,0, + 0,0,1,0,1,0, + 0,0,1,0,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, // 0x23 ' British Pound' + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,1,0,0,1, + 0,0,1,0,0,0, + 0,1,1,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,0,0,0, + 0,0,1,0,0,1, + 0,0,0,0,1,1, + 0,0,0,1,0,1, + 0,0,0,1,1,1, + 0,0,0,0,0,1, + 0,0,0,0,0,0 +, // 0x7c '|' + 0,0,0,0,0,0, + 0,0,1,0,1,0, + 0,0,1,0,1,0, + 0,0,1,0,1,0, + 0,0,1,0,1,0, + 0,0,1,0,1,0, + 0,0,1,0,1,0, + 0,0,1,0,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, // 0x7d ' three fourths symbol' + 0,0,0,0,0,0, + 0,1,1,0,0,0, + 0,0,0,1,0,0, + 0,1,1,0,0,0, + 0,0,0,1,0,0, + 0,1,1,0,0,1, + 0,0,0,0,1,1, + 0,0,0,1,0,1, + 0,0,0,1,1,1, + 0,0,0,0,0,1 +, // 0x7e Divide + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,1,0,0, + 0,0,0,0,0,0, + 0,1,1,1,1,1, + 0,0,0,0,0,0, + 0,0,0,1,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, // 0x7f Block + 0,0,0,0,0,0, + 0,1,1,1,1,1, + 0,1,1,1,1,1, + 0,1,1,1,1,1, + 0,1,1,1,1,1, + 0,1,1,1,1,1, + 0,1,1,1,1,1, + 0,1,1,1,1,1, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +}; + + +/* Graphics Character Set */ + +static uint8_t teletext_graphics[96*60]={ + // 0x20 + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, // 0x21 + 1,1,1,0,0,0, + 1,1,1,0,0,0, + 1,1,1,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 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,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 0,0,0,1,1,1, + 0,0,0,1,1,1, + 0,0,0,1,1,1, + 0,0,0,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1 +, // 0x7c + 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, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1 +, // 0x7d + 1,1,1,0,0,0, + 1,1,1,0,0,0, + 1,1,1,0,0,0, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1 +, // 0x7e + 0,0,0,1,1,1, + 0,0,0,1,1,1, + 0,0,0,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1 +, // 0x7f + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1, + 1,1,1,1,1,1 +}; + +/* Separated Graphics Character Set */ + +static uint8_t teletext_separated_graphics[96*60]={ + // Character ' ' (32) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '!' (33) + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '"' (34) + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '#' (35) + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '$' (36) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '%' (37) + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '&' (38) + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character ''' (39) + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '(' (40) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character ')' (41) + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '*' (42) + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '+' (43) + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character ',' (44) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '-' (45) + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '.' (46) + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '/' (47) + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '0' (48) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 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,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '1' (49) + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 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,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '2' (50) + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 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,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '3' (51) + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 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,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '4' (52) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '5' (53) + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '6' (54) + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '7' (55) + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '8' (56) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '9' (57) + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0 +, + // Character ':' (58) + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0 +, + // Character ';' (59) + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '<' (60) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '=' (61) + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '>' (62) + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '?' (63) + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '@' (64) + 0,0,0,0,0,0, + 0,0,1,1,1,0, + 0,1,0,0,0,1, + 0,1,0,1,1,1, + 0,1,0,1,0,1, + 0,1,0,1,1,1, + 0,1,0,0,0,0, + 0,0,1,1,1,1, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'A' (65) + 0,0,0,0,0,0, + 0,0,0,1,0,0, + 0,0,1,0,1,0, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,1,1,1,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'B' (66) + 0,0,0,0,0,0, + 0,1,1,1,1,0, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,1,1,1,0, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,1,1,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'C' (67) + 0,0,0,0,0,0, + 0,0,1,1,1,0, + 0,1,0,0,0,1, + 0,1,0,0,0,0, + 0,1,0,0,0,0, + 0,1,0,0,0,0, + 0,1,0,0,0,1, + 0,0,1,1,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'D' (68) + 0,0,0,0,0,0, + 0,1,1,1,1,0, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,1,1,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'E' (69) + 0,0,0,0,0,0, + 0,1,1,1,1,1, + 0,1,0,0,0,0, + 0,1,0,0,0,0, + 0,1,1,1,1,0, + 0,1,0,0,0,0, + 0,1,0,0,0,0, + 0,1,1,1,1,1, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'F' (70) + 0,0,0,0,0,0, + 0,1,1,1,1,1, + 0,1,0,0,0,0, + 0,1,0,0,0,0, + 0,1,1,1,1,0, + 0,1,0,0,0,0, + 0,1,0,0,0,0, + 0,1,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'G' (71) + 0,0,0,0,0,0, + 0,0,1,1,1,0, + 0,1,0,0,0,1, + 0,1,0,0,0,0, + 0,1,0,0,0,0, + 0,1,0,0,1,1, + 0,1,0,0,0,1, + 0,0,1,1,1,1, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'H' (72) + 0,0,0,0,0,0, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,1,1,1,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'I' (73) + 0,0,0,0,0,0, + 0,0,1,1,1,0, + 0,0,0,1,0,0, + 0,0,0,1,0,0, + 0,0,0,1,0,0, + 0,0,0,1,0,0, + 0,0,0,1,0,0, + 0,0,1,1,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'J' (74) + 0,0,0,0,0,0, + 0,0,0,0,0,1, + 0,0,0,0,0,1, + 0,0,0,0,0,1, + 0,0,0,0,0,1, + 0,0,0,0,0,1, + 0,1,0,0,0,1, + 0,0,1,1,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'K' (75) + 0,0,0,0,0,0, + 0,1,0,0,0,1, + 0,1,0,0,1,0, + 0,1,0,1,0,0, + 0,1,1,0,0,0, + 0,1,0,1,0,0, + 0,1,0,0,1,0, + 0,1,0,0,0,1, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'L' (76) + 0,0,0,0,0,0, + 0,1,0,0,0,0, + 0,1,0,0,0,0, + 0,1,0,0,0,0, + 0,1,0,0,0,0, + 0,1,0,0,0,0, + 0,1,0,0,0,0, + 0,1,1,1,1,1, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'M' (77) + 0,0,0,0,0,0, + 0,1,0,0,0,1, + 0,1,1,0,1,1, + 0,1,0,1,0,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'N' (78) + 0,0,0,0,0,0, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,1,0,0,1, + 0,1,0,1,0,1, + 0,1,0,0,1,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'O' (79) + 0,0,0,0,0,0, + 0,0,1,1,1,0, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,0,1,1,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'P' (80) + 0,0,0,0,0,0, + 0,1,1,1,1,0, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,1,1,1,0, + 0,1,0,0,0,0, + 0,1,0,0,0,0, + 0,1,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'Q' (81) + 0,0,0,0,0,0, + 0,0,1,1,1,0, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,1,0,1, + 0,1,0,0,1,0, + 0,0,1,1,0,1, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'R' (82) + 0,0,0,0,0,0, + 0,1,1,1,1,0, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,1,1,1,0, + 0,1,0,1,0,0, + 0,1,0,0,1,0, + 0,1,0,0,0,1, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'S' (83) + 0,0,0,0,0,0, + 0,0,1,1,1,0, + 0,1,0,0,0,1, + 0,1,0,0,0,0, + 0,0,1,1,1,0, + 0,0,0,0,0,1, + 0,1,0,0,0,1, + 0,0,1,1,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'T' (84) + 0,0,0,0,0,0, + 0,1,1,1,1,1, + 0,0,0,1,0,0, + 0,0,0,1,0,0, + 0,0,0,1,0,0, + 0,0,0,1,0,0, + 0,0,0,1,0,0, + 0,0,0,1,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'U' (85) + 0,0,0,0,0,0, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,0,1,1,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'V' (86) + 0,0,0,0,0,0, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,0,1,0,1,0, + 0,0,1,0,1,0, + 0,0,0,1,0,0, + 0,0,0,1,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'W' (87) + 0,0,0,0,0,0, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,1,0,1,0,1, + 0,1,0,1,0,1, + 0,1,0,1,0,1, + 0,0,1,0,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'X' (88) + 0,0,0,0,0,0, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,0,1,0,1,0, + 0,0,0,1,0,0, + 0,0,1,0,1,0, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'Y' (89) + 0,0,0,0,0,0, + 0,1,0,0,0,1, + 0,1,0,0,0,1, + 0,0,1,0,1,0, + 0,0,0,1,0,0, + 0,0,0,1,0,0, + 0,0,0,1,0,0, + 0,0,0,1,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character 'Z' (90) + 0,0,0,0,0,0, + 0,1,1,1,1,1, + 0,0,0,0,0,1, + 0,0,0,0,1,0, + 0,0,0,1,0,0, + 0,0,1,0,0,0, + 0,1,0,0,0,0, + 0,1,1,1,1,1, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '[' (91) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,1,0,0, + 0,0,1,0,0,0, + 0,1,1,1,1,1, + 0,0,1,0,0,0, + 0,0,0,1,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '\' (92) + 0,0,0,0,0,0, + 0,1,0,0,0,0, + 0,1,0,0,0,0, + 0,1,0,0,0,0, + 0,1,0,1,1,0, + 0,0,0,0,0,1, + 0,0,0,0,1,0, + 0,0,0,1,0,0, + 0,0,0,1,1,1, + 0,0,0,0,0,0 +, + // Character ']' (93) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,1,0,0, + 0,0,0,0,1,0, + 0,1,1,1,1,1, + 0,0,0,0,1,0, + 0,0,0,1,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '^' (94) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,1,0,0, + 0,0,1,1,1,0, + 0,1,0,1,0,1, + 0,0,0,1,0,0, + 0,0,0,1,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '_' (95) + 0,0,0,0,0,0, + 0,0,1,0,1,0, + 0,0,1,0,1,0, + 0,1,1,1,1,1, + 0,0,1,0,1,0, + 0,1,1,1,1,1, + 0,0,1,0,1,0, + 0,0,1,0,1,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0 +, + // Character '`' (96) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,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,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'a' (97) + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,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,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'b' (98) + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,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,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'c' (99) + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,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,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'd' (100) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'e' (101) + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'f' (102) + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'g' (103) + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'h' (104) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'i' (105) + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'j' (106) + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'k' (107) + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'l' (108) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'm' (109) + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'n' (110) + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'o' (111) + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'p' (112) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 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,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'q' (113) + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 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,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'r' (114) + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 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,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 's' (115) + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 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,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 't' (116) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'u' (117) + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'v' (118) + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'w' (119) + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'x' (120) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0 +, + // Character 'y' (121) + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 1,1,1,1,1,0, + 1,1,1,1,1,0, + 0,0,0,0,0,0 +, + // Character 'z' (122) + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0 +, + // Character '{' (123) + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0 +, + // Character '|' (124) + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0 +, + // Character '}' (125) + 1,1,0,0,0,0, + 1,1,0,0,0,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0 +, + // Character '~' (126) + 0,0,0,1,1,0, + 0,0,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0 +, + // Character '' (127) + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0, + 1,1,0,1,1,0, + 1,1,0,1,1,0, + 0,0,0,0,0,0 +}; diff --git a/src/cmos.c b/src/cmos.c index 4ec8f0db..c0ba63a6 100644 --- a/src/cmos.c +++ b/src/cmos.c @@ -1,95 +1,95 @@ -/*B-em v2.2 by Tom Walker - Master 128 CMOS emulation*/ - -/*Master 128 uses a HD146818 - - It is connected as - - - System VIA PB6 - enable - System VIA PB7 - address strobe - IC32 B1 - RW - IC32 B2 - D - Slow data bus - data*/ -#include -#include "b-em.h" -#include "via.h" -#include "sysvia.h" -#include "model.h" -#include "cmos.h" -#include "compactcmos.h" - -static uint8_t cmos[64]; - -static int cmos_old, cmos_addr, cmos_ena, cmos_rw; - -static uint8_t cmos_data; - -void cmos_update(uint8_t IC32, uint8_t sdbval) -{ - int cmos_strobe; - cmos_rw = IC32 & 2; - cmos_strobe = (IC32 & 4) ^ cmos_old; - cmos_old = IC32 & 4; -// rpclog("CMOS update %i %i %i\n",cmos_rw,cmos_strobe,cmos_old); - if (cmos_strobe && cmos_ena) - { - if (!cmos_rw && cmos_addr > 0xB && !(IC32 & 4)) /*Write triggered on low -> high on D*/ - cmos[cmos_addr] = sdbval; - - if (cmos_rw && (IC32 & 4)) /*Read data output while D high*/ - cmos_data = cmos[cmos_addr]; - } -} - -void cmos_writeaddr(uint8_t val) -{ - if (val&0x80) /*Latch address*/ - cmos_addr = sdbval & 63; - cmos_ena = val & 0x40; -// rpclog("CMOS writeaddr %02X %02X %02X\n",val,sdbval,cmos_addr); -} - -uint8_t cmos_read() -{ -// rpclog("CMOS read ORAnh %02X %02X %i %02X %i\n",cmos_addr,cmos[cmos_addr],cmos_ena,IC32,cmos_rw); - if (cmos_ena && (IC32 & 4) && cmos_rw) return cmos_data; /*To drive bus, CMOS must be enabled, - D must be high, RW must be high*/ - return 0xff; -} - -void cmos_load(MODEL m) -{ - FILE *f; - char fn[512]; - if (!m.cmos[0]) return; - if (m.compact) compactcmos_load(m); - else - { - sprintf(fn, "%s%s", exedir, m.cmos); - rpclog("CMOS Opening %s\n", fn); - f=fopen(fn, "rb"); - if (!f) - { - memset(cmos, 0, 64); - return; - } - fread(cmos, 64, 1, f); - fclose(f); - } -} - -void cmos_save(MODEL m) -{ - FILE *f; - char fn[512]; - if (!m.cmos[0]) return; - if (m.compact) compactcmos_save(m); - else - { - sprintf(fn, "%s%s", exedir, m.cmos); - rpclog("CMOS Opening %s\n", fn); - f=fopen(fn, "wb"); - fwrite(cmos, 64, 1, f); - fclose(f); - } -} +/*B-em v2.2 by Tom Walker + Master 128 CMOS emulation*/ + +/*Master 128 uses a HD146818 + + It is connected as - + + System VIA PB6 - enable + System VIA PB7 - address strobe + IC32 B1 - RW + IC32 B2 - D + Slow data bus - data*/ +#include +#include "b-em.h" +#include "via.h" +#include "sysvia.h" +#include "model.h" +#include "cmos.h" +#include "compactcmos.h" + +static uint8_t cmos[64]; + +static int cmos_old, cmos_addr, cmos_ena, cmos_rw; + +static uint8_t cmos_data; + +void cmos_update(uint8_t IC32, uint8_t sdbval) +{ + int cmos_strobe; + cmos_rw = IC32 & 2; + cmos_strobe = (IC32 & 4) ^ cmos_old; + cmos_old = IC32 & 4; +// rpclog("CMOS update %i %i %i\n",cmos_rw,cmos_strobe,cmos_old); + if (cmos_strobe && cmos_ena) + { + if (!cmos_rw && cmos_addr > 0xB && !(IC32 & 4)) /*Write triggered on low -> high on D*/ + cmos[cmos_addr] = sdbval; + + if (cmos_rw && (IC32 & 4)) /*Read data output while D high*/ + cmos_data = cmos[cmos_addr]; + } +} + +void cmos_writeaddr(uint8_t val) +{ + if (val&0x80) /*Latch address*/ + cmos_addr = sdbval & 63; + cmos_ena = val & 0x40; +// rpclog("CMOS writeaddr %02X %02X %02X\n",val,sdbval,cmos_addr); +} + +uint8_t cmos_read() +{ +// rpclog("CMOS read ORAnh %02X %02X %i %02X %i\n",cmos_addr,cmos[cmos_addr],cmos_ena,IC32,cmos_rw); + if (cmos_ena && (IC32 & 4) && cmos_rw) return cmos_data; /*To drive bus, CMOS must be enabled, + D must be high, RW must be high*/ + return 0xff; +} + +void cmos_load(MODEL m) +{ + FILE *f; + char fn[512]; + if (!m.cmos[0]) return; + if (m.compact) compactcmos_load(m); + else + { + sprintf(fn, "%s%s", exedir, m.cmos); + rpclog("CMOS Opening %s\n", fn); + f=fopen(fn, "rb"); + if (!f) + { + memset(cmos, 0, 64); + return; + } + fread(cmos, 64, 1, f); + fclose(f); + } +} + +void cmos_save(MODEL m) +{ + FILE *f; + char fn[512]; + if (!m.cmos[0]) return; + if (m.compact) compactcmos_save(m); + else + { + sprintf(fn, "%s%s", exedir, m.cmos); + rpclog("CMOS Opening %s\n", fn); + f=fopen(fn, "wb"); + fwrite(cmos, 64, 1, f); + fclose(f); + } +} diff --git a/src/cmos.h b/src/cmos.h index 3df1681b..00fdea42 100644 --- a/src/cmos.h +++ b/src/cmos.h @@ -1,5 +1,5 @@ -void cmos_update(uint8_t IC32, uint8_t sdbval); -void cmos_writeaddr(uint8_t val); -uint8_t cmos_read(); -void cmos_load(MODEL m); -void cmos_save(MODEL m); +void cmos_update(uint8_t IC32, uint8_t sdbval); +void cmos_writeaddr(uint8_t val); +uint8_t cmos_read(); +void cmos_load(MODEL m); +void cmos_save(MODEL m); diff --git a/src/compact_joystick.c b/src/compact_joystick.c index 3e03e863..ac8b74fe 100644 --- a/src/compact_joystick.c +++ b/src/compact_joystick.c @@ -1,20 +1,20 @@ -#include -#include "b-em.h" -#include "compact_joystick.h" - -uint8_t compact_joystick_read() -{ -/*Master Compact inputs : - PB4 - right - PB3 - up - PB2 - down - PB1 - left - PB0 - fire*/ - uint8_t temp = 0xFF; - if (joy[0].stick[0].axis[0].pos >= 64) temp &= ~0x10; - if (joy[0].stick[0].axis[0].pos <= -64) temp &= ~0x02; - if (joy[0].stick[0].axis[1].pos >= 64) temp &= ~0x04; - if (joy[0].stick[0].axis[1].pos <= -64) temp &= ~0x08; - if (joybutton[0]) temp &= ~0x01; - return temp; -} +#include +#include "b-em.h" +#include "compact_joystick.h" + +uint8_t compact_joystick_read() +{ +/*Master Compact inputs : + PB4 - right + PB3 - up + PB2 - down + PB1 - left + PB0 - fire*/ + uint8_t temp = 0xFF; + if (joy[0].stick[0].axis[0].pos >= 64) temp &= ~0x10; + if (joy[0].stick[0].axis[0].pos <= -64) temp &= ~0x02; + if (joy[0].stick[0].axis[1].pos >= 64) temp &= ~0x04; + if (joy[0].stick[0].axis[1].pos <= -64) temp &= ~0x08; + if (joybutton[0]) temp &= ~0x01; + return temp; +} diff --git a/src/compact_joystick.h b/src/compact_joystick.h index 1a93793b..c6d2c460 100644 --- a/src/compact_joystick.h +++ b/src/compact_joystick.h @@ -1 +1 @@ -extern uint8_t compact_joystick_read(); +extern uint8_t compact_joystick_read(); diff --git a/src/compactcmos.c b/src/compactcmos.c index afc214a4..2c2935b2 100644 --- a/src/compactcmos.c +++ b/src/compactcmos.c @@ -1,221 +1,221 @@ -/*B-em v2.2 by Tom Walker - I2C + CMOS RAM emulation for Master Compact*/ -#include -#include "b-em.h" -#include "model.h" - -int i2c_clock = 1, i2c_data = 1; - -static int cmos_state = 0; -static int i2c_state = 0; -static uint8_t i2c_byte; -static int i2c_pos; -static int i2c_transmit = -1; - -static int lastdata; - -#define CMOS 1 -#define ARM -1 - -#define I2C_IDLE 0 -#define I2C_RECIEVE 1 -#define I2C_TRANSMIT 2 -#define I2C_ACKNOWLEDGE 3 -#define I2C_TRANSACKNOWLEDGE 4 - -#define CMOS_IDLE 0 -#define CMOS_RECIEVEADDR 1 -#define CMOS_RECIEVEDATA 2 -#define CMOS_SENDDATA 3 - -static int cmos_rw; - -static uint8_t cmos_addr = 0; -static uint8_t cmos_ram[256]; - -void compactcmos_load(MODEL m) -{ - FILE *cmosf; - char fn[512]; - sprintf(fn, "%s%s", exedir, m.cmos); - cmosf = fopen(fn, "rb"); - if (cmosf) - { - fread(cmos_ram, 128, 1, cmosf); - fclose(cmosf); - } - else - memset(cmos_ram, 0, 128); -} - -void compactcmos_save(MODEL m) -{ - FILE *cmosf; - char fn[512]; - sprintf(fn, "%s%s", exedir, m.cmos); - cmosf = fopen(fn, "wb"); - fwrite(cmos_ram, 128, 1, cmosf); - fclose(cmosf); -} - -static void cmos_stop() -{ - cmos_state = CMOS_IDLE; - i2c_transmit = ARM; -} - -static void cmos_nextbyte() -{ - i2c_byte = cmos_ram[(cmos_addr++) & 0x7F]; -} - -static void cmos_write(uint8_t byte) -{ -// rpclog("CMOS write - %02X %i %02X\n",byte,cmos_state,cmos_addr&0x7F); - switch (cmos_state) - { - case CMOS_IDLE: - cmos_rw = byte&1; -// rpclog("cmos_rw %i\n",cmos_rw); - if (cmos_rw) - { - cmos_state = CMOS_SENDDATA; - i2c_transmit = CMOS; - i2c_byte = cmos_ram[(cmos_addr++) & 0x7F]; - } - else - { - cmos_state = CMOS_RECIEVEADDR; - i2c_transmit = ARM; - } - return; - - case CMOS_RECIEVEADDR: - cmos_addr = byte; -// rpclog("Set CMOS addr %02X %i\n",byte,cmos_rw); - if (cmos_rw) - cmos_state = CMOS_SENDDATA; - else - cmos_state = CMOS_RECIEVEDATA; - break; - - case CMOS_RECIEVEDATA: -// rpclog("Rec byte - %02X\n",cmos_ram[(cmos_addr)&0x7F]); - cmos_ram[(cmos_addr++) & 0x7F] = byte; - break; - - case CMOS_SENDDATA: - i2c_byte = cmos_ram[(cmos_addr++) & 0x7F]; - break; -// closevideo(); -// printf("Send data %02X\n",cmos_addr); -// exit(-1); - } -} - -void compactcmos_i2cchange(int nuclock, int nudata) -{ -// rpclog("cmos_rw %i\n",cmos_rw); -// printf("I2C %i %i %i %i %i\n",i2c_clock,nuclock,i2c_data,nudata,i2c_state); -// log("I2C update clock %i %i data %i %i state %i\n",i2c_clock,nuclock,i2c_data,nudata,i2c_state); - switch (i2c_state) - { - case I2C_IDLE: - if (i2c_clock && nuclock) - { - if (lastdata && !nudata) /*Start bit*/ - { -// printf("Start bit\n"); -// rpclog("Start bit recieved\n"); - i2c_state = I2C_RECIEVE; - i2c_pos = 0; - } - } - break; - - case I2C_RECIEVE: - if (!i2c_clock && nuclock) - { -// printf("Reciving %07X %07X\n",(*armregs[15]-8)&0x3FFFFFC,(*armregs[14]-8)&0x3FFFFFC); - i2c_byte <<= 1; - if (nudata) - i2c_byte |= 1; - else - i2c_byte &= 0xFE; - i2c_pos++; - if (i2c_pos == 8) - { -// if (output) //logfile("Complete - byte %02X %07X %07X\n",i2c_byte,(*armregs[15]-8)&0x3FFFFFC,(*armregs[14]-8)&0x3FFFFFC); - cmos_write(i2c_byte); - i2c_state = I2C_ACKNOWLEDGE; - } - } - else if (i2c_clock && nuclock && nudata && !lastdata) /*Stop bit*/ - { -// rpclog("Stop bit recieved\n"); - i2c_state = I2C_IDLE; - cmos_stop(); - } - else if (i2c_clock && nuclock && !nudata && lastdata) /*Start bit*/ - { -// rpclog("Start bit recieved\n"); - i2c_pos = 0; - cmos_state = CMOS_IDLE; - } - break; - - case I2C_ACKNOWLEDGE: - if (!i2c_clock && nuclock) - { -// rpclog("Acknowledging transfer\n"); - nudata = 0; - i2c_pos = 0; - if (i2c_transmit == ARM) - i2c_state = I2C_RECIEVE; - else - i2c_state = I2C_TRANSMIT; - } - break; - - case I2C_TRANSACKNOWLEDGE: - if (!i2c_clock && nuclock) - { - if (nudata) /*It's not acknowledged - must be end of transfer*/ - { -// rpclog("End of transfer\n"); - i2c_state = I2C_IDLE; - cmos_stop(); - } - else /*Next byte to transfer*/ - { - i2c_state = I2C_TRANSMIT; - cmos_nextbyte(); - i2c_pos = 0; -// rpclog("Next byte - %02X %02X\n",i2c_byte,cmos_addr); - } - } - break; - - case I2C_TRANSMIT: - if (!i2c_clock && nuclock) - { - i2c_data = nudata = i2c_byte & 128; - i2c_byte <<= 1; - i2c_pos++; -// if (output) rpclog("Transfering bit at %07X %i %02X\n",(*armregs[15]-8)&0x3FFFFFC,i2c_pos,cmos_addr); - if (i2c_pos == 8) - { - i2c_state = I2C_TRANSACKNOWLEDGE; -// rpclog("Acknowledge mode\n"); - } - i2c_clock = nuclock; - return; - } - break; - - } - if (!i2c_clock && nuclock) - i2c_data = nudata; - lastdata = nudata; - i2c_clock = nuclock; -} +/*B-em v2.2 by Tom Walker + I2C + CMOS RAM emulation for Master Compact*/ +#include +#include "b-em.h" +#include "model.h" + +int i2c_clock = 1, i2c_data = 1; + +static int cmos_state = 0; +static int i2c_state = 0; +static uint8_t i2c_byte; +static int i2c_pos; +static int i2c_transmit = -1; + +static int lastdata; + +#define CMOS 1 +#define ARM -1 + +#define I2C_IDLE 0 +#define I2C_RECIEVE 1 +#define I2C_TRANSMIT 2 +#define I2C_ACKNOWLEDGE 3 +#define I2C_TRANSACKNOWLEDGE 4 + +#define CMOS_IDLE 0 +#define CMOS_RECIEVEADDR 1 +#define CMOS_RECIEVEDATA 2 +#define CMOS_SENDDATA 3 + +static int cmos_rw; + +static uint8_t cmos_addr = 0; +static uint8_t cmos_ram[256]; + +void compactcmos_load(MODEL m) +{ + FILE *cmosf; + char fn[512]; + sprintf(fn, "%s%s", exedir, m.cmos); + cmosf = fopen(fn, "rb"); + if (cmosf) + { + fread(cmos_ram, 128, 1, cmosf); + fclose(cmosf); + } + else + memset(cmos_ram, 0, 128); +} + +void compactcmos_save(MODEL m) +{ + FILE *cmosf; + char fn[512]; + sprintf(fn, "%s%s", exedir, m.cmos); + cmosf = fopen(fn, "wb"); + fwrite(cmos_ram, 128, 1, cmosf); + fclose(cmosf); +} + +static void cmos_stop() +{ + cmos_state = CMOS_IDLE; + i2c_transmit = ARM; +} + +static void cmos_nextbyte() +{ + i2c_byte = cmos_ram[(cmos_addr++) & 0x7F]; +} + +static void cmos_write(uint8_t byte) +{ +// rpclog("CMOS write - %02X %i %02X\n",byte,cmos_state,cmos_addr&0x7F); + switch (cmos_state) + { + case CMOS_IDLE: + cmos_rw = byte&1; +// rpclog("cmos_rw %i\n",cmos_rw); + if (cmos_rw) + { + cmos_state = CMOS_SENDDATA; + i2c_transmit = CMOS; + i2c_byte = cmos_ram[(cmos_addr++) & 0x7F]; + } + else + { + cmos_state = CMOS_RECIEVEADDR; + i2c_transmit = ARM; + } + return; + + case CMOS_RECIEVEADDR: + cmos_addr = byte; +// rpclog("Set CMOS addr %02X %i\n",byte,cmos_rw); + if (cmos_rw) + cmos_state = CMOS_SENDDATA; + else + cmos_state = CMOS_RECIEVEDATA; + break; + + case CMOS_RECIEVEDATA: +// rpclog("Rec byte - %02X\n",cmos_ram[(cmos_addr)&0x7F]); + cmos_ram[(cmos_addr++) & 0x7F] = byte; + break; + + case CMOS_SENDDATA: + i2c_byte = cmos_ram[(cmos_addr++) & 0x7F]; + break; +// closevideo(); +// printf("Send data %02X\n",cmos_addr); +// exit(-1); + } +} + +void compactcmos_i2cchange(int nuclock, int nudata) +{ +// rpclog("cmos_rw %i\n",cmos_rw); +// printf("I2C %i %i %i %i %i\n",i2c_clock,nuclock,i2c_data,nudata,i2c_state); +// log("I2C update clock %i %i data %i %i state %i\n",i2c_clock,nuclock,i2c_data,nudata,i2c_state); + switch (i2c_state) + { + case I2C_IDLE: + if (i2c_clock && nuclock) + { + if (lastdata && !nudata) /*Start bit*/ + { +// printf("Start bit\n"); +// rpclog("Start bit recieved\n"); + i2c_state = I2C_RECIEVE; + i2c_pos = 0; + } + } + break; + + case I2C_RECIEVE: + if (!i2c_clock && nuclock) + { +// printf("Reciving %07X %07X\n",(*armregs[15]-8)&0x3FFFFFC,(*armregs[14]-8)&0x3FFFFFC); + i2c_byte <<= 1; + if (nudata) + i2c_byte |= 1; + else + i2c_byte &= 0xFE; + i2c_pos++; + if (i2c_pos == 8) + { +// if (output) //logfile("Complete - byte %02X %07X %07X\n",i2c_byte,(*armregs[15]-8)&0x3FFFFFC,(*armregs[14]-8)&0x3FFFFFC); + cmos_write(i2c_byte); + i2c_state = I2C_ACKNOWLEDGE; + } + } + else if (i2c_clock && nuclock && nudata && !lastdata) /*Stop bit*/ + { +// rpclog("Stop bit recieved\n"); + i2c_state = I2C_IDLE; + cmos_stop(); + } + else if (i2c_clock && nuclock && !nudata && lastdata) /*Start bit*/ + { +// rpclog("Start bit recieved\n"); + i2c_pos = 0; + cmos_state = CMOS_IDLE; + } + break; + + case I2C_ACKNOWLEDGE: + if (!i2c_clock && nuclock) + { +// rpclog("Acknowledging transfer\n"); + nudata = 0; + i2c_pos = 0; + if (i2c_transmit == ARM) + i2c_state = I2C_RECIEVE; + else + i2c_state = I2C_TRANSMIT; + } + break; + + case I2C_TRANSACKNOWLEDGE: + if (!i2c_clock && nuclock) + { + if (nudata) /*It's not acknowledged - must be end of transfer*/ + { +// rpclog("End of transfer\n"); + i2c_state = I2C_IDLE; + cmos_stop(); + } + else /*Next byte to transfer*/ + { + i2c_state = I2C_TRANSMIT; + cmos_nextbyte(); + i2c_pos = 0; +// rpclog("Next byte - %02X %02X\n",i2c_byte,cmos_addr); + } + } + break; + + case I2C_TRANSMIT: + if (!i2c_clock && nuclock) + { + i2c_data = nudata = i2c_byte & 128; + i2c_byte <<= 1; + i2c_pos++; +// if (output) rpclog("Transfering bit at %07X %i %02X\n",(*armregs[15]-8)&0x3FFFFFC,i2c_pos,cmos_addr); + if (i2c_pos == 8) + { + i2c_state = I2C_TRANSACKNOWLEDGE; +// rpclog("Acknowledge mode\n"); + } + i2c_clock = nuclock; + return; + } + break; + + } + if (!i2c_clock && nuclock) + i2c_data = nudata; + lastdata = nudata; + i2c_clock = nuclock; +} diff --git a/src/compactcmos.h b/src/compactcmos.h index 33a07e2a..5c0f3472 100644 --- a/src/compactcmos.h +++ b/src/compactcmos.h @@ -1,5 +1,5 @@ -void compactcmos_load(MODEL m); -void compactcmos_save(MODEL m); -void compactcmos_i2cchange(int nuclock, int nudata); - -extern int i2c_clock, i2c_data; +void compactcmos_load(MODEL m); +void compactcmos_save(MODEL m); +void compactcmos_i2cchange(int nuclock, int nudata); + +extern int i2c_clock, i2c_data; diff --git a/src/config.c b/src/config.c index a9009f9a..7016c349 100644 --- a/src/config.c +++ b/src/config.c @@ -1,137 +1,137 @@ -/*B-em v2.2 by Tom Walker - Configuration handling*/ - -#include -#include "b-em.h" - -#include "config.h" -#include "ddnoise.h" -#include "disc.h" -#include "keyboard.h" -#include "mouse.h" -#include "ide.h" -#include "sn76489.h" -#include "sound.h" -#include "tape.h" -#include "tube.h" -#include "video_render.h" - -int curmodel; -int fasttape = 0; -int selecttube = -1; -int cursid = 0; -int sidmethod = 0; - -void config_load() -{ - int c; - char s[256]; - char *p; - sprintf(s, "%sb-em.cfg", exedir); - //printf("%s\n",s); - set_config_file(s); - - p = (char *)get_config_string(NULL, "disc0", NULL); - if (p) strcpy(discfns[0], p); - else discfns[0][0] = 0; - p = (char *)get_config_string(NULL, "disc1", NULL); - if (p) strcpy(discfns[1], p); - else discfns[1][0] = 0; -// p=(char *)get_config_string(NULL,"tape",NULL); -// if (p) strcpy(tapefn,p); - /*else */tape_fn[0] = 0; - - defaultwriteprot = get_config_int(NULL, "defaultwriteprotect", 1); - - curmodel = get_config_int(NULL, "model", 3); - selecttube = get_config_int(NULL, "tube", -1); - tube_6502_speed = get_config_int(NULL, "tube6502speed", 1); - - sound_internal = get_config_int(NULL, "sndinternal", 1); - sound_beebsid = get_config_int(NULL, "sndbeebsid", 1); - sound_dac = get_config_int(NULL, "snddac ", 0); - sound_ddnoise = get_config_int(NULL, "sndddnoise", 1); - sound_tape = get_config_int(NULL, "sndtape", 0); - - sound_filter = get_config_int(NULL, "soundfilter", 1); - curwave = get_config_int(NULL, "soundwave", 0); - - sidmethod = get_config_int(NULL, "sidmethod", 0); - cursid = get_config_int(NULL, "cursid", 2); - - ddnoise_vol = get_config_int(NULL, "ddvol", 2); - ddnoise_type = get_config_int(NULL, "ddtype", 0); - - vid_fullborders = get_config_int(NULL, "fullborders", 1); - - c = get_config_int(NULL, "displaymode", 3); - vid_scanlines = (c == 2); - vid_interlace = (c == 1) || (c == 5); - vid_linedbl = (c == 3); - vid_pal = (c == 4) || (c == 5); - videoresize = get_config_int(NULL, "video_resize", 0); - - fasttape = get_config_int(NULL, "fasttape", 0); - - ide_enable = get_config_int(NULL, "ideenable", 0); - - keyas = get_config_int(NULL, "key_as", 0); - - mouse_amx = get_config_int(NULL, "mouse_amx", 0); - - for (c = 0; c < 128; c++) - { - sprintf(s, "key_define_%03i", c); - keylookup[c] = get_config_int("user_keyboard", s, c); - } -} - -void config_save() -{ - int c; - char s[256]; - sprintf(s, "%sb-em.cfg", exedir); - set_config_file(s); - set_config_string(NULL, "disc0", discfns[0]); - set_config_string(NULL, "disc1", discfns[1]); -// set_config_string(NULL,"tape",tape_fn); - - set_config_int(NULL, "defaultwriteprotect", defaultwriteprot); - - set_config_int(NULL, "model", curmodel); - set_config_int(NULL, "tube", selecttube); - set_config_int(NULL, "tube6502speed", tube_6502_speed); - - set_config_int(NULL, "sndinternal", sound_internal); - set_config_int(NULL, "sndbeebsid", sound_beebsid); - set_config_int(NULL, "snddac", sound_dac); - set_config_int(NULL, "sndddnoise", sound_ddnoise); - set_config_int(NULL, "sndtape", sound_tape); - - set_config_int(NULL, "soundfilter", sound_filter); - set_config_int(NULL, "soundwave", curwave); - - set_config_int(NULL, "sidmethod", sidmethod); - set_config_int(NULL, "cursid", cursid); - - set_config_int(NULL, "ddvol", ddnoise_vol); - set_config_int(NULL, "ddtype", ddnoise_type); - - set_config_int(NULL, "fullborders", vid_fullborders); - set_config_int(NULL, "displaymode", (vid_pal && vid_interlace) ? 5 : (vid_scanlines ? 2 : (vid_interlace ? 1 : (vid_linedbl ? 3 : (vid_pal ? 4 : 0))))); - set_config_int(NULL, "video_resize", videoresize); - - set_config_int(NULL, "fasttape", fasttape); - - set_config_int(NULL, "ideenable", ide_enable); - - set_config_int(NULL, "key_as", keyas); - - set_config_int(NULL, "mouse_amx", mouse_amx); - - for (c = 0; c < 128; c++) - { - sprintf(s, "key_define_%03i", c); - set_config_int("user_keyboard", s, keylookup[c]); - } -} +/*B-em v2.2 by Tom Walker + Configuration handling*/ + +#include +#include "b-em.h" + +#include "config.h" +#include "ddnoise.h" +#include "disc.h" +#include "keyboard.h" +#include "mouse.h" +#include "ide.h" +#include "sn76489.h" +#include "sound.h" +#include "tape.h" +#include "tube.h" +#include "video_render.h" + +int curmodel; +int fasttape = 0; +int selecttube = -1; +int cursid = 0; +int sidmethod = 0; + +void config_load() +{ + int c; + char s[256]; + char *p; + sprintf(s, "%sb-em.cfg", exedir); + //printf("%s\n",s); + set_config_file(s); + + p = (char *)get_config_string(NULL, "disc0", NULL); + if (p) strcpy(discfns[0], p); + else discfns[0][0] = 0; + p = (char *)get_config_string(NULL, "disc1", NULL); + if (p) strcpy(discfns[1], p); + else discfns[1][0] = 0; +// p=(char *)get_config_string(NULL,"tape",NULL); +// if (p) strcpy(tapefn,p); + /*else */tape_fn[0] = 0; + + defaultwriteprot = get_config_int(NULL, "defaultwriteprotect", 1); + + curmodel = get_config_int(NULL, "model", 3); + selecttube = get_config_int(NULL, "tube", -1); + tube_6502_speed = get_config_int(NULL, "tube6502speed", 1); + + sound_internal = get_config_int(NULL, "sndinternal", 1); + sound_beebsid = get_config_int(NULL, "sndbeebsid", 1); + sound_dac = get_config_int(NULL, "snddac ", 0); + sound_ddnoise = get_config_int(NULL, "sndddnoise", 1); + sound_tape = get_config_int(NULL, "sndtape", 0); + + sound_filter = get_config_int(NULL, "soundfilter", 1); + curwave = get_config_int(NULL, "soundwave", 0); + + sidmethod = get_config_int(NULL, "sidmethod", 0); + cursid = get_config_int(NULL, "cursid", 2); + + ddnoise_vol = get_config_int(NULL, "ddvol", 2); + ddnoise_type = get_config_int(NULL, "ddtype", 0); + + vid_fullborders = get_config_int(NULL, "fullborders", 1); + + c = get_config_int(NULL, "displaymode", 3); + vid_scanlines = (c == 2); + vid_interlace = (c == 1) || (c == 5); + vid_linedbl = (c == 3); + vid_pal = (c == 4) || (c == 5); + videoresize = get_config_int(NULL, "video_resize", 0); + + fasttape = get_config_int(NULL, "fasttape", 0); + + ide_enable = get_config_int(NULL, "ideenable", 0); + + keyas = get_config_int(NULL, "key_as", 0); + + mouse_amx = get_config_int(NULL, "mouse_amx", 0); + + for (c = 0; c < 128; c++) + { + sprintf(s, "key_define_%03i", c); + keylookup[c] = get_config_int("user_keyboard", s, c); + } +} + +void config_save() +{ + int c; + char s[256]; + sprintf(s, "%sb-em.cfg", exedir); + set_config_file(s); + set_config_string(NULL, "disc0", discfns[0]); + set_config_string(NULL, "disc1", discfns[1]); +// set_config_string(NULL,"tape",tape_fn); + + set_config_int(NULL, "defaultwriteprotect", defaultwriteprot); + + set_config_int(NULL, "model", curmodel); + set_config_int(NULL, "tube", selecttube); + set_config_int(NULL, "tube6502speed", tube_6502_speed); + + set_config_int(NULL, "sndinternal", sound_internal); + set_config_int(NULL, "sndbeebsid", sound_beebsid); + set_config_int(NULL, "snddac", sound_dac); + set_config_int(NULL, "sndddnoise", sound_ddnoise); + set_config_int(NULL, "sndtape", sound_tape); + + set_config_int(NULL, "soundfilter", sound_filter); + set_config_int(NULL, "soundwave", curwave); + + set_config_int(NULL, "sidmethod", sidmethod); + set_config_int(NULL, "cursid", cursid); + + set_config_int(NULL, "ddvol", ddnoise_vol); + set_config_int(NULL, "ddtype", ddnoise_type); + + set_config_int(NULL, "fullborders", vid_fullborders); + set_config_int(NULL, "displaymode", (vid_pal && vid_interlace) ? 5 : (vid_scanlines ? 2 : (vid_interlace ? 1 : (vid_linedbl ? 3 : (vid_pal ? 4 : 0))))); + set_config_int(NULL, "video_resize", videoresize); + + set_config_int(NULL, "fasttape", fasttape); + + set_config_int(NULL, "ideenable", ide_enable); + + set_config_int(NULL, "key_as", keyas); + + set_config_int(NULL, "mouse_amx", mouse_amx); + + for (c = 0; c < 128; c++) + { + sprintf(s, "key_define_%03i", c); + set_config_int("user_keyboard", s, keylookup[c]); + } +} diff --git a/src/config.h b/src/config.h index 20903020..4a9147e1 100644 --- a/src/config.h +++ b/src/config.h @@ -1,5 +1,5 @@ -void config_load(); -void config_save(); - -extern int curmodel; -extern int selecttube; +void config_load(); +void config_save(); + +extern int curmodel; +extern int selecttube; diff --git a/src/csw.c b/src/csw.c index 15a23b55..f075cede 100644 --- a/src/csw.c +++ b/src/csw.c @@ -1,289 +1,285 @@ -/*B-em v2.2 by Tom Walker - CSW cassette support*/ -#include -#include -#include -#include "b-em.h" -#include "acia.h" -#include "csw.h" -#include "tape.h" - -int csw_toneon=0; - -static int csw_intone = 1, csw_indat = 0, csw_datbits = 0, csw_enddat = 0; -static FILE *csw_f = NULL; -static uint8_t *csw_dat = NULL; -static int csw_point; -static uint8_t csw_head[0x34]; -static int csw_skip = 0; -static int csw_loop = 1; -int csw_ena; - -void csw_load(char *fn) -{ - int end,c; - uLongf destlen = 8 * 1024 * 1024; - uint8_t *tempin; - if (csw_f) fclose(csw_f); - if (csw_dat) free(csw_dat); - csw_ena = 1; - /*Allocate buffer*/ - csw_dat = malloc(8 * 1024 * 1024); - /*Open file and get size*/ - csw_f = fopen(fn,"rb"); - if (!csw_f) - { - free(csw_dat); - csw_dat = NULL; - return; - } - fseek(csw_f, -1, SEEK_END); - end = ftell(csw_f) + 1; - fseek(csw_f, 0, SEEK_SET); - /*Read header*/ - fread(csw_head, 0x34, 1, csw_f); - for (c = 0; c < csw_head[0x23]; c++) getc(csw_f); - /*Allocate temporary memory and read file into memory*/ - end -= ftell(csw_f); - tempin = malloc(end); - fread(tempin, end, 1, csw_f); - fclose(csw_f); - csw_f = NULL; -// sprintf(csws,"Decompressing %i %i\n",destlen,end); -// fputs(csws,cswlog); - /*Decompress*/ - uncompress(csw_dat, (unsigned long *)&destlen, tempin, end); - free(tempin); - /*Reset data pointer*/ - csw_point = 0; - dcd(); - tapellatch = (1000000 / (1200 / 10)) / 64; - tapelcount = 0; - tape_loaded = 1; -} - -void csw_close() -{ - if (csw_f) fclose(csw_f); - if (csw_dat) free(csw_dat); - csw_dat = NULL; - csw_f = NULL; -} - -int ffound, fdat; -int infilenames; -static void csw_receive(uint8_t val) -{ - csw_toneon--; - if (infilenames) - { - ffound = 1; - fdat = val; - } - else - acia_receive(val); -} - -void csw_poll() -{ - int c; - uint8_t dat; -// if (!csw_dat) return; - - for (c = 0; c < 10; c++) - { - /*If no tape is loaded or user managed to eject tape during this loop then give up now*/ - if (!tape_loaded) return; - - dat = csw_dat[csw_point++]; - - if (csw_point >= (8 * 1024 * 1024)) - { - csw_point = 0; - csw_loop = 1; - } - if (csw_skip) - csw_skip--; - else if (csw_intone && dat > 0xD) /*Not in tone any more - data start bit*/ - { - csw_point++; /*Skip next half of wave*/ - if (acia_tapespeed) csw_skip = 6; - csw_intone = 0; - csw_indat = 1; - - csw_datbits = csw_enddat = 0; - dcdlow(); - return; - } - else if (csw_indat && csw_datbits != -1 && csw_datbits != -2) - { - csw_point++; /*Skip next half of wave*/ - if (acia_tapespeed) csw_skip = 6; - csw_enddat >>= 1; - - if (dat <= 0xD) - { - csw_point += 2; - if (acia_tapespeed) csw_skip += 6; - csw_enddat |= 0x80; - } - csw_datbits++; - if (csw_datbits == 8) - { - csw_receive(csw_enddat); - - csw_datbits = -2; - return; - } - } - else if (csw_indat && csw_datbits == -2) /*Deal with stop bit*/ - { - csw_point++; - if (acia_tapespeed) csw_skip = 6; - if (dat <= 0xD) - { - csw_point += 2; - if (acia_tapespeed) csw_skip += 6; - } - csw_datbits = -1; - } - else if (csw_indat && csw_datbits == -1) - { - if (dat <= 0xD) /*Back in tone again*/ - { - dcd(); - csw_toneon = 2; - csw_indat = 0; - csw_intone = 1; - csw_datbits = 0; - return; - } - else /*Start bit*/ - { - csw_point++; /*Skip next half of wave*/ - if (acia_tapespeed) csw_skip += 6; - csw_datbits = 0; - csw_enddat = 0; - } - } - } -} - -#define getcswbyte() ffound = 0; \ - while (!ffound && !csw_loop) \ - { \ - csw_poll(); \ - } \ - if (csw_loop) break; - -static uint8_t ffilename[16]; -void csw_findfilenames() -{ - int temp, temps, tempd, tempi, tempsk, tempspd; - uint8_t tb; - int c; - int fsize = 0; - char s[256]; - uint32_t run, load; - uint8_t status; - int skip; - if (!csw_dat) return; - startblit(); - temp = csw_point; - temps = csw_indat; - tempi = csw_intone; - tempd = csw_datbits; - tempsk = csw_skip; - tempspd = acia_tapespeed; - csw_point = 0; - - csw_indat = csw_intone = csw_datbits = csw_skip = 0; - csw_intone = 1; - acia_tapespeed = 0; - -// gzseek(csw,12,SEEK_SET); - csw_loop = 0; - infilenames = 1; - while (!csw_loop) - { -// rpclog("Start\n"); - ffound = 0; - while (!ffound && !csw_loop) - { - csw_poll(); - } - if (csw_loop) break; -// rpclog("FDAT %02X csw_toneon %i\n",fdat,csw_toneon); - if (fdat == 0x2A && csw_toneon == 1) - { - c = 0; - do - { - ffound = 0; - while (!ffound && !csw_loop) - { - csw_poll(); - } - if (csw_loop) break; - ffilename[c++] = fdat; - } while (fdat != 0x0 && c <= 10); - if (csw_loop) break; - c--; - while (c < 13) ffilename[c++] = 32; - ffilename[c] = 0; - - getcswbyte(); - tb = fdat; - getcswbyte(); - load = tb | (fdat << 8); - getcswbyte(); - tb = fdat; - getcswbyte(); - load |= (tb | (fdat << 8)) << 16; - - getcswbyte(); - tb = fdat; - getcswbyte(); - run = tb | (fdat << 8); - getcswbyte(); - tb = fdat; - getcswbyte(); - run |= (tb | (fdat << 8)) << 16; - - getcswbyte(); - getcswbyte(); - - getcswbyte(); - tb = fdat; - getcswbyte(); - skip = tb | (fdat << 8); - - fsize += skip; - - getcswbyte(); - status = fdat; - -//rpclog("Got block - %08X %08X %02X\n",load,run,status); - if (status & 0x80) - { - sprintf(s, "%s Size %04X Load %08X Run %08X", ffilename, fsize, load, run); - cataddname(s); - fsize = 0; - } - for (c = 0; c < skip + 8; c++) - { - getcswbyte(); - } - } - } - infilenames = 0; - csw_indat = temps; - csw_intone = tempi; - csw_datbits = tempd; - csw_skip = tempsk; - acia_tapespeed = tempspd; - csw_point = temp; - csw_loop = 0; - endblit(); -} - +/*B-em v2.2 by Tom Walker + CSW cassette support*/ +#include +#include +#include +#include "b-em.h" +#include "acia.h" +#include "csw.h" +#include "tape.h" + +int csw_toneon=0; + +static int csw_intone = 1, csw_indat = 0, csw_datbits = 0, csw_enddat = 0; +static FILE *csw_f = NULL; +static uint8_t *csw_dat = NULL; +static int csw_point; +static uint8_t csw_head[0x34]; +static int csw_skip = 0; +static int csw_loop = 1; +int csw_ena; + +void csw_load(char *fn) +{ + int end,c; + uint32_t destlen = 8 * 1024 * 1024; + uint8_t *tempin; + if (csw_f) fclose(csw_f); + if (csw_dat) free(csw_dat); + csw_ena = 1; + /*Allocate buffer*/ + csw_dat = malloc(8 * 1024 * 1024); + /*Open file and get size*/ + csw_f = fopen(fn,"rb"); + if (!csw_f) + { + free(csw_dat); + csw_dat = NULL; + return; + } + fseek(csw_f, -1, SEEK_END); + end = ftell(csw_f); + fseek(csw_f, 0, SEEK_SET); + /*Read header*/ + fread(csw_head, 0x34, 1, csw_f); + for (c = 0; c < csw_head[0x23]; c++) getc(csw_f); + /*Allocate temporary memory and read file into memory*/ + end -= ftell(csw_f); + tempin = malloc(end); + fread(tempin, end, 1, csw_f); + fclose(csw_f); +// sprintf(csws,"Decompressing %i %i\n",destlen,end); +// fputs(csws,cswlog); + /*Decompress*/ + uncompress(csw_dat, (unsigned long *)&destlen, tempin, end); + free(tempin); + /*Reset data pointer*/ + csw_point = 0; + dcd(); + tapellatch = (1000000 / (1200 / 10)) / 64; + tapelcount = 0; + tape_loaded = 1; +} + +void csw_close() +{ + if (csw_f) fclose(csw_f); + if (csw_dat) free(csw_dat); + csw_dat = NULL; + csw_f = NULL; +} + +int ffound, fdat; +int infilenames; +static void csw_receive(uint8_t val) +{ + csw_toneon--; + if (infilenames) + { + ffound = 1; + fdat = val; + } + else + acia_receive(val); +} + +void csw_poll() +{ + int c; + uint8_t dat; + if (!csw_dat) return; + + for (c = 0; c < 10; c++) + { + dat = csw_dat[csw_point++]; + + if (csw_point >= (8 * 1024 * 1024)) + { + csw_point = 0; + csw_loop = 1; + } + if (csw_skip) + csw_skip--; + else if (csw_intone && dat > 0xD) /*Not in tone any more - data start bit*/ + { + csw_point++; /*Skip next half of wave*/ + if (acia_tapespeed) csw_skip = 6; + csw_intone = 0; + csw_indat = 1; + + csw_datbits = csw_enddat = 0; + dcdlow(); + return; + } + else if (csw_indat && csw_datbits != -1 && csw_datbits != -2) + { + csw_point++; /*Skip next half of wave*/ + if (acia_tapespeed) csw_skip = 6; + csw_enddat >>= 1; + + if (dat <= 0xD) + { + csw_point += 2; + if (acia_tapespeed) csw_skip += 6; + csw_enddat |= 0x80; + } + csw_datbits++; + if (csw_datbits == 8) + { + csw_receive(csw_enddat); + + csw_datbits = -2; + return; + } + } + else if (csw_indat && csw_datbits == -2) /*Deal with stop bit*/ + { + csw_point++; + if (acia_tapespeed) csw_skip = 6; + if (dat <= 0xD) + { + csw_point += 2; + if (acia_tapespeed) csw_skip += 6; + } + csw_datbits = -1; + } + else if (csw_indat && csw_datbits == -1) + { + if (dat <= 0xD) /*Back in tone again*/ + { + dcd(); + csw_toneon = 2; + csw_indat = 0; + csw_intone = 1; + csw_datbits = 0; + return; + } + else /*Start bit*/ + { + csw_point++; /*Skip next half of wave*/ + if (acia_tapespeed) csw_skip += 6; + csw_datbits = 0; + csw_enddat = 0; + } + } + } +} + +#define getcswbyte() ffound = 0; \ + while (!ffound && !csw_loop) \ + { \ + csw_poll(); \ + } \ + if (csw_loop) break; + +static uint8_t ffilename[16]; +void csw_findfilenames() +{ + int temp, temps, tempd, tempi, tempsk, tempspd; + uint8_t tb; + int c; + int fsize = 0; + char s[256]; + uint32_t run, load; + uint8_t status; + int skip; + if (!csw_dat) return; + startblit(); + temp = csw_point; + temps = csw_indat; + tempi = csw_intone; + tempd = csw_datbits; + tempsk = csw_skip; + tempspd = acia_tapespeed; + csw_point = 0; + + csw_indat = csw_intone = csw_datbits = csw_skip = 0; + csw_intone = 1; + acia_tapespeed = 0; + +// gzseek(csw,12,SEEK_SET); + csw_loop = 0; + infilenames = 1; + while (!csw_loop) + { +// rpclog("Start\n"); + ffound = 0; + while (!ffound && !csw_loop) + { + csw_poll(); + } + if (csw_loop) break; +// rpclog("FDAT %02X csw_toneon %i\n",fdat,csw_toneon); + if (fdat == 0x2A && csw_toneon == 1) + { + c = 0; + do + { + ffound = 0; + while (!ffound && !csw_loop) + { + csw_poll(); + } + if (csw_loop) break; + ffilename[c++] = fdat; + } while (fdat != 0x0 && c <= 10); + if (csw_loop) break; + c--; + while (c < 13) ffilename[c++] = 32; + ffilename[c] = 0; + + getcswbyte(); + tb = fdat; + getcswbyte(); + load = tb | (fdat << 8); + getcswbyte(); + tb = fdat; + getcswbyte(); + load |= (tb | (fdat << 8)) << 16; + + getcswbyte(); + tb = fdat; + getcswbyte(); + run = tb | (fdat << 8); + getcswbyte(); + tb = fdat; + getcswbyte(); + run |= (tb | (fdat << 8)) << 16; + + getcswbyte(); + getcswbyte(); + + getcswbyte(); + tb = fdat; + getcswbyte(); + skip = tb | (fdat << 8); + + fsize += skip; + + getcswbyte(); + status = fdat; + +//rpclog("Got block - %08X %08X %02X\n",load,run,status); + if (status & 0x80) + { + sprintf(s, "%s Size %04X Load %08X Run %08X", ffilename, fsize, load, run); + cataddname(s); + fsize = 0; + } + for (c = 0; c < skip + 8; c++) + { + getcswbyte(); + } + } + } + infilenames = 0; + csw_indat = temps; + csw_intone = tempi; + csw_datbits = tempd; + csw_skip = tempsk; + acia_tapespeed = tempspd; + csw_point = temp; + csw_loop = 0; + endblit(); +} + diff --git a/src/csw.h b/src/csw.h index d3332333..5cb3dce6 100644 --- a/src/csw.h +++ b/src/csw.h @@ -1,7 +1,7 @@ -void csw_load(char *fn); -void csw_close(); -void csw_poll(); -void csw_findfilenames(); - -extern int csw_ena; -extern int csw_toneon; +void csw_load(char *fn); +void csw_close(); +void csw_poll(); +void csw_findfilenames(); + +extern int csw_ena; +extern int csw_toneon; diff --git a/src/daa.h b/src/daa.h index 803af5ea..17ac47e8 100644 --- a/src/daa.h +++ b/src/daa.h @@ -1,2051 +1,2051 @@ -static short DAATable[2048]= -{ -68, -256, -512, -772, -1024, -1284, -1540, -1792, -2056, -2316, -4112, -4372, -4628, -4880, -5140, -5392, -4096, -4356, -4612, -4864, -5124, -5376, -5632, -5892, -6156, -6408, -8240, -8500, -8756, -9008, -9268, -9520, -8224, -8484, -8740, -8992, -9252, -9504, -9760, -10020, -10284, -10536, -12340, -12592, -12848, -13108, -13360, -13620, -12324, -12576, -12832, -13092, -13344, -13604, -13860, -14112, -14376, -14636, -16400, -16660, -16916, -17168, -17428, -17680, -16384, -16644, -16900, -17152, -17412, -17664, -17920, -18180, -18444, -18696, -20500, -20752, -21008, -21268, -21520, -21780, -20484, -20736, -20992, -21252, -21504, -21764, -22020, -22272, -22536, -22796, -24628, -24880, -25136, -25396, -25648, -25908, -24612, -24864, -25120, -25380, -25632, -25892, -26148, -26400, -26664, -26924, -28720, -28980, -29236, -29488, -29748, -30000, -28704, -28964, -29220, -29472, -29732, -29984, -30240, -30500, -30764, -31016, --32624, --32364, --32108, --31856, --31596, --31344, --32640, --32380, --32124, --31872, --31612, --31360, --31104, --30844, --30580, --30328, --28524, --28272, --28016, --27756, --27504, --27244, --28540, --28288, --28032, --27772, --27520, --27260, --27004, --26752, --26488, --26228, -85, -273, -529, -789, -1041, -1301, -69, -257, -513, -773, -1025, -1285, -1541, -1793, -2057, -2317, -4113, -4373, -4629, -4881, -5141, -5393, -4097, -4357, -4613, -4865, -5125, -5377, -5633, -5893, -6157, -6409, -8241, -8501, -8757, -9009, -9269, -9521, -8225, -8485, -8741, -8993, -9253, -9505, -9761, -10021, -10285, -10537, -12341, -12593, -12849, -13109, -13361, -13621, -12325, -12577, -12833, -13093, -13345, -13605, -13861, -14113, -14377, -14637, -16401, -16661, -16917, -17169, -17429, -17681, -16385, -16645, -16901, -17153, -17413, -17665, -17921, -18181, -18445, -18697, -20501, -20753, -21009, -21269, -21521, -21781, -20485, -20737, -20993, -21253, -21505, -21765, -22021, -22273, -22537, -22797, -24629, -24881, -25137, -25397, -25649, -25909, -24613, -24865, -25121, -25381, -25633, -25893, -26149, -26401, -26665, -26925, -28721, -28981, -29237, -29489, -29749, -30001, -28705, -28965, -29221, -29473, -29733, -29985, -30241, -30501, -30765, -31017, --32623, --32363, --32107, --31855, --31595, --31343, --32639, --32379, --32123, --31871, --31611, --31359, --31103, --30843, --30579, --30327, --28523, --28271, --28015, --27755, --27503, --27243, --28539, --28287, --28031, --27771, --27519, --27259, --27003, --26751, --26487, --26227, --24395, --24143, --23887, --23627, --23375, --23115, --24411, --24159, --23903, --23643, --23391, --23131, --22875, --22623, --22359, --22099, --20303, --20043, --19787, --19535, --19275, --19023, --20319, --20059, --19803, --19551, --19291, --19039, --18783, --18523, --18259, --18007, --16235, --15983, --15727, --15467, --15215, --14955, --16251, --15999, --15743, --15483, --15231, --14971, --14715, --14463, --14199, --13939, --12143, --11883, --11627, --11375, --11115, --10863, --12159, --11899, --11643, --11391, --11131, --10879, --10623, --10363, --10099, --9847, --8015, --7755, --7499, --7247, --6987, --6735, --8031, --7771, --7515, --7263, --7003, --6751, --6495, --6235, --5971, --5719, --3915, --3663, --3407, --3147, --2895, --2635, --3931, --3679, --3423, --3163, --2911, --2651, --2395, --2143, --1879, --1619, -85, -273, -529, -789, -1041, -1301, -69, -257, -513, -773, -1025, -1285, -1541, -1793, -2057, -2317, -4113, -4373, -4629, -4881, -5141, -5393, -4097, -4357, -4613, -4865, -5125, -5377, -5633, -5893, -6157, -6409, -8241, -8501, -8757, -9009, -9269, -9521, -8225, -8485, -8741, -8993, -9253, -9505, -9761, -10021, -10285, -10537, -12341, -12593, -12849, -13109, -13361, -13621, -12325, -12577, -12833, -13093, -13345, -13605, -13861, -14113, -14377, -14637, -16401, -16661, -16917, -17169, -17429, -17681, -16385, -16645, -16901, -17153, -17413, -17665, -17921, -18181, -18445, -18697, -20501, -20753, -21009, -21269, -21521, -21781, -20485, -20737, -20993, -21253, -21505, -21765, -22021, -22273, -22537, -22797, -24629, -24881, -25137, -25397, -25649, -25909, -1540, -1792, -2056, -2316, -2572, -2824, -3084, -3336, -3592, -3852, -4112, -4372, -4628, -4880, -5140, -5392, -5632, -5892, -6156, -6408, -6664, -6924, -7176, -7436, -7692, -7944, -8240, -8500, -8756, -9008, -9268, -9520, -9760, -10020, -10284, -10536, -10792, -11052, -11304, -11564, -11820, -12072, -12340, -12592, -12848, -13108, -13360, -13620, -13860, -14112, -14376, -14636, -14892, -15144, -15404, -15656, -15912, -16172, -16400, -16660, -16916, -17168, -17428, -17680, -17920, -18180, -18444, -18696, -18952, -19212, -19464, -19724, -19980, -20232, -20500, -20752, -21008, -21268, -21520, -21780, -22020, -22272, -22536, -22796, -23052, -23304, -23564, -23816, -24072, -24332, -24628, -24880, -25136, -25396, -25648, -25908, -26148, -26400, -26664, -26924, -27180, -27432, -27692, -27944, -28200, -28460, -28720, -28980, -29236, -29488, -29748, -30000, -30240, -30500, -30764, -31016, -31272, -31532, -31784, -32044, -32300, -32552, --32624, --32364, --32108, --31856, --31596, --31344, --31104, --30844, --30580, --30328, --30072, --29812, --29560, --29300, --29044, --28792, --28524, --28272, --28016, --27756, --27504, --27244, --27004, --26752, --26488, --26228, --25972, --25720, --25460, --25208, --24952, --24692, -85, -273, -529, -789, -1041, -1301, -1541, -1793, -2057, -2317, -2573, -2825, -3085, -3337, -3593, -3853, -4113, -4373, -4629, -4881, -5141, -5393, -5633, -5893, -6157, -6409, -6665, -6925, -7177, -7437, -7693, -7945, -8241, -8501, -8757, -9009, -9269, -9521, -9761, -10021, -10285, -10537, -10793, -11053, -11305, -11565, -11821, -12073, -12341, -12593, -12849, -13109, -13361, -13621, -13861, -14113, -14377, -14637, -14893, -15145, -15405, -15657, -15913, -16173, -16401, -16661, -16917, -17169, -17429, -17681, -17921, -18181, -18445, -18697, -18953, -19213, -19465, -19725, -19981, -20233, -20501, -20753, -21009, -21269, -21521, -21781, -22021, -22273, -22537, -22797, -23053, -23305, -23565, -23817, -24073, -24333, -24629, -24881, -25137, -25397, -25649, -25909, -26149, -26401, -26665, -26925, -27181, -27433, -27693, -27945, -28201, -28461, -28721, -28981, -29237, -29489, -29749, -30001, -30241, -30501, -30765, -31017, -31273, -31533, -31785, -32045, -32301, -32553, --32623, --32363, --32107, --31855, --31595, --31343, --31103, --30843, --30579, --30327, --30071, --29811, --29559, --29299, --29043, --28791, --28523, --28271, --28015, --27755, --27503, --27243, --27003, --26751, --26487, --26227, --25971, --25719, --25459, --25207, --24951, --24691, --24395, --24143, --23887, --23627, --23375, --23115, --22875, --22623, --22359, --22099, --21843, --21591, --21331, --21079, --20823, --20563, --20303, --20043, --19787, --19535, --19275, --19023, --18783, --18523, --18259, --18007, --17751, --17491, --17239, --16979, --16723, --16471, --16235, --15983, --15727, --15467, --15215, --14955, --14715, --14463, --14199, --13939, --13683, --13431, --13171, --12919, --12663, --12403, --12143, --11883, --11627, --11375, --11115, --10863, --10623, --10363, --10099, --9847, --9591, --9331, --9079, --8819, --8563, --8311, --8015, --7755, --7499, --7247, --6987, --6735, --6495, --6235, --5971, --5719, --5463, --5203, --4951, --4691, --4435, --4183, --3915, --3663, --3407, --3147, --2895, --2635, --2395, --2143, --1879, --1619, --1363, --1111, --851, --599, --343, --83, -85, -273, -529, -789, -1041, -1301, -1541, -1793, -2057, -2317, -2573, -2825, -3085, -3337, -3593, -3853, -4113, -4373, -4629, -4881, -5141, -5393, -5633, -5893, -6157, -6409, -6665, -6925, -7177, -7437, -7693, -7945, -8241, -8501, -8757, -9009, -9269, -9521, -9761, -10021, -10285, -10537, -10793, -11053, -11305, -11565, -11821, -12073, -12341, -12593, -12849, -13109, -13361, -13621, -13861, -14113, -14377, -14637, -14893, -15145, -15405, -15657, -15913, -16173, -16401, -16661, -16917, -17169, -17429, -17681, -17921, -18181, -18445, -18697, -18953, -19213, -19465, -19725, -19981, -20233, -20501, -20753, -21009, -21269, -21521, -21781, -22021, -22273, -22537, -22797, -23053, -23305, -23565, -23817, -24073, -24333, -24629, -24881, -25137, -25397, -25649, -25909, -70, -258, -514, -774, -1026, -1286, -1542, -1794, -2058, -2318, -1026, -1286, -1542, -1794, -2058, -2318, -4098, -4358, -4614, -4866, -5126, -5378, -5634, -5894, -6158, -6410, -5126, -5378, -5634, -5894, -6158, -6410, -8226, -8486, -8742, -8994, -9254, -9506, -9762, -10022, -10286, -10538, -9254, -9506, -9762, -10022, -10286, -10538, -12326, -12578, -12834, -13094, -13346, -13606, -13862, -14114, -14378, -14638, -13346, -13606, -13862, -14114, -14378, -14638, -16386, -16646, -16902, -17154, -17414, -17666, -17922, -18182, -18446, -18698, -17414, -17666, -17922, -18182, -18446, -18698, -20486, -20738, -20994, -21254, -21506, -21766, -22022, -22274, -22538, -22798, -21506, -21766, -22022, -22274, -22538, -22798, -24614, -24866, -25122, -25382, -25634, -25894, -26150, -26402, -26666, -26926, -25634, -25894, -26150, -26402, -26666, -26926, -28706, -28966, -29222, -29474, -29734, -29986, -30242, -30502, -30766, -31018, -29734, -29986, -30242, -30502, -30766, -31018, --32638, --32378, --32122, --31870, --31610, --31358, --31102, --30842, --30578, --30326, --31610, --31358, --31102, --30842, --30578, --30326, --28538, --28286, --28030, --27770, --27518, --27258, --27002, --26750, --26486, --26226, -13347, -13607, -13863, -14115, -14379, -14639, -16387, -16647, -16903, -17155, -17415, -17667, -17923, -18183, -18447, -18699, -17415, -17667, -17923, -18183, -18447, -18699, -20487, -20739, -20995, -21255, -21507, -21767, -22023, -22275, -22539, -22799, -21507, -21767, -22023, -22275, -22539, -22799, -24615, -24867, -25123, -25383, -25635, -25895, -26151, -26403, -26667, -26927, -25635, -25895, -26151, -26403, -26667, -26927, -28707, -28967, -29223, -29475, -29735, -29987, -30243, -30503, -30767, -31019, -29735, -29987, -30243, -30503, -30767, -31019, --32637, --32377, --32121, --31869, --31609, --31357, --31101, --30841, --30577, --30325, --31609, --31357, --31101, --30841, --30577, --30325, --28537, --28285, --28029, --27769, --27517, --27257, --27001, --26749, --26485, --26225, --27517, --27257, --27001, --26749, --26485, --26225, --24409, --24157, --23901, --23641, --23389, --23129, --22873, --22621, --22357, --22097, --23389, --23129, --22873, --22621, --22357, --22097, --20317, --20057, --19801, --19549, --19289, --19037, --18781, --18521, --18257, --18005, --19289, --19037, --18781, --18521, --18257, --18005, --16249, --15997, --15741, --15481, --15229, --14969, --14713, --14461, --14197, --13937, --15229, --14969, --14713, --14461, --14197, --13937, --12157, --11897, --11641, --11389, --11129, --10877, --10621, --10361, --10097, --9845, --11129, --10877, --10621, --10361, --10097, --9845, --8029, --7769, --7513, --7261, --7001, --6749, --6493, --6233, --5969, --5717, --7001, --6749, --6493, --6233, --5969, --5717, --3929, --3677, --3421, --3161, --2909, --2649, --2393, --2141, --1877, --1617, --2909, --2649, --2393, --2141, --1877, --1617, -71, -259, -515, -775, -1027, -1287, -1543, -1795, -2059, -2319, -1027, -1287, -1543, -1795, -2059, -2319, -4099, -4359, -4615, -4867, -5127, -5379, -5635, -5895, -6159, -6411, -5127, -5379, -5635, -5895, -6159, -6411, -8227, -8487, -8743, -8995, -9255, -9507, -9763, -10023, -10287, -10539, -9255, -9507, -9763, -10023, -10287, -10539, -12327, -12579, -12835, -13095, -13347, -13607, -13863, -14115, -14379, -14639, -13347, -13607, -13863, -14115, -14379, -14639, -16387, -16647, -16903, -17155, -17415, -17667, -17923, -18183, -18447, -18699, -17415, -17667, -17923, -18183, -18447, -18699, -20487, -20739, -20995, -21255, -21507, -21767, -22023, -22275, -22539, -22799, -21507, -21767, -22023, -22275, -22539, -22799, -24615, -24867, -25123, -25383, -25635, -25895, -26151, -26403, -26667, -26927, -25635, -25895, -26151, -26403, -26667, -26927, -28707, -28967, -29223, -29475, -29735, -29987, -30243, -30503, -30767, -31019, -29735, -29987, -30243, -30503, -30767, -31019, --32637, --32377, --32121, --31869, --31609, --31357, --31101, --30841, --30577, --30325, --31609, --31357, --31101, --30841, --30577, --30325, --28537, --28285, --28029, --27769, --27517, --27257, --27001, --26749, --26485, --26225, --27517, --27257, --27001, --26749, --26485, --26225, --1346, --1094, --834, --582, --326, --66, -70, -258, -514, -774, -1026, -1286, -1542, -1794, -2058, -2318, -2590, -2842, -3102, -3354, -3610, -3870, -4098, -4358, -4614, -4866, -5126, -5378, -5634, -5894, -6158, -6410, -6682, -6942, -7194, -7454, -7710, -7962, -8226, -8486, -8742, -8994, -9254, -9506, -9762, -10022, -10286, -10538, -10810, -11070, -11322, -11582, -11838, -12090, -12326, -12578, -12834, -13094, -13346, -13606, -13862, -14114, -14378, -14638, -14910, -15162, -15422, -15674, -15930, -16190, -16386, -16646, -16902, -17154, -17414, -17666, -17922, -18182, -18446, -18698, -18970, -19230, -19482, -19742, -19998, -20250, -20486, -20738, -20994, -21254, -21506, -21766, -22022, -22274, -22538, -22798, -23070, -23322, -23582, -23834, -24090, -24350, -24614, -24866, -25122, -25382, -25634, -25894, -26150, -26402, -26666, -26926, -27198, -27450, -27710, -27962, -28218, -28478, -28706, -28966, -29222, -29474, -29734, -29986, -30242, -30502, -30766, -31018, -31290, -31550, -31802, -32062, -32318, -32570, --32638, --32378, --32122, --31870, --31610, --31358, --31102, --30842, --30578, --30326, --30054, --29794, --29542, --29282, --29026, --28774, --28538, --28286, --28030, --27770, -13347, -13607, -13863, -14115, -14379, -14639, -14911, -15163, -15423, -15675, -15931, -16191, -16387, -16647, -16903, -17155, -17415, -17667, -17923, -18183, -18447, -18699, -18971, -19231, -19483, -19743, -19999, -20251, -20487, -20739, -20995, -21255, -21507, -21767, -22023, -22275, -22539, -22799, -23071, -23323, -23583, -23835, -24091, -24351, -24615, -24867, -25123, -25383, -25635, -25895, -26151, -26403, -26667, -26927, -27199, -27451, -27711, -27963, -28219, -28479, -28707, -28967, -29223, -29475, -29735, -29987, -30243, -30503, -30767, -31019, -31291, -31551, -31803, -32063, -32319, -32571, --32637, --32377, --32121, --31869, --31609, --31357, --31101, --30841, --30577, --30325, --30053, --29793, --29541, --29281, --29025, --28773, --28537, --28285, --28029, --27769, --27517, --27257, --27001, --26749, --26485, --26225, --25953, --25701, --25441, --25189, --24933, --24673, --24409, --24157, --23901, --23641, --23389, --23129, --22873, --22621, --22357, --22097, --21825, --21573, --21313, --21061, --20805, --20545, --20317, --20057, --19801, --19549, --19289, --19037, --18781, --18521, --18257, --18005, --17733, --17473, --17221, --16961, --16705, --16453, --16249, --15997, --15741, --15481, --15229, --14969, --14713, --14461, --14197, --13937, --13665, --13413, --13153, --12901, --12645, --12385, --12157, --11897, --11641, --11389, --11129, --10877, --10621, --10361, --10097, --9845, --9573, --9313, --9061, --8801, --8545, --8293, --8029, --7769, --7513, --7261, --7001, --6749, --6493, --6233, --5969, --5717, --5445, --5185, --4933, --4673, --4417, --4165, --3929, --3677, --3421, --3161, --2909, --2649, --2393, --2141, --1877, --1617, --1345, --1093, --833, --581, --325, --65, -71, -259, -515, -775, -1027, -1287, -1543, -1795, -2059, -2319, -2591, -2843, -3103, -3355, -3611, -3871, -4099, -4359, -4615, -4867, -5127, -5379, -5635, -5895, -6159, -6411, -6683, -6943, -7195, -7455, -7711, -7963, -8227, -8487, -8743, -8995, -9255, -9507, -9763, -10023, -10287, -10539, -10811, -11071, -11323, -11583, -11839, -12091, -12327, -12579, -12835, -13095, -13347, -13607, -13863, -14115, -14379, -14639, -14911, -15163, -15423, -15675, -15931, -16191, -16387, -16647, -16903, -17155, -17415, -17667, -17923, -18183, -18447, -18699, -18971, -19231, -19483, -19743, -19999, -20251, -20487, -20739, -20995, -21255, -21507, -21767, -22023, -22275, -22539, -22799, -23071, -23323, -23583, -23835, -24091, -24351, -24615, -24867, -25123, -25383, -25635, -25895, -26151, -26403, -26667, -26927, -27199, -27451, -27711, -27963, -28219, -28479, -28707, -28967, -29223, -29475, -29735, -29987, -30243, -30503, -30767, -31019, -31291, -31551, -31803, -32063, -32319, -32571, --32637, --32377, --32121, --31869, --31609, --31357, --31101, --30841, --30577, --30325, --30053, --29793, --29541, --29281, --29025, --28773, --28537, --28285, --28029, --27769, --27517, --27257, --27001, --26749, --26485, --26225 -}; +static short DAATable[2048]= +{ +68, +256, +512, +772, +1024, +1284, +1540, +1792, +2056, +2316, +4112, +4372, +4628, +4880, +5140, +5392, +4096, +4356, +4612, +4864, +5124, +5376, +5632, +5892, +6156, +6408, +8240, +8500, +8756, +9008, +9268, +9520, +8224, +8484, +8740, +8992, +9252, +9504, +9760, +10020, +10284, +10536, +12340, +12592, +12848, +13108, +13360, +13620, +12324, +12576, +12832, +13092, +13344, +13604, +13860, +14112, +14376, +14636, +16400, +16660, +16916, +17168, +17428, +17680, +16384, +16644, +16900, +17152, +17412, +17664, +17920, +18180, +18444, +18696, +20500, +20752, +21008, +21268, +21520, +21780, +20484, +20736, +20992, +21252, +21504, +21764, +22020, +22272, +22536, +22796, +24628, +24880, +25136, +25396, +25648, +25908, +24612, +24864, +25120, +25380, +25632, +25892, +26148, +26400, +26664, +26924, +28720, +28980, +29236, +29488, +29748, +30000, +28704, +28964, +29220, +29472, +29732, +29984, +30240, +30500, +30764, +31016, +-32624, +-32364, +-32108, +-31856, +-31596, +-31344, +-32640, +-32380, +-32124, +-31872, +-31612, +-31360, +-31104, +-30844, +-30580, +-30328, +-28524, +-28272, +-28016, +-27756, +-27504, +-27244, +-28540, +-28288, +-28032, +-27772, +-27520, +-27260, +-27004, +-26752, +-26488, +-26228, +85, +273, +529, +789, +1041, +1301, +69, +257, +513, +773, +1025, +1285, +1541, +1793, +2057, +2317, +4113, +4373, +4629, +4881, +5141, +5393, +4097, +4357, +4613, +4865, +5125, +5377, +5633, +5893, +6157, +6409, +8241, +8501, +8757, +9009, +9269, +9521, +8225, +8485, +8741, +8993, +9253, +9505, +9761, +10021, +10285, +10537, +12341, +12593, +12849, +13109, +13361, +13621, +12325, +12577, +12833, +13093, +13345, +13605, +13861, +14113, +14377, +14637, +16401, +16661, +16917, +17169, +17429, +17681, +16385, +16645, +16901, +17153, +17413, +17665, +17921, +18181, +18445, +18697, +20501, +20753, +21009, +21269, +21521, +21781, +20485, +20737, +20993, +21253, +21505, +21765, +22021, +22273, +22537, +22797, +24629, +24881, +25137, +25397, +25649, +25909, +24613, +24865, +25121, +25381, +25633, +25893, +26149, +26401, +26665, +26925, +28721, +28981, +29237, +29489, +29749, +30001, +28705, +28965, +29221, +29473, +29733, +29985, +30241, +30501, +30765, +31017, +-32623, +-32363, +-32107, +-31855, +-31595, +-31343, +-32639, +-32379, +-32123, +-31871, +-31611, +-31359, +-31103, +-30843, +-30579, +-30327, +-28523, +-28271, +-28015, +-27755, +-27503, +-27243, +-28539, +-28287, +-28031, +-27771, +-27519, +-27259, +-27003, +-26751, +-26487, +-26227, +-24395, +-24143, +-23887, +-23627, +-23375, +-23115, +-24411, +-24159, +-23903, +-23643, +-23391, +-23131, +-22875, +-22623, +-22359, +-22099, +-20303, +-20043, +-19787, +-19535, +-19275, +-19023, +-20319, +-20059, +-19803, +-19551, +-19291, +-19039, +-18783, +-18523, +-18259, +-18007, +-16235, +-15983, +-15727, +-15467, +-15215, +-14955, +-16251, +-15999, +-15743, +-15483, +-15231, +-14971, +-14715, +-14463, +-14199, +-13939, +-12143, +-11883, +-11627, +-11375, +-11115, +-10863, +-12159, +-11899, +-11643, +-11391, +-11131, +-10879, +-10623, +-10363, +-10099, +-9847, +-8015, +-7755, +-7499, +-7247, +-6987, +-6735, +-8031, +-7771, +-7515, +-7263, +-7003, +-6751, +-6495, +-6235, +-5971, +-5719, +-3915, +-3663, +-3407, +-3147, +-2895, +-2635, +-3931, +-3679, +-3423, +-3163, +-2911, +-2651, +-2395, +-2143, +-1879, +-1619, +85, +273, +529, +789, +1041, +1301, +69, +257, +513, +773, +1025, +1285, +1541, +1793, +2057, +2317, +4113, +4373, +4629, +4881, +5141, +5393, +4097, +4357, +4613, +4865, +5125, +5377, +5633, +5893, +6157, +6409, +8241, +8501, +8757, +9009, +9269, +9521, +8225, +8485, +8741, +8993, +9253, +9505, +9761, +10021, +10285, +10537, +12341, +12593, +12849, +13109, +13361, +13621, +12325, +12577, +12833, +13093, +13345, +13605, +13861, +14113, +14377, +14637, +16401, +16661, +16917, +17169, +17429, +17681, +16385, +16645, +16901, +17153, +17413, +17665, +17921, +18181, +18445, +18697, +20501, +20753, +21009, +21269, +21521, +21781, +20485, +20737, +20993, +21253, +21505, +21765, +22021, +22273, +22537, +22797, +24629, +24881, +25137, +25397, +25649, +25909, +1540, +1792, +2056, +2316, +2572, +2824, +3084, +3336, +3592, +3852, +4112, +4372, +4628, +4880, +5140, +5392, +5632, +5892, +6156, +6408, +6664, +6924, +7176, +7436, +7692, +7944, +8240, +8500, +8756, +9008, +9268, +9520, +9760, +10020, +10284, +10536, +10792, +11052, +11304, +11564, +11820, +12072, +12340, +12592, +12848, +13108, +13360, +13620, +13860, +14112, +14376, +14636, +14892, +15144, +15404, +15656, +15912, +16172, +16400, +16660, +16916, +17168, +17428, +17680, +17920, +18180, +18444, +18696, +18952, +19212, +19464, +19724, +19980, +20232, +20500, +20752, +21008, +21268, +21520, +21780, +22020, +22272, +22536, +22796, +23052, +23304, +23564, +23816, +24072, +24332, +24628, +24880, +25136, +25396, +25648, +25908, +26148, +26400, +26664, +26924, +27180, +27432, +27692, +27944, +28200, +28460, +28720, +28980, +29236, +29488, +29748, +30000, +30240, +30500, +30764, +31016, +31272, +31532, +31784, +32044, +32300, +32552, +-32624, +-32364, +-32108, +-31856, +-31596, +-31344, +-31104, +-30844, +-30580, +-30328, +-30072, +-29812, +-29560, +-29300, +-29044, +-28792, +-28524, +-28272, +-28016, +-27756, +-27504, +-27244, +-27004, +-26752, +-26488, +-26228, +-25972, +-25720, +-25460, +-25208, +-24952, +-24692, +85, +273, +529, +789, +1041, +1301, +1541, +1793, +2057, +2317, +2573, +2825, +3085, +3337, +3593, +3853, +4113, +4373, +4629, +4881, +5141, +5393, +5633, +5893, +6157, +6409, +6665, +6925, +7177, +7437, +7693, +7945, +8241, +8501, +8757, +9009, +9269, +9521, +9761, +10021, +10285, +10537, +10793, +11053, +11305, +11565, +11821, +12073, +12341, +12593, +12849, +13109, +13361, +13621, +13861, +14113, +14377, +14637, +14893, +15145, +15405, +15657, +15913, +16173, +16401, +16661, +16917, +17169, +17429, +17681, +17921, +18181, +18445, +18697, +18953, +19213, +19465, +19725, +19981, +20233, +20501, +20753, +21009, +21269, +21521, +21781, +22021, +22273, +22537, +22797, +23053, +23305, +23565, +23817, +24073, +24333, +24629, +24881, +25137, +25397, +25649, +25909, +26149, +26401, +26665, +26925, +27181, +27433, +27693, +27945, +28201, +28461, +28721, +28981, +29237, +29489, +29749, +30001, +30241, +30501, +30765, +31017, +31273, +31533, +31785, +32045, +32301, +32553, +-32623, +-32363, +-32107, +-31855, +-31595, +-31343, +-31103, +-30843, +-30579, +-30327, +-30071, +-29811, +-29559, +-29299, +-29043, +-28791, +-28523, +-28271, +-28015, +-27755, +-27503, +-27243, +-27003, +-26751, +-26487, +-26227, +-25971, +-25719, +-25459, +-25207, +-24951, +-24691, +-24395, +-24143, +-23887, +-23627, +-23375, +-23115, +-22875, +-22623, +-22359, +-22099, +-21843, +-21591, +-21331, +-21079, +-20823, +-20563, +-20303, +-20043, +-19787, +-19535, +-19275, +-19023, +-18783, +-18523, +-18259, +-18007, +-17751, +-17491, +-17239, +-16979, +-16723, +-16471, +-16235, +-15983, +-15727, +-15467, +-15215, +-14955, +-14715, +-14463, +-14199, +-13939, +-13683, +-13431, +-13171, +-12919, +-12663, +-12403, +-12143, +-11883, +-11627, +-11375, +-11115, +-10863, +-10623, +-10363, +-10099, +-9847, +-9591, +-9331, +-9079, +-8819, +-8563, +-8311, +-8015, +-7755, +-7499, +-7247, +-6987, +-6735, +-6495, +-6235, +-5971, +-5719, +-5463, +-5203, +-4951, +-4691, +-4435, +-4183, +-3915, +-3663, +-3407, +-3147, +-2895, +-2635, +-2395, +-2143, +-1879, +-1619, +-1363, +-1111, +-851, +-599, +-343, +-83, +85, +273, +529, +789, +1041, +1301, +1541, +1793, +2057, +2317, +2573, +2825, +3085, +3337, +3593, +3853, +4113, +4373, +4629, +4881, +5141, +5393, +5633, +5893, +6157, +6409, +6665, +6925, +7177, +7437, +7693, +7945, +8241, +8501, +8757, +9009, +9269, +9521, +9761, +10021, +10285, +10537, +10793, +11053, +11305, +11565, +11821, +12073, +12341, +12593, +12849, +13109, +13361, +13621, +13861, +14113, +14377, +14637, +14893, +15145, +15405, +15657, +15913, +16173, +16401, +16661, +16917, +17169, +17429, +17681, +17921, +18181, +18445, +18697, +18953, +19213, +19465, +19725, +19981, +20233, +20501, +20753, +21009, +21269, +21521, +21781, +22021, +22273, +22537, +22797, +23053, +23305, +23565, +23817, +24073, +24333, +24629, +24881, +25137, +25397, +25649, +25909, +70, +258, +514, +774, +1026, +1286, +1542, +1794, +2058, +2318, +1026, +1286, +1542, +1794, +2058, +2318, +4098, +4358, +4614, +4866, +5126, +5378, +5634, +5894, +6158, +6410, +5126, +5378, +5634, +5894, +6158, +6410, +8226, +8486, +8742, +8994, +9254, +9506, +9762, +10022, +10286, +10538, +9254, +9506, +9762, +10022, +10286, +10538, +12326, +12578, +12834, +13094, +13346, +13606, +13862, +14114, +14378, +14638, +13346, +13606, +13862, +14114, +14378, +14638, +16386, +16646, +16902, +17154, +17414, +17666, +17922, +18182, +18446, +18698, +17414, +17666, +17922, +18182, +18446, +18698, +20486, +20738, +20994, +21254, +21506, +21766, +22022, +22274, +22538, +22798, +21506, +21766, +22022, +22274, +22538, +22798, +24614, +24866, +25122, +25382, +25634, +25894, +26150, +26402, +26666, +26926, +25634, +25894, +26150, +26402, +26666, +26926, +28706, +28966, +29222, +29474, +29734, +29986, +30242, +30502, +30766, +31018, +29734, +29986, +30242, +30502, +30766, +31018, +-32638, +-32378, +-32122, +-31870, +-31610, +-31358, +-31102, +-30842, +-30578, +-30326, +-31610, +-31358, +-31102, +-30842, +-30578, +-30326, +-28538, +-28286, +-28030, +-27770, +-27518, +-27258, +-27002, +-26750, +-26486, +-26226, +13347, +13607, +13863, +14115, +14379, +14639, +16387, +16647, +16903, +17155, +17415, +17667, +17923, +18183, +18447, +18699, +17415, +17667, +17923, +18183, +18447, +18699, +20487, +20739, +20995, +21255, +21507, +21767, +22023, +22275, +22539, +22799, +21507, +21767, +22023, +22275, +22539, +22799, +24615, +24867, +25123, +25383, +25635, +25895, +26151, +26403, +26667, +26927, +25635, +25895, +26151, +26403, +26667, +26927, +28707, +28967, +29223, +29475, +29735, +29987, +30243, +30503, +30767, +31019, +29735, +29987, +30243, +30503, +30767, +31019, +-32637, +-32377, +-32121, +-31869, +-31609, +-31357, +-31101, +-30841, +-30577, +-30325, +-31609, +-31357, +-31101, +-30841, +-30577, +-30325, +-28537, +-28285, +-28029, +-27769, +-27517, +-27257, +-27001, +-26749, +-26485, +-26225, +-27517, +-27257, +-27001, +-26749, +-26485, +-26225, +-24409, +-24157, +-23901, +-23641, +-23389, +-23129, +-22873, +-22621, +-22357, +-22097, +-23389, +-23129, +-22873, +-22621, +-22357, +-22097, +-20317, +-20057, +-19801, +-19549, +-19289, +-19037, +-18781, +-18521, +-18257, +-18005, +-19289, +-19037, +-18781, +-18521, +-18257, +-18005, +-16249, +-15997, +-15741, +-15481, +-15229, +-14969, +-14713, +-14461, +-14197, +-13937, +-15229, +-14969, +-14713, +-14461, +-14197, +-13937, +-12157, +-11897, +-11641, +-11389, +-11129, +-10877, +-10621, +-10361, +-10097, +-9845, +-11129, +-10877, +-10621, +-10361, +-10097, +-9845, +-8029, +-7769, +-7513, +-7261, +-7001, +-6749, +-6493, +-6233, +-5969, +-5717, +-7001, +-6749, +-6493, +-6233, +-5969, +-5717, +-3929, +-3677, +-3421, +-3161, +-2909, +-2649, +-2393, +-2141, +-1877, +-1617, +-2909, +-2649, +-2393, +-2141, +-1877, +-1617, +71, +259, +515, +775, +1027, +1287, +1543, +1795, +2059, +2319, +1027, +1287, +1543, +1795, +2059, +2319, +4099, +4359, +4615, +4867, +5127, +5379, +5635, +5895, +6159, +6411, +5127, +5379, +5635, +5895, +6159, +6411, +8227, +8487, +8743, +8995, +9255, +9507, +9763, +10023, +10287, +10539, +9255, +9507, +9763, +10023, +10287, +10539, +12327, +12579, +12835, +13095, +13347, +13607, +13863, +14115, +14379, +14639, +13347, +13607, +13863, +14115, +14379, +14639, +16387, +16647, +16903, +17155, +17415, +17667, +17923, +18183, +18447, +18699, +17415, +17667, +17923, +18183, +18447, +18699, +20487, +20739, +20995, +21255, +21507, +21767, +22023, +22275, +22539, +22799, +21507, +21767, +22023, +22275, +22539, +22799, +24615, +24867, +25123, +25383, +25635, +25895, +26151, +26403, +26667, +26927, +25635, +25895, +26151, +26403, +26667, +26927, +28707, +28967, +29223, +29475, +29735, +29987, +30243, +30503, +30767, +31019, +29735, +29987, +30243, +30503, +30767, +31019, +-32637, +-32377, +-32121, +-31869, +-31609, +-31357, +-31101, +-30841, +-30577, +-30325, +-31609, +-31357, +-31101, +-30841, +-30577, +-30325, +-28537, +-28285, +-28029, +-27769, +-27517, +-27257, +-27001, +-26749, +-26485, +-26225, +-27517, +-27257, +-27001, +-26749, +-26485, +-26225, +-1346, +-1094, +-834, +-582, +-326, +-66, +70, +258, +514, +774, +1026, +1286, +1542, +1794, +2058, +2318, +2590, +2842, +3102, +3354, +3610, +3870, +4098, +4358, +4614, +4866, +5126, +5378, +5634, +5894, +6158, +6410, +6682, +6942, +7194, +7454, +7710, +7962, +8226, +8486, +8742, +8994, +9254, +9506, +9762, +10022, +10286, +10538, +10810, +11070, +11322, +11582, +11838, +12090, +12326, +12578, +12834, +13094, +13346, +13606, +13862, +14114, +14378, +14638, +14910, +15162, +15422, +15674, +15930, +16190, +16386, +16646, +16902, +17154, +17414, +17666, +17922, +18182, +18446, +18698, +18970, +19230, +19482, +19742, +19998, +20250, +20486, +20738, +20994, +21254, +21506, +21766, +22022, +22274, +22538, +22798, +23070, +23322, +23582, +23834, +24090, +24350, +24614, +24866, +25122, +25382, +25634, +25894, +26150, +26402, +26666, +26926, +27198, +27450, +27710, +27962, +28218, +28478, +28706, +28966, +29222, +29474, +29734, +29986, +30242, +30502, +30766, +31018, +31290, +31550, +31802, +32062, +32318, +32570, +-32638, +-32378, +-32122, +-31870, +-31610, +-31358, +-31102, +-30842, +-30578, +-30326, +-30054, +-29794, +-29542, +-29282, +-29026, +-28774, +-28538, +-28286, +-28030, +-27770, +13347, +13607, +13863, +14115, +14379, +14639, +14911, +15163, +15423, +15675, +15931, +16191, +16387, +16647, +16903, +17155, +17415, +17667, +17923, +18183, +18447, +18699, +18971, +19231, +19483, +19743, +19999, +20251, +20487, +20739, +20995, +21255, +21507, +21767, +22023, +22275, +22539, +22799, +23071, +23323, +23583, +23835, +24091, +24351, +24615, +24867, +25123, +25383, +25635, +25895, +26151, +26403, +26667, +26927, +27199, +27451, +27711, +27963, +28219, +28479, +28707, +28967, +29223, +29475, +29735, +29987, +30243, +30503, +30767, +31019, +31291, +31551, +31803, +32063, +32319, +32571, +-32637, +-32377, +-32121, +-31869, +-31609, +-31357, +-31101, +-30841, +-30577, +-30325, +-30053, +-29793, +-29541, +-29281, +-29025, +-28773, +-28537, +-28285, +-28029, +-27769, +-27517, +-27257, +-27001, +-26749, +-26485, +-26225, +-25953, +-25701, +-25441, +-25189, +-24933, +-24673, +-24409, +-24157, +-23901, +-23641, +-23389, +-23129, +-22873, +-22621, +-22357, +-22097, +-21825, +-21573, +-21313, +-21061, +-20805, +-20545, +-20317, +-20057, +-19801, +-19549, +-19289, +-19037, +-18781, +-18521, +-18257, +-18005, +-17733, +-17473, +-17221, +-16961, +-16705, +-16453, +-16249, +-15997, +-15741, +-15481, +-15229, +-14969, +-14713, +-14461, +-14197, +-13937, +-13665, +-13413, +-13153, +-12901, +-12645, +-12385, +-12157, +-11897, +-11641, +-11389, +-11129, +-10877, +-10621, +-10361, +-10097, +-9845, +-9573, +-9313, +-9061, +-8801, +-8545, +-8293, +-8029, +-7769, +-7513, +-7261, +-7001, +-6749, +-6493, +-6233, +-5969, +-5717, +-5445, +-5185, +-4933, +-4673, +-4417, +-4165, +-3929, +-3677, +-3421, +-3161, +-2909, +-2649, +-2393, +-2141, +-1877, +-1617, +-1345, +-1093, +-833, +-581, +-325, +-65, +71, +259, +515, +775, +1027, +1287, +1543, +1795, +2059, +2319, +2591, +2843, +3103, +3355, +3611, +3871, +4099, +4359, +4615, +4867, +5127, +5379, +5635, +5895, +6159, +6411, +6683, +6943, +7195, +7455, +7711, +7963, +8227, +8487, +8743, +8995, +9255, +9507, +9763, +10023, +10287, +10539, +10811, +11071, +11323, +11583, +11839, +12091, +12327, +12579, +12835, +13095, +13347, +13607, +13863, +14115, +14379, +14639, +14911, +15163, +15423, +15675, +15931, +16191, +16387, +16647, +16903, +17155, +17415, +17667, +17923, +18183, +18447, +18699, +18971, +19231, +19483, +19743, +19999, +20251, +20487, +20739, +20995, +21255, +21507, +21767, +22023, +22275, +22539, +22799, +23071, +23323, +23583, +23835, +24091, +24351, +24615, +24867, +25123, +25383, +25635, +25895, +26151, +26403, +26667, +26927, +27199, +27451, +27711, +27963, +28219, +28479, +28707, +28967, +29223, +29475, +29735, +29987, +30243, +30503, +30767, +31019, +31291, +31551, +31803, +32063, +32319, +32571, +-32637, +-32377, +-32121, +-31869, +-31609, +-31357, +-31101, +-30841, +-30577, +-30325, +-30053, +-29793, +-29541, +-29281, +-29025, +-28773, +-28537, +-28285, +-28029, +-27769, +-27517, +-27257, +-27001, +-26749, +-26485, +-26225 +}; diff --git a/src/ddnoise.c b/src/ddnoise.c index 05fc1431..7960acb6 100644 --- a/src/ddnoise.c +++ b/src/ddnoise.c @@ -1,177 +1,164 @@ -/*B-em v2.2 by Tom Walker - Disc drive noise*/ - -#include -#include -#include "b-em.h" -#include "disc.h" -#include "ddnoise.h" -#include "sound.h" -#include "soundopenal.h" -#include "tapenoise.h" - -int ddnoise_vol=3; -int ddnoise_type=0; - -static SAMPLE *seeksmp[4][2]; -static SAMPLE *motorsmp[3]; - -static float ddnoise_mpos = 0; -static int ddnoise_mstat = -1; -static int oldmotoron = 0; - -static float ddnoise_spos = 0; -static int ddnoise_sstat = -1; -static int ddnoise_sdir = 0; - -SAMPLE *safe_load_wav(char *fn) -{ - if (file_exists(fn, FA_ALL, NULL)) - { - return load_wav(fn); - } - else - { - rpclog("Failed to load sample %s",fn); - bem_error("Can't load sound sample - does 'ddnoise' exist?"); - exit(-1); - } -} -void ddnoise_init() -{ - char path[512], p2[512]; - getcwd(p2, 511); - if (ddnoise_type) sprintf(path, "%sddnoise/35", exedir); - else sprintf(path, "%sddnoise/525", exedir); -// printf("path now %s\n",path); - chdir(path); - if (ddnoise_type) - { - seeksmp[0][0] = safe_load_wav("stepo.wav"); - seeksmp[0][1] = safe_load_wav("stepi.wav"); - seeksmp[1][0] = safe_load_wav("seek1o.wav"); - seeksmp[1][1] = safe_load_wav("seek1i.wav"); - seeksmp[2][0] = safe_load_wav("seek2o.wav"); - seeksmp[2][1] = safe_load_wav("seek2i.wav"); - seeksmp[3][0] = safe_load_wav("seek3o.wav"); - seeksmp[3][1] = safe_load_wav("seek3i.wav"); - } - else - { - seeksmp[0][0] = safe_load_wav("step.wav"); - seeksmp[0][1] = safe_load_wav("step.wav"); - seeksmp[1][0] = safe_load_wav("seek.wav"); - seeksmp[1][1] = safe_load_wav("seek.wav"); - seeksmp[2][0] = safe_load_wav("seek3.wav"); - seeksmp[2][1] = safe_load_wav("seek3.wav"); - seeksmp[3][0] = safe_load_wav("seek2.wav"); - seeksmp[3][1] = safe_load_wav("seek2.wav"); - } - motorsmp[0] = safe_load_wav("motoron.wav"); - motorsmp[1] = safe_load_wav("motor.wav"); - motorsmp[2] = safe_load_wav("motoroff.wav"); - chdir(p2); -// printf("done!\n"); -} - -void ddnoise_close() -{ - int c; - for (c = 0; c < 4; c++) - { - if (seeksmp[c][0]) destroy_sample(seeksmp[c][0]); - if (seeksmp[c][1]) destroy_sample(seeksmp[c][1]); - seeksmp[c][0] = seeksmp[c][1] = NULL; - } - for (c = 0; c < 3; c++) - { - if (motorsmp[c]) destroy_sample(motorsmp[c]); - motorsmp[c] = NULL; - } -} - -static int16_t ddbuffer[4410]; - -void ddnoise_seek(int len) -{ -// printf("Seek %i tracks\n",len); - ddnoise_sdir = (len < 0) ? 1 : 0; - if (len < 0) len = -len; - ddnoise_spos = 0; - if (len == 0) { ddnoise_sstat = -1; fdc_time = 200; } - else if (len == 1) { ddnoise_sstat = 0; fdc_time = 140000; } - else if (len < 7) ddnoise_sstat = 1; - else if (len < 30) ddnoise_sstat = 2; - else ddnoise_sstat = 3; - if (!sound_ddnoise) fdc_time = 200; -// rpclog("Start seek!\n"); -} - -void ddnoise_mix() -{ - int c; -// if (!f1) f1=fopen("f1.pcm","wb"); -// if (!f2) f2=fopen("f2.pcm","wb"); - - memset(ddbuffer, 0, 4410 * 2); -// fwrite(ddbuffer,4410*2,1,f1); - if (motoron && !oldmotoron) - { - ddnoise_mstat = 0; - ddnoise_mpos = 0; - } - if (!motoron && oldmotoron) - { - ddnoise_mstat = 2; - ddnoise_mpos = 0; - } - - if (sound_ddnoise) - { - for (c = 0; c < 4410; c++) - { - ddbuffer[c] = 0; - if (ddnoise_mstat >= 0) - { - if (ddnoise_mpos >= motorsmp[ddnoise_mstat]->len) - { - ddnoise_mpos = 0; - if (ddnoise_mstat != 1) ddnoise_mstat++; - if (ddnoise_mstat == 3) ddnoise_mstat = -1; - } - if (ddnoise_mstat != -1) - { - ddbuffer[c] += ((int16_t)((((int16_t *)motorsmp[ddnoise_mstat]->data)[(int)ddnoise_mpos]) ^ 0x8000) / 2); - ddnoise_mpos += ((float)motorsmp[ddnoise_mstat]->freq / 44100.0); - } - } - } - - for (c = 0; c < 4410; c++) - { - if (ddnoise_sstat >= 0) - { - if (ddnoise_spos >= seeksmp[ddnoise_sstat][ddnoise_sdir]->len) - { - if (ddnoise_sstat > 0) - fdc_time = 100; - ddnoise_spos = 0; - ddnoise_sstat = -1; - } - else - { - ddbuffer[c] += ((int16_t)((((int16_t *)seeksmp[ddnoise_sstat][ddnoise_sdir]->data)[(int)ddnoise_spos]) ^ 0x8000) / 2); - ddnoise_spos += ((float)seeksmp[ddnoise_sstat][ddnoise_sdir]->freq / 44100.0); - } - } - ddbuffer[c] = (ddbuffer[c] / 3) * ddnoise_vol; - } - } - - tapenoise_mix(ddbuffer); -// fwrite(ddbuffer,4410*2,1,f2); -//rpclog("Give buffer... %i %i\n",ddnoise_mstat,ddnoise_sstat); - al_givebufferdd(ddbuffer); - - oldmotoron=motoron; -} +/*B-em v2.2 by Tom Walker + Disc drive noise*/ + +#include +#include +#include "b-em.h" +#include "disc.h" +#include "ddnoise.h" +#include "sound.h" +#include "soundopenal.h" +#include "tapenoise.h" + +int ddnoise_vol=3; +int ddnoise_type=0; + +static SAMPLE *seeksmp[4][2]; +static SAMPLE *motorsmp[3]; + +static float ddnoise_mpos = 0; +static int ddnoise_mstat = -1; +static int oldmotoron = 0; + +static float ddnoise_spos = 0; +static int ddnoise_sstat = -1; +static int ddnoise_sdir = 0; + +void ddnoise_init() +{ + char path[512], p2[512]; + getcwd(p2, 511); + if (ddnoise_type) sprintf(path, "%sddnoise/35", exedir); + else sprintf(path, "%sddnoise/525", exedir); +// printf("path now %s\n",path); + chdir(path); + seeksmp[0][0] = load_wav("stepo.wav"); + if (seeksmp[0][0]) + { + seeksmp[0][1] = load_wav("stepi.wav"); + seeksmp[1][0] = load_wav("seek1o.wav"); + seeksmp[1][1] = load_wav("seek1i.wav"); + seeksmp[2][0] = load_wav("seek2o.wav"); + seeksmp[2][1] = load_wav("seek2i.wav"); + seeksmp[3][0] = load_wav("seek3o.wav"); + seeksmp[3][1] = load_wav("seek3i.wav"); + } + else + { + seeksmp[0][0] = load_wav("step.wav"); + seeksmp[0][1] = load_wav("step.wav"); + seeksmp[1][0] = load_wav("seek.wav"); + seeksmp[1][1] = load_wav("seek.wav"); + seeksmp[2][0] = load_wav("seek3.wav"); + seeksmp[2][1] = load_wav("seek3.wav"); + seeksmp[3][0] = load_wav("seek2.wav"); + seeksmp[3][1] = load_wav("seek2.wav"); + } + motorsmp[0] = load_wav("motoron.wav"); + motorsmp[1] = load_wav("motor.wav"); + motorsmp[2] = load_wav("motoroff.wav"); + chdir(p2); +// printf("done!\n"); +} + +void ddnoise_close() +{ + int c; + for (c = 0; c < 4; c++) + { + if (seeksmp[c][0]) destroy_sample(seeksmp[c][0]); + if (seeksmp[c][1]) destroy_sample(seeksmp[c][1]); + seeksmp[c][0] = seeksmp[c][1] = NULL; + } + for (c = 0; c < 3; c++) + { + if (motorsmp[c]) destroy_sample(motorsmp[c]); + motorsmp[c] = NULL; + } +} + +static int16_t ddbuffer[4410]; + +void ddnoise_seek(int len) +{ +// printf("Seek %i tracks\n",len); + ddnoise_sdir = (len < 0) ? 1 : 0; + if (len < 0) len = -len; + ddnoise_spos = 0; + if (len == 0) { ddnoise_sstat = -1; fdc_time = 200; } + else if (len == 1) { ddnoise_sstat = 0; fdc_time = 140000; } + else if (len < 7) ddnoise_sstat = 1; + else if (len < 30) ddnoise_sstat = 2; + else ddnoise_sstat = 3; + if (!sound_ddnoise) fdc_time = 200; +// rpclog("Start seek!\n"); +} + +void ddnoise_mix() +{ + int c; +// if (!f1) f1=fopen("f1.pcm","wb"); +// if (!f2) f2=fopen("f2.pcm","wb"); + + memset(ddbuffer, 0, 4410 * 2); +// fwrite(ddbuffer,4410*2,1,f1); + if (motoron && !oldmotoron) + { + ddnoise_mstat = 0; + ddnoise_mpos = 0; + } + if (!motoron && oldmotoron) + { + ddnoise_mstat = 2; + ddnoise_mpos = 0; + } + + if (sound_ddnoise) + { + for (c = 0; c < 4410; c++) + { + ddbuffer[c] = 0; + if (ddnoise_mstat >= 0) + { + if (ddnoise_mpos >= motorsmp[ddnoise_mstat]->len) + { + ddnoise_mpos = 0; + if (ddnoise_mstat != 1) ddnoise_mstat++; + if (ddnoise_mstat == 3) ddnoise_mstat = -1; + } + if (ddnoise_mstat != -1) + { + ddbuffer[c] += ((int16_t)((((int16_t *)motorsmp[ddnoise_mstat]->data)[(int)ddnoise_mpos]) ^ 0x8000) / 2); + ddnoise_mpos += ((float)motorsmp[ddnoise_mstat]->freq / 44100.0); + } + } + } + + for (c = 0; c < 4410; c++) + { + if (ddnoise_sstat >= 0) + { + if (ddnoise_spos >= seeksmp[ddnoise_sstat][ddnoise_sdir]->len) + { + if (ddnoise_sstat > 0) + fdc_time = 100; + ddnoise_spos = 0; + ddnoise_sstat = -1; + } + else + { + ddbuffer[c] += ((int16_t)((((int16_t *)seeksmp[ddnoise_sstat][ddnoise_sdir]->data)[(int)ddnoise_spos]) ^ 0x8000) / 2); + ddnoise_spos += ((float)seeksmp[ddnoise_sstat][ddnoise_sdir]->freq / 44100.0); + } + } + ddbuffer[c] = (ddbuffer[c] / 3) * ddnoise_vol; + } + } + + tapenoise_mix(ddbuffer); +// fwrite(ddbuffer,4410*2,1,f2); +//rpclog("Give buffer... %i %i\n",ddnoise_mstat,ddnoise_sstat); + al_givebufferdd(ddbuffer); + + oldmotoron=motoron; +} diff --git a/src/ddnoise.h b/src/ddnoise.h index 7d3b10ca..5d95c34d 100644 --- a/src/ddnoise.h +++ b/src/ddnoise.h @@ -1,7 +1,6 @@ -void ddnoise_init(); -void ddnoise_close(); -void ddnoise_seek(int len); -void ddnoise_mix(); -extern int ddnoise_vol; -extern int ddnoise_type; -SAMPLE *safe_load_wav(char *fn); +void ddnoise_init(); +void ddnoise_close(); +void ddnoise_seek(int len); +void ddnoise_mix(); +extern int ddnoise_vol; +extern int ddnoise_type; diff --git a/src/debugger.c b/src/debugger.c index 49c580a6..a0daa5cf 100644 --- a/src/debugger.c +++ b/src/debugger.c @@ -1,891 +1,891 @@ -/*B-em v2.2 by Tom Walker - Debugger*/ - -int debug; -int indebug=0; -extern int fcount; - -#ifdef WIN32 -#include -#include -#include -#include "b-em.h" -#include "debugger.h" - -static HANDLE debugthread; -static HWND dhwnd; -static int debugstarted = 0; -static char DebugszClassName[ ] = "B-emDebugWnd"; -LRESULT CALLBACK DebugWindowProcedure (HWND, UINT, WPARAM, LPARAM); -static HINSTANCE hinst; -static uint8_t *usdat; - -void _debugthread(PVOID pvoid) -{ - MSG messages = {0}; /* Here messages to the application are saved */ - WNDCLASSEX wincl; /* Data structure for the windowclass */ - - HDC hDC; - HDC memDC; - HBITMAP memBM; - BITMAPINFO lpbmi; - int x; - int c,d; - - usdat = malloc(256 * 256 * 4); - if (!debugstarted) - { - wincl.hInstance = hinst; - wincl.lpszClassName = DebugszClassName; - wincl.lpfnWndProc = DebugWindowProcedure; /* This function is called by windows */ - wincl.style = CS_DBLCLKS; /* Catch double-clicks */ - wincl.cbSize = sizeof (WNDCLASSEX); - - /* Use default icon and mouse-pointer */ - wincl.hIcon = LoadIcon(hinst, "allegro_icon"); - wincl.hIconSm = LoadIcon(hinst, "allegro_icon"); - wincl.hCursor = LoadCursor (NULL, IDC_ARROW); - wincl.lpszMenuName = NULL; /* No menu */ - wincl.cbClsExtra = 0; /* No extra bytes after the window class */ - wincl.cbWndExtra = 0; /* structure or the window instance */ - /* Use Windows's default color as the background of the window */ - wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND; - - /* Register the window class, and if it fails quit the program */ - if (!RegisterClassEx(&wincl)) - { - printf("Registerclass failed\n"); - return; - } - } - dhwnd = CreateWindowEx ( - 0, /* Extended possibilites for variation */ - DebugszClassName, /* Classname */ - "Memory viewer", /* Title Text */ - WS_OVERLAPPEDWINDOW, /* default window */ - CW_USEDEFAULT, /* Windows decides the position */ - CW_USEDEFAULT, /* where the window ends up on the screen */ - 256 + (GetSystemMetrics(SM_CXFIXEDFRAME) * 2),/* The programs width */ - 256 + (GetSystemMetrics(SM_CYFIXEDFRAME) * 2) + GetSystemMetrics(SM_CYCAPTION) + 2,/* and height in pixels */ - HWND_DESKTOP, /* The window is a child-window to desktop */ - NULL, /* No menu */ - hinst, /* Program Instance handler */ - NULL /* No Window Creation data */ - ); - printf("Window create %08X\n", (uint32_t)dhwnd); - ShowWindow (dhwnd, SW_SHOWNORMAL); - - hDC = GetDC(dhwnd); - - memDC = CreateCompatibleDC ( hDC ); - if (!memDC) printf("memDC failed!\n"); - memBM = CreateCompatibleBitmap ( hDC, 256, 256 ); - if (!memBM) printf("memBM failed!\n"); - SelectObject ( memDC, memBM ); - - lpbmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - lpbmi.bmiHeader.biWidth = 256; - lpbmi.bmiHeader.biHeight = -256; - lpbmi.bmiHeader.biPlanes = 1; - lpbmi.bmiHeader.biBitCount = 32; - lpbmi.bmiHeader.biCompression = BI_RGB; - lpbmi.bmiHeader.biSizeImage = 256 * 256 * 4; - lpbmi.bmiHeader.biClrUsed = 0; - lpbmi.bmiHeader.biClrImportant = 0; - - debugstarted = 1; - while (debugon) - { - Sleep(20); - - - c += 16; - d = 0; - for (x = 0; x < 65536; x++) - { - usdat[d++] = fetchc[x] * 8; - usdat[d++] = readc[x] * 8; - usdat[d++] = writec[x] * 8; - usdat[d++] = 0; - if (fetchc[x]) fetchc[x]--; - if (readc[x]) readc[x]--; - if (writec[x]) writec[x]--; - } - - SetDIBitsToDevice(memDC, 0, 0, 256, 256, 0, 0, 0, 256, usdat, &lpbmi, DIB_RGB_COLORS); - BitBlt(hDC, 0, 0, 256, 256, memDC, 0, 0, SRCCOPY); - - if (PeekMessage(&messages, NULL, 0, 0, PM_REMOVE)) - { - /* Translate virtual-key messages into character messages */ - TranslateMessage(&messages); - /* Send message to WindowProcedure */ - DispatchMessage(&messages); - } -// if (indebug) pollmainwindow(); - } - free(usdat); -} - -static HANDLE consf, cinf; - -BOOL CtrlHandler(DWORD fdwCtrlType) -{ - setquit(); - return TRUE; -} - - -/*void _debugconsolethread(PVOID pvoid) -{ - int c,d; - return; - while (debug) - { - if (!gotstr) - { - c=ReadConsoleA(cinf,debugconsoleins,255,(LPDWORD)&d,NULL); - debugconsoleins[d]=0; - gotstr=1; - } - else - Sleep(10); - } -}*/ - -void debug_start() -{ - if (debug) - { - hinst = GetModuleHandle(NULL); - debugthread = (HANDLE)_beginthread(_debugthread, 0, NULL); -// debugconsolethread=(HANDLE)_beginthread(_debugconsolethread,0,NULL); - - AllocConsole(); - SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler, TRUE); - consf = GetStdHandle(STD_OUTPUT_HANDLE); - cinf = GetStdHandle(STD_INPUT_HANDLE); - } -} - -void debug_end() -{ - FreeConsole(); - debug = debugon = 0; -} - -void debug_kill() -{ - TerminateThread(debugthread, 0); - if (usdat) free(usdat); -} - -LRESULT CALLBACK DebugWindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch (message) /* handle the messages */ - { - case WM_CREATE: - return 0; - case WM_DESTROY: - PostQuitMessage (0); /* send a WM_QUIT to the message queue */ - break; - default: /* for messages that we don't deal with */ - return DefWindowProc (hwnd, message, wParam, lParam); - } - return 0; -} - -static void debug_out(char *s) -{ - startblit(); - WriteConsole(consf, s, strlen(s), NULL, NULL); - endblit(); - rpclog("%s", s); -} - -#else - -#include -#include "b-em.h" -#include "debugger.h" - -#undef printf - -static void debug_out(char *s) -{ - printf(s); - fflush(stdout); -} - -void debug_start() -{ -} - -#endif - -#include "6502.h" -#include "via.h" -#include "sysvia.h" -#include "uservia.h" -#include "video.h" -#include "sn76489.h" -#include "model.h" - -int readc[65536], writec[65536], fetchc[65536]; - -static uint16_t debug_memaddr=0; -static uint16_t debug_disaddr=0; -static uint8_t debug_lastcommand=0; - -static uint8_t debug_readmem(uint16_t addr) -{ - if (addr >= 0xFC00 && addr < 0xFF00) return 0xFF; - return readmem(addr); -} - -enum -{ - IMP,IMPA,IMM,ZP,ZPX,ZPY,INDX,INDY,IND,ABS,ABSX,ABSY,IND16,IND1X,BRA -}; - -static char dopname[256][6]= -{ -/*00*/ "BRK","ORA","---","---","TSB","ORA","ASL","---","PHP","ORA","ASL","---","TSB","ORA","ASL","---", -/*10*/ "BPL","ORA","ORA","---","TRB","ORA","ASL","---","CLC","ORA","INC","---","TRB","ORA","ASL","---", -/*20*/ "JSR","AND","---","---","BIT","AND","ROL","---","PLP","AND","ROL","---","BIT","AND","ROL","---", -/*30*/ "BMI","AND","AND","---","BIT","AND","ROL","---","SEC","AND","DEC","---","BIT","AND","ROL","---", -/*40*/ "RTI","EOR","---","---","---","EOR","LSR","---","PHA","EOR","LSR","---","JMP","EOR","LSR","---", -/*50*/ "BVC","EOR","EOR","---","---","EOR","LSR","---","CLI","EOR","PHY","---","---","EOR","LSR","---", -/*60*/ "RTS","ADC","---","---","STZ","ADC","ROR","---","PLA","ADC","ROR","---","JMP","ADC","ROR","---", -/*70*/ "BVS","ADC","ADC","---","STZ","ADC","ROR","---","SEI","ADC","PLY","---","JMP","ADC","ROR","---", -/*80*/ "BRA","STA","---","---","STY","STA","STX","---","DEY","BIT","TXA","---","STY","STA","STX","---", -/*90*/ "BCC","STA","STA","---","STY","STA","STX","---","TYA","STA","TXS","---","STZ","STA","STZ","---", -/*A0*/ "LDY","LDA","LDX","---","LDY","LDA","LDX","---","TAY","LDA","TAX","---","LDY","LDA","LDX","---", -/*B0*/ "BCS","LDA","LDA","---","LDY","LDA","LDX","---","CLV","LDA","TSX","---","LDY","LDA","LDX","---", -/*C0*/ "CPY","CMP","---","---","CPY","CMP","DEC","---","INY","CMP","DEX","WAI","CPY","CMP","DEC","---", -/*D0*/ "BNE","CMP","CMP","---","---","CMP","DEC","---","CLD","CMP","PHX","STP","---","CMP","DEC","---", -/*E0*/ "CPX","SBC","---","---","CPX","SBC","INC","---","INX","SBC","NOP","---","CPX","SBC","INC","---", -/*F0*/ "BEQ","SBC","SBC","---","---","SBC","INC","---","SED","SBC","PLX","---","---","SBC","INC","---", -}; - -static int dopaddr[256]= -{ -/*00*/ IMP, INDX, IMP, IMP, ZP, ZP, ZP, IMP, IMP, IMM, IMPA, IMP, ABS, ABS, ABS, IMP, -/*10*/ BRA, INDY, IND, IMP, ZP, ZPX, ZPX, IMP, IMP, ABSY, IMPA, IMP, ABS, ABSX, ABSX, IMP, -/*20*/ ABS, INDX, IMP, IMP, ZP, ZP, ZP, IMP, IMP, IMM, IMPA, IMP, ABS, ABS, ABS, IMP, -/*30*/ BRA, INDY, IND, IMP, ZPX, ZPX, ZPX, IMP, IMP, ABSY, IMPA, IMP, ABSX, ABSX, ABSX, IMP, -/*40*/ IMP, INDX, IMP, IMP, ZP, ZP, ZP, IMP, IMP, IMM, IMPA, IMP, ABS, ABS, ABS, IMP, -/*50*/ BRA, INDY, IND, IMP, ZP, ZPX, ZPX, IMP, IMP, ABSY, IMP, IMP, ABS, ABSX, ABSX, IMP, -/*60*/ IMP, INDX, IMP, IMP, ZP, ZP, ZP, IMP, IMP, IMM, IMPA, IMP, IND16,ABS, ABS, IMP, -/*70*/ BRA, INDY, IND, IMP, ZPX, ZPX, ZPX, IMP, IMP, ABSY, IMP, IMP, IND1X,ABSX, ABSX, IMP, -/*80*/ BRA, INDX, IMP, IMP, ZP, ZP, ZP, IMP, IMP, IMM, IMP, IMP, ABS, ABS, ABS, IMP, -/*90*/ BRA, INDY, IND, IMP, ZPX, ZPX, ZPY, IMP, IMP, ABSY, IMP, IMP, ABS, ABSX, ABSX, IMP, -/*A0*/ IMM, INDX, IMM, IMP, ZP, ZP, ZP, IMP, IMP, IMM, IMP, IMP, ABS, ABS, ABS, IMP, -/*B0*/ BRA, INDY, IND, IMP, ZPX, ZPX, ZPY, IMP, IMP, ABSY, IMP, IMP, ABSX, ABSX, ABSY, IMP, -/*C0*/ IMM, INDX, IMP, IMP, ZP, ZP, ZP, IMP, IMP, IMM, IMP, IMP, ABS, ABS, ABS, IMP, -/*D0*/ BRA, INDY, IND, IMP, ZP, ZPX, ZPX, IMP, IMP, ABSY, IMP, IMP, ABS, ABSX, ABSX, IMP, -/*E0*/ IMM, INDX, IMP, IMP, ZP, ZP, ZP, IMP, IMP, IMM, IMP, IMP, ABS, ABS, ABS, IMP, -/*F0*/ BRA, INDY, IND, IMP, ZP, ZPX, ZPX, IMP, IMP, ABSY, IMP, IMP, ABS, ABSX, ABSX, IMP, -}; - -static char dopnamenmos[256][6]= -{ -/*00*/ "BRK","ORA","HLT","SLO","NOP","ORA","ASL","SLO","PHP","ORA","ASL","ANC","NOP","ORA","ASL","SLO", -/*10*/ "BPL","ORA","HLT","SLO","NOP","ORA","ASL","SLO","CLC","ORA","NOP","SLO","NOP","ORA","ASL","SLO", -/*20*/ "JSR","AND","HLT","RLA","NOP","AND","ROL","RLA","PLP","AND","ROL","ANC","BIT","AND","ROL","RLA", -/*30*/ "BMI","AND","HLT","RLA","NOP","AND","ROL","RLA","SEC","AND","NOP","RLA","NOP","AND","ROL","RLA", -/*40*/ "RTI","EOR","HLT","SRE","NOP","EOR","LSR","SRE","PHA","EOR","LSR","ASR","JMP","EOR","LSR","SRE", -/*50*/ "BVC","EOR","HLT","SRE","NOP","EOR","LSR","SRE","CLI","EOR","NOP","SRE","NOP","EOR","LSR","SRE", -/*60*/ "RTS","ADC","HLT","RRA","NOP","ADC","ROR","RRA","PLA","ADC","ROR","ARR","JMP","ADC","ROR","RRA", -/*70*/ "BVS","ADC","HLT","RRA","NOP","ADC","ROR","RRA","SEI","ADC","NOP","RRA","NOP","ADC","ROR","RRA", -/*80*/ "BRA","STA","NOP","SAX","STY","STA","STX","SAX","DEY","NOP","TXA","ANE","STY","STA","STX","SAX", -/*90*/ "BCC","STA","HLT","SHA","STY","STA","STX","SAX","TYA","STA","TXS","SHS","SHY","STA","SHX","SHA", -/*A0*/ "LDY","LDA","LDX","LAX","LDY","LDA","LDX","LAX","TAY","LDA","TAX","LXA","LDY","LDA","LDX","LAX", -/*B0*/ "BCS","LDA","HLT","LAX","LDY","LDA","LDX","LAX","CLV","LDA","TSX","LAS","LDY","LDA","LDX","LAX", -/*C0*/ "CPY","CMP","NOP","DCP","CPY","CMP","DEC","DCP","INY","CMP","DEX","SBX","CPY","CMP","DEC","DCP", -/*D0*/ "BNE","CMP","HLT","DCP","NOP","CMP","DEC","DCP","CLD","CMP","NOP","DCP","NOP","CMP","DEC","DCP", -/*E0*/ "CPX","SBC","NOP","ISB","CPX","SBC","INC","ISB","INX","SBC","NOP","SBC","CPX","SBC","INC","ISB", -/*F0*/ "BEQ","SBC","HLT","ISB","NOP","SBC","INC","ISB","SED","SBC","NOP","ISB","NOP","SBC","INC","ISB", -}; - -static int dopaddrnmos[256]= -{ -/*00*/ IMP, INDX, IMP, INDX, ZP, ZP, ZP, ZP, IMP, IMM, IMPA, IMM, ABS, ABS, ABS, ABS, -/*10*/ BRA, INDY, IMP, INDY, ZPX, ZPX, ZPX, ZPX, IMP, ABSY, IMP, ABSY, ABSX, ABSX, ABSX, ABSX, -/*20*/ ABS, INDX, IMP, INDX, ZP, ZP, ZP, ZP, IMP, IMM, IMPA, IMM, ABS, ABS, ABS, ABS, -/*30*/ BRA, INDY, IMP, INDY, ZPX, ZPX, ZPX, ZPX, IMP, ABSY, IMP, ABSY, ABSX, ABSX, ABSX, ABSX, -/*40*/ IMP, INDX, IMP, INDX, ZP, ZP, ZP, ZP, IMP, IMM, IMPA, IMM, ABS, ABS, ABS, ABS, -/*50*/ BRA, INDY, IMP, INDY, ZPX, ZPX, ZPX, ZPX, IMP, ABSY, IMP, ABSY, ABSX, ABSX, ABSX, ABSX, -/*60*/ IMP, INDX, IMP, INDX, ZP, ZP, ZP, ZP, IMP, IMM, IMPA, IMM, IND16,ABS, ABS, ABS, -/*70*/ BRA, INDY, IMP, INDY, ZPX, ZPX, ZPX, ZPX, IMP, ABSY, IMP, ABSY, ABSX, ABSX, ABSX, ABSX, -/*80*/ BRA, INDX, IMM, INDX, ZP, ZP, ZP, ZP, IMP, IMM, IMP, IMM, ABS, ABS, ABS, ABS, -/*90*/ BRA, INDY, IMP, INDY, ZPX, ZPX, ZPY, ZPY, IMP, ABSY, IMP, ABSY, ABSX, ABSX, ABSX, ABSX, -/*A0*/ IMM, INDX, IMM, INDX, ZP, ZP, ZP, ZP, IMP, IMM, IMP, IMM, ABS, ABS, ABS, ABS, -/*B0*/ BRA, INDY, IMP, INDY, ZPX, ZPX, ZPY, ZPY, IMP, ABSY, IMP, ABSY, ABSX, ABSX, ABSY, ABSX, -/*C0*/ IMM, INDX, IMM, INDX, ZP, ZP, ZP, ZP, IMP, IMM, IMP, IMM, ABS, ABS, ABS, ABS, -/*D0*/ BRA, INDY, IMP, INDY, ZPX, ZPX, ZPX, ZPX, IMP, ABSY, IMP, ABSY, ABSX, ABSX, ABSX, ABSX, -/*E0*/ IMM, INDX, IMM, INDX, ZP, ZP, ZP, ZP, IMP, IMM, IMP, IMM, ABS, ABS, ABS, ABS, -/*F0*/ BRA, INDY, IMP, INDY, ZPX, ZPX, ZPX, ZPX, IMP, ABSY, IMP, ABSY, ABSX, ABSX, ABSX, ABSX, -}; - - -static void debug_disassemble() -{ - uint16_t temp; - char s[256]; - uint8_t op = debug_readmem(debug_disaddr); - uint8_t p1 = debug_readmem(debug_disaddr + 1), p2 = debug_readmem(debug_disaddr + 2); - sprintf(s, "%04X : ", debug_disaddr); - debug_out(s); - debug_out(MASTER ? dopname[op] : dopnamenmos[op]); - debug_out(" "); - switch (MASTER ? dopaddr[op] : dopaddrnmos[op]) - { - case IMP: - sprintf(s, " "); - debug_out(s); - break; - case IMPA: - sprintf(s, "A "); - debug_out(s); - break; - case IMM: - sprintf(s, "#%02X ", p1); - debug_out(s); - debug_disaddr++; - break; - case ZP: - sprintf(s, "%02X ", p1); - debug_out(s); - debug_disaddr++; - break; - case ZPX: - sprintf(s, "%02X,X ", p1); - debug_out(s); - debug_disaddr++; - break; - case ZPY: - sprintf(s, "%02X,Y ", p1); - debug_out(s); - debug_disaddr++; - break; - case IND: - sprintf(s, "(%02X) ", p1); - debug_out(s); - debug_disaddr++; - break; - case INDX: - sprintf(s, "(%02X,X) ", p1); - debug_out(s); - debug_disaddr++; - break; - case INDY: - sprintf(s, "(%02X),Y ", p1); - debug_out(s); - debug_disaddr++; - break; - case ABS: - sprintf(s, "%02X%02X ", p2, p1); - debug_out(s); - debug_disaddr += 2; - break; - case ABSX: - sprintf(s, "%02X%02X,X ", p2, p1); - debug_out(s); - debug_disaddr += 2; - break; - case ABSY: - sprintf(s, "%02X%02X,Y ", p2, p1); - debug_out(s); - debug_disaddr += 2; - break; - case IND16: - sprintf(s, "(%02X%02X) ", p2, p1); - debug_out(s); - debug_disaddr += 2; - break; - case IND1X: - sprintf(s, "(%02X%02X,X)", p2, p1); - debug_out(s); - debug_disaddr += 2; - break; - case BRA: - temp = debug_disaddr + 2 + (signed char)p1; - sprintf(s, "%04X ", temp); - debug_out(s); - debug_disaddr++; - break; - } - debug_disaddr++; -// WriteConsole(consf,"\n",strlen("\n"),NULL,NULL); -} - -static int breakpoints[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; -static int breakr[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; -static int breakw[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; -static int watchr[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; -static int watchw[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; -static int debugstep = 0; - -void debug_read(uint16_t addr) -{ - int c; - char outs[256]; - for (c = 0; c < 8; c++) - { - if (breakr[c] == addr) - { - debug = 1; - sprintf(outs, " Break on read from %04X\n", addr); - debug_out(outs); - return; - } - if (watchr[c] == addr) - { - sprintf(outs, " Read from %04X - A=%02X X=%02X Y=%02X PC=%04X\n", addr, a, x, y, pc); - debug_out(outs); - } - } -} -void debug_write(uint16_t addr, uint8_t val) -{ - int c; - char outs[256]; - for (c = 0; c < 8; c++) - { - if (breakw[c] == addr) - { - debug = 1; - sprintf(outs, " Break on write to %04X - val %02X\n", addr, val); - debug_out(outs); - return; - } - if (watchw[c] == addr) - { - sprintf(outs, " Write %02X to %04X - A=%02X X=%02X Y=%02X PC=%04X\n", val, addr, a, x, y, pc); - debug_out(outs); - } - } -} - -void debugger_do() -{ - int c, d, e, f; - int params; - uint8_t temp; - char outs[256]; - char ins[256]; - if (!opcode) - { - sprintf(outs, "BRK %04X! %04X %04X\n", pc, oldpc, oldoldpc); - debug_out(outs); - } - if (!opcode) debug = 1; - - for (c = 0; c < 8; c++) - { - if (breakpoints[c] == pc) - { - debug = 1; - sprintf(outs, " Break at %04X\n", pc); - debug_out(outs); - } - } - if (!debug) return; -// if (!opcode) printf("BRK at %04X\n",pc); - if (debugstep) - { - debugstep--; - if (debugstep) return; - } - indebug = 1; - while (1) - { - d = debug_disaddr; - debug_disaddr = pc; - debug_disassemble(); - debug_disaddr = d; - sprintf(outs, " >"); - debug_out(outs); -#ifdef WIN32 - c = ReadConsoleA(cinf, ins, 255, (LPDWORD)&d, NULL); - ins[d] = 0; -#else - d = (int)fgets(ins, 255, stdin); -#endif - d = 0; - while (ins[d] != 32 && ins[d] != 0xA && ins[d] != 0xD && ins[d] != 0) d++; - while (ins[d] == 32) d++; - if (ins[d] == 0xA || ins[d] == 0xD || ins[d] == 0) params = 0; - else params = 1; - - if (ins[0] == 0xA || ins[0] == 0xD) ins[0] = debug_lastcommand; -//debug_out("Processing!\n"); - switch (ins[0]) - { - case 'c': case 'C': - debug = 0; - indebug = 0; - return; - case 'm': case 'M': - if (params) sscanf(&ins[d], "%X", (unsigned int *)&debug_memaddr); - for (c = 0; c < 16; c++) - { - sprintf(outs, " %04X : ", debug_memaddr); - debug_out(outs); - for (d = 0; d < 16; d++) - { - sprintf(outs, "%02X ", debug_readmem(debug_memaddr + d)); - debug_out(outs); - } - debug_out(" "); - for (d = 0; d < 16; d++) - { - temp = debug_readmem(debug_memaddr + d); - if (temp < 32) sprintf(outs, "."); - else sprintf(outs, "%c", temp); - debug_out(outs); - } - debug_memaddr += 16; - debug_out("\n"); - } - break; - case 'd': case 'D': - if (params) sscanf(&ins[d], "%X", (unsigned int *)&debug_disaddr); - for (c = 0; c < 12; c++) - { - debug_out(" "); - debug_disassemble(); - debug_out("\n"); - } - break; - case 'r': case 'R': - if (params) - { - if (!strncasecmp(&ins[d], "sysvia", 6)) - { - sprintf(outs, " System VIA registers :\n"); - debug_out(outs); - sprintf(outs, " ORA %02X ORB %02X IRA %02X IRB %02X\n", sysvia.ora, sysvia.orb, sysvia.ira, sysvia.irb); - debug_out(outs); - sprintf(outs, " DDRA %02X DDRB %02X ACR %02X PCR %02X\n", sysvia.ddra, sysvia.ddrb, sysvia.acr, sysvia.pcr); - debug_out(outs); - sprintf(outs, " Timer 1 latch %04X count %04X\n", sysvia.t1l / 2, (sysvia.t1c / 2) & 0xFFFF); - debug_out(outs); - sprintf(outs, " Timer 2 latch %04X count %04X\n", sysvia.t2l / 2, (sysvia.t2c / 2) & 0xFFFF); - debug_out(outs); - sprintf(outs, " IER %02X IFR %02X\n", sysvia.ier, sysvia.ifr); - debug_out(outs); - } - if (!strncasecmp(&ins[d], "uservia", 7)) - { - sprintf(outs, " User VIA registers :\n"); - debug_out(outs); - sprintf(outs, " ORA %02X ORB %02X IRA %02X IRB %02X\n", uservia.ora, uservia.orb, uservia.ira, uservia.irb); - debug_out(outs); - sprintf(outs, " DDRA %02X DDRB %02X ACR %02X PCR %02X\n", uservia.ddra, uservia.ddrb, uservia.acr, uservia.pcr); - debug_out(outs); - sprintf(outs, " Timer 1 latch %04X count %04X\n", uservia.t1l / 2, (uservia.t1c / 2) & 0xFFFF); - debug_out(outs); - sprintf(outs, " Timer 2 latch %04X count %04X\n", uservia.t2l / 2, (uservia.t2c / 2) & 0xFFFF); - debug_out(outs); - sprintf(outs, " IER %02X IFR %02X\n", uservia.ier, uservia.ifr); - debug_out(outs); - } - if (!strncasecmp(&ins[d], "crtc", 4)) - { - sprintf(outs, " CRTC registers :\n"); - debug_out(outs); - sprintf(outs, " Index=%i\n", crtc_i); - debug_out(outs); - sprintf(outs, " R0 =%02X R1 =%02X R2 =%02X R3 =%02X R4 =%02X R5 =%02X R6 =%02X R7 =%02X R8 =%02X\n", crtc[0], crtc[1], crtc[2], crtc[3], crtc[4], crtc[5], crtc[6], crtc[7], crtc[8]); - debug_out(outs); - sprintf(outs, " R9 =%02X R10=%02X R11=%02X R12=%02X R13=%02X R14=%02X R15=%02X R16=%02X R17=%02X\n", crtc[9], crtc[10], crtc[11], crtc[12], crtc[13], crtc[14], crtc[15], crtc[16], crtc[17]); - debug_out(outs); - sprintf(outs, " VC=%i SC=%i HC=%i MA=%04X\n", vc, sc, hc, ma); - debug_out(outs); - } - if (!strncasecmp(&ins[d],"vidproc",7)) - { - sprintf(outs, " VIDPROC registers :\n"); - debug_out(outs); - sprintf(outs, " Control=%02X\n", ula_ctrl); - debug_out(outs); - sprintf(outs, " Palette entries :\n"); - debug_out(outs); - sprintf(outs, " 0=%01X 1=%01X 2=%01X 3=%01X 4=%01X 5=%01X 6=%01X 7=%01X\n", ula_palbak[0], ula_palbak[1], ula_palbak[2], ula_palbak[3], ula_palbak[4], ula_palbak[5], ula_palbak[6], ula_palbak[7]); - debug_out(outs); - sprintf(outs, " 8=%01X 9=%01X 10=%01X 11=%01X 12=%01X 13=%01X 14=%01X 15=%01X\n", ula_palbak[8], ula_palbak[9], ula_palbak[10], ula_palbak[11], ula_palbak[12], ula_palbak[13], ula_palbak[14], ula_palbak[15]); - debug_out(outs); - } - if (!strncasecmp(&ins[d],"sound",5)) - { - sprintf(outs, " Sound registers :\n"); - debug_out(outs); - sprintf(outs, " Voice 0 frequency = %04X volume = %i control = %02X\n", sn_latch[0] >> 6, sn_vol[0], sn_noise); - debug_out(outs); - sprintf(outs, " Voice 1 frequency = %04X volume = %i\n", sn_latch[1] >> 6, sn_vol[1]); - debug_out(outs); - sprintf(outs, " Voice 2 frequency = %04X volume = %i\n", sn_latch[2] >> 6, sn_vol[2]); - debug_out(outs); - sprintf(outs, " Voice 3 frequency = %04X volume = %i\n", sn_latch[3] >> 6, sn_vol[3]); - debug_out(outs); - } - } - else - { - sprintf(outs, " 6502 registers :\n"); - debug_out(outs); - sprintf(outs, " A=%02X X=%02X Y=%02X S=01%02X PC=%04X\n", a, x, y, s, pc); - debug_out(outs); - sprintf(outs, " Status : %c%c%c%c%c%c\n", (p.n) ? 'N' : ' ', (p.v) ? 'V' : ' ', (p.d) ? 'D' : ' ', (p.i) ? 'I' : ' ', (p.z) ? 'Z' : ' ', (p.c) ? 'C' : ' '); - debug_out(outs); - } - break; - case 's': case 'S': - if (params) sscanf(&ins[d], "%i", &debugstep); - else debugstep = 1; - debug_lastcommand = ins[0]; - indebug = 0; - return; - case 'b': case 'B': - if (!strncasecmp(ins, "breakr", 6)) - { - if (!params) break; - for (c = 0; c < 8; c++) - { - if (breakpoints[c] == -1) - { - sscanf(&ins[d], "%X", &breakr[c]); - sprintf(outs, " Read breakpoint %i set to %04X\n", c, breakr[c]); - debug_out(outs); - break; - } - } - } - else if (!strncasecmp(ins, "breakw", 6)) - { - if (!params) break; - for (c = 0; c < 8; c++) - { - if (breakpoints[c] == -1) - { - sscanf(&ins[d], "%X", &breakw[c]); - sprintf(outs, " Write breakpoint %i set to %04X\n", c, breakw[c]); - debug_out(outs); - break; - } - } - } - else if (!strncasecmp(ins, "break", 5)) - { - if (!params) break; - for (c = 0; c < 8; c++) - { - if (breakpoints[c] == -1) - { - sscanf(&ins[d], "%X", &breakpoints[c]); - sprintf(outs, " Breakpoint %i set to %04X\n", c, breakpoints[c]); - debug_out(outs); - break; - } - } - } - if (!strncasecmp(ins, "blist", 5)) - { - for (c = 0; c < 8; c++) - { - if (breakpoints[c] != -1) - { - sprintf(outs, " Breakpoint %i : %04X\n", c, breakpoints[c]); - debug_out(outs); - } - } - for (c = 0; c < 8; c++) - { - if (breakr[c] != -1) - { - sprintf(outs, " Read breakpoint %i : %04X\n", c, breakr[c]); - debug_out(outs); - } - } - for (c = 0; c < 8; c++) - { - if (breakw[c] != -1) - { - sprintf(outs, " Write breakpoint %i : %04X\n", c, breakw[c]); - debug_out(outs); - } - } - } - if (!strncasecmp(ins, "bclearr", 7)) - { - if (!params) break; - sscanf(&ins[d], "%X", &e); - for (c = 0; c < 8; c++) - { - if (breakr[c] == e) breakr[c] = -1; - if (c == e) breakr[c] = -1; - } - } - else if (!strncasecmp(ins, "bclearw", 7)) - { - if (!params) break; - sscanf(&ins[d], "%X", &e); - for (c = 0; c < 8; c++) - { - if (breakw[c] == e) breakw[c] = -1; - if (c == e) breakw[c] = -1; - } - } - else if (!strncasecmp(ins, "bclear", 6)) - { - if (!params) break; - sscanf(&ins[d], "%X", &e); - for (c = 0; c < 8; c++) - { - if (breakpoints[c] == e) breakpoints[c] = -1; - if (c == e) breakpoints[c] = -1; - } - } - break; - case 'w': case 'W': - if (!strncasecmp(ins, "watchr", 6)) - { - if (!params) break; - for (c = 0; c < 8; c++) - { - if (watchr[c] == -1) - { - sscanf(&ins[d], "%X", &watchr[c]); - sprintf(outs, " Read watchpoint %i set to %04X\n", c, watchr[c]); - debug_out(outs); - break; - } - } - break; - } - if (!strncasecmp(ins, "watchw", 6)) - { - if (!params) break; - for (c = 0; c < 8; c++) - { - if (watchw[c] == -1) - { - sscanf(&ins[d], "%X", &watchw[c]); - sprintf(outs, " Write watchpoint %i set to %04X\n", c, watchw[c]); - debug_out(outs); - break; - } - } - break; - } - if (!strncasecmp(ins, "wlist", 5)) - { - for (c = 0; c < 8; c++) - { - if (watchr[c] != -1) - { - sprintf(outs, " Read watchpoint %i : %04X\n", c, watchr[c]); - debug_out(outs); - } - } - for (c = 0; c < 8; c++) - { - if (watchw[c] != -1) - { - sprintf(outs, " Write watchpoint %i : %04X\n", c, watchw[c]); - debug_out(outs); - } - } - } - if (!strncasecmp(ins, "wclearr", 7)) - { - if (!params) break; - sscanf(&ins[d], "%X", &e); - for (c = 0; c < 8; c++) - { - if (watchr[c] == e) watchr[c] = -1; - if (c == e) watchr[c] = -1; - } - } - else if (!strncasecmp(ins, "wclearw", 7)) - { - if (!params) break; - sscanf(&ins[d], "%X", &e); - for (c = 0; c < 8; c++) - { - if (watchw[c] == e) watchw[c] = -1; - if (c == e) watchw[c] = -1; - } - } - else if (!strncasecmp(ins, "writem", 6)) - { - if (!params) break; - sscanf(&ins[d], "%X %X", &e, &f); - rpclog("WriteM %04X %04X\n", e, f); - writemem(e, f); - } - break; - case 'q': case 'Q': - setquit(); - while (1); - break; - case 'h': case 'H': case '?': - sprintf(outs, "\n Debugger commands :\n\n"); - debug_out(outs); - sprintf(outs, " bclear n - clear breakpoint n or breakpoint at n\n"); - debug_out(outs); - sprintf(outs, " bclearr n - clear read breakpoint n or read breakpoint at n\n"); - debug_out(outs); - sprintf(outs, " bclearw n - clear write breakpoint n or write breakpoint at n\n"); - debug_out(outs); - sprintf(outs, " blist - list current breakpoints\n"); - debug_out(outs); - sprintf(outs, " break n - set a breakpoint at n\n"); - debug_out(outs); - sprintf(outs, " breakr n - break on reads from address n\n"); - debug_out(outs); - sprintf(outs, " breakw n - break on writes to address n\n"); - debug_out(outs); - sprintf(outs, " c - continue running indefinitely\n"); - debug_out(outs); - sprintf(outs, " d [n] - disassemble from address n\n"); - debug_out(outs); - sprintf(outs, " m [n] - memory dump from address n\n"); - debug_out(outs); - sprintf(outs, " q - force emulator exit\n"); - debug_out(outs); - sprintf(outs, " r - print 6502 registers\n"); - debug_out(outs); - sprintf(outs, " r sysvia - print System VIA registers\n"); - debug_out(outs); - sprintf(outs, " r uservia - print User VIA registers\n"); - debug_out(outs); - sprintf(outs, " r crtc - print CRTC registers\n"); - debug_out(outs); - sprintf(outs, " r vidproc - print VIDPROC registers\n"); - debug_out(outs); - sprintf(outs, " r sound - print Sound registers\n"); - debug_out(outs); - sprintf(outs, " s [n] - step n instructions (or 1 if no parameter)\n\n"); - debug_out(outs); - sprintf(outs, " watchr n - watch reads from address n\n"); - debug_out(outs); - sprintf(outs, " watchw n - watch writes to address n\n"); - debug_out(outs); - sprintf(outs, " wclearr n - clear read watchpoint n or read watchpoint at n\n"); - debug_out(outs); - sprintf(outs, " wclearw n - clear write watchpoint n or write watchpoint at n\n"); - debug_out(outs); - sprintf(outs, " writem a v - write to memory, a = address, v = value\n"); - debug_out(outs); - break; - } - debug_lastcommand = ins[0]; -// WriteConsole(consf,"\n",1,NULL,NULL); -// WriteConsole(consf,ins,strlen(ins),NULL,NULL); - } - fcount = 0; - indebug = 0; -} +/*B-em v2.2 by Tom Walker + Debugger*/ + +int debug; +int indebug=0; +extern int fcount; + +#ifdef WIN32 +#include +#include +#include +#include "b-em.h" +#include "debugger.h" + +static HANDLE debugthread; +static HWND dhwnd; +static int debugstarted = 0; +static char DebugszClassName[ ] = "B-emDebugWnd"; +LRESULT CALLBACK DebugWindowProcedure (HWND, UINT, WPARAM, LPARAM); +static HINSTANCE hinst; +static uint8_t *usdat; + +void _debugthread(PVOID pvoid) +{ + MSG messages = {0}; /* Here messages to the application are saved */ + WNDCLASSEX wincl; /* Data structure for the windowclass */ + + HDC hDC; + HDC memDC; + HBITMAP memBM; + BITMAPINFO lpbmi; + int x; + int c,d; + + usdat = malloc(256 * 256 * 4); + if (!debugstarted) + { + wincl.hInstance = hinst; + wincl.lpszClassName = DebugszClassName; + wincl.lpfnWndProc = DebugWindowProcedure; /* This function is called by windows */ + wincl.style = CS_DBLCLKS; /* Catch double-clicks */ + wincl.cbSize = sizeof (WNDCLASSEX); + + /* Use default icon and mouse-pointer */ + wincl.hIcon = LoadIcon(hinst, "allegro_icon"); + wincl.hIconSm = LoadIcon(hinst, "allegro_icon"); + wincl.hCursor = LoadCursor (NULL, IDC_ARROW); + wincl.lpszMenuName = NULL; /* No menu */ + wincl.cbClsExtra = 0; /* No extra bytes after the window class */ + wincl.cbWndExtra = 0; /* structure or the window instance */ + /* Use Windows's default color as the background of the window */ + wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND; + + /* Register the window class, and if it fails quit the program */ + if (!RegisterClassEx(&wincl)) + { + printf("Registerclass failed\n"); + return; + } + } + dhwnd = CreateWindowEx ( + 0, /* Extended possibilites for variation */ + DebugszClassName, /* Classname */ + "Memory viewer", /* Title Text */ + WS_OVERLAPPEDWINDOW, /* default window */ + CW_USEDEFAULT, /* Windows decides the position */ + CW_USEDEFAULT, /* where the window ends up on the screen */ + 256 + (GetSystemMetrics(SM_CXFIXEDFRAME) * 2),/* The programs width */ + 256 + (GetSystemMetrics(SM_CYFIXEDFRAME) * 2) + GetSystemMetrics(SM_CYCAPTION) + 2,/* and height in pixels */ + HWND_DESKTOP, /* The window is a child-window to desktop */ + NULL, /* No menu */ + hinst, /* Program Instance handler */ + NULL /* No Window Creation data */ + ); + printf("Window create %08X\n", (uint32_t)dhwnd); + ShowWindow (dhwnd, SW_SHOWNORMAL); + + hDC = GetDC(dhwnd); + + memDC = CreateCompatibleDC ( hDC ); + if (!memDC) printf("memDC failed!\n"); + memBM = CreateCompatibleBitmap ( hDC, 256, 256 ); + if (!memBM) printf("memBM failed!\n"); + SelectObject ( memDC, memBM ); + + lpbmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + lpbmi.bmiHeader.biWidth = 256; + lpbmi.bmiHeader.biHeight = -256; + lpbmi.bmiHeader.biPlanes = 1; + lpbmi.bmiHeader.biBitCount = 32; + lpbmi.bmiHeader.biCompression = BI_RGB; + lpbmi.bmiHeader.biSizeImage = 256 * 256 * 4; + lpbmi.bmiHeader.biClrUsed = 0; + lpbmi.bmiHeader.biClrImportant = 0; + + debugstarted = 1; + while (debugon) + { + Sleep(20); + + + c += 16; + d = 0; + for (x = 0; x < 65536; x++) + { + usdat[d++] = fetchc[x] * 8; + usdat[d++] = readc[x] * 8; + usdat[d++] = writec[x] * 8; + usdat[d++] = 0; + if (fetchc[x]) fetchc[x]--; + if (readc[x]) readc[x]--; + if (writec[x]) writec[x]--; + } + + SetDIBitsToDevice(memDC, 0, 0, 256, 256, 0, 0, 0, 256, usdat, &lpbmi, DIB_RGB_COLORS); + BitBlt(hDC, 0, 0, 256, 256, memDC, 0, 0, SRCCOPY); + + if (PeekMessage(&messages, NULL, 0, 0, PM_REMOVE)) + { + /* Translate virtual-key messages into character messages */ + TranslateMessage(&messages); + /* Send message to WindowProcedure */ + DispatchMessage(&messages); + } +// if (indebug) pollmainwindow(); + } + free(usdat); +} + +static HANDLE consf, cinf; + +BOOL CtrlHandler(DWORD fdwCtrlType) +{ + setquit(); + return TRUE; +} + + +/*void _debugconsolethread(PVOID pvoid) +{ + int c,d; + return; + while (debug) + { + if (!gotstr) + { + c=ReadConsoleA(cinf,debugconsoleins,255,(LPDWORD)&d,NULL); + debugconsoleins[d]=0; + gotstr=1; + } + else + Sleep(10); + } +}*/ + +void debug_start() +{ + if (debug) + { + hinst = GetModuleHandle(NULL); + debugthread = (HANDLE)_beginthread(_debugthread, 0, NULL); +// debugconsolethread=(HANDLE)_beginthread(_debugconsolethread,0,NULL); + + AllocConsole(); + SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler, TRUE); + consf = GetStdHandle(STD_OUTPUT_HANDLE); + cinf = GetStdHandle(STD_INPUT_HANDLE); + } +} + +void debug_end() +{ + FreeConsole(); + debug = debugon = 0; +} + +void debug_kill() +{ + TerminateThread(debugthread, 0); + if (usdat) free(usdat); +} + +LRESULT CALLBACK DebugWindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) /* handle the messages */ + { + case WM_CREATE: + return 0; + case WM_DESTROY: + PostQuitMessage (0); /* send a WM_QUIT to the message queue */ + break; + default: /* for messages that we don't deal with */ + return DefWindowProc (hwnd, message, wParam, lParam); + } + return 0; +} + +static void debug_out(char *s) +{ + startblit(); + WriteConsole(consf, s, strlen(s), NULL, NULL); + endblit(); + rpclog("%s", s); +} + +#else + +#include +#include "b-em.h" +#include "debugger.h" + +#undef printf + +static void debug_out(char *s) +{ + printf(s); + fflush(stdout); +} + +void debug_start() +{ +} + +#endif + +#include "6502.h" +#include "via.h" +#include "sysvia.h" +#include "uservia.h" +#include "video.h" +#include "sn76489.h" +#include "model.h" + +int readc[65536], writec[65536], fetchc[65536]; + +static uint16_t debug_memaddr=0; +static uint16_t debug_disaddr=0; +static uint8_t debug_lastcommand=0; + +static uint8_t debug_readmem(uint16_t addr) +{ + if (addr >= 0xFC00 && addr < 0xFF00) return 0xFF; + return readmem(addr); +} + +enum +{ + IMP,IMPA,IMM,ZP,ZPX,ZPY,INDX,INDY,IND,ABS,ABSX,ABSY,IND16,IND1X,BRA +}; + +static char dopname[256][6]= +{ +/*00*/ "BRK","ORA","---","---","TSB","ORA","ASL","---","PHP","ORA","ASL","---","TSB","ORA","ASL","---", +/*10*/ "BPL","ORA","ORA","---","TRB","ORA","ASL","---","CLC","ORA","INC","---","TRB","ORA","ASL","---", +/*20*/ "JSR","AND","---","---","BIT","AND","ROL","---","PLP","AND","ROL","---","BIT","AND","ROL","---", +/*30*/ "BMI","AND","AND","---","BIT","AND","ROL","---","SEC","AND","DEC","---","BIT","AND","ROL","---", +/*40*/ "RTI","EOR","---","---","---","EOR","LSR","---","PHA","EOR","LSR","---","JMP","EOR","LSR","---", +/*50*/ "BVC","EOR","EOR","---","---","EOR","LSR","---","CLI","EOR","PHY","---","---","EOR","LSR","---", +/*60*/ "RTS","ADC","---","---","STZ","ADC","ROR","---","PLA","ADC","ROR","---","JMP","ADC","ROR","---", +/*70*/ "BVS","ADC","ADC","---","STZ","ADC","ROR","---","SEI","ADC","PLY","---","JMP","ADC","ROR","---", +/*80*/ "BRA","STA","---","---","STY","STA","STX","---","DEY","BIT","TXA","---","STY","STA","STX","---", +/*90*/ "BCC","STA","STA","---","STY","STA","STX","---","TYA","STA","TXS","---","STZ","STA","STZ","---", +/*A0*/ "LDY","LDA","LDX","---","LDY","LDA","LDX","---","TAY","LDA","TAX","---","LDY","LDA","LDX","---", +/*B0*/ "BCS","LDA","LDA","---","LDY","LDA","LDX","---","CLV","LDA","TSX","---","LDY","LDA","LDX","---", +/*C0*/ "CPY","CMP","---","---","CPY","CMP","DEC","---","INY","CMP","DEX","WAI","CPY","CMP","DEC","---", +/*D0*/ "BNE","CMP","CMP","---","---","CMP","DEC","---","CLD","CMP","PHX","STP","---","CMP","DEC","---", +/*E0*/ "CPX","SBC","---","---","CPX","SBC","INC","---","INX","SBC","NOP","---","CPX","SBC","INC","---", +/*F0*/ "BEQ","SBC","SBC","---","---","SBC","INC","---","SED","SBC","PLX","---","---","SBC","INC","---", +}; + +static int dopaddr[256]= +{ +/*00*/ IMP, INDX, IMP, IMP, ZP, ZP, ZP, IMP, IMP, IMM, IMPA, IMP, ABS, ABS, ABS, IMP, +/*10*/ BRA, INDY, IND, IMP, ZP, ZPX, ZPX, IMP, IMP, ABSY, IMPA, IMP, ABS, ABSX, ABSX, IMP, +/*20*/ ABS, INDX, IMP, IMP, ZP, ZP, ZP, IMP, IMP, IMM, IMPA, IMP, ABS, ABS, ABS, IMP, +/*30*/ BRA, INDY, IND, IMP, ZPX, ZPX, ZPX, IMP, IMP, ABSY, IMPA, IMP, ABSX, ABSX, ABSX, IMP, +/*40*/ IMP, INDX, IMP, IMP, ZP, ZP, ZP, IMP, IMP, IMM, IMPA, IMP, ABS, ABS, ABS, IMP, +/*50*/ BRA, INDY, IND, IMP, ZP, ZPX, ZPX, IMP, IMP, ABSY, IMP, IMP, ABS, ABSX, ABSX, IMP, +/*60*/ IMP, INDX, IMP, IMP, ZP, ZP, ZP, IMP, IMP, IMM, IMPA, IMP, IND16,ABS, ABS, IMP, +/*70*/ BRA, INDY, IND, IMP, ZPX, ZPX, ZPX, IMP, IMP, ABSY, IMP, IMP, IND1X,ABSX, ABSX, IMP, +/*80*/ BRA, INDX, IMP, IMP, ZP, ZP, ZP, IMP, IMP, IMM, IMP, IMP, ABS, ABS, ABS, IMP, +/*90*/ BRA, INDY, IND, IMP, ZPX, ZPX, ZPY, IMP, IMP, ABSY, IMP, IMP, ABS, ABSX, ABSX, IMP, +/*A0*/ IMM, INDX, IMM, IMP, ZP, ZP, ZP, IMP, IMP, IMM, IMP, IMP, ABS, ABS, ABS, IMP, +/*B0*/ BRA, INDY, IND, IMP, ZPX, ZPX, ZPY, IMP, IMP, ABSY, IMP, IMP, ABSX, ABSX, ABSY, IMP, +/*C0*/ IMM, INDX, IMP, IMP, ZP, ZP, ZP, IMP, IMP, IMM, IMP, IMP, ABS, ABS, ABS, IMP, +/*D0*/ BRA, INDY, IND, IMP, ZP, ZPX, ZPX, IMP, IMP, ABSY, IMP, IMP, ABS, ABSX, ABSX, IMP, +/*E0*/ IMM, INDX, IMP, IMP, ZP, ZP, ZP, IMP, IMP, IMM, IMP, IMP, ABS, ABS, ABS, IMP, +/*F0*/ BRA, INDY, IND, IMP, ZP, ZPX, ZPX, IMP, IMP, ABSY, IMP, IMP, ABS, ABSX, ABSX, IMP, +}; + +static char dopnamenmos[256][6]= +{ +/*00*/ "BRK","ORA","HLT","SLO","NOP","ORA","ASL","SLO","PHP","ORA","ASL","ANC","NOP","ORA","ASL","SLO", +/*10*/ "BPL","ORA","HLT","SLO","NOP","ORA","ASL","SLO","CLC","ORA","NOP","SLO","NOP","ORA","ASL","SLO", +/*20*/ "JSR","AND","HLT","RLA","NOP","AND","ROL","RLA","PLP","AND","ROL","ANC","BIT","AND","ROL","RLA", +/*30*/ "BMI","AND","HLT","RLA","NOP","AND","ROL","RLA","SEC","AND","NOP","RLA","NOP","AND","ROL","RLA", +/*40*/ "RTI","EOR","HLT","SRE","NOP","EOR","LSR","SRE","PHA","EOR","LSR","ASR","JMP","EOR","LSR","SRE", +/*50*/ "BVC","EOR","HLT","SRE","NOP","EOR","LSR","SRE","CLI","EOR","NOP","SRE","NOP","EOR","LSR","SRE", +/*60*/ "RTS","ADC","HLT","RRA","NOP","ADC","ROR","RRA","PLA","ADC","ROR","ARR","JMP","ADC","ROR","RRA", +/*70*/ "BVS","ADC","HLT","RRA","NOP","ADC","ROR","RRA","SEI","ADC","NOP","RRA","NOP","ADC","ROR","RRA", +/*80*/ "BRA","STA","NOP","SAX","STY","STA","STX","SAX","DEY","NOP","TXA","ANE","STY","STA","STX","SAX", +/*90*/ "BCC","STA","HLT","SHA","STY","STA","STX","SAX","TYA","STA","TXS","SHS","SHY","STA","SHX","SHA", +/*A0*/ "LDY","LDA","LDX","LAX","LDY","LDA","LDX","LAX","TAY","LDA","TAX","LXA","LDY","LDA","LDX","LAX", +/*B0*/ "BCS","LDA","HLT","LAX","LDY","LDA","LDX","LAX","CLV","LDA","TSX","LAS","LDY","LDA","LDX","LAX", +/*C0*/ "CPY","CMP","NOP","DCP","CPY","CMP","DEC","DCP","INY","CMP","DEX","SBX","CPY","CMP","DEC","DCP", +/*D0*/ "BNE","CMP","HLT","DCP","NOP","CMP","DEC","DCP","CLD","CMP","NOP","DCP","NOP","CMP","DEC","DCP", +/*E0*/ "CPX","SBC","NOP","ISB","CPX","SBC","INC","ISB","INX","SBC","NOP","SBC","CPX","SBC","INC","ISB", +/*F0*/ "BEQ","SBC","HLT","ISB","NOP","SBC","INC","ISB","SED","SBC","NOP","ISB","NOP","SBC","INC","ISB", +}; + +static int dopaddrnmos[256]= +{ +/*00*/ IMP, INDX, IMP, INDX, ZP, ZP, ZP, ZP, IMP, IMM, IMPA, IMM, ABS, ABS, ABS, ABS, +/*10*/ BRA, INDY, IMP, INDY, ZPX, ZPX, ZPX, ZPX, IMP, ABSY, IMP, ABSY, ABSX, ABSX, ABSX, ABSX, +/*20*/ ABS, INDX, IMP, INDX, ZP, ZP, ZP, ZP, IMP, IMM, IMPA, IMM, ABS, ABS, ABS, ABS, +/*30*/ BRA, INDY, IMP, INDY, ZPX, ZPX, ZPX, ZPX, IMP, ABSY, IMP, ABSY, ABSX, ABSX, ABSX, ABSX, +/*40*/ IMP, INDX, IMP, INDX, ZP, ZP, ZP, ZP, IMP, IMM, IMPA, IMM, ABS, ABS, ABS, ABS, +/*50*/ BRA, INDY, IMP, INDY, ZPX, ZPX, ZPX, ZPX, IMP, ABSY, IMP, ABSY, ABSX, ABSX, ABSX, ABSX, +/*60*/ IMP, INDX, IMP, INDX, ZP, ZP, ZP, ZP, IMP, IMM, IMPA, IMM, IND16,ABS, ABS, ABS, +/*70*/ BRA, INDY, IMP, INDY, ZPX, ZPX, ZPX, ZPX, IMP, ABSY, IMP, ABSY, ABSX, ABSX, ABSX, ABSX, +/*80*/ BRA, INDX, IMM, INDX, ZP, ZP, ZP, ZP, IMP, IMM, IMP, IMM, ABS, ABS, ABS, ABS, +/*90*/ BRA, INDY, IMP, INDY, ZPX, ZPX, ZPY, ZPY, IMP, ABSY, IMP, ABSY, ABSX, ABSX, ABSX, ABSX, +/*A0*/ IMM, INDX, IMM, INDX, ZP, ZP, ZP, ZP, IMP, IMM, IMP, IMM, ABS, ABS, ABS, ABS, +/*B0*/ BRA, INDY, IMP, INDY, ZPX, ZPX, ZPY, ZPY, IMP, ABSY, IMP, ABSY, ABSX, ABSX, ABSY, ABSX, +/*C0*/ IMM, INDX, IMM, INDX, ZP, ZP, ZP, ZP, IMP, IMM, IMP, IMM, ABS, ABS, ABS, ABS, +/*D0*/ BRA, INDY, IMP, INDY, ZPX, ZPX, ZPX, ZPX, IMP, ABSY, IMP, ABSY, ABSX, ABSX, ABSX, ABSX, +/*E0*/ IMM, INDX, IMM, INDX, ZP, ZP, ZP, ZP, IMP, IMM, IMP, IMM, ABS, ABS, ABS, ABS, +/*F0*/ BRA, INDY, IMP, INDY, ZPX, ZPX, ZPX, ZPX, IMP, ABSY, IMP, ABSY, ABSX, ABSX, ABSX, ABSX, +}; + + +static void debug_disassemble() +{ + uint16_t temp; + char s[256]; + uint8_t op = debug_readmem(debug_disaddr); + uint8_t p1 = debug_readmem(debug_disaddr + 1), p2 = debug_readmem(debug_disaddr + 2); + sprintf(s, "%04X : ", debug_disaddr); + debug_out(s); + debug_out(MASTER ? dopname[op] : dopnamenmos[op]); + debug_out(" "); + switch (MASTER ? dopaddr[op] : dopaddrnmos[op]) + { + case IMP: + sprintf(s, " "); + debug_out(s); + break; + case IMPA: + sprintf(s, "A "); + debug_out(s); + break; + case IMM: + sprintf(s, "#%02X ", p1); + debug_out(s); + debug_disaddr++; + break; + case ZP: + sprintf(s, "%02X ", p1); + debug_out(s); + debug_disaddr++; + break; + case ZPX: + sprintf(s, "%02X,X ", p1); + debug_out(s); + debug_disaddr++; + break; + case ZPY: + sprintf(s, "%02X,Y ", p1); + debug_out(s); + debug_disaddr++; + break; + case IND: + sprintf(s, "(%02X) ", p1); + debug_out(s); + debug_disaddr++; + break; + case INDX: + sprintf(s, "(%02X,X) ", p1); + debug_out(s); + debug_disaddr++; + break; + case INDY: + sprintf(s, "(%02X),Y ", p1); + debug_out(s); + debug_disaddr++; + break; + case ABS: + sprintf(s, "%02X%02X ", p2, p1); + debug_out(s); + debug_disaddr += 2; + break; + case ABSX: + sprintf(s, "%02X%02X,X ", p2, p1); + debug_out(s); + debug_disaddr += 2; + break; + case ABSY: + sprintf(s, "%02X%02X,Y ", p2, p1); + debug_out(s); + debug_disaddr += 2; + break; + case IND16: + sprintf(s, "(%02X%02X) ", p2, p1); + debug_out(s); + debug_disaddr += 2; + break; + case IND1X: + sprintf(s, "(%02X%02X,X)", p2, p1); + debug_out(s); + debug_disaddr += 2; + break; + case BRA: + temp = debug_disaddr + 2 + (signed char)p1; + sprintf(s, "%04X ", temp); + debug_out(s); + debug_disaddr++; + break; + } + debug_disaddr++; +// WriteConsole(consf,"\n",strlen("\n"),NULL,NULL); +} + +static int breakpoints[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; +static int breakr[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; +static int breakw[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; +static int watchr[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; +static int watchw[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; +static int debugstep = 0; + +void debug_read(uint16_t addr) +{ + int c; + char outs[256]; + for (c = 0; c < 8; c++) + { + if (breakr[c] == addr) + { + debug = 1; + sprintf(outs, " Break on read from %04X\n", addr); + debug_out(outs); + return; + } + if (watchr[c] == addr) + { + sprintf(outs, " Read from %04X - A=%02X X=%02X Y=%02X PC=%04X\n", addr, a, x, y, pc); + debug_out(outs); + } + } +} +void debug_write(uint16_t addr, uint8_t val) +{ + int c; + char outs[256]; + for (c = 0; c < 8; c++) + { + if (breakw[c] == addr) + { + debug = 1; + sprintf(outs, " Break on write to %04X - val %02X\n", addr, val); + debug_out(outs); + return; + } + if (watchw[c] == addr) + { + sprintf(outs, " Write %02X to %04X - A=%02X X=%02X Y=%02X PC=%04X\n", val, addr, a, x, y, pc); + debug_out(outs); + } + } +} + +void debugger_do() +{ + int c, d, e, f; + int params; + uint8_t temp; + char outs[256]; + char ins[256]; + if (!opcode) + { + sprintf(outs, "BRK %04X! %04X %04X\n", pc, oldpc, oldoldpc); + debug_out(outs); + } + if (!opcode) debug = 1; + + for (c = 0; c < 8; c++) + { + if (breakpoints[c] == pc) + { + debug = 1; + sprintf(outs, " Break at %04X\n", pc); + debug_out(outs); + } + } + if (!debug) return; +// if (!opcode) printf("BRK at %04X\n",pc); + if (debugstep) + { + debugstep--; + if (debugstep) return; + } + indebug = 1; + while (1) + { + d = debug_disaddr; + debug_disaddr = pc; + debug_disassemble(); + debug_disaddr = d; + sprintf(outs, " >"); + debug_out(outs); +#ifdef WIN32 + c = ReadConsoleA(cinf, ins, 255, (LPDWORD)&d, NULL); + ins[d] = 0; +#else + d = (int)fgets(ins, 255, stdin); +#endif + d = 0; + while (ins[d] != 32 && ins[d] != 0xA && ins[d] != 0xD && ins[d] != 0) d++; + while (ins[d] == 32) d++; + if (ins[d] == 0xA || ins[d] == 0xD || ins[d] == 0) params = 0; + else params = 1; + + if (ins[0] == 0xA || ins[0] == 0xD) ins[0] = debug_lastcommand; +//debug_out("Processing!\n"); + switch (ins[0]) + { + case 'c': case 'C': + debug = 0; + indebug = 0; + return; + case 'm': case 'M': + if (params) sscanf(&ins[d], "%X", (unsigned int *)&debug_memaddr); + for (c = 0; c < 16; c++) + { + sprintf(outs, " %04X : ", debug_memaddr); + debug_out(outs); + for (d = 0; d < 16; d++) + { + sprintf(outs, "%02X ", debug_readmem(debug_memaddr + d)); + debug_out(outs); + } + debug_out(" "); + for (d = 0; d < 16; d++) + { + temp = debug_readmem(debug_memaddr + d); + if (temp < 32) sprintf(outs, "."); + else sprintf(outs, "%c", temp); + debug_out(outs); + } + debug_memaddr += 16; + debug_out("\n"); + } + break; + case 'd': case 'D': + if (params) sscanf(&ins[d], "%X", (unsigned int *)&debug_disaddr); + for (c = 0; c < 12; c++) + { + debug_out(" "); + debug_disassemble(); + debug_out("\n"); + } + break; + case 'r': case 'R': + if (params) + { + if (!strncasecmp(&ins[d], "sysvia", 6)) + { + sprintf(outs, " System VIA registers :\n"); + debug_out(outs); + sprintf(outs, " ORA %02X ORB %02X IRA %02X IRB %02X\n", sysvia.ora, sysvia.orb, sysvia.ira, sysvia.irb); + debug_out(outs); + sprintf(outs, " DDRA %02X DDRB %02X ACR %02X PCR %02X\n", sysvia.ddra, sysvia.ddrb, sysvia.acr, sysvia.pcr); + debug_out(outs); + sprintf(outs, " Timer 1 latch %04X count %04X\n", sysvia.t1l / 2, (sysvia.t1c / 2) & 0xFFFF); + debug_out(outs); + sprintf(outs, " Timer 2 latch %04X count %04X\n", sysvia.t2l / 2, (sysvia.t2c / 2) & 0xFFFF); + debug_out(outs); + sprintf(outs, " IER %02X IFR %02X\n", sysvia.ier, sysvia.ifr); + debug_out(outs); + } + if (!strncasecmp(&ins[d], "uservia", 7)) + { + sprintf(outs, " User VIA registers :\n"); + debug_out(outs); + sprintf(outs, " ORA %02X ORB %02X IRA %02X IRB %02X\n", uservia.ora, uservia.orb, uservia.ira, uservia.irb); + debug_out(outs); + sprintf(outs, " DDRA %02X DDRB %02X ACR %02X PCR %02X\n", uservia.ddra, uservia.ddrb, uservia.acr, uservia.pcr); + debug_out(outs); + sprintf(outs, " Timer 1 latch %04X count %04X\n", uservia.t1l / 2, (uservia.t1c / 2) & 0xFFFF); + debug_out(outs); + sprintf(outs, " Timer 2 latch %04X count %04X\n", uservia.t2l / 2, (uservia.t2c / 2) & 0xFFFF); + debug_out(outs); + sprintf(outs, " IER %02X IFR %02X\n", uservia.ier, uservia.ifr); + debug_out(outs); + } + if (!strncasecmp(&ins[d], "crtc", 4)) + { + sprintf(outs, " CRTC registers :\n"); + debug_out(outs); + sprintf(outs, " Index=%i\n", crtc_i); + debug_out(outs); + sprintf(outs, " R0 =%02X R1 =%02X R2 =%02X R3 =%02X R4 =%02X R5 =%02X R6 =%02X R7 =%02X R8 =%02X\n", crtc[0], crtc[1], crtc[2], crtc[3], crtc[4], crtc[5], crtc[6], crtc[7], crtc[8]); + debug_out(outs); + sprintf(outs, " R9 =%02X R10=%02X R11=%02X R12=%02X R13=%02X R14=%02X R15=%02X R16=%02X R17=%02X\n", crtc[9], crtc[10], crtc[11], crtc[12], crtc[13], crtc[14], crtc[15], crtc[16], crtc[17]); + debug_out(outs); + sprintf(outs, " VC=%i SC=%i HC=%i MA=%04X\n", vc, sc, hc, ma); + debug_out(outs); + } + if (!strncasecmp(&ins[d],"vidproc",7)) + { + sprintf(outs, " VIDPROC registers :\n"); + debug_out(outs); + sprintf(outs, " Control=%02X\n", ula_ctrl); + debug_out(outs); + sprintf(outs, " Palette entries :\n"); + debug_out(outs); + sprintf(outs, " 0=%01X 1=%01X 2=%01X 3=%01X 4=%01X 5=%01X 6=%01X 7=%01X\n", ula_palbak[0], ula_palbak[1], ula_palbak[2], ula_palbak[3], ula_palbak[4], ula_palbak[5], ula_palbak[6], ula_palbak[7]); + debug_out(outs); + sprintf(outs, " 8=%01X 9=%01X 10=%01X 11=%01X 12=%01X 13=%01X 14=%01X 15=%01X\n", ula_palbak[8], ula_palbak[9], ula_palbak[10], ula_palbak[11], ula_palbak[12], ula_palbak[13], ula_palbak[14], ula_palbak[15]); + debug_out(outs); + } + if (!strncasecmp(&ins[d],"sound",5)) + { + sprintf(outs, " Sound registers :\n"); + debug_out(outs); + sprintf(outs, " Voice 0 frequency = %04X volume = %i control = %02X\n", sn_latch[0] >> 6, sn_vol[0], sn_noise); + debug_out(outs); + sprintf(outs, " Voice 1 frequency = %04X volume = %i\n", sn_latch[1] >> 6, sn_vol[1]); + debug_out(outs); + sprintf(outs, " Voice 2 frequency = %04X volume = %i\n", sn_latch[2] >> 6, sn_vol[2]); + debug_out(outs); + sprintf(outs, " Voice 3 frequency = %04X volume = %i\n", sn_latch[3] >> 6, sn_vol[3]); + debug_out(outs); + } + } + else + { + sprintf(outs, " 6502 registers :\n"); + debug_out(outs); + sprintf(outs, " A=%02X X=%02X Y=%02X S=01%02X PC=%04X\n", a, x, y, s, pc); + debug_out(outs); + sprintf(outs, " Status : %c%c%c%c%c%c\n", (p.n) ? 'N' : ' ', (p.v) ? 'V' : ' ', (p.d) ? 'D' : ' ', (p.i) ? 'I' : ' ', (p.z) ? 'Z' : ' ', (p.c) ? 'C' : ' '); + debug_out(outs); + } + break; + case 's': case 'S': + if (params) sscanf(&ins[d], "%i", &debugstep); + else debugstep = 1; + debug_lastcommand = ins[0]; + indebug = 0; + return; + case 'b': case 'B': + if (!strncasecmp(ins, "breakr", 6)) + { + if (!params) break; + for (c = 0; c < 8; c++) + { + if (breakpoints[c] == -1) + { + sscanf(&ins[d], "%X", &breakr[c]); + sprintf(outs, " Read breakpoint %i set to %04X\n", c, breakr[c]); + debug_out(outs); + break; + } + } + } + else if (!strncasecmp(ins, "breakw", 6)) + { + if (!params) break; + for (c = 0; c < 8; c++) + { + if (breakpoints[c] == -1) + { + sscanf(&ins[d], "%X", &breakw[c]); + sprintf(outs, " Write breakpoint %i set to %04X\n", c, breakw[c]); + debug_out(outs); + break; + } + } + } + else if (!strncasecmp(ins, "break", 5)) + { + if (!params) break; + for (c = 0; c < 8; c++) + { + if (breakpoints[c] == -1) + { + sscanf(&ins[d], "%X", &breakpoints[c]); + sprintf(outs, " Breakpoint %i set to %04X\n", c, breakpoints[c]); + debug_out(outs); + break; + } + } + } + if (!strncasecmp(ins, "blist", 5)) + { + for (c = 0; c < 8; c++) + { + if (breakpoints[c] != -1) + { + sprintf(outs, " Breakpoint %i : %04X\n", c, breakpoints[c]); + debug_out(outs); + } + } + for (c = 0; c < 8; c++) + { + if (breakr[c] != -1) + { + sprintf(outs, " Read breakpoint %i : %04X\n", c, breakr[c]); + debug_out(outs); + } + } + for (c = 0; c < 8; c++) + { + if (breakw[c] != -1) + { + sprintf(outs, " Write breakpoint %i : %04X\n", c, breakw[c]); + debug_out(outs); + } + } + } + if (!strncasecmp(ins, "bclearr", 7)) + { + if (!params) break; + sscanf(&ins[d], "%X", &e); + for (c = 0; c < 8; c++) + { + if (breakr[c] == e) breakr[c] = -1; + if (c == e) breakr[c] = -1; + } + } + else if (!strncasecmp(ins, "bclearw", 7)) + { + if (!params) break; + sscanf(&ins[d], "%X", &e); + for (c = 0; c < 8; c++) + { + if (breakw[c] == e) breakw[c] = -1; + if (c == e) breakw[c] = -1; + } + } + else if (!strncasecmp(ins, "bclear", 6)) + { + if (!params) break; + sscanf(&ins[d], "%X", &e); + for (c = 0; c < 8; c++) + { + if (breakpoints[c] == e) breakpoints[c] = -1; + if (c == e) breakpoints[c] = -1; + } + } + break; + case 'w': case 'W': + if (!strncasecmp(ins, "watchr", 6)) + { + if (!params) break; + for (c = 0; c < 8; c++) + { + if (watchr[c] == -1) + { + sscanf(&ins[d], "%X", &watchr[c]); + sprintf(outs, " Read watchpoint %i set to %04X\n", c, watchr[c]); + debug_out(outs); + break; + } + } + break; + } + if (!strncasecmp(ins, "watchw", 6)) + { + if (!params) break; + for (c = 0; c < 8; c++) + { + if (watchw[c] == -1) + { + sscanf(&ins[d], "%X", &watchw[c]); + sprintf(outs, " Write watchpoint %i set to %04X\n", c, watchw[c]); + debug_out(outs); + break; + } + } + break; + } + if (!strncasecmp(ins, "wlist", 5)) + { + for (c = 0; c < 8; c++) + { + if (watchr[c] != -1) + { + sprintf(outs, " Read watchpoint %i : %04X\n", c, watchr[c]); + debug_out(outs); + } + } + for (c = 0; c < 8; c++) + { + if (watchw[c] != -1) + { + sprintf(outs, " Write watchpoint %i : %04X\n", c, watchw[c]); + debug_out(outs); + } + } + } + if (!strncasecmp(ins, "wclearr", 7)) + { + if (!params) break; + sscanf(&ins[d], "%X", &e); + for (c = 0; c < 8; c++) + { + if (watchr[c] == e) watchr[c] = -1; + if (c == e) watchr[c] = -1; + } + } + else if (!strncasecmp(ins, "wclearw", 7)) + { + if (!params) break; + sscanf(&ins[d], "%X", &e); + for (c = 0; c < 8; c++) + { + if (watchw[c] == e) watchw[c] = -1; + if (c == e) watchw[c] = -1; + } + } + else if (!strncasecmp(ins, "writem", 6)) + { + if (!params) break; + sscanf(&ins[d], "%X %X", &e, &f); + rpclog("WriteM %04X %04X\n", e, f); + writemem(e, f); + } + break; + case 'q': case 'Q': + setquit(); + while (1); + break; + case 'h': case 'H': case '?': + sprintf(outs, "\n Debugger commands :\n\n"); + debug_out(outs); + sprintf(outs, " bclear n - clear breakpoint n or breakpoint at n\n"); + debug_out(outs); + sprintf(outs, " bclearr n - clear read breakpoint n or read breakpoint at n\n"); + debug_out(outs); + sprintf(outs, " bclearw n - clear write breakpoint n or write breakpoint at n\n"); + debug_out(outs); + sprintf(outs, " blist - list current breakpoints\n"); + debug_out(outs); + sprintf(outs, " break n - set a breakpoint at n\n"); + debug_out(outs); + sprintf(outs, " breakr n - break on reads from address n\n"); + debug_out(outs); + sprintf(outs, " breakw n - break on writes to address n\n"); + debug_out(outs); + sprintf(outs, " c - continue running indefinitely\n"); + debug_out(outs); + sprintf(outs, " d [n] - disassemble from address n\n"); + debug_out(outs); + sprintf(outs, " m [n] - memory dump from address n\n"); + debug_out(outs); + sprintf(outs, " q - force emulator exit\n"); + debug_out(outs); + sprintf(outs, " r - print 6502 registers\n"); + debug_out(outs); + sprintf(outs, " r sysvia - print System VIA registers\n"); + debug_out(outs); + sprintf(outs, " r uservia - print User VIA registers\n"); + debug_out(outs); + sprintf(outs, " r crtc - print CRTC registers\n"); + debug_out(outs); + sprintf(outs, " r vidproc - print VIDPROC registers\n"); + debug_out(outs); + sprintf(outs, " r sound - print Sound registers\n"); + debug_out(outs); + sprintf(outs, " s [n] - step n instructions (or 1 if no parameter)\n\n"); + debug_out(outs); + sprintf(outs, " watchr n - watch reads from address n\n"); + debug_out(outs); + sprintf(outs, " watchw n - watch writes to address n\n"); + debug_out(outs); + sprintf(outs, " wclearr n - clear read watchpoint n or read watchpoint at n\n"); + debug_out(outs); + sprintf(outs, " wclearw n - clear write watchpoint n or write watchpoint at n\n"); + debug_out(outs); + sprintf(outs, " writem a v - write to memory, a = address, v = value\n"); + debug_out(outs); + break; + } + debug_lastcommand = ins[0]; +// WriteConsole(consf,"\n",1,NULL,NULL); +// WriteConsole(consf,ins,strlen(ins),NULL,NULL); + } + fcount = 0; + indebug = 0; +} diff --git a/src/debugger.h b/src/debugger.h index f46cb534..14f4fd8b 100644 --- a/src/debugger.h +++ b/src/debugger.h @@ -1,11 +1,11 @@ -void debug_start(); -void debug_kill(); -void debug_end(); -void debug_read(uint16_t addr); -void debug_write(uint16_t addr, uint8_t val); -void debugger_do(); - - -extern int readc[65536], writec[65536], fetchc[65536]; - -extern int debug,debugon; +void debug_start(); +void debug_kill(); +void debug_end(); +void debug_read(uint16_t addr); +void debug_write(uint16_t addr, uint8_t val); +void debugger_do(); + + +extern int readc[65536], writec[65536], fetchc[65536]; + +extern int debug,debugon; diff --git a/src/disc.c b/src/disc.c index e2213d6c..ab53d8bd 100644 --- a/src/disc.c +++ b/src/disc.c @@ -1,242 +1,242 @@ -/*B-em v2.2 by Tom Walker - Disc support*/ - -#include -#include -#include "b-em.h" - -#include "adf.h" -#include "fdi.h" -#include "ssd.h" - -#include "disc.h" - -#include "ddnoise.h" - -DRIVE drives[2]; - -int curdrive = 0; - -char discfns[2][260] = {"", ""}; -int defaultwriteprot = 0; - -int fdc_time; -int disc_time; - -int motorspin; -int motoron; - -void (*fdc_callback)(); -void (*fdc_data)(uint8_t dat); -void (*fdc_spindown)(); -void (*fdc_finishread)(); -void (*fdc_notfound)(); -void (*fdc_datacrcerror)(); -void (*fdc_headercrcerror)(); -void (*fdc_writeprotect)(); -int (*fdc_getdata)(int last); - -static struct -{ - char *ext; - void (*load)(int drive, char *fn); - void (*close)(int drive); - int size; -} -loaders[]= -{ - {"SSD", ssd_load, ssd_close, 80*10*256}, - {"DSD", dsd_load, ssd_close, 2*80*10*256}, - {"ADF", adf_load, adf_close, 80*16*256}, - {"ADL", adl_load, adf_close, 2*80*16*256}, - {"FDI", fdi_load, fdi_close, -1}, - {0,0,0} -}; - -static int driveloaders[2]; - -void disc_load(int drive, char *fn) -{ - int c = 0; - char *p; - FILE *f; - setejecttext(drive, ""); - if (!fn) return; - p = get_extension(fn); - if (!p) return; - setejecttext(drive, fn); - rpclog("Loading :%i %s %s\n", drive, fn,p); - while (loaders[c].ext) - { - if (!strcasecmp(p, loaders[c].ext)) - { - driveloaders[drive] = c; - loaders[c].load(drive, fn); - return; - } - c++; - } -// printf("Couldn't load %s %s\n",fn,p); - /*No extension match, so guess based on image size*/ - f=fopen(fn, "rb"); - if (!f) return; - fseek(f, -1, SEEK_END); - c = ftell(f)+1; - fclose(f); - rpclog("Size %i\n",c); - if (c == (800*1024)) /*800k ADFS/DOS - 80*2*5*1024*/ - { - driveloaders[drive] = 2; - loaders[2].load(drive, fn); - return; - } - if (c == (640*1024)) /*640k ADFS/DOS - 80*2*16*256*/ - { - driveloaders[drive] = 3; - loaders[3].load(drive, fn); - return; - } - if (c == (720*1024)) /*720k DOS - 80*2*9*512*/ - { - driveloaders[drive] = 3; - adl_loadex(drive, fn, 9, 512, 0); - return; - } - if (c == (360*1024)) /*360k DOS - 40*2*9*512*/ - { - driveloaders[drive] = 3; - adl_loadex(drive, fn, 9, 512, 1); - return; - } - if (c <= (200 * 1024)) /*200k DFS - 80*1*10*256*/ - { - driveloaders[drive] = 0; - loaders[0].load(drive, fn); - return; - } - if (c <= (400 * 1024)) /*400k DFS - 80*2*10*256*/ - { - driveloaders[drive] = 1; - loaders[1].load(drive, fn); - return; - } -} - -void disc_new(int drive, char *fn) -{ - int c = 0, d; - FILE *f; - char *p = get_extension(fn); - while (loaders[c].ext) - { - if (!strcasecmp(p, loaders[c].ext) && loaders[c].size != -1) - { - f=fopen(fn, "wb"); - for (d = 0; d < loaders[c].size; d++) putc(0, f); - if (!strcasecmp(p, "ADF")) - { - fseek(f, 0, SEEK_SET); - putc(7, f); - fseek(f, 0xFD, SEEK_SET); - putc(5, f); putc(0, f); putc(0xC, f); putc(0xF9, f); putc(0x04, f); - fseek(f, 0x1FB, SEEK_SET); - putc(0x88,f); putc(0x39,f); putc(0,f); putc(3,f); putc(0xC1,f); - putc(0, f); putc('H', f); putc('u', f); putc('g', f); putc('o', f); - fseek(f, 0x6CC, SEEK_SET); - putc(0x24, f); - fseek(f, 0x6D6, SEEK_SET); - putc(2, f); putc(0, f); putc(0, f); putc(0x24, f); - fseek(f, 0x6FB, SEEK_SET); - putc('H', f); putc('u', f); putc('g', f); putc('o', f); - } - if (!strcasecmp(p, "ADL")) - { - fseek(f, 0, SEEK_SET); - putc(7, f); - fseek(f, 0xFD, SEEK_SET); - putc(0xA, f); putc(0, f); putc(0x11, f); putc(0xF9, f); putc(0x09, f); - fseek(f, 0x1FB, SEEK_SET); - putc(0x01, f); putc(0x84, f); putc(0, f); putc(3, f); putc(0x8A, f); - putc(0, f); putc('H', f); putc('u', f); putc('g', f); putc('o', f); - fseek(f, 0x6CC, SEEK_SET); - putc(0x24, f); - fseek(f, 0x6D6, SEEK_SET); - putc(2, f); putc(0, f); putc(0, f); putc(0x24, f); - fseek(f, 0x6FB, SEEK_SET); - putc('H', f); putc('u', f); putc('g', f); putc('o', f); - } - fclose(f); - disc_load(drive, fn); - return; - } - c++; - } -} - -void disc_close(int drive) -{ - if (loaders[driveloaders[drive]].close) loaders[driveloaders[drive]].close(drive); -} - -int disc_notfound=0; - -void disc_init() -{ - drives[0].poll = drives[1].poll = 0; - drives[0].seek = drives[1].seek = 0; - drives[0].readsector = drives[1].readsector = 0; - curdrive = 0; -} - -void disc_poll() -{ - if (drives[curdrive].poll) drives[curdrive].poll(); - if (disc_notfound) - { - disc_notfound--; - if (!disc_notfound) - fdc_notfound(); - } -} - -int oldtrack[2] = {0, 0}; -void disc_seek(int drive, int track) -{ - if (drives[drive].seek) - drives[drive].seek(drive, track); - ddnoise_seek(track - oldtrack[drive]); - oldtrack[drive] = track; -} - -void disc_readsector(int drive, int sector, int track, int side, int density) -{ - if (drives[drive].readsector) - drives[drive].readsector(drive, sector, track, side, density); - else - disc_notfound = 10000; -} - -void disc_writesector(int drive, int sector, int track, int side, int density) -{ - if (drives[drive].writesector) - drives[drive].writesector(drive, sector, track, side, density); - else - disc_notfound = 10000; -} - -void disc_readaddress(int drive, int track, int side, int density) -{ - if (drives[drive].readaddress) - drives[drive].readaddress(drive, track, side, density); - else - disc_notfound = 10000; -} - -void disc_format(int drive, int track, int side, int density) -{ - if (drives[drive].format) - drives[drive].format(drive, track, side, density); - else - disc_notfound = 10000; -} - +/*B-em v2.2 by Tom Walker + Disc support*/ + +#include +#include +#include "b-em.h" + +#include "adf.h" +#include "fdi.h" +#include "ssd.h" + +#include "disc.h" + +#include "ddnoise.h" + +DRIVE drives[2]; + +int curdrive = 0; + +char discfns[2][260] = {"", ""}; +int defaultwriteprot = 0; + +int fdc_time; +int disc_time; + +int motorspin; +int motoron; + +void (*fdc_callback)(); +void (*fdc_data)(uint8_t dat); +void (*fdc_spindown)(); +void (*fdc_finishread)(); +void (*fdc_notfound)(); +void (*fdc_datacrcerror)(); +void (*fdc_headercrcerror)(); +void (*fdc_writeprotect)(); +int (*fdc_getdata)(int last); + +static struct +{ + char *ext; + void (*load)(int drive, char *fn); + void (*close)(int drive); + int size; +} +loaders[]= +{ + {"SSD", ssd_load, ssd_close, 80*10*256}, + {"DSD", dsd_load, ssd_close, 2*80*10*256}, + {"ADF", adf_load, adf_close, 80*16*256}, + {"ADL", adl_load, adf_close, 2*80*16*256}, + {"FDI", fdi_load, fdi_close, -1}, + {0,0,0} +}; + +static int driveloaders[2]; + +void disc_load(int drive, char *fn) +{ + int c = 0; + char *p; + FILE *f; + setejecttext(drive, ""); + if (!fn) return; + p = get_extension(fn); + if (!p) return; + setejecttext(drive, fn); + rpclog("Loading :%i %s %s\n", drive, fn,p); + while (loaders[c].ext) + { + if (!strcasecmp(p, loaders[c].ext)) + { + driveloaders[drive] = c; + loaders[c].load(drive, fn); + return; + } + c++; + } +// printf("Couldn't load %s %s\n",fn,p); + /*No extension match, so guess based on image size*/ + f=fopen(fn, "rb"); + if (!f) return; + fseek(f, -1, SEEK_END); + c = ftell(f)+1; + fclose(f); + rpclog("Size %i\n",c); + if (c == (800*1024)) /*800k ADFS/DOS - 80*2*5*1024*/ + { + driveloaders[drive] = 2; + loaders[2].load(drive, fn); + return; + } + if (c == (640*1024)) /*640k ADFS/DOS - 80*2*16*256*/ + { + driveloaders[drive] = 3; + loaders[3].load(drive, fn); + return; + } + if (c == (720*1024)) /*720k DOS - 80*2*9*512*/ + { + driveloaders[drive] = 3; + adl_loadex(drive, fn, 9, 512, 0); + return; + } + if (c == (360*1024)) /*360k DOS - 40*2*9*512*/ + { + driveloaders[drive] = 3; + adl_loadex(drive, fn, 9, 512, 1); + return; + } + if (c <= (200 * 1024)) /*200k DFS - 80*1*10*256*/ + { + driveloaders[drive] = 0; + loaders[0].load(drive, fn); + return; + } + if (c <= (400 * 1024)) /*400k DFS - 80*2*10*256*/ + { + driveloaders[drive] = 1; + loaders[1].load(drive, fn); + return; + } +} + +void disc_new(int drive, char *fn) +{ + int c = 0, d; + FILE *f; + char *p = get_extension(fn); + while (loaders[c].ext) + { + if (!strcasecmp(p, loaders[c].ext) && loaders[c].size != -1) + { + f=fopen(fn, "wb"); + for (d = 0; d < loaders[c].size; d++) putc(0, f); + if (!strcasecmp(p, "ADF")) + { + fseek(f, 0, SEEK_SET); + putc(7, f); + fseek(f, 0xFD, SEEK_SET); + putc(5, f); putc(0, f); putc(0xC, f); putc(0xF9, f); putc(0x04, f); + fseek(f, 0x1FB, SEEK_SET); + putc(0x88,f); putc(0x39,f); putc(0,f); putc(3,f); putc(0xC1,f); + putc(0, f); putc('H', f); putc('u', f); putc('g', f); putc('o', f); + fseek(f, 0x6CC, SEEK_SET); + putc(0x24, f); + fseek(f, 0x6D6, SEEK_SET); + putc(2, f); putc(0, f); putc(0, f); putc(0x24, f); + fseek(f, 0x6FB, SEEK_SET); + putc('H', f); putc('u', f); putc('g', f); putc('o', f); + } + if (!strcasecmp(p, "ADL")) + { + fseek(f, 0, SEEK_SET); + putc(7, f); + fseek(f, 0xFD, SEEK_SET); + putc(0xA, f); putc(0, f); putc(0x11, f); putc(0xF9, f); putc(0x09, f); + fseek(f, 0x1FB, SEEK_SET); + putc(0x01, f); putc(0x84, f); putc(0, f); putc(3, f); putc(0x8A, f); + putc(0, f); putc('H', f); putc('u', f); putc('g', f); putc('o', f); + fseek(f, 0x6CC, SEEK_SET); + putc(0x24, f); + fseek(f, 0x6D6, SEEK_SET); + putc(2, f); putc(0, f); putc(0, f); putc(0x24, f); + fseek(f, 0x6FB, SEEK_SET); + putc('H', f); putc('u', f); putc('g', f); putc('o', f); + } + fclose(f); + disc_load(drive, fn); + return; + } + c++; + } +} + +void disc_close(int drive) +{ + if (loaders[driveloaders[drive]].close) loaders[driveloaders[drive]].close(drive); +} + +int disc_notfound=0; + +void disc_init() +{ + drives[0].poll = drives[1].poll = 0; + drives[0].seek = drives[1].seek = 0; + drives[0].readsector = drives[1].readsector = 0; + curdrive = 0; +} + +void disc_poll() +{ + if (drives[curdrive].poll) drives[curdrive].poll(); + if (disc_notfound) + { + disc_notfound--; + if (!disc_notfound) + fdc_notfound(); + } +} + +int oldtrack[2] = {0, 0}; +void disc_seek(int drive, int track) +{ + if (drives[drive].seek) + drives[drive].seek(drive, track); + ddnoise_seek(track - oldtrack[drive]); + oldtrack[drive] = track; +} + +void disc_readsector(int drive, int sector, int track, int side, int density) +{ + if (drives[drive].readsector) + drives[drive].readsector(drive, sector, track, side, density); + else + disc_notfound = 10000; +} + +void disc_writesector(int drive, int sector, int track, int side, int density) +{ + if (drives[drive].writesector) + drives[drive].writesector(drive, sector, track, side, density); + else + disc_notfound = 10000; +} + +void disc_readaddress(int drive, int track, int side, int density) +{ + if (drives[drive].readaddress) + drives[drive].readaddress(drive, track, side, density); + else + disc_notfound = 10000; +} + +void disc_format(int drive, int track, int side, int density) +{ + if (drives[drive].format) + drives[drive].format(drive, track, side, density); + else + disc_notfound = 10000; +} + diff --git a/src/disc.h b/src/disc.h index 4283bca6..86a33643 100644 --- a/src/disc.h +++ b/src/disc.h @@ -1,44 +1,44 @@ -typedef struct -{ - void (*seek)(int drive, int track); - void (*readsector)(int drive, int sector, int track, int side, int density); - void (*writesector)(int drive, int sector, int track, int side, int density); - void (*readaddress)(int drive, int track, int side, int density); - void (*format)(int drive, int track, int side, int density); - void (*poll)(); -} DRIVE; - -extern DRIVE drives[2]; - -extern int curdrive; - -void disc_load(int drive, char *fn); -void disc_new(int drive, char *fn); -void disc_close(int drive); -void disc_init(); -void disc_poll(); -void disc_seek(int drive, int track); -void disc_readsector(int drive, int sector, int track, int side, int density); -void disc_writesector(int drive, int sector, int track, int side, int density); -void disc_readaddress(int drive, int track, int side, int density); -void disc_format(int drive, int track, int side, int density); -extern int disc_time; - -extern void (*fdc_callback)(); -extern void (*fdc_data)(uint8_t dat); -extern void (*fdc_spindown)(); -extern void (*fdc_finishread)(); -extern void (*fdc_notfound)(); -extern void (*fdc_datacrcerror)(); -extern void (*fdc_headercrcerror)(); -extern void (*fdc_writeprotect)(); -extern int (*fdc_getdata)(int last); -extern int fdc_time; - -extern int motorspin; -extern int motoron; - -extern int defaultwriteprot; -extern char discfns[2][260]; - -extern int writeprot[2], fwriteprot[2]; +typedef struct +{ + void (*seek)(int drive, int track); + void (*readsector)(int drive, int sector, int track, int side, int density); + void (*writesector)(int drive, int sector, int track, int side, int density); + void (*readaddress)(int drive, int track, int side, int density); + void (*format)(int drive, int track, int side, int density); + void (*poll)(); +} DRIVE; + +extern DRIVE drives[2]; + +extern int curdrive; + +void disc_load(int drive, char *fn); +void disc_new(int drive, char *fn); +void disc_close(int drive); +void disc_init(); +void disc_poll(); +void disc_seek(int drive, int track); +void disc_readsector(int drive, int sector, int track, int side, int density); +void disc_writesector(int drive, int sector, int track, int side, int density); +void disc_readaddress(int drive, int track, int side, int density); +void disc_format(int drive, int track, int side, int density); +extern int disc_time; + +extern void (*fdc_callback)(); +extern void (*fdc_data)(uint8_t dat); +extern void (*fdc_spindown)(); +extern void (*fdc_finishread)(); +extern void (*fdc_notfound)(); +extern void (*fdc_datacrcerror)(); +extern void (*fdc_headercrcerror)(); +extern void (*fdc_writeprotect)(); +extern int (*fdc_getdata)(int last); +extern int fdc_time; + +extern int motorspin; +extern int motoron; + +extern int defaultwriteprot; +extern char discfns[2][260]; + +extern int writeprot[2], fwriteprot[2]; diff --git a/src/fdi.c b/src/fdi.c index ca0fbb4b..83c85c9e 100644 --- a/src/fdi.c +++ b/src/fdi.c @@ -1,379 +1,379 @@ -/*B-em v2.2 by Tom Walker - FDI disc support - Interfaces with fdi2raw.c*/ - -#include -#include -#include "b-em.h" -#include "fdi.h" -#include "fdi2raw.h" -#include "disc.h" - -static FILE *fdi_f[2]; -static FDI *fdi_h[2]; -static uint8_t fdi_trackinfo[2][2][2][65536]; -static uint8_t fdi_timing[65536]; -static int fdi_sides[2]; -static int fdi_tracklen[2][2][2]; -static int fdi_trackindex[2][2][2]; -static int fdi_lasttrack[2]; -static int fdi_ds[2]; -static int fdi_pos; -static int fdi_revs; - -static int fdi_sector, fdi_track, fdi_side, fdi_drive, fdi_density; -static int fdi_inread, fdi_inwrite, fdi_readpos, fdi_inreadaddr; -static int fdi_notfound; - -static uint16_t CRCTable[256]; - -static void fdi_setupcrc(uint16_t poly, uint16_t rvalue) -{ - int c = 256, bc; - uint16_t crctemp; - - while(c--) - { - crctemp = c << 8; - bc = 8; - - while(bc--) - { - if(crctemp & 0x8000) - { - crctemp = (crctemp << 1) ^ poly; - } - else - { - crctemp <<= 1; - } - } - - CRCTable[c] = crctemp; - } -} - -void fdi_init() -{ -// printf("FDI reset\n"); - fdi_f[0] = fdi_f[1] = 0; - fdi_ds[0] = fdi_ds[1] = 0; - fdi_notfound = 0; - fdi_setupcrc(0x1021, 0xcdb4); -} - -void fdi_load(int drive, char *fn) -{ - writeprot[drive] = fwriteprot[drive] = 1; - fdi_f[drive] = fopen(fn, "rb"); - if (!fdi_f[drive]) return; - fdi_h[drive] = fdi2raw_header(fdi_f[drive]); -// if (!fdih[drive]) printf("Failed to load!\n"); - fdi_lasttrack[drive] = fdi2raw_get_last_track(fdi_h[drive]); - fdi_sides[drive] = (fdi_lasttrack[drive]>83) ? 1 : 0; -// printf("Last track %i\n",fdilasttrack[drive]); - drives[drive].seek = fdi_seek; - drives[drive].readsector = fdi_readsector; - drives[drive].writesector = fdi_writesector; - drives[drive].readaddress = fdi_readaddress; - drives[drive].poll = fdi_poll; - drives[drive].format = fdi_format; -} - -void fdi_close(int drive) -{ - if (fdi_h[drive]) fdi2raw_header_free(fdi_h[drive]); - if (fdi_f[drive]) fclose(fdi_f[drive]); - fdi_f[drive] = NULL; -} - -void fdi_seek(int drive, int track) -{ - int c; - if (!fdi_f[drive]) return; -// printf("Track start %i\n",track); - if (track < 0) track = 0; - if (track > fdi_lasttrack[drive]) track = fdi_lasttrack[drive] - 1; - c = fdi2raw_loadtrack(fdi_h[drive], (uint16_t *)fdi_trackinfo[drive][0][0], (uint16_t *)fdi_timing, track << fdi_sides[drive], &fdi_tracklen[drive][0][0], &fdi_trackindex[drive][0][0], NULL, 0); - if (!c) memset(fdi_trackinfo[drive][0][0], 0, fdi_tracklen[drive][0][0]); - c = fdi2raw_loadtrack(fdi_h[drive], (uint16_t *)fdi_trackinfo[drive][0][1], (uint16_t *)fdi_timing, track << fdi_sides[drive], &fdi_tracklen[drive][0][1], &fdi_trackindex[drive][0][1], NULL, 1); - if (!c) memset(fdi_trackinfo[drive][0][1], 0, fdi_tracklen[drive][0][1]); - if (fdi_sides[drive]) - { - c = fdi2raw_loadtrack(fdi_h[drive], (uint16_t *)fdi_trackinfo[drive][1][0], (uint16_t *)fdi_timing, (track << fdi_sides[drive]) + 1, &fdi_tracklen[drive][1][0], &fdi_trackindex[drive][1][0], NULL, 0); - if (!c) memset(fdi_trackinfo[drive][1][0], 0, fdi_tracklen[drive][1][0]); - c = fdi2raw_loadtrack(fdi_h[drive], (uint16_t *)fdi_trackinfo[drive][1][1], (uint16_t *)fdi_timing, (track << fdi_sides[drive]) + 1, &fdi_tracklen[drive][1][1], &fdi_trackindex[drive][1][1], NULL, 1); - if (!c) memset(fdi_trackinfo[drive][1][1], 0, fdi_tracklen[drive][1][1]); - } - else - { - memset(fdi_trackinfo[drive][1][0], 0, 65536); - memset(fdi_trackinfo[drive][1][1], 0, 65536); - fdi_tracklen[drive][1][0] = fdi_tracklen[drive][1][1] = 10000; - fdi_trackindex[drive][1][0] = fdi_trackindex[drive][1][1] = 100; - } -// printf("SD Track %i Len %i Index %i %i\n",track,ftracklen[drive][0][0],ftrackindex[drive][0][0],c); -// printf("DD Track %i Len %i Index %i %i\n",track,ftracklen[drive][0][1],ftrackindex[drive][0][1],c); -} - -void fdi_writeback(int drive, int track) -{ - return; -} - -void fdi_readsector(int drive, int sector, int track, int side, int density) -{ - fdi_revs = 0; - fdi_sector = sector; - fdi_track = track; - fdi_side = side; - fdi_drive = drive; - fdi_density = density; -// printf("Read sector %i %i %i %i\n",drive,side,track,sector); - - fdi_inread = 1; - fdi_readpos = 0; -} - -void fdi_writesector(int drive, int sector, int track, int side, int density) -{ - fdi_revs = 0; - fdi_sector = sector; - fdi_track = track; - fdi_side = side; - fdi_drive = drive; -// printf("Write sector %i %i %i %i\n",drive,side,track,sector); - - if (!fdi_f[drive] || (side && !fdi_ds[drive]) || density) - { - fdi_notfound = 500; - return; - } - fdi_inwrite = 1; - fdi_readpos = 0; -} - -void fdi_readaddress(int drive, int track, int side, int density) -{ - fdi_revs = 0; - fdi_track = track; - fdi_side = side; - fdi_density = density; - fdi_drive = drive; -// printf("Read address %i %i %i\n",drive,side,track); - - fdi_inreadaddr = 1; - fdi_readpos = 0; -} - -void fdi_format(int drive, int track, int side, int density) -{ - fdi_revs = 0; - fdi_track = track; - fdi_side = side; - fdi_density = density; - fdi_drive = drive; -// printf("Format %i %i %i\n",drive,side,track); - - fdi_inwrite = 1; - fdi_readpos = 0; -} - -static uint16_t fdi_buffer; -static int pollbytesleft=0,pollbitsleft=0; -static int readidpoll=0,readdatapoll=0,fdi_nextsector=0,inreadop=0; -static uint8_t fdi_sectordat[1026]; -static int lastfdidat[2],sectorcrc[2]; -static int sectorsize,fdc_sectorsize; -static int ddidbitsleft=0; - -static uint8_t decodefm(uint16_t dat) -{ - uint8_t temp; - temp = 0; - if (dat & 0x0001) temp |= 1; - if (dat & 0x0004) temp |= 2; - if (dat & 0x0010) temp |= 4; - if (dat & 0x0040) temp |= 8; - if (dat & 0x0100) temp |= 16; - if (dat & 0x0400) temp |= 32; - if (dat & 0x1000) temp |= 64; - if (dat & 0x4000) temp |= 128; - return temp; -} - -static uint16_t crc; - -static void calccrc(uint8_t byte) -{ - crc = (crc << 8) ^ CRCTable[(crc >> 8)^byte]; -} - -void fdi_poll() -{ - int tempi, c; - if (fdi_pos >= fdi_tracklen[fdi_drive][fdi_side][fdi_density]) - { -// printf("Looping! %i\n",fdipos); - fdi_pos = 0; - } - tempi = fdi_trackinfo[fdi_drive][fdi_side][fdi_density][((fdi_pos >> 3) & 0xFFFF) ^ 1] & (1 << (7 - (fdi_pos & 7))); - fdi_pos++; - fdi_buffer<<=1; - fdi_buffer|=(tempi?1:0); - if (fdi_inwrite) - { - fdi_inwrite=0; - fdc_writeprotect(); - return; - } - if (!fdi_inread && !fdi_inreadaddr) return; - if (fdi_pos == fdi_trackindex[fdi_drive][fdi_side][fdi_density]) - { - fdi_revs++; - if (fdi_revs == 3) - { -// printf("Not found!\n"); - fdc_notfound(); - fdi_inread = fdi_inreadaddr = 0; - return; - } - } - if (pollbitsleft) - { - pollbitsleft--; - if (!pollbitsleft) - { - pollbytesleft--; - if (pollbytesleft) pollbitsleft = 16; /*Set up another word if we need it*/ - if (readidpoll) - { - fdi_sectordat[5 - pollbytesleft] = decodefm(fdi_buffer); - if (fdi_inreadaddr && pollbytesleft > 1) fdc_data(fdi_sectordat[5 - pollbytesleft]); - if (!pollbytesleft) - { - if ((fdi_sectordat[0] == fdi_track && fdi_sectordat[2] == fdi_sector) || fdi_inreadaddr) - { - crc = (fdi_density) ? 0xcdb4 : 0xffff; - calccrc(0xFE); - for (c = 0; c < 4; c++) calccrc(fdi_sectordat[c]); - if ((crc >> 8) != fdi_sectordat[4] || (crc & 0xFF) != fdi_sectordat[5]) - { -// printf("Header CRC error : %02X %02X %02X %02X\n",crc>>8,crc&0xFF,fdisectordat[4],fdisectordat[5]); -// dumpregs(); -// exit(-1); - inreadop = 0; - if (fdi_inreadaddr) - { - fdc_data(fdi_sector); - fdc_finishread(); - } - else fdc_headercrcerror(); - return; - } - if (fdi_sectordat[0] == fdi_track && fdi_sectordat[2] == fdi_sector && fdi_inread && !fdi_inreadaddr) - { - fdi_nextsector = 1; - readidpoll = 0; - sectorsize = (1 << (fdi_sectordat[3] + 7)) + 2; - fdc_sectorsize = fdi_sectordat[3]; - } - if (fdi_inreadaddr) - { - fdc_finishread(); - fdi_inreadaddr = 0; - } - } - } - } - if (readdatapoll) - { - if (pollbytesleft > 1) - { - calccrc(decodefm(fdi_buffer)); - } - else - sectorcrc[1 - pollbytesleft] = decodefm(fdi_buffer); - if (!pollbytesleft) - { - fdi_inread = 0; - if ((crc >> 8) != sectorcrc[0] || (crc & 0xFF) != sectorcrc[1])// || (fditrack==79 && fdisect==4 && fdc_side&1)) - { -// printf("Data CRC error : %02X %02X %02X %02X %i %04X %02X%02X %i\n",crc>>8,crc&0xFF,sectorcrc[0],sectorcrc[1],fdipos,crc,sectorcrc[0],sectorcrc[1],ftracklen[0][0][fdidensity]); - inreadop = 0; - fdc_data(decodefm(lastfdidat[1])); - fdc_finishread(); - fdc_datacrcerror(); - readdatapoll = 0; - return; - } -// printf("End of FDI read %02X %02X %02X %02X\n",crc>>8,crc&0xFF,sectorcrc[0],sectorcrc[1]); - fdc_data(decodefm(lastfdidat[1])); - fdc_finishread(); - } - else if (lastfdidat[1] != 0) - fdc_data(decodefm(lastfdidat[1])); - lastfdidat[1] = lastfdidat[0]; - lastfdidat[0] = fdi_buffer; - if (!pollbytesleft) - readdatapoll = 0; - } - } - } - if (fdi_buffer == 0x4489 && fdi_density) - { -// rpclog("Found sync\n"); - ddidbitsleft = 17; - } - - if (fdi_buffer == 0xF57E && !fdi_density) - { - pollbytesleft = 6; - pollbitsleft = 16; - readidpoll = 1; - } - if ((fdi_buffer == 0xF56F || fdi_buffer == 0xF56A) && !fdi_density) - { - if (fdi_nextsector) - { - pollbytesleft = sectorsize; - pollbitsleft = 16; - readdatapoll = 1; - fdi_nextsector = 0; - crc = 0xffff; - if (fdi_buffer == 0xF56A) calccrc(0xF8); - else calccrc(0xFB); - lastfdidat[0] = lastfdidat[1] = 0; - } - } - if (ddidbitsleft) - { - ddidbitsleft--; - if (!ddidbitsleft) - { -// printf("ID bits over %04X %02X %i\n",fdibuffer,decodefm(fdibuffer),fdipos); - if (decodefm(fdi_buffer) == 0xFE) - { -// printf("Sector header\n"); - pollbytesleft = 6; - pollbitsleft = 16; - readidpoll = 1; - } - else if (decodefm(fdi_buffer) == 0xFB) - { -// printf("Data header\n"); - if (fdi_nextsector) - { - pollbytesleft = sectorsize; - pollbitsleft = 16; - readdatapoll = 1; - fdi_nextsector = 0; - crc = 0xcdb4; - if (fdi_buffer == 0xF56A) calccrc(0xF8); - else calccrc(0xFB); - lastfdidat[0] = lastfdidat[1] = 0; - } - } - } - } -} +/*B-em v2.2 by Tom Walker + FDI disc support + Interfaces with fdi2raw.c*/ + +#include +#include +#include "b-em.h" +#include "fdi.h" +#include "fdi2raw.h" +#include "disc.h" + +static FILE *fdi_f[2]; +static FDI *fdi_h[2]; +static uint8_t fdi_trackinfo[2][2][2][65536]; +static uint8_t fdi_timing[65536]; +static int fdi_sides[2]; +static int fdi_tracklen[2][2][2]; +static int fdi_trackindex[2][2][2]; +static int fdi_lasttrack[2]; +static int fdi_ds[2]; +static int fdi_pos; +static int fdi_revs; + +static int fdi_sector, fdi_track, fdi_side, fdi_drive, fdi_density; +static int fdi_inread, fdi_inwrite, fdi_readpos, fdi_inreadaddr; +static int fdi_notfound; + +static uint16_t CRCTable[256]; + +static void fdi_setupcrc(uint16_t poly, uint16_t rvalue) +{ + int c = 256, bc; + uint16_t crctemp; + + while(c--) + { + crctemp = c << 8; + bc = 8; + + while(bc--) + { + if(crctemp & 0x8000) + { + crctemp = (crctemp << 1) ^ poly; + } + else + { + crctemp <<= 1; + } + } + + CRCTable[c] = crctemp; + } +} + +void fdi_init() +{ +// printf("FDI reset\n"); + fdi_f[0] = fdi_f[1] = 0; + fdi_ds[0] = fdi_ds[1] = 0; + fdi_notfound = 0; + fdi_setupcrc(0x1021, 0xcdb4); +} + +void fdi_load(int drive, char *fn) +{ + writeprot[drive] = fwriteprot[drive] = 1; + fdi_f[drive] = fopen(fn, "rb"); + if (!fdi_f[drive]) return; + fdi_h[drive] = fdi2raw_header(fdi_f[drive]); +// if (!fdih[drive]) printf("Failed to load!\n"); + fdi_lasttrack[drive] = fdi2raw_get_last_track(fdi_h[drive]); + fdi_sides[drive] = (fdi_lasttrack[drive]>83) ? 1 : 0; +// printf("Last track %i\n",fdilasttrack[drive]); + drives[drive].seek = fdi_seek; + drives[drive].readsector = fdi_readsector; + drives[drive].writesector = fdi_writesector; + drives[drive].readaddress = fdi_readaddress; + drives[drive].poll = fdi_poll; + drives[drive].format = fdi_format; +} + +void fdi_close(int drive) +{ + if (fdi_h[drive]) fdi2raw_header_free(fdi_h[drive]); + if (fdi_f[drive]) fclose(fdi_f[drive]); + fdi_f[drive] = NULL; +} + +void fdi_seek(int drive, int track) +{ + int c; + if (!fdi_f[drive]) return; +// printf("Track start %i\n",track); + if (track < 0) track = 0; + if (track > fdi_lasttrack[drive]) track = fdi_lasttrack[drive] - 1; + c = fdi2raw_loadtrack(fdi_h[drive], (uint16_t *)fdi_trackinfo[drive][0][0], (uint16_t *)fdi_timing, track << fdi_sides[drive], &fdi_tracklen[drive][0][0], &fdi_trackindex[drive][0][0], NULL, 0); + if (!c) memset(fdi_trackinfo[drive][0][0], 0, fdi_tracklen[drive][0][0]); + c = fdi2raw_loadtrack(fdi_h[drive], (uint16_t *)fdi_trackinfo[drive][0][1], (uint16_t *)fdi_timing, track << fdi_sides[drive], &fdi_tracklen[drive][0][1], &fdi_trackindex[drive][0][1], NULL, 1); + if (!c) memset(fdi_trackinfo[drive][0][1], 0, fdi_tracklen[drive][0][1]); + if (fdi_sides[drive]) + { + c = fdi2raw_loadtrack(fdi_h[drive], (uint16_t *)fdi_trackinfo[drive][1][0], (uint16_t *)fdi_timing, (track << fdi_sides[drive]) + 1, &fdi_tracklen[drive][1][0], &fdi_trackindex[drive][1][0], NULL, 0); + if (!c) memset(fdi_trackinfo[drive][1][0], 0, fdi_tracklen[drive][1][0]); + c = fdi2raw_loadtrack(fdi_h[drive], (uint16_t *)fdi_trackinfo[drive][1][1], (uint16_t *)fdi_timing, (track << fdi_sides[drive]) + 1, &fdi_tracklen[drive][1][1], &fdi_trackindex[drive][1][1], NULL, 1); + if (!c) memset(fdi_trackinfo[drive][1][1], 0, fdi_tracklen[drive][1][1]); + } + else + { + memset(fdi_trackinfo[drive][1][0], 0, 65536); + memset(fdi_trackinfo[drive][1][1], 0, 65536); + fdi_tracklen[drive][1][0] = fdi_tracklen[drive][1][1] = 10000; + fdi_trackindex[drive][1][0] = fdi_trackindex[drive][1][1] = 100; + } +// printf("SD Track %i Len %i Index %i %i\n",track,ftracklen[drive][0][0],ftrackindex[drive][0][0],c); +// printf("DD Track %i Len %i Index %i %i\n",track,ftracklen[drive][0][1],ftrackindex[drive][0][1],c); +} + +void fdi_writeback(int drive, int track) +{ + return; +} + +void fdi_readsector(int drive, int sector, int track, int side, int density) +{ + fdi_revs = 0; + fdi_sector = sector; + fdi_track = track; + fdi_side = side; + fdi_drive = drive; + fdi_density = density; +// printf("Read sector %i %i %i %i\n",drive,side,track,sector); + + fdi_inread = 1; + fdi_readpos = 0; +} + +void fdi_writesector(int drive, int sector, int track, int side, int density) +{ + fdi_revs = 0; + fdi_sector = sector; + fdi_track = track; + fdi_side = side; + fdi_drive = drive; +// printf("Write sector %i %i %i %i\n",drive,side,track,sector); + + if (!fdi_f[drive] || (side && !fdi_ds[drive]) || density) + { + fdi_notfound = 500; + return; + } + fdi_inwrite = 1; + fdi_readpos = 0; +} + +void fdi_readaddress(int drive, int track, int side, int density) +{ + fdi_revs = 0; + fdi_track = track; + fdi_side = side; + fdi_density = density; + fdi_drive = drive; +// printf("Read address %i %i %i\n",drive,side,track); + + fdi_inreadaddr = 1; + fdi_readpos = 0; +} + +void fdi_format(int drive, int track, int side, int density) +{ + fdi_revs = 0; + fdi_track = track; + fdi_side = side; + fdi_density = density; + fdi_drive = drive; +// printf("Format %i %i %i\n",drive,side,track); + + fdi_inwrite = 1; + fdi_readpos = 0; +} + +static uint16_t fdi_buffer; +static int pollbytesleft=0,pollbitsleft=0; +static int readidpoll=0,readdatapoll=0,fdi_nextsector=0,inreadop=0; +static uint8_t fdi_sectordat[1026]; +static int lastfdidat[2],sectorcrc[2]; +static int sectorsize,fdc_sectorsize; +static int ddidbitsleft=0; + +static uint8_t decodefm(uint16_t dat) +{ + uint8_t temp; + temp = 0; + if (dat & 0x0001) temp |= 1; + if (dat & 0x0004) temp |= 2; + if (dat & 0x0010) temp |= 4; + if (dat & 0x0040) temp |= 8; + if (dat & 0x0100) temp |= 16; + if (dat & 0x0400) temp |= 32; + if (dat & 0x1000) temp |= 64; + if (dat & 0x4000) temp |= 128; + return temp; +} + +static uint16_t crc; + +static void calccrc(uint8_t byte) +{ + crc = (crc << 8) ^ CRCTable[(crc >> 8)^byte]; +} + +void fdi_poll() +{ + int tempi, c; + if (fdi_pos >= fdi_tracklen[fdi_drive][fdi_side][fdi_density]) + { +// printf("Looping! %i\n",fdipos); + fdi_pos = 0; + } + tempi = fdi_trackinfo[fdi_drive][fdi_side][fdi_density][((fdi_pos >> 3) & 0xFFFF) ^ 1] & (1 << (7 - (fdi_pos & 7))); + fdi_pos++; + fdi_buffer<<=1; + fdi_buffer|=(tempi?1:0); + if (fdi_inwrite) + { + fdi_inwrite=0; + fdc_writeprotect(); + return; + } + if (!fdi_inread && !fdi_inreadaddr) return; + if (fdi_pos == fdi_trackindex[fdi_drive][fdi_side][fdi_density]) + { + fdi_revs++; + if (fdi_revs == 3) + { +// printf("Not found!\n"); + fdc_notfound(); + fdi_inread = fdi_inreadaddr = 0; + return; + } + } + if (pollbitsleft) + { + pollbitsleft--; + if (!pollbitsleft) + { + pollbytesleft--; + if (pollbytesleft) pollbitsleft = 16; /*Set up another word if we need it*/ + if (readidpoll) + { + fdi_sectordat[5 - pollbytesleft] = decodefm(fdi_buffer); + if (fdi_inreadaddr && pollbytesleft > 1) fdc_data(fdi_sectordat[5 - pollbytesleft]); + if (!pollbytesleft) + { + if ((fdi_sectordat[0] == fdi_track && fdi_sectordat[2] == fdi_sector) || fdi_inreadaddr) + { + crc = (fdi_density) ? 0xcdb4 : 0xffff; + calccrc(0xFE); + for (c = 0; c < 4; c++) calccrc(fdi_sectordat[c]); + if ((crc >> 8) != fdi_sectordat[4] || (crc & 0xFF) != fdi_sectordat[5]) + { +// printf("Header CRC error : %02X %02X %02X %02X\n",crc>>8,crc&0xFF,fdisectordat[4],fdisectordat[5]); +// dumpregs(); +// exit(-1); + inreadop = 0; + if (fdi_inreadaddr) + { + fdc_data(fdi_sector); + fdc_finishread(); + } + else fdc_headercrcerror(); + return; + } + if (fdi_sectordat[0] == fdi_track && fdi_sectordat[2] == fdi_sector && fdi_inread && !fdi_inreadaddr) + { + fdi_nextsector = 1; + readidpoll = 0; + sectorsize = (1 << (fdi_sectordat[3] + 7)) + 2; + fdc_sectorsize = fdi_sectordat[3]; + } + if (fdi_inreadaddr) + { + fdc_finishread(); + fdi_inreadaddr = 0; + } + } + } + } + if (readdatapoll) + { + if (pollbytesleft > 1) + { + calccrc(decodefm(fdi_buffer)); + } + else + sectorcrc[1 - pollbytesleft] = decodefm(fdi_buffer); + if (!pollbytesleft) + { + fdi_inread = 0; + if ((crc >> 8) != sectorcrc[0] || (crc & 0xFF) != sectorcrc[1])// || (fditrack==79 && fdisect==4 && fdc_side&1)) + { +// printf("Data CRC error : %02X %02X %02X %02X %i %04X %02X%02X %i\n",crc>>8,crc&0xFF,sectorcrc[0],sectorcrc[1],fdipos,crc,sectorcrc[0],sectorcrc[1],ftracklen[0][0][fdidensity]); + inreadop = 0; + fdc_data(decodefm(lastfdidat[1])); + fdc_finishread(); + fdc_datacrcerror(); + readdatapoll = 0; + return; + } +// printf("End of FDI read %02X %02X %02X %02X\n",crc>>8,crc&0xFF,sectorcrc[0],sectorcrc[1]); + fdc_data(decodefm(lastfdidat[1])); + fdc_finishread(); + } + else if (lastfdidat[1] != 0) + fdc_data(decodefm(lastfdidat[1])); + lastfdidat[1] = lastfdidat[0]; + lastfdidat[0] = fdi_buffer; + if (!pollbytesleft) + readdatapoll = 0; + } + } + } + if (fdi_buffer == 0x4489 && fdi_density) + { +// rpclog("Found sync\n"); + ddidbitsleft = 17; + } + + if (fdi_buffer == 0xF57E && !fdi_density) + { + pollbytesleft = 6; + pollbitsleft = 16; + readidpoll = 1; + } + if ((fdi_buffer == 0xF56F || fdi_buffer == 0xF56A) && !fdi_density) + { + if (fdi_nextsector) + { + pollbytesleft = sectorsize; + pollbitsleft = 16; + readdatapoll = 1; + fdi_nextsector = 0; + crc = 0xffff; + if (fdi_buffer == 0xF56A) calccrc(0xF8); + else calccrc(0xFB); + lastfdidat[0] = lastfdidat[1] = 0; + } + } + if (ddidbitsleft) + { + ddidbitsleft--; + if (!ddidbitsleft) + { +// printf("ID bits over %04X %02X %i\n",fdibuffer,decodefm(fdibuffer),fdipos); + if (decodefm(fdi_buffer) == 0xFE) + { +// printf("Sector header\n"); + pollbytesleft = 6; + pollbitsleft = 16; + readidpoll = 1; + } + else if (decodefm(fdi_buffer) == 0xFB) + { +// printf("Data header\n"); + if (fdi_nextsector) + { + pollbytesleft = sectorsize; + pollbitsleft = 16; + readdatapoll = 1; + fdi_nextsector = 0; + crc = 0xcdb4; + if (fdi_buffer == 0xF56A) calccrc(0xF8); + else calccrc(0xFB); + lastfdidat[0] = lastfdidat[1] = 0; + } + } + } + } +} diff --git a/src/fdi.h b/src/fdi.h index e6cb7cb0..e25efa17 100644 --- a/src/fdi.h +++ b/src/fdi.h @@ -1,9 +1,9 @@ -void fdi_init(); -void fdi_load(int drive, char *fn); -void fdi_close(int drive); -void fdi_seek(int drive, int track); -void fdi_readsector(int drive, int sector, int track, int side, int density); -void fdi_writesector(int drive, int sector, int track, int side, int density); -void fdi_readaddress(int drive, int sector, int side, int density); -void fdi_format(int drive, int sector, int side, int density); -void fdi_poll(); +void fdi_init(); +void fdi_load(int drive, char *fn); +void fdi_close(int drive); +void fdi_seek(int drive, int track); +void fdi_readsector(int drive, int sector, int track, int side, int density); +void fdi_writesector(int drive, int sector, int track, int side, int density); +void fdi_readaddress(int drive, int sector, int side, int density); +void fdi_format(int drive, int sector, int side, int density); +void fdi_poll(); diff --git a/src/fdi2raw.c b/src/fdi2raw.c index c8ad9527..c2a91282 100644 --- a/src/fdi2raw.c +++ b/src/fdi2raw.c @@ -1,2190 +1,2190 @@ -/* - - FDI to raw bit stream converter - Copyright (c) 2001 by Toni Wilen - FDI 2.0 support - Copyright (c) 2003-2004 by Toni Wilen - and Vincent Joguin - - FDI format created by Vincent "ApH" Joguin - - Tiny changes - function type fixes, multiple drives, addition of - get_last_head and C++ callability - by Thomas Harte, 2001, - T.Harte@excite.co.uk - - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public 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 STATIC_INLINE -#include -#include -#include -#include - -/* IF UAE */ -/*#include "sysconfig.h" -#include "sysdeps.h" -#include "zfile.h"*/ -/* ELSE */ -//#include "types.h" -#define xmalloc malloc -#include "fdi2raw.h" - -#include "b-em.h" - -#undef DEBUG -#define VERBOSE -#undef VERBOSE - -#include - -#ifdef DEBUG -static char *datalog(uae_u8 *src, int len) -{ - static char buf[1000]; - static int offset; - int i = 0, offset2; - - offset2 = offset; - buf[offset++]='\''; - while(len--) { - sprintf (buf + offset, "%02.2X", src[i]); - offset += 2; - i++; - if (i > 10) break; - } - buf[offset++]='\''; - buf[offset++] = 0; - if (offset >= 900) offset = 0; - return buf + offset2; -} -#else -static char *datalog(uae_u8 *src, int len) { return ""; } -#endif - -#define outlog rpclog -#define debuglog rpclog - -static int fdi_allocated; -#ifdef DEBUG -static void fdi_free (void *p) -{ - int size; - if (!p) - return; - size = ((int*)p)[-1]; - fdi_allocated -= size; - write_log ("%d freed (%d)\n", size, fdi_allocated); - free ((int*)p - 1); -} -static void *fdi_malloc (int size) -{ - void *p = xmalloc (size + sizeof (int)); - ((int*)p)[0] = size; - fdi_allocated += size; - write_log ("%d allocated (%d)\n", size, fdi_allocated); - return (int*)p + 1; -} -#else -#define fdi_free free -#define fdi_malloc xmalloc -#endif - -#define MAX_SRC_BUFFER 4194304 -#define MAX_DST_BUFFER 40000 -#define MAX_MFM_SYNC_BUFFER 60000 -#define MAX_TIMING_BUFFER 400000 -#define MAX_TRACKS 166 - -struct fdi_cache { - uae_u32 *avgp, *minp, *maxp; - uae_u8 *idxp; - int avg_free, idx_free, min_free, max_free; - uae_u32 totalavg, pulses, maxidx, indexoffset; - int weakbits; - int lowlevel; -}; - -struct fdi { - uae_u8 *track_src_buffer; - uae_u8 *track_src; - int track_src_len; - uae_u8 *track_dst_buffer; - uae_u8 *track_dst; - uae_u16 *track_dst_buffer_timing; - uae_u8 track_len; - uae_u8 track_type; - int current_track; - int last_track; - int last_head; - int rotation_speed; - int bit_rate; - int disk_type; - int write_protect; - int err; - uae_u8 header[2048]; - int track_offsets[MAX_TRACKS]; - FILE *file; - int out; - int mfmsync_offset; - int *mfmsync_buffer; - /* sector described only */ - int index_offset; - int encoding_type; - /* bit handling */ - int nextdrop; - struct fdi_cache cache[MAX_TRACKS]; -}; - -#define get_u32(x) ((((x)[0])<<24)|(((x)[1])<<16)|(((x)[2])<<8)|((x)[3])) -#define get_u24(x) ((((x)[0])<<16)|(((x)[1])<<8)|((x)[2])) -STATIC_INLINE void put_u32 (uae_u8 *d, uae_u32 v) -{ - d[0] = v >> 24; - d[1] = v >> 16; - d[2] = v >> 8; - d[3] = v; -} - -struct node { - uae_u16 v; - struct node *left; - struct node *right; -}; -typedef struct node NODE; - -static uae_u8 temp, temp2; - -static uae_u8 *expand_tree (uae_u8 *stream, NODE *node) -{ - if (temp & temp2) { - fdi_free (node->left); - node->left = 0; - fdi_free (node->right); - node->right = 0; - temp2 >>= 1; - if (!temp2) { - temp = *stream++; - temp2 = 0x80; - } - return stream; - } else { - uae_u8 *stream_temp; - temp2 >>= 1; - if (!temp2) { - temp = *stream++; - temp2 = 0x80; - } - node->left = fdi_malloc (sizeof (NODE)); - memset (node->left, 0, sizeof (NODE)); - stream_temp = expand_tree (stream, node->left); - node->right = fdi_malloc (sizeof (NODE)); - memset (node->right, 0, sizeof (NODE)); - return expand_tree (stream_temp, node->right); - } -} - -static uae_u8 *values_tree8 (uae_u8 *stream, NODE *node) -{ - if (node->left == 0) { - node->v = *stream++; - return stream; - } else { - uae_u8 *stream_temp = values_tree8 (stream, node->left); - return values_tree8 (stream_temp, node->right); - } -} - -static uae_u8 *values_tree16 (uae_u8 *stream, NODE *node) -{ - if (node->left == 0) { - uae_u16 high_8_bits = (*stream++) << 8; - node->v = high_8_bits | (*stream++); - return stream; - } else { - uae_u8 *stream_temp = values_tree16 (stream, node->left); - return values_tree16 (stream_temp, node->right); - } -} - -static void free_nodes (NODE *node) -{ - if (node) { - free_nodes (node->left); - free_nodes (node->right); - fdi_free (node); - } -} - -static uae_u32 sign_extend16 (uae_u32 v) -{ - if (v & 0x8000) - v |= 0xffff0000; - return v; -} - -static uae_u32 sign_extend8 (uae_u32 v) -{ - if (v & 0x80) - v |= 0xffffff00; - return v; -} - -static void fdi_decode (uae_u8 *stream, int size, uae_u8 *out) -{ - int i; - uae_u8 sign_extend, sixteen_bit, sub_stream_shift; - NODE root; - NODE *current_node; - - memset (out, 0, size * 4); - sub_stream_shift = 1; - while (sub_stream_shift) { - - //sub-stream header decode - sign_extend = *stream++; - sub_stream_shift = sign_extend & 0x7f; - sign_extend &= 0x80; - sixteen_bit = (*stream++) & 0x80; - - //huffman tree architecture decode - temp = *stream++; - temp2 = 0x80; - stream = expand_tree (stream, &root); - if (temp2 == 0x80) - stream--; - - //huffman output values decode - if (sixteen_bit) - stream = values_tree16 (stream, &root); - else - stream = values_tree8 (stream, &root); - - //sub-stream data decode - temp2 = 0; - for (i = 0; i < size; i++) { - uae_u32 v; - uae_u8 decode = 1; - current_node = &root; - while (decode) { - if (current_node->left == 0) { - decode = 0; - } else { - temp2 >>= 1; - if (!temp2) { - temp2 = 0x80; - temp = *stream++; - } - if (temp & temp2) - current_node = current_node->right; - else - current_node = current_node->left; - } - } - v = ((uae_u32*)out)[i]; - if (sign_extend) { - if (sixteen_bit) - v |= sign_extend16 (current_node->v) << sub_stream_shift; - else - v |= sign_extend8 (current_node->v) << sub_stream_shift; - } else { - v |= current_node->v << sub_stream_shift; - } - ((uae_u32*)out)[i] = v; - } - free_nodes (root.left); - free_nodes (root.right); - } -} - - -static int decode_raw_track (FDI *fdi) -{ - int size = get_u32(fdi->track_src); - memcpy (fdi->track_dst, fdi->track_src, (size + 7) >> 3); - fdi->track_src += (size + 7) >> 3; - return size; -} - -/* unknown track */ -static void zxx (FDI *fdi) -{ - outlog ("track %d: unknown track type 0x%02.2X\n", fdi->current_track, fdi->track_type); -// return -1; -} -/* unsupported track */ -#if 0 -static void zyy (FDI *fdi) -{ - outlog ("track %d: unsupported track type 0x%02.2X\n", fdi->current_track, fdi->track_type); -// return -1; -} -#endif -/* empty track */ -static void track_empty (FDI *fdi) -{ -// return 0; -} - -/* unknown sector described type */ -static void dxx (FDI *fdi) -{ - outlog ("\ntrack %d: unknown sector described type 0x%02.2X\n", fdi->current_track, fdi->track_type); - fdi->err = 1; -} -/* unsupported sector described type */ -#if 0 -static void dyy (FDI *fdi) -{ - outlog ("\ntrack %d: unsupported sector described 0x%02.2X\n", fdi->current_track, fdi->track_type); - fdi->err = 1; -} -#endif -/* add position of mfm sync bit */ -static void add_mfm_sync_bit (FDI *fdi) -{ - if (fdi->nextdrop) { - fdi->nextdrop = 0; - return; - } - fdi->mfmsync_buffer[fdi->mfmsync_offset++] = fdi->out; - if (fdi->out == 0) { - outlog ("illegal position for mfm sync bit, offset=%d\n",fdi->out); - fdi->err = 1; - } - if (fdi->mfmsync_offset >= MAX_MFM_SYNC_BUFFER) { - fdi->mfmsync_offset = 0; - outlog ("mfmsync buffer overflow\n"); - fdi->err = 1; - } - fdi->out++; -} - -#define BIT_BYTEOFFSET ((fdi->out) >> 3) -#define BIT_BITOFFSET (7-((fdi->out)&7)) - -/* add one bit */ -static void bit_add (FDI *fdi, int bit) -{ - if (fdi->nextdrop) { - fdi->nextdrop = 0; - return; - } - fdi->track_dst[BIT_BYTEOFFSET] &= ~(1 << BIT_BITOFFSET); - if (bit) - fdi->track_dst[BIT_BYTEOFFSET] |= (1 << BIT_BITOFFSET); - fdi->out++; - if (fdi->out >= MAX_DST_BUFFER * 8) { - outlog ("destination buffer overflow\n"); - fdi->err = 1; - fdi->out = 1; - } -} -/* add bit and mfm sync bit */ -static void bit_mfm_add (FDI *fdi, int bit) -{ - add_mfm_sync_bit (fdi); - bit_add (fdi, bit); -} -/* remove following bit */ -static void bit_drop_next (FDI *fdi) -{ - if (fdi->nextdrop > 0) { - outlog("multiple bit_drop_next() called"); - } else if (fdi->nextdrop < 0) { - fdi->nextdrop = 0; - debuglog(":DNN:"); - return; - } - debuglog(":DN:"); - fdi->nextdrop = 1; -} - -/* ignore next bit_drop_next() */ -static void bit_dedrop (FDI *fdi) -{ - if (fdi->nextdrop) { - outlog("bit_drop_next called before bit_dedrop"); - } - fdi->nextdrop = -1; - debuglog(":BDD:"); -} - -/* add one byte */ -static void byte_add (FDI *fdi, uae_u8 v) -{ - int i; - for (i = 7; i >= 0; i--) - bit_add (fdi, v & (1 << i)); -} -/* add one word */ -static void word_add (FDI *fdi, uae_u16 v) -{ - byte_add (fdi, (uae_u8)(v >> 8)); - byte_add (fdi, (uae_u8)v); -} -/* add one byte and mfm encode it */ -static void byte_mfm_add (FDI *fdi, uae_u8 v) -{ - int i; - for (i = 7; i >= 0; i--) - bit_mfm_add (fdi, v & (1 << i)); -} -/* add multiple bytes and mfm encode them */ -static void bytes_mfm_add (FDI *fdi, uae_u8 v, int len) -{ - int i; - for (i = 0; i < len; i++) byte_mfm_add (fdi, v); -} -/* add one mfm encoded word and re-mfm encode it */ -static void word_post_mfm_add (FDI *fdi, uae_u16 v) -{ - int i; - for (i = 14; i >= 0; i -= 2) - bit_mfm_add (fdi, v & (1 << i)); -} - -/* bit 0 */ -static void s00(FDI *fdi) { bit_add (fdi, 0); } -/* bit 1*/ -static void s01(FDI *fdi) { bit_add (fdi, 1); } -/* 4489 */ -static void s02(FDI *fdi) { word_add (fdi, 0x4489); } -/* 5224 */ -static void s03(FDI *fdi) { word_add (fdi, 0x5224); } -/* mfm sync bit */ -static void s04(FDI *fdi) { add_mfm_sync_bit (fdi); } -/* RLE MFM-encoded data */ -static void s08(FDI *fdi) -{ - int bytes = *fdi->track_src++; - uae_u8 byte = *fdi->track_src++; - if (bytes == 0) bytes = 256; - debuglog ("s08:len=%d,data=%02.2X",bytes,byte); - while(bytes--) byte_add (fdi, byte); -} -/* RLE MFM-decoded data */ -static void s09(FDI *fdi) -{ - int bytes = *fdi->track_src++; - uae_u8 byte = *fdi->track_src++; - if (bytes == 0) bytes = 256; - bit_drop_next (fdi); - debuglog ("s09:len=%d,data=%02.2X",bytes,byte); - while(bytes--) byte_mfm_add (fdi, byte); -} -/* MFM-encoded data */ -static void s0a(FDI *fdi) -{ - int i, bits = (fdi->track_src[0] << 8) | fdi->track_src[1]; - uae_u8 b; - fdi->track_src += 2; - debuglog ("s0a:bits=%d,data=%s", bits, datalog(fdi->track_src, (bits + 7) / 8)); - while (bits >= 8) { - byte_add (fdi, *fdi->track_src++); - bits -= 8; - } - if (bits > 0) { - i = 7; - b = *fdi->track_src++; - while (bits--) { - bit_add (fdi, b & (1 << i)); - i--; - } - } -} -/* MFM-encoded data */ -static void s0b(FDI *fdi) -{ - int i, bits = ((fdi->track_src[0] << 8) | fdi->track_src[1]) + 65536; - uae_u8 b; - fdi->track_src += 2; - debuglog ("s0b:bits=%d,data=%s", bits, datalog(fdi->track_src, (bits + 7) / 8)); - while (bits >= 8) { - byte_add (fdi, *fdi->track_src++); - bits -= 8; - } - if (bits > 0) { - i = 7; - b = *fdi->track_src++; - while (bits--) { - bit_add (fdi, b & (1 << i)); - i--; - } - } -} -/* MFM-decoded data */ -static void s0c(FDI *fdi) -{ - int i, bits = (fdi->track_src[0] << 8) | fdi->track_src[1]; - uae_u8 b; - fdi->track_src += 2; - bit_drop_next (fdi); - debuglog ("s0c:bits=%d,data=%s", bits, datalog(fdi->track_src, (bits + 7) / 8)); - while (bits >= 8) { - byte_mfm_add (fdi, *fdi->track_src++); - bits -= 8; - } - if (bits > 0) { - i = 7; - b = *fdi->track_src++; - while(bits--) { - bit_mfm_add (fdi, b & (1 << i)); - i--; - } - } -} -/* MFM-decoded data */ -static void s0d(FDI *fdi) -{ - int i, bits = ((fdi->track_src[0] << 8) | fdi->track_src[1]) + 65536; - uae_u8 b; - fdi->track_src += 2; - bit_drop_next (fdi); - debuglog ("s0d:bits=%d,data=%s", bits, datalog(fdi->track_src, (bits + 7) / 8)); - while (bits >= 8) { - byte_mfm_add (fdi, *fdi->track_src++); - bits -= 8; - } - if (bits > 0) { - i = 7; - b = *fdi->track_src++; - while(bits--) { - bit_mfm_add (fdi, b & (1 << i)); - i--; - } - } -} - -/* ***** */ -/* AMIGA */ -/* ***** */ - -/* just for testing integrity of Amiga sectors */ - -/*static void rotateonebit (uae_u8 *start, uae_u8 *end, int shift) -{ - if (shift == 0) - return; - while (start <= end) { - start[0] <<= shift; - start[0] |= start[1] >> (8 - shift); - start++; - } -}*/ - -//static int check_offset; -/*static uae_u16 getmfmword (uae_u8 *mbuf) -{ - uae_u32 v; - - v = (mbuf[0] << 8) | (mbuf[1] << 0); - if (check_offset == 0) - return v; - v <<= 8; - v |= mbuf[2]; - v >>= check_offset; - return v; -}*/ - -#define MFMMASK 0x55555555 -/*static uae_u32 getmfmlong (uae_u8 * mbuf) -{ - return ((getmfmword (mbuf) << 16) | getmfmword (mbuf + 2)) & MFMMASK; -}*/ - -#if 0 -static int amiga_check_track (FDI *fdi) -{ - int i, j, secwritten = 0; - int fwlen = fdi->out / 8; - int length = 2 * fwlen; - int drvsec = 11; - uae_u32 odd, even, chksum, id, dlong; - uae_u8 *secdata; - uae_u8 secbuf[544]; - uae_u8 bigmfmbuf[60000]; - uae_u8 *mbuf, *mbuf2, *mend; - char sectable[22]; - uae_u8 *raw = fdi->track_dst_buffer; - int slabel, off; - int ok = 1; - - memset (bigmfmbuf, 0, sizeof (bigmfmbuf)); - mbuf = bigmfmbuf; - check_offset = 0; - for (i = 0; i < (fdi->out + 7) / 8; i++) - *mbuf++ = raw[i]; - off = fdi->out & 7; -#if 1 - if (off > 0) { - mbuf--; - *mbuf &= ~((1 << (8 - off)) - 1); - } - j = 0; - while (i < (fdi->out + 7) / 8 + 600) { - *mbuf++ |= (raw[j] >> off) | ((raw[j + 1]) << (8 - off)); - j++; - i++; - } -#endif - mbuf = bigmfmbuf; - - memset (sectable, 0, sizeof (sectable)); - //memcpy (mbuf + fwlen, mbuf, fwlen * sizeof (uae_u16)); - mend = bigmfmbuf + length; - mend -= (4 + 16 + 8 + 512); - - while (secwritten < drvsec) { - int trackoffs; - - for (;;) { - rotateonebit (bigmfmbuf, mend, 1); - if (getmfmword (mbuf) == 0) - break; - if (secwritten == 10) { - mbuf[0] = 0x44; - mbuf[1] = 0x89; - } -// check_offset++; - if (check_offset > 7) { - check_offset = 0; - mbuf++; - if (mbuf >= mend || *mbuf == 0) - break; - } - if (getmfmword (mbuf) == 0x4489) - break; - } - if (mbuf >= mend || *mbuf == 0) - break; - - rotateonebit (bigmfmbuf, mend, check_offset); - check_offset = 0; - - while (getmfmword (mbuf) == 0x4489) - mbuf+= 1 * 2; - mbuf2 = mbuf + 8; - - odd = getmfmlong (mbuf); - even = getmfmlong (mbuf + 2 * 2); - mbuf += 4 * 2; - id = (odd << 1) | even; - - trackoffs = (id & 0xff00) >> 8; - if (trackoffs + 1 > drvsec) { - outlog("illegal sector offset %d\n",trackoffs); - ok = 0; - mbuf = mbuf2; - continue; - } - if ((id >> 24) != 0xff) { - outlog ("sector %d format type %02.2X?\n", trackoffs, id >> 24); - ok = 0; - } - chksum = odd ^ even; - slabel = 0; - for (i = 0; i < 4; i++) { - odd = getmfmlong (mbuf); - even = getmfmlong (mbuf + 8 * 2); - mbuf += 2* 2; - - dlong = (odd << 1) | even; - if (dlong) slabel = 1; - chksum ^= odd ^ even; - } - mbuf += 8 * 2; - odd = getmfmlong (mbuf); - even = getmfmlong (mbuf + 2 * 2); - mbuf += 4 * 2; - if (((odd << 1) | even) != chksum) { - outlog("sector %d header crc error\n", trackoffs); - ok = 0; - mbuf = mbuf2; - continue; - } - outlog("sector %d header crc ok\n", trackoffs); - if (((id & 0x00ff0000) >> 16) != (uae_u32)fdi->current_track) { - outlog("illegal track number %d <> %d\n",fdi->current_track,(id & 0x00ff0000) >> 16); - ok++; - mbuf = mbuf2; - continue; - } - odd = getmfmlong (mbuf); - even = getmfmlong (mbuf + 2 * 2); - mbuf += 4 * 2; - chksum = (odd << 1) | even; - secdata = secbuf + 32; - for (i = 0; i < 128; i++) { - odd = getmfmlong (mbuf); - even = getmfmlong (mbuf + 256 * 2); - mbuf += 2 * 2; - dlong = (odd << 1) | even; - *secdata++ = (uae_u8) (dlong >> 24); - *secdata++ = (uae_u8) (dlong >> 16); - *secdata++ = (uae_u8) (dlong >> 8); - *secdata++ = (uae_u8) dlong; - chksum ^= odd ^ even; - } - mbuf += 256 * 2; - if (chksum) { - outlog("sector %d data checksum error\n",trackoffs); - ok = 0; - } else if (sectable[trackoffs]) { - outlog("sector %d already found?\n", trackoffs); - mbuf = mbuf2; - } else { - outlog("sector %d ok\n",trackoffs); - if (slabel) outlog("(non-empty sector header)\n"); - sectable[trackoffs] = 1; - secwritten++; - if (trackoffs == 9) - mbuf += 0x228; - } - } - for (i = 0; i < drvsec; i++) { - if (!sectable[i]) { - outlog ("sector %d missing\n", i); - ok = 0; - } - } - return ok; -} -#endif - -static void amiga_data_raw (FDI *fdi, uae_u8 *secbuf, uae_u8 *crc, int len) -{ - int i; - uae_u8 crcbuf[4]; - - if (!crc) { - memset (crcbuf, 0, 4); - } else { - memcpy (crcbuf, crc ,4); - } - for (i = 0; i < 4; i++) - byte_mfm_add (fdi, crcbuf[i]); - for (i = 0; i < len; i++) - byte_mfm_add (fdi, secbuf[i]); -} - -static void amiga_data (FDI *fdi, uae_u8 *secbuf) -{ - uae_u16 mfmbuf[4 + 512]; - uae_u32 dodd, deven, dck; - int i; - - for (i = 0; i < 512; i += 4) { - deven = ((secbuf[i + 0] << 24) | (secbuf[i + 1] << 16) - | (secbuf[i + 2] << 8) | (secbuf[i + 3])); - dodd = deven >> 1; - deven &= 0x55555555; - dodd &= 0x55555555; - mfmbuf[(i >> 1) + 4] = (uae_u16) (dodd >> 16); - mfmbuf[(i >> 1) + 5] = (uae_u16) dodd; - mfmbuf[(i >> 1) + 256 + 4] = (uae_u16) (deven >> 16); - mfmbuf[(i >> 1) + 256 + 5] = (uae_u16) deven; - } - dck = 0; - for (i = 4; i < 4 + 512; i += 2) - dck ^= (mfmbuf[i] << 16) | mfmbuf[i + 1]; - deven = dodd = dck; - dodd >>= 1; - deven &= 0x55555555; - dodd &= 0x55555555; - mfmbuf[0] = (uae_u16) (dodd >> 16); - mfmbuf[1] = (uae_u16) dodd; - mfmbuf[2] = (uae_u16) (deven >> 16); - mfmbuf[3] = (uae_u16) deven; - - for (i = 0; i < 4 + 512; i ++) - word_post_mfm_add (fdi, mfmbuf[i]); -} - -static void amiga_sector_header (FDI *fdi, uae_u8 *header, uae_u8 *data, int sector, int untilgap) -{ - uae_u8 headerbuf[4], databuf[16]; - uae_u32 deven, dodd, hck; - uae_u16 mfmbuf[24]; - int i; - - byte_mfm_add (fdi, 0); - byte_mfm_add (fdi, 0); - word_add (fdi, 0x4489); - word_add (fdi, 0x4489); - if (header) { - memcpy (headerbuf, header, 4); - } else { - headerbuf[0] = 0xff; - headerbuf[1] = (uae_u8)fdi->current_track; - headerbuf[2] = (uae_u8)sector; - headerbuf[3] = (uae_u8)untilgap; - } - if (data) - memcpy (databuf, data, 16); - else - memset (databuf, 0, 16); - - deven = ((headerbuf[0] << 24) | (headerbuf[1] << 16) - | (headerbuf[2] << 8) | (headerbuf[3])); - dodd = deven >> 1; - deven &= 0x55555555; - dodd &= 0x55555555; - mfmbuf[0] = (uae_u16) (dodd >> 16); - mfmbuf[1] = (uae_u16) dodd; - mfmbuf[2] = (uae_u16) (deven >> 16); - mfmbuf[3] = (uae_u16) deven; - for (i = 0; i < 16; i += 4) { - deven = ((databuf[i] << 24) | (databuf[i + 1] << 16) - | (databuf[i + 2] << 8) | (databuf[i + 3])); - dodd = deven >> 1; - deven &= 0x55555555; - dodd &= 0x55555555; - mfmbuf[(i >> 1) + 0 + 4] = (uae_u16) (dodd >> 16); - mfmbuf[(i >> 1) + 0 + 5] = (uae_u16) dodd; - mfmbuf[(i >> 1) + 8 + 4] = (uae_u16) (deven >> 16); - mfmbuf[(i >> 1) + 8 + 5] = (uae_u16) deven; - } - hck = 0; - for (i = 0; i < 4 + 16; i += 2) - hck ^= (mfmbuf[i] << 16) | mfmbuf[i + 1]; - deven = dodd = hck; - dodd >>= 1; - deven &= 0x55555555; - dodd &= 0x55555555; - mfmbuf[20] = (uae_u16) (dodd >> 16); - mfmbuf[21] = (uae_u16) dodd; - mfmbuf[22] = (uae_u16) (deven >> 16); - mfmbuf[23] = (uae_u16) deven; - - for (i = 0; i < 4 + 16 + 4; i ++) - word_post_mfm_add (fdi, mfmbuf[i]); -} - -/* standard super-extended Amiga sector header */ -static void s20(FDI *fdi) -{ - bit_drop_next (fdi); - debuglog ("s20:header=%s,data=%s", datalog(fdi->track_src, 4), datalog(fdi->track_src + 4, 16)); - amiga_sector_header (fdi, fdi->track_src, fdi->track_src + 4, 0, 0); - fdi->track_src += 4 + 16; -} -/* standard extended Amiga sector header */ -static void s21(FDI *fdi) -{ - bit_drop_next (fdi); - debuglog ("s21:header=%s", datalog(fdi->track_src, 4)); - amiga_sector_header (fdi, fdi->track_src, 0, 0, 0); - fdi->track_src += 4; -} -/* standard Amiga sector header */ -static void s22(FDI *fdi) -{ - bit_drop_next (fdi); - debuglog("s22:sector=%d,untilgap=%d", fdi->track_src[0], fdi->track_src[1]); - amiga_sector_header (fdi, 0, 0, fdi->track_src[0], fdi->track_src[1]); - fdi->track_src += 2; -} -/* standard 512-byte, CRC-correct Amiga data */ -static void s23(FDI *fdi) -{ - debuglog("s23:data=%s", datalog (fdi->track_src, 512)); - amiga_data (fdi, fdi->track_src); - fdi->track_src += 512; -} -/* not-decoded, 128*2^x-byte, CRC-correct Amiga data */ -static void s24(FDI *fdi) -{ - int shift = *fdi->track_src++; - debuglog("s24:shift=%d,data=%s", shift, datalog (fdi->track_src, 128 << shift)); - amiga_data_raw (fdi, fdi->track_src, 0, 128 << shift); - fdi->track_src += 128 << shift; -} -/* not-decoded, 128*2^x-byte, CRC-incorrect Amiga data */ -static void s25(FDI *fdi) -{ - int shift = *fdi->track_src++; - debuglog("s25:shift=%d,crc=%s,data=%s", shift, datalog (fdi->track_src, 4), datalog (fdi->track_src + 4, 128 << shift)); - amiga_data_raw (fdi, fdi->track_src + 4, fdi->track_src, 128 << shift); - fdi->track_src += 4 + (128 << shift); -} -/* standard extended Amiga sector */ -static void s26(FDI *fdi) -{ - s21 (fdi); - debuglog("s26:data=%s", datalog (fdi->track_src, 512)); - amiga_data (fdi, fdi->track_src); - fdi->track_src += 512; -} -/* standard short Amiga sector */ -static void s27(FDI *fdi) -{ - s22 (fdi); - debuglog("s27:data=%s", datalog (fdi->track_src, 512)); - amiga_data (fdi, fdi->track_src); - fdi->track_src += 512; -} - -/* *** */ -/* IBM */ -/* *** */ - -static uae_u16 ibm_crc (uae_u8 byte, int reset) -{ - static uae_u16 crc; - int i; - - if (reset) crc = 0xcdb4; - for (i = 0; i < 8; i++) { - if (crc & 0x8000) { - crc <<= 1; - if (!(byte & 0x80)) crc ^= 0x1021; - } else { - crc <<= 1; - if (byte & 0x80) crc ^= 0x1021; - } - byte <<= 1; - } - return crc; -} - -static void ibm_data (FDI *fdi, uae_u8 *data, uae_u8 *crc, int len) -{ - int i; - uae_u8 crcbuf[2]; - uae_u16 crcv = 0; - - word_add (fdi, 0x4489); - word_add (fdi, 0x4489); - word_add (fdi, 0x4489); - byte_mfm_add (fdi, 0xfb); - ibm_crc (0xfb, 1); - for (i = 0; i < len; i++) { - byte_mfm_add (fdi, data[i]); - crcv = ibm_crc (data[i], 0); - } - if (!crc) { - crc = crcbuf; - crc[0] = (uae_u8)(crcv >> 8); - crc[1] = (uae_u8)crcv; - } - byte_mfm_add (fdi, crc[0]); - byte_mfm_add (fdi, crc[1]); -} - -static void ibm_sector_header (FDI *fdi, uae_u8 *data, uae_u8 *crc, int secnum, int pre) -{ - uae_u8 secbuf[5]; - uae_u8 crcbuf[2]; - uae_u16 crcv; - int i; - - if (pre) - bytes_mfm_add (fdi, 0, 12); - word_add (fdi, 0x4489); - word_add (fdi, 0x4489); - word_add (fdi, 0x4489); - secbuf[0] = 0xfe; - if (secnum >= 0) { - secbuf[1] = (uae_u8)(fdi->current_track/2); - secbuf[2] = (uae_u8)(fdi->current_track%2); - secbuf[3] = (uae_u8)secnum; - secbuf[4] = 2; - } else { - memcpy (secbuf + 1, data, 4); - } - ibm_crc (secbuf[0], 1); - ibm_crc (secbuf[1], 0); - ibm_crc (secbuf[2], 0); - ibm_crc (secbuf[3], 0); - crcv = ibm_crc (secbuf[4], 0); - if (crc) { - memcpy (crcbuf, crc, 2); - } else { - crcbuf[0] = (uae_u8)(crcv >> 8); - crcbuf[1] = (uae_u8)crcv; - } - /* data */ - for (i = 0;i < 5; i++) - byte_mfm_add (fdi, secbuf[i]); - /* crc */ - byte_mfm_add (fdi, crcbuf[0]); - byte_mfm_add (fdi, crcbuf[1]); -} - -/* standard IBM index address mark */ -static void s10(FDI *fdi) -{ - bit_drop_next (fdi); - bytes_mfm_add (fdi, 0, 12); - word_add (fdi, 0x5224); - word_add (fdi, 0x5224); - word_add (fdi, 0x5224); - byte_mfm_add (fdi, 0xfc); -} -/* standard IBM pre-gap */ -static void s11(FDI *fdi) -{ - bit_drop_next (fdi); - bytes_mfm_add (fdi, 0x4e, 78); - bit_dedrop (fdi); - s10 (fdi); - bytes_mfm_add (fdi, 0x4e, 50); -} -/* standard ST pre-gap */ -static void s12(FDI *fdi) -{ - bit_drop_next (fdi); - bytes_mfm_add (fdi, 0x4e, 78); -} -/* standard extended IBM sector header */ -static void s13(FDI *fdi) -{ - bit_drop_next (fdi); - debuglog ("s13:header=%s", datalog (fdi->track_src, 4)); - ibm_sector_header (fdi, fdi->track_src, 0, -1, 1); - fdi->track_src += 4; -} -/* standard mini-extended IBM sector header */ -static void s14(FDI *fdi) -{ - debuglog ("s14:header=%s", datalog (fdi->track_src, 4)); - ibm_sector_header (fdi, fdi->track_src, 0, -1, 0); - fdi->track_src += 4; -} -/* standard short IBM sector header */ -static void s15(FDI *fdi) -{ - bit_drop_next (fdi); - debuglog ("s15:sector=%d", *fdi->track_src); - ibm_sector_header (fdi, 0, 0, *fdi->track_src++, 1); -} -/* standard mini-short IBM sector header */ -static void s16(FDI *fdi) -{ - debuglog ("s16:track=%d", *fdi->track_src); - ibm_sector_header (fdi, 0, 0, *fdi->track_src++, 0); -} -/* standard CRC-incorrect mini-extended IBM sector header */ -static void s17(FDI *fdi) -{ - debuglog ("s17:header=%s,crc=%s", datalog (fdi->track_src, 4), datalog (fdi->track_src + 4, 2)); - ibm_sector_header (fdi, fdi->track_src, fdi->track_src + 4, -1, 0); - fdi->track_src += 4 + 2; -} -/* standard CRC-incorrect mini-short IBM sector header */ -static void s18(FDI *fdi) -{ - debuglog ("s18:sector=%d,header=%s", *fdi->track_src, datalog (fdi->track_src + 1, 4)); - ibm_sector_header (fdi, 0, fdi->track_src + 1, *fdi->track_src, 0); - fdi->track_src += 1 + 4; -} -/* standard 512-byte CRC-correct IBM data */ -static void s19(FDI *fdi) -{ - debuglog ("s19:data=%s", datalog (fdi->track_src , 512)); - ibm_data (fdi, fdi->track_src, 0, 512); - fdi->track_src += 512; -} -/* standard 128*2^x-byte-byte CRC-correct IBM data */ -static void s1a(FDI *fdi) -{ - int shift = *fdi->track_src++; - debuglog ("s1a:shift=%d,data=%s", shift, datalog (fdi->track_src , 128 << shift)); - ibm_data (fdi, fdi->track_src, 0, 128 << shift); - fdi->track_src += 128 << shift; -} -/* standard 128*2^x-byte-byte CRC-incorrect IBM data */ -static void s1b(FDI *fdi) -{ - int shift = *fdi->track_src++; - debuglog ("s1b:shift=%d,crc=%s,data=%s", shift, datalog (fdi->track_src + (128 << shift), 2), datalog (fdi->track_src , 128 << shift)); - ibm_data (fdi, fdi->track_src, fdi->track_src + (128 << shift), 128 << shift); - fdi->track_src += (128 << shift) + 2; -} -/* standard extended IBM sector */ -static void s1c(FDI *fdi) -{ - int shift = fdi->track_src[3]; - s13 (fdi); - bytes_mfm_add (fdi, 0x4e, 22); - bytes_mfm_add (fdi, 0x00, 12); - ibm_data (fdi, fdi->track_src, 0, 128 << shift); - fdi->track_src += 128 << shift; -} -/* standard short IBM sector */ -static void s1d(FDI *fdi) -{ - s15 (fdi); - bytes_mfm_add (fdi, 0x4e, 22); - bytes_mfm_add (fdi, 0x00, 12); - s19 (fdi); -} - -/* end marker */ -static void sff(FDI *fdi) -{ -} - -typedef void (*decode_described_track_func)(FDI*); - -static decode_described_track_func decode_sectors_described_track[] = -{ - s00,s01,s02,s03,s04,dxx,dxx,dxx,s08,s09,s0a,s0b,s0c,s0d,dxx,dxx, /* 00-0F */ - s10,s11,s12,s13,s14,s15,s16,s17,s18,s19,s1a,s1b,s1c,s1d,dxx,dxx, /* 10-1F */ - s20,s21,s22,s23,s24,s25,s26,s27,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx, /* 20-2F */ - dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx, /* 30-3F */ - dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx, /* 40-4F */ - dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx, /* 50-5F */ - dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx, /* 60-6F */ - dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx, /* 70-7F */ - dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx, /* 80-8F */ - dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx, /* 90-9F */ - dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx, /* A0-AF */ - dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx, /* B0-BF */ - dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx, /* C0-CF */ - dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx, /* D0-DF */ - dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx, /* E0-EF */ - dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,dxx,sff /* F0-FF */ -}; - -static void track_amiga (struct fdi *fdi, int first_sector, int max_sector) -{ - int i; - - bit_add (fdi, 0); - bit_drop_next (fdi); - for (i = 0; i < max_sector; i++) { - amiga_sector_header (fdi, 0, 0, first_sector, max_sector - i); - amiga_data (fdi, fdi->track_src + first_sector * 512); - first_sector++; - if (first_sector >= max_sector) first_sector = 0; - } - bytes_mfm_add (fdi, 0, 260); /* gap */ -} -static void track_atari_st (struct fdi *fdi, int max_sector) -{ - int i, gap3 = 0; - uae_u8 *p = fdi->track_src; - - switch (max_sector) - { - case 9: - gap3 = 40; - break; - case 10: - gap3 = 24; - break; - } - s15 (fdi); - for (i = 0; i < max_sector; i++) { - byte_mfm_add (fdi, 0x4e); - byte_mfm_add (fdi, 0x4e); - ibm_sector_header (fdi, 0, 0, fdi->current_track, 1); - ibm_data (fdi, p + i * 512, 0, 512); - bytes_mfm_add (fdi, 0x4e, gap3); - } - bytes_mfm_add (fdi, 0x4e, 660 - gap3); - fdi->track_src += fdi->track_len * 256; -} -static void track_pc (struct fdi *fdi, int max_sector) -{ - int i, gap3; - uae_u8 *p = fdi->track_src; - - switch (max_sector) - { - case 8: - gap3 = 116; - break; - case 9: - gap3 = 54; - break; - default: - gap3 = 100; /* fixme */ - break; - } - s11 (fdi); - for (i = 0; i < max_sector; i++) { - byte_mfm_add (fdi, 0x4e); - byte_mfm_add (fdi, 0x4e); - ibm_sector_header (fdi, 0, 0, fdi->current_track, 1); - ibm_data (fdi, p + i * 512, 0, 512); - bytes_mfm_add (fdi, 0x4e, gap3); - } - bytes_mfm_add (fdi, 0x4e, 600 - gap3); - fdi->track_src += fdi->track_len * 256; -} - -/* amiga dd */ -static void track_amiga_dd (struct fdi *fdi) -{ - uae_u8 *p = fdi->track_src; - track_amiga (fdi, fdi->track_len >> 4, 11); - fdi->track_src = p + (fdi->track_len & 15) * 512; -} -/* amiga hd */ -static void track_amiga_hd (struct fdi *fdi) -{ - uae_u8 *p = fdi->track_src; - track_amiga (fdi, 0, 22); - fdi->track_src = p + fdi->track_len * 256; -} -/* atari st 9 sector */ -static void track_atari_st_9 (struct fdi *fdi) -{ - track_atari_st (fdi, 9); -} -/* atari st 10 sector */ -static void track_atari_st_10 (struct fdi *fdi) -{ - track_atari_st (fdi, 10); -} -/* pc 8 sector */ -static void track_pc_8 (struct fdi *fdi) -{ - track_pc (fdi, 8); -} -/* pc 9 sector */ -static void track_pc_9 (struct fdi *fdi) -{ - track_pc (fdi, 9); -} -/* pc 15 sector */ -static void track_pc_15 (struct fdi *fdi) -{ - track_pc (fdi, 15); -} -/* pc 18 sector */ -static void track_pc_18 (struct fdi *fdi) -{ - track_pc (fdi, 18); -} -/* pc 36 sector */ -static void track_pc_36 (struct fdi *fdi) -{ - track_pc (fdi, 36); -} - -typedef void (*decode_normal_track_func)(FDI*); - -static decode_normal_track_func decode_normal_track[] = -{ - track_empty, /* 0 */ - track_amiga_dd, track_amiga_hd, /* 1-2 */ - track_atari_st_9, track_atari_st_10, /* 3-4 */ - track_pc_8, track_pc_9, track_pc_15, track_pc_18, track_pc_36, /* 5-9 */ - zxx,zxx,zxx,zxx,zxx /* A-F */ -}; - -static void fix_mfm_sync (FDI *fdi) -{ - int i, pos, off1, off2, off3, mask1, mask2, mask3; - - for (i = 0; i < fdi->mfmsync_offset; i++) { - pos = fdi->mfmsync_buffer[i]; - off1 = (pos - 1) >> 3; - off2 = (pos + 1) >> 3; - off3 = pos >> 3; - mask1 = 1 << (7 - ((pos - 1) & 7)); - mask2 = 1 << (7 - ((pos + 1) & 7)); - mask3 = 1 << (7 - (pos & 7)); - if (!(fdi->track_dst[off1] & mask1) && !(fdi->track_dst[off2] & mask2)) - fdi->track_dst[off3] |= mask3; - else - fdi->track_dst[off3] &= ~mask3; - } -} - -static int handle_sectors_described_track (FDI *fdi) -{ - int oldout; - uae_u8 *start_src = fdi->track_src ; - fdi->encoding_type = *fdi->track_src++; - fdi->index_offset = get_u32(fdi->track_src); - fdi->index_offset >>= 8; - fdi->track_src += 3; - outlog ("sectors_described, index offset: %d\n",fdi->index_offset); - - do { - fdi->track_type = *fdi->track_src++; - outlog ("%06.6X %06.6X %02.2X:",fdi->track_src - start_src + 0x200, fdi->out/8, fdi->track_type); - oldout = fdi->out; - decode_sectors_described_track[fdi->track_type](fdi); - outlog(" %d\n", fdi->out - oldout); - oldout = fdi->out; - if (fdi->out < 0 || fdi->err) { - outlog ("\nin %d bytes, out %d bits\n", fdi->track_src - fdi->track_src_buffer, fdi->out); - return -1; - } - if (fdi->track_src - fdi->track_src_buffer >= fdi->track_src_len) { - outlog ("source buffer overrun, previous type: %02.2X\n", fdi->track_type); - return -1; - } - } while (fdi->track_type != 0xff); - outlog("\n"); - fix_mfm_sync (fdi); - return fdi->out; -} - -static uae_u8 *fdi_decompress (int pulses, uae_u8 *sizep, uae_u8 *src, int *dofree) -{ - uae_u32 size = get_u24 (sizep); - uae_u32 *dst2; - int len = size & 0x3fffff; - uae_u8 *dst; - int mode = size >> 22, i; - - *dofree = 0; - if (mode == 0 && pulses * 2 > len) - mode = 1; - if (mode == 0) { - dst2 = (uae_u32*)src; - dst = src; - for (i = 0; i < pulses; i++) { - *dst2++ = get_u32 (src); - src += 4; - } - } else if (mode == 1) { - dst = fdi_malloc (pulses *4); - *dofree = 1; - fdi_decode (src, pulses, dst); - } else { - dst = 0; - } - return dst; -} - -static void dumpstream(int track, uae_u8 *stream, int len) -{ -#if 0 - char name[100]; - FILE *f; - - sprintf (name, "track_%d.raw", track); - f = fopen(name, "wb"); - fwrite (stream, 1, len * 4, f); - fclose (f); -#endif -} - -static int bitoffset; - -STATIC_INLINE void addbit (uae_u8 *p, int bit) -{ - int off1 = bitoffset / 8; - int off2 = bitoffset % 8; - p[off1] |= bit << (7 - off2); - bitoffset++; -} - - -struct pulse_sample { - uint32_t size; - int number_of_bits; -}; - - -#define FDI_MAX_ARRAY 10 /* change this value as you want */ -static int pulse_limitval = 15; /* tolerance of 15% */ -static struct pulse_sample psarray[FDI_MAX_ARRAY]; -static int array_index; -static unsigned long total; -static int totaldiv; - -static void init_array(uint32_t standard_MFM_2_bit_cell_size, int nb_of_bits) -{ - int i; - - for (i = 0; i < FDI_MAX_ARRAY; i++) { - psarray[i].size = standard_MFM_2_bit_cell_size; // That is (total track length / 50000) for Amiga double density - total += psarray[i].size; - psarray[i].number_of_bits = nb_of_bits; - totaldiv += psarray[i].number_of_bits; - } - array_index = 0; -} - -#if 0 - -static void fdi2_decode (FDI *fdi, uint32_t totalavg, uae_u32 *avgp, uae_u32 *minp, uae_u32 *maxp, uae_u8 *idx, int maxidx, int *indexoffsetp, int pulses, int mfm) -{ - uint32_t adjust; - uint32_t adjusted_pulse; - uint32_t standard_MFM_2_bit_cell_size = totalavg / 50000; - uint32_t standard_MFM_8_bit_cell_size = totalavg / 12500; - int real_size, i, j, eodat, outstep; - int indexoffset = *indexoffsetp; - uae_u8 *d = fdi->track_dst_buffer; - uae_u16 *pt = fdi->track_dst_buffer_timing; - uae_u32 ref_pulse, pulse; - - /* detects a long-enough stable pulse coming just after another stable pulse */ - i = 1; - while ( (i < pulses) && ( (idx[i] < maxidx) - || (idx[i - 1] < maxidx) - || (avgp[i] < (standard_MFM_2_bit_cell_size - (standard_MFM_2_bit_cell_size / 4))) ) ) - i++; - if (i == pulses) { - outlog ("No stable and long-enough pulse in track.\n"); - return; - } - i--; - eodat = i; - adjust = 0; - total = 0; - totaldiv = 0; - init_array(standard_MFM_2_bit_cell_size, 2); - bitoffset = 0; - ref_pulse = 0; - outstep = 0; - while (outstep < 2) { - - /* calculates the current average bitrate from previous decoded data */ - uae_u32 avg_size = (total << 3) / totaldiv; /* this is the new average size for one MFM bit */ - /* uae_u32 avg_size = (uae_u32)((((float)total)*8.0) / ((float)totaldiv)); */ - /* you can try tighter ranges than 25%, or wider ranges. I would probably go for tighter... */ - if ((avg_size < (standard_MFM_8_bit_cell_size - (pulse_limitval * standard_MFM_8_bit_cell_size / 100))) || - (avg_size > (standard_MFM_8_bit_cell_size + (pulse_limitval * standard_MFM_8_bit_cell_size / 100)))) { - //init_array(standard_MFM_2_bit_cell_size, 2); - avg_size = standard_MFM_8_bit_cell_size; - } - /* this is to prevent the average value from going too far - * from the theoretical value, otherwise it could progressively go to (2 * - * real value), or (real value / 2), etc. */ - - /* gets the next long-enough pulse (this may require more than one pulse) */ - pulse = 0; - while (pulse < ((avg_size / 4) - (avg_size / 16))) { - int indx; - i++; - if (i >= pulses) - i = 0; - indx = idx[i]; - if (rand() <= (indx * RAND_MAX) / maxidx) { - pulse += avgp[i] - ref_pulse; - if (indx >= maxidx) - ref_pulse = 0; - else - ref_pulse = avgp[i]; - } - if (i == eodat) - outstep++; - if (outstep == 1 && indexoffset == i) - *indexoffsetp = bitoffset; - } - - /* gets the size in bits from the pulse width, considering the current average bitrate */ - adjusted_pulse = pulse; - real_size = 0; - while (adjusted_pulse >= avg_size) { - real_size += 4; - adjusted_pulse -= avg_size / 2; - } - adjusted_pulse <<= 3; - while (adjusted_pulse >= ((avg_size * 4) + (avg_size / 4))) { - real_size += 2; - adjusted_pulse -= avg_size * 2; - } - if (adjusted_pulse >= ((avg_size * 3) + (avg_size / 4))) { - if (adjusted_pulse <= ((avg_size * 4) - (avg_size / 4))) { - if ((2 * ((adjusted_pulse >> 2) - adjust)) <= ((2 * avg_size) - (avg_size / 4))) - real_size += 3; - else - real_size += 4; - } else - real_size += 4; - } else { - if (adjusted_pulse > ((avg_size * 3) - (avg_size / 4))) { - real_size += 3; - } else { - if (adjusted_pulse >= ((avg_size * 2) + (avg_size / 4))) { - if ((2 * ((adjusted_pulse >> 2) - adjust)) < (avg_size + (avg_size / 4))) - real_size += 2; - else - real_size += 3; - } else - real_size += 2; - } - } - - if (outstep == 1) { - for (j = real_size; j > 1; j--) - addbit (d, 0); - addbit (d, 1); - for (j = 0; j < real_size; j++) - *pt++ = (uae_u16)(pulse / real_size); - } - - /* prepares for the next pulse */ - adjust = ((real_size * avg_size)/8) - pulse; - total -= psarray[array_index].size; - totaldiv -= psarray[array_index].number_of_bits; - psarray[array_index].size = pulse; - psarray[array_index].number_of_bits = real_size; - total += pulse; - totaldiv += real_size; - array_index++; - if (array_index >= FDI_MAX_ARRAY) - array_index = 0; - } - - fdi->out = bitoffset; -} - -#else - -static void fdi2_decode (FDI *fdi, uint32_t totalavg, uae_u32 *avgp, uae_u32 *minp, uae_u32 *maxp, uae_u8 *idx, int maxidx, int *indexoffsetp, int pulses, int mfm) -{ - uint32_t adjust; - uint32_t adjusted_pulse; - uint32_t standard_MFM_2_bit_cell_size = totalavg / 50000; - uint32_t standard_MFM_8_bit_cell_size = totalavg / 12500; - int real_size, i, j, nexti, eodat, outstep, randval; - int indexoffset = *indexoffsetp; - uae_u8 *d = fdi->track_dst_buffer; - uae_u16 *pt = fdi->track_dst_buffer_timing; - uae_u32 ref_pulse, pulse; - long jitter; - - /* detects a long-enough stable pulse coming just after another stable pulse */ - i = 1; - while ( (i < pulses) && ( (idx[i] < maxidx) - || (idx[i - 1] < maxidx) - || (minp[i] < (standard_MFM_2_bit_cell_size - (standard_MFM_2_bit_cell_size / 4))) ) ) - i++; - if (i == pulses) { - outlog ("FDI: No stable and long-enough pulse in track.\n"); - return; - } - nexti = i; - eodat = i; - i--; - adjust = 0; - total = 0; - totaldiv = 0; - init_array(standard_MFM_2_bit_cell_size, 1 + mfm); - bitoffset = 0; - ref_pulse = 0; - jitter = 0; - outstep = -1; - while (outstep < 2) { - - /* calculates the current average bitrate from previous decoded data */ - uae_u32 avg_size = (total << (2 + mfm)) / totaldiv; /* this is the new average size for one MFM bit */ - /* uae_u32 avg_size = (uae_u32)((((float)total)*((float)(mfm+1))*4.0) / ((float)totaldiv)); */ - /* you can try tighter ranges than 25%, or wider ranges. I would probably go for tighter... */ - if ((avg_size < (standard_MFM_8_bit_cell_size - (pulse_limitval * standard_MFM_8_bit_cell_size / 100))) || - (avg_size > (standard_MFM_8_bit_cell_size + (pulse_limitval * standard_MFM_8_bit_cell_size / 100)))) { - //init_array(standard_MFM_2_bit_cell_size, mfm + 1); - avg_size = standard_MFM_8_bit_cell_size; - } - /* this is to prevent the average value from going too far - * from the theoretical value, otherwise it could progressively go to (2 * - * real value), or (real value / 2), etc. */ - - /* gets the next long-enough pulse (this may require more than one pulse) */ - pulse = 0; - while (pulse < ((avg_size / 4) - (avg_size / 16))) { - uae_u32 avg_pulse, min_pulse, max_pulse; - i++; - if (i >= pulses) - i = 0; - if (i == nexti) { - do { - nexti++; - if (nexti >= pulses) - nexti = 0; - } while (idx[nexti] < maxidx); - } - if (idx[i] >= maxidx) { /* stable pulse */ - avg_pulse = avgp[i] - jitter; - min_pulse = minp[i]; - max_pulse = maxp[i]; - if (jitter >= 0) - max_pulse -= jitter; - else - min_pulse -= jitter; - if ((maxp[nexti] - avgp[nexti]) < (avg_pulse - min_pulse)) - min_pulse = avg_pulse - (maxp[nexti] - avgp[nexti]); - if ((avgp[nexti] - minp[nexti]) < (max_pulse - avg_pulse)) - max_pulse = avg_pulse + (avgp[nexti] - minp[nexti]); - if (min_pulse < ref_pulse) - min_pulse = ref_pulse; - randval = rand(); - if (randval < (RAND_MAX / 2)) { - if (randval > (RAND_MAX / 4)) { - if (randval <= (3 * RAND_MAX / 8)) - randval = (2 * randval) - (RAND_MAX /4); - else - randval = (4 * randval) - RAND_MAX; - } - jitter = 0 - (randval * (avg_pulse - min_pulse)) / RAND_MAX; - } else { - randval -= RAND_MAX / 2; - if (randval > (RAND_MAX / 4)) { - if (randval <= (3 * RAND_MAX / 8)) - randval = (2 * randval) - (RAND_MAX /4); - else - randval = (4 * randval) - RAND_MAX; - } - jitter = (randval * (max_pulse - avg_pulse)) / RAND_MAX; - } - avg_pulse += jitter; - if ((avg_pulse < min_pulse) || (avg_pulse > max_pulse)) { - outlog ("FDI: avg_pulse outside bounds! avg=%u min=%u max=%u\n", avg_pulse, min_pulse, max_pulse); - outlog ("FDI: avgp=%u (%u) minp=%u (%u) maxp=%u (%u) jitter=%d i=%d ni=%d\n", - avgp[i], avgp[nexti], minp[i], minp[nexti], maxp[i], maxp[nexti], jitter, i, nexti); - } - if (avg_pulse < ref_pulse) - outlog ("FDI: avg_pulse < ref_pulse! (%u < %u)\n", avg_pulse, ref_pulse); - pulse += avg_pulse - ref_pulse; - ref_pulse = 0; - if (i == eodat) - outstep++; - } else if (rand() <= ((idx[i] * RAND_MAX) / maxidx)) { - avg_pulse = avgp[i]; - min_pulse = minp[i]; - max_pulse = maxp[i]; - randval = rand(); - if (randval < (RAND_MAX / 2)) { - if (randval > (RAND_MAX / 4)) { - if (randval <= (3 * RAND_MAX / 8)) - randval = (2 * randval) - (RAND_MAX /4); - else - randval = (4 * randval) - RAND_MAX; - } - avg_pulse -= (randval * (avg_pulse - min_pulse)) / RAND_MAX; - } else { - randval -= RAND_MAX / 2; - if (randval > (RAND_MAX / 4)) { - if (randval <= (3 * RAND_MAX / 8)) - randval = (2 * randval) - (RAND_MAX /4); - else - randval = (4 * randval) - RAND_MAX; - } - avg_pulse += (randval * (max_pulse - avg_pulse)) / RAND_MAX; - } - if ((avg_pulse > ref_pulse) && (avg_pulse < (avgp[nexti] - jitter))) { - pulse += avg_pulse - ref_pulse; - ref_pulse = avg_pulse; - } - } - if (outstep == 1 && indexoffset == i) - *indexoffsetp = bitoffset; - } - - /* gets the size in bits from the pulse width, considering the current average bitrate */ - adjusted_pulse = pulse; - real_size = 0; - if (mfm) { - while (adjusted_pulse >= avg_size) { - real_size += 4; - adjusted_pulse -= avg_size / 2; - } - adjusted_pulse <<= 3; - while (adjusted_pulse >= ((avg_size * 4) + (avg_size / 4))) { - real_size += 2; - adjusted_pulse -= avg_size * 2; - } - if (adjusted_pulse >= ((avg_size * 3) + (avg_size / 4))) { - if (adjusted_pulse <= ((avg_size * 4) - (avg_size / 4))) { - if ((2 * ((adjusted_pulse >> 2) - adjust)) <= ((2 * avg_size) - (avg_size / 4))) - real_size += 3; - else - real_size += 4; - } else - real_size += 4; - } else { - if (adjusted_pulse > ((avg_size * 3) - (avg_size / 4))) { - real_size += 3; - } else { - if (adjusted_pulse >= ((avg_size * 2) + (avg_size / 4))) { - if ((2 * ((adjusted_pulse >> 2) - adjust)) < (avg_size + (avg_size / 4))) - real_size += 2; - else - real_size += 3; - } else - real_size += 2; - } - } - } else { - while (adjusted_pulse >= (2*avg_size)) - { - real_size+=4; - adjusted_pulse-=avg_size; - } - adjusted_pulse<<=2; - while (adjusted_pulse >= ((avg_size*3)+(avg_size/4))) - { - real_size+=2; - adjusted_pulse-=avg_size*2; - } - if (adjusted_pulse >= ((avg_size*2)+(avg_size/4))) - { - if (adjusted_pulse <= ((avg_size*3)-(avg_size/4))) - { - if (((adjusted_pulse>>1)-adjust) < (avg_size+(avg_size/4))) - real_size+=2; - else - real_size+=3; - } - else - real_size+=3; - } - else - { - if (adjusted_pulse > ((avg_size*2)-(avg_size/4))) - real_size+=2; - else - { - if (adjusted_pulse >= (avg_size+(avg_size/4))) - { - if (((adjusted_pulse>>1)-adjust) <= (avg_size-(avg_size/4))) - real_size++; - else - real_size+=2; - } - else - real_size++; - } - } - } - - /* after one pass to correctly initialize the average bitrate, outputs the bits */ - if (outstep == 1) { - for (j = real_size; j > 1; j--) - addbit (d, 0); - addbit (d, 1); - for (j = 0; j < real_size; j++) - *pt++ = (uae_u16)(pulse / real_size); - } - - /* prepares for the next pulse */ - adjust = ((real_size * avg_size) / (4 << mfm)) - pulse; - total -= psarray[array_index].size; - totaldiv -= psarray[array_index].number_of_bits; - psarray[array_index].size = pulse; - psarray[array_index].number_of_bits = real_size; - total += pulse; - totaldiv += real_size; - array_index++; - if (array_index >= FDI_MAX_ARRAY) - array_index = 0; - } - - fdi->out = bitoffset; -} - -#endif - -static void fdi2_celltiming (FDI *fdi, uint32_t totalavg, int bitoffset, uae_u16 *out) -{ - uae_u16 *pt2, *pt; - double avg_bit_len; - int i; - - avg_bit_len = (double)totalavg / (double)bitoffset; - pt2 = fdi->track_dst_buffer_timing; - pt = out; - for (i = 0; i < bitoffset / 8; i++) { - double v = (pt2[0] + pt2[1] + pt2[2] + pt2[3] + pt2[4] + pt2[5] + pt2[6] + pt2[7]) / 8.0; - v = 1000.0 * v / avg_bit_len; - *pt++ = (uae_u16)v; - pt2 += 8; - } - *pt++ = out[0]; - *pt = out[0]; -} - -static int decode_lowlevel_track (FDI *fdi, int track, struct fdi_cache *cache) -{ - uae_u8 *p1, *d; - uae_u32 *p2; - uae_u32 *avgp, *minp = 0, *maxp = 0; - uae_u8 *idxp = 0; - uae_u32 maxidx, totalavg, weakbits; - int i, j, len, pulses, indexoffset; - int avg_free, min_free = 0, max_free = 0, idx_free; - int idx_off1, idx_off2, idx_off3; - - d = fdi->track_dst; - p1 = fdi->track_src; - pulses = get_u32 (p1); - if (!pulses) - return -1; - p1 += 4; - len = 12; - avgp = (uae_u32*)fdi_decompress (pulses, p1 + 0, p1 + len, &avg_free); - dumpstream(track, (uae_u8*)avgp, pulses); - len += get_u24 (p1 + 0) & 0x3fffff; - if (!avgp) - return -1; - if (get_u24 (p1 + 3) && get_u24 (p1 + 6)) { - minp = (uae_u32*)fdi_decompress (pulses, p1 + 3, p1 + len, &min_free); - len += get_u24 (p1 + 3) & 0x3fffff; - maxp = (uae_u32*)fdi_decompress (pulses, p1 + 6, p1 + len, &max_free); - len += get_u24 (p1 + 6) & 0x3fffff; - /* Computes the real min and max values */ - for (i = 0; i < pulses; i++) { - maxp[i] = avgp[i] + minp[i] - maxp[i]; - minp[i] = avgp[i] - minp[i]; - } - } else { - minp = avgp; - maxp = avgp; - } - if (get_u24 (p1 + 9)) { - idx_off1 = 0; - idx_off2 = 1; - idx_off3 = 2; - idxp = fdi_decompress (pulses, p1 + 9, p1 + len, &idx_free); - if (idx_free) { - if (idxp[0] == 0 && idxp[1] == 0) { - idx_off1 = 2; - idx_off2 = 3; - } else { - idx_off1 = 1; - idx_off2 = 0; - } - idx_off3 = 4; - } - } else { - idxp = fdi_malloc (pulses * 2); - idx_free = 1; - for (i = 0; i < pulses; i++) { - idxp[i * 2 + 0] = 2; - idxp[i * 2 + 1] = 0; - } - idxp[0] = 1; - idxp[1] = 1; - } - - maxidx = 0; - indexoffset = 0; - p1 = idxp; - for (i = 0; i < pulses; i++) { - if (p1[idx_off1] + p1[idx_off2] > maxidx) - maxidx = p1[idx_off1] + p1[idx_off2]; - p1 += idx_off3; - } - p1 = idxp; - for (i = 0; (i < pulses) && (p1[idx_off2] != 0); i++) /* falling edge, replace with idx_off1 for rising edge */ - p1 += idx_off3; - if (i < pulses) { - j = i; - do { - i++; - p1 += idx_off3; - if (i >= pulses) { - i = 0; - p1 = idxp; - } - } while ((i != j) && (p1[idx_off2] == 0)); /* falling edge, replace with idx_off1 for rising edge */ - if (i != j) /* index pulse detected */ - { - while ((i != j) && (p1[idx_off1] > p1[idx_off2])) { /* falling edge, replace with "<" for rising edge */ - i++; - p1 += idx_off3; - if (i >= pulses) { - i = 0; - p1 = idxp; - } - } - if (i != j) - indexoffset = i; /* index position detected */ - } - } - p1 = idxp; - p2 = avgp; - totalavg = 0; - weakbits = 0; - for (i = 0; i < pulses; i++) { - int sum = p1[idx_off1] + p1[idx_off2]; - if (sum >= maxidx) { - totalavg += *p2; - } else { - weakbits++; - } - p2++; - p1 += idx_off3; - idxp[i] = sum; - } - len = totalavg / 100000; - outlog("totalavg=%u index=%d (%d) maxidx=%d weakbits=%d len=%d\n", - totalavg, indexoffset, maxidx, weakbits, len); - cache->avgp = avgp; - cache->idxp = idxp; - cache->minp = minp; - cache->maxp = maxp; - cache->avg_free = avg_free; - cache->idx_free = idx_free; - cache->min_free = min_free; - cache->max_free = max_free; - cache->totalavg = totalavg; - cache->pulses = pulses; - cache->maxidx = maxidx; - cache->indexoffset = indexoffset; - cache->weakbits = weakbits; - cache->lowlevel = 1; - - return 1; -} - -static unsigned char fdiid[]={"Formatted Disk Image file"}; -static int bit_rate_table[16] = { 125,150,250,300,500,1000 }; - -void fdi2raw_header_free (FDI *fdi) -{ - int i; - - fdi_free (fdi->mfmsync_buffer); - fdi_free (fdi->track_src_buffer); - fdi_free (fdi->track_dst_buffer); - fdi_free (fdi->track_dst_buffer_timing); - for (i = 0; i < MAX_TRACKS; i++) { - struct fdi_cache *c = &fdi->cache[i]; - if (c->idx_free) - fdi_free (c->idxp); - if (c->avg_free) - fdi_free (c->avgp); - if (c->min_free) - fdi_free (c->minp); - if (c->max_free) - fdi_free (c->maxp); - } - fdi_free (fdi); - debuglog ("FREE: memory allocated %d\n", fdi_allocated); -} - -int fdi2raw_get_last_track (FDI *fdi) -{ - return fdi->last_track; -} - -int fdi2raw_get_num_sector (FDI *fdi) -{ - if (fdi->header[152] == 0x02) - return 22; - return 11; -} - -int fdi2raw_get_last_head (FDI *fdi) -{ - return fdi->last_head; -} - -int fdi2raw_get_rotation (FDI *fdi) -{ - return fdi->rotation_speed; -} - -int fdi2raw_get_bit_rate (FDI *fdi) -{ - return fdi->bit_rate; -} - -int fdi2raw_get_type (FDI *fdi) -{ - return fdi->disk_type; -} - -int fdi2raw_get_write_protect (FDI *fdi) -{ - return fdi->write_protect; -} - -FDI *fdi2raw_header(FILE *f) -{ - int i, offset, oldseek; - uae_u8 type, size; - FDI *fdi; - - debuglog ("ALLOC: memory allocated %d\n", fdi_allocated); - fdi = fdi_malloc(sizeof(FDI)); - memset (fdi, 0, sizeof (FDI)); - fdi->file = f; - oldseek = ftell (fdi->file); - fseek (fdi->file, 0, SEEK_SET); - fread (fdi->header, 2048, 1, fdi->file); - fseek (fdi->file, oldseek, SEEK_SET); - if (memcmp (fdiid, fdi->header, strlen ((char *)fdiid)) ) { - fdi_free(fdi); - return NULL; - } - if ((fdi->header[140] != 1 && fdi->header[140] != 2) || (fdi->header[141] != 0 && !(fdi->header[140]==2 && fdi->header[141]==1))) { - fdi_free(fdi); - return NULL; - } - - fdi->mfmsync_buffer = fdi_malloc (MAX_MFM_SYNC_BUFFER * sizeof(int)); - fdi->track_src_buffer = fdi_malloc (MAX_SRC_BUFFER); - fdi->track_dst_buffer = fdi_malloc (MAX_DST_BUFFER); - fdi->track_dst_buffer_timing = fdi_malloc (MAX_TIMING_BUFFER); - - fdi->last_track = ((fdi->header[142] << 8) + fdi->header[143]) + 1; - fdi->last_track *= fdi->header[144] + 1; - if (fdi->last_track > MAX_TRACKS) - fdi->last_track = MAX_TRACKS; - fdi->last_head = fdi->header[144]; - fdi->disk_type = fdi->header[145]; - fdi->rotation_speed = fdi->header[146] + 128; - fdi->write_protect = fdi->header[147] & 1; - outlog ("FDI version %d.%d\n", fdi->header[140], fdi->header[141]); - outlog ("last_track=%d rotation_speed=%d\n",fdi->last_track,fdi->rotation_speed); - - offset = 512; - i = fdi->last_track; - if (i > 180) { - offset += 512; - i -= 180; - while (i > 256) { - offset += 512; - i -= 256; - } - } - for (i = 0; i < fdi->last_track; i++) { - fdi->track_offsets[i] = offset; - type = fdi->header[152 + i * 2]; - size = fdi->header[152 + i * 2 + 1]; - if (type == 1) - offset += (size & 15) * 512; - else if ((type & 0xc0) == 0x80) - offset += (((type & 0x3f) << 8) | size) * 256; - else - offset += size * 256; - } - fdi->track_offsets[i] = offset; - - return fdi; -} - - -int fdi2raw_loadrevolution_2 (FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, int *tracklength, int *indexoffsetp, int *multirev, int mfm) -{ - struct fdi_cache *cache = &fdi->cache[track]; - int len, i, idx; - - memset (fdi->track_dst_buffer, 0, MAX_DST_BUFFER); - idx = cache->indexoffset; - fdi2_decode (fdi, cache->totalavg, - cache->avgp, cache->minp, cache->maxp, cache->idxp, - cache->maxidx, &idx, cache->pulses, mfm); - //fdi2_gcr_decode (fdi, totalavg, avgp, minp, maxp, idxp, idx_off1, idx_off2, idx_off3, maxidx, pulses); - outlog("track %d: nbits=%d avg len=%.2f weakbits=%d idx=%d\n", - track, bitoffset, (double)cache->totalavg / bitoffset, cache->weakbits, cache->indexoffset); - len = fdi->out; - if (cache->weakbits >= 10 && multirev) - *multirev = 1; - *tracklength = len; - - for (i = 0; i < (len + 15) / (2 * 8); i++) { - uae_u8 *data = fdi->track_dst_buffer + i * 2; - *mfmbuf++ = 256 * *data + *(data + 1); - } - fdi2_celltiming (fdi, cache->totalavg, len, tracktiming); - if (indexoffsetp) - *indexoffsetp = idx; - return 1; -} - -int fdi2raw_loadrevolution (FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, int *tracklength, int mfm) -{ - return fdi2raw_loadrevolution_2 (fdi, mfmbuf, tracktiming, track, tracklength, 0, 0, mfm); -} - -int fdi2raw_loadtrack (FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, int *tracklength, int *indexoffsetp, int *multirev, int mfm) -{ - uae_u8 *p; - int outlen, i; - struct fdi_cache *cache = &fdi->cache[track]; - - if (cache->lowlevel) - return fdi2raw_loadrevolution_2 (fdi, mfmbuf, tracktiming, track, tracklength, indexoffsetp, multirev, mfm); - - fdi->err = 0; - fdi->track_src_len = fdi->track_offsets[track + 1] - fdi->track_offsets[track]; - fseek (fdi->file, fdi->track_offsets[track], SEEK_SET); - fread (fdi->track_src_buffer, fdi->track_src_len, 1, fdi->file); - memset (fdi->track_dst_buffer, 0, MAX_DST_BUFFER); - fdi->track_dst_buffer_timing[0] = 0; - - fdi->current_track = track; - fdi->track_src = fdi->track_src_buffer; - fdi->track_dst = fdi->track_dst_buffer; - p = fdi->header + 152 + fdi->current_track * 2; - fdi->track_type = *p++; - fdi->track_len = *p++; - fdi->bit_rate = 0; - fdi->out = 0; - fdi->mfmsync_offset = 0; - - if ((fdi->track_type & 0xf0) == 0xf0 || (fdi->track_type & 0xf0) == 0xe0) - fdi->bit_rate = bit_rate_table[fdi->track_type & 0x0f]; - else - fdi->bit_rate = 250; - - outlog ("track %d: srclen: %d track_type: %02.2X, bitrate: %d\n", - fdi->current_track, fdi->track_src_len, fdi->track_type, fdi->bit_rate); - - if ((fdi->track_type & 0xc0) == 0x80) { - - outlen = decode_lowlevel_track (fdi, track, cache); - - } else if ((fdi->track_type & 0xf0) == 0xf0) { - - outlen = decode_raw_track (fdi); - - } else if ((fdi->track_type & 0xf0) == 0xe0) { - - outlen = handle_sectors_described_track (fdi); - - } else if ((fdi->track_type & 0xf0)) { - - zxx (fdi); - outlen = -1; - - } else if (fdi->track_type < 0x10) { - - decode_normal_track[fdi->track_type](fdi); - fix_mfm_sync (fdi); - outlen = fdi->out; - - } else { - - zxx (fdi); - outlen = -1; - - } - -// amiga_check_track (fdi); - - if (fdi->err) - return 0; - - if (outlen > 0) { - if (cache->lowlevel) - return fdi2raw_loadrevolution_2 (fdi, mfmbuf, tracktiming, track, tracklength, indexoffsetp, multirev, mfm); - *tracklength = fdi->out; - for (i = 0; i < ((*tracklength) + 15) / (2 * 8); i++) { - uae_u8 *data = fdi->track_dst_buffer + i * 2; - *mfmbuf++ = 256 * *data + *(data + 1); - } - } - return outlen; -} - +/* + + FDI to raw bit stream converter + Copyright (c) 2001 by Toni Wilen + FDI 2.0 support + Copyright (c) 2003-2004 by Toni Wilen + and Vincent Joguin + + FDI format created by Vincent "ApH" Joguin + + Tiny changes - function type fixes, multiple drives, addition of + get_last_head and C++ callability - by Thomas Harte, 2001, + T.Harte@excite.co.uk + + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public 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 STATIC_INLINE +#include +#include +#include +#include + +/* IF UAE */ +/*#include "sysconfig.h" +#include "sysdeps.h" +#include "zfile.h"*/ +/* ELSE */ +//#include "types.h" +#define xmalloc malloc +#include "fdi2raw.h" + +#include "b-em.h" + +#undef DEBUG +#define VERBOSE +#undef VERBOSE + +#include + +#ifdef DEBUG +static char *datalog(uae_u8 *src, int len) +{ + static char buf[1000]; + static int offset; + int i = 0, offset2; + + offset2 = offset; + buf[offset++]='\''; + while(len--) { + sprintf (buf + offset, "%02.2X", src[i]); + offset += 2; + i++; + if (i > 10) break; + } + buf[offset++]='\''; + buf[offset++] = 0; + if (offset >= 900) offset = 0; + return buf + offset2; +} +#else +static char *datalog(uae_u8 *src, int len) { return ""; } +#endif + +#define outlog rpclog +#define debuglog rpclog + +static int fdi_allocated; +#ifdef DEBUG +static void fdi_free (void *p) +{ + int size; + if (!p) + return; + size = ((int*)p)[-1]; + fdi_allocated -= size; + write_log ("%d freed (%d)\n", size, fdi_allocated); + free ((int*)p - 1); +} +static void *fdi_malloc (int size) +{ + void *p = xmalloc (size + sizeof (int)); + ((int*)p)[0] = size; + fdi_allocated += size; + write_log ("%d allocated (%d)\n", size, fdi_allocated); + return (int*)p + 1; +} +#else +#define fdi_free free +#define fdi_malloc xmalloc +#endif + +#define MAX_SRC_BUFFER 4194304 +#define MAX_DST_BUFFER 40000 +#define MAX_MFM_SYNC_BUFFER 60000 +#define MAX_TIMING_BUFFER 400000 +#define MAX_TRACKS 166 + +struct fdi_cache { + uae_u32 *avgp, *minp, *maxp; + uae_u8 *idxp; + int avg_free, idx_free, min_free, max_free; + uae_u32 totalavg, pulses, maxidx, indexoffset; + int weakbits; + int lowlevel; +}; + +struct fdi { + uae_u8 *track_src_buffer; + uae_u8 *track_src; + int track_src_len; + uae_u8 *track_dst_buffer; + uae_u8 *track_dst; + uae_u16 *track_dst_buffer_timing; + uae_u8 track_len; + uae_u8 track_type; + int current_track; + int last_track; + int last_head; + int rotation_speed; + int bit_rate; + int disk_type; + int write_protect; + int err; + uae_u8 header[2048]; + int track_offsets[MAX_TRACKS]; + FILE *file; + int out; + int mfmsync_offset; + int *mfmsync_buffer; + /* sector described only */ + int index_offset; + int encoding_type; + /* bit handling */ + int nextdrop; + struct fdi_cache cache[MAX_TRACKS]; +}; + +#define get_u32(x) ((((x)[0])<<24)|(((x)[1])<<16)|(((x)[2])<<8)|((x)[3])) +#define get_u24(x) ((((x)[0])<<16)|(((x)[1])<<8)|((x)[2])) +STATIC_INLINE void put_u32 (uae_u8 *d, uae_u32 v) +{ + d[0] = v >> 24; + d[1] = v >> 16; + d[2] = v >> 8; + d[3] = v; +} + +struct node { + uae_u16 v; + struct node *left; + struct node *right; +}; +typedef struct node NODE; + +static uae_u8 temp, temp2; + +static uae_u8 *expand_tree (uae_u8 *stream, NODE *node) +{ + if (temp & temp2) { + fdi_free (node->left); + node->left = 0; + fdi_free (node->right); + node->right = 0; + temp2 >>= 1; + if (!temp2) { + temp = *stream++; + temp2 = 0x80; + } + return stream; + } else { + uae_u8 *stream_temp; + temp2 >>= 1; + if (!temp2) { + temp = *stream++; + temp2 = 0x80; + } + node->left = fdi_malloc (sizeof (NODE)); + memset (node->left, 0, sizeof (NODE)); + stream_temp = expand_tree (stream, node->left); + node->right = fdi_malloc (sizeof (NODE)); + memset (node->right, 0, sizeof (NODE)); + return expand_tree (stream_temp, node->right); + } +} + +static uae_u8 *values_tree8 (uae_u8 *stream, NODE *node) +{ + if (node->left == 0) { + node->v = *stream++; + return stream; + } else { + uae_u8 *stream_temp = values_tree8 (stream, node->left); + return values_tree8 (stream_temp, node->right); + } +} + +static uae_u8 *values_tree16 (uae_u8 *stream, NODE *node) +{ + if (node->left == 0) { + uae_u16 high_8_bits = (*stream++) << 8; + node->v = high_8_bits | (*stream++); + return stream; + } else { + uae_u8 *stream_temp = values_tree16 (stream, node->left); + return values_tree16 (stream_temp, node->right); + } +} + +static void free_nodes (NODE *node) +{ + if (node) { + free_nodes (node->left); + free_nodes (node->right); + fdi_free (node); + } +} + +static uae_u32 sign_extend16 (uae_u32 v) +{ + if (v & 0x8000) + v |= 0xffff0000; + return v; +} + +static uae_u32 sign_extend8 (uae_u32 v) +{ + if (v & 0x80) + v |= 0xffffff00; + return v; +} + +static void fdi_decode (uae_u8 *stream, int size, uae_u8 *out) +{ + int i; + uae_u8 sign_extend, sixteen_bit, sub_stream_shift; + NODE root; + NODE *current_node; + + memset (out, 0, size * 4); + sub_stream_shift = 1; + while (sub_stream_shift) { + + //sub-stream header decode + sign_extend = *stream++; + sub_stream_shift = sign_extend & 0x7f; + sign_extend &= 0x80; + sixteen_bit = (*stream++) & 0x80; + + //huffman tree architecture decode + temp = *stream++; + temp2 = 0x80; + stream = expand_tree (stream, &root); + if (temp2 == 0x80) + stream--; + + //huffman output values decode + if (sixteen_bit) + stream = values_tree16 (stream, &root); + else + stream = values_tree8 (stream, &root); + + //sub-stream data decode + temp2 = 0; + for (i = 0; i < size; i++) { + uae_u32 v; + uae_u8 decode = 1; + current_node = &root; + while (decode) { + if (current_node->left == 0) { + decode = 0; + } else { + temp2 >>= 1; + if (!temp2) { + temp2 = 0x80; + temp = *stream++; + } + if (temp & temp2) + current_node = current_node->right; + else + current_node = current_node->left; + } + } + v = ((uae_u32*)out)[i]; + if (sign_extend) { + if (sixteen_bit) + v |= sign_extend16 (current_node->v) << sub_stream_shift; + else + v |= sign_extend8 (current_node->v) << sub_stream_shift; + } else { + v |= current_node->v << sub_stream_shift; + } + ((uae_u32*)out)[i] = v; + } + free_nodes (root.left); + free_nodes (root.right); + } +} + + +static int decode_raw_track (FDI *fdi) +{ + int size = get_u32(fdi->track_src); + memcpy (fdi->track_dst, fdi->track_src, (size + 7) >> 3); + fdi->track_src += (size + 7) >> 3; + return size; +} + +/* unknown track */ +static void zxx (FDI *fdi) +{ + outlog ("track %d: unknown track type 0x%02.2X\n", fdi->current_track, fdi->track_type); +// return -1; +} +/* unsupported track */ +#if 0 +static void zyy (FDI *fdi) +{ + outlog ("track %d: unsupported track type 0x%02.2X\n", fdi->current_track, fdi->track_type); +// return -1; +} +#endif +/* empty track */ +static void track_empty (FDI *fdi) +{ +// return 0; +} + +/* unknown sector described type */ +static void dxx (FDI *fdi) +{ + outlog ("\ntrack %d: unknown sector described type 0x%02.2X\n", fdi->current_track, fdi->track_type); + fdi->err = 1; +} +/* unsupported sector described type */ +#if 0 +static void dyy (FDI *fdi) +{ + outlog ("\ntrack %d: unsupported sector described 0x%02.2X\n", fdi->current_track, fdi->track_type); + fdi->err = 1; +} +#endif +/* add position of mfm sync bit */ +static void add_mfm_sync_bit (FDI *fdi) +{ + if (fdi->nextdrop) { + fdi->nextdrop = 0; + return; + } + fdi->mfmsync_buffer[fdi->mfmsync_offset++] = fdi->out; + if (fdi->out == 0) { + outlog ("illegal position for mfm sync bit, offset=%d\n",fdi->out); + fdi->err = 1; + } + if (fdi->mfmsync_offset >= MAX_MFM_SYNC_BUFFER) { + fdi->mfmsync_offset = 0; + outlog ("mfmsync buffer overflow\n"); + fdi->err = 1; + } + fdi->out++; +} + +#define BIT_BYTEOFFSET ((fdi->out) >> 3) +#define BIT_BITOFFSET (7-((fdi->out)&7)) + +/* add one bit */ +static void bit_add (FDI *fdi, int bit) +{ + if (fdi->nextdrop) { + fdi->nextdrop = 0; + return; + } + fdi->track_dst[BIT_BYTEOFFSET] &= ~(1 << BIT_BITOFFSET); + if (bit) + fdi->track_dst[BIT_BYTEOFFSET] |= (1 << BIT_BITOFFSET); + fdi->out++; + if (fdi->out >= MAX_DST_BUFFER * 8) { + outlog ("destination buffer overflow\n"); + fdi->err = 1; + fdi->out = 1; + } +} +/* add bit and mfm sync bit */ +static void bit_mfm_add (FDI *fdi, int bit) +{ + add_mfm_sync_bit (fdi); + bit_add (fdi, bit); +} +/* remove following bit */ +static void bit_drop_next (FDI *fdi) +{ + if (fdi->nextdrop > 0) { + outlog("multiple bit_drop_next() called"); + } else if (fdi->nextdrop < 0) { + fdi->nextdrop = 0; + debuglog(":DNN:"); + return; + } + debuglog(":DN:"); + fdi->nextdrop = 1; +} + +/* ignore next bit_drop_next() */ +static void bit_dedrop (FDI *fdi) +{ + if (fdi->nextdrop) { + outlog("bit_drop_next called before bit_dedrop"); + } + fdi->nextdrop = -1; + debuglog(":BDD:"); +} + +/* add one byte */ +static void byte_add (FDI *fdi, uae_u8 v) +{ + int i; + for (i = 7; i >= 0; i--) + bit_add (fdi, v & (1 << i)); +} +/* add one word */ +static void word_add (FDI *fdi, uae_u16 v) +{ + byte_add (fdi, (uae_u8)(v >> 8)); + byte_add (fdi, (uae_u8)v); +} +/* add one byte and mfm encode it */ +static void byte_mfm_add (FDI *fdi, uae_u8 v) +{ + int i; + for (i = 7; i >= 0; i--) + bit_mfm_add (fdi, v & (1 << i)); +} +/* add multiple bytes and mfm encode them */ +static void bytes_mfm_add (FDI *fdi, uae_u8 v, int len) +{ + int i; + for (i = 0; i < len; i++) byte_mfm_add (fdi, v); +} +/* add one mfm encoded word and re-mfm encode it */ +static void word_post_mfm_add (FDI *fdi, uae_u16 v) +{ + int i; + for (i = 14; i >= 0; i -= 2) + bit_mfm_add (fdi, v & (1 << i)); +} + +/* bit 0 */ +static void s00(FDI *fdi) { bit_add (fdi, 0); } +/* bit 1*/ +static void s01(FDI *fdi) { bit_add (fdi, 1); } +/* 4489 */ +static void s02(FDI *fdi) { word_add (fdi, 0x4489); } +/* 5224 */ +static void s03(FDI *fdi) { word_add (fdi, 0x5224); } +/* mfm sync bit */ +static void s04(FDI *fdi) { add_mfm_sync_bit (fdi); } +/* RLE MFM-encoded data */ +static void s08(FDI *fdi) +{ + int bytes = *fdi->track_src++; + uae_u8 byte = *fdi->track_src++; + if (bytes == 0) bytes = 256; + debuglog ("s08:len=%d,data=%02.2X",bytes,byte); + while(bytes--) byte_add (fdi, byte); +} +/* RLE MFM-decoded data */ +static void s09(FDI *fdi) +{ + int bytes = *fdi->track_src++; + uae_u8 byte = *fdi->track_src++; + if (bytes == 0) bytes = 256; + bit_drop_next (fdi); + debuglog ("s09:len=%d,data=%02.2X",bytes,byte); + while(bytes--) byte_mfm_add (fdi, byte); +} +/* MFM-encoded data */ +static void s0a(FDI *fdi) +{ + int i, bits = (fdi->track_src[0] << 8) | fdi->track_src[1]; + uae_u8 b; + fdi->track_src += 2; + debuglog ("s0a:bits=%d,data=%s", bits, datalog(fdi->track_src, (bits + 7) / 8)); + while (bits >= 8) { + byte_add (fdi, *fdi->track_src++); + bits -= 8; + } + if (bits > 0) { + i = 7; + b = *fdi->track_src++; + while (bits--) { + bit_add (fdi, b & (1 << i)); + i--; + } + } +} +/* MFM-encoded data */ +static void s0b(FDI *fdi) +{ + int i, bits = ((fdi->track_src[0] << 8) | fdi->track_src[1]) + 65536; + uae_u8 b; + fdi->track_src += 2; + debuglog ("s0b:bits=%d,data=%s", bits, datalog(fdi->track_src, (bits + 7) / 8)); + while (bits >= 8) { + byte_add (fdi, *fdi->track_src++); + bits -= 8; + } + if (bits > 0) { + i = 7; + b = *fdi->track_src++; + while (bits--) { + bit_add (fdi, b & (1 << i)); + i--; + } + } +} +/* MFM-decoded data */ +static void s0c(FDI *fdi) +{ + int i, bits = (fdi->track_src[0] << 8) | fdi->track_src[1]; + uae_u8 b; + fdi->track_src += 2; + bit_drop_next (fdi); + debuglog ("s0c:bits=%d,data=%s", bits, datalog(fdi->track_src, (bits + 7) / 8)); + while (bits >= 8) { + byte_mfm_add (fdi, *fdi->track_src++); + bits -= 8; + } + if (bits > 0) { + i = 7; + b = *fdi->track_src++; + while(bits--) { + bit_mfm_add (fdi, b & (1 << i)); + i--; + } + } +} +/* MFM-decoded data */ +static void s0d(FDI *fdi) +{ + int i, bits = ((fdi->track_src[0] << 8) | fdi->track_src[1]) + 65536; + uae_u8 b; + fdi->track_src += 2; + bit_drop_next (fdi); + debuglog ("s0d:bits=%d,data=%s", bits, datalog(fdi->track_src, (bits + 7) / 8)); + while (bits >= 8) { + byte_mfm_add (fdi, *fdi->track_src++); + bits -= 8; + } + if (bits > 0) { + i = 7; + b = *fdi->track_src++; + while(bits--) { + bit_mfm_add (fdi, b & (1 << i)); + i--; + } + } +} + +/* ***** */ +/* AMIGA */ +/* ***** */ + +/* just for testing integrity of Amiga sectors */ + +/*static void rotateonebit (uae_u8 *start, uae_u8 *end, int shift) +{ + if (shift == 0) + return; + while (start <= end) { + start[0] <<= shift; + start[0] |= start[1] >> (8 - shift); + start++; + } +}*/ + +//static int check_offset; +/*static uae_u16 getmfmword (uae_u8 *mbuf) +{ + uae_u32 v; + + v = (mbuf[0] << 8) | (mbuf[1] << 0); + if (check_offset == 0) + return v; + v <<= 8; + v |= mbuf[2]; + v >>= check_offset; + return v; +}*/ + +#define MFMMASK 0x55555555 +/*static uae_u32 getmfmlong (uae_u8 * mbuf) +{ + return ((getmfmword (mbuf) << 16) | getmfmword (mbuf + 2)) & MFMMASK; +}*/ + +#if 0 +static int amiga_check_track (FDI *fdi) +{ + int i, j, secwritten = 0; + int fwlen = fdi->out / 8; + int length = 2 * fwlen; + int drvsec = 11; + uae_u32 odd, even, chksum, id, dlong; + uae_u8 *secdata; + uae_u8 secbuf[544]; + uae_u8 bigmfmbuf[60000]; + uae_u8 *mbuf, *mbuf2, *mend; + char sectable[22]; + uae_u8 *raw = fdi->track_dst_buffer; + int slabel, off; + int ok = 1; + + memset (bigmfmbuf, 0, sizeof (bigmfmbuf)); + mbuf = bigmfmbuf; + check_offset = 0; + for (i = 0; i < (fdi->out + 7) / 8; i++) + *mbuf++ = raw[i]; + off = fdi->out & 7; +#if 1 + if (off > 0) { + mbuf--; + *mbuf &= ~((1 << (8 - off)) - 1); + } + j = 0; + while (i < (fdi->out + 7) / 8 + 600) { + *mbuf++ |= (raw[j] >> off) | ((raw[j + 1]) << (8 - off)); + j++; + i++; + } +#endif + mbuf = bigmfmbuf; + + memset (sectable, 0, sizeof (sectable)); + //memcpy (mbuf + fwlen, mbuf, fwlen * sizeof (uae_u16)); + mend = bigmfmbuf + length; + mend -= (4 + 16 + 8 + 512); + + while (secwritten < drvsec) { + int trackoffs; + + for (;;) { + rotateonebit (bigmfmbuf, mend, 1); + if (getmfmword (mbuf) == 0) + break; + if (secwritten == 10) { + mbuf[0] = 0x44; + mbuf[1] = 0x89; + } +// check_offset++; + if (check_offset > 7) { + check_offset = 0; + mbuf++; + if (mbuf >= mend || *mbuf == 0) + break; + } + if (getmfmword (mbuf) == 0x4489) + break; + } + if (mbuf >= mend || *mbuf == 0) + break; + + rotateonebit (bigmfmbuf, mend, check_offset); + check_offset = 0; + + while (getmfmword (mbuf) == 0x4489) + mbuf+= 1 * 2; + mbuf2 = mbuf + 8; + + odd = getmfmlong (mbuf); + even = getmfmlong (mbuf + 2 * 2); + mbuf += 4 * 2; + id = (odd << 1) | even; + + trackoffs = (id & 0xff00) >> 8; + if (trackoffs + 1 > drvsec) { + outlog("illegal sector offset %d\n",trackoffs); + ok = 0; + mbuf = mbuf2; + continue; + } + if ((id >> 24) != 0xff) { + outlog ("sector %d format type %02.2X?\n", trackoffs, id >> 24); + ok = 0; + } + chksum = odd ^ even; + slabel = 0; + for (i = 0; i < 4; i++) { + odd = getmfmlong (mbuf); + even = getmfmlong (mbuf + 8 * 2); + mbuf += 2* 2; + + dlong = (odd << 1) | even; + if (dlong) slabel = 1; + chksum ^= odd ^ even; + } + mbuf += 8 * 2; + odd = getmfmlong (mbuf); + even = getmfmlong (mbuf + 2 * 2); + mbuf += 4 * 2; + if (((odd << 1) | even) != chksum) { + outlog("sector %d header crc error\n", trackoffs); + ok = 0; + mbuf = mbuf2; + continue; + } + outlog("sector %d header crc ok\n", trackoffs); + if (((id & 0x00ff0000) >> 16) != (uae_u32)fdi->current_track) { + outlog("illegal track number %d <> %d\n",fdi->current_track,(id & 0x00ff0000) >> 16); + ok++; + mbuf = mbuf2; + continue; + } + odd = getmfmlong (mbuf); + even = getmfmlong (mbuf + 2 * 2); + mbuf += 4 * 2; + chksum = (odd << 1) | even; + secdata = secbuf + 32; + for (i = 0; i < 128; i++) { + odd = getmfmlong (mbuf); + even = getmfmlong (mbuf + 256 * 2); + mbuf += 2 * 2; + dlong = (odd << 1) | even; + *secdata++ = (uae_u8) (dlong >> 24); + *secdata++ = (uae_u8) (dlong >> 16); + *secdata++ = (uae_u8) (dlong >> 8); + *secdata++ = (uae_u8) dlong; + chksum ^= odd ^ even; + } + mbuf += 256 * 2; + if (chksum) { + outlog("sector %d data checksum error\n",trackoffs); + ok = 0; + } else if (sectable[trackoffs]) { + outlog("sector %d already found?\n", trackoffs); + mbuf = mbuf2; + } else { + outlog("sector %d ok\n",trackoffs); + if (slabel) outlog("(non-empty sector header)\n"); + sectable[trackoffs] = 1; + secwritten++; + if (trackoffs == 9) + mbuf += 0x228; + } + } + for (i = 0; i < drvsec; i++) { + if (!sectable[i]) { + outlog ("sector %d missing\n", i); + ok = 0; + } + } + return ok; +} +#endif + +static void amiga_data_raw (FDI *fdi, uae_u8 *secbuf, uae_u8 *crc, int len) +{ + int i; + uae_u8 crcbuf[4]; + + if (!crc) { + memset (crcbuf, 0, 4); + } else { + memcpy (crcbuf, crc ,4); + } + for (i = 0; i < 4; i++) + byte_mfm_add (fdi, crcbuf[i]); + for (i = 0; i < len; i++) + byte_mfm_add (fdi, secbuf[i]); +} + +static void amiga_data (FDI *fdi, uae_u8 *secbuf) +{ + uae_u16 mfmbuf[4 + 512]; + uae_u32 dodd, deven, dck; + int i; + + for (i = 0; i < 512; i += 4) { + deven = ((secbuf[i + 0] << 24) | (secbuf[i + 1] << 16) + | (secbuf[i + 2] << 8) | (secbuf[i + 3])); + dodd = deven >> 1; + deven &= 0x55555555; + dodd &= 0x55555555; + mfmbuf[(i >> 1) + 4] = (uae_u16) (dodd >> 16); + mfmbuf[(i >> 1) + 5] = (uae_u16) dodd; + mfmbuf[(i >> 1) + 256 + 4] = (uae_u16) (deven >> 16); + mfmbuf[(i >> 1) + 256 + 5] = (uae_u16) deven; + } + dck = 0; + for (i = 4; i < 4 + 512; i += 2) + dck ^= (mfmbuf[i] << 16) | mfmbuf[i + 1]; + deven = dodd = dck; + dodd >>= 1; + deven &= 0x55555555; + dodd &= 0x55555555; + mfmbuf[0] = (uae_u16) (dodd >> 16); + mfmbuf[1] = (uae_u16) dodd; + mfmbuf[2] = (uae_u16) (deven >> 16); + mfmbuf[3] = (uae_u16) deven; + + for (i = 0; i < 4 + 512; i ++) + word_post_mfm_add (fdi, mfmbuf[i]); +} + +static void amiga_sector_header (FDI *fdi, uae_u8 *header, uae_u8 *data, int sector, int untilgap) +{ + uae_u8 headerbuf[4], databuf[16]; + uae_u32 deven, dodd, hck; + uae_u16 mfmbuf[24]; + int i; + + byte_mfm_add (fdi, 0); + byte_mfm_add (fdi, 0); + word_add (fdi, 0x4489); + word_add (fdi, 0x4489); + if (header) { + memcpy (headerbuf, header, 4); + } else { + headerbuf[0] = 0xff; + headerbuf[1] = (uae_u8)fdi->current_track; + headerbuf[2] = (uae_u8)sector; + headerbuf[3] = (uae_u8)untilgap; + } + if (data) + memcpy (databuf, data, 16); + else + memset (databuf, 0, 16); + + deven = ((headerbuf[0] << 24) | (headerbuf[1] << 16) + | (headerbuf[2] << 8) | (headerbuf[3])); + dodd = deven >> 1; + deven &= 0x55555555; + dodd &= 0x55555555; + mfmbuf[0] = (uae_u16) (dodd >> 16); + mfmbuf[1] = (uae_u16) dodd; + mfmbuf[2] = (uae_u16) (deven >> 16); + mfmbuf[3] = (uae_u16) deven; + for (i = 0; i < 16; i += 4) { + deven = ((databuf[i] << 24) | (databuf[i + 1] << 16) + | (databuf[i + 2] << 8) | (databuf[i + 3])); + dodd = deven >> 1; + deven &= 0x55555555; + dodd &= 0x55555555; + mfmbuf[(i >> 1) + 0 + 4] = (uae_u16) (dodd >> 16); + mfmbuf[(i >> 1) + 0 + 5] = (uae_u16) dodd; + mfmbuf[(i >> 1) + 8 + 4] = (uae_u16) (deven >> 16); + mfmbuf[(i >> 1) + 8 + 5] = (uae_u16) deven; + } + hck = 0; + for (i = 0; i < 4 + 16; i += 2) + hck ^= (mfmbuf[i] << 16) | mfmbuf[i + 1]; + deven = dodd = hck; + dodd >>= 1; + deven &= 0x55555555; + dodd &= 0x55555555; + mfmbuf[20] = (uae_u16) (dodd >> 16); + mfmbuf[21] = (uae_u16) dodd; + mfmbuf[22] = (uae_u16) (deven >> 16); + mfmbuf[23] = (uae_u16) deven; + + for (i = 0; i < 4 + 16 + 4; i ++) + word_post_mfm_add (fdi, mfmbuf[i]); +} + +/* standard super-extended Amiga sector header */ +static void s20(FDI *fdi) +{ + bit_drop_next (fdi); + debuglog ("s20:header=%s,data=%s", datalog(fdi->track_src, 4), datalog(fdi->track_src + 4, 16)); + amiga_sector_header (fdi, fdi->track_src, fdi->track_src + 4, 0, 0); + fdi->track_src += 4 + 16; +} +/* standard extended Amiga sector header */ +static void s21(FDI *fdi) +{ + bit_drop_next (fdi); + debuglog ("s21:header=%s", datalog(fdi->track_src, 4)); + amiga_sector_header (fdi, fdi->track_src, 0, 0, 0); + fdi->track_src += 4; +} +/* standard Amiga sector header */ +static void s22(FDI *fdi) +{ + bit_drop_next (fdi); + debuglog("s22:sector=%d,untilgap=%d", fdi->track_src[0], fdi->track_src[1]); + amiga_sector_header (fdi, 0, 0, fdi->track_src[0], fdi->track_src[1]); + fdi->track_src += 2; +} +/* standard 512-byte, CRC-correct Amiga data */ +static void s23(FDI *fdi) +{ + debuglog("s23:data=%s", datalog (fdi->track_src, 512)); + amiga_data (fdi, fdi->track_src); + fdi->track_src += 512; +} +/* not-decoded, 128*2^x-byte, CRC-correct Amiga data */ +static void s24(FDI *fdi) +{ + int shift = *fdi->track_src++; + debuglog("s24:shift=%d,data=%s", shift, datalog (fdi->track_src, 128 << shift)); + amiga_data_raw (fdi, fdi->track_src, 0, 128 << shift); + fdi->track_src += 128 << shift; +} +/* not-decoded, 128*2^x-byte, CRC-incorrect Amiga data */ +static void s25(FDI *fdi) +{ + int shift = *fdi->track_src++; + debuglog("s25:shift=%d,crc=%s,data=%s", shift, datalog (fdi->track_src, 4), datalog (fdi->track_src + 4, 128 << shift)); + amiga_data_raw (fdi, fdi->track_src + 4, fdi->track_src, 128 << shift); + fdi->track_src += 4 + (128 << shift); +} +/* standard extended Amiga sector */ +static void s26(FDI *fdi) +{ + s21 (fdi); + debuglog("s26:data=%s", datalog (fdi->track_src, 512)); + amiga_data (fdi, fdi->track_src); + fdi->track_src += 512; +} +/* standard short Amiga sector */ +static void s27(FDI *fdi) +{ + s22 (fdi); + debuglog("s27:data=%s", datalog (fdi->track_src, 512)); + amiga_data (fdi, fdi->track_src); + fdi->track_src += 512; +} + +/* *** */ +/* IBM */ +/* *** */ + +static uae_u16 ibm_crc (uae_u8 byte, int reset) +{ + static uae_u16 crc; + int i; + + if (reset) crc = 0xcdb4; + for (i = 0; i < 8; i++) { + if (crc & 0x8000) { + crc <<= 1; + if (!(byte & 0x80)) crc ^= 0x1021; + } else { + crc <<= 1; + if (byte & 0x80) crc ^= 0x1021; + } + byte <<= 1; + } + return crc; +} + +static void ibm_data (FDI *fdi, uae_u8 *data, uae_u8 *crc, int len) +{ + int i; + uae_u8 crcbuf[2]; + uae_u16 crcv = 0; + + word_add (fdi, 0x4489); + word_add (fdi, 0x4489); + word_add (fdi, 0x4489); + byte_mfm_add (fdi, 0xfb); + ibm_crc (0xfb, 1); + for (i = 0; i < len; i++) { + byte_mfm_add (fdi, data[i]); + crcv = ibm_crc (data[i], 0); + } + if (!crc) { + crc = crcbuf; + crc[0] = (uae_u8)(crcv >> 8); + crc[1] = (uae_u8)crcv; + } + byte_mfm_add (fdi, crc[0]); + byte_mfm_add (fdi, crc[1]); +} + +static void ibm_sector_header (FDI *fdi, uae_u8 *data, uae_u8 *crc, int secnum, int pre) +{ + uae_u8 secbuf[5]; + uae_u8 crcbuf[2]; + uae_u16 crcv; + int i; + + if (pre) + bytes_mfm_add (fdi, 0, 12); + word_add (fdi, 0x4489); + word_add (fdi, 0x4489); + word_add (fdi, 0x4489); + secbuf[0] = 0xfe; + if (secnum >= 0) { + secbuf[1] = (uae_u8)(fdi->current_track/2); + secbuf[2] = (uae_u8)(fdi->current_track%2); + secbuf[3] = (uae_u8)secnum; + secbuf[4] = 2; + } else { + memcpy (secbuf + 1, data, 4); + } + ibm_crc (secbuf[0], 1); + ibm_crc (secbuf[1], 0); + ibm_crc (secbuf[2], 0); + ibm_crc (secbuf[3], 0); + crcv = ibm_crc (secbuf[4], 0); + if (crc) { + memcpy (crcbuf, crc, 2); + } else { + crcbuf[0] = (uae_u8)(crcv >> 8); + crcbuf[1] = (uae_u8)crcv; + } + /* data */ + for (i = 0;i < 5; i++) + byte_mfm_add (fdi, secbuf[i]); + /* crc */ + byte_mfm_add (fdi, crcbuf[0]); + byte_mfm_add (fdi, crcbuf[1]); +} + +/* standard IBM index address mark */ +static void s10(FDI *fdi) +{ + bit_drop_next (fdi); + bytes_mfm_add (fdi, 0, 12); + word_add (fdi, 0x5224); + word_add (fdi, 0x5224); + word_add (fdi, 0x5224); + byte_mfm_add (fdi, 0xfc); +} +/* standard IBM pre-gap */ +static void s11(FDI *fdi) +{ + bit_drop_next (fdi); + bytes_mfm_add (fdi, 0x4e, 78); + bit_dedrop (fdi); + s10 (fdi); + bytes_mfm_add (fdi, 0x4e, 50); +} +/* standard ST pre-gap */ +static void s12(FDI *fdi) +{ + bit_drop_next (fdi); + bytes_mfm_add (fdi, 0x4e, 78); +} +/* standard extended IBM sector header */ +static void s13(FDI *fdi) +{ + bit_drop_next (fdi); + debuglog ("s13:header=%s", datalog (fdi->track_src, 4)); + ibm_sector_header (fdi, fdi->track_src, 0, -1, 1); + fdi->track_src += 4; +} +/* standard mini-extended IBM sector header */ +static void s14(FDI *fdi) +{ + debuglog ("s14:header=%s", datalog (fdi->track_src, 4)); + ibm_sector_header (fdi, fdi->track_src, 0, -1, 0); + fdi->track_src += 4; +} +/* standard short IBM sector header */ +static void s15(FDI *fdi) +{ + bit_drop_next (fdi); + debuglog ("s15:sector=%d", *fdi->track_src); + ibm_sector_header (fdi, 0, 0, *fdi->track_src++, 1); +} +/* standard mini-short IBM sector header */ +static void s16(FDI *fdi) +{ + debuglog ("s16:track=%d", *fdi->track_src); + ibm_sector_header (fdi, 0, 0, *fdi->track_src++, 0); +} +/* standard CRC-incorrect mini-extended IBM sector header */ +static void s17(FDI *fdi) +{ + debuglog ("s17:header=%s,crc=%s", datalog (fdi->track_src, 4), datalog (fdi->track_src + 4, 2)); + ibm_sector_header (fdi, fdi->track_src, fdi->track_src + 4, -1, 0); + fdi->track_src += 4 + 2; +} +/* standard CRC-incorrect mini-short IBM sector header */ +static void s18(FDI *fdi) +{ + debuglog ("s18:sector=%d,header=%s", *fdi->track_src, datalog (fdi->track_src + 1, 4)); + ibm_sector_header (fdi, 0, fdi->track_src + 1, *fdi->track_src, 0); + fdi->track_src += 1 + 4; +} +/* standard 512-byte CRC-correct IBM data */ +static void s19(FDI *fdi) +{ + debuglog ("s19:data=%s", datalog (fdi->track_src , 512)); + ibm_data (fdi, fdi->track_src, 0, 512); + fdi->track_src += 512; +} +/* standard 128*2^x-byte-byte CRC-correct IBM data */ +static void s1a(FDI *fdi) +{ + int shift = *fdi->track_src++; + debuglog ("s1a:shift=%d,data=%s", shift, datalog (fdi->track_src , 128 << shift)); + ibm_data (fdi, fdi->track_src, 0, 128 << shift); + fdi->track_src += 128 << shift; +} +/* standard 128*2^x-byte-byte CRC-incorrect IBM data */ +static void s1b(FDI *fdi) +{ + int shift = *fdi->track_src++; + debuglog ("s1b:shift=%d,crc=%s,data=%s", shift, datalog (fdi->track_src + (128 << shift), 2), datalog (fdi->track_src , 128 << shift)); + ibm_data (fdi, fdi->track_src, fdi->track_src + (128 << shift), 128 << shift); + fdi->track_src += (128 << shift) + 2; +} +/* standard extended IBM sector */ +static void s1c(FDI *fdi) +{ + int shift = fdi->track_src[3]; + s13 (fdi); + bytes_mfm_add (fdi, 0x4e, 22); + bytes_mfm_add (fdi, 0x00, 12); + ibm_data (fdi, fdi->track_src, 0, 128 << shift); + fdi->track_src += 128 << shift; +} +/* standard short IBM sector */ +static void s1d(FDI *fdi) +{ + s15 (fdi); + bytes_mfm_add (fdi, 0x4e, 22); + bytes_mfm_add (fdi, 0x00, 12); + s19 (fdi); +} + +/* end marker */ +static void sff(FDI *fdi) +{ +} + +typedef void (*decode_described_track_func)(FDI*); + +static decode_described_track_func decode_sectors_described_track[] = +{ + s00,s01,s02,s03,s04,dxx,dxx,dxx,s08,s09,s0a,s0b,s0c,s0d,dxx,dxx, /* 00-0F */ + s10,s11,s12,s13,s14,s15,s16,s17,s18,s19,s1a,s1b,s1c,s1d,dxx,dxx, /* 10-1F */ + s20,s21,s22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track_amiga (struct fdi *fdi, int first_sector, int max_sector) +{ + int i; + + bit_add (fdi, 0); + bit_drop_next (fdi); + for (i = 0; i < max_sector; i++) { + amiga_sector_header (fdi, 0, 0, first_sector, max_sector - i); + amiga_data (fdi, fdi->track_src + first_sector * 512); + first_sector++; + if (first_sector >= max_sector) first_sector = 0; + } + bytes_mfm_add (fdi, 0, 260); /* gap */ +} +static void track_atari_st (struct fdi *fdi, int max_sector) +{ + int i, gap3 = 0; + uae_u8 *p = fdi->track_src; + + switch (max_sector) + { + case 9: + gap3 = 40; + break; + case 10: + gap3 = 24; + break; + } + s15 (fdi); + for (i = 0; i < max_sector; i++) { + byte_mfm_add (fdi, 0x4e); + byte_mfm_add (fdi, 0x4e); + ibm_sector_header (fdi, 0, 0, fdi->current_track, 1); + ibm_data (fdi, p + i * 512, 0, 512); + bytes_mfm_add (fdi, 0x4e, gap3); + } + bytes_mfm_add (fdi, 0x4e, 660 - gap3); + fdi->track_src += fdi->track_len * 256; +} +static void track_pc (struct fdi *fdi, int max_sector) +{ + int i, gap3; + uae_u8 *p = fdi->track_src; + + switch (max_sector) + { + case 8: + gap3 = 116; + break; + case 9: + gap3 = 54; + break; + default: + gap3 = 100; /* fixme */ + break; + } + s11 (fdi); + for (i = 0; i < max_sector; i++) { + byte_mfm_add (fdi, 0x4e); + byte_mfm_add (fdi, 0x4e); + ibm_sector_header (fdi, 0, 0, fdi->current_track, 1); + ibm_data (fdi, p + i * 512, 0, 512); + bytes_mfm_add (fdi, 0x4e, gap3); + } + bytes_mfm_add (fdi, 0x4e, 600 - gap3); + fdi->track_src += fdi->track_len * 256; +} + +/* amiga dd */ +static void track_amiga_dd (struct fdi *fdi) +{ + uae_u8 *p = fdi->track_src; + track_amiga (fdi, fdi->track_len >> 4, 11); + fdi->track_src = p + (fdi->track_len & 15) * 512; +} +/* amiga hd */ +static void track_amiga_hd (struct fdi *fdi) +{ + uae_u8 *p = fdi->track_src; + track_amiga (fdi, 0, 22); + fdi->track_src = p + fdi->track_len * 256; +} +/* atari st 9 sector */ +static void track_atari_st_9 (struct fdi *fdi) +{ + track_atari_st (fdi, 9); +} +/* atari st 10 sector */ +static void track_atari_st_10 (struct fdi *fdi) +{ + track_atari_st (fdi, 10); +} +/* pc 8 sector */ +static void track_pc_8 (struct fdi *fdi) +{ + track_pc (fdi, 8); +} +/* pc 9 sector */ +static void track_pc_9 (struct fdi *fdi) +{ + track_pc (fdi, 9); +} +/* pc 15 sector */ +static void track_pc_15 (struct fdi *fdi) +{ + track_pc (fdi, 15); +} +/* pc 18 sector */ +static void track_pc_18 (struct fdi *fdi) +{ + track_pc (fdi, 18); +} +/* pc 36 sector */ +static void track_pc_36 (struct fdi *fdi) +{ + track_pc (fdi, 36); +} + +typedef void (*decode_normal_track_func)(FDI*); + +static decode_normal_track_func decode_normal_track[] = +{ + track_empty, /* 0 */ + track_amiga_dd, track_amiga_hd, /* 1-2 */ + track_atari_st_9, track_atari_st_10, /* 3-4 */ + track_pc_8, track_pc_9, track_pc_15, track_pc_18, track_pc_36, /* 5-9 */ + zxx,zxx,zxx,zxx,zxx /* A-F */ +}; + +static void fix_mfm_sync (FDI *fdi) +{ + int i, pos, off1, off2, off3, mask1, mask2, mask3; + + for (i = 0; i < fdi->mfmsync_offset; i++) { + pos = fdi->mfmsync_buffer[i]; + off1 = (pos - 1) >> 3; + off2 = (pos + 1) >> 3; + off3 = pos >> 3; + mask1 = 1 << (7 - ((pos - 1) & 7)); + mask2 = 1 << (7 - ((pos + 1) & 7)); + mask3 = 1 << (7 - (pos & 7)); + if (!(fdi->track_dst[off1] & mask1) && !(fdi->track_dst[off2] & mask2)) + fdi->track_dst[off3] |= mask3; + else + fdi->track_dst[off3] &= ~mask3; + } +} + +static int handle_sectors_described_track (FDI *fdi) +{ + int oldout; + uae_u8 *start_src = fdi->track_src ; + fdi->encoding_type = *fdi->track_src++; + fdi->index_offset = get_u32(fdi->track_src); + fdi->index_offset >>= 8; + fdi->track_src += 3; + outlog ("sectors_described, index offset: %d\n",fdi->index_offset); + + do { + fdi->track_type = *fdi->track_src++; + outlog ("%06.6X %06.6X %02.2X:",fdi->track_src - start_src + 0x200, fdi->out/8, fdi->track_type); + oldout = fdi->out; + decode_sectors_described_track[fdi->track_type](fdi); + outlog(" %d\n", fdi->out - oldout); + oldout = fdi->out; + if (fdi->out < 0 || fdi->err) { + outlog ("\nin %d bytes, out %d bits\n", fdi->track_src - fdi->track_src_buffer, fdi->out); + return -1; + } + if (fdi->track_src - fdi->track_src_buffer >= fdi->track_src_len) { + outlog ("source buffer overrun, previous type: %02.2X\n", fdi->track_type); + return -1; + } + } while (fdi->track_type != 0xff); + outlog("\n"); + fix_mfm_sync (fdi); + return fdi->out; +} + +static uae_u8 *fdi_decompress (int pulses, uae_u8 *sizep, uae_u8 *src, int *dofree) +{ + uae_u32 size = get_u24 (sizep); + uae_u32 *dst2; + int len = size & 0x3fffff; + uae_u8 *dst; + int mode = size >> 22, i; + + *dofree = 0; + if (mode == 0 && pulses * 2 > len) + mode = 1; + if (mode == 0) { + dst2 = (uae_u32*)src; + dst = src; + for (i = 0; i < pulses; i++) { + *dst2++ = get_u32 (src); + src += 4; + } + } else if (mode == 1) { + dst = fdi_malloc (pulses *4); + *dofree = 1; + fdi_decode (src, pulses, dst); + } else { + dst = 0; + } + return dst; +} + +static void dumpstream(int track, uae_u8 *stream, int len) +{ +#if 0 + char name[100]; + FILE *f; + + sprintf (name, "track_%d.raw", track); + f = fopen(name, "wb"); + fwrite (stream, 1, len * 4, f); + fclose (f); +#endif +} + +static int bitoffset; + +STATIC_INLINE void addbit (uae_u8 *p, int bit) +{ + int off1 = bitoffset / 8; + int off2 = bitoffset % 8; + p[off1] |= bit << (7 - off2); + bitoffset++; +} + + +struct pulse_sample { + uint32_t size; + int number_of_bits; +}; + + +#define FDI_MAX_ARRAY 10 /* change this value as you want */ +static int pulse_limitval = 15; /* tolerance of 15% */ +static struct pulse_sample psarray[FDI_MAX_ARRAY]; +static int array_index; +static unsigned long total; +static int totaldiv; + +static void init_array(uint32_t standard_MFM_2_bit_cell_size, int nb_of_bits) +{ + int i; + + for (i = 0; i < FDI_MAX_ARRAY; i++) { + psarray[i].size = standard_MFM_2_bit_cell_size; // That is (total track length / 50000) for Amiga double density + total += psarray[i].size; + psarray[i].number_of_bits = nb_of_bits; + totaldiv += psarray[i].number_of_bits; + } + array_index = 0; +} + +#if 0 + +static void fdi2_decode (FDI *fdi, uint32_t totalavg, uae_u32 *avgp, uae_u32 *minp, uae_u32 *maxp, uae_u8 *idx, int maxidx, int *indexoffsetp, int pulses, int mfm) +{ + uint32_t adjust; + uint32_t adjusted_pulse; + uint32_t standard_MFM_2_bit_cell_size = totalavg / 50000; + uint32_t standard_MFM_8_bit_cell_size = totalavg / 12500; + int real_size, i, j, eodat, outstep; + int indexoffset = *indexoffsetp; + uae_u8 *d = fdi->track_dst_buffer; + uae_u16 *pt = fdi->track_dst_buffer_timing; + uae_u32 ref_pulse, pulse; + + /* detects a long-enough stable pulse coming just after another stable pulse */ + i = 1; + while ( (i < pulses) && ( (idx[i] < maxidx) + || (idx[i - 1] < maxidx) + || (avgp[i] < (standard_MFM_2_bit_cell_size - (standard_MFM_2_bit_cell_size / 4))) ) ) + i++; + if (i == pulses) { + outlog ("No stable and long-enough pulse in track.\n"); + return; + } + i--; + eodat = i; + adjust = 0; + total = 0; + totaldiv = 0; + init_array(standard_MFM_2_bit_cell_size, 2); + bitoffset = 0; + ref_pulse = 0; + outstep = 0; + while (outstep < 2) { + + /* calculates the current average bitrate from previous decoded data */ + uae_u32 avg_size = (total << 3) / totaldiv; /* this is the new average size for one MFM bit */ + /* uae_u32 avg_size = (uae_u32)((((float)total)*8.0) / ((float)totaldiv)); */ + /* you can try tighter ranges than 25%, or wider ranges. I would probably go for tighter... */ + if ((avg_size < (standard_MFM_8_bit_cell_size - (pulse_limitval * standard_MFM_8_bit_cell_size / 100))) || + (avg_size > (standard_MFM_8_bit_cell_size + (pulse_limitval * standard_MFM_8_bit_cell_size / 100)))) { + //init_array(standard_MFM_2_bit_cell_size, 2); + avg_size = standard_MFM_8_bit_cell_size; + } + /* this is to prevent the average value from going too far + * from the theoretical value, otherwise it could progressively go to (2 * + * real value), or (real value / 2), etc. */ + + /* gets the next long-enough pulse (this may require more than one pulse) */ + pulse = 0; + while (pulse < ((avg_size / 4) - (avg_size / 16))) { + int indx; + i++; + if (i >= pulses) + i = 0; + indx = idx[i]; + if (rand() <= (indx * RAND_MAX) / maxidx) { + pulse += avgp[i] - ref_pulse; + if (indx >= maxidx) + ref_pulse = 0; + else + ref_pulse = avgp[i]; + } + if (i == eodat) + outstep++; + if (outstep == 1 && indexoffset == i) + *indexoffsetp = bitoffset; + } + + /* gets the size in bits from the pulse width, considering the current average bitrate */ + adjusted_pulse = pulse; + real_size = 0; + while (adjusted_pulse >= avg_size) { + real_size += 4; + adjusted_pulse -= avg_size / 2; + } + adjusted_pulse <<= 3; + while (adjusted_pulse >= ((avg_size * 4) + (avg_size / 4))) { + real_size += 2; + adjusted_pulse -= avg_size * 2; + } + if (adjusted_pulse >= ((avg_size * 3) + (avg_size / 4))) { + if (adjusted_pulse <= ((avg_size * 4) - (avg_size / 4))) { + if ((2 * ((adjusted_pulse >> 2) - adjust)) <= ((2 * avg_size) - (avg_size / 4))) + real_size += 3; + else + real_size += 4; + } else + real_size += 4; + } else { + if (adjusted_pulse > ((avg_size * 3) - (avg_size / 4))) { + real_size += 3; + } else { + if (adjusted_pulse >= ((avg_size * 2) + (avg_size / 4))) { + if ((2 * ((adjusted_pulse >> 2) - adjust)) < (avg_size + (avg_size / 4))) + real_size += 2; + else + real_size += 3; + } else + real_size += 2; + } + } + + if (outstep == 1) { + for (j = real_size; j > 1; j--) + addbit (d, 0); + addbit (d, 1); + for (j = 0; j < real_size; j++) + *pt++ = (uae_u16)(pulse / real_size); + } + + /* prepares for the next pulse */ + adjust = ((real_size * avg_size)/8) - pulse; + total -= psarray[array_index].size; + totaldiv -= psarray[array_index].number_of_bits; + psarray[array_index].size = pulse; + psarray[array_index].number_of_bits = real_size; + total += pulse; + totaldiv += real_size; + array_index++; + if (array_index >= FDI_MAX_ARRAY) + array_index = 0; + } + + fdi->out = bitoffset; +} + +#else + +static void fdi2_decode (FDI *fdi, uint32_t totalavg, uae_u32 *avgp, uae_u32 *minp, uae_u32 *maxp, uae_u8 *idx, int maxidx, int *indexoffsetp, int pulses, int mfm) +{ + uint32_t adjust; + uint32_t adjusted_pulse; + uint32_t standard_MFM_2_bit_cell_size = totalavg / 50000; + uint32_t standard_MFM_8_bit_cell_size = totalavg / 12500; + int real_size, i, j, nexti, eodat, outstep, randval; + int indexoffset = *indexoffsetp; + uae_u8 *d = fdi->track_dst_buffer; + uae_u16 *pt = fdi->track_dst_buffer_timing; + uae_u32 ref_pulse, pulse; + long jitter; + + /* detects a long-enough stable pulse coming just after another stable pulse */ + i = 1; + while ( (i < pulses) && ( (idx[i] < maxidx) + || (idx[i - 1] < maxidx) + || (minp[i] < (standard_MFM_2_bit_cell_size - (standard_MFM_2_bit_cell_size / 4))) ) ) + i++; + if (i == pulses) { + outlog ("FDI: No stable and long-enough pulse in track.\n"); + return; + } + nexti = i; + eodat = i; + i--; + adjust = 0; + total = 0; + totaldiv = 0; + init_array(standard_MFM_2_bit_cell_size, 1 + mfm); + bitoffset = 0; + ref_pulse = 0; + jitter = 0; + outstep = -1; + while (outstep < 2) { + + /* calculates the current average bitrate from previous decoded data */ + uae_u32 avg_size = (total << (2 + mfm)) / totaldiv; /* this is the new average size for one MFM bit */ + /* uae_u32 avg_size = (uae_u32)((((float)total)*((float)(mfm+1))*4.0) / ((float)totaldiv)); */ + /* you can try tighter ranges than 25%, or wider ranges. I would probably go for tighter... */ + if ((avg_size < (standard_MFM_8_bit_cell_size - (pulse_limitval * standard_MFM_8_bit_cell_size / 100))) || + (avg_size > (standard_MFM_8_bit_cell_size + (pulse_limitval * standard_MFM_8_bit_cell_size / 100)))) { + //init_array(standard_MFM_2_bit_cell_size, mfm + 1); + avg_size = standard_MFM_8_bit_cell_size; + } + /* this is to prevent the average value from going too far + * from the theoretical value, otherwise it could progressively go to (2 * + * real value), or (real value / 2), etc. */ + + /* gets the next long-enough pulse (this may require more than one pulse) */ + pulse = 0; + while (pulse < ((avg_size / 4) - (avg_size / 16))) { + uae_u32 avg_pulse, min_pulse, max_pulse; + i++; + if (i >= pulses) + i = 0; + if (i == nexti) { + do { + nexti++; + if (nexti >= pulses) + nexti = 0; + } while (idx[nexti] < maxidx); + } + if (idx[i] >= maxidx) { /* stable pulse */ + avg_pulse = avgp[i] - jitter; + min_pulse = minp[i]; + max_pulse = maxp[i]; + if (jitter >= 0) + max_pulse -= jitter; + else + min_pulse -= jitter; + if ((maxp[nexti] - avgp[nexti]) < (avg_pulse - min_pulse)) + min_pulse = avg_pulse - (maxp[nexti] - avgp[nexti]); + if ((avgp[nexti] - minp[nexti]) < (max_pulse - avg_pulse)) + max_pulse = avg_pulse + (avgp[nexti] - minp[nexti]); + if (min_pulse < ref_pulse) + min_pulse = ref_pulse; + randval = rand(); + if (randval < (RAND_MAX / 2)) { + if (randval > (RAND_MAX / 4)) { + if (randval <= (3 * RAND_MAX / 8)) + randval = (2 * randval) - (RAND_MAX /4); + else + randval = (4 * randval) - RAND_MAX; + } + jitter = 0 - (randval * (avg_pulse - min_pulse)) / RAND_MAX; + } else { + randval -= RAND_MAX / 2; + if (randval > (RAND_MAX / 4)) { + if (randval <= (3 * RAND_MAX / 8)) + randval = (2 * randval) - (RAND_MAX /4); + else + randval = (4 * randval) - RAND_MAX; + } + jitter = (randval * (max_pulse - avg_pulse)) / RAND_MAX; + } + avg_pulse += jitter; + if ((avg_pulse < min_pulse) || (avg_pulse > max_pulse)) { + outlog ("FDI: avg_pulse outside bounds! avg=%u min=%u max=%u\n", avg_pulse, min_pulse, max_pulse); + outlog ("FDI: avgp=%u (%u) minp=%u (%u) maxp=%u (%u) jitter=%d i=%d ni=%d\n", + avgp[i], avgp[nexti], minp[i], minp[nexti], maxp[i], maxp[nexti], jitter, i, nexti); + } + if (avg_pulse < ref_pulse) + outlog ("FDI: avg_pulse < ref_pulse! (%u < %u)\n", avg_pulse, ref_pulse); + pulse += avg_pulse - ref_pulse; + ref_pulse = 0; + if (i == eodat) + outstep++; + } else if (rand() <= ((idx[i] * RAND_MAX) / maxidx)) { + avg_pulse = avgp[i]; + min_pulse = minp[i]; + max_pulse = maxp[i]; + randval = rand(); + if (randval < (RAND_MAX / 2)) { + if (randval > (RAND_MAX / 4)) { + if (randval <= (3 * RAND_MAX / 8)) + randval = (2 * randval) - (RAND_MAX /4); + else + randval = (4 * randval) - RAND_MAX; + } + avg_pulse -= (randval * (avg_pulse - min_pulse)) / RAND_MAX; + } else { + randval -= RAND_MAX / 2; + if (randval > (RAND_MAX / 4)) { + if (randval <= (3 * RAND_MAX / 8)) + randval = (2 * randval) - (RAND_MAX /4); + else + randval = (4 * randval) - RAND_MAX; + } + avg_pulse += (randval * (max_pulse - avg_pulse)) / RAND_MAX; + } + if ((avg_pulse > ref_pulse) && (avg_pulse < (avgp[nexti] - jitter))) { + pulse += avg_pulse - ref_pulse; + ref_pulse = avg_pulse; + } + } + if (outstep == 1 && indexoffset == i) + *indexoffsetp = bitoffset; + } + + /* gets the size in bits from the pulse width, considering the current average bitrate */ + adjusted_pulse = pulse; + real_size = 0; + if (mfm) { + while (adjusted_pulse >= avg_size) { + real_size += 4; + adjusted_pulse -= avg_size / 2; + } + adjusted_pulse <<= 3; + while (adjusted_pulse >= ((avg_size * 4) + (avg_size / 4))) { + real_size += 2; + adjusted_pulse -= avg_size * 2; + } + if (adjusted_pulse >= ((avg_size * 3) + (avg_size / 4))) { + if (adjusted_pulse <= ((avg_size * 4) - (avg_size / 4))) { + if ((2 * ((adjusted_pulse >> 2) - adjust)) <= ((2 * avg_size) - (avg_size / 4))) + real_size += 3; + else + real_size += 4; + } else + real_size += 4; + } else { + if (adjusted_pulse > ((avg_size * 3) - (avg_size / 4))) { + real_size += 3; + } else { + if (adjusted_pulse >= ((avg_size * 2) + (avg_size / 4))) { + if ((2 * ((adjusted_pulse >> 2) - adjust)) < (avg_size + (avg_size / 4))) + real_size += 2; + else + real_size += 3; + } else + real_size += 2; + } + } + } else { + while (adjusted_pulse >= (2*avg_size)) + { + real_size+=4; + adjusted_pulse-=avg_size; + } + adjusted_pulse<<=2; + while (adjusted_pulse >= ((avg_size*3)+(avg_size/4))) + { + real_size+=2; + adjusted_pulse-=avg_size*2; + } + if (adjusted_pulse >= ((avg_size*2)+(avg_size/4))) + { + if (adjusted_pulse <= ((avg_size*3)-(avg_size/4))) + { + if (((adjusted_pulse>>1)-adjust) < (avg_size+(avg_size/4))) + real_size+=2; + else + real_size+=3; + } + else + real_size+=3; + } + else + { + if (adjusted_pulse > ((avg_size*2)-(avg_size/4))) + real_size+=2; + else + { + if (adjusted_pulse >= (avg_size+(avg_size/4))) + { + if (((adjusted_pulse>>1)-adjust) <= (avg_size-(avg_size/4))) + real_size++; + else + real_size+=2; + } + else + real_size++; + } + } + } + + /* after one pass to correctly initialize the average bitrate, outputs the bits */ + if (outstep == 1) { + for (j = real_size; j > 1; j--) + addbit (d, 0); + addbit (d, 1); + for (j = 0; j < real_size; j++) + *pt++ = (uae_u16)(pulse / real_size); + } + + /* prepares for the next pulse */ + adjust = ((real_size * avg_size) / (4 << mfm)) - pulse; + total -= psarray[array_index].size; + totaldiv -= psarray[array_index].number_of_bits; + psarray[array_index].size = pulse; + psarray[array_index].number_of_bits = real_size; + total += pulse; + totaldiv += real_size; + array_index++; + if (array_index >= FDI_MAX_ARRAY) + array_index = 0; + } + + fdi->out = bitoffset; +} + +#endif + +static void fdi2_celltiming (FDI *fdi, uint32_t totalavg, int bitoffset, uae_u16 *out) +{ + uae_u16 *pt2, *pt; + double avg_bit_len; + int i; + + avg_bit_len = (double)totalavg / (double)bitoffset; + pt2 = fdi->track_dst_buffer_timing; + pt = out; + for (i = 0; i < bitoffset / 8; i++) { + double v = (pt2[0] + pt2[1] + pt2[2] + pt2[3] + pt2[4] + pt2[5] + pt2[6] + pt2[7]) / 8.0; + v = 1000.0 * v / avg_bit_len; + *pt++ = (uae_u16)v; + pt2 += 8; + } + *pt++ = out[0]; + *pt = out[0]; +} + +static int decode_lowlevel_track (FDI *fdi, int track, struct fdi_cache *cache) +{ + uae_u8 *p1, *d; + uae_u32 *p2; + uae_u32 *avgp, *minp = 0, *maxp = 0; + uae_u8 *idxp = 0; + uae_u32 maxidx, totalavg, weakbits; + int i, j, len, pulses, indexoffset; + int avg_free, min_free = 0, max_free = 0, idx_free; + int idx_off1, idx_off2, idx_off3; + + d = fdi->track_dst; + p1 = fdi->track_src; + pulses = get_u32 (p1); + if (!pulses) + return -1; + p1 += 4; + len = 12; + avgp = (uae_u32*)fdi_decompress (pulses, p1 + 0, p1 + len, &avg_free); + dumpstream(track, (uae_u8*)avgp, pulses); + len += get_u24 (p1 + 0) & 0x3fffff; + if (!avgp) + return -1; + if (get_u24 (p1 + 3) && get_u24 (p1 + 6)) { + minp = (uae_u32*)fdi_decompress (pulses, p1 + 3, p1 + len, &min_free); + len += get_u24 (p1 + 3) & 0x3fffff; + maxp = (uae_u32*)fdi_decompress (pulses, p1 + 6, p1 + len, &max_free); + len += get_u24 (p1 + 6) & 0x3fffff; + /* Computes the real min and max values */ + for (i = 0; i < pulses; i++) { + maxp[i] = avgp[i] + minp[i] - maxp[i]; + minp[i] = avgp[i] - minp[i]; + } + } else { + minp = avgp; + maxp = avgp; + } + if (get_u24 (p1 + 9)) { + idx_off1 = 0; + idx_off2 = 1; + idx_off3 = 2; + idxp = fdi_decompress (pulses, p1 + 9, p1 + len, &idx_free); + if (idx_free) { + if (idxp[0] == 0 && idxp[1] == 0) { + idx_off1 = 2; + idx_off2 = 3; + } else { + idx_off1 = 1; + idx_off2 = 0; + } + idx_off3 = 4; + } + } else { + idxp = fdi_malloc (pulses * 2); + idx_free = 1; + for (i = 0; i < pulses; i++) { + idxp[i * 2 + 0] = 2; + idxp[i * 2 + 1] = 0; + } + idxp[0] = 1; + idxp[1] = 1; + } + + maxidx = 0; + indexoffset = 0; + p1 = idxp; + for (i = 0; i < pulses; i++) { + if (p1[idx_off1] + p1[idx_off2] > maxidx) + maxidx = p1[idx_off1] + p1[idx_off2]; + p1 += idx_off3; + } + p1 = idxp; + for (i = 0; (i < pulses) && (p1[idx_off2] != 0); i++) /* falling edge, replace with idx_off1 for rising edge */ + p1 += idx_off3; + if (i < pulses) { + j = i; + do { + i++; + p1 += idx_off3; + if (i >= pulses) { + i = 0; + p1 = idxp; + } + } while ((i != j) && (p1[idx_off2] == 0)); /* falling edge, replace with idx_off1 for rising edge */ + if (i != j) /* index pulse detected */ + { + while ((i != j) && (p1[idx_off1] > p1[idx_off2])) { /* falling edge, replace with "<" for rising edge */ + i++; + p1 += idx_off3; + if (i >= pulses) { + i = 0; + p1 = idxp; + } + } + if (i != j) + indexoffset = i; /* index position detected */ + } + } + p1 = idxp; + p2 = avgp; + totalavg = 0; + weakbits = 0; + for (i = 0; i < pulses; i++) { + int sum = p1[idx_off1] + p1[idx_off2]; + if (sum >= maxidx) { + totalavg += *p2; + } else { + weakbits++; + } + p2++; + p1 += idx_off3; + idxp[i] = sum; + } + len = totalavg / 100000; + outlog("totalavg=%u index=%d (%d) maxidx=%d weakbits=%d len=%d\n", + totalavg, indexoffset, maxidx, weakbits, len); + cache->avgp = avgp; + cache->idxp = idxp; + cache->minp = minp; + cache->maxp = maxp; + cache->avg_free = avg_free; + cache->idx_free = idx_free; + cache->min_free = min_free; + cache->max_free = max_free; + cache->totalavg = totalavg; + cache->pulses = pulses; + cache->maxidx = maxidx; + cache->indexoffset = indexoffset; + cache->weakbits = weakbits; + cache->lowlevel = 1; + + return 1; +} + +static unsigned char fdiid[]={"Formatted Disk Image file"}; +static int bit_rate_table[16] = { 125,150,250,300,500,1000 }; + +void fdi2raw_header_free (FDI *fdi) +{ + int i; + + fdi_free (fdi->mfmsync_buffer); + fdi_free (fdi->track_src_buffer); + fdi_free (fdi->track_dst_buffer); + fdi_free (fdi->track_dst_buffer_timing); + for (i = 0; i < MAX_TRACKS; i++) { + struct fdi_cache *c = &fdi->cache[i]; + if (c->idx_free) + fdi_free (c->idxp); + if (c->avg_free) + fdi_free (c->avgp); + if (c->min_free) + fdi_free (c->minp); + if (c->max_free) + fdi_free (c->maxp); + } + fdi_free (fdi); + debuglog ("FREE: memory allocated %d\n", fdi_allocated); +} + +int fdi2raw_get_last_track (FDI *fdi) +{ + return fdi->last_track; +} + +int fdi2raw_get_num_sector (FDI *fdi) +{ + if (fdi->header[152] == 0x02) + return 22; + return 11; +} + +int fdi2raw_get_last_head (FDI *fdi) +{ + return fdi->last_head; +} + +int fdi2raw_get_rotation (FDI *fdi) +{ + return fdi->rotation_speed; +} + +int fdi2raw_get_bit_rate (FDI *fdi) +{ + return fdi->bit_rate; +} + +int fdi2raw_get_type (FDI *fdi) +{ + return fdi->disk_type; +} + +int fdi2raw_get_write_protect (FDI *fdi) +{ + return fdi->write_protect; +} + +FDI *fdi2raw_header(FILE *f) +{ + int i, offset, oldseek; + uae_u8 type, size; + FDI *fdi; + + debuglog ("ALLOC: memory allocated %d\n", fdi_allocated); + fdi = fdi_malloc(sizeof(FDI)); + memset (fdi, 0, sizeof (FDI)); + fdi->file = f; + oldseek = ftell (fdi->file); + fseek (fdi->file, 0, SEEK_SET); + fread (fdi->header, 2048, 1, fdi->file); + fseek (fdi->file, oldseek, SEEK_SET); + if (memcmp (fdiid, fdi->header, strlen ((char *)fdiid)) ) { + fdi_free(fdi); + return NULL; + } + if ((fdi->header[140] != 1 && fdi->header[140] != 2) || (fdi->header[141] != 0 && !(fdi->header[140]==2 && fdi->header[141]==1))) { + fdi_free(fdi); + return NULL; + } + + fdi->mfmsync_buffer = fdi_malloc (MAX_MFM_SYNC_BUFFER * sizeof(int)); + fdi->track_src_buffer = fdi_malloc (MAX_SRC_BUFFER); + fdi->track_dst_buffer = fdi_malloc (MAX_DST_BUFFER); + fdi->track_dst_buffer_timing = fdi_malloc (MAX_TIMING_BUFFER); + + fdi->last_track = ((fdi->header[142] << 8) + fdi->header[143]) + 1; + fdi->last_track *= fdi->header[144] + 1; + if (fdi->last_track > MAX_TRACKS) + fdi->last_track = MAX_TRACKS; + fdi->last_head = fdi->header[144]; + fdi->disk_type = fdi->header[145]; + fdi->rotation_speed = fdi->header[146] + 128; + fdi->write_protect = fdi->header[147] & 1; + outlog ("FDI version %d.%d\n", fdi->header[140], fdi->header[141]); + outlog ("last_track=%d rotation_speed=%d\n",fdi->last_track,fdi->rotation_speed); + + offset = 512; + i = fdi->last_track; + if (i > 180) { + offset += 512; + i -= 180; + while (i > 256) { + offset += 512; + i -= 256; + } + } + for (i = 0; i < fdi->last_track; i++) { + fdi->track_offsets[i] = offset; + type = fdi->header[152 + i * 2]; + size = fdi->header[152 + i * 2 + 1]; + if (type == 1) + offset += (size & 15) * 512; + else if ((type & 0xc0) == 0x80) + offset += (((type & 0x3f) << 8) | size) * 256; + else + offset += size * 256; + } + fdi->track_offsets[i] = offset; + + return fdi; +} + + +int fdi2raw_loadrevolution_2 (FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, int *tracklength, int *indexoffsetp, int *multirev, int mfm) +{ + struct fdi_cache *cache = &fdi->cache[track]; + int len, i, idx; + + memset (fdi->track_dst_buffer, 0, MAX_DST_BUFFER); + idx = cache->indexoffset; + fdi2_decode (fdi, cache->totalavg, + cache->avgp, cache->minp, cache->maxp, cache->idxp, + cache->maxidx, &idx, cache->pulses, mfm); + //fdi2_gcr_decode (fdi, totalavg, avgp, minp, maxp, idxp, idx_off1, idx_off2, idx_off3, maxidx, pulses); + outlog("track %d: nbits=%d avg len=%.2f weakbits=%d idx=%d\n", + track, bitoffset, (double)cache->totalavg / bitoffset, cache->weakbits, cache->indexoffset); + len = fdi->out; + if (cache->weakbits >= 10 && multirev) + *multirev = 1; + *tracklength = len; + + for (i = 0; i < (len + 15) / (2 * 8); i++) { + uae_u8 *data = fdi->track_dst_buffer + i * 2; + *mfmbuf++ = 256 * *data + *(data + 1); + } + fdi2_celltiming (fdi, cache->totalavg, len, tracktiming); + if (indexoffsetp) + *indexoffsetp = idx; + return 1; +} + +int fdi2raw_loadrevolution (FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, int *tracklength, int mfm) +{ + return fdi2raw_loadrevolution_2 (fdi, mfmbuf, tracktiming, track, tracklength, 0, 0, mfm); +} + +int fdi2raw_loadtrack (FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, int *tracklength, int *indexoffsetp, int *multirev, int mfm) +{ + uae_u8 *p; + int outlen, i; + struct fdi_cache *cache = &fdi->cache[track]; + + if (cache->lowlevel) + return fdi2raw_loadrevolution_2 (fdi, mfmbuf, tracktiming, track, tracklength, indexoffsetp, multirev, mfm); + + fdi->err = 0; + fdi->track_src_len = fdi->track_offsets[track + 1] - fdi->track_offsets[track]; + fseek (fdi->file, fdi->track_offsets[track], SEEK_SET); + fread (fdi->track_src_buffer, fdi->track_src_len, 1, fdi->file); + memset (fdi->track_dst_buffer, 0, MAX_DST_BUFFER); + fdi->track_dst_buffer_timing[0] = 0; + + fdi->current_track = track; + fdi->track_src = fdi->track_src_buffer; + fdi->track_dst = fdi->track_dst_buffer; + p = fdi->header + 152 + fdi->current_track * 2; + fdi->track_type = *p++; + fdi->track_len = *p++; + fdi->bit_rate = 0; + fdi->out = 0; + fdi->mfmsync_offset = 0; + + if ((fdi->track_type & 0xf0) == 0xf0 || (fdi->track_type & 0xf0) == 0xe0) + fdi->bit_rate = bit_rate_table[fdi->track_type & 0x0f]; + else + fdi->bit_rate = 250; + + outlog ("track %d: srclen: %d track_type: %02.2X, bitrate: %d\n", + fdi->current_track, fdi->track_src_len, fdi->track_type, fdi->bit_rate); + + if ((fdi->track_type & 0xc0) == 0x80) { + + outlen = decode_lowlevel_track (fdi, track, cache); + + } else if ((fdi->track_type & 0xf0) == 0xf0) { + + outlen = decode_raw_track (fdi); + + } else if ((fdi->track_type & 0xf0) == 0xe0) { + + outlen = handle_sectors_described_track (fdi); + + } else if ((fdi->track_type & 0xf0)) { + + zxx (fdi); + outlen = -1; + + } else if (fdi->track_type < 0x10) { + + decode_normal_track[fdi->track_type](fdi); + fix_mfm_sync (fdi); + outlen = fdi->out; + + } else { + + zxx (fdi); + outlen = -1; + + } + +// amiga_check_track (fdi); + + if (fdi->err) + return 0; + + if (outlen > 0) { + if (cache->lowlevel) + return fdi2raw_loadrevolution_2 (fdi, mfmbuf, tracktiming, track, tracklength, indexoffsetp, multirev, mfm); + *tracklength = fdi->out; + for (i = 0; i < ((*tracklength) + 15) / (2 * 8); i++) { + uae_u8 *data = fdi->track_dst_buffer + i * 2; + *mfmbuf++ = 256 * *data + *(data + 1); + } + } + return outlen; +} + diff --git a/src/fdi2raw.h b/src/fdi2raw.h index 92e6ab1a..1ca272da 100644 --- a/src/fdi2raw.h +++ b/src/fdi2raw.h @@ -1,34 +1,34 @@ -#ifndef __FDI2RAW_H -#define __FDI2RAW_H - -#define uae_u8 uint8_t -#define uae_u16 uint16_t -#define uae_u32 uint32_t - -//#include "types.h" -#include -typedef struct fdi FDI; - -#ifdef __cplusplus -extern "C" { -#endif - -extern int fdi2raw_loadtrack (FDI*, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, int *tracklength, int *indexoffset, int *multirev, int mfm); - -extern int fdi2raw_loadrevolution (FDI*, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, int *tracklength, int mfm); - -extern FDI *fdi2raw_header(FILE *f); -extern void fdi2raw_header_free (FDI *); -extern int fdi2raw_get_last_track(FDI *); -extern int fdi2raw_get_num_sector (FDI *); -extern int fdi2raw_get_last_head(FDI *); -extern int fdi2raw_get_type (FDI *); -extern int fdi2raw_get_bit_rate (FDI *); -extern int fdi2raw_get_rotation (FDI *); -extern int fdi2raw_get_write_protect (FDI *); - -#ifdef __cplusplus -} -#endif - -#endif +#ifndef __FDI2RAW_H +#define __FDI2RAW_H + +#define uae_u8 uint8_t +#define uae_u16 uint16_t +#define uae_u32 uint32_t + +//#include "types.h" +#include +typedef struct fdi FDI; + +#ifdef __cplusplus +extern "C" { +#endif + +extern int fdi2raw_loadtrack (FDI*, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, int *tracklength, int *indexoffset, int *multirev, int mfm); + +extern int fdi2raw_loadrevolution (FDI*, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, int *tracklength, int mfm); + +extern FDI *fdi2raw_header(FILE *f); +extern void fdi2raw_header_free (FDI *); +extern int fdi2raw_get_last_track(FDI *); +extern int fdi2raw_get_num_sector (FDI *); +extern int fdi2raw_get_last_head(FDI *); +extern int fdi2raw_get_type (FDI *); +extern int fdi2raw_get_bit_rate (FDI *); +extern int fdi2raw_get_rotation (FDI *); +extern int fdi2raw_get_write_protect (FDI *); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/i8271.c b/src/i8271.c index ac06e4fd..e96de35c 100644 --- a/src/i8271.c +++ b/src/i8271.c @@ -1,507 +1,507 @@ -/*B-em v2.2 by Tom Walker - 8271 FDC emulation*/ - -#include -#include -#include "b-em.h" -#include "6502.h" -#include "i8271.h" -#include "disc.h" -#include "model.h" - -void i8271_callback(); -void i8271_data(uint8_t dat); -void i8271_spindown(); -void i8271_finishread(); -void i8271_notfound(); -void i8271_datacrcerror(); -void i8271_headercrcerror(); -void i8271_writeprotect(); -int i8271_getdata(int last); - -int byte; -int i8271_verify = 0; - -struct -{ - uint8_t command, params[5]; - int drivesel; - int paramnum, paramreq; - uint8_t status; - uint8_t result; - int curtrack[2], cursector; - int realtrack[2]; - int sectorsleft; - uint8_t data; - int phase; - int written; - - uint8_t drvout; -} i8271; - -void i8271_reset() -{ - if (I8271) - { - fdc_callback = i8271_callback; - fdc_data = i8271_data; - fdc_spindown = i8271_spindown; - fdc_finishread = i8271_finishread; - fdc_notfound = i8271_notfound; - fdc_datacrcerror = i8271_datacrcerror; - fdc_headercrcerror = i8271_headercrcerror; - fdc_writeprotect = i8271_writeprotect; - fdc_getdata = i8271_getdata; - } - i8271.paramnum = i8271.paramreq = 0; - i8271.status = 0; -// printf("Reset 8271\n"); - fdc_time = 0; - i8271.curtrack[0] = i8271.curtrack[1] = 0; - i8271.command = 0xFF; - i8271.realtrack[0] = i8271.realtrack[1] = 0; - motorspin = 45000; -} - -static void i8271_NMI() -{ - if (i8271.status & 8) - { - nmi = 1; -// printf("NMI\n"); - } - else nmi = 0; -} - - -void i8271_spinup() -{ - motoron = 1; - motorspin = 0; -} - -void i8271_spindown() -{ - motoron = 0; -} - -void i8271_setspindown() -{ - motorspin = 45000; -} - - -int params[][2]= -{ - {0x35, 4}, {0x29, 1}, {0x2C, 0}, {0x3D, 1}, {0x3A, 2}, {0x13, 3}, {0x0B, 3}, {0x1B, 3}, {0x1F, 3}, {0x23, 5}, {-1, -1} -}; - -int i8271_getparams() -{ - int c = 0; - while (params[c][0] != -1) - { - if (params[c][0] == i8271.command) - return params[c][1]; - c++; - } - return 0; -/* printf("Unknown 8271 command %02X\n",i8271.command); - dumpregs(); - exit(-1);*/ -} - -uint8_t i8271_read(uint16_t addr) -{ -// printf("Read 8271 %04X\n",addr); - switch (addr & 7) - { - case 0: /*Status register*/ -// printf("Read status reg %04X %02X\n",pc,i8271.status); - return i8271.status; - case 1: /*Result register*/ - i8271.status &= ~0x18; - i8271_NMI(); -// printf("Read result reg %04X %02X\n",pc,i8271.status); - // output=1; timetolive=50; - return i8271.result; - case 4: /*Data register*/ - i8271.status &= ~0xC; - i8271_NMI(); -// printf("Read data reg %04X %02X\n",pc,i8271.status); - return i8271.data; - } - return 0; -} - -#define track0 (i8271.curtrack[curdrive] ? 0 : 2) - -void i8271_seek() -{ - int diff = i8271.params[0] - i8271.curtrack[curdrive]; - i8271.realtrack[curdrive] += diff; - disc_seek(curdrive, i8271.realtrack[curdrive]); -} - -void i8271_write(uint16_t addr, uint8_t val) -{ -// printf("Write 8271 %04X %02X\n",addr,val); - switch (addr&7) - { - case 0: /*Command register*/ - if (i8271.status & 0x80) return; - i8271.command = val & 0x3F; - if (i8271.command == 0x17) i8271.command = 0x13; -// printf("8271 command %02X!\n",i8271.command); - i8271.drivesel = val >> 6; - curdrive = (val & 0x80) ? 1 : 0; - i8271.paramnum = 0; - i8271.paramreq = i8271_getparams(); - i8271.status = 0x80; - if (!i8271.paramreq) - { - switch (i8271.command) - { - case 0x2C: /*Read drive status*/ - i8271.status = 0x10; - i8271.result = 0x80 | 8 | track0; - if (i8271.drivesel & 1) i8271.result |= 0x04; - if (i8271.drivesel & 2) i8271.result |= 0x40; -// printf("Status %02X\n",i8271.result); - break; - - default: - i8271.result = 0x18; - i8271.status = 0x18; - i8271_NMI(); - fdc_time = 0; - break; -// printf("Unknown 8271 command %02X 3\n",i8271.command); -// dumpregs(); -// exit(-1); - } - } - break; - case 1: /*Parameter register*/ - if (i8271.paramnum < 5) - i8271.params[i8271.paramnum++] = val; - if (i8271.paramnum == i8271.paramreq) - { - switch (i8271.command) - { - case 0x0B: /*Write sector*/ - i8271.sectorsleft = i8271.params[2] & 31; - i8271.cursector = i8271.params[1]; - i8271_spinup(); - i8271.phase = 0; - if (i8271.curtrack[curdrive] != i8271.params[0]) i8271_seek(); - else fdc_time = 200; - break; - case 0x13: /*Read sector*/ - i8271.sectorsleft = i8271.params[2] & 31; - i8271.cursector = i8271.params[1]; - i8271_spinup(); - i8271.phase = 0; - if (i8271.curtrack[curdrive] != i8271.params[0]) i8271_seek(); - else fdc_time = 200; - break; - case 0x1F: /*Verify sector*/ - i8271.sectorsleft = i8271.params[2] & 31; - i8271.cursector = i8271.params[1]; - i8271_spinup(); - i8271.phase = 0; - if (i8271.curtrack[curdrive] != i8271.params[0]) i8271_seek(); - else fdc_time = 200; - i8271_verify = 1; - break; - case 0x1B: /*Read ID*/ -// printf("8271 : Read ID start\n"); - i8271.sectorsleft = i8271.params[2] & 31; - i8271_spinup(); - i8271.phase = 0; - if (i8271.curtrack[curdrive] != i8271.params[0]) i8271_seek(); - else fdc_time = 200; - break; - case 0x23: /*Format track*/ - i8271_spinup(); - i8271.phase = 0; - if (i8271.curtrack[curdrive] != i8271.params[0]) i8271_seek(); - else fdc_time = 200; - break; - break; - case 0x29: /*Seek*/ -// fdc_time=10000; - i8271_seek(); - i8271_spinup(); - break; - case 0x35: /*Specify*/ - i8271.status = 0; - break; - case 0x3A: /*Write special register*/ - i8271.status = 0; -// printf("Write special %02X\n",i8271.params[0]); - switch (i8271.params[0]) - { - case 0x12: i8271.curtrack[0] = val; /*printf("Write real track now %i\n",val);*/ break; - case 0x17: break; /*Mode register*/ - case 0x1A: i8271.curtrack[1] = val; /*printf("Write real track now %i\n",val);*/ break; - case 0x23: i8271.drvout = i8271.params[1]; break; - default: - i8271.result = 0x18; - i8271.status = 0x18; - i8271_NMI(); - fdc_time = 0; - break; -// default: -// printf("8271 Write bad special register %02X\n",i8271.params[0]); -// dumpregs(); -// exit(-1); - } - break; - case 0x3D: /*Read special register*/ - i8271.status = 0x10; - i8271.result = 0; - switch (i8271.params[0]) - { - case 0x06: i8271.result = 0; break; - case 0x12: i8271.result = i8271.curtrack[0]; break; - case 0x1A: i8271.result = i8271.curtrack[1]; break; - case 0x23: i8271.result = i8271.drvout; break; - default: - i8271.result = 0x18; - i8271.status = 0x18; - i8271_NMI(); - fdc_time = 0; - break; -// default: -// printf("8271 Read bad special register %02X\n",i8271.params[0]); -// dumpregs(); -// exit(-1); - } - break; - - default: - i8271.result = 0x18; - i8271.status = 0x18; - i8271_NMI(); - fdc_time = 0; - break; -// printf("Unknown 8271 command %02X 2\n",i8271.command); -// dumpregs(); -// exit(-1); - } - } - break; - case 2: /*Reset register*/ - if (val & 1) i8271_reset(); - break; - case 4: /*Data register*/ - i8271.data = val; - i8271.written = 1; - i8271.status &= ~0xC; - i8271_NMI(); - break; - } -} - -void i8271_callback() -{ - fdc_time = 0; -// printf("Callback 8271 - command %02X\n",i8271.command); - switch (i8271.command) - { - case 0x0B: /*Write*/ - if (!i8271.phase) - { - i8271.curtrack[curdrive] = i8271.params[0]; - disc_writesector(curdrive, i8271.cursector, i8271.params[0], (i8271.drvout & 0x20) ? 1 : 0, 0); - i8271.phase = 1; - - i8271.status = 0x8C; - i8271.result = 0; - i8271_NMI(); - return; - } - i8271.sectorsleft--; - if (!i8271.sectorsleft) - { - i8271.status = 0x18; - i8271.result = 0; - i8271_NMI(); - i8271_setspindown(); - i8271_verify=0; - return; - } - i8271.cursector++; - disc_writesector(curdrive, i8271.cursector, i8271.params[0], (i8271.drvout & 0x20) ? 1 : 0, 0); - byte = 0; - i8271.status = 0x8C; - i8271.result = 0; - i8271_NMI(); - break; - - case 0x13: /*Read*/ - case 0x1F: /*Verify*/ - if (!i8271.phase) - { -// printf("Seek to %i\n",i8271.params[0]); - i8271.curtrack[curdrive] = i8271.params[0]; -// i8271.realtrack+=diff; -// disc_seek(0,i8271.realtrack); -// printf("Re-seeking - track now %i %i\n",i8271.curtrack,i8271.realtrack); - disc_readsector(curdrive, i8271.cursector, i8271.params[0], (i8271.drvout & 0x20) ? 1 : 0, 0); - i8271.phase = 1; - return; - } - i8271.sectorsleft--; - if (!i8271.sectorsleft) - { - i8271.status = 0x18; - i8271.result = 0; - i8271_NMI(); - i8271_setspindown(); - i8271_verify=0; - return; - } - i8271.cursector++; - disc_readsector(curdrive, i8271.cursector, i8271.params[0], (i8271.drvout & 0x20) ? 1 : 0, 0); - byte = 0; - break; - - case 0x1B: /*Read ID*/ -// printf("Read ID callback %i\n",i8271.phase); - if (!i8271.phase) - { - i8271.curtrack[curdrive] = i8271.params[0]; -// i8271.realtrack+=diff; -// disc_seek(0,i8271.realtrack); - disc_readaddress(curdrive, i8271.params[0], (i8271.drvout & 0x20) ? 1 : 0, 0); - i8271.phase = 1; - return; - } -// printf("Read ID track %i %i\n",i8271.params[0],i8271.sectorsleft); - i8271.sectorsleft--; - if (!i8271.sectorsleft) - { - i8271.status = 0x18; - i8271.result = 0; - i8271_NMI(); -// printf("8271 : ID read done!\n"); - i8271_setspindown(); - return; - } - i8271.cursector++; - disc_readaddress(curdrive, i8271.params[0], (i8271.drvout & 0x20) ? 1 : 0, 0); - byte = 0; - break; - - case 0x23: /*Format*/ - if (!i8271.phase) - { - i8271.curtrack[curdrive] = i8271.params[0]; - disc_writesector(curdrive, i8271.cursector, i8271.params[0], (i8271.drvout & 0x20) ? 1 : 0, 0); - i8271.phase = 1; - - i8271.status = 0x8C; - i8271.result = 0; - i8271_NMI(); - return; - } - if (i8271.phase == 2) - { - i8271.status = 0x18; - i8271.result = 0; - i8271_NMI(); - i8271_setspindown(); - i8271_verify=0; - return; - } - disc_format(curdrive, i8271.params[0], (i8271.drvout & 0x20) ? 1 : 0, 0); - i8271.phase = 2; - break; - - case 0x29: /*Seek*/ - i8271.curtrack[curdrive] = i8271.params[0]; -// i8271.realtrack+=diff; - i8271.status = 0x18; - i8271.result = 0; - i8271_NMI(); -// disc_seek(0,i8271.realtrack); -// printf("Seek done!\n"); - i8271_setspindown(); - break; - - case 0xFF: break; - - default: break; - printf("Unknown 8271 command %02X 3\n", i8271.command); - dumpregs(); - exit(-1); - } -} - -void i8271_data(uint8_t dat) -{ - if (i8271_verify) return; - i8271.data = dat; - i8271.status = 0x8C; - i8271.result = 0; - i8271_NMI(); -// printf("%02X : Data %02X\n",byte,dat); - byte++; -} - -void i8271_finishread() -{ - fdc_time = 200; -} - -void i8271_notfound() -{ - i8271.result = 0x18; - i8271.status = 0x18; - i8271_NMI(); - fdc_time = 0; -// printf("Not found 8271\n"); -} - -void i8271_datacrcerror() -{ - i8271.result = 0x0E; - i8271.status = 0x18; - i8271_NMI(); - fdc_time = 0; -// printf("CRCdat 8271\n"); -} - -void i8271_headercrcerror() -{ - i8271.result = 0x0C; - i8271.status = 0x18; - i8271_NMI(); - fdc_time = 0; -// printf("CRChead 8271\n"); -} - -int i8271_getdata(int last) -{ -// printf("Disc get data %i\n",byte); - byte++; - if (!i8271.written) return -1; - if (!last) - { - i8271.status = 0x8C; - i8271.result = 0; - i8271_NMI(); - } - i8271.written = 0; - return i8271.data; -} - -void i8271_writeprotect() -{ - i8271.result = 0x12; - i8271.status = 0x18; - i8271_NMI(); - fdc_time = 0; -} +/*B-em v2.2 by Tom Walker + 8271 FDC emulation*/ + +#include +#include +#include "b-em.h" +#include "6502.h" +#include "i8271.h" +#include "disc.h" +#include "model.h" + +void i8271_callback(); +void i8271_data(uint8_t dat); +void i8271_spindown(); +void i8271_finishread(); +void i8271_notfound(); +void i8271_datacrcerror(); +void i8271_headercrcerror(); +void i8271_writeprotect(); +int i8271_getdata(int last); + +int byte; +int i8271_verify = 0; + +struct +{ + uint8_t command, params[5]; + int drivesel; + int paramnum, paramreq; + uint8_t status; + uint8_t result; + int curtrack[2], cursector; + int realtrack[2]; + int sectorsleft; + uint8_t data; + int phase; + int written; + + uint8_t drvout; +} i8271; + +void i8271_reset() +{ + if (I8271) + { + fdc_callback = i8271_callback; + fdc_data = i8271_data; + fdc_spindown = i8271_spindown; + fdc_finishread = i8271_finishread; + fdc_notfound = i8271_notfound; + fdc_datacrcerror = i8271_datacrcerror; + fdc_headercrcerror = i8271_headercrcerror; + fdc_writeprotect = i8271_writeprotect; + fdc_getdata = i8271_getdata; + } + i8271.paramnum = i8271.paramreq = 0; + i8271.status = 0; +// printf("Reset 8271\n"); + fdc_time = 0; + i8271.curtrack[0] = i8271.curtrack[1] = 0; + i8271.command = 0xFF; + i8271.realtrack[0] = i8271.realtrack[1] = 0; + motorspin = 45000; +} + +static void i8271_NMI() +{ + if (i8271.status & 8) + { + nmi = 1; +// printf("NMI\n"); + } + else nmi = 0; +} + + +void i8271_spinup() +{ + motoron = 1; + motorspin = 0; +} + +void i8271_spindown() +{ + motoron = 0; +} + +void i8271_setspindown() +{ + motorspin = 45000; +} + + +int params[][2]= +{ + {0x35, 4}, {0x29, 1}, {0x2C, 0}, {0x3D, 1}, {0x3A, 2}, {0x13, 3}, {0x0B, 3}, {0x1B, 3}, {0x1F, 3}, {0x23, 5}, {-1, -1} +}; + +int i8271_getparams() +{ + int c = 0; + while (params[c][0] != -1) + { + if (params[c][0] == i8271.command) + return params[c][1]; + c++; + } + return 0; +/* printf("Unknown 8271 command %02X\n",i8271.command); + dumpregs(); + exit(-1);*/ +} + +uint8_t i8271_read(uint16_t addr) +{ +// printf("Read 8271 %04X\n",addr); + switch (addr & 7) + { + case 0: /*Status register*/ +// printf("Read status reg %04X %02X\n",pc,i8271.status); + return i8271.status; + case 1: /*Result register*/ + i8271.status &= ~0x18; + i8271_NMI(); +// printf("Read result reg %04X %02X\n",pc,i8271.status); + // output=1; timetolive=50; + return i8271.result; + case 4: /*Data register*/ + i8271.status &= ~0xC; + i8271_NMI(); +// printf("Read data reg %04X %02X\n",pc,i8271.status); + return i8271.data; + } + return 0; +} + +#define track0 (i8271.curtrack[curdrive] ? 0 : 2) + +void i8271_seek() +{ + int diff = i8271.params[0] - i8271.curtrack[curdrive]; + i8271.realtrack[curdrive] += diff; + disc_seek(curdrive, i8271.realtrack[curdrive]); +} + +void i8271_write(uint16_t addr, uint8_t val) +{ +// printf("Write 8271 %04X %02X\n",addr,val); + switch (addr&7) + { + case 0: /*Command register*/ + if (i8271.status & 0x80) return; + i8271.command = val & 0x3F; + if (i8271.command == 0x17) i8271.command = 0x13; +// printf("8271 command %02X!\n",i8271.command); + i8271.drivesel = val >> 6; + curdrive = (val & 0x80) ? 1 : 0; + i8271.paramnum = 0; + i8271.paramreq = i8271_getparams(); + i8271.status = 0x80; + if (!i8271.paramreq) + { + switch (i8271.command) + { + case 0x2C: /*Read drive status*/ + i8271.status = 0x10; + i8271.result = 0x80 | 8 | track0; + if (i8271.drivesel & 1) i8271.result |= 0x04; + if (i8271.drivesel & 2) i8271.result |= 0x40; +// printf("Status %02X\n",i8271.result); + break; + + default: + i8271.result = 0x18; + i8271.status = 0x18; + i8271_NMI(); + fdc_time = 0; + break; +// printf("Unknown 8271 command %02X 3\n",i8271.command); +// dumpregs(); +// exit(-1); + } + } + break; + case 1: /*Parameter register*/ + if (i8271.paramnum < 5) + i8271.params[i8271.paramnum++] = val; + if (i8271.paramnum == i8271.paramreq) + { + switch (i8271.command) + { + case 0x0B: /*Write sector*/ + i8271.sectorsleft = i8271.params[2] & 31; + i8271.cursector = i8271.params[1]; + i8271_spinup(); + i8271.phase = 0; + if (i8271.curtrack[curdrive] != i8271.params[0]) i8271_seek(); + else fdc_time = 200; + break; + case 0x13: /*Read sector*/ + i8271.sectorsleft = i8271.params[2] & 31; + i8271.cursector = i8271.params[1]; + i8271_spinup(); + i8271.phase = 0; + if (i8271.curtrack[curdrive] != i8271.params[0]) i8271_seek(); + else fdc_time = 200; + break; + case 0x1F: /*Verify sector*/ + i8271.sectorsleft = i8271.params[2] & 31; + i8271.cursector = i8271.params[1]; + i8271_spinup(); + i8271.phase = 0; + if (i8271.curtrack[curdrive] != i8271.params[0]) i8271_seek(); + else fdc_time = 200; + i8271_verify = 1; + break; + case 0x1B: /*Read ID*/ +// printf("8271 : Read ID start\n"); + i8271.sectorsleft = i8271.params[2] & 31; + i8271_spinup(); + i8271.phase = 0; + if (i8271.curtrack[curdrive] != i8271.params[0]) i8271_seek(); + else fdc_time = 200; + break; + case 0x23: /*Format track*/ + i8271_spinup(); + i8271.phase = 0; + if (i8271.curtrack[curdrive] != i8271.params[0]) i8271_seek(); + else fdc_time = 200; + break; + break; + case 0x29: /*Seek*/ +// fdc_time=10000; + i8271_seek(); + i8271_spinup(); + break; + case 0x35: /*Specify*/ + i8271.status = 0; + break; + case 0x3A: /*Write special register*/ + i8271.status = 0; +// printf("Write special %02X\n",i8271.params[0]); + switch (i8271.params[0]) + { + case 0x12: i8271.curtrack[0] = val; /*printf("Write real track now %i\n",val);*/ break; + case 0x17: break; /*Mode register*/ + case 0x1A: i8271.curtrack[1] = val; /*printf("Write real track now %i\n",val);*/ break; + case 0x23: i8271.drvout = i8271.params[1]; break; + default: + i8271.result = 0x18; + i8271.status = 0x18; + i8271_NMI(); + fdc_time = 0; + break; +// default: +// printf("8271 Write bad special register %02X\n",i8271.params[0]); +// dumpregs(); +// exit(-1); + } + break; + case 0x3D: /*Read special register*/ + i8271.status = 0x10; + i8271.result = 0; + switch (i8271.params[0]) + { + case 0x06: i8271.result = 0; break; + case 0x12: i8271.result = i8271.curtrack[0]; break; + case 0x1A: i8271.result = i8271.curtrack[1]; break; + case 0x23: i8271.result = i8271.drvout; break; + default: + i8271.result = 0x18; + i8271.status = 0x18; + i8271_NMI(); + fdc_time = 0; + break; +// default: +// printf("8271 Read bad special register %02X\n",i8271.params[0]); +// dumpregs(); +// exit(-1); + } + break; + + default: + i8271.result = 0x18; + i8271.status = 0x18; + i8271_NMI(); + fdc_time = 0; + break; +// printf("Unknown 8271 command %02X 2\n",i8271.command); +// dumpregs(); +// exit(-1); + } + } + break; + case 2: /*Reset register*/ + if (val & 1) i8271_reset(); + break; + case 4: /*Data register*/ + i8271.data = val; + i8271.written = 1; + i8271.status &= ~0xC; + i8271_NMI(); + break; + } +} + +void i8271_callback() +{ + fdc_time = 0; +// printf("Callback 8271 - command %02X\n",i8271.command); + switch (i8271.command) + { + case 0x0B: /*Write*/ + if (!i8271.phase) + { + i8271.curtrack[curdrive] = i8271.params[0]; + disc_writesector(curdrive, i8271.cursector, i8271.params[0], (i8271.drvout & 0x20) ? 1 : 0, 0); + i8271.phase = 1; + + i8271.status = 0x8C; + i8271.result = 0; + i8271_NMI(); + return; + } + i8271.sectorsleft--; + if (!i8271.sectorsleft) + { + i8271.status = 0x18; + i8271.result = 0; + i8271_NMI(); + i8271_setspindown(); + i8271_verify=0; + return; + } + i8271.cursector++; + disc_writesector(curdrive, i8271.cursector, i8271.params[0], (i8271.drvout & 0x20) ? 1 : 0, 0); + byte = 0; + i8271.status = 0x8C; + i8271.result = 0; + i8271_NMI(); + break; + + case 0x13: /*Read*/ + case 0x1F: /*Verify*/ + if (!i8271.phase) + { +// printf("Seek to %i\n",i8271.params[0]); + i8271.curtrack[curdrive] = i8271.params[0]; +// i8271.realtrack+=diff; +// disc_seek(0,i8271.realtrack); +// printf("Re-seeking - track now %i %i\n",i8271.curtrack,i8271.realtrack); + disc_readsector(curdrive, i8271.cursector, i8271.params[0], (i8271.drvout & 0x20) ? 1 : 0, 0); + i8271.phase = 1; + return; + } + i8271.sectorsleft--; + if (!i8271.sectorsleft) + { + i8271.status = 0x18; + i8271.result = 0; + i8271_NMI(); + i8271_setspindown(); + i8271_verify=0; + return; + } + i8271.cursector++; + disc_readsector(curdrive, i8271.cursector, i8271.params[0], (i8271.drvout & 0x20) ? 1 : 0, 0); + byte = 0; + break; + + case 0x1B: /*Read ID*/ +// printf("Read ID callback %i\n",i8271.phase); + if (!i8271.phase) + { + i8271.curtrack[curdrive] = i8271.params[0]; +// i8271.realtrack+=diff; +// disc_seek(0,i8271.realtrack); + disc_readaddress(curdrive, i8271.params[0], (i8271.drvout & 0x20) ? 1 : 0, 0); + i8271.phase = 1; + return; + } +// printf("Read ID track %i %i\n",i8271.params[0],i8271.sectorsleft); + i8271.sectorsleft--; + if (!i8271.sectorsleft) + { + i8271.status = 0x18; + i8271.result = 0; + i8271_NMI(); +// printf("8271 : ID read done!\n"); + i8271_setspindown(); + return; + } + i8271.cursector++; + disc_readaddress(curdrive, i8271.params[0], (i8271.drvout & 0x20) ? 1 : 0, 0); + byte = 0; + break; + + case 0x23: /*Format*/ + if (!i8271.phase) + { + i8271.curtrack[curdrive] = i8271.params[0]; + disc_writesector(curdrive, i8271.cursector, i8271.params[0], (i8271.drvout & 0x20) ? 1 : 0, 0); + i8271.phase = 1; + + i8271.status = 0x8C; + i8271.result = 0; + i8271_NMI(); + return; + } + if (i8271.phase == 2) + { + i8271.status = 0x18; + i8271.result = 0; + i8271_NMI(); + i8271_setspindown(); + i8271_verify=0; + return; + } + disc_format(curdrive, i8271.params[0], (i8271.drvout & 0x20) ? 1 : 0, 0); + i8271.phase = 2; + break; + + case 0x29: /*Seek*/ + i8271.curtrack[curdrive] = i8271.params[0]; +// i8271.realtrack+=diff; + i8271.status = 0x18; + i8271.result = 0; + i8271_NMI(); +// disc_seek(0,i8271.realtrack); +// printf("Seek done!\n"); + i8271_setspindown(); + break; + + case 0xFF: break; + + default: break; + printf("Unknown 8271 command %02X 3\n", i8271.command); + dumpregs(); + exit(-1); + } +} + +void i8271_data(uint8_t dat) +{ + if (i8271_verify) return; + i8271.data = dat; + i8271.status = 0x8C; + i8271.result = 0; + i8271_NMI(); +// printf("%02X : Data %02X\n",byte,dat); + byte++; +} + +void i8271_finishread() +{ + fdc_time = 200; +} + +void i8271_notfound() +{ + i8271.result = 0x18; + i8271.status = 0x18; + i8271_NMI(); + fdc_time = 0; +// printf("Not found 8271\n"); +} + +void i8271_datacrcerror() +{ + i8271.result = 0x0E; + i8271.status = 0x18; + i8271_NMI(); + fdc_time = 0; +// printf("CRCdat 8271\n"); +} + +void i8271_headercrcerror() +{ + i8271.result = 0x0C; + i8271.status = 0x18; + i8271_NMI(); + fdc_time = 0; +// printf("CRChead 8271\n"); +} + +int i8271_getdata(int last) +{ +// printf("Disc get data %i\n",byte); + byte++; + if (!i8271.written) return -1; + if (!last) + { + i8271.status = 0x8C; + i8271.result = 0; + i8271_NMI(); + } + i8271.written = 0; + return i8271.data; +} + +void i8271_writeprotect() +{ + i8271.result = 0x12; + i8271.status = 0x18; + i8271_NMI(); + fdc_time = 0; +} diff --git a/src/i8271.h b/src/i8271.h index 13bde5d3..699e0513 100644 --- a/src/i8271.h +++ b/src/i8271.h @@ -1,4 +1,4 @@ -void i8271_reset(); -uint8_t i8271_read(uint16_t addr); -void i8271_write(uint16_t addr, uint8_t val); - +void i8271_reset(); +uint8_t i8271_read(uint16_t addr); +void i8271_write(uint16_t addr, uint8_t val); + diff --git a/src/ide.c b/src/ide.c index a086b077..49b222be 100644 --- a/src/ide.c +++ b/src/ide.c @@ -1,327 +1,327 @@ -/*B-em v2.2 by Tom Walker - IDE emulation*/ -#include -#include "b-em.h" -#include "ide.h" - -int ide_enable; -int ide_count; - -static struct -{ - uint8_t atastat; - uint8_t error,status; - int secount,sector,cylinder,head,drive,cylprecomp; - uint8_t command; - uint8_t fdisk; - int pos,pos2; - int spt,hpc; -} ide; - -static uint16_t ide_buffer[256]; -static uint8_t *ide_bufferb; -static uint8_t ide_buffer2[256]; -static FILE *hdfile[2] = {NULL, NULL}; - -void ide_close() -{ - if (hdfile[0]) fclose(hdfile[0]); - if (hdfile[1]) fclose(hdfile[1]); -} - -void ide_init(void) -{ - char s[256]; - ide.pos2 = 1; - ide.atastat = 0x40; - ide_count = 0; - if (!hdfile[0]) - { - sprintf(s, "%shd4.hdf", exedir); - hdfile[0] = fopen(s, "rb+"); - if (!hdfile[0]) - { - hdfile[0] = fopen(s, "wb"); - putc(0, hdfile[0]); - fclose(hdfile[0]); - hdfile[0] = fopen(s, "rb+"); - } - } - if (!hdfile[1]) - { - sprintf(s, "%shd5.hdf", exedir); - hdfile[1] = fopen(s, "rb+"); - if (!hdfile[1]) - { - hdfile[1] = fopen(s, "wb"); - putc(0, hdfile[1]); - fclose(hdfile[1]); - hdfile[1] = fopen(s, "rb+"); - } - } - ide_bufferb = (uint8_t *)ide_buffer; - ide.spt = 63; - ide.hpc = 16; - - ide.atastat = 0x40; - ide.error = 0; - ide.secount = 1; - ide.sector = 1; - ide.head = 0; - ide.cylinder = 0; -} - -void ide_write(uint16_t addr, uint8_t val) -{ - if (!ide_enable) return; -// rpclog("Write IDE %04X %02X %04X\n",addr,val,pc); - switch (addr & 0xF) - { - case 0x0: - ide_bufferb[ide.pos] = val; - ide.pos2 = ide.pos + 1; - ide.pos += 2; - if (ide.pos >= 512) - { - ide.pos = 0; - ide.atastat = 0x80; - ide_count = 1000; - } - return; - case 0x8: - ide_bufferb[ide.pos2] = val; - return; - case 0x1: - ide.cylprecomp = val; - return; - case 0x2: - ide.secount = val; - return; - case 0x3: - ide.sector = val; - return; - case 0x4: - ide.cylinder = (ide.cylinder & 0xFF00) | val; - return; - case 0x5: - ide.cylinder = (ide.cylinder & 0xFF) | (val << 8); - return; - case 0x6: - ide.head = val & 0xF; - ide.drive = (val >> 4) & 1; - return; - case 0x7: /*Command register*/ - ide.command = val; - ide.error = 0; -// rpclog("IDE command %02X\n",val); - switch (val) - { - case 0x10: /*Restore*/ - case 0x70: /*Seek*/ - ide.atastat = 0x40; - ide_count = 100; - return; - case 0x20: /*Read sector*/ - ide.atastat = 0x80; - ide_count = 200; - return; - case 0x30: /*Write sector*/ - ide.atastat = 0x08 | 0x40; - ide.pos = 0; - return; - case 0x40: /*Read verify*/ - ide.atastat = 0x80; - ide_count = 200; - return; - case 0x50: /*Format track*/ - ide.atastat = 0x08; - ide.pos = 0; - return; - case 0x91: /*Set parameters*/ - ide.atastat = 0x80; - ide_count = 200; - return; - case 0xA1: /*Identify packet device*/ - case 0xE3: /*Idle*/ - ide.atastat = 0x80; - ide_count = 200; - return; - case 0xEC: /*Identify device*/ - ide.atastat = 0x80; - ide_count = 200; - return; - } - rpclog("Bad IDE command %02X\n", val); - exit(-1); - return; - } -} - -static int indexcount=0; - -uint8_t ide_read(uint16_t addr) -{ - uint8_t temp; - if (!ide_enable) return 0xFC; -// rpclog("Read IDE %04X %04X %02X\n",addr,pc,ide.atastat); - switch (addr&0xF) - { - case 0x0: - temp = ide_bufferb[ide.pos]; - ide.pos2 = ide.pos + 1; - ide.pos += 2; - - if (ide.pos >= 512) - { - ide.pos = 0; - ide.atastat = 0x40; - if (ide.command == 0x20) - { - ide.secount--; - if (ide.secount) - { - ide.atastat = 0x08; - ide.sector++; - if (ide.sector == (ide.spt + 1)) - { - ide.sector = 1; - ide.head++; - if (ide.head == ide.hpc) - { - ide.head = 0; - ide.cylinder++; - } - } - ide.atastat = 0x80; - ide_count = 200; - } - } - } - return temp; - case 0x8: - temp = ide_bufferb[ide.pos2]; - return temp; - case 0x1: - return ide.error; - case 0x2: - return ide.secount; - case 0x3: - return ide.sector; - case 0x4: - return ide.cylinder & 0xFF; - case 0x5: - return ide.cylinder >> 8; - case 0x6: - return ide.head | (ide.drive << 4); - case 0x7: - indexcount++; - if (indexcount == 199) - { - indexcount = 0; - return ide.atastat | 2; - } - return ide.atastat; - } - return 0xFF; -} - -void ide_callback() -{ - int addr, c; - - switch (ide.command) - { - case 0x10: /*Restore*/ - case 0x70: /*Seek*/ - ide.atastat = 0x40; - return; - case 0x20: /*Read sectors*/ - addr = ((((ide.cylinder * ide.hpc) + ide.head) * ide.spt) + (ide.sector)) * 256; - fseek(hdfile[ide.drive], addr, SEEK_SET); - memset(ide_buffer, 0, 512); - fread(ide_buffer2, 256, 1, hdfile[ide.drive]); - for (c = 0; c < 256; c++) ide_bufferb[c << 1] = ide_buffer2[c]; - ide.pos = 0; - ide.atastat = 0x08 | 0x40; - return; - case 0x30: /*Write sector*/ - addr = ((((ide.cylinder * ide.hpc) + ide.head) * ide.spt) + (ide.sector)) * 256; - fseek(hdfile[ide.drive], addr, SEEK_SET); - for (c = 0; c < 256; c++) ide_buffer2[c] = ide_bufferb[c << 1]; - fwrite(ide_buffer2, 256, 1, hdfile[ide.drive]); - ide.secount--; - if (ide.secount) - { - ide.atastat = 0x08 | 0x40; - ide.pos = 0; - ide.sector++; - if (ide.sector == (ide.spt + 1)) - { - ide.sector = 1; - ide.head++; - if (ide.head == ide.hpc) - { - ide.head = 0; - ide.cylinder++; - } - } - } - else - ide.atastat = 0x40; - return; - case 0x40: /*Read verify*/ - ide.pos = 0; - ide.atastat = 0x40; - return; - case 0x50: /*Format track*/ - addr = (((ide.cylinder * ide.hpc) + ide.head) * ide.spt) * 256; - fseek(hdfile[ide.drive], addr, SEEK_SET); - memset(ide_bufferb, 0, 512); - for (c = 0; c < ide.secount; c++) - { - fwrite(ide_buffer, 256, 1, hdfile[ide.drive]); - } - ide.atastat = 0x40; - return; - case 0x91: /*Set parameters*/ - ide.spt = ide.secount; - ide.hpc = ide.head + 1; - ide.atastat = 0x40; - return; - case 0xA1: - case 0xE3: - ide.atastat = 0x41; - ide.error = 4; - return; - case 0xEC: - memset(ide_buffer, 0, 512); - ide_buffer[1] = 101; /*Cylinders*/ - ide_buffer[3] = 16; /*Heads*/ - ide_buffer[6] = 63; /*Sectors*/ - for (addr = 10; addr < 20; addr++) - ide_buffer[addr] = 0x2020; - for (addr = 23; addr < 47; addr++) - ide_buffer[addr] = 0x2020; - ide_bufferb[46^1] = 'v'; /*Firmware version*/ - ide_bufferb[47^1] = '2'; - ide_bufferb[48^1] = '.'; - ide_bufferb[49^1] = '1'; - ide_bufferb[54^1] = 'B'; /*Drive model*/ - ide_bufferb[55^1] = '-'; - ide_bufferb[56^1] = 'e'; - ide_bufferb[57^1] = 'm'; - ide_bufferb[58^1] = ' '; - ide_bufferb[59^1] = 'H'; - ide_bufferb[60^1] = 'D'; - ide_buffer[50] = 0x4000; /*Capabilities*/ - ide_buffer[53] = 1; - ide_buffer[56] = ide.spt; - ide_buffer[55] = ide.hpc; - ide_buffer[54] = (101 * 16 * 63) / (ide.spt * ide.hpc); - ide_buffer[57] = (101 * 16 * 63) & 0xFFFF; - ide_buffer[58] = (101 * 16 * 63) >> 16; - ide.pos = 0; - ide.atastat = 0x08; - return; - } -} +/*B-em v2.2 by Tom Walker + IDE emulation*/ +#include +#include "b-em.h" +#include "ide.h" + +int ide_enable; +int ide_count; + +static struct +{ + uint8_t atastat; + uint8_t error,status; + int secount,sector,cylinder,head,drive,cylprecomp; + uint8_t command; + uint8_t fdisk; + int pos,pos2; + int spt,hpc; +} ide; + +static uint16_t ide_buffer[256]; +static uint8_t *ide_bufferb; +static uint8_t ide_buffer2[256]; +static FILE *hdfile[2] = {NULL, NULL}; + +void ide_close() +{ + if (hdfile[0]) fclose(hdfile[0]); + if (hdfile[1]) fclose(hdfile[1]); +} + +void ide_init(void) +{ + char s[256]; + ide.pos2 = 1; + ide.atastat = 0x40; + ide_count = 0; + if (!hdfile[0]) + { + sprintf(s, "%shd4.hdf", exedir); + hdfile[0] = fopen(s, "rb+"); + if (!hdfile[0]) + { + hdfile[0] = fopen(s, "wb"); + putc(0, hdfile[0]); + fclose(hdfile[0]); + hdfile[0] = fopen(s, "rb+"); + } + } + if (!hdfile[1]) + { + sprintf(s, "%shd5.hdf", exedir); + hdfile[1] = fopen(s, "rb+"); + if (!hdfile[1]) + { + hdfile[1] = fopen(s, "wb"); + putc(0, hdfile[1]); + fclose(hdfile[1]); + hdfile[1] = fopen(s, "rb+"); + } + } + ide_bufferb = (uint8_t *)ide_buffer; + ide.spt = 63; + ide.hpc = 16; + + ide.atastat = 0x40; + ide.error = 0; + ide.secount = 1; + ide.sector = 1; + ide.head = 0; + ide.cylinder = 0; +} + +void ide_write(uint16_t addr, uint8_t val) +{ + if (!ide_enable) return; +// rpclog("Write IDE %04X %02X %04X\n",addr,val,pc); + switch (addr & 0xF) + { + case 0x0: + ide_bufferb[ide.pos] = val; + ide.pos2 = ide.pos + 1; + ide.pos += 2; + if (ide.pos >= 512) + { + ide.pos = 0; + ide.atastat = 0x80; + ide_count = 1000; + } + return; + case 0x8: + ide_bufferb[ide.pos2] = val; + return; + case 0x1: + ide.cylprecomp = val; + return; + case 0x2: + ide.secount = val; + return; + case 0x3: + ide.sector = val; + return; + case 0x4: + ide.cylinder = (ide.cylinder & 0xFF00) | val; + return; + case 0x5: + ide.cylinder = (ide.cylinder & 0xFF) | (val << 8); + return; + case 0x6: + ide.head = val & 0xF; + ide.drive = (val >> 4) & 1; + return; + case 0x7: /*Command register*/ + ide.command = val; + ide.error = 0; +// rpclog("IDE command %02X\n",val); + switch (val) + { + case 0x10: /*Restore*/ + case 0x70: /*Seek*/ + ide.atastat = 0x40; + ide_count = 100; + return; + case 0x20: /*Read sector*/ + ide.atastat = 0x80; + ide_count = 200; + return; + case 0x30: /*Write sector*/ + ide.atastat = 0x08 | 0x40; + ide.pos = 0; + return; + case 0x40: /*Read verify*/ + ide.atastat = 0x80; + ide_count = 200; + return; + case 0x50: /*Format track*/ + ide.atastat = 0x08; + ide.pos = 0; + return; + case 0x91: /*Set parameters*/ + ide.atastat = 0x80; + ide_count = 200; + return; + case 0xA1: /*Identify packet device*/ + case 0xE3: /*Idle*/ + ide.atastat = 0x80; + ide_count = 200; + return; + case 0xEC: /*Identify device*/ + ide.atastat = 0x80; + ide_count = 200; + return; + } + rpclog("Bad IDE command %02X\n", val); + exit(-1); + return; + } +} + +static int indexcount=0; + +uint8_t ide_read(uint16_t addr) +{ + uint8_t temp; + if (!ide_enable) return 0xFC; +// rpclog("Read IDE %04X %04X %02X\n",addr,pc,ide.atastat); + switch (addr&0xF) + { + case 0x0: + temp = ide_bufferb[ide.pos]; + ide.pos2 = ide.pos + 1; + ide.pos += 2; + + if (ide.pos >= 512) + { + ide.pos = 0; + ide.atastat = 0x40; + if (ide.command == 0x20) + { + ide.secount--; + if (ide.secount) + { + ide.atastat = 0x08; + ide.sector++; + if (ide.sector == (ide.spt + 1)) + { + ide.sector = 1; + ide.head++; + if (ide.head == ide.hpc) + { + ide.head = 0; + ide.cylinder++; + } + } + ide.atastat = 0x80; + ide_count = 200; + } + } + } + return temp; + case 0x8: + temp = ide_bufferb[ide.pos2]; + return temp; + case 0x1: + return ide.error; + case 0x2: + return ide.secount; + case 0x3: + return ide.sector; + case 0x4: + return ide.cylinder & 0xFF; + case 0x5: + return ide.cylinder >> 8; + case 0x6: + return ide.head | (ide.drive << 4); + case 0x7: + indexcount++; + if (indexcount == 199) + { + indexcount = 0; + return ide.atastat | 2; + } + return ide.atastat; + } + return 0xFF; +} + +void ide_callback() +{ + int addr, c; + + switch (ide.command) + { + case 0x10: /*Restore*/ + case 0x70: /*Seek*/ + ide.atastat = 0x40; + return; + case 0x20: /*Read sectors*/ + addr = ((((ide.cylinder * ide.hpc) + ide.head) * ide.spt) + (ide.sector)) * 256; + fseek(hdfile[ide.drive], addr, SEEK_SET); + memset(ide_buffer, 0, 512); + fread(ide_buffer2, 256, 1, hdfile[ide.drive]); + for (c = 0; c < 256; c++) ide_bufferb[c << 1] = ide_buffer2[c]; + ide.pos = 0; + ide.atastat = 0x08 | 0x40; + return; + case 0x30: /*Write sector*/ + addr = ((((ide.cylinder * ide.hpc) + ide.head) * ide.spt) + (ide.sector)) * 256; + fseek(hdfile[ide.drive], addr, SEEK_SET); + for (c = 0; c < 256; c++) ide_buffer2[c] = ide_bufferb[c << 1]; + fwrite(ide_buffer2, 256, 1, hdfile[ide.drive]); + ide.secount--; + if (ide.secount) + { + ide.atastat = 0x08 | 0x40; + ide.pos = 0; + ide.sector++; + if (ide.sector == (ide.spt + 1)) + { + ide.sector = 1; + ide.head++; + if (ide.head == ide.hpc) + { + ide.head = 0; + ide.cylinder++; + } + } + } + else + ide.atastat = 0x40; + return; + case 0x40: /*Read verify*/ + ide.pos = 0; + ide.atastat = 0x40; + return; + case 0x50: /*Format track*/ + addr = (((ide.cylinder * ide.hpc) + ide.head) * ide.spt) * 256; + fseek(hdfile[ide.drive], addr, SEEK_SET); + memset(ide_bufferb, 0, 512); + for (c = 0; c < ide.secount; c++) + { + fwrite(ide_buffer, 256, 1, hdfile[ide.drive]); + } + ide.atastat = 0x40; + return; + case 0x91: /*Set parameters*/ + ide.spt = ide.secount; + ide.hpc = ide.head + 1; + ide.atastat = 0x40; + return; + case 0xA1: + case 0xE3: + ide.atastat = 0x41; + ide.error = 4; + return; + case 0xEC: + memset(ide_buffer, 0, 512); + ide_buffer[1] = 101; /*Cylinders*/ + ide_buffer[3] = 16; /*Heads*/ + ide_buffer[6] = 63; /*Sectors*/ + for (addr = 10; addr < 20; addr++) + ide_buffer[addr] = 0x2020; + for (addr = 23; addr < 47; addr++) + ide_buffer[addr] = 0x2020; + ide_bufferb[46^1] = 'v'; /*Firmware version*/ + ide_bufferb[47^1] = '2'; + ide_bufferb[48^1] = '.'; + ide_bufferb[49^1] = '1'; + ide_bufferb[54^1] = 'B'; /*Drive model*/ + ide_bufferb[55^1] = '-'; + ide_bufferb[56^1] = 'e'; + ide_bufferb[57^1] = 'm'; + ide_bufferb[58^1] = ' '; + ide_bufferb[59^1] = 'H'; + ide_bufferb[60^1] = 'D'; + ide_buffer[50] = 0x4000; /*Capabilities*/ + ide_buffer[53] = 1; + ide_buffer[56] = ide.spt; + ide_buffer[55] = ide.hpc; + ide_buffer[54] = (101 * 16 * 63) / (ide.spt * ide.hpc); + ide_buffer[57] = (101 * 16 * 63) & 0xFFFF; + ide_buffer[58] = (101 * 16 * 63) >> 16; + ide.pos = 0; + ide.atastat = 0x08; + return; + } +} diff --git a/src/ide.h b/src/ide.h index 4417924b..30648499 100644 --- a/src/ide.h +++ b/src/ide.h @@ -1,8 +1,8 @@ -extern int ide_enable; -extern int ide_count; - -void ide_init(); -void ide_close(); -void ide_write(uint16_t addr, uint8_t val); -uint8_t ide_read(uint16_t addr); -void ide_callback(); +extern int ide_enable; +extern int ide_count; + +void ide_init(); +void ide_close(); +void ide_write(uint16_t addr, uint8_t val); +uint8_t ide_read(uint16_t addr); +void ide_callback(); diff --git a/src/keyboard.c b/src/keyboard.c index 34bf49ad..a07f13a8 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1,147 +1,147 @@ -#include -#include "b-em.h" -#include "via.h" -#include "sysvia.h" -#include "keyboard.h" -#include "model.h" - -int keylookup[128]; -int keyas = 0; - -int keycol, keyrow; -int bbckey[16][16]; - -/*Keyboard*/ -#include "scan2bbc.h" - -static uint8_t codeconvert[128]= -{ - 0,30,48,46,32,18,33,34, //0 - 35,23,36,37,38,50,49,24, //8 - 25,16,19,31,20,22,47,17, //16 - 45,21,44,11,2,3,4,5, //24 - 6,7,8,9,10,100,101,102, //32 - 103,104,105,106,107,108,109,59, //40 - 60,61,62,63,64,65,66,67, //48 - 68,87,88,1,41,12,13,14, //56 - 15,26,27,28,39,40,43,86, //64 - 51,52,53,57,0,83,116,79, //72 - 0,115,75,77,72,80,114,55, //80 - 74,78,83,111,84,0,115,125, //88 - 112,121,123,42,54,29,0,56, //96 - 0,39,92,56,70,69,58,0, //104 - 0,0,58,0,0,0,0,0, //112 - 0,0,0,0,0,113,58,0, //120 -}; - -void key_press(int row, int col) -{ - bbckey[col][row] = 1; -} - -void key_release(int row, int col) -{ - bbckey[col][row] = 0; -} - -static inline int TranslateKey(int index, int *row, int *col) -{ - unsigned int vkey = scan2bbc[index & 127]; - if (vkey == 0xaa) return -1; - *col = vkey & 15; - *row = (vkey >> 4) & 15; - return *row; -} - -static int keys2[128]; - -void key_clear() -{ - int c; - int row, col; - for (c = 0; c < 128; c++) - { - keys2[c] = 0; - if (TranslateKey(codeconvert[keylookup[c]], &row, &col) > 0) key_release(row,col); - } -} - -void key_check() -{ - int c; - int row,col; - int rc; -// if (key[KEY_A]) printf("KEY_A!\n"); - memset(bbckey, 0, sizeof(bbckey)); - for (c = 0; c < 128; c++) - { - rc = c; - if (keyas && c == KEY_A) rc = KEY_CAPSLOCK; -// if (keyas && c==KEY_S) rc=KEY_LCONTROL; - if (key[c] && rc != KEY_F11) - { -// rpclog("%i %i\n",c,rc); - if (TranslateKey(codeconvert[keylookup[rc]], &row, &col)>0) - { - if (key[c]) - key_press(row, col); -// else -// releasekey(row,col); - } - } - } - if (key[keylookup[KEY_RSHIFT]] || key[keylookup[KEY_LSHIFT]] || autoboot) - key_press(0, 0); - if (key[keylookup[KEY_LCONTROL]] || key[keylookup[KEY_RCONTROL]] || (keyas && key[KEY_S])) - key_press(0, 1); - for (c = 0; c < 128; c++) - keys2[c] = key[c]; - key_update(); -} - -void key_update() -{ - int c,d; - if (IC32 & 8) - { - for (d = 0; d < ((MASTER) ? 13 : 10); d++) - { - for (c = 1; c < 8; c++) - { - if (bbckey[d][c]) - { - sysvia_set_ca2(1); - return; - } - } - } - } - else - { - if (keycol < ((MASTER) ? 13 : 10)) - { - for (c = 1; c < 8; c++) - { - if (bbckey[keycol][c]) - { - sysvia_set_ca2(1); - return; - } - } - } - } - sysvia_set_ca2(0); -} - -void key_set_DIPS(uint8_t dips) -{ - int c; - for (c = 9; c >= 2; c--) - { - if (dips & 1) - key_press(0, c); - else - key_release(0, c); - dips >>= 1; - } -} +#include +#include "b-em.h" +#include "via.h" +#include "sysvia.h" +#include "keyboard.h" +#include "model.h" + +int keylookup[128]; +int keyas = 0; + +int keycol, keyrow; +int bbckey[16][16]; + +/*Keyboard*/ +#include "scan2bbc.h" + +static uint8_t codeconvert[128]= +{ + 0,30,48,46,32,18,33,34, //0 + 35,23,36,37,38,50,49,24, //8 + 25,16,19,31,20,22,47,17, //16 + 45,21,44,11,2,3,4,5, //24 + 6,7,8,9,10,100,101,102, //32 + 103,104,105,106,107,108,109,59, //40 + 60,61,62,63,64,65,66,67, //48 + 68,87,88,1,41,12,13,14, //56 + 15,26,27,28,39,40,43,86, //64 + 51,52,53,57,0,83,116,79, //72 + 0,115,75,77,72,80,114,55, //80 + 74,78,83,111,84,0,115,125, //88 + 112,121,123,42,54,29,0,56, //96 + 0,39,92,56,70,69,58,0, //104 + 0,0,58,0,0,0,0,0, //112 + 0,0,0,0,0,113,58,0, //120 +}; + +void key_press(int row, int col) +{ + bbckey[col][row] = 1; +} + +void key_release(int row, int col) +{ + bbckey[col][row] = 0; +} + +static inline int TranslateKey(int index, int *row, int *col) +{ + unsigned int vkey = scan2bbc[index & 127]; + if (vkey == 0xaa) return -1; + *col = vkey & 15; + *row = (vkey >> 4) & 15; + return *row; +} + +static int keys2[128]; + +void key_clear() +{ + int c; + int row, col; + for (c = 0; c < 128; c++) + { + keys2[c] = 0; + if (TranslateKey(codeconvert[keylookup[c]], &row, &col) > 0) key_release(row,col); + } +} + +void key_check() +{ + int c; + int row,col; + int rc; +// if (key[KEY_A]) printf("KEY_A!\n"); + memset(bbckey, 0, sizeof(bbckey)); + for (c = 0; c < 128; c++) + { + rc = c; + if (keyas && c == KEY_A) rc = KEY_CAPSLOCK; +// if (keyas && c==KEY_S) rc=KEY_LCONTROL; + if (key[c] && rc != KEY_F11) + { +// rpclog("%i %i\n",c,rc); + if (TranslateKey(codeconvert[keylookup[rc]], &row, &col)>0) + { + if (key[c]) + key_press(row, col); +// else +// releasekey(row,col); + } + } + } + if (key[keylookup[KEY_RSHIFT]] || key[keylookup[KEY_LSHIFT]] || autoboot) + key_press(0, 0); + if (key[keylookup[KEY_LCONTROL]] || key[keylookup[KEY_RCONTROL]] || (keyas && key[KEY_S])) + key_press(0, 1); + for (c = 0; c < 128; c++) + keys2[c] = key[c]; + key_update(); +} + +void key_update() +{ + int c,d; + if (IC32 & 8) + { + for (d = 0; d < ((MASTER) ? 13 : 10); d++) + { + for (c = 1; c < 8; c++) + { + if (bbckey[d][c]) + { + sysvia_set_ca2(1); + return; + } + } + } + } + else + { + if (keycol < ((MASTER) ? 13 : 10)) + { + for (c = 1; c < 8; c++) + { + if (bbckey[keycol][c]) + { + sysvia_set_ca2(1); + return; + } + } + } + } + sysvia_set_ca2(0); +} + +void key_set_DIPS(uint8_t dips) +{ + int c; + for (c = 9; c >= 2; c--) + { + if (dips & 1) + key_press(0, c); + else + key_release(0, c); + dips >>= 1; + } +} diff --git a/src/keyboard.h b/src/keyboard.h index ef6cf766..715629c6 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -1,11 +1,11 @@ -extern int keycol,keyrow; -extern int bbckey[16][16]; - -extern int keylookup[128]; -extern int keyas; - -void key_press(int row, int col); -void key_release(int row, int col); -void key_clear(); -void key_check(); -void key_update(); +extern int keycol,keyrow; +extern int bbckey[16][16]; + +extern int keylookup[128]; +extern int keyas; + +void key_press(int row, int col); +void key_release(int row, int col); +void key_clear(); +void key_check(); +void key_update(); diff --git a/src/linux-gui.c b/src/linux-gui.c index 3686e43a..04d1a5ff 100644 --- a/src/linux-gui.c +++ b/src/linux-gui.c @@ -1,771 +1,770 @@ -/*B-em v2.2 by Tom Walker - Linux GUI*/ - -#ifndef WIN32 -#include -#include "b-em.h" -#include "resources.h" - -#include "config.h" -#include "ddnoise.h" -#include "debugger.h" -#include "disc.h" -#include "ide.h" -#include "keyboard.h" -#include "linux-gui.h" -#include "main.h" -#include "model.h" -#include "mouse.h" -#include "savestate.h" -#include "sid_b-em.h" -#include "sound.h" -#include "sn76489.h" -#include "tape.h" -#include "tube.h" -#include "video_render.h" - - -#undef printf - -int timerspeeds[] = {5, 12, 25, 38, 50, 75, 100, 150, 200, 250}; -int frameskips[] = {0, 0, 0, 0, 0, 0, 1, 2, 3, 4}; -int emuspeed = 4; - -void setejecttext(int d, char *s) -{ -} -void setquit() -{ -} - -extern int quited; -extern int windx,windy; - -MENU filemenu[6]; -MENU discmenu[8]; -MENU tapespdmenu[3]; -MENU tapemenu[5]; -MENU modelmenu[17]; -MENU tubespdmenu[6]; -#ifdef NS32016 -MENU tubemenu[7]; -#else -MENU tubemenu[6]; -#endif -MENU displaymenu[4]; -MENU bordersmenu[4]; -MENU videomenu[4]; -MENU sidtypemenu[15]; -MENU methodmenu[3]; -MENU residmenu[3]; -MENU waveformmenu[6]; -MENU ddtypemenu[3]; -MENU ddvolmenu[4]; -MENU soundmenu[11]; -MENU keymenu[3]; -MENU mousemenu[2]; -MENU idemenu[2]; -MENU settingsmenu[8]; -MENU miscmenu[3]; -MENU speedmenu[11]; -MENU mainmenu[6]; - -void gui_update() -{ - int x; - discmenu[4].flags = (writeprot[0]) ? D_SELECTED : 0; - discmenu[5].flags = (writeprot[1]) ? D_SELECTED : 0; - discmenu[6].flags = (defaultwriteprot) ? D_SELECTED : 0; - tapespdmenu[0].flags = (!fasttape) ? D_SELECTED : 0; - tapespdmenu[1].flags = (fasttape) ? D_SELECTED : 0; - for (x = 0; x < 16; x++) modelmenu[x].flags = 0; - for (x = 0; x < 16; x++) - { - if (curmodel == (int)modelmenu[x].dp) - modelmenu[x].flags = D_SELECTED; - } - #ifdef NS32016 - for (x = 0; x < 5; x++) tubemenu[x].flags = (selecttube == (int)tubemenu[x].dp) ? D_SELECTED : 0; - #else - for (x = 0; x < 4; x++) tubemenu[x].flags = (selecttube == (int)tubemenu[x].dp) ? D_SELECTED : 0; - #endif - for (x = 0; x < 5; x++) tubespdmenu[x].flags = (tube_6502_speed == (int)tubespdmenu[x].dp) ? D_SELECTED : 0; - displaymenu[0].flags = (vid_linedbl) ? D_SELECTED : 0; - displaymenu[1].flags = (vid_scanlines) ? D_SELECTED : 0; - displaymenu[2].flags = (vid_interlace) ? D_SELECTED : 0; - videomenu[2].flags = (fullscreen) ? D_SELECTED : 0; - for (x = 0; x < 3; x++) bordersmenu[x].flags = (vid_fullborders == (int)bordersmenu[x].dp) ? D_SELECTED : 0; - soundmenu[0].flags = (sound_internal) ? D_SELECTED : 0; - soundmenu[1].flags = (sound_beebsid) ? D_SELECTED : 0; - soundmenu[2].flags = (sound_dac) ? D_SELECTED : 0; - soundmenu[3].flags = (sound_ddnoise) ? D_SELECTED : 0; - soundmenu[4].flags = (sound_tape) ? D_SELECTED : 0; - soundmenu[5].flags = (sound_filter) ? D_SELECTED : 0; - for (x = 0; x < 5; x++) waveformmenu[x].flags = (curwave == (int)waveformmenu[x].dp) ? D_SELECTED : 0; - for (x = 0; x < 14; x++) sidtypemenu[x].flags = (cursid == (int)sidtypemenu[x].dp) ? D_SELECTED : 0; - methodmenu[0].flags = (!sidmethod) ? D_SELECTED : 0; - methodmenu[1].flags = (sidmethod) ? D_SELECTED : 0; - ddtypemenu[0].flags = (!ddnoise_type) ? D_SELECTED : 0; - ddtypemenu[1].flags = (ddnoise_type) ? D_SELECTED : 0; - for (x = 0; x < 3; x++) ddvolmenu[x].flags = (ddnoise_vol == (int)ddvolmenu[x].dp) ? D_SELECTED : 0; - keymenu[1].flags = (keyas) ? D_SELECTED : 0; - mousemenu[0].flags = (mouse_amx) ? D_SELECTED : 0; - for (x = 0; x < 10; x++) speedmenu[x].flags = (emuspeed == (int)speedmenu[x].dp) ? D_SELECTED : 0; - idemenu[0].flags = (ide_enable) ? D_SELECTED : 0; -} - -int gui_keydefine(); - -int gui_return() -{ - return D_CLOSE; -} - -int gui_reset() -{ - main_restart(); - return D_O_K; -} - -int gui_exit() -{ - quited=1; - return D_CLOSE; -} - -int gui_loadss() -{ - char tempname[260]; - int ret; - int xsize = windx - 32, ysize = windy - 16; - memcpy(tempname, discfns[0], 260); - ret = file_select_ex("Please choose a save state", tempname, "SNP", 260, xsize, ysize); - if (ret) - { - strcpy(savestate_name, tempname); - savestate_load(); - } - gui_update(); - return D_CLOSE; -} - -int gui_savess() -{ - char tempname[260]; - int ret; - int xsize = windx - 32, ysize = windy - 16; - if (curtube != -1) - { - alert(NULL, "Second processor save states not supported yet.", NULL, "&OK", NULL, 0, 0); - return D_O_K; - } - memcpy(tempname, discfns[0], 260); - ret = file_select_ex("Please choose a save state", tempname, "SNP", 260, xsize, ysize); - if (ret) - { - strcpy(savestate_name, tempname); - savestate_save(); - } - gui_update(); - return D_CLOSE; -} - -MENU filemenu[6]= -{ - {"&Return", gui_return, NULL, 0, NULL}, - {"&Hard reset", gui_reset, NULL, 0, NULL}, - {"&Load state", gui_loadss, NULL, 0, NULL}, - {"&Save state", gui_savess, NULL, 0, NULL}, - {"&Exit", gui_exit, NULL, 0, NULL}, - {NULL, NULL, NULL, 0, NULL} -}; - -int gui_load0() -{ - char tempname[260]; - int ret; - int xsize = windx - 32, ysize = windy - 16; - memcpy(tempname, discfns[0], 260); - ret = file_select_ex("Please choose a disc image", tempname, "SSD;DSD;IMG;ADF;ADL;FDI", 260, xsize, ysize); - if (ret) - { - disc_close(0); - memcpy(discfns[0], tempname, 260); - disc_load(0, discfns[0]); - if (defaultwriteprot) writeprot[0] = 1; - } - gui_update(); - return D_O_K; -} -int gui_load1() -{ - char tempname[260]; - int ret; - int xsize = windx - 32, ysize = windy - 16; - memcpy(tempname, discfns[1], 260); - ret = file_select_ex("Please choose a disc image", tempname, "SSD;DSD;IMG;ADF;ADL;FDI", 260, xsize, ysize); - if (ret) - { - disc_close(1); - memcpy(discfns[1], tempname, 260); - disc_load(1, discfns[1]); - if (defaultwriteprot) writeprot[1] = 1; - } - gui_update(); - return D_O_K; -} - -int gui_eject0() -{ - disc_close(0); - discfns[0][0] = 0; - return D_O_K; -} -int gui_eject1() -{ - disc_close(1); - discfns[1][0] = 0; - return D_O_K; -} - -int gui_wprot0() -{ - writeprot[0] = !writeprot[0]; - if (fwriteprot[0]) fwriteprot[0] = 1; - gui_update(); - return D_O_K; -} -int gui_wprot1() -{ - writeprot[1] = !writeprot[1]; - if (fwriteprot[1]) fwriteprot[1] = 1; - gui_update(); - return D_O_K; -} -int gui_wprotd() -{ - defaultwriteprot = !defaultwriteprot; - gui_update(); - return D_O_K; -} - -MENU discmenu[8]= -{ - {"Load disc :&0/2...", gui_load0, NULL, 0, NULL}, - {"Load disc :&1/3...", gui_load1, NULL, 0, NULL}, - {"Eject disc :0/2", gui_eject0, NULL, 0, NULL}, - {"Eject disc :1/3", gui_eject1, NULL, 0, NULL}, - {"Write protect disc :0/2", gui_wprot0, NULL, 0, NULL}, - {"Write protect disc :1/3", gui_wprot1, NULL, 0, NULL}, - {"Default write protect", gui_wprotd, NULL, 0, NULL}, - {NULL, NULL, NULL, 0, NULL} -}; - -int gui_normal() -{ - fasttape = 0; - gui_update(); - return D_O_K; -} -int gui_fast() -{ - fasttape = 1; - gui_update(); - return D_O_K; -} - -MENU tapespdmenu[3]= -{ - {"Normal", gui_normal, NULL, 0, NULL}, - {"Fast", gui_fast, NULL, 0, NULL}, - {NULL, NULL, NULL, 0, NULL} -}; - -int gui_loadt() -{ - char tempname[260]; - int ret; - int xsize = windx - 32, ysize = windy - 16; - memcpy(tempname, tape_fn, 260); - ret=file_select_ex("Please choose a tape image", tempname, "UEF;CSW", 260, xsize, ysize); - if (ret) - { - tape_close(); - memcpy(tape_fn, tempname, 260); - tape_load(tape_fn); - } - return D_O_K; -} - -int gui_rewind() -{ - tape_close(); - tape_load(tape_fn); - return D_O_K; -} - -int gui_ejectt() -{ - tape_close(); - tape_loaded = 0; - return D_O_K; -} - -MENU tapemenu[]= -{ - {"Load tape...", gui_loadt, NULL, 0, NULL}, - {"Rewind tape", gui_rewind, NULL, 0, NULL}, - {"Eject tape", gui_ejectt, NULL, 0, NULL}, - {"Tape speed", NULL, tapespdmenu, 0, NULL}, - {NULL, NULL, NULL, 0, NULL} -}; - -int gui_model() -{ - oldmodel = curmodel; - curmodel = (int)active_menu->dp; - main_restart(); - gui_update(); - return D_O_K; -} - -MENU modelmenu[17]= -{ - {"BBC A w/OS 0.1", gui_model, NULL, 0, (void *)0}, - {"BBC B w/OS 0.1", gui_model, NULL, 0, (void *)1}, - {"BBC A", gui_model, NULL, 0, (void *)2}, - {"BBC B w/8271 FDC", gui_model, NULL, 0, (void *)3}, - {"BBC B w/8271+SWRAM", gui_model, NULL, 0, (void *)4}, - {"BBC B w/1770 FDC", gui_model, NULL, 0, (void *)5}, - {"BBC B US", gui_model, NULL, 0, (void *)6}, - {"BBC B German", gui_model, NULL, 0, (void *)7}, - {"BBC B+ 64K", gui_model, NULL, 0, (void *)8}, - {"BBC B+ 128K", gui_model, NULL, 0, (void *)9}, - {"BBC Master 128", gui_model, NULL, 0, (void *)10}, - {"BBC Master 128 w/MOS 3.50", gui_model, NULL, 0, (void *)15}, - {"BBC Master 512", gui_model, NULL, 0, (void *)11}, - {"BBC Master Turbo", gui_model, NULL, 0, (void *)12}, - {"BBC Master Compact", gui_model, NULL, 0, (void *)13}, - {"ARM Evaluation System", gui_model, NULL, 0, (void *)14}, - {NULL, NULL, NULL, 0, NULL} -}; - -int gui_tubespd() -{ - tube_6502_speed = (int)active_menu->dp; - tube_updatespeed(); - gui_update(); - return D_O_K; -} - -MENU tubespdmenu[6]= -{ - {"4mhz", gui_tubespd, NULL, 0, (void *)1}, - {"8mhz", gui_tubespd, NULL, 0, (void *)2}, - {"16mhz", gui_tubespd, NULL, 0, (void *)3}, - {"32mhz", gui_tubespd, NULL, 0, (void *)4}, - {"64mhz", gui_tubespd, NULL, 0, (void *)5}, - {NULL, NULL, NULL, 0, NULL} -}; - - -int gui_tube() -{ - selecttube = (int)active_menu->dp; - main_restart(); - gui_update(); - return D_O_K; -} - -#ifdef NS32016 -MENU tubemenu[7]= -#else -MENU tubemenu[6]= -#endif -{ - {"None",gui_tube,NULL,0,(void *)-1}, - {"6502",gui_tube,NULL,0,(void *)0}, - {"65816",gui_tube,NULL,0,(void *)4}, - {"Z80",gui_tube,NULL,0,(void *)2}, -#ifdef NS32016 - {"32016",gui_tube,NULL,0,(void *)5}, -#endif - {"6502 tube speed",NULL,tubespdmenu,0,NULL}, - {NULL,NULL,NULL,0,NULL} -}; - -int gui_linedbl() -{ - vid_linedbl = 1; - vid_scanlines = vid_interlace = 0; - gui_update(); - return D_O_K; -} -int gui_scanlines() -{ - vid_scanlines = 1; - vid_linedbl = vid_interlace = 0; - gui_update(); - return D_O_K; -} -int gui_interlaced() -{ - vid_interlace = 1; - vid_linedbl = vid_scanlines = 0; - gui_update(); - return D_O_K; -} - -MENU displaymenu[4]= -{ - {"Line doubling",gui_linedbl,NULL,0,NULL}, - {"Scanlines",gui_scanlines,NULL,0,NULL}, - {"Interlaced",gui_interlaced,NULL,0,NULL}, - {NULL,NULL,NULL,0,NULL} -}; - -int gui_borders() -{ - vid_fullborders = (int)active_menu->dp; - gui_update(); - return D_O_K; -} - -MENU bordersmenu[4]= -{ - {"None", gui_borders,NULL,0,(void *)0}, - {"Small",gui_borders,NULL,0,(void *)1}, - {"Full", gui_borders,NULL,0,(void *)2}, - {NULL,NULL,NULL,0,NULL} -}; - -int gui_fullscreen() -{ - if (fullscreen) - { - fullscreen=0; - video_leavefullscreen(); - } - else - { - fullscreen=1; - video_enterfullscreen(); - } - return D_EXIT; -} - -MENU videomenu[4] = -{ - {"Display type", NULL, displaymenu, 0, NULL}, - {"Borders", NULL, bordersmenu, 0, NULL}, - {"Fullscreen", gui_fullscreen, NULL, 0, NULL}, - {NULL, NULL, NULL, 0, NULL} -}; - -int gui_sidtype() -{ - cursid = (int)active_menu->dp; - sid_settype(sidmethod, cursid); - gui_update(); - return D_O_K; -} - -MENU sidtypemenu[15] = -{ - {"6581", gui_sidtype,NULL,0,(void *)SID_MODEL_6581}, - {"8580", gui_sidtype,NULL,0,(void *)SID_MODEL_8580}, - {"8580 + digi boost", gui_sidtype,NULL,0,(void *)SID_MODEL_8580D}, - {"6581R4", gui_sidtype,NULL,0,(void *)SID_MODEL_6581R4}, - {"6581R3 4885", gui_sidtype,NULL,0,(void *)SID_MODEL_6581R3_4885}, - {"6581R3 0486S", gui_sidtype,NULL,0,(void *)SID_MODEL_6581R3_0486S}, - {"6581R3 3984", gui_sidtype,NULL,0,(void *)SID_MODEL_6581R3_3984}, - {"6581R4AR 3789", gui_sidtype,NULL,0,(void *)SID_MODEL_6581R4AR_3789}, - {"6581R3 4485", gui_sidtype,NULL,0,(void *)SID_MODEL_6581R3_4485}, - {"6581R4 1986S", gui_sidtype,NULL,0,(void *)SID_MODEL_6581R4_1986S}, - {"8580R5 3691", gui_sidtype,NULL,0,(void *)SID_MODEL_8580R5_3691}, - {"8580R5 3691 + digi boost",gui_sidtype,NULL,0,(void *)SID_MODEL_8580R5_3691D}, - {"8580R5 1489", gui_sidtype,NULL,0,(void *)SID_MODEL_8580R5_1489}, - {"8580R5 1489 + digi boost",gui_sidtype,NULL,0,(void *)SID_MODEL_8580R5_1489D}, - {NULL,NULL,NULL,0,NULL} -}; - -int gui_method() -{ - sidmethod = (int)active_menu->dp; - sid_settype(sidmethod, cursid); - gui_update(); - return D_O_K; -} - -MENU methodmenu[3] = -{ - {"Interpolating", gui_method,NULL,0,(void *)0}, - {"Resampling", gui_method,NULL,0,(void *)1}, - {NULL,NULL,NULL,0,NULL} -}; - -MENU residmenu[3] = -{ - {"Model", NULL, sidtypemenu, 0, NULL}, - {"Sample method", NULL, methodmenu, 0, NULL}, - {NULL, NULL, NULL, 0, NULL} -}; - -int gui_waveform() -{ - curwave = (int)active_menu->dp; - gui_update(); - return D_O_K; -} - -MENU waveformmenu[6] = -{ - {"Square", gui_waveform, NULL, 0, (void *)0}, - {"Saw", gui_waveform, NULL, 0, (void *)1}, - {"Sine", gui_waveform, NULL, 0, (void *)2}, - {"Triangle", gui_waveform, NULL, 0, (void *)3}, - {"SID", gui_waveform, NULL, 0, (void *)4}, - {NULL, NULL, NULL, 0, NULL} -}; - -int gui_ddtype() -{ - ddnoise_type = (int)active_menu->dp; - ddnoise_close(); - ddnoise_init(); - gui_update(); - return D_O_K; -} - -MENU ddtypemenu[3]= -{ - {"5.25", gui_ddtype, NULL, 0, (void *)0}, - {"3.5", gui_ddtype, NULL, 0, (void *)1}, - {NULL, NULL, NULL, 0, NULL} -}; - -int gui_ddvol() -{ - ddnoise_vol = (int)active_menu->dp; - gui_update(); - return D_O_K; -} - -MENU ddvolmenu[4]= -{ - {"33%", gui_ddvol, NULL, 0, (void *)1}, - {"66%", gui_ddvol, NULL, 0, (void *)2}, - {"100%", gui_ddvol, NULL, 0, (void *)3}, - {NULL, NULL, NULL, 0, NULL} -}; - -int gui_internalsnd() -{ - sound_internal = !sound_internal; - gui_update(); - return D_O_K; -} -int gui_beebsid() -{ - sound_beebsid = !sound_beebsid; - gui_update(); - return D_O_K; -} -int gui_dac() -{ - sound_dac = !sound_dac; - gui_update(); - return D_O_K; -} -int gui_ddnoise() -{ - sound_ddnoise = !sound_ddnoise; - gui_update(); - return D_O_K; -} -int gui_tnoise() -{ - sound_tape = !sound_tape; - gui_update(); - return D_O_K; -} -int gui_filter() -{ - sound_filter = !sound_filter; - gui_update(); - return D_O_K; -} - -MENU soundmenu[11]= -{ - {"Internal sound chip", gui_internalsnd, NULL, 0, NULL}, - {"BeebSID", gui_beebsid, NULL, 0, NULL}, - {"Printer Port DAC", gui_dac, NULL, 0, NULL}, - {"Disc drive noise", gui_ddnoise, NULL, 0, NULL}, - {"Tape noise", gui_tnoise, NULL, 0, NULL}, - {"Internal sound filter", gui_filter, NULL, 0, NULL}, - {"Internal waveform", NULL, waveformmenu, 0, NULL}, - {"reSID configuration", NULL, residmenu, 0, NULL}, - {"Disc drive type", NULL, ddtypemenu, 0, NULL}, - {"Disc drive volume", NULL, ddvolmenu, 0, NULL}, - {NULL, NULL, NULL, 0, NULL} -}; - -int gui_mapas() -{ - keyas = !keyas; - gui_update(); - return D_O_K; -} - -MENU keymenu[3] = -{ - {"Redefine keyboard", gui_keydefine, NULL, 0, NULL}, - {"&Map CAPS/CTRL to A/S", gui_mapas, NULL, 0, NULL}, - {NULL, NULL, NULL, 0, NULL} -}; - -int gui_mouseamx() -{ - mouse_amx = !mouse_amx; - gui_update(); - return D_O_K; -} - -MENU mousemenu[2] = -{ - {"&AMX mouse", gui_mouseamx, NULL, 0, NULL}, - {NULL, NULL, NULL, 0, NULL} -}; - - -int gui_ide() -{ - ide_enable = !ide_enable; - main_reset(); - gui_update(); - return D_O_K; -} - -MENU idemenu[2]= -{ - {"&Enable IDE hard discs", gui_ide, NULL, 0, NULL}, - {NULL, NULL, NULL, 0, NULL} -}; - -MENU settingsmenu[8]= -{ - {"&Model", NULL, modelmenu, 0, NULL}, - {"&Second processor", NULL, tubemenu, 0, NULL}, - {"&Video", NULL, videomenu, 0, NULL}, - {"&Sound", NULL, soundmenu, 0, NULL}, - {"&Keyboard", NULL, keymenu, 0, NULL}, - {"&Mouse", NULL, mousemenu, 0, NULL}, - {"&IDE", NULL, idemenu, 0, NULL}, - {NULL, NULL, NULL, 0, NULL} -}; - -int gui_scrshot() -{ - char tempname[260]; - int ret; - int xsize = windx - 32, ysize = windy - 16; - tempname[0] = 0; - ret = file_select_ex("Please enter filename", tempname, "BMP", 260, xsize, ysize); - if (ret) - { - memcpy(vid_scrshotname, tempname, 260); - printf("Save scrshot\n"); - vid_savescrshot = 2; - } - return D_CLOSE; -} - -int gui_speed() -{ - emuspeed = (int)active_menu->dp; - changetimerspeed(timerspeeds[emuspeed]); - vid_fskipmax = frameskips[emuspeed]; - gui_update(); - return D_O_K; -} - -MENU speedmenu[11] = -{ - {"&10%", gui_speed, NULL, 0, (void *)0}, - {"&25%", gui_speed, NULL, 0, (void *)1}, - {"&50%", gui_speed, NULL, 0, (void *)2}, - {"&75%", gui_speed, NULL, 0, (void *)3}, - {"&100%", gui_speed, NULL, 0, (void *)4}, - {"&150%", gui_speed, NULL, 0, (void *)5}, - {"&200%", gui_speed, NULL, 0, (void *)6}, - {"&300%", gui_speed, NULL, 0, (void *)7}, - {"&400%", gui_speed, NULL, 0, (void *)8}, - {"&500%", gui_speed, NULL, 0, (void *)9}, - {NULL, NULL, NULL, 0, NULL} -}; - -MENU miscmenu[3] = -{ - {"&Speed", NULL, speedmenu, 0, NULL}, - {"Save screenshot", gui_scrshot, NULL, 0, NULL}, - {NULL, NULL, NULL, 0, NULL} -}; - -MENU mainmenu[6] = -{ - {"&File", NULL,filemenu, 0, NULL}, - {"&Disc", NULL,discmenu, 0, NULL}, - {"&Tape", NULL,tapemenu, 0, NULL}, - {"&Settings", NULL,settingsmenu, 0, NULL}, - {"&Misc", NULL,miscmenu, 0, NULL}, - {NULL, NULL, NULL, 0, NULL} -}; - -DIALOG bemgui[]= -{ - {d_ctext_proc, 200, 260, 0, 0, 15,0,0,0, 0,0,B_EM_VERSION}, - {d_menu_proc, 0, 0, 0, 0, 15,0,0,0, 0,0,mainmenu}, - {d_yield_proc}, - {0,0,0,0,0,0,0,0,0,0,0,NULL,NULL,NULL} -}; - -BITMAP *mouse, *_mouse_sprite; - -BITMAP *guib; - -void gui_enter() -{ - int x = 1; - DIALOG_PLAYER *dp; - - while (keypressed()) readkey(); - while (key[KEY_F11]) rest(100); - - set_window_title(B_EM_VERSION); - - gui_update(); - - if (curtube != 3 && !mouse_amx) install_mouse(); - - set_color_depth(dcol); - show_mouse(screen); - bemgui[0].x = (windx / 2) - 36; - bemgui[0].y = windy - 8; - bemgui[0].fg = makecol(255,255,255); - dp=init_dialog(bemgui, 0); - while (x && !key[KEY_F11] && !key[KEY_ESC]) - { - x = update_dialog(dp); - } - shutdown_dialog(dp); - show_mouse(NULL); - set_color_depth(8); - - if (curtube != 3 && !mouse_amx) remove_mouse(); - - while (key[KEY_F11]) rest(100); - - video_clearscreen(); -} -#endif +/*B-em v2.2 by Tom Walker + Linux GUI*/ + +#ifndef WIN32 +#include +#include "b-em.h" +#include "resources.h" + +#include "config.h" +#include "ddnoise.h" +#include "debugger.h" +#include "disc.h" +#include "ide.h" +#include "keyboard.h" +#include "linux-gui.h" +#include "main.h" +#include "model.h" +#include "mouse.h" +#include "savestate.h" +#include "sid_b-em.h" +#include "sound.h" +#include "sn76489.h" +#include "tape.h" +#include "tube.h" +#include "video_render.h" + + +#undef printf + +int timerspeeds[] = {5, 12, 25, 38, 50, 75, 100, 150, 200, 250}; +int frameskips[] = {0, 0, 0, 0, 0, 0, 1, 2, 3, 4}; +int emuspeed = 4; + +void setejecttext(int d, char *s) +{ +} +void setquit() +{ +} + +extern int quited; +extern int windx,windy; + +MENU filemenu[6]; +MENU discmenu[8]; +MENU tapespdmenu[3]; +MENU tapemenu[5]; +MENU modelmenu[17]; +MENU tubespdmenu[6]; +#ifdef NS32016 +MENU tubemenu[7]; +#else +MENU tubemenu[6]; +#endif +MENU displaymenu[4]; +MENU bordersmenu[4]; +MENU videomenu[4]; +MENU sidtypemenu[15]; +MENU methodmenu[3]; +MENU residmenu[3]; +MENU waveformmenu[6]; +MENU ddtypemenu[3]; +MENU ddvolmenu[4]; +MENU soundmenu[11]; +MENU keymenu[3]; +MENU mousemenu[2]; +MENU idemenu[2]; +MENU settingsmenu[8]; +MENU miscmenu[3]; +MENU speedmenu[11]; +MENU mainmenu[6]; + +void gui_update() +{ + int x; + discmenu[4].flags = (writeprot[0]) ? D_SELECTED : 0; + discmenu[5].flags = (writeprot[1]) ? D_SELECTED : 0; + discmenu[6].flags = (defaultwriteprot) ? D_SELECTED : 0; + tapespdmenu[0].flags = (!fasttape) ? D_SELECTED : 0; + tapespdmenu[1].flags = (fasttape) ? D_SELECTED : 0; + for (x = 0; x < 16; x++) modelmenu[x].flags = 0; + for (x = 0; x < 16; x++) + { + if (curmodel == (int)modelmenu[x].dp) + modelmenu[x].flags = D_SELECTED; + } + #ifdef NS32016 + for (x = 0; x < 5; x++) tubemenu[x].flags = (selecttube == (int)tubemenu[x].dp) ? D_SELECTED : 0; + #else + for (x = 0; x < 4; x++) tubemenu[x].flags = (selecttube == (int)tubemenu[x].dp) ? D_SELECTED : 0; + #endif + for (x = 0; x < 5; x++) tubespdmenu[x].flags = (tube_6502_speed == (int)tubespdmenu[x].dp) ? D_SELECTED : 0; + displaymenu[0].flags = (vid_linedbl) ? D_SELECTED : 0; + displaymenu[1].flags = (vid_scanlines) ? D_SELECTED : 0; + displaymenu[2].flags = (vid_interlace) ? D_SELECTED : 0; + videomenu[2].flags = (fullscreen) ? D_SELECTED : 0; + for (x = 0; x < 3; x++) bordersmenu[x].flags = (vid_fullborders == (int)bordersmenu[x].dp) ? D_SELECTED : 0; + soundmenu[0].flags = (sound_internal) ? D_SELECTED : 0; + soundmenu[1].flags = (sound_beebsid) ? D_SELECTED : 0; + soundmenu[2].flags = (sound_dac) ? D_SELECTED : 0; + soundmenu[3].flags = (sound_ddnoise) ? D_SELECTED : 0; + soundmenu[4].flags = (sound_tape) ? D_SELECTED : 0; + soundmenu[5].flags = (sound_filter) ? D_SELECTED : 0; + for (x = 0; x < 5; x++) waveformmenu[x].flags = (curwave == (int)waveformmenu[x].dp) ? D_SELECTED : 0; + for (x = 0; x < 14; x++) sidtypemenu[x].flags = (cursid == (int)sidtypemenu[x].dp) ? D_SELECTED : 0; + methodmenu[0].flags = (!sidmethod) ? D_SELECTED : 0; + methodmenu[1].flags = (sidmethod) ? D_SELECTED : 0; + ddtypemenu[0].flags = (!ddnoise_type) ? D_SELECTED : 0; + ddtypemenu[1].flags = (ddnoise_type) ? D_SELECTED : 0; + for (x = 0; x < 3; x++) ddvolmenu[x].flags = (ddnoise_vol == (int)ddvolmenu[x].dp) ? D_SELECTED : 0; + keymenu[1].flags = (keyas) ? D_SELECTED : 0; + mousemenu[0].flags = (mouse_amx) ? D_SELECTED : 0; + for (x = 0; x < 10; x++) speedmenu[x].flags = (emuspeed == (int)speedmenu[x].dp) ? D_SELECTED : 0; + idemenu[0].flags = (ide_enable) ? D_SELECTED : 0; +} + +int gui_keydefine(); + +int gui_return() +{ + return D_CLOSE; +} + +int gui_reset() +{ + main_restart(); + return D_O_K; +} + +int gui_exit() +{ + quited=1; + return D_CLOSE; +} + +int gui_loadss() +{ + char tempname[260]; + int ret; + int xsize = windx - 32, ysize = windy - 16; + memcpy(tempname, discfns[0], 260); + ret = file_select_ex("Please choose a save state", tempname, "SNP", 260, xsize, ysize); + if (ret) + { + strcpy(savestate_name, tempname); + savestate_load(); + } + gui_update(); + return D_CLOSE; +} + +int gui_savess() +{ + char tempname[260]; + int ret; + int xsize = windx - 32, ysize = windy - 16; + if (curtube != -1) + { + alert(NULL, "Second processor save states not supported yet.", NULL, "&OK", NULL, 0, 0); + return D_O_K; + } + memcpy(tempname, discfns[0], 260); + ret = file_select_ex("Please choose a save state", tempname, "SNP", 260, xsize, ysize); + if (ret) + { + strcpy(savestate_name, tempname); + savestate_save(); + } + gui_update(); + return D_CLOSE; +} + +MENU filemenu[6]= +{ + {"&Return", gui_return, NULL, 0, NULL}, + {"&Hard reset", gui_reset, NULL, 0, NULL}, + {"&Load state", gui_loadss, NULL, 0, NULL}, + {"&Save state", gui_savess, NULL, 0, NULL}, + {"&Exit", gui_exit, NULL, 0, NULL}, + {NULL, NULL, NULL, 0, NULL} +}; + +int gui_load0() +{ + char tempname[260]; + int ret; + int xsize = windx - 32, ysize = windy - 16; + memcpy(tempname, discfns[0], 260); + ret = file_select_ex("Please choose a disc image", tempname, "SSD;DSD;IMG;ADF;ADL;FDI", 260, xsize, ysize); + if (ret) + { + disc_close(0); + memcpy(discfns[0], tempname, 260); + disc_load(0, discfns[0]); + if (defaultwriteprot) writeprot[0] = 1; + } + gui_update(); + return D_O_K; +} +int gui_load1() +{ + char tempname[260]; + int ret; + int xsize = windx - 32, ysize = windy - 16; + memcpy(tempname, discfns[1], 260); + ret = file_select_ex("Please choose a disc image", tempname, "SSD;DSD;IMG;ADF;ADL;FDI", 260, xsize, ysize); + if (ret) + { + disc_close(1); + memcpy(discfns[1], tempname, 260); + disc_load(1, discfns[1]); + if (defaultwriteprot) writeprot[1] = 1; + } + gui_update(); + return D_O_K; +} + +int gui_eject0() +{ + disc_close(0); + discfns[0][0] = 0; + return D_O_K; +} +int gui_eject1() +{ + disc_close(1); + discfns[1][0] = 0; + return D_O_K; +} + +int gui_wprot0() +{ + writeprot[0] = !writeprot[0]; + if (fwriteprot[0]) fwriteprot[0] = 1; + gui_update(); + return D_O_K; +} +int gui_wprot1() +{ + writeprot[1] = !writeprot[1]; + if (fwriteprot[1]) fwriteprot[1] = 1; + gui_update(); + return D_O_K; +} +int gui_wprotd() +{ + defaultwriteprot = !defaultwriteprot; + gui_update(); + return D_O_K; +} + +MENU discmenu[8]= +{ + {"Load disc :&0/2...", gui_load0, NULL, 0, NULL}, + {"Load disc :&1/3...", gui_load1, NULL, 0, NULL}, + {"Eject disc :0/2", gui_eject0, NULL, 0, NULL}, + {"Eject disc :1/3", gui_eject1, NULL, 0, NULL}, + {"Write protect disc :0/2", gui_wprot0, NULL, 0, NULL}, + {"Write protect disc :1/3", gui_wprot1, NULL, 0, NULL}, + {"Default write protect", gui_wprotd, NULL, 0, NULL}, + {NULL, NULL, NULL, 0, NULL} +}; + +int gui_normal() +{ + fasttape = 0; + gui_update(); + return D_O_K; +} +int gui_fast() +{ + fasttape = 1; + gui_update(); + return D_O_K; +} + +MENU tapespdmenu[3]= +{ + {"Normal", gui_normal, NULL, 0, NULL}, + {"Fast", gui_fast, NULL, 0, NULL}, + {NULL, NULL, NULL, 0, NULL} +}; + +int gui_loadt() +{ + char tempname[260]; + int ret; + int xsize = windx - 32, ysize = windy - 16; + memcpy(tempname, tape_fn, 260); + ret=file_select_ex("Please choose a tape image", tempname, "UEF;CSW", 260, xsize, ysize); + if (ret) + { + tape_close(); + memcpy(tape_fn, tempname, 260); + tape_load(tape_fn); + tape_loaded = 1; + } + return D_O_K; +} + +int gui_rewind() +{ + tape_close(); + tape_load(tape_fn); + return D_O_K; +} + +int gui_ejectt() +{ + tape_close(); + tape_loaded = 0; + return D_O_K; +} + +MENU tapemenu[]= +{ + {"Load tape...", gui_loadt, NULL, 0, NULL}, + {"Rewind tape", gui_rewind, NULL, 0, NULL}, + {"Eject tape", gui_ejectt, NULL, 0, NULL}, + {"Tape speed", NULL, tapespdmenu, 0, NULL}, + {NULL, NULL, NULL, 0, NULL} +}; + +int gui_model() +{ + oldmodel = curmodel; + curmodel = (int)active_menu->dp; + main_restart(); + gui_update(); + return D_O_K; +} + +MENU modelmenu[17]= +{ + {"BBC A w/OS 0.1", gui_model, NULL, 0, (void *)0}, + {"BBC B w/OS 0.1", gui_model, NULL, 0, (void *)1}, + {"BBC A", gui_model, NULL, 0, (void *)2}, + {"BBC B w/8271 FDC", gui_model, NULL, 0, (void *)3}, + {"BBC B w/8271+SWRAM", gui_model, NULL, 0, (void *)4}, + {"BBC B w/1770 FDC", gui_model, NULL, 0, (void *)5}, + {"BBC B US", gui_model, NULL, 0, (void *)6}, + {"BBC B German", gui_model, NULL, 0, (void *)7}, + {"BBC B+ 64K", gui_model, NULL, 0, (void *)8}, + {"BBC B+ 128K", gui_model, NULL, 0, (void *)9}, + {"BBC Master 128", gui_model, NULL, 0, (void *)10}, + {"BBC Master 128 w/MOS 3.50", gui_model, NULL, 0, (void *)15}, + {"BBC Master 512", gui_model, NULL, 0, (void *)11}, + {"BBC Master Turbo", gui_model, NULL, 0, (void *)12}, + {"BBC Master Compact", gui_model, NULL, 0, (void *)13}, + {"ARM Evaluation System", gui_model, NULL, 0, (void *)14}, + {NULL, NULL, NULL, 0, NULL} +}; + +int gui_tubespd() +{ + tube_6502_speed = (int)active_menu->dp; + tube_updatespeed(); + gui_update(); + return D_O_K; +} + +MENU tubespdmenu[6]= +{ + {"4mhz", gui_tubespd, NULL, 0, (void *)1}, + {"8mhz", gui_tubespd, NULL, 0, (void *)2}, + {"16mhz", gui_tubespd, NULL, 0, (void *)3}, + {"32mhz", gui_tubespd, NULL, 0, (void *)4}, + {"64mhz", gui_tubespd, NULL, 0, (void *)5}, + {NULL, NULL, NULL, 0, NULL} +}; + + +int gui_tube() +{ + selecttube = (int)active_menu->dp; + main_restart(); + gui_update(); + return D_O_K; +} + +#ifdef NS32016 +MENU tubemenu[7]= +#else +MENU tubemenu[6]= +#endif +{ + {"None",gui_tube,NULL,0,(void *)-1}, + {"6502",gui_tube,NULL,0,(void *)0}, + {"65816",gui_tube,NULL,0,(void *)4}, + {"Z80",gui_tube,NULL,0,(void *)2}, +#ifdef NS32016 + {"32016",gui_tube,NULL,0,(void *)5}, +#endif + {"6502 tube speed",NULL,tubespdmenu,0,NULL}, + {NULL,NULL,NULL,0,NULL} +}; + +int gui_linedbl() +{ + vid_linedbl = 1; + vid_scanlines = vid_interlace = 0; + gui_update(); + return D_O_K; +} +int gui_scanlines() +{ + vid_scanlines = 1; + vid_linedbl = vid_interlace = 0; + gui_update(); + return D_O_K; +} +int gui_interlaced() +{ + vid_interlace = 1; + vid_linedbl = vid_scanlines = 0; + gui_update(); + return D_O_K; +} + +MENU displaymenu[4]= +{ + {"Line doubling",gui_linedbl,NULL,0,NULL}, + {"Scanlines",gui_scanlines,NULL,0,NULL}, + {"Interlaced",gui_interlaced,NULL,0,NULL}, + {NULL,NULL,NULL,0,NULL} +}; + +int gui_borders() +{ + vid_fullborders = (int)active_menu->dp; + gui_update(); + return D_O_K; +} + +MENU bordersmenu[4]= +{ + {"None", gui_borders,NULL,0,(void *)0}, + {"Small",gui_borders,NULL,0,(void *)1}, + {"Full", gui_borders,NULL,0,(void *)2}, + {NULL,NULL,NULL,0,NULL} +}; + +int gui_fullscreen() +{ + if (fullscreen) + { + fullscreen=0; + video_leavefullscreen(); + } + else + { + fullscreen=1; + video_enterfullscreen(); + } + return D_EXIT; +} + +MENU videomenu[4] = +{ + {"Display type", NULL, displaymenu, 0, NULL}, + {"Borders", NULL, bordersmenu, 0, NULL}, + {"Fullscreen", gui_fullscreen, NULL, 0, NULL}, + {NULL, NULL, NULL, 0, NULL} +}; + +int gui_sidtype() +{ + cursid = (int)active_menu->dp; + sid_settype(sidmethod, cursid); + gui_update(); + return D_O_K; +} + +MENU sidtypemenu[15] = +{ + {"6581", gui_sidtype,NULL,0,(void *)SID_MODEL_6581}, + {"8580", gui_sidtype,NULL,0,(void *)SID_MODEL_8580}, + {"8580 + digi boost", gui_sidtype,NULL,0,(void *)SID_MODEL_8580D}, + {"6581R4", gui_sidtype,NULL,0,(void *)SID_MODEL_6581R4}, + {"6581R3 4885", gui_sidtype,NULL,0,(void *)SID_MODEL_6581R3_4885}, + {"6581R3 0486S", gui_sidtype,NULL,0,(void *)SID_MODEL_6581R3_0486S}, + {"6581R3 3984", gui_sidtype,NULL,0,(void *)SID_MODEL_6581R3_3984}, + {"6581R4AR 3789", gui_sidtype,NULL,0,(void *)SID_MODEL_6581R4AR_3789}, + {"6581R3 4485", gui_sidtype,NULL,0,(void *)SID_MODEL_6581R3_4485}, + {"6581R4 1986S", gui_sidtype,NULL,0,(void *)SID_MODEL_6581R4_1986S}, + {"8580R5 3691", gui_sidtype,NULL,0,(void *)SID_MODEL_8580R5_3691}, + {"8580R5 3691 + digi boost",gui_sidtype,NULL,0,(void *)SID_MODEL_8580R5_3691D}, + {"8580R5 1489", gui_sidtype,NULL,0,(void *)SID_MODEL_8580R5_1489}, + {"8580R5 1489 + digi boost",gui_sidtype,NULL,0,(void *)SID_MODEL_8580R5_1489D}, + {NULL,NULL,NULL,0,NULL} +}; + +int gui_method() +{ + sidmethod = (int)active_menu->dp; + sid_settype(sidmethod, cursid); + gui_update(); + return D_O_K; +} + +MENU methodmenu[3] = +{ + {"Interpolating", gui_method,NULL,0,(void *)0}, + {"Resampling", gui_method,NULL,0,(void *)1}, + {NULL,NULL,NULL,0,NULL} +}; + +MENU residmenu[3] = +{ + {"Model", NULL, sidtypemenu, 0, NULL}, + {"Sample method", NULL, methodmenu, 0, NULL}, + {NULL, NULL, NULL, 0, NULL} +}; + +int gui_waveform() +{ + curwave = (int)active_menu->dp; + gui_update(); + return D_O_K; +} + +MENU waveformmenu[6] = +{ + {"Square", gui_waveform, NULL, 0, (void *)0}, + {"Saw", gui_waveform, NULL, 0, (void *)1}, + {"Sine", gui_waveform, NULL, 0, (void *)2}, + {"Triangle", gui_waveform, NULL, 0, (void *)3}, + {"SID", gui_waveform, NULL, 0, (void *)4}, + {NULL, NULL, NULL, 0, NULL} +}; + +int gui_ddtype() +{ + ddnoise_type = (int)active_menu->dp; + ddnoise_close(); + ddnoise_init(); + gui_update(); + return D_O_K; +} + +MENU ddtypemenu[3]= +{ + {"5.25", gui_ddtype, NULL, 0, (void *)0}, + {"3.5", gui_ddtype, NULL, 0, (void *)1}, + {NULL, NULL, NULL, 0, NULL} +}; + +int gui_ddvol() +{ + ddnoise_vol = (int)active_menu->dp; + gui_update(); + return D_O_K; +} + +MENU ddvolmenu[4]= +{ + {"33%", gui_ddvol, NULL, 0, (void *)1}, + {"66%", gui_ddvol, NULL, 0, (void *)2}, + {"100%", gui_ddvol, NULL, 0, (void *)3}, + {NULL, NULL, NULL, 0, NULL} +}; + +int gui_internalsnd() +{ + sound_internal = !sound_internal; + gui_update(); + return D_O_K; +} +int gui_beebsid() +{ + sound_beebsid = !sound_beebsid; + gui_update(); + return D_O_K; +} +int gui_dac() +{ + sound_dac = !sound_dac; + gui_update(); + return D_O_K; +} +int gui_ddnoise() +{ + sound_ddnoise = !sound_ddnoise; + gui_update(); + return D_O_K; +} +int gui_tnoise() +{ + sound_tape = !sound_tape; + gui_update(); + return D_O_K; +} +int gui_filter() +{ + sound_filter = !sound_filter; + gui_update(); + return D_O_K; +} + +MENU soundmenu[11]= +{ + {"Internal sound chip", gui_internalsnd, NULL, 0, NULL}, + {"BeebSID", gui_beebsid, NULL, 0, NULL}, + {"Printer Port DAC", gui_dac, NULL, 0, NULL}, + {"Disc drive noise", gui_ddnoise, NULL, 0, NULL}, + {"Tape noise", gui_tnoise, NULL, 0, NULL}, + {"Internal sound filter", gui_filter, NULL, 0, NULL}, + {"Internal waveform", NULL, waveformmenu, 0, NULL}, + {"reSID configuration", NULL, residmenu, 0, NULL}, + {"Disc drive type", NULL, ddtypemenu, 0, NULL}, + {"Disc drive volume", NULL, ddvolmenu, 0, NULL}, + {NULL, NULL, NULL, 0, NULL} +}; + +int gui_mapas() +{ + keyas = !keyas; + gui_update(); + return D_O_K; +} + +MENU keymenu[3] = +{ + {"Redefine keyboard", gui_keydefine, NULL, 0, NULL}, + {"&Map CAPS/CTRL to A/S", gui_mapas, NULL, 0, NULL}, + {NULL, NULL, NULL, 0, NULL} +}; + +int gui_mouseamx() +{ + mouse_amx = !mouse_amx; + gui_update(); + return D_O_K; +} + +MENU mousemenu[2] = +{ + {"&AMX mouse", gui_mouseamx, NULL, 0, NULL}, + {NULL, NULL, NULL, 0, NULL} +}; + + +int gui_ide() +{ + ide_enable = !ide_enable; + main_reset(); + gui_update(); + return D_O_K; +} + +MENU idemenu[2]= +{ + {"&Enable IDE hard discs", gui_ide, NULL, 0, NULL}, + {NULL, NULL, NULL, 0, NULL} +}; + +MENU settingsmenu[8]= +{ + {"&Model", NULL, modelmenu, 0, NULL}, + {"&Second processor", NULL, tubemenu, 0, NULL}, + {"&Video", NULL, videomenu, 0, NULL}, + {"&Sound", NULL, soundmenu, 0, NULL}, + {"&Keyboard", NULL, keymenu, 0, NULL}, + {"&Mouse", NULL, mousemenu, 0, NULL}, + {"&IDE", NULL, idemenu, 0, NULL}, + {NULL, NULL, NULL, 0, NULL} +}; + +int gui_scrshot() +{ + char tempname[260]; + int ret; + int xsize = windx - 32, ysize = windy - 16; + tempname[0] = 0; + ret = file_select_ex("Please enter filename", tempname, "BMP", 260, xsize, ysize); + if (ret) + { + memcpy(vid_scrshotname, tempname, 260); + printf("Save scrshot\n"); + vid_savescrshot = 2; + } + return D_CLOSE; +} + +int gui_speed() +{ + emuspeed = (int)active_menu->dp; + changetimerspeed(timerspeeds[emuspeed]); + vid_fskipmax = frameskips[emuspeed]; + gui_update(); + return D_O_K; +} + +MENU speedmenu[11] = +{ + {"&10%", gui_speed, NULL, 0, (void *)0}, + {"&25%", gui_speed, NULL, 0, (void *)1}, + {"&50%", gui_speed, NULL, 0, (void *)2}, + {"&75%", gui_speed, NULL, 0, (void *)3}, + {"&100%", gui_speed, NULL, 0, (void *)4}, + {"&150%", gui_speed, NULL, 0, (void *)5}, + {"&200%", gui_speed, NULL, 0, (void *)6}, + {"&300%", gui_speed, NULL, 0, (void *)7}, + {"&400%", gui_speed, NULL, 0, (void *)8}, + {"&500%", gui_speed, NULL, 0, (void *)9}, + {NULL, NULL, NULL, 0, NULL} +}; + +MENU miscmenu[3] = +{ + {"&Speed", NULL, speedmenu, 0, NULL}, + {"Save screenshot", gui_scrshot, NULL, 0, NULL}, + {NULL, NULL, NULL, 0, NULL} +}; + +MENU mainmenu[6] = +{ + {"&File", NULL,filemenu, 0, NULL}, + {"&Disc", NULL,discmenu, 0, NULL}, + {"&Tape", NULL,tapemenu, 0, NULL}, + {"&Settings", NULL,settingsmenu, 0, NULL}, + {"&Misc", NULL,miscmenu, 0, NULL}, + {NULL, NULL, NULL, 0, NULL} +}; + +DIALOG bemgui[]= +{ + {d_ctext_proc, 200, 260, 0, 0, 15,0,0,0, 0,0,"B-em v2.2"}, + {d_menu_proc, 0, 0, 0, 0, 15,0,0,0, 0,0,mainmenu}, + {d_yield_proc}, + {0,0,0,0,0,0,0,0,0,0,0,NULL,NULL,NULL} +}; + +BITMAP *mouse, *_mouse_sprite; + +BITMAP *guib; + +void gui_enter() +{ + int x = 1; + DIALOG_PLAYER *dp; + + while (keypressed()) readkey(); + while (key[KEY_F11]) rest(100); + + gui_update(); + + if (curtube != 3 && !mouse_amx) install_mouse(); + + set_color_depth(dcol); + show_mouse(screen); + bemgui[0].x = (windx / 2) - 36; + bemgui[0].y = windy - 8; + bemgui[0].fg = makecol(255,255,255); + dp=init_dialog(bemgui, 0); + while (x && !key[KEY_F11] && !key[KEY_ESC]) + { + x = update_dialog(dp); + } + shutdown_dialog(dp); + show_mouse(NULL); + set_color_depth(8); + + if (curtube != 3 && !mouse_amx) remove_mouse(); + + while (key[KEY_F11]) rest(100); + + video_clearscreen(); +} +#endif diff --git a/src/linux-gui.h b/src/linux-gui.h index c6820eae..822731fa 100644 --- a/src/linux-gui.h +++ b/src/linux-gui.h @@ -1 +1 @@ -void gui_enter(); +void gui_enter(); diff --git a/src/linux-keydefine.c b/src/linux-keydefine.c index b4bc22b9..1b96f647 100644 --- a/src/linux-keydefine.c +++ b/src/linux-keydefine.c @@ -1,345 +1,331 @@ -/*B-em v2.2 by Tom Walker - Linux keyboard redefinition GUI*/ - -#ifndef WIN32 -#include -#include "b-em.h" -#include "keyboard.h" -#include "model.h" - -int keytemp[128]; -int xSize; -int ySize; - -char *key_names[] = -{ - "", "A", "B", "C", - "D", "E", "F", "G", - "H", "I", "J", "K", - "L", "M", "N", "O", - "P", "Q", "R", "S", - "T", "U", "V", "W", - "X", "Y", "Z", "0", - "1", "2", "3", "4", - "5", "6", "7", "8", - "9", "0_PAD", "1_PAD", "2_PAD", - "3_PAD", "4_PAD", "5_PAD", "6_PAD", - "7_PAD", "8_PAD", "9_PAD", "F1", - "F2", "F3", "F4", "F5", - "F6", "F7", "F8", "F9", - "F10", "F11", "F12", "ESC", - "TILDE", "MINUS", "EQUALS", "BACKSPACE", - "TAB", "OPENBRACE", "CLOSEBRACE", "ENTER", - "COLON", "QUOTE", "BACKSLASH", "BACKSLASH2", - "COMMA", "STOP", "SLASH", "SPACE", - "INSERT", "DEL", "HOME", "END", - "PGUP", "PGDN", "LEFT", "RIGHT", - "UP", "DOWN", "SLASH_PAD", "ASTERISK", - "MINUS_PAD", "PLUS_PAD", "DEL_PAD", "ENTER_PAD", - "PRTSCR", "PAUSE", "ABNT_C1", "YEN", - "KANA", "CONVERT", "NOCONVERT", "AT", - "CIRCUMFLEX", "COLON2", "KANJI", "EQUALS_PAD", - "BACKQUOTE", "SEMICOLON", "COMMAND", "UNKNOWN1", - "UNKNOWN2", "UNKNOWN3", "UNKNOWN4", "UNKNOWN5", - "UNKNOWN6", "UNKNOWN7", "UNKNOWN8", "LSHIFT", - "RSHIFT", "LCONTROL", "RCONTROL", "ALT", - "ALTGR", "LWIN", "RWIN", "MENU", - "SCRLOCK", "NUMLOCK", "CAPSLOCK", "MAX" -}; - -int d_getkey(int msg, DIALOG *d, int cd) -{ - BITMAP *b; - int x,y; - int ret = d_button_proc(msg, d, cd); - int k,k2; - int c; - char s[1024],s2[1024],s3[64]; - if (ret==D_EXIT) - { - k=(int)d->dp2; - x=(SCREEN_W/2)-100; - y=(SCREEN_H/2)-36; - b=create_bitmap(200,72); - blit(screen,b,x,y,0,0,200,72); - rectfill(screen,x,y,x+199,y+71,makecol(0,0,0)); - rect(screen,x,y,x+199,y+71,makecol(255,255,255)); - if (d->dp3) textprintf_ex(screen,font,x+8,y+8,makecol(255,255,255),makecol(0,0,0),"Redefining %s",(char *)d->dp3); - else textprintf_ex(screen,font,x+8,y+8,makecol(255,255,255),makecol(0,0,0),"Redefining %s",(char *)d->dp); - textprintf_ex(screen,font,x+8,y+24,makecol(255,255,255),makecol(0,0,0),"Assigned to PC key(s) :"); - - s[0]=0; - for (c=0;c<128;c++) - { - if (keylookup[c]==k) - { - if (s[0]) sprintf(s3,", %s",key_names[c]); - else sprintf(s3,"%s",key_names[c]); - sprintf(s2,"%s%s",s,s3); - strcpy(s,s2); - } - } - - textprintf_ex(screen,font,x+8,y+40,makecol(255,255,255),makecol(0,0,0),s); - - textprintf_ex(screen,font,x+8,y+56,makecol(255,255,255),makecol(0,0,0),"Please press new key..."); -getnewkey: - while (!keypressed()); - k2=readkey()>>8; - if (k2==KEY_F11 || k2==KEY_F12) goto getnewkey; - keylookup[k2]=k; - - blit(b,screen,0,0,x,y,200,72); - destroy_bitmap(b); - while (key[KEY_SPACE]); - while (keypressed()) readkey(); - return 0; - } - return ret; -} - -DIALOG bemdefinegui[]= -{ - {d_box_proc, 0, 0, 538, 256, 15,15,0,0, 0,0,0, NULL,NULL}, - - {d_button_proc, 205,218,60,28, 15,15,0,D_CLOSE, 0,0,"OK", NULL,NULL}, - {d_button_proc, 271,218,60,28, 15,15,0,D_CLOSE, 0,0,"Cancel", NULL,NULL}, - - {d_getkey, 82,10,28,28, 15,15,0,D_EXIT, 0,0,"F0", (void *)KEY_F1,NULL}, - {d_getkey, 114,10,28,28, 15,15,0,D_EXIT, 0,0,"F1", (void *)KEY_F2,NULL}, - {d_getkey, 146,10,28,28, 15,15,0,D_EXIT, 0,0,"F2", (void *)KEY_F3,NULL}, - {d_getkey, 178,10,28,28, 15,15,0,D_EXIT, 0,0,"F3", (void *)KEY_F4,NULL}, - {d_getkey, 210,10,28,28, 15,15,0,D_EXIT, 0,0,"F4", (void *)KEY_F5,NULL}, - {d_getkey, 242,10,28,28, 15,15,0,D_EXIT, 0,0,"F5", (void *)KEY_F6,NULL}, - {d_getkey, 274,10,28,28, 15,15,0,D_EXIT, 0,0,"F6", (void *)KEY_F7,NULL}, - {d_getkey, 306,10,28,28, 15,15,0,D_EXIT, 0,0,"F7", (void *)KEY_F8,NULL}, - {d_getkey, 338,10,28,28, 15,15,0,D_EXIT, 0,0,"F8", (void *)KEY_F9,NULL}, - {d_getkey, 370,10,28,28, 15,15,0,D_EXIT, 0,0,"F9", (void *)KEY_F10,NULL}, - {d_getkey, 10,42,28,28, 15,15,0,D_EXIT, 0,0,"ESC", (void *)KEY_ESC,NULL}, - {d_getkey, 42,42,28,28, 15,15,0,D_EXIT, 0,0,"1", (void *)KEY_1,NULL}, - {d_getkey, 74,42,28,28, 15,15,0,D_EXIT, 0,0,"2", (void *)KEY_2,NULL}, - {d_getkey, 106,42,28,28, 15,15,0,D_EXIT, 0,0,"3", (void *)KEY_3,NULL}, - {d_getkey, 138,42,28,28, 15,15,0,D_EXIT, 0,0,"4", (void *)KEY_4,NULL}, - {d_getkey, 170,42,28,28, 15,15,0,D_EXIT, 0,0,"5", (void *)KEY_5,NULL}, - {d_getkey, 202,42,28,28, 15,15,0,D_EXIT, 0,0,"6", (void *)KEY_6,NULL}, - {d_getkey, 234,42,28,28, 15,15,0,D_EXIT, 0,0,"7", (void *)KEY_7,NULL}, - {d_getkey, 266,42,28,28, 15,15,0,D_EXIT, 0,0,"8", (void *)KEY_8,NULL}, - {d_getkey, 298,42,28,28, 15,15,0,D_EXIT, 0,0,"9", (void *)KEY_9,NULL}, - {d_getkey, 330,42,28,28, 15,15,0,D_EXIT, 0,0,"0", (void *)KEY_0,NULL}, - {d_getkey, 362,42,28,28, 15,15,0,D_EXIT, 0,0,"=", (void *)KEY_MINUS,NULL}, - {d_getkey, 394,42,28,28, 15,15,0,D_EXIT, 0,0,"^", (void *)KEY_EQUALS,NULL}, - {d_getkey, 426,42,28,28, 15,15,0,D_EXIT, 0,0,"\\", (void *)KEY_BACKSLASH2,NULL}, - {d_getkey, 458,42,28,28, 15,15,0,D_EXIT, 0,0,"LFT", (void *)KEY_LEFT,"LEFT"},//25 - {d_getkey, 490,42,28,28, 15,15,0,D_EXIT, 0,0,"RGT", (void *)KEY_RIGHT,"RIGHT"},//26 - {d_getkey, 10,74,44,28, 15,15,0,D_EXIT, 0,0,"TAB", (void *)KEY_TAB,NULL}, - {d_getkey, 58,74,28,28, 15,15,0,D_EXIT, 0,0,"Q", (void *)KEY_Q,NULL}, - {d_getkey, 90,74,28,28, 15,15,0,D_EXIT, 0,0,"W", (void *)KEY_W,NULL}, - {d_getkey, 122,74,28,28, 15,15,0,D_EXIT, 0,0,"E", (void *)KEY_E,NULL}, - {d_getkey, 154,74,28,28, 15,15,0,D_EXIT, 0,0,"R", (void *)KEY_R,NULL}, - {d_getkey, 186,74,28,28, 15,15,0,D_EXIT, 0,0,"T", (void *)KEY_T,NULL}, - {d_getkey, 218,74,28,28, 15,15,0,D_EXIT, 0,0,"Y", (void *)KEY_Y,NULL}, - {d_getkey, 250,74,28,28, 15,15,0,D_EXIT, 0,0,"U", (void *)KEY_U,NULL}, - {d_getkey, 282,74,28,28, 15,15,0,D_EXIT, 0,0,"I", (void *)KEY_I,NULL}, - {d_getkey, 314,74,28,28, 15,15,0,D_EXIT, 0,0,"O", (void *)KEY_O,NULL}, - {d_getkey, 346,74,28,28, 15,15,0,D_EXIT, 0,0,"P", (void *)KEY_P,NULL}, - {d_getkey, 378,74,28,28, 15,15,0,D_EXIT, 0,0,"@", (void *)KEY_OPENBRACE,NULL}, - {d_getkey, 410,74,28,28, 15,15,0,D_EXIT, 0,0,"[", (void *)KEY_CLOSEBRACE,NULL}, - {d_getkey, 442,74,28,28, 15,15,0,D_EXIT, 0,0,"_", (void *)KEY_TILDE,NULL}, - {d_getkey, 474,74,28,28, 15,15,0,D_EXIT, 0,0,"UP", (void *)KEY_UP,NULL},//41 - {d_getkey, 506,74,28,28, 15,15,0,D_EXIT, 0,0,"DWN", (void *)KEY_DOWN,"DOWN"},//42 - {d_getkey, 10,106,28,28, 15,15,0,D_EXIT, 0,0,"CLK", (void *)KEY_CAPSLOCK,"CAPS LOCK"}, - {d_getkey, 42,106,28,28, 15,15,0,D_EXIT, 0,0,"CTL", (void *)KEY_LCONTROL,"CTRL"}, - {d_getkey, 74,106,28,28, 15,15,0,D_EXIT, 0,0,"A", (void *)KEY_A,NULL}, - {d_getkey, 106,106,28,28, 15,15,0,D_EXIT, 0,0,"S", (void *)KEY_S,NULL}, - {d_getkey, 138,106,28,28, 15,15,0,D_EXIT, 0,0,"D", (void *)KEY_D,NULL}, - {d_getkey, 170,106,28,28, 15,15,0,D_EXIT, 0,0,"F", (void *)KEY_F,NULL}, - {d_getkey, 202,106,28,28, 15,15,0,D_EXIT, 0,0,"G", (void *)KEY_G,NULL}, - {d_getkey, 234,106,28,28, 15,15,0,D_EXIT, 0,0,"H", (void *)KEY_H,NULL}, - {d_getkey, 266,106,28,28, 15,15,0,D_EXIT, 0,0,"J", (void *)KEY_J,NULL}, - {d_getkey, 298,106,28,28, 15,15,0,D_EXIT, 0,0,"K", (void *)KEY_K,NULL}, - {d_getkey, 330,106,28,28, 15,15,0,D_EXIT, 0,0,"L", (void *)KEY_L,NULL}, - {d_getkey, 362,106,28,28, 15,15,0,D_EXIT, 0,0,";", (void *)KEY_SEMICOLON,NULL}, - {d_getkey, 394,106,28,28, 15,15,0,D_EXIT, 0,0,":", (void *)KEY_QUOTE,NULL}, - {d_getkey, 426,106,28,28, 15,15,0,D_EXIT, 0,0,"]", (void *)KEY_BACKSLASH,NULL}, - {d_getkey, 458,106,60,28, 15,15,0,D_EXIT, 0,0,"RET", (void *)KEY_ENTER,"RETURN"}, - {d_getkey, 10,138,28,28, 15,15,0,D_EXIT, 0,0,"SLK", (void *)KEY_ALT,"SHIFT LOCK"}, - {d_getkey, 42,138,44,28, 15,15,0,D_EXIT, 0,0,"SHIFT", (void *)KEY_LSHIFT,NULL}, - {d_getkey, 90,138,28,28, 15,15,0,D_EXIT, 0,0,"Z", (void *)KEY_Z,NULL}, - {d_getkey, 122,138,28,28, 15,15,0,D_EXIT, 0,0,"X", (void *)KEY_X,NULL}, - {d_getkey, 154,138,28,28, 15,15,0,D_EXIT, 0,0,"C", (void *)KEY_C,NULL}, - {d_getkey, 186,138,28,28, 15,15,0,D_EXIT, 0,0,"V", (void *)KEY_V,NULL}, - {d_getkey, 218,138,28,28, 15,15,0,D_EXIT, 0,0,"B", (void *)KEY_B,NULL}, - {d_getkey, 250,138,28,28, 15,15,0,D_EXIT, 0,0,"N", (void *)KEY_N,NULL}, - {d_getkey, 282,138,28,28, 15,15,0,D_EXIT, 0,0,"M", (void *)KEY_M,NULL}, - {d_getkey, 314,138,28,28, 15,15,0,D_EXIT, 0,0,",", (void *)KEY_COMMA,NULL}, - {d_getkey, 346,138,28,28, 15,15,0,D_EXIT, 0,0,".", (void *)KEY_STOP,NULL}, - {d_getkey, 378,138,28,28, 15,15,0,D_EXIT, 0,0,"/", (void *)KEY_SLASH,NULL}, - {d_getkey, 410,138,44,28, 15,15,0,D_EXIT, 0,0,"SHIFT", (void *)KEY_RSHIFT,NULL}, - {d_getkey, 458,138,28,28, 15,15,0,D_EXIT, 0,0,"DEL", (void *)KEY_DEL,"DELETE"}, - {d_getkey, 490,138,28,28, 15,15,0,D_EXIT, 0,0,"CPY", (void *)KEY_END,"COPY"},//72 - {d_getkey, 122,170,256,28, 15,15,0,D_EXIT, 0,0,"SPACE", (void *)KEY_SPACE,NULL}, - - {d_yield_proc}, - {0,0,0,0,0,0,0,0,0,0,0,NULL,NULL,NULL} -}; - -DIALOG bemdefineguim[]= -{ - {d_box_proc, 0, 0, 676, 256, 15,15,0,0, 0,0,0, NULL,NULL}, - - {d_button_proc, 205,218,60,28, 15,15,0,D_CLOSE, 0,0,"OK", NULL,NULL}, - {d_button_proc, 271,218,60,28, 15,15,0,D_CLOSE, 0,0,"Cancel", NULL,NULL}, - - {d_getkey, 50,10,28,28, 15,15,0,D_EXIT, 0,0,"F0", (void *)KEY_F1,NULL}, - {d_getkey, 82,10,28,28, 15,15,0,D_EXIT, 0,0,"F1", (void *)KEY_F2,NULL}, - {d_getkey, 114,10,28,28, 15,15,0,D_EXIT, 0,0,"F2", (void *)KEY_F3,NULL}, - {d_getkey, 146,10,28,28, 15,15,0,D_EXIT, 0,0,"F3", (void *)KEY_F4,NULL}, - {d_getkey, 178,10,28,28, 15,15,0,D_EXIT, 0,0,"F4", (void *)KEY_F5,NULL}, - {d_getkey, 210,10,28,28, 15,15,0,D_EXIT, 0,0,"F5", (void *)KEY_F6,NULL}, - {d_getkey, 242,10,28,28, 15,15,0,D_EXIT, 0,0,"F6", (void *)KEY_F7,NULL}, - {d_getkey, 274,10,28,28, 15,15,0,D_EXIT, 0,0,"F7", (void *)KEY_F8,NULL}, - {d_getkey, 306,10,28,28, 15,15,0,D_EXIT, 0,0,"F8", (void *)KEY_F9,NULL}, - {d_getkey, 338,10,28,28, 15,15,0,D_EXIT, 0,0,"F9", (void *)KEY_F10,NULL}, - {d_getkey, 10,42,28,28, 15,15,0,D_EXIT, 0,0,"ESC", (void *)KEY_ESC,NULL}, - {d_getkey, 42,42,28,28, 15,15,0,D_EXIT, 0,0,"1", (void *)KEY_1,NULL}, - {d_getkey, 74,42,28,28, 15,15,0,D_EXIT, 0,0,"2", (void *)KEY_2,NULL}, - {d_getkey, 106,42,28,28, 15,15,0,D_EXIT, 0,0,"3", (void *)KEY_3,NULL}, - {d_getkey, 138,42,28,28, 15,15,0,D_EXIT, 0,0,"4", (void *)KEY_4,NULL}, - {d_getkey, 170,42,28,28, 15,15,0,D_EXIT, 0,0,"5", (void *)KEY_5,NULL}, - {d_getkey, 202,42,28,28, 15,15,0,D_EXIT, 0,0,"6", (void *)KEY_6,NULL}, - {d_getkey, 234,42,28,28, 15,15,0,D_EXIT, 0,0,"7", (void *)KEY_7,NULL}, - {d_getkey, 266,42,28,28, 15,15,0,D_EXIT, 0,0,"8", (void *)KEY_8,NULL}, - {d_getkey, 298,42,28,28, 15,15,0,D_EXIT, 0,0,"9", (void *)KEY_9,NULL}, - {d_getkey, 330,42,28,28, 15,15,0,D_EXIT, 0,0,"0", (void *)KEY_0,NULL}, - {d_getkey, 362,42,28,28, 15,15,0,D_EXIT, 0,0,"=", (void *)KEY_MINUS,NULL}, - {d_getkey, 394,42,28,28, 15,15,0,D_EXIT, 0,0,"^", (void *)KEY_EQUALS,NULL}, - {d_getkey, 426,42,28,28, 15,15,0,D_EXIT, 0,0,"\\", (void *)KEY_BACKSLASH2,NULL}, - {d_getkey, 458,42,28,28, 15,15,0,D_EXIT, 0,0,"LFT", (void *)KEY_LEFT,"LEFT"},//25 - {d_getkey, 490,42,28,28, 15,15,0,D_EXIT, 0,0,"RGT", (void *)KEY_RIGHT,"RIGHT"},//26 - {d_getkey, 10,74,44,28, 15,15,0,D_EXIT, 0,0,"TAB", (void *)KEY_TAB,NULL}, - {d_getkey, 58,74,28,28, 15,15,0,D_EXIT, 0,0,"Q", (void *)KEY_Q,NULL}, - {d_getkey, 90,74,28,28, 15,15,0,D_EXIT, 0,0,"W", (void *)KEY_W,NULL}, - {d_getkey, 122,74,28,28, 15,15,0,D_EXIT, 0,0,"E", (void *)KEY_E,NULL}, - {d_getkey, 154,74,28,28, 15,15,0,D_EXIT, 0,0,"R", (void *)KEY_R,NULL}, - {d_getkey, 186,74,28,28, 15,15,0,D_EXIT, 0,0,"T", (void *)KEY_T,NULL}, - {d_getkey, 218,74,28,28, 15,15,0,D_EXIT, 0,0,"Y", (void *)KEY_Y,NULL}, - {d_getkey, 250,74,28,28, 15,15,0,D_EXIT, 0,0,"U", (void *)KEY_U,NULL}, - {d_getkey, 282,74,28,28, 15,15,0,D_EXIT, 0,0,"I", (void *)KEY_I,NULL}, - {d_getkey, 314,74,28,28, 15,15,0,D_EXIT, 0,0,"O", (void *)KEY_O,NULL}, - {d_getkey, 346,74,28,28, 15,15,0,D_EXIT, 0,0,"P", (void *)KEY_P,NULL}, - {d_getkey, 378,74,28,28, 15,15,0,D_EXIT, 0,0,"@", (void *)KEY_OPENBRACE,NULL}, - {d_getkey, 410,74,28,28, 15,15,0,D_EXIT, 0,0,"[", (void *)KEY_CLOSEBRACE,NULL}, - {d_getkey, 442,74,28,28, 15,15,0,D_EXIT, 0,0,"_", (void *)KEY_TILDE,NULL}, - {d_getkey, 474,10,28,28, 15,15,0,D_EXIT, 0,0,"UP", (void *)KEY_UP,NULL},//41 - {d_getkey, 474,74,28,28, 15,15,0,D_EXIT, 0,0,"DWN", (void *)KEY_DOWN,"DOWN"},//42 - {d_getkey, 10,106,28,28, 15,15,0,D_EXIT, 0,0,"CLK", (void *)KEY_CAPSLOCK,"CAPS LOCK"}, - {d_getkey, 42,106,28,28, 15,15,0,D_EXIT, 0,0,"CTL", (void *)KEY_LCONTROL,"CTRL"}, - {d_getkey, 74,106,28,28, 15,15,0,D_EXIT, 0,0,"A", (void *)KEY_A,NULL}, - {d_getkey, 106,106,28,28, 15,15,0,D_EXIT, 0,0,"S", (void *)KEY_S,NULL}, - {d_getkey, 138,106,28,28, 15,15,0,D_EXIT, 0,0,"D", (void *)KEY_D,NULL}, - {d_getkey, 170,106,28,28, 15,15,0,D_EXIT, 0,0,"F", (void *)KEY_F,NULL}, - {d_getkey, 202,106,28,28, 15,15,0,D_EXIT, 0,0,"G", (void *)KEY_G,NULL}, - {d_getkey, 234,106,28,28, 15,15,0,D_EXIT, 0,0,"H", (void *)KEY_H,NULL}, - {d_getkey, 266,106,28,28, 15,15,0,D_EXIT, 0,0,"J", (void *)KEY_J,NULL}, - {d_getkey, 298,106,28,28, 15,15,0,D_EXIT, 0,0,"K", (void *)KEY_K,NULL}, - {d_getkey, 330,106,28,28, 15,15,0,D_EXIT, 0,0,"L", (void *)KEY_L,NULL}, - {d_getkey, 362,106,28,28, 15,15,0,D_EXIT, 0,0,";", (void *)KEY_SEMICOLON,NULL}, - {d_getkey, 394,106,28,28, 15,15,0,D_EXIT, 0,0,":", (void *)KEY_QUOTE,NULL}, - {d_getkey, 426,106,28,28, 15,15,0,D_EXIT, 0,0,"]", (void *)KEY_BACKSLASH,NULL}, - {d_getkey, 458,106,60,28, 15,15,0,D_EXIT, 0,0,"RET", (void *)KEY_ENTER,"RETURN"}, - {d_getkey, 10,138,28,28, 15,15,0,D_EXIT, 0,0,"SLK", (void *)KEY_ALT,"SHIFT LOCK"}, - {d_getkey, 42,138,44,28, 15,15,0,D_EXIT, 0,0,"SHIFT", (void *)KEY_LSHIFT,NULL}, - {d_getkey, 90,138,28,28, 15,15,0,D_EXIT, 0,0,"Z", (void *)KEY_Z,NULL}, - {d_getkey, 122,138,28,28, 15,15,0,D_EXIT, 0,0,"X", (void *)KEY_X,NULL}, - {d_getkey, 154,138,28,28, 15,15,0,D_EXIT, 0,0,"C", (void *)KEY_C,NULL}, - {d_getkey, 186,138,28,28, 15,15,0,D_EXIT, 0,0,"V", (void *)KEY_V,NULL}, - {d_getkey, 218,138,28,28, 15,15,0,D_EXIT, 0,0,"B", (void *)KEY_B,NULL}, - {d_getkey, 250,138,28,28, 15,15,0,D_EXIT, 0,0,"N", (void *)KEY_N,NULL}, - {d_getkey, 282,138,28,28, 15,15,0,D_EXIT, 0,0,"M", (void *)KEY_M,NULL}, - {d_getkey, 314,138,28,28, 15,15,0,D_EXIT, 0,0,",", (void *)KEY_COMMA,NULL}, - {d_getkey, 346,138,28,28, 15,15,0,D_EXIT, 0,0,".", (void *)KEY_STOP,NULL}, - {d_getkey, 378,138,28,28, 15,15,0,D_EXIT, 0,0,"/", (void *)KEY_SLASH,NULL}, - {d_getkey, 410,138,44,28, 15,15,0,D_EXIT, 0,0,"SHIFT", (void *)KEY_RSHIFT,NULL}, - {d_getkey, 458,138,28,28, 15,15,0,D_EXIT, 0,0,"DEL", (void *)KEY_DEL,"DELETE"}, - {d_getkey, 490,138,28,28, 15,15,0,D_EXIT, 0,0,"CPY", (void *)KEY_END,"COPY"},//72 - {d_getkey, 122,170,256,28, 15,15,0,D_EXIT, 0,0,"SPACE", (void *)KEY_SPACE,NULL}, - - {d_getkey, 538,10,28,28, 15,15,0,D_EXIT, 0,0,"+", (void *)KEY_PLUS_PAD, NULL}, - {d_getkey, 570,10,28,28, 15,15,0,D_EXIT, 0,0,"-", (void *)KEY_MINUS_PAD, NULL}, - {d_getkey, 602,10,28,28, 15,15,0,D_EXIT, 0,0,"/", (void *)KEY_SLASH_PAD, NULL}, - {d_getkey, 634,10,28,28, 15,15,0,D_EXIT, 0,0,"*", (void *)KEY_ASTERISK, NULL}, - {d_getkey, 538,42,28,28, 15,15,0,D_EXIT, 0,0,"7", (void *)KEY_7_PAD, NULL}, - {d_getkey, 570,42,28,28, 15,15,0,D_EXIT, 0,0,"8", (void *)KEY_8_PAD, NULL}, - {d_getkey, 602,42,28,28, 15,15,0,D_EXIT, 0,0,"9", (void *)KEY_9_PAD, NULL}, - {d_getkey, 634,42,28,28, 15,15,0,D_EXIT, 0,0,"#", (void *)KEY_DOWN, NULL}, - {d_getkey, 538,74,28,28, 15,15,0,D_EXIT, 0,0,"4", (void *)KEY_4_PAD, NULL}, - {d_getkey, 570,74,28,28, 15,15,0,D_EXIT, 0,0,"5", (void *)KEY_5_PAD, NULL}, - {d_getkey, 602,74,28,28, 15,15,0,D_EXIT, 0,0,"6", (void *)KEY_6_PAD, NULL}, - {d_getkey, 634,74,28,28, 15,15,0,D_EXIT, 0,0,"DEL", (void *)KEY_DEL_PAD, "DELETE"}, - {d_getkey, 538,106,28,28, 15,15,0,D_EXIT, 0,0,"1", (void *)KEY_1_PAD, NULL}, - {d_getkey, 570,106,28,28, 15,15,0,D_EXIT, 0,0,"2", (void *)KEY_2_PAD, NULL}, - {d_getkey, 602,106,28,28, 15,15,0,D_EXIT, 0,0,"3", (void *)KEY_3_PAD, NULL}, - {d_getkey, 634,106,28,28, 15,15,0,D_EXIT, 0,0,",", (void *)KEY_HOME, NULL}, - {d_getkey, 538,138,28,28, 15,15,0,D_EXIT, 0,0,"0", (void *)KEY_0_PAD, NULL}, - {d_getkey, 570,138,28,28, 15,15,0,D_EXIT, 0,0,".", (void *)KEY_PGDN, NULL}, - {d_getkey, 602,138,60,28, 15,15,0,D_EXIT, 0,0,"RETURN", (void *)KEY_ENTER_PAD, NULL}, - - {d_yield_proc}, - {0,0,0,0,0,0,0,0,0,0,0,NULL,NULL,NULL} -}; - -int gui_keydefine() -{ - DIALOG_PLAYER *dp; - BITMAP *b; - DIALOG *d=MASTER?bemdefineguim:bemdefinegui; - int xOffset,yOffset; - int c=0; - - xSize = d[0].w; - ySize = d[0].h; - - xOffset = (SCREEN_W>>1) - (xSize>>1); - yOffset = (SCREEN_H>>1) - (ySize>>1); - - while (d[c].proc) - { - d[c].x+=xOffset; - d[c].y+=yOffset; - d[c].fg=0xFFFFFF; - if (c>=1 && c<=10) d[c].bg=makecol(127,0,0); - if (c==25 || c==26 || c==41 || c==42 || c==72) d[c].bg=makecol(127,127,127); - c++; - } - for (c=0;c<128;c++) keytemp[c]=keylookup[c]; - b=create_bitmap(xSize, ySize); - scare_mouse(); - blit(screen,b,xOffset,yOffset,0,0,xSize,ySize); - dp=init_dialog(d,0); - unscare_mouse(); - while (c && !key[KEY_F11] && !(mouse_b&2) && !key[KEY_ESC]) - { - c=update_dialog(dp); - } - shutdown_dialog(dp); - if (c==1) - { - for (c=0;c<128;c++) keylookup[c]=keytemp[c]; - } - /*Hide mouse when blitting to avoid screen corruption*/ - scare_mouse(); - blit(b,screen,0,0,xOffset,yOffset,xSize,ySize); - unscare_mouse(); - - destroy_bitmap(b); - - c=0; - while (d[c].proc) - { - d[c].x-=xOffset; - d[c].y-=yOffset; - c++; - } - return D_O_K; -} -#endif +/*B-em v2.2 by Tom Walker + Linux keyboard redefinition GUI*/ + +#ifndef WIN32 +#include +#include "b-em.h" +#include "keyboard.h" +#include "model.h" + +int keytemp[128]; + +char *key_names[] = +{ + "", "A", "B", "C", + "D", "E", "F", "G", + "H", "I", "J", "K", + "L", "M", "N", "O", + "P", "Q", "R", "S", + "T", "U", "V", "W", + "X", "Y", "Z", "0", + "1", "2", "3", "4", + "5", "6", "7", "8", + "9", "0_PAD", "1_PAD", "2_PAD", + "3_PAD", "4_PAD", "5_PAD", "6_PAD", + "7_PAD", "8_PAD", "9_PAD", "F1", + "F2", "F3", "F4", "F5", + "F6", "F7", "F8", "F9", + "F10", "F11", "F12", "ESC", + "TILDE", "MINUS", "EQUALS", "BACKSPACE", + "TAB", "OPENBRACE", "CLOSEBRACE", "ENTER", + "COLON", "QUOTE", "BACKSLASH", "BACKSLASH2", + "COMMA", "STOP", "SLASH", "SPACE", + "INSERT", "DEL", "HOME", "END", + "PGUP", "PGDN", "LEFT", "RIGHT", + "UP", "DOWN", "SLASH_PAD", "ASTERISK", + "MINUS_PAD", "PLUS_PAD", "DEL_PAD", "ENTER_PAD", + "PRTSCR", "PAUSE", "ABNT_C1", "YEN", + "KANA", "CONVERT", "NOCONVERT", "AT", + "CIRCUMFLEX", "COLON2", "KANJI", "EQUALS_PAD", + "BACKQUOTE", "SEMICOLON", "COMMAND", "UNKNOWN1", + "UNKNOWN2", "UNKNOWN3", "UNKNOWN4", "UNKNOWN5", + "UNKNOWN6", "UNKNOWN7", "UNKNOWN8", "LSHIFT", + "RSHIFT", "LCONTROL", "RCONTROL", "ALT", + "ALTGR", "LWIN", "RWIN", "MENU", + "SCRLOCK", "NUMLOCK", "CAPSLOCK", "MAX" +}; + +int d_getkey(int msg, DIALOG *d, int cd) +{ + BITMAP *b; + int x,y; + int ret = d_button_proc(msg, d, cd); + int k,k2; + int c; + char s[1024],s2[1024],s3[64]; + if (ret==D_EXIT) + { + k=(int)d->dp2; + x=(SCREEN_W/2)-100; + y=(SCREEN_H/2)-36; + b=create_bitmap(200,72); + blit(screen,b,x,y,0,0,200,72); + rectfill(screen,x,y,x+199,y+71,makecol(0,0,0)); + rect(screen,x,y,x+199,y+71,makecol(255,255,255)); + if (d->dp3) textprintf_ex(screen,font,x+8,y+8,makecol(255,255,255),makecol(0,0,0),"Redefining %s",(char *)d->dp3); + else textprintf_ex(screen,font,x+8,y+8,makecol(255,255,255),makecol(0,0,0),"Redefining %s",(char *)d->dp); + textprintf_ex(screen,font,x+8,y+24,makecol(255,255,255),makecol(0,0,0),"Assigned to PC key(s) :"); + + s[0]=0; + for (c=0;c<128;c++) + { + if (keylookup[c]==k) + { + if (s[0]) sprintf(s3,", %s",key_names[c]); + else sprintf(s3,"%s",key_names[c]); + sprintf(s2,"%s%s",s,s3); + strcpy(s,s2); + } + } + + textprintf_ex(screen,font,x+8,y+40,makecol(255,255,255),makecol(0,0,0),s); + + textprintf_ex(screen,font,x+8,y+56,makecol(255,255,255),makecol(0,0,0),"Please press new key..."); +getnewkey: + while (!keypressed()); + k2=readkey()>>8; + if (k2==KEY_F11 || k2==KEY_F12) goto getnewkey; + keylookup[k2]=k; + + blit(b,screen,0,0,x,y,200,72); + destroy_bitmap(b); + while (key[KEY_SPACE]); + while (keypressed()) readkey(); + return 0; + } + return ret; +} + +DIALOG bemdefinegui[]= +{ + {d_box_proc, 0, 0, 538, 256, 15,15,0,0, 0,0,0, NULL,NULL}, + + {d_button_proc, 205,218,60,28, 15,15,0,D_CLOSE, 0,0,"OK", NULL,NULL}, + {d_button_proc, 271,218,60,28, 15,15,0,D_CLOSE, 0,0,"Cancel", NULL,NULL}, + + {d_getkey, 82,10,28,28, 15,15,0,D_EXIT, 0,0,"F0", (void *)KEY_F1,NULL}, + {d_getkey, 114,10,28,28, 15,15,0,D_EXIT, 0,0,"F1", (void *)KEY_F2,NULL}, + {d_getkey, 146,10,28,28, 15,15,0,D_EXIT, 0,0,"F2", (void *)KEY_F3,NULL}, + {d_getkey, 178,10,28,28, 15,15,0,D_EXIT, 0,0,"F3", (void *)KEY_F4,NULL}, + {d_getkey, 210,10,28,28, 15,15,0,D_EXIT, 0,0,"F4", (void *)KEY_F5,NULL}, + {d_getkey, 242,10,28,28, 15,15,0,D_EXIT, 0,0,"F5", (void *)KEY_F6,NULL}, + {d_getkey, 274,10,28,28, 15,15,0,D_EXIT, 0,0,"F6", (void *)KEY_F7,NULL}, + {d_getkey, 306,10,28,28, 15,15,0,D_EXIT, 0,0,"F7", (void *)KEY_F8,NULL}, + {d_getkey, 338,10,28,28, 15,15,0,D_EXIT, 0,0,"F8", (void *)KEY_F9,NULL}, + {d_getkey, 370,10,28,28, 15,15,0,D_EXIT, 0,0,"F9", (void *)KEY_F10,NULL}, + {d_getkey, 10,42,28,28, 15,15,0,D_EXIT, 0,0,"ESC", (void *)KEY_ESC,NULL}, + {d_getkey, 42,42,28,28, 15,15,0,D_EXIT, 0,0,"1", (void *)KEY_1,NULL}, + {d_getkey, 74,42,28,28, 15,15,0,D_EXIT, 0,0,"2", (void *)KEY_2,NULL}, + {d_getkey, 106,42,28,28, 15,15,0,D_EXIT, 0,0,"3", (void *)KEY_3,NULL}, + {d_getkey, 138,42,28,28, 15,15,0,D_EXIT, 0,0,"4", (void *)KEY_4,NULL}, + {d_getkey, 170,42,28,28, 15,15,0,D_EXIT, 0,0,"5", (void *)KEY_5,NULL}, + {d_getkey, 202,42,28,28, 15,15,0,D_EXIT, 0,0,"6", (void *)KEY_6,NULL}, + {d_getkey, 234,42,28,28, 15,15,0,D_EXIT, 0,0,"7", (void *)KEY_7,NULL}, + {d_getkey, 266,42,28,28, 15,15,0,D_EXIT, 0,0,"8", (void *)KEY_8,NULL}, + {d_getkey, 298,42,28,28, 15,15,0,D_EXIT, 0,0,"9", (void *)KEY_9,NULL}, + {d_getkey, 330,42,28,28, 15,15,0,D_EXIT, 0,0,"0", (void *)KEY_0,NULL}, + {d_getkey, 362,42,28,28, 15,15,0,D_EXIT, 0,0,"=", (void *)KEY_MINUS,NULL}, + {d_getkey, 394,42,28,28, 15,15,0,D_EXIT, 0,0,"^", (void *)KEY_EQUALS,NULL}, + {d_getkey, 426,42,28,28, 15,15,0,D_EXIT, 0,0,"\\", (void *)KEY_BACKSLASH2,NULL}, + {d_getkey, 458,42,28,28, 15,15,0,D_EXIT, 0,0,"LFT", (void *)KEY_LEFT,"LEFT"},//25 + {d_getkey, 490,42,28,28, 15,15,0,D_EXIT, 0,0,"RGT", (void *)KEY_RIGHT,"RIGHT"},//26 + {d_getkey, 10,74,44,28, 15,15,0,D_EXIT, 0,0,"TAB", (void *)KEY_TAB,NULL}, + {d_getkey, 58,74,28,28, 15,15,0,D_EXIT, 0,0,"Q", (void *)KEY_Q,NULL}, + {d_getkey, 90,74,28,28, 15,15,0,D_EXIT, 0,0,"W", (void *)KEY_W,NULL}, + {d_getkey, 122,74,28,28, 15,15,0,D_EXIT, 0,0,"E", (void *)KEY_E,NULL}, + {d_getkey, 154,74,28,28, 15,15,0,D_EXIT, 0,0,"R", (void *)KEY_R,NULL}, + {d_getkey, 186,74,28,28, 15,15,0,D_EXIT, 0,0,"T", (void *)KEY_T,NULL}, + {d_getkey, 218,74,28,28, 15,15,0,D_EXIT, 0,0,"Y", (void *)KEY_Y,NULL}, + {d_getkey, 250,74,28,28, 15,15,0,D_EXIT, 0,0,"U", (void *)KEY_U,NULL}, + {d_getkey, 282,74,28,28, 15,15,0,D_EXIT, 0,0,"I", (void *)KEY_I,NULL}, + {d_getkey, 314,74,28,28, 15,15,0,D_EXIT, 0,0,"O", (void *)KEY_O,NULL}, + {d_getkey, 346,74,28,28, 15,15,0,D_EXIT, 0,0,"P", (void *)KEY_P,NULL}, + {d_getkey, 378,74,28,28, 15,15,0,D_EXIT, 0,0,"@", (void *)KEY_OPENBRACE,NULL}, + {d_getkey, 410,74,28,28, 15,15,0,D_EXIT, 0,0,"[", (void *)KEY_CLOSEBRACE,NULL}, + {d_getkey, 442,74,28,28, 15,15,0,D_EXIT, 0,0,"_", (void *)KEY_TILDE,NULL}, + {d_getkey, 474,74,28,28, 15,15,0,D_EXIT, 0,0,"UP", (void *)KEY_UP,NULL},//41 + {d_getkey, 506,74,28,28, 15,15,0,D_EXIT, 0,0,"DWN", (void *)KEY_DOWN,"DOWN"},//42 + {d_getkey, 10,106,28,28, 15,15,0,D_EXIT, 0,0,"CLK", (void *)KEY_CAPSLOCK,"CAPS LOCK"}, + {d_getkey, 42,106,28,28, 15,15,0,D_EXIT, 0,0,"CTL", (void *)KEY_LCONTROL,"CTRL"}, + {d_getkey, 74,106,28,28, 15,15,0,D_EXIT, 0,0,"A", (void *)KEY_A,NULL}, + {d_getkey, 106,106,28,28, 15,15,0,D_EXIT, 0,0,"S", (void *)KEY_S,NULL}, + {d_getkey, 138,106,28,28, 15,15,0,D_EXIT, 0,0,"D", (void *)KEY_D,NULL}, + {d_getkey, 170,106,28,28, 15,15,0,D_EXIT, 0,0,"F", (void *)KEY_F,NULL}, + {d_getkey, 202,106,28,28, 15,15,0,D_EXIT, 0,0,"G", (void *)KEY_G,NULL}, + {d_getkey, 234,106,28,28, 15,15,0,D_EXIT, 0,0,"H", (void *)KEY_H,NULL}, + {d_getkey, 266,106,28,28, 15,15,0,D_EXIT, 0,0,"J", (void *)KEY_J,NULL}, + {d_getkey, 298,106,28,28, 15,15,0,D_EXIT, 0,0,"K", (void *)KEY_K,NULL}, + {d_getkey, 330,106,28,28, 15,15,0,D_EXIT, 0,0,"L", (void *)KEY_L,NULL}, + {d_getkey, 362,106,28,28, 15,15,0,D_EXIT, 0,0,";", (void *)KEY_SEMICOLON,NULL}, + {d_getkey, 394,106,28,28, 15,15,0,D_EXIT, 0,0,":", (void *)KEY_QUOTE,NULL}, + {d_getkey, 426,106,28,28, 15,15,0,D_EXIT, 0,0,"]", (void *)KEY_BACKSLASH,NULL}, + {d_getkey, 458,106,60,28, 15,15,0,D_EXIT, 0,0,"RET", (void *)KEY_ENTER,"RETURN"}, + {d_getkey, 10,138,28,28, 15,15,0,D_EXIT, 0,0,"SLK", (void *)KEY_ALT,"SHIFT LOCK"}, + {d_getkey, 42,138,44,28, 15,15,0,D_EXIT, 0,0,"SHIFT", (void *)KEY_LSHIFT,NULL}, + {d_getkey, 90,138,28,28, 15,15,0,D_EXIT, 0,0,"Z", (void *)KEY_Z,NULL}, + {d_getkey, 122,138,28,28, 15,15,0,D_EXIT, 0,0,"X", (void *)KEY_X,NULL}, + {d_getkey, 154,138,28,28, 15,15,0,D_EXIT, 0,0,"C", (void *)KEY_C,NULL}, + {d_getkey, 186,138,28,28, 15,15,0,D_EXIT, 0,0,"V", (void *)KEY_V,NULL}, + {d_getkey, 218,138,28,28, 15,15,0,D_EXIT, 0,0,"B", (void *)KEY_B,NULL}, + {d_getkey, 250,138,28,28, 15,15,0,D_EXIT, 0,0,"N", (void *)KEY_N,NULL}, + {d_getkey, 282,138,28,28, 15,15,0,D_EXIT, 0,0,"M", (void *)KEY_M,NULL}, + {d_getkey, 314,138,28,28, 15,15,0,D_EXIT, 0,0,",", (void *)KEY_COMMA,NULL}, + {d_getkey, 346,138,28,28, 15,15,0,D_EXIT, 0,0,".", (void *)KEY_STOP,NULL}, + {d_getkey, 378,138,28,28, 15,15,0,D_EXIT, 0,0,"/", (void *)KEY_SLASH,NULL}, + {d_getkey, 410,138,44,28, 15,15,0,D_EXIT, 0,0,"SHIFT", (void *)KEY_RSHIFT,NULL}, + {d_getkey, 458,138,28,28, 15,15,0,D_EXIT, 0,0,"DEL", (void *)KEY_DEL,"DELETE"}, + {d_getkey, 490,138,28,28, 15,15,0,D_EXIT, 0,0,"CPY", (void *)KEY_END,"COPY"},//72 + {d_getkey, 122,170,256,28, 15,15,0,D_EXIT, 0,0,"SPACE", (void *)KEY_SPACE,NULL}, + + {d_yield_proc}, + {0,0,0,0,0,0,0,0,0,0,0,NULL,NULL,NULL} +}; + +DIALOG bemdefineguim[]= +{ + {d_box_proc, 0, 0, 676, 256, 15,15,0,0, 0,0,0, NULL,NULL}, + + {d_button_proc, 205,218,60,28, 15,15,0,D_CLOSE, 0,0,"OK", NULL,NULL}, + {d_button_proc, 271,218,60,28, 15,15,0,D_CLOSE, 0,0,"Cancel", NULL,NULL}, + + {d_getkey, 50,10,28,28, 15,15,0,D_EXIT, 0,0,"F0", (void *)KEY_F1,NULL}, + {d_getkey, 82,10,28,28, 15,15,0,D_EXIT, 0,0,"F1", (void *)KEY_F2,NULL}, + {d_getkey, 114,10,28,28, 15,15,0,D_EXIT, 0,0,"F2", (void *)KEY_F3,NULL}, + {d_getkey, 146,10,28,28, 15,15,0,D_EXIT, 0,0,"F3", (void *)KEY_F4,NULL}, + {d_getkey, 178,10,28,28, 15,15,0,D_EXIT, 0,0,"F4", (void *)KEY_F5,NULL}, + {d_getkey, 210,10,28,28, 15,15,0,D_EXIT, 0,0,"F5", (void *)KEY_F6,NULL}, + {d_getkey, 242,10,28,28, 15,15,0,D_EXIT, 0,0,"F6", (void *)KEY_F7,NULL}, + {d_getkey, 274,10,28,28, 15,15,0,D_EXIT, 0,0,"F7", (void *)KEY_F8,NULL}, + {d_getkey, 306,10,28,28, 15,15,0,D_EXIT, 0,0,"F8", (void *)KEY_F9,NULL}, + {d_getkey, 338,10,28,28, 15,15,0,D_EXIT, 0,0,"F9", (void *)KEY_F10,NULL}, + {d_getkey, 10,42,28,28, 15,15,0,D_EXIT, 0,0,"ESC", (void *)KEY_ESC,NULL}, + {d_getkey, 42,42,28,28, 15,15,0,D_EXIT, 0,0,"1", (void *)KEY_1,NULL}, + {d_getkey, 74,42,28,28, 15,15,0,D_EXIT, 0,0,"2", (void *)KEY_2,NULL}, + {d_getkey, 106,42,28,28, 15,15,0,D_EXIT, 0,0,"3", (void *)KEY_3,NULL}, + {d_getkey, 138,42,28,28, 15,15,0,D_EXIT, 0,0,"4", (void *)KEY_4,NULL}, + {d_getkey, 170,42,28,28, 15,15,0,D_EXIT, 0,0,"5", (void *)KEY_5,NULL}, + {d_getkey, 202,42,28,28, 15,15,0,D_EXIT, 0,0,"6", (void *)KEY_6,NULL}, + {d_getkey, 234,42,28,28, 15,15,0,D_EXIT, 0,0,"7", (void *)KEY_7,NULL}, + {d_getkey, 266,42,28,28, 15,15,0,D_EXIT, 0,0,"8", (void *)KEY_8,NULL}, + {d_getkey, 298,42,28,28, 15,15,0,D_EXIT, 0,0,"9", (void *)KEY_9,NULL}, + {d_getkey, 330,42,28,28, 15,15,0,D_EXIT, 0,0,"0", (void *)KEY_0,NULL}, + {d_getkey, 362,42,28,28, 15,15,0,D_EXIT, 0,0,"=", (void *)KEY_MINUS,NULL}, + {d_getkey, 394,42,28,28, 15,15,0,D_EXIT, 0,0,"^", (void *)KEY_EQUALS,NULL}, + {d_getkey, 426,42,28,28, 15,15,0,D_EXIT, 0,0,"\\", (void *)KEY_BACKSLASH2,NULL}, + {d_getkey, 458,42,28,28, 15,15,0,D_EXIT, 0,0,"LFT", (void *)KEY_LEFT,"LEFT"},//25 + {d_getkey, 490,42,28,28, 15,15,0,D_EXIT, 0,0,"RGT", (void *)KEY_RIGHT,"RIGHT"},//26 + {d_getkey, 10,74,44,28, 15,15,0,D_EXIT, 0,0,"TAB", (void *)KEY_TAB,NULL}, + {d_getkey, 58,74,28,28, 15,15,0,D_EXIT, 0,0,"Q", (void *)KEY_Q,NULL}, + {d_getkey, 90,74,28,28, 15,15,0,D_EXIT, 0,0,"W", (void *)KEY_W,NULL}, + {d_getkey, 122,74,28,28, 15,15,0,D_EXIT, 0,0,"E", (void *)KEY_E,NULL}, + {d_getkey, 154,74,28,28, 15,15,0,D_EXIT, 0,0,"R", (void *)KEY_R,NULL}, + {d_getkey, 186,74,28,28, 15,15,0,D_EXIT, 0,0,"T", (void *)KEY_T,NULL}, + {d_getkey, 218,74,28,28, 15,15,0,D_EXIT, 0,0,"Y", (void *)KEY_Y,NULL}, + {d_getkey, 250,74,28,28, 15,15,0,D_EXIT, 0,0,"U", (void *)KEY_U,NULL}, + {d_getkey, 282,74,28,28, 15,15,0,D_EXIT, 0,0,"I", (void *)KEY_I,NULL}, + {d_getkey, 314,74,28,28, 15,15,0,D_EXIT, 0,0,"O", (void *)KEY_O,NULL}, + {d_getkey, 346,74,28,28, 15,15,0,D_EXIT, 0,0,"P", (void *)KEY_P,NULL}, + {d_getkey, 378,74,28,28, 15,15,0,D_EXIT, 0,0,"@", (void *)KEY_OPENBRACE,NULL}, + {d_getkey, 410,74,28,28, 15,15,0,D_EXIT, 0,0,"[", (void *)KEY_CLOSEBRACE,NULL}, + {d_getkey, 442,74,28,28, 15,15,0,D_EXIT, 0,0,"_", (void *)KEY_TILDE,NULL}, + {d_getkey, 474,10,28,28, 15,15,0,D_EXIT, 0,0,"UP", (void *)KEY_UP,NULL},//41 + {d_getkey, 474,74,28,28, 15,15,0,D_EXIT, 0,0,"DWN", (void *)KEY_DOWN,"DOWN"},//42 + {d_getkey, 10,106,28,28, 15,15,0,D_EXIT, 0,0,"CLK", (void *)KEY_CAPSLOCK,"CAPS LOCK"}, + {d_getkey, 42,106,28,28, 15,15,0,D_EXIT, 0,0,"CTL", (void *)KEY_LCONTROL,"CTRL"}, + {d_getkey, 74,106,28,28, 15,15,0,D_EXIT, 0,0,"A", (void *)KEY_A,NULL}, + {d_getkey, 106,106,28,28, 15,15,0,D_EXIT, 0,0,"S", (void *)KEY_S,NULL}, + {d_getkey, 138,106,28,28, 15,15,0,D_EXIT, 0,0,"D", (void *)KEY_D,NULL}, + {d_getkey, 170,106,28,28, 15,15,0,D_EXIT, 0,0,"F", (void *)KEY_F,NULL}, + {d_getkey, 202,106,28,28, 15,15,0,D_EXIT, 0,0,"G", (void *)KEY_G,NULL}, + {d_getkey, 234,106,28,28, 15,15,0,D_EXIT, 0,0,"H", (void *)KEY_H,NULL}, + {d_getkey, 266,106,28,28, 15,15,0,D_EXIT, 0,0,"J", (void *)KEY_J,NULL}, + {d_getkey, 298,106,28,28, 15,15,0,D_EXIT, 0,0,"K", (void *)KEY_K,NULL}, + {d_getkey, 330,106,28,28, 15,15,0,D_EXIT, 0,0,"L", (void *)KEY_L,NULL}, + {d_getkey, 362,106,28,28, 15,15,0,D_EXIT, 0,0,";", (void *)KEY_SEMICOLON,NULL}, + {d_getkey, 394,106,28,28, 15,15,0,D_EXIT, 0,0,":", (void *)KEY_QUOTE,NULL}, + {d_getkey, 426,106,28,28, 15,15,0,D_EXIT, 0,0,"]", (void *)KEY_BACKSLASH,NULL}, + {d_getkey, 458,106,60,28, 15,15,0,D_EXIT, 0,0,"RET", (void *)KEY_ENTER,"RETURN"}, + {d_getkey, 10,138,28,28, 15,15,0,D_EXIT, 0,0,"SLK", (void *)KEY_ALT,"SHIFT LOCK"}, + {d_getkey, 42,138,44,28, 15,15,0,D_EXIT, 0,0,"SHIFT", (void *)KEY_LSHIFT,NULL}, + {d_getkey, 90,138,28,28, 15,15,0,D_EXIT, 0,0,"Z", (void *)KEY_Z,NULL}, + {d_getkey, 122,138,28,28, 15,15,0,D_EXIT, 0,0,"X", (void *)KEY_X,NULL}, + {d_getkey, 154,138,28,28, 15,15,0,D_EXIT, 0,0,"C", (void *)KEY_C,NULL}, + {d_getkey, 186,138,28,28, 15,15,0,D_EXIT, 0,0,"V", (void *)KEY_V,NULL}, + {d_getkey, 218,138,28,28, 15,15,0,D_EXIT, 0,0,"B", (void *)KEY_B,NULL}, + {d_getkey, 250,138,28,28, 15,15,0,D_EXIT, 0,0,"N", (void *)KEY_N,NULL}, + {d_getkey, 282,138,28,28, 15,15,0,D_EXIT, 0,0,"M", (void *)KEY_M,NULL}, + {d_getkey, 314,138,28,28, 15,15,0,D_EXIT, 0,0,",", (void *)KEY_COMMA,NULL}, + {d_getkey, 346,138,28,28, 15,15,0,D_EXIT, 0,0,".", (void *)KEY_STOP,NULL}, + {d_getkey, 378,138,28,28, 15,15,0,D_EXIT, 0,0,"/", (void *)KEY_SLASH,NULL}, + {d_getkey, 410,138,44,28, 15,15,0,D_EXIT, 0,0,"SHIFT", (void *)KEY_RSHIFT,NULL}, + {d_getkey, 458,138,28,28, 15,15,0,D_EXIT, 0,0,"DEL", (void *)KEY_DEL,"DELETE"}, + {d_getkey, 490,138,28,28, 15,15,0,D_EXIT, 0,0,"CPY", (void *)KEY_END,"COPY"},//72 + {d_getkey, 122,170,256,28, 15,15,0,D_EXIT, 0,0,"SPACE", (void *)KEY_SPACE,NULL}, + + {d_getkey, 538,10,28,28, 15,15,0,D_EXIT, 0,0,"+", (void *)KEY_PLUS_PAD, NULL}, + {d_getkey, 570,10,28,28, 15,15,0,D_EXIT, 0,0,"-", (void *)KEY_MINUS_PAD, NULL}, + {d_getkey, 602,10,28,28, 15,15,0,D_EXIT, 0,0,"/", (void *)KEY_SLASH_PAD, NULL}, + {d_getkey, 634,10,28,28, 15,15,0,D_EXIT, 0,0,"*", (void *)KEY_ASTERISK, NULL}, + {d_getkey, 538,42,28,28, 15,15,0,D_EXIT, 0,0,"7", (void *)KEY_7_PAD, NULL}, + {d_getkey, 570,42,28,28, 15,15,0,D_EXIT, 0,0,"8", (void *)KEY_8_PAD, NULL}, + {d_getkey, 602,42,28,28, 15,15,0,D_EXIT, 0,0,"9", (void *)KEY_9_PAD, NULL}, + {d_getkey, 634,42,28,28, 15,15,0,D_EXIT, 0,0,"#", (void *)KEY_DOWN, NULL}, + {d_getkey, 538,74,28,28, 15,15,0,D_EXIT, 0,0,"4", (void *)KEY_4_PAD, NULL}, + {d_getkey, 570,74,28,28, 15,15,0,D_EXIT, 0,0,"5", (void *)KEY_5_PAD, NULL}, + {d_getkey, 602,74,28,28, 15,15,0,D_EXIT, 0,0,"6", (void *)KEY_6_PAD, NULL}, + {d_getkey, 634,74,28,28, 15,15,0,D_EXIT, 0,0,"DEL", (void *)KEY_DEL_PAD, "DELETE"}, + {d_getkey, 538,106,28,28, 15,15,0,D_EXIT, 0,0,"1", (void *)KEY_1_PAD, NULL}, + {d_getkey, 570,106,28,28, 15,15,0,D_EXIT, 0,0,"2", (void *)KEY_2_PAD, NULL}, + {d_getkey, 602,106,28,28, 15,15,0,D_EXIT, 0,0,"3", (void *)KEY_3_PAD, NULL}, + {d_getkey, 634,106,28,28, 15,15,0,D_EXIT, 0,0,",", (void *)KEY_HOME, NULL}, + {d_getkey, 538,138,28,28, 15,15,0,D_EXIT, 0,0,"0", (void *)KEY_0_PAD, NULL}, + {d_getkey, 570,138,28,28, 15,15,0,D_EXIT, 0,0,".", (void *)KEY_PGDN, NULL}, + {d_getkey, 602,138,60,28, 15,15,0,D_EXIT, 0,0,"RETURN", (void *)KEY_ENTER_PAD, NULL}, + + {d_yield_proc}, + {0,0,0,0,0,0,0,0,0,0,0,NULL,NULL,NULL} +}; + +int gui_keydefine() +{ + DIALOG_PLAYER *dp; + BITMAP *b; + DIALOG *d=MASTER?bemdefineguim:bemdefinegui; + int x=0,y; + while (d[x].proc) + { + d[x].x+=(SCREEN_W/2)-(d[0].w/2); + d[x].y+=(SCREEN_H/2)-(d[0].h/2); + d[x].fg=0xFFFFFF; + if (x>=1 && x<=10) d[x].bg=makecol(127,0,0); + if (x==25 || x==26 || x==41 || x==42 || x==72) d[x].bg=makecol(127,127,127); + x++; + } + for (x=0;x<128;x++) keytemp[x]=keylookup[x]; + x=(SCREEN_W/2)-(d[0].w/2); + y=(SCREEN_H/2)-(d[0].h/2); + b=create_bitmap(d[0].w,d[0].h); + blit(screen,b,x,y,0,0,d[0].w,d[0].h); + dp=init_dialog(d,0); + while (x && !key[KEY_F11] && !(mouse_b&2) && !key[KEY_ESC]) + { + x=update_dialog(dp); + } + shutdown_dialog(dp); + if (x==1) + { + for (x=0;x<128;x++) keylookup[x]=keytemp[x]; + } + x=(SCREEN_W/2)-(d[0].w/2); + y=(SCREEN_H/2)-(d[0].h/2); + blit(b,screen,0,0,x,y,d[0].w,d[0].h); + x=0; + while (d[x].proc) + { + d[x].x-=(d[0].w/2)-(538/2); + d[x].y-=(d[0].h/2)-(256/2); + x++; + } + return D_O_K; +} +#endif diff --git a/src/linux.c b/src/linux.c index f38e61f7..0b99dd66 100644 --- a/src/linux.c +++ b/src/linux.c @@ -1,107 +1,91 @@ -/*B-em v2.2 by Tom Walker - Linux main*/ - -#ifndef WIN32 -#include -#include "b-em.h" -#include "config.h" -#include "linux-gui.h" -#include "main.h" -#include "video_render.h" - -int winsizex, winsizey; -int videoresize = 0; - -int mousecapture = 0; -int quited = 0; - -void waitforready() { } -void resumeready() { } -int windx, windy; -void updatewindowsize(int x, int y) -{ - x=(x+3)&~3; y=(y+3)&~3; - if (x<128) x=128; - if (y<64) y=64; - if (windx!=x || windy!=y) - { -// printf("Update window size %i,%i\n",x,y); - windx=winsizex=x; windy=winsizey=y; - set_color_depth(dcol); - set_gfx_mode(GFX_AUTODETECT_WINDOWED,x,y,0,0); - set_color_depth(8); - set_palette(pal); - } -} - -void startblit() -{ -} - -void endblit() -{ -} - -void cataddname(char *s) -{ -} - -void updatewindow() -{ -} - -void bem_error(char *s) -{ - allegro_message(s); -} - -void bem_quit() -{ - quited=1; -} -//#undef printf -int main(int argc, char *argv[]) -{ - int oldf = 0; - char *p; - - if (allegro_init()) - { - printf("Failed to initialise Allegro!"); - exit(-1); - } - - set_close_button_callback(bem_quit); - - set_window_title(B_EM_VERSION); - - get_executable_name(exedir, 511); - p = get_filename(exedir); - p[0] = 0; - config_load(); -// printf("Main\n"); - main_init(argc, argv); -// printf("Inited\n"); - while (!quited) - { - main_run(); - if (key[KEY_F11]) gui_enter(); - if (key[KEY_ALT] && key[KEY_ENTER] && fullscreen && !oldf) - { - fullscreen = 0; - video_leavefullscreen(); - } - else if (key[KEY_ALT] && key[KEY_ENTER] && !fullscreen && !oldf) - { - fullscreen = 1; - video_enterfullscreen(); - } - oldf = key[KEY_ALT] && key[KEY_ENTER]; - } - main_close(); - return 0; -} - -END_OF_MAIN() -//no semicolon after END_OF_MAIN -#endif +/*B-em v2.2 by Tom Walker + Linux main*/ + +#ifndef WIN32 +#include +#include "b-em.h" +#include "config.h" +#include "linux-gui.h" +#include "main.h" +#include "video_render.h" + +int winsizex, winsizey; +int videoresize = 0; + +int mousecapture = 0; +int quited = 0; + +void waitforready() { } +void resumeready() { } +int windx, windy; +void updatewindowsize(int x, int y) +{ + x=(x+3)&~3; y=(y+3)&~3; + if (x<128) x=128; + if (y<64) y=64; + if (windx!=x || windy!=y) + { +// printf("Update window size %i,%i\n",x,y); + windx=winsizex=x; windy=winsizey=y; + set_color_depth(dcol); + set_gfx_mode(GFX_AUTODETECT_WINDOWED,x,y,0,0); + set_color_depth(8); + set_palette(pal); + } +} + +void startblit() +{ +} + +void endblit() +{ +} + +void cataddname(char *s) +{ +} + +void updatewindow() +{ +} + +void bem_error(char *s) +{ + allegro_message(s); +} +//#undef printf +int main(int argc, char *argv[]) +{ + int oldf = 0; + char *p; + allegro_init(); + get_executable_name(exedir, 511); + p = get_filename(exedir); + p[0] = 0; + config_load(); +// printf("Main\n"); + main_init(argc, argv); +// printf("Inited\n"); + while (!quited) + { + main_run(); + if (key[KEY_F11]) gui_enter(); + if (key[KEY_ALT] && key[KEY_ENTER] && fullscreen && !oldf) + { + fullscreen = 0; + video_leavefullscreen(); + } + else if (key[KEY_ALT] && key[KEY_ENTER] && !fullscreen && !oldf) + { + fullscreen = 1; + video_enterfullscreen(); + } + oldf = key[KEY_ALT] && key[KEY_ENTER]; + } + main_close(); + return 0; +} + +END_OF_MAIN(); +#endif diff --git a/src/main.c b/src/main.c index 8c4f4536..d46f0d16 100644 --- a/src/main.c +++ b/src/main.c @@ -1,403 +1,403 @@ -/*B-em v2.2 by Tom Walker - Main loop + start/finish code*/ - -#include -#ifdef WIN32 -#include -#endif -#include -#include -#include - -#include "b-em.h" - -#include "6502.h" -#include "acia.h" -#include "adc.h" -#include "adf.h" -#include "model.h" -#include "cmos.h" -#include "config.h" -#include "csw.h" -#include "ddnoise.h" -#include "debugger.h" -#include "disc.h" -#include "fdi.h" -#include "i8271.h" -#include "ide.h" -#include "keyboard.h" -#include "main.h" -#include "mem.h" -#include "mouse.h" -#ifdef WIN32 -#include "pal.h" -#endif -#include "savestate.h" -#include "serial.h" -#include "sid_b-em.h" -#include "sn76489.h" -#include "sound.h" -#include "soundopenal.h" -#include "ssd.h" -#include "tape.h" -#include "tapenoise.h" -#include "tube.h" -#include "via.h" -#include "sysvia.h" -#include "uef.h" -#include "uservia.h" -#include "video.h" -#include "video_render.h" -#include "wd1770.h" - -#include "tube.h" -#include "32016.h" -#include "6502tube.h" -#include "65816.h" -#include "arm.h" -#include "x86_tube.h" -#include "z80.h" - -#undef printf - -int autoboot=0; -int joybutton[2]; - - - -FILE *arclog; -void rpclog(const char *format, ...) -{ - char buf[256]; - va_list ap; - return; - if (!arclog) arclog=fopen("b-emlog.txt","wt"); - - va_start(ap, format); - vsprintf(buf, format, ap); - va_end(ap); - fputs(buf, arclog); - fflush(arclog); -} - -int printsec; -void secint() -{ - printsec = 1; -} - -int fcount = 0; -void int50() -{ - fcount++; -} - -char exedir[512]; -int debug = 0, debugon = 0; -int ddnoiseframes = 0; - -void main_reset() -{ - m6502_reset(); - crtc_reset(); - sysvia_reset(); - uservia_reset(); - serial_reset(); - acia_reset(); - wd1770_reset(); - i8271_reset(); - sid_reset(); - sn_init(); - if (curtube != -1) tubes[curtube].reset(); - else tube_exec = NULL; - tube_reset(); - - memset(ram, 0, 64 * 1024); -} - - -void main_init(int argc, char *argv[]) -{ - char t[512]; - int c; - int tapenext = 0, discnext = 0; - - startblit(); - - printf(B_EM_VERSION "\n"); - - vid_fskipmax = 1; - - al_init_main(argc, argv); - - - append_filename(t, exedir, "roms\\tube\\ReCo6502ROM_816", 511); - if (!file_exists(t,FA_ALL,NULL) && selecttube == 4) selecttube = -1; - - curtube = selecttube; - if (models[curmodel].tube != -1) curtube = models[curmodel].tube; - - - for (c = 1; c < argc; c++) - { -// rpclog("%i : %s\n",c,argv[c]); -/* if (!strcasecmp(argv[c],"-1770")) - { - I8271=0; - WD1770=1; - } - else*/ -//#ifndef WIN32 - if (!strcasecmp(argv[c], "--help")) - { - printf(B_EM_VERSION " command line options :\n\n"); - printf("-mx - start as model x (see readme.txt for models)\n"); - printf("-tx - start with tube x (see readme.txt for tubes)\n"); - printf("-disc disc.ssd - load disc.ssd into drives :0/:2\n"); - printf("-disc1 disc.ssd - load disc.ssd into drives :1/:3\n"); - printf("-autoboot - boot disc in drive :0\n"); - printf("-tape tape.uef - load tape.uef\n"); - printf("-fasttape - set tape speed to fast\n"); - printf("-s - scanlines display mode\n"); - printf("-i - interlace display mode\n"); - printf("-debug - start debugger\n"); - printf("-allegro - use Allegro for video rendering\n"); - exit(-1); - } - else -//#endif - if (!strcasecmp(argv[c], "-tape")) - { - tapenext = 2; - } - else if (!strcasecmp(argv[c], "-disc") || !strcasecmp(argv[c], "-disk")) - { - discnext = 1; - } - else if (!strcasecmp(argv[c], "-disc1")) - { - discnext = 2; - } - else if (argv[c][0] == '-' && (argv[c][1] == 'm' || argv[c][1] == 'M')) - { - sscanf(&argv[c][2], "%i", &curmodel); - } - else if (argv[c][0] == '-' && (argv[c][1] == 't' || argv[c][1] == 'T')) - { - sscanf(&argv[c][2], "%i", &curtube); - } - else if (!strcasecmp(argv[c], "-fasttape")) - { - fasttape = 1; - } - else if (!strcasecmp(argv[c], "-autoboot")) - { - autoboot = 150; - } - else if (argv[c][0] == '-' && (argv[c][1] == 'f' || argv[c][1]=='F')) - { - sscanf(&argv[c][2], "%i", &vid_fskipmax); - if (vid_fskipmax < 1) vid_fskipmax = 1; - if (vid_fskipmax > 9) vid_fskipmax = 9; - } - else if (argv[c][0] == '-' && (argv[c][1] == 's' || argv[c][1] == 'S')) - { - vid_scanlines = 1; - } - else if (!strcasecmp(argv[c], "-debug")) - { - debug = debugon = 1; - } - else if (argv[c][0] == '-' && (argv[c][1] == 'i' || argv[c][1] == 'I')) - { - vid_interlace = 1; - } - else if (tapenext) - strcpy(tape_fn, argv[c]); - else if (discnext) - { - strcpy(discfns[discnext-1], argv[c]); - discnext = 0; - } - else - { - strcpy(discfns[0], argv[c]); - discnext = 0; - autoboot = 150; - } - if (tapenext) tapenext--; - } - - video_init(); - mode7_makechars(); - -#ifndef WIN32 - install_keyboard(); -#endif - install_timer(); - - mem_init(); - ddnoise_init(); - tapenoise_init(); - - sound_init(); - al_init(); - sid_init(); - sid_settype(sidmethod, cursid); - - adc_init(); -#ifdef WIN32 - pal_init(); -#endif - disc_init(); - ssd_init(); - adf_init(); - fdi_init(); - - ide_init(); - - debug_start(); - - model_init(); - - main_reset(); - - - install_int_ex(secint, MSEC_TO_TIMER(1000)); - install_int_ex(int50, MSEC_TO_TIMER(20)); - - set_display_switch_mode(SWITCH_BACKGROUND); -#ifdef WIN32 - timeBeginPeriod(1); -#endif - oldmodel = curmodel; - - if (curtube == 3 || mouse_amx) install_mouse(); - -//printf("Disc 0 : %s\n",discfns[0]); -//printf("Disc 1 : %s\n",discfns[1]); -//printf("Tape : %s\n",tape_fn); - disc_load(0, discfns[0]); - disc_load(1, discfns[1]); - tape_load(tape_fn); - if (defaultwriteprot) writeprot[0] = writeprot[1] = 1; - - endblit(); -} - -void main_restart() -{ - startblit(); - if (curtube == 3 || mouse_amx) remove_mouse(); - cmos_save(models[oldmodel]); - oldmodel = curmodel; - - model_init(); - - main_reset(); - - resumeready(); - if (curtube == 3 || mouse_amx) install_mouse(); - endblit(); -} - -void main_setmouse() -{ - if (curtube != 3) - { - if (mouse_amx) install_mouse(); - else remove_mouse(); - } -} - -int resetting = 0; -int framesrun = 0; - -void main_cleardrawit() -{ - fcount = 0; -} - -void main_run() -{ - int c, d; - if ((fcount > 0 || key[KEY_PGUP] || (motor && fasttape))) - { - if (autoboot) autoboot--; - fcount--; - framesrun++; - if (key[KEY_PGUP] || (motor && fasttape)) fcount=0; - if (x65c02) m65c02_exec(); - else m6502_exec(); - ddnoiseframes++; - if (ddnoiseframes >= 5) - { - ddnoiseframes = 0; - ddnoise_mix(); - } - key_check(); - poll_joystick(); - for (c = 0; c < 2; c++) - { - joybutton[c] = 0; - for (d = 0; d < joy[c].num_buttons; d++) - { - if (joy[c].button[d].b) joybutton[c] = 1; - } - } - if (savestate_wantload) savestate_doload(); - if (savestate_wantsave) savestate_dosave(); - if (key[KEY_F10] && debugon) debug = 1; - if (key[KEY_F12] && !resetting) - { - m6502_reset(); - i8271_reset(); - wd1770_reset(); - sid_reset(); - - if (curtube != -1) tubes[curtube].reset(); - tube_reset(); - } - resetting = key[KEY_F12]; - } - else - { - framesrun = 0; - rest(1); - } - if (framesrun > 10) fcount = 0; -} - -void main_close() -{ -#ifdef WIN32 - timeEndPeriod(1); -#endif - - config_save(); - cmos_save(models[curmodel]); - - mem_close(); - uef_close(); - csw_close(); - tube_6502_close(); - arm_close(); - x86_close(); - z80_close(); - w65816_close(); - n32016_close(); - disc_close(0); - disc_close(1); - ide_close(); - ddnoise_close(); - tapenoise_close(); - - al_close(); - video_close(); -} - -void changetimerspeed(int i) -{ - remove_int(int50); - install_int_ex(int50, BPS_TO_TIMER(i)); -} +/*B-em v2.2 by Tom Walker + Main loop + start/finish code*/ + +#include +#ifdef WIN32 +#include +#endif +#include +#include +#include + +#include "b-em.h" + +#include "6502.h" +#include "acia.h" +#include "adc.h" +#include "adf.h" +#include "model.h" +#include "cmos.h" +#include "config.h" +#include "csw.h" +#include "ddnoise.h" +#include "debugger.h" +#include "disc.h" +#include "fdi.h" +#include "i8271.h" +#include "ide.h" +#include "keyboard.h" +#include "main.h" +#include "mem.h" +#include "mouse.h" +#ifdef WIN32 +#include "pal.h" +#endif +#include "savestate.h" +#include "serial.h" +#include "sid_b-em.h" +#include "sn76489.h" +#include "sound.h" +#include "soundopenal.h" +#include "ssd.h" +#include "tape.h" +#include "tapenoise.h" +#include "tube.h" +#include "via.h" +#include "sysvia.h" +#include "uef.h" +#include "uservia.h" +#include "video.h" +#include "video_render.h" +#include "wd1770.h" + +#include "tube.h" +#include "32016.h" +#include "6502tube.h" +#include "65816.h" +#include "arm.h" +#include "x86_tube.h" +#include "z80.h" + +#undef printf + +int autoboot=0; +int joybutton[2]; + + + +FILE *arclog; +void rpclog(const char *format, ...) +{ + char buf[256]; + va_list ap; + return; + if (!arclog) arclog=fopen("b-emlog.txt","wt"); + + va_start(ap, format); + vsprintf(buf, format, ap); + va_end(ap); + fputs(buf, arclog); + fflush(arclog); +} + +int printsec; +void secint() +{ + printsec = 1; +} + +int fcount = 0; +void int50() +{ + fcount++; +} + +char exedir[512]; +int debug = 0, debugon = 0; +int ddnoiseframes = 0; + +void main_reset() +{ + m6502_reset(); + crtc_reset(); + sysvia_reset(); + uservia_reset(); + serial_reset(); + acia_reset(); + wd1770_reset(); + i8271_reset(); + sid_reset(); + sn_init(); + if (curtube != -1) tubes[curtube].reset(); + else tube_exec = NULL; + tube_reset(); + + memset(ram, 0, 64 * 1024); +} + + +void main_init(int argc, char *argv[]) +{ + char t[512]; + int c; + int tapenext = 0, discnext = 0; + + startblit(); + + printf("B-em v2.2\n"); + + vid_fskipmax = 1; + + al_init_main(argc, argv); + + + append_filename(t, exedir, "roms\\tube\\ReCo6502ROM_816", 511); + if (!file_exists(t,FA_ALL,NULL) && selecttube == 4) selecttube = -1; + + curtube = selecttube; + if (models[curmodel].tube != -1) curtube = models[curmodel].tube; + + + for (c = 1; c < argc; c++) + { +// rpclog("%i : %s\n",c,argv[c]); +/* if (!strcasecmp(argv[c],"-1770")) + { + I8271=0; + WD1770=1; + } + else*/ +//#ifndef WIN32 + if (!strcasecmp(argv[c], "--help")) + { + printf("B-em v2.1 command line options :\n\n"); + printf("-mx - start as model x (see readme.txt for models)\n"); + printf("-tx - start with tube x (see readme.txt for tubes)\n"); + printf("-disc disc.ssd - load disc.ssd into drives :0/:2\n"); + printf("-disc1 disc.ssd - load disc.ssd into drives :1/:3\n"); + printf("-autoboot - boot disc in drive :0\n"); + printf("-tape tape.uef - load tape.uef\n"); + printf("-fasttape - set tape speed to fast\n"); + printf("-s - scanlines display mode\n"); + printf("-i - interlace display mode\n"); + printf("-debug - start debugger\n"); + printf("-allegro - use Allegro for video rendering\n"); + exit(-1); + } + else +//#endif + if (!strcasecmp(argv[c], "-tape")) + { + tapenext = 2; + } + else if (!strcasecmp(argv[c], "-disc") || !strcasecmp(argv[c], "-disk")) + { + discnext = 1; + } + else if (!strcasecmp(argv[c], "-disc1")) + { + discnext = 2; + } + else if (argv[c][0] == '-' && (argv[c][1] == 'm' || argv[c][1] == 'M')) + { + sscanf(&argv[c][2], "%i", &curmodel); + } + else if (argv[c][0] == '-' && (argv[c][1] == 't' || argv[c][1] == 'T')) + { + sscanf(&argv[c][2], "%i", &curtube); + } + else if (!strcasecmp(argv[c], "-fasttape")) + { + fasttape = 1; + } + else if (!strcasecmp(argv[c], "-autoboot")) + { + autoboot = 150; + } + else if (argv[c][0] == '-' && (argv[c][1] == 'f' || argv[c][1]=='F')) + { + sscanf(&argv[c][2], "%i", &vid_fskipmax); + if (vid_fskipmax < 1) vid_fskipmax = 1; + if (vid_fskipmax > 9) vid_fskipmax = 9; + } + else if (argv[c][0] == '-' && (argv[c][1] == 's' || argv[c][1] == 'S')) + { + vid_scanlines = 1; + } + else if (!strcasecmp(argv[c], "-debug")) + { + debug = debugon = 1; + } + else if (argv[c][0] == '-' && (argv[c][1] == 'i' || argv[c][1] == 'I')) + { + vid_interlace = 1; + } + else if (tapenext) + strcpy(tape_fn, argv[c]); + else if (discnext) + { + strcpy(discfns[discnext-1], argv[c]); + discnext = 0; + } + else + { + strcpy(discfns[0], argv[c]); + discnext = 0; + autoboot = 150; + } + if (tapenext) tapenext--; + } + + video_init(); + mode7_makechars(); + +#ifndef WIN32 + install_keyboard(); +#endif + install_timer(); + + mem_init(); + ddnoise_init(); + tapenoise_init(); + + sound_init(); + al_init(); + sid_init(); + sid_settype(sidmethod, cursid); + + adc_init(); +#ifdef WIN32 + pal_init(); +#endif + disc_init(); + ssd_init(); + adf_init(); + fdi_init(); + + ide_init(); + + debug_start(); + + model_init(); + + main_reset(); + + + install_int_ex(secint, MSEC_TO_TIMER(1000)); + install_int_ex(int50, MSEC_TO_TIMER(20)); + + set_display_switch_mode(SWITCH_BACKGROUND); +#ifdef WIN32 + timeBeginPeriod(1); +#endif + oldmodel = curmodel; + + if (curtube == 3 || mouse_amx) install_mouse(); + +//printf("Disc 0 : %s\n",discfns[0]); +//printf("Disc 1 : %s\n",discfns[1]); +//printf("Tape : %s\n",tape_fn); + disc_load(0, discfns[0]); + disc_load(1, discfns[1]); + tape_load(tape_fn); + if (defaultwriteprot) writeprot[0] = writeprot[1] = 1; + + endblit(); +} + +void main_restart() +{ + startblit(); + if (curtube == 3 || mouse_amx) remove_mouse(); + cmos_save(models[oldmodel]); + oldmodel = curmodel; + + model_init(); + + main_reset(); + + resumeready(); + if (curtube == 3 || mouse_amx) install_mouse(); + endblit(); +} + +void main_setmouse() +{ + if (curtube != 3) + { + if (mouse_amx) install_mouse(); + else remove_mouse(); + } +} + +int resetting = 0; +int framesrun = 0; + +void main_cleardrawit() +{ + fcount = 0; +} + +void main_run() +{ + int c, d; + if ((fcount > 0 || key[KEY_PGUP] || (motor && fasttape))) + { + if (autoboot) autoboot--; + fcount--; + framesrun++; + if (key[KEY_PGUP] || (motor && fasttape)) fcount=0; + if (x65c02) m65c02_exec(); + else m6502_exec(); + ddnoiseframes++; + if (ddnoiseframes >= 5) + { + ddnoiseframes = 0; + ddnoise_mix(); + } + key_check(); + poll_joystick(); + for (c = 0; c < 2; c++) + { + joybutton[c] = 0; + for (d = 0; d < joy[c].num_buttons; d++) + { + if (joy[c].button[d].b) joybutton[c] = 1; + } + } + if (savestate_wantload) savestate_doload(); + if (savestate_wantsave) savestate_dosave(); + if (key[KEY_F10] && debugon) debug = 1; + if (key[KEY_F12] && !resetting) + { + m6502_reset(); + i8271_reset(); + wd1770_reset(); + sid_reset(); + + if (curtube != -1) tubes[curtube].reset(); + tube_reset(); + } + resetting = key[KEY_F12]; + } + else + { + framesrun = 0; + rest(1); + } + if (framesrun > 10) fcount = 0; +} + +void main_close() +{ +#ifdef WIN32 + timeEndPeriod(1); +#endif + + config_save(); + cmos_save(models[curmodel]); + + mem_close(); + uef_close(); + csw_close(); + tube_6502_close(); + arm_close(); + x86_close(); + z80_close(); + w65816_close(); + n32016_close(); + disc_close(0); + disc_close(1); + ide_close(); + ddnoise_close(); + tapenoise_close(); + + al_close(); + video_close(); +} + +void changetimerspeed(int i) +{ + remove_int(int50); + install_int_ex(int50, BPS_TO_TIMER(i)); +} diff --git a/src/main.h b/src/main.h index aa3c51b6..a85b4e14 100644 --- a/src/main.h +++ b/src/main.h @@ -1,9 +1,9 @@ -void main_init(int argc, char *argv[]); -void main_reset(); -void main_restart(); -void main_run(); -void main_close(); - -void main_cleardrawit(); -void main_setmouse(); - +void main_init(int argc, char *argv[]); +void main_reset(); +void main_restart(); +void main_run(); +void main_close(); + +void main_cleardrawit(); +void main_setmouse(); + diff --git a/src/mem.c b/src/mem.c index e047d356..26fbe3d5 100644 --- a/src/mem.c +++ b/src/mem.c @@ -1,297 +1,248 @@ -/*B-em v2.2 by Tom Walker - ROM handling*/ - -#include -#include -#include -#include -#include "b-em.h" -#include "6502.h" -#include "mem.h" - -uint8_t *ram, *rom, *os; -uint8_t ram_fe30, ram_fe34; -int romused[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -int swram[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - -void mem_init() -{ - rpclog("mem_init\n"); - ram = (uint8_t *)malloc(64 * 1024); - rom = (uint8_t *)malloc(16 * 16384); - os = (uint8_t *)malloc(16384); - memset(ram, 0, 64 * 1024); -} - -void mem_reset() -{ - memset(romused,0, sizeof(romused)); - memset(swram, 0, sizeof(swram)); - memset(ram, 0, 64 * 1024); - memset(rom, 0, 16 * 16384); - memset(os, 0, 16384); -} - -void mem_close() -{ - if (ram) free(ram); - if (rom) free(rom); - if (os) free(os); -} - -void mem_dump() -{ - FILE *f=fopen("ram.dmp","wb"); - fwrite(ram,64*1024,1,f); - fclose(f); - f=fopen("swram.dmp","wb"); - fwrite(&rom[4*16384],16384,1,f); - fwrite(&rom[5*16384],16384,1,f); - fwrite(&rom[6*16384],16384,1,f); - fwrite(&rom[7*16384],16384,1,f); - fclose(f); -} - -void mem_loadswroms() -{ - FILE *f; - int c = 15; - struct al_ffblk ffblk; -// memset(rom,0,16*16384); - - if (al_findfirst("*.rom", &ffblk, FA_ALL) != 0) return; - do - { - while (romused[c] && c >= 0) c--; - if (c >= 0) - { - rpclog("Loading %s to slot %i\n",ffblk.name,c); - f = fopen(ffblk.name, "rb"); - fread(rom + (c * 16384), 16384, 1, f); - fclose(f); - romused[c] = 1; - c--; - } - } while (c >= 0 && !al_findnext(&ffblk)); - al_findclose(&ffblk); - -#ifndef WIN32 - if (al_findfirst("*.ROM", &ffblk, FA_ALL) != 0) return; - do - { - while (romused[c] && c >= 0) c--; - if (c >= 0) - { -// printf("Loading %s to slot %i\n",ffblk.name,c); - f = fopen(ffblk.name, "rb"); - fread(rom + (c * 16384), 16384, 1, f); - fclose(f); - romused[c] = 1; - c--; - } - } while (c >= 0 && !al_findnext(&ffblk)); - al_findclose(&ffblk); -#endif -} - -void mem_fillswram() -{ - int c; - for (c = 0; c < 16; c++) - { - if (!romused[c]) swram[c] = 1; - } -} - -void mem_loadroms(char *os_name, char *romdir) -{ - char path[512], p2[512]; - FILE *f; - - if (os_name[0]) - { - rpclog("Reading OS file %s\n", os_name); - f = fopen(os_name, "rb"); - if (!f) - { - char err[80]; - sprintf(err, "Failed to load roms/%s\n", os_name); - bem_error(err); - exit(-1); - } - fread(os, 16384, 1, f); - fclose(f); - } - getcwd(p2, 511); - sprintf(path, "%sroms/%s", exedir, romdir); - chdir(path); - mem_loadswroms(); - chdir(p2); -} - -void mem_clearroms() -{ - int c; - memset(rom, 0, 16 * 16384); - for (c = 0; c < 16; c++) romused[c] = 0; - for (c = 0; c < 16; c++) swram[c] = 0; -} - -int mem_romsetup_os01() -{ - int c; - FILE *f; - struct al_ffblk ffblk; - - f=fopen("os01", "rb"); - if (!f) - { - bem_error("Failed to load roms/os01"); - return -1; - } - fread(os, 16384, 1, f); - fclose(f); - - chdir("a01"); - if (!al_findfirst("*.rom", &ffblk, FA_ALL)) - { - f=fopen(ffblk.name, "rb"); - if (f) - { - fread(rom, 16384, 1, f); - fclose(f); - } - al_findclose(&ffblk); - memcpy(rom + 16384, rom, 16384); - memcpy(rom + 32768, rom, 32768); - memcpy(rom + 65536, rom, 65536); - memcpy(rom + 131072, rom, 131072); - } - - chdir(".."); - for (c = 0; c < 16; c++) romused[c] = 1; - for (c = 0; c < 16; c++) swram[c] = 0; - return 0; -} - -int mem_romsetup_bplus128() -{ - swram[12] = swram[13] = 1; - swram[0] = swram[1] = 1; - romused[12] = romused[13] = 1; - romused[0] = romused[1] = 1; - return 0; -} - -int mem_romsetup_master128() -{ - FILE *f; -// printf("ROM setup Master 128\n"); - memset(rom, 0, 16 * 16384); - swram[0] = swram[1] = swram[2] = swram[3] = 0; - swram[4] = swram[5] = swram[6] = swram[7] = 1; - swram[8] = swram[9] = swram[10] = swram[11] = 0; - swram[12] = swram[13] = swram[14] = swram[15] = 0; - romused[0] = romused[1] = romused[2] = romused[3] = romused[8] = 0; - romused[4] = romused[5] = romused[6] = romused[7] = 1; - romused[9] = romused[10] = romused[11] = 1; - romused[12] = romused[13] = romused[14] = romused[15] = 1; - f=fopen("master/mos3.20", "rb"); - if (!f) - { - bem_error("Failed to load roms/master/mos.320"); - return -1; - } - fread(os, 16384, 1, f); - fread(rom + (9 * 16384), 7 * 16384, 1, f); - fclose(f); - return 0; -} - -int mem_romsetup_master128_35() -{ - FILE *f; -// printf("ROM setup Master 128\n"); - memset(rom, 0, 16 * 16384); - swram[0] = swram[1] = swram[2] = swram[3] = 0; - swram[4] = swram[5] = swram[6] = swram[7] = 1; - swram[8] = swram[9] = swram[10] = swram[11] = 0; - swram[12] = swram[13] = swram[14] = swram[15] = 0; - romused[0] = romused[1] = romused[2] = romused[3] = romused[8] = 0; - romused[4] = romused[5] = romused[6] = romused[7] = 1; - romused[9] = romused[10] = romused[11] = 1; - romused[12] = romused[13] = romused[14] = romused[15] = 1; - f=fopen("master/mos3.50", "rb"); - if (!f) - { - bem_error("Failed to load roms/master/mos.350"); - return -1; - } - fread(os, 16384, 1, f); - fread(rom + (9 * 16384), 7 * 16384, 1, f); - fclose(f); - return 0; -} - -int mem_romsetup_mastercompact() -{ - FILE *f; - swram[0] = swram[1] = swram[2] = swram[3] = 0; - swram[4] = swram[5] = swram[6] = swram[7] = 1; - swram[8] = swram[9] = swram[10] = swram[11] = 0; - swram[12] = swram[13] = swram[14] = swram[15] = 0; - romused[0] = romused[1] = romused[2] = romused[3] = 0; - romused[4] = romused[5] = romused[6] = romused[7] = 1; - romused[8] = romused[9] = romused[10] = romused[11] = 0; - romused[12] = romused[13] = romused[14] = romused[15] = 1; -// printf("Master compact init\n"); - f=fopen("compact/os51","rb"); - if (!f) - { - bem_error("Failed to load roms/compact/os51"); - return -1; - } - fread(os,16384,1,f); - fclose(f); - f=fopen("compact/basic48","rb"); - if (!f) - { - bem_error("Failed to load roms/compact/basic48"); - return -1; - } - fread(rom+(14*16384),16384,1,f); - fclose(f); - f=fopen("compact/adfs210","rb"); - if (!f) - { - bem_error("Failed to load roms/compact/adfs210"); - return -1; - } - fread(rom+(13*16384),16384,1,f); - fclose(f); - f=fopen("compact/utils","rb"); - if (!f) - { - bem_error("Failed to load roms/compact/utils"); - return -1; - } - fread(rom+(15*16384),16384,1,f); - fclose(f); - return 0; -} - -void mem_savestate(FILE *f) -{ - putc(ram_fe30, f); - putc(ram_fe34, f); - fwrite(ram, 64 * 1024, 1, f); - fwrite(rom, 256 * 1024, 1, f); -} - -void mem_loadstate(FILE *f) -{ - writemem(0xFE30, getc(f)); - writemem(0xFE34, getc(f)); - fread(ram, 64 * 1024, 1, f); - fread(rom, 256 * 1024, 1, f); -} +/*B-em v2.2 by Tom Walker + ROM handling*/ + +#include +#include +#include +#include +#include "b-em.h" +#include "6502.h" +#include "mem.h" + +uint8_t *ram, *rom, *os; +uint8_t ram_fe30, ram_fe34; +int romused[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +int swram[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +void mem_init() +{ + rpclog("mem_init\n"); + ram = (uint8_t *)malloc(64 * 1024); + rom = (uint8_t *)malloc(16 * 16384); + os = (uint8_t *)malloc(16384); + memset(ram, 0, 64 * 1024); +} + +void mem_reset() +{ + memset(romused,0, sizeof(romused)); + memset(swram, 0, sizeof(swram)); + memset(ram, 0, 64 * 1024); + memset(rom, 0, 16 * 16384); + memset(os, 0, 16384); +} + +void mem_close() +{ + if (ram) free(ram); + if (rom) free(rom); + if (os) free(os); +} + +void mem_dump() +{ + FILE *f=fopen("ram.dmp","wb"); + fwrite(ram,64*1024,1,f); + fclose(f); + f=fopen("swram.dmp","wb"); + fwrite(&rom[4*16384],16384,1,f); + fwrite(&rom[5*16384],16384,1,f); + fwrite(&rom[6*16384],16384,1,f); + fwrite(&rom[7*16384],16384,1,f); + fclose(f); +} + +void mem_loadswroms() +{ + FILE *f; + int c = 15; + struct al_ffblk ffblk; +// memset(rom,0,16*16384); + + if (al_findfirst("*.rom", &ffblk, FA_ALL) != 0) return; + do + { + while (romused[c] && c >= 0) c--; + if (c >= 0) + { + rpclog("Loading %s to slot %i\n",ffblk.name,c); + f = fopen(ffblk.name, "rb"); + fread(rom + (c * 16384), 16384, 1, f); + fclose(f); + romused[c] = 1; + c--; + } + } while (c >= 0 && !al_findnext(&ffblk)); + al_findclose(&ffblk); + +#ifndef WIN32 + if (al_findfirst("*.ROM", &ffblk, FA_ALL) != 0) return; + do + { + while (romused[c] && c >= 0) c--; + if (c >= 0) + { +// printf("Loading %s to slot %i\n",ffblk.name,c); + f = fopen(ffblk.name, "rb"); + fread(rom + (c * 16384), 16384, 1, f); + fclose(f); + romused[c] = 1; + c--; + } + } while (c >= 0 && !al_findnext(&ffblk)); + al_findclose(&ffblk); +#endif +} + +void mem_fillswram() +{ + int c; + for (c = 0; c < 16; c++) + { + if (!romused[c]) swram[c] = 1; + } +} + +void mem_loadroms(char *os_name, char *romdir) +{ + char path[512], p2[512]; + FILE *f; + + if (os_name[0]) + { + rpclog("Reading OS file %s\n", os_name); + f = fopen(os_name, "rb"); + if (!f) rpclog("Failed!\n"); + fread(os, 16384, 1, f); + fclose(f); + } + getcwd(p2, 511); + sprintf(path, "%sroms/%s", exedir, romdir); + chdir(path); + mem_loadswroms(); + chdir(p2); +} + +void mem_clearroms() +{ + int c; + memset(rom, 0, 16 * 16384); + for (c = 0; c < 16; c++) romused[c] = 0; + for (c = 0; c < 16; c++) swram[c] = 0; +} + +void mem_romsetup_os01() +{ + int c; + FILE *f; + struct al_ffblk ffblk; + + f=fopen("os01", "rb"); + fread(os, 16384, 1, f); + fclose(f); + + chdir("a01"); + if (!al_findfirst("*.rom", &ffblk, FA_ALL)) + { + f=fopen(ffblk.name, "rb"); + fread(rom, 16384, 1, f); + fclose(f); + al_findclose(&ffblk); + memcpy(rom + 16384, rom, 16384); + memcpy(rom + 32768, rom, 32768); + memcpy(rom + 65536, rom, 65536); + memcpy(rom + 131072, rom, 131072); + } + + chdir(".."); + for (c = 0; c < 16; c++) romused[c] = 1; + for (c = 0; c < 16; c++) swram[c] = 0; +} + +void mem_romsetup_bplus128() +{ + swram[12] = swram[13] = 1; + swram[0] = swram[1] = 1; + romused[12] = romused[13] = 1; + romused[0] = romused[1] = 1; +} + +void mem_romsetup_master128() +{ + FILE *f; +// printf("ROM setup Master 128\n"); + memset(rom, 0, 16 * 16384); + swram[0] = swram[1] = swram[2] = swram[3] = 0; + swram[4] = swram[5] = swram[6] = swram[7] = 1; + swram[8] = swram[9] = swram[10] = swram[11] = 0; + swram[12] = swram[13] = swram[14] = swram[15] = 0; + romused[0] = romused[1] = romused[2] = romused[3] = romused[8] = 0; + romused[4] = romused[5] = romused[6] = romused[7] = 1; + romused[9] = romused[10] = romused[11] = 1; + romused[12] = romused[13] = romused[14] = romused[15] = 1; + f=fopen("master/mos3.20", "rb"); + fread(os, 16384, 1, f); + fread(rom + (9 * 16384), 7 * 16384, 1, f); + fclose(f); +} + +void mem_romsetup_master128_35() +{ + FILE *f; +// printf("ROM setup Master 128\n"); + memset(rom, 0, 16 * 16384); + swram[0] = swram[1] = swram[2] = swram[3] = 0; + swram[4] = swram[5] = swram[6] = swram[7] = 1; + swram[8] = swram[9] = swram[10] = swram[11] = 0; + swram[12] = swram[13] = swram[14] = swram[15] = 0; + romused[0] = romused[1] = romused[2] = romused[3] = romused[8] = 0; + romused[4] = romused[5] = romused[6] = romused[7] = 1; + romused[9] = romused[10] = romused[11] = 1; + romused[12] = romused[13] = romused[14] = romused[15] = 1; + f=fopen("master/mos3.50", "rb"); + fread(os, 16384, 1, f); + fread(rom + (9 * 16384), 7 * 16384, 1, f); + fclose(f); +} + +void mem_romsetup_mastercompact() +{ + FILE *f; + swram[0] = swram[1] = swram[2] = swram[3] = 0; + swram[4] = swram[5] = swram[6] = swram[7] = 1; + swram[8] = swram[9] = swram[10] = swram[11] = 0; + swram[12] = swram[13] = swram[14] = swram[15] = 0; + romused[0] = romused[1] = romused[2] = romused[3] = 0; + romused[4] = romused[5] = romused[6] = romused[7] = 1; + romused[8] = romused[9] = romused[10] = romused[11] = 0; + romused[12] = romused[13] = romused[14] = romused[15] = 1; +// printf("Master compact init\n"); + f=fopen("compact/os51","rb"); + fread(os,16384,1,f); + fclose(f); + f=fopen("compact/basic48","rb"); + fread(rom+(14*16384),16384,1,f); + fclose(f); + f=fopen("compact/adfs210","rb"); + fread(rom+(13*16384),16384,1,f); + fclose(f); + f=fopen("compact/utils","rb"); + fread(rom+(15*16384),16384,1,f); + fclose(f); +} + +void mem_savestate(FILE *f) +{ + putc(ram_fe30, f); + putc(ram_fe34, f); + fwrite(ram, 64 * 1024, 1, f); + fwrite(rom, 256 * 1024, 1, f); +} + +void mem_loadstate(FILE *f) +{ + writemem(0xFE30, getc(f)); + writemem(0xFE34, getc(f)); + fread(ram, 64 * 1024, 1, f); + fread(rom, 256 * 1024, 1, f); +} diff --git a/src/mem.h b/src/mem.h index 87a3a9aa..469dc2b0 100644 --- a/src/mem.h +++ b/src/mem.h @@ -1,22 +1,22 @@ -int mem_romsetup_os01(); -int mem_romsetup_bplus128(); -int mem_romsetup_master128(); -int mem_romsetup_master128_35(); -int mem_romsetup_mastercompact(); -void mem_fillswram(); -void mem_clearroms(); - -void mem_init(); -void mem_reset(); -void mem_close(); -void mem_loadroms(char *os, char *romdir); - -void mem_savestate(FILE *f); -void mem_loadstate(FILE *f); - -void mem_dump(); - -extern uint8_t ram_fe30, ram_fe34; -extern uint8_t *ram, *rom, *os; -extern int swram[16]; - +void mem_romsetup_os01(); +void mem_romsetup_bplus128(); +void mem_romsetup_master128(); +void mem_romsetup_master128_35(); +void mem_romsetup_mastercompact(); +void mem_fillswram(); +void mem_clearroms(); + +void mem_init(); +void mem_reset(); +void mem_close(); +void mem_loadroms(char *os, char *romdir); + +void mem_savestate(FILE *f); +void mem_loadstate(FILE *f); + +void mem_dump(); + +extern uint8_t ram_fe30, ram_fe34; +extern uint8_t *ram, *rom, *os; +extern int swram[16]; + diff --git a/src/model.c b/src/model.c index 5cc8998b..4b07883c 100644 --- a/src/model.c +++ b/src/model.c @@ -1,93 +1,89 @@ -#include -#include "b-em.h" - -#include "model.h" -#include "cmos.h" -#include "mem.h" -#include "tube.h" -#include "32016.h" -#include "6502tube.h" -#include "65816.h" -#include "arm.h" -#include "x86_tube.h" -#include "z80.h" - -int I8271, WD1770, BPLUS, x65c02, MASTER, MODELA, OS01, compactcmos; -int curtube; -int oldmodel; - -MODEL models[17] = -{ -/* Name 8271 1770 65c02 B+ Master SWRAM A OS 0.1 Compact OS ROM dir CMOS ROM setup function Second processor*/ - {"BBC A w/OS 0.1", 1, 0, 0, 0, 0, 0, 1, 1, 0, "", "a01", "", mem_romsetup_os01, -1}, - {"BBC B w/OS 0.1", 1, 0, 0, 0, 0, 0, 0, 1, 0, "", "a01", "", mem_romsetup_os01, -1}, - {"BBC A", 1, 0, 0, 0, 0, 0, 1, 0, 0, "os", "a", "", NULL, -1}, - {"BBC B w/8271 FDC", 1, 0, 0, 0, 0, 0, 0, 0, 0, "os", "b", "", NULL, -1}, - {"BBC B w/8271+SWRAM", 1, 0, 0, 0, 0, 1, 0, 0, 0, "os", "b", "", NULL, -1}, - {"BBC B w/1770 FDC", 0, 1, 0, 0, 0, 1, 0, 0, 0, "os", "b1770", "", NULL, -1}, - {"BBC B US", 1, 0, 0, 0, 0, 0, 0, 0, 0, "usmos","us", "", NULL, -1}, - {"BBC B German", 1, 0, 0, 0, 0, 0, 0, 0, 0, "deos", "us", "", NULL, -1}, - {"BBC B+ 64K", 0, 1, 0, 1, 0, 0, 0, 0, 0, "bpos", "bp", "", NULL, -1}, - {"BBC B+ 128K", 0, 1, 0, 1, 0, 0, 0, 0, 0, "bpos", "bp", "", mem_romsetup_bplus128, -1}, - {"BBC Master 128", 0, 1, 1, 0, 1, 0, 0, 0, 0, "", "master", "cmos.bin", mem_romsetup_master128, -1}, - {"BBC Master 512", 0, 1, 1, 0, 1, 0, 0, 0, 0, "", "master", "cmos.bin", mem_romsetup_master128, 3}, - {"BBC Master Turbo", 0, 1, 1, 0, 1, 0, 0, 0, 0, "", "master", "cmos.bin", mem_romsetup_master128, 0}, - {"BBC Master Compact", 0, 1, 1, 0, 1, 0, 0, 0, 1, "", "compact","cmosc.bin", mem_romsetup_mastercompact,-1}, - {"ARM Evaluation System", 0, 1, 1, 0, 1, 0, 0, 0, 0, "", "master", "cmosa.bin", mem_romsetup_master128, 1}, - {"BBC Master 128 w/MOS 3.5", 0, 1, 1, 0, 1, 0, 0, 0, 0, "", "master", "cmos350.bin", mem_romsetup_master128_35, -1}, - {"",0,0,0,0,0,0,0,0,0,"","","",0,0} -}; - -static int _modelcount = 0; -char *model_get() -{ - return models[_modelcount++].name; -} - -TUBE tubes[7]= -{ - {"6502", tube_6502_init, tube_6502_reset}, - {"ARM", tube_arm_init, arm_reset}, - {"Z80", tube_z80_init, z80_reset}, - {"80186",tube_x86_init, x86_reset}, - {"65816",tube_65816_init, w65816_reset}, - {"32016",tube_32016_init, n32016_reset}, - {"",0,0} -}; - -void model_init() -{ - char t[512],t2[512]; - rpclog("Starting emulation as %s\n",models[curmodel].name); - I8271 = models[curmodel].I8271; - WD1770 = models[curmodel].WD1770; - BPLUS = models[curmodel].bplus; - x65c02 = models[curmodel].x65c02; - MASTER = models[curmodel].master; - MODELA = models[curmodel].modela; - OS01 = models[curmodel].os01; - compactcmos = models[curmodel].compact; - - curtube = selecttube; - if (models[curmodel].tube != -1) curtube = models[curmodel].tube; - - - getcwd(t, 511); - append_filename(t2, exedir, "roms", 511); - chdir(t2); - mem_clearroms(); - if (models[curmodel].romsetup) - { - if (models[curmodel].romsetup()) - exit(-1); - } - - mem_loadroms(models[curmodel].os, models[curmodel].romdir); -// if (ideenable) loadiderom(); - if (curtube!=-1) tubes[curtube].init(); - tube_reset(); - chdir(t); - - cmos_load(models[curmodel]); - if (models[curmodel].swram) mem_fillswram(); -} +#include +#include "b-em.h" + +#include "model.h" +#include "cmos.h" +#include "mem.h" +#include "tube.h" +#include "32016.h" +#include "6502tube.h" +#include "65816.h" +#include "arm.h" +#include "x86_tube.h" +#include "z80.h" + +int I8271, WD1770, BPLUS, x65c02, MASTER, MODELA, OS01, compactcmos; +int curtube; +int oldmodel; + +MODEL models[17] = +{ +/* Name 8271 1770 65c02 B+ Master SWRAM A OS 0.1 Compact OS ROM dir CMOS ROM setup function Second processor*/ + {"BBC A w/OS 0.1", 1, 0, 0, 0, 0, 0, 1, 1, 0, "", "a01", "", mem_romsetup_os01, -1}, + {"BBC B w/OS 0.1", 1, 0, 0, 0, 0, 0, 0, 1, 0, "", "a01", "", mem_romsetup_os01, -1}, + {"BBC A", 1, 0, 0, 0, 0, 0, 1, 0, 0, "os", "a", "", NULL, -1}, + {"BBC B w/8271 FDC", 1, 0, 0, 0, 0, 0, 0, 0, 0, "os", "b", "", NULL, -1}, + {"BBC B w/8271+SWRAM", 1, 0, 0, 0, 0, 1, 0, 0, 0, "os", "b", "", NULL, -1}, + {"BBC B w/1770 FDC", 0, 1, 0, 0, 0, 1, 0, 0, 0, "os", "b1770", "", NULL, -1}, + {"BBC B US", 1, 0, 0, 0, 0, 0, 0, 0, 0, "usmos","us", "", NULL, -1}, + {"BBC B German", 1, 0, 0, 0, 0, 0, 0, 0, 0, "deos", "us", "", NULL, -1}, + {"BBC B+ 64K", 0, 1, 0, 1, 0, 0, 0, 0, 0, "bpos", "bp", "", NULL, -1}, + {"BBC B+ 128K", 0, 1, 0, 1, 0, 0, 0, 0, 0, "bpos", "bp", "", mem_romsetup_bplus128, -1}, + {"BBC Master 128", 0, 1, 1, 0, 1, 0, 0, 0, 0, "", "master", "cmos.bin", mem_romsetup_master128, -1}, + {"BBC Master 512", 0, 1, 1, 0, 1, 0, 0, 0, 0, "", "master", "cmos.bin", mem_romsetup_master128, 3}, + {"BBC Master Turbo", 0, 1, 1, 0, 1, 0, 0, 0, 0, "", "master", "cmos.bin", mem_romsetup_master128, 0}, + {"BBC Master Compact", 0, 1, 1, 0, 1, 0, 0, 0, 1, "", "compact","cmosc.bin", mem_romsetup_mastercompact,-1}, + {"ARM Evaluation System", 0, 1, 1, 0, 1, 0, 0, 0, 0, "", "master", "cmosa.bin", mem_romsetup_master128, 1}, + {"BBC Master 128 w/MOS 3.5", 0, 1, 1, 0, 1, 0, 0, 0, 0, "", "master", "cmos350.bin", mem_romsetup_master128_35, -1}, + {"",0,0,0,0,0,0,0,0,0,"","","",0,0} +}; + +static int _modelcount = 0; +char *model_get() +{ + return models[_modelcount++].name; +} + +TUBE tubes[7]= +{ + {"6502", tube_6502_init, tube_6502_reset}, + {"ARM", tube_arm_init, arm_reset}, + {"Z80", tube_z80_init, z80_reset}, + {"80186",tube_x86_init, x86_reset}, + {"65816",tube_65816_init, w65816_reset}, + {"32016",tube_32016_init, n32016_reset}, + {"",0,0} +}; + +void model_init() +{ + char t[512],t2[512]; + rpclog("Starting emulation as %s\n",models[curmodel].name); + I8271 = models[curmodel].I8271; + WD1770 = models[curmodel].WD1770; + BPLUS = models[curmodel].bplus; + x65c02 = models[curmodel].x65c02; + MASTER = models[curmodel].master; + MODELA = models[curmodel].modela; + OS01 = models[curmodel].os01; + compactcmos = models[curmodel].compact; + + curtube = selecttube; + if (models[curmodel].tube != -1) curtube = models[curmodel].tube; + + + getcwd(t, 511); + append_filename(t2, exedir, "roms", 511); + chdir(t2); + mem_clearroms(); + if (models[curmodel].romsetup) models[curmodel].romsetup(); + + mem_loadroms(models[curmodel].os, models[curmodel].romdir); +// if (ideenable) loadiderom(); + if (curtube!=-1) tubes[curtube].init(); + tube_reset(); + chdir(t); + + cmos_load(models[curmodel]); + if (models[curmodel].swram) mem_fillswram(); +} diff --git a/src/model.h b/src/model.h index 0b7fc307..304049a1 100644 --- a/src/model.h +++ b/src/model.h @@ -1,34 +1,34 @@ -void model_init(); -char *model_get(); - -typedef struct -{ - char name[32]; - int I8271,WD1770; - int x65c02; - int bplus; - int master; - int swram; - int modela; - int os01; - int compact; - char os[32]; - char romdir[32]; - char cmos[32]; - int (*romsetup)(); - int tube; -} MODEL; - -extern MODEL models[17]; - -typedef struct -{ - char name[32]; - void (*init)(); - void (*reset)(); -} TUBE; - -extern TUBE tubes[7]; - -extern int curmodel, curtube, oldmodel, selecttube; -extern int I8271, WD1770, BPLUS, x65c02, MASTER, MODELA, OS01, compactcmos; +void model_init(); +char *model_get(); + +typedef struct +{ + char name[32]; + int I8271,WD1770; + int x65c02; + int bplus; + int master; + int swram; + int modela; + int os01; + int compact; + char os[32]; + char romdir[32]; + char cmos[32]; + void (*romsetup)(); + int tube; +} MODEL; + +extern MODEL models[17]; + +typedef struct +{ + char name[32]; + void (*init)(); + void (*reset)(); +} TUBE; + +extern TUBE tubes[7]; + +extern int curmodel, curtube, oldmodel, selecttube; +extern int I8271, WD1770, BPLUS, x65c02, MASTER, MODELA, OS01, compactcmos; diff --git a/src/mouse.c b/src/mouse.c index c11edfa8..4301ec50 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -1,136 +1,136 @@ -#include -#include "b-em.h" - -#include "mouse.h" -#include "mem.h" -#include "model.h" -#include "via.h" -#include "uservia.h" - -int mcount = 8; -uint8_t mouse_portb = 0; -int mouse_amx; - -static int mx = 0, my = 0; - -static int mouse_ff = 0; - -static int mouse_xff = 0, mouse_yff = 0; - -#ifndef WIN32 -static int mouse_ox = 0, mouse_oy = 0; -#endif - -void mouse_poll() -{ - int dx, dy; - - poll_mouse(); - - if (curtube == 3) - { - if (uservia.ifr & 0x18) return; -#ifdef WIN32 - get_mouse_mickeys(&dx,&dy); -#else - dx = (mouse_x - mouse_ox); - dy = (mouse_y - mouse_oy); - mouse_ox = mouse_x; - mouse_oy = mouse_y; -#endif - mx += dx; - my += dy; - - if (mx) - { - if (mx > 0) mouse_portb |= 8; - else mouse_portb &= ~8; - - if (mouse_xff) mouse_portb ^= 8; - - if (mx > 0) mx--; - else mx++; - - uservia_set_cb1(mouse_xff); - mouse_xff = !mouse_xff; - } - - if (mouse_y != my) - { - if (my > 0) mouse_portb &= ~0x10; - else mouse_portb |= 0x10; - - if (mouse_yff) mouse_portb ^= 0x10; - - if (my > 0) my--; - else my++; - - uservia_set_cb2(mouse_yff); - mouse_yff = !mouse_yff; - } - - if (mouse_b & 1) mouse_portb &= ~1; - else mouse_portb |= 1; - if (mouse_b & 2) mouse_portb &= ~4; - else mouse_portb |= 4; - mouse_portb |= 2; - } - else if (mouse_amx) - { - mouse_ff = !mouse_ff; - if (mouse_ff) - { - uservia_set_cb1(0); - uservia_set_cb2(0); - return; - } - -#ifdef WIN32 - get_mouse_mickeys(&dx,&dy); -#else - dx = (mouse_x - mouse_ox); - dy = (mouse_y - mouse_oy); - mouse_ox = mouse_x; - mouse_oy = mouse_y; -// printf("%i,%i - %i, %i\n",mouse_x,mouse_y,dx,dy); -#endif - - mx += dx; - my += dy; - - /*AMX mouse*/ - if (mx) - { - uservia_set_cb1(1); - if (mx > 0) mouse_portb |= 1; - else mouse_portb &= ~1; - - if (mx > 0) mx--; - else mx++; - } - else - uservia_set_cb1(0); - - if (my) - { - uservia_set_cb2(1); - if (my < 0) mouse_portb |= 4; - else mouse_portb &= ~4; - - if (my > 0) my--; - else my++; - } - else - uservia_set_cb2(0); - - - if (mouse_b & 1) mouse_portb &= ~0x20; - else mouse_portb |= 0x20; - if (mouse_b & 2) mouse_portb &= ~0x80; - else mouse_portb |= 0x80; - if (mouse_b & 4) mouse_portb &= ~0x40; - else mouse_portb |= 0x40; - } - if (mousecapture) position_mouse(64, 64); -} - +#include +#include "b-em.h" + +#include "mouse.h" +#include "mem.h" +#include "model.h" +#include "via.h" +#include "uservia.h" + +int mcount = 8; +uint8_t mouse_portb = 0; +int mouse_amx; + +static int mx = 0, my = 0; + +static int mouse_ff = 0; + +static int mouse_xff = 0, mouse_yff = 0; + +#ifndef WIN32 +static int mouse_ox = 0, mouse_oy = 0; +#endif + +void mouse_poll() +{ + int dx, dy; + + poll_mouse(); + + if (curtube == 3) + { + if (uservia.ifr & 0x18) return; +#ifdef WIN32 + get_mouse_mickeys(&dx,&dy); +#else + dx = (mouse_x - mouse_ox); + dy = (mouse_y - mouse_oy); + mouse_ox = mouse_x; + mouse_oy = mouse_y; +#endif + mx += dx; + my += dy; + + if (mx) + { + if (mx > 0) mouse_portb |= 8; + else mouse_portb &= ~8; + + if (mouse_xff) mouse_portb ^= 8; + + if (mx > 0) mx--; + else mx++; + + uservia_set_cb1(mouse_xff); + mouse_xff = !mouse_xff; + } + + if (mouse_y != my) + { + if (my > 0) mouse_portb &= ~0x10; + else mouse_portb |= 0x10; + + if (mouse_yff) mouse_portb ^= 0x10; + + if (my > 0) my--; + else my++; + + uservia_set_cb2(mouse_yff); + mouse_yff = !mouse_yff; + } + + if (mouse_b & 1) mouse_portb &= ~1; + else mouse_portb |= 1; + if (mouse_b & 2) mouse_portb &= ~4; + else mouse_portb |= 4; + mouse_portb |= 2; + } + else if (mouse_amx) + { + mouse_ff = !mouse_ff; + if (mouse_ff) + { + uservia_set_cb1(0); + uservia_set_cb2(0); + return; + } + +#ifdef WIN32 + get_mouse_mickeys(&dx,&dy); +#else + dx = (mouse_x - mouse_ox); + dy = (mouse_y - mouse_oy); + mouse_ox = mouse_x; + mouse_oy = mouse_y; + printf("%i,%i - %i, %i\n",mouse_x,mouse_y,dx,dy); +#endif + + mx += dx; + my += dy; + + /*AMX mouse*/ + if (mx) + { + uservia_set_cb1(1); + if (mx > 0) mouse_portb |= 1; + else mouse_portb &= ~1; + + if (mx > 0) mx--; + else mx++; + } + else + uservia_set_cb1(0); + + if (my) + { + uservia_set_cb2(1); + if (my < 0) mouse_portb |= 4; + else mouse_portb &= ~4; + + if (my > 0) my--; + else my++; + } + else + uservia_set_cb2(0); + + + if (mouse_b & 1) mouse_portb &= ~0x20; + else mouse_portb |= 0x20; + if (mouse_b & 2) mouse_portb &= ~0x80; + else mouse_portb |= 0x80; + if (mouse_b & 4) mouse_portb &= ~0x40; + else mouse_portb |= 0x40; + } + if (mousecapture) position_mouse(64, 64); +} + diff --git a/src/mouse.h b/src/mouse.h index d1b4816c..429364e7 100644 --- a/src/mouse.h +++ b/src/mouse.h @@ -1,5 +1,5 @@ -void mouse_poll(); - -extern int mcount; -extern uint8_t mouse_portb; -extern int mouse_amx; +void mouse_poll(); + +extern int mcount; +extern uint8_t mouse_portb; +extern int mouse_amx; diff --git a/src/pal.c b/src/pal.c index 5a35f8bb..6106a6d2 100644 --- a/src/pal.c +++ b/src/pal.c @@ -1,342 +1,342 @@ -#include -#include -#include "b-em.h" - -#include "pal.h" -#include "video.h" -#include "video_render.h" - -#define NCoef 1 -fixed vision_iir(fixed NewSample) { - static fixed x; //input samples - - x = (x + NewSample) >> 1; -// x = NewSample; - - return x; -} - - -#undef NCoef -#define NCoef 2 -static inline fixed chroma_iir(fixed NewSample) { - static fixed y[NCoef+1]; //output samples - static fixed x[NCoef+1]; //input samples - - x[2] = x[1]; - x[1] = x[0]; - x[0] = NewSample; - y[2] = y[1]; - y[1] = y[0]; - - - //Calculate the new output - y[0] = fmul(49429, x[0]); - y[0] -= fmul(12112, y[1]); - y[0] -= fmul(49429, x[2]); - y[0] -= fmul(21779, y[2]); - - return y[0]; -} - - -//3.609 -#define WT_INC ((4433618.75 / 16000000.0) * (2 * 3.14)) - -fixed sint[1024], cost[1024]; -fixed sint2[1024], cost2[1024]; -fixed cols[256][4]; - -fixed colx[256][16]; - -void pal_init() -{ - int c; - float wt = 0.0; - int r, g, b; - for (c = 0; c < 1024; c++) - { - sint[c] = ftofix(sin(wt)); - cost[c] = ftofix(cos(wt)); - sint2[c] = fmul(40000, fmul(16622, sint[c])); - cost2[c] = fmul(40000, fmul(9339, cost[c])); - wt += (2.0 * 3.14) / 1024.0; - } - for (c = 0; c < 256; c++) - { - r = (c & 1) ? 255 : 0; - g = (c & 2) ? 255 : 0; - b = (c & 4) ? 255 : 0; - - cols[c][0] = ftofix( 0.299 * r + 0.587 * g + 0.114 * b); - cols[c][1] = ftofix(-0.147 * r - 0.289 * g + 0.436 * b); - cols[c][2] = ftofix( 0.615 * r - 0.515 * g - 0.100 * b); - - colx[c][0] = fmul( 19595, c << 16); - colx[c][1] = fmul( 38470, c << 16); - colx[c][2] = fmul( 7471, c << 16); - colx[c][4] = fmul( -9634, c << 16); - colx[c][5] = fmul(-18940, c << 16); - colx[c][6] = fmul( 28574, c << 16); - colx[c][8] = fmul( 40305, c << 16); - colx[c][9] = fmul(-33751, c << 16); - colx[c][10] = fmul( -6553, c << 16); - } -} - -void pal_convert(BITMAP *inb, int x1, int y1, int x2, int y2, int yoff) -{ - int x, y; - int r, g, b; - int pixel; - fixed Y, U, V; - fixed signal; - static int wt; - int old_wt; - int col; - - fixed u_old[2][1536], v_old[2][1536]; - fixed u_filt[4], v_filt[4]; - fixed *uo[2], *vo[2]; - - fixed sr[1536], sg[1536], sb[1536]; - - int dx1 = (x1 * 922) / 832; - int dx2 = (x2 * 922) / 832; - - int sx; - int dx = 59139; - - int c = (crtc[0] + 1) * ((ula_ctrl & 0x10) ? 8 : 16); - - c = ((c * 256) * 922) / 832; - - if (x1 > 1535) x1 = 1535; - if (x2 > 1536) x2 = 1536; - if (y1 > 799) y1 = 799; - if (y2 > 800) y2 = 800; - - for (x = x1; x < x2; x++) - u_old[0][x] = u_old[1][x] = v_old[0][x] = v_old[1][x] = 0; - for (x = 0; x < 4; x++) - u_filt[x] = v_filt[x] = 0; - -// rpclog("PAL %i-%i %i-%i\n",x1,x2,dx1,dx2); - - - for (y = y1; y < y2; y += yoff) - { - uo[0] = u_old[y&1]; - vo[0] = v_old[y&1]; - uo[1] = u_old[(y&1)^1]; - vo[1] = v_old[(y&1)^1]; - - sx = x1 << 16; - for (x = dx1; x < dx2; x++) - { - pixel = inb->line[y][sx >> 16]; - col = (0x10000 - (sx & 0xFFFF)) >> 8; - sr[x] = pal[pixel].r * col; - sg[x] = pal[pixel].g * col; - sb[x] = pal[pixel].b * col; - - pixel = inb->line[y][(sx >> 16) + 1]; - col = (sx & 0xFFFF) >> 8; - sr[x] += pal[pixel].r * col; - sg[x] += pal[pixel].g * col; - sb[x] += pal[pixel].b * col; - - sx += dx; - } - - old_wt = wt; - - for (x = dx1; x < dx2; x++) - { - r = sr[x] >> 6; - g = sg[x] >> 6; - b = sb[x] >> 6; - - Y = colx[r][0] + colx[g][1] + colx[b][2]; - U = colx[r][4] + colx[g][5] + colx[b][6]; - V = colx[r][8] + colx[g][9] + colx[b][10]; - - signal = (Y << 1) + chroma_iir(fmul(U, sint[wt]) + fmul(V, cost[wt])); - - u_filt[x & 3] = fmul(signal, sint2[wt]); - v_filt[x & 3] = fmul(signal, cost2[wt]); - U = u_filt[0] + u_filt[1] + u_filt[2] + u_filt[3]; - V = v_filt[0] + v_filt[1] + v_filt[2] + v_filt[3]; - uo[0][x] = U; - vo[0][x] = V; - U += uo[1][x]; - V += vo[1][x]; - - wt += 256; - wt &= 1023; - -/* r = fixtoi(Y + fmul(9339, V)); - g = fixtoi(Y - fmul(3244,U) - fmul(4760, V)); - b = fixtoi(Y + fmul(16622,U));*/ - r = fixtoi(Y + V); - g = fixtoi(Y - fmul(12790, U) - fmul(33403, V)); - b = fixtoi(Y + U); - - if (r > 255) r = 255; - if (r < 0) r = 0; - if (g > 255) g = 255; - if (g < 0) g = 0; - if (b > 255) b = 255; - if (b < 0) b = 0; - - ((uint32_t *)b32->line[y])[x] = b | (g << 8) | (r << 16); - } - - wt = old_wt - c; -// wt += 769; -// wt += (c - (256 * (dx2 - dx1))); - wt &= 1023; - } - - /*cheat*/ - wt -= (c * (312 - ((y2 - y1) / yoff))); - if (crtc[8] & 1) wt -= (c >> 1); - wt &= 1023; -} - - -/*Floating point version. This would be faster than the above, if B-em didn't crash with -O3 -msse*/ - -#if 0 -#include -#include "b-em.h" -#include "video.h" - -#define NCoef 1 -float vision_iir(float NewSample) { - static float x; //input samples - float y; - - x = (x + NewSample) * 0.5; -// x = NewSample; - - return x; -} - - -#undef NCoef -#define NCoef 2 -static inline float chroma_iir(float NewSample) { - static float y[NCoef+1]; //output samples - static float x[NCoef+1]; //input samples - - x[2] = x[1]; - x[1] = x[0]; - x[0] = NewSample; - y[2] = y[1]; - y[1] = y[0]; - - - //Calculate the new output - y[0] = 0.754226 * x[0]; - y[0] -= 0.184815 * y[1]; - y[0] -= 0.754226 * x[2]; - y[0] -= 0.332316 * y[2]; - - return y[0]; -} - - - -#define WT_INC ((4433618.75 / 16000000.0) * (2 * 3.14)) - -float sint[832*2], cost[832*2]; -float cols[256][4]; -void pal_init() -{ - int c; - float wt = 0.0; - int r, g, b; - for (c = 0; c < 832*2; c++) - { - sint[c] = sin(wt); - cost[c] = cos(wt); - wt += WT_INC; - } - for (c = 0; c < 256; c++) - { - r = pal[c].r << 2; - g = pal[c].g << 2; - b = pal[c].b << 2; - - cols[c][0] = 0.299 * r + 0.587 * g + 0.114 * b; - cols[c][1] = -0.147 * r - 0.289 * g + 0.436 * b; - cols[c][2] = 0.615 * r - 0.515 * g - 0.100 * b; - } -} - -void pal_convert(BITMAP *inb, int x1, int y1, int x2, int y2) -{ - int x, y; - int r, g, b; - int pixel; - int c; - float Y, U, V; - float signal; - static int wt; - float u_old[2][1536], v_old[2][1536]; - float u_filt[4], v_filt[4]; - float *uo[2], *vo[2]; - - for (x = x1; x < x2; x++) - u_old[0][x] = u_old[1][x] = v_old[0][x] = v_old[1][x] = 0.0; - for (x = 0; x < 4; x++) - u_filt[x] = v_filt[x] = 0.0; - - for (y = y1; y < y2; y++) - { - uo[0] = u_old[y&1]; - vo[0] = v_old[y&1]; - uo[1] = u_old[(y&1)^1]; - vo[1] = v_old[(y&1)^1]; - for (x = x1; x < x2; x++) - { - pixel = inb->line[y][x]; - - Y = vision_iir(cols[pixel][0]); - U = cols[pixel][1]; - V = cols[pixel][2]; - - signal = Y + chroma_iir(U * sint[wt] + V * cost[wt]); - - u_filt[x & 3] = signal * sint[wt]; - v_filt[x & 3] = signal * cost[wt]; - U = u_filt[0] + u_filt[1] + u_filt[2] + u_filt[3]; - V = v_filt[0] + v_filt[1] + v_filt[2] + v_filt[3]; - uo[0][x] = U; - vo[0][x] = V; - U += uo[1][x]; - V += vo[1][x]; - - wt++; - - r = Y + (1.140/8.0) * V; - g = Y - (0.396/8.0) * U - (0.581/8.0) * V; - b = Y + (2.029/8.0) * U; - - if (r > 255) r = 255; - if (r < 0) r = 0; - if (g > 255) g = 255; - if (g < 0) g = 0; - if (b > 255) b = 255; - if (b < 0) b = 0; - - ((uint32_t *)b32->line[y])[x] = b | (g << 8) | (r << 16); - } - - wt += (1024 - (x2 - x1)); - wt %= 832; - } -} - -#endif +#include +#include +#include "b-em.h" + +#include "pal.h" +#include "video.h" +#include "video_render.h" + +#define NCoef 1 +fixed vision_iir(fixed NewSample) { + static fixed x; //input samples + + x = (x + NewSample) >> 1; +// x = NewSample; + + return x; +} + + +#undef NCoef +#define NCoef 2 +static inline fixed chroma_iir(fixed NewSample) { + static fixed y[NCoef+1]; //output samples + static fixed x[NCoef+1]; //input samples + + x[2] = x[1]; + x[1] = x[0]; + x[0] = NewSample; + y[2] = y[1]; + y[1] = y[0]; + + + //Calculate the new output + y[0] = fmul(49429, x[0]); + y[0] -= fmul(12112, y[1]); + y[0] -= fmul(49429, x[2]); + y[0] -= fmul(21779, y[2]); + + return y[0]; +} + + +//3.609 +#define WT_INC ((4433618.75 / 16000000.0) * (2 * 3.14)) + +fixed sint[1024], cost[1024]; +fixed sint2[1024], cost2[1024]; +fixed cols[256][4]; + +fixed colx[256][16]; + +void pal_init() +{ + int c; + float wt = 0.0; + int r, g, b; + for (c = 0; c < 1024; c++) + { + sint[c] = ftofix(sin(wt)); + cost[c] = ftofix(cos(wt)); + sint2[c] = fmul(40000, fmul(16622, sint[c])); + cost2[c] = fmul(40000, fmul(9339, cost[c])); + wt += (2.0 * 3.14) / 1024.0; + } + for (c = 0; c < 256; c++) + { + r = (c & 1) ? 255 : 0; + g = (c & 2) ? 255 : 0; + b = (c & 4) ? 255 : 0; + + cols[c][0] = ftofix( 0.299 * r + 0.587 * g + 0.114 * b); + cols[c][1] = ftofix(-0.147 * r - 0.289 * g + 0.436 * b); + cols[c][2] = ftofix( 0.615 * r - 0.515 * g - 0.100 * b); + + colx[c][0] = fmul( 19595, c << 16); + colx[c][1] = fmul( 38470, c << 16); + colx[c][2] = fmul( 7471, c << 16); + colx[c][4] = fmul( -9634, c << 16); + colx[c][5] = fmul(-18940, c << 16); + colx[c][6] = fmul( 28574, c << 16); + colx[c][8] = fmul( 40305, c << 16); + colx[c][9] = fmul(-33751, c << 16); + colx[c][10] = fmul( -6553, c << 16); + } +} + +void pal_convert(BITMAP *inb, int x1, int y1, int x2, int y2, int yoff) +{ + int x, y; + int r, g, b; + int pixel; + fixed Y, U, V; + fixed signal; + static int wt; + int old_wt; + int col; + + fixed u_old[2][1536], v_old[2][1536]; + fixed u_filt[4], v_filt[4]; + fixed *uo[2], *vo[2]; + + fixed sr[1536], sg[1536], sb[1536]; + + int dx1 = (x1 * 922) / 832; + int dx2 = (x2 * 922) / 832; + + int sx; + int dx = 59139; + + int c = (crtc[0] + 1) * ((ula_ctrl & 0x10) ? 8 : 16); + + c = ((c * 256) * 922) / 832; + + if (x1 > 1535) x1 = 1535; + if (x2 > 1536) x2 = 1536; + if (y1 > 799) y1 = 799; + if (y2 > 800) y2 = 800; + + for (x = x1; x < x2; x++) + u_old[0][x] = u_old[1][x] = v_old[0][x] = v_old[1][x] = 0; + for (x = 0; x < 4; x++) + u_filt[x] = v_filt[x] = 0; + +// rpclog("PAL %i-%i %i-%i\n",x1,x2,dx1,dx2); + + + for (y = y1; y < y2; y += yoff) + { + uo[0] = u_old[y&1]; + vo[0] = v_old[y&1]; + uo[1] = u_old[(y&1)^1]; + vo[1] = v_old[(y&1)^1]; + + sx = x1 << 16; + for (x = dx1; x < dx2; x++) + { + pixel = inb->line[y][sx >> 16]; + col = (0x10000 - (sx & 0xFFFF)) >> 8; + sr[x] = pal[pixel].r * col; + sg[x] = pal[pixel].g * col; + sb[x] = pal[pixel].b * col; + + pixel = inb->line[y][(sx >> 16) + 1]; + col = (sx & 0xFFFF) >> 8; + sr[x] += pal[pixel].r * col; + sg[x] += pal[pixel].g * col; + sb[x] += pal[pixel].b * col; + + sx += dx; + } + + old_wt = wt; + + for (x = dx1; x < dx2; x++) + { + r = sr[x] >> 6; + g = sg[x] >> 6; + b = sb[x] >> 6; + + Y = colx[r][0] + colx[g][1] + colx[b][2]; + U = colx[r][4] + colx[g][5] + colx[b][6]; + V = colx[r][8] + colx[g][9] + colx[b][10]; + + signal = (Y << 1) + chroma_iir(fmul(U, sint[wt]) + fmul(V, cost[wt])); + + u_filt[x & 3] = fmul(signal, sint2[wt]); + v_filt[x & 3] = fmul(signal, cost2[wt]); + U = u_filt[0] + u_filt[1] + u_filt[2] + u_filt[3]; + V = v_filt[0] + v_filt[1] + v_filt[2] + v_filt[3]; + uo[0][x] = U; + vo[0][x] = V; + U += uo[1][x]; + V += vo[1][x]; + + wt += 256; + wt &= 1023; + +/* r = fixtoi(Y + fmul(9339, V)); + g = fixtoi(Y - fmul(3244,U) - fmul(4760, V)); + b = fixtoi(Y + fmul(16622,U));*/ + r = fixtoi(Y + V); + g = fixtoi(Y - fmul(12790, U) - fmul(33403, V)); + b = fixtoi(Y + U); + + if (r > 255) r = 255; + if (r < 0) r = 0; + if (g > 255) g = 255; + if (g < 0) g = 0; + if (b > 255) b = 255; + if (b < 0) b = 0; + + ((uint32_t *)b32->line[y])[x] = b | (g << 8) | (r << 16); + } + + wt = old_wt - c; +// wt += 769; +// wt += (c - (256 * (dx2 - dx1))); + wt &= 1023; + } + + /*cheat*/ + wt -= (c * (312 - ((y2 - y1) / yoff))); + if (crtc[8] & 1) wt -= (c >> 1); + wt &= 1023; +} + + +/*Floating point version. This would be faster than the above, if B-em didn't crash with -O3 -msse*/ + +#if 0 +#include +#include "b-em.h" +#include "video.h" + +#define NCoef 1 +float vision_iir(float NewSample) { + static float x; //input samples + float y; + + x = (x + NewSample) * 0.5; +// x = NewSample; + + return x; +} + + +#undef NCoef +#define NCoef 2 +static inline float chroma_iir(float NewSample) { + static float y[NCoef+1]; //output samples + static float x[NCoef+1]; //input samples + + x[2] = x[1]; + x[1] = x[0]; + x[0] = NewSample; + y[2] = y[1]; + y[1] = y[0]; + + + //Calculate the new output + y[0] = 0.754226 * x[0]; + y[0] -= 0.184815 * y[1]; + y[0] -= 0.754226 * x[2]; + y[0] -= 0.332316 * y[2]; + + return y[0]; +} + + + +#define WT_INC ((4433618.75 / 16000000.0) * (2 * 3.14)) + +float sint[832*2], cost[832*2]; +float cols[256][4]; +void pal_init() +{ + int c; + float wt = 0.0; + int r, g, b; + for (c = 0; c < 832*2; c++) + { + sint[c] = sin(wt); + cost[c] = cos(wt); + wt += WT_INC; + } + for (c = 0; c < 256; c++) + { + r = pal[c].r << 2; + g = pal[c].g << 2; + b = pal[c].b << 2; + + cols[c][0] = 0.299 * r + 0.587 * g + 0.114 * b; + cols[c][1] = -0.147 * r - 0.289 * g + 0.436 * b; + cols[c][2] = 0.615 * r - 0.515 * g - 0.100 * b; + } +} + +void pal_convert(BITMAP *inb, int x1, int y1, int x2, int y2) +{ + int x, y; + int r, g, b; + int pixel; + int c; + float Y, U, V; + float signal; + static int wt; + float u_old[2][1536], v_old[2][1536]; + float u_filt[4], v_filt[4]; + float *uo[2], *vo[2]; + + for (x = x1; x < x2; x++) + u_old[0][x] = u_old[1][x] = v_old[0][x] = v_old[1][x] = 0.0; + for (x = 0; x < 4; x++) + u_filt[x] = v_filt[x] = 0.0; + + for (y = y1; y < y2; y++) + { + uo[0] = u_old[y&1]; + vo[0] = v_old[y&1]; + uo[1] = u_old[(y&1)^1]; + vo[1] = v_old[(y&1)^1]; + for (x = x1; x < x2; x++) + { + pixel = inb->line[y][x]; + + Y = vision_iir(cols[pixel][0]); + U = cols[pixel][1]; + V = cols[pixel][2]; + + signal = Y + chroma_iir(U * sint[wt] + V * cost[wt]); + + u_filt[x & 3] = signal * sint[wt]; + v_filt[x & 3] = signal * cost[wt]; + U = u_filt[0] + u_filt[1] + u_filt[2] + u_filt[3]; + V = v_filt[0] + v_filt[1] + v_filt[2] + v_filt[3]; + uo[0][x] = U; + vo[0][x] = V; + U += uo[1][x]; + V += vo[1][x]; + + wt++; + + r = Y + (1.140/8.0) * V; + g = Y - (0.396/8.0) * U - (0.581/8.0) * V; + b = Y + (2.029/8.0) * U; + + if (r > 255) r = 255; + if (r < 0) r = 0; + if (g > 255) g = 255; + if (g < 0) g = 0; + if (b > 255) b = 255; + if (b < 0) b = 0; + + ((uint32_t *)b32->line[y])[x] = b | (g << 8) | (r << 16); + } + + wt += (1024 - (x2 - x1)); + wt %= 832; + } +} + +#endif diff --git a/src/pal.h b/src/pal.h index 618e870d..0165a54e 100644 --- a/src/pal.h +++ b/src/pal.h @@ -1,2 +1,2 @@ -void pal_init(); -void pal_convert(BITMAP *inb, int x1, int y1, int x2, int y2, int yoff); +void pal_init(); +void pal_convert(BITMAP *inb, int x1, int y1, int x2, int y2, int yoff); diff --git a/src/resid-fp/AUTHORS b/src/resid-fp/AUTHORS index cd2ca3fc..256214b2 100644 --- a/src/resid-fp/AUTHORS +++ b/src/resid-fp/AUTHORS @@ -1,4 +1,4 @@ -Authors of reSID. - -Dag Lem: Designed and programmed complete emulation engine. -Antti S. Lankila: Support 6581 filter distortion, envelope & voice nonlinearities, output amp clipping effects. +Authors of reSID. + +Dag Lem: Designed and programmed complete emulation engine. +Antti S. Lankila: Support 6581 filter distortion, envelope & voice nonlinearities, output amp clipping effects. diff --git a/src/resid-fp/COPYING b/src/resid-fp/COPYING index d60c31a9..fbdd65f6 100644 --- a/src/resid-fp/COPYING +++ b/src/resid-fp/COPYING @@ -1,340 +1,340 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public 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. + 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. diff --git a/src/resid-fp/ChangeLog b/src/resid-fp/ChangeLog index db2da142..465e29a3 100644 --- a/src/resid-fp/ChangeLog +++ b/src/resid-fp/ChangeLog @@ -1,136 +1,136 @@ -2008-12-05 Antti S. Lankila - - * Sync against V27 patch version. Filter updates described below. - - * Reduce Q maximum to 2.2 or so. This may still be slightly too much, - but it's hard to say exactly... - - * Arrange for about 3 dB boost of lowpass output that is independent - of state variable mixing or other feedback. This seems to produce - the right kind of sounds for songs like AMJ's Blasphemy. - - * Assume that bp is slightly louder than bp (= more distorted). - This seems to help against very large number of songs which sport - lead sounds and effects distorted in a smooth, bassy way. - - * Parameter tuneup. - -2008-10-31 Antti S. Lankila - - * Sync against V25 patch version. Filter updates described below. - - * Tweak filter algorithm to do some state variable mixing in the - 6581 code path. This corresponds with assumed output impedance of - the SID "amplifiers", and is separate effect to the output strip - backmixing. - - * Retire the V24 attempt of dynamically adjusting BP distortion - threshold. It doesn't really seem to work. - - * Increase Q value maximum to 2.5. This may be too much, but it sounds - fine to me. - - * JT's Star Ball was very distorted when played by V24. This related - to the hardclipping I had assumed to occur in the filter output amp, - but maybe that theory is incorrect. I now only add distortion to the - unfiltered voice path, but I'm not happy about it. - -2008-08-29 Antti S. Lankila - - * Optimized resampling to be about 2x faster through using aliasing - to increase passband width and hence reduce FIR length. - - * Fixed some valgrind warnings. - - * Added nuke_denormals() method to periodically flush these to zero, as - this can only be done for SSE registers by the FPU and we can't use - any in order to support CPUs older than P3. - - * Marco, Hannu and me developed a runtime switching system - that detects SSE from cpuinfo and calls some SSE routines when they - are compiled in and the CPU can support them. We lost only very - little performance, but gained compatibility to very, very old - hardware. - - * The old code for ST_lockup proved unnecessary, so it is now removed. - -2008-08-21 Antti S. Lankila - - * Fixed a bug where nonlinearity setting appeared to get lost, and - kenchis discovered further bugs in it. Oh well. - - * I removed a lot of code associated with the lower quality modes of - ReSID, and only left the 1 MHz clock routines. Analysis shows that the - filter code is a major culprit, but the digital side emulation is not - completely cheap, either. I already added some small hacks to optimize - it, and I now think about reinjecting pieces of those clocking modes - that run the analog parts with reduced accuracy. - - * I defined type4 filters based on equation of straight line. These are - characterized by parameters k and b, and the equation is - freq = k * fc. Strictly speaking, straight line is not 100 % - accurate, and a 2nd degree component would help, but based on - measurements against two of Trurl's 8580s, the maximum error - introduced using linear approximation is mere 3 %. - -2008-08-10 Antti S. Lankila - - * I ripped off Type1 definitions from the filter, and the spline.h - and PointPlotter were unnecessary and so removed. - - * I also added a bit of hardclipping in the output that seems to be - required to get Fred Gray's Break Thru. This might not occur so - strongly on all chips, so it should probably be added as a proper - tunable. For now, I just settled for a slight effect to collect - feedback. - -2008-07-15 Antti S. Lankila - - * This release is a bit slower than usual. The culprit is the changes in - voice.h where a new kinked-dac style calculation is used to simulate - the nonlinear shape of the waveform outputs. The cost of the new - calculation varies by song as I was lazy and only cached the result of - previous calculation, so speed depends on the pitch of the waveforms - and the precise waveform chosen. - - * exp() is back, but this time it is implemented as an integer - calculation according to Schraudolph's paper "A Fast, Compact - Approximation of the Exponential Function". Using near-proper exp() - simplified the distortion algorithm. I think it all sounds much better - now. - - * A new effect where I mix bp-hp and lp-bp together by their difference - to simulate a small resistor between them appears to improve SidRiders - and several other songs, largerly eliminating some types of hard - distortion sounds that do not occur on the chip. It also helped - Mechanicus. I am trying to understand where this term comes from... - -2008-07-09 Antti S. Lankila - - * I now have somewhat less arbitrary values for the distortion - tunables. They are now related to the relative signal levels in the - simulation. I'm still sorting out the particulars of the values I - ended up with ("why 128 instead of 256"). - -2008-03-02 Antti S. Lankila - - * Exposed the filter at sid.cc to callers through get_filter() - method, and fixed a few types. - -2008-02-19 Antti S. Lankila - - * For some reason ReSID code adjusted the external filter frequency - based on calculated passband, while in the real C64 the filter is - fixed to about 16 kHz. - -2008-02-06 Antti S. Lankila - - * I got interested to improve ReSID after chatting with Kevtris. He is - aiming to replicate the filter using analog hardware. He has the EE - experience that I have sorely lacked and made an infinitely valuable - contribution by telling me exactly how the distortion works. - -2004-06-11 Dag Lem - - * Version 0.16 released. (From this point forwards, read - ../resid/ChangeLog.) +2008-12-05 Antti S. Lankila + + * Sync against V27 patch version. Filter updates described below. + + * Reduce Q maximum to 2.2 or so. This may still be slightly too much, + but it's hard to say exactly... + + * Arrange for about 3 dB boost of lowpass output that is independent + of state variable mixing or other feedback. This seems to produce + the right kind of sounds for songs like AMJ's Blasphemy. + + * Assume that bp is slightly louder than bp (= more distorted). + This seems to help against very large number of songs which sport + lead sounds and effects distorted in a smooth, bassy way. + + * Parameter tuneup. + +2008-10-31 Antti S. Lankila + + * Sync against V25 patch version. Filter updates described below. + + * Tweak filter algorithm to do some state variable mixing in the + 6581 code path. This corresponds with assumed output impedance of + the SID "amplifiers", and is separate effect to the output strip + backmixing. + + * Retire the V24 attempt of dynamically adjusting BP distortion + threshold. It doesn't really seem to work. + + * Increase Q value maximum to 2.5. This may be too much, but it sounds + fine to me. + + * JT's Star Ball was very distorted when played by V24. This related + to the hardclipping I had assumed to occur in the filter output amp, + but maybe that theory is incorrect. I now only add distortion to the + unfiltered voice path, but I'm not happy about it. + +2008-08-29 Antti S. Lankila + + * Optimized resampling to be about 2x faster through using aliasing + to increase passband width and hence reduce FIR length. + + * Fixed some valgrind warnings. + + * Added nuke_denormals() method to periodically flush these to zero, as + this can only be done for SSE registers by the FPU and we can't use + any in order to support CPUs older than P3. + + * Marco, Hannu and me developed a runtime switching system + that detects SSE from cpuinfo and calls some SSE routines when they + are compiled in and the CPU can support them. We lost only very + little performance, but gained compatibility to very, very old + hardware. + + * The old code for ST_lockup proved unnecessary, so it is now removed. + +2008-08-21 Antti S. Lankila + + * Fixed a bug where nonlinearity setting appeared to get lost, and + kenchis discovered further bugs in it. Oh well. + + * I removed a lot of code associated with the lower quality modes of + ReSID, and only left the 1 MHz clock routines. Analysis shows that the + filter code is a major culprit, but the digital side emulation is not + completely cheap, either. I already added some small hacks to optimize + it, and I now think about reinjecting pieces of those clocking modes + that run the analog parts with reduced accuracy. + + * I defined type4 filters based on equation of straight line. These are + characterized by parameters k and b, and the equation is + freq = k * fc. Strictly speaking, straight line is not 100 % + accurate, and a 2nd degree component would help, but based on + measurements against two of Trurl's 8580s, the maximum error + introduced using linear approximation is mere 3 %. + +2008-08-10 Antti S. Lankila + + * I ripped off Type1 definitions from the filter, and the spline.h + and PointPlotter were unnecessary and so removed. + + * I also added a bit of hardclipping in the output that seems to be + required to get Fred Gray's Break Thru. This might not occur so + strongly on all chips, so it should probably be added as a proper + tunable. For now, I just settled for a slight effect to collect + feedback. + +2008-07-15 Antti S. Lankila + + * This release is a bit slower than usual. The culprit is the changes in + voice.h where a new kinked-dac style calculation is used to simulate + the nonlinear shape of the waveform outputs. The cost of the new + calculation varies by song as I was lazy and only cached the result of + previous calculation, so speed depends on the pitch of the waveforms + and the precise waveform chosen. + + * exp() is back, but this time it is implemented as an integer + calculation according to Schraudolph's paper "A Fast, Compact + Approximation of the Exponential Function". Using near-proper exp() + simplified the distortion algorithm. I think it all sounds much better + now. + + * A new effect where I mix bp-hp and lp-bp together by their difference + to simulate a small resistor between them appears to improve SidRiders + and several other songs, largerly eliminating some types of hard + distortion sounds that do not occur on the chip. It also helped + Mechanicus. I am trying to understand where this term comes from... + +2008-07-09 Antti S. Lankila + + * I now have somewhat less arbitrary values for the distortion + tunables. They are now related to the relative signal levels in the + simulation. I'm still sorting out the particulars of the values I + ended up with ("why 128 instead of 256"). + +2008-03-02 Antti S. Lankila + + * Exposed the filter at sid.cc to callers through get_filter() + method, and fixed a few types. + +2008-02-19 Antti S. Lankila + + * For some reason ReSID code adjusted the external filter frequency + based on calculated passband, while in the real C64 the filter is + fixed to about 16 kHz. + +2008-02-06 Antti S. Lankila + + * I got interested to improve ReSID after chatting with Kevtris. He is + aiming to replicate the filter using analog hardware. He has the EE + experience that I have sorely lacked and made an infinitely valuable + contribution by telling me exactly how the distortion works. + +2004-06-11 Dag Lem + + * Version 0.16 released. (From this point forwards, read + ../resid/ChangeLog.) diff --git a/src/resid-fp/INSTALL b/src/resid-fp/INSTALL index 4573d654..537b11e7 100644 --- a/src/resid-fp/INSTALL +++ b/src/resid-fp/INSTALL @@ -1,14 +1,14 @@ -Unless you want to do anything fancy, just say: - -% ./configure -% make - -ReSID-FP is compiled with a C++ compiler, so if you wish to specify compiler -and compiler flags you must set CXX and CXXFLAGS, e.g.: -% CXX=g++ CXXFLAGS="-g -O" ./configure - -In addition to normal configure flags, you may specify ---disable-inline - Disable inlining of functions (for debugging/profiling) - -ReSID-FP makes no installable files. The libresid.a is linked to final -executable automatically. +Unless you want to do anything fancy, just say: + +% ./configure +% make + +ReSID-FP is compiled with a C++ compiler, so if you wish to specify compiler +and compiler flags you must set CXX and CXXFLAGS, e.g.: +% CXX=g++ CXXFLAGS="-g -O" ./configure + +In addition to normal configure flags, you may specify +--disable-inline - Disable inlining of functions (for debugging/profiling) + +ReSID-FP makes no installable files. The libresid.a is linked to final +executable automatically. diff --git a/src/resid-fp/Makefile.am b/src/resid-fp/Makefile.am index 5af26322..dcd5dc21 100644 --- a/src/resid-fp/Makefile.am +++ b/src/resid-fp/Makefile.am @@ -1,29 +1,29 @@ -## Process this file with automake to create Makefile.in - -AR = @AR@ - -noinst_LIBRARIES = libresidfp.a - -libresidfp_a_SOURCES = sid.cc voice.cc wave.cc envelope.cc filter.cc extfilt.cc pot.cc version.cc convolve.cc $(noinst_DATA:.dat=.cc) - -BUILT_SOURCES = $(noinst_DATA:.dat=.cc) - -noinst_HEADERS = sid.h voice.h wave.h envelope.h filter.h extfilt.h pot.h - -noinst_DATA = wave6581_PST.dat wave6581_PS_.dat wave6581_P_T.dat wave6581__ST.dat wave8580_PST.dat wave8580_PS_.dat wave8580_P_T.dat wave8580__ST.dat - -noinst_SCRIPTS = samp2src.pl - -EXTRA_DIST = $(noinst_HEADERS) $(noinst_DATA) $(noinst_SCRIPTS) README.VICE convolve-sse.cc - -SUFFIXES = .dat - -.dat.cc: - $(PERL) $(srcdir)/samp2src.pl $* $< $(srcdir)/$@ - -if USE_SSE -convolve-sse.o: convolve-sse.cc - $(CXXCOMPILE) -msse -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -libresidfp_a_LIBADD = convolve-sse.o -endif +## Process this file with automake to create Makefile.in + +AR = @AR@ + +noinst_LIBRARIES = libresidfp.a + +libresidfp_a_SOURCES = sid.cc voice.cc wave.cc envelope.cc filter.cc extfilt.cc pot.cc version.cc convolve.cc $(noinst_DATA:.dat=.cc) + +BUILT_SOURCES = $(noinst_DATA:.dat=.cc) + +noinst_HEADERS = sid.h voice.h wave.h envelope.h filter.h extfilt.h pot.h + +noinst_DATA = wave6581_PST.dat wave6581_PS_.dat wave6581_P_T.dat wave6581__ST.dat wave8580_PST.dat wave8580_PS_.dat wave8580_P_T.dat wave8580__ST.dat + +noinst_SCRIPTS = samp2src.pl + +EXTRA_DIST = $(noinst_HEADERS) $(noinst_DATA) $(noinst_SCRIPTS) README.VICE convolve-sse.cc + +SUFFIXES = .dat + +.dat.cc: + $(PERL) $(srcdir)/samp2src.pl $* $< $(srcdir)/$@ + +if USE_SSE +convolve-sse.o: convolve-sse.cc + $(CXXCOMPILE) -msse -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +libresidfp_a_LIBADD = convolve-sse.o +endif diff --git a/src/resid-fp/Makefile.in b/src/resid-fp/Makefile.in new file mode 100644 index 00000000..5d66ef8f --- /dev/null +++ b/src/resid-fp/Makefile.in @@ -0,0 +1,557 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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@ + + + + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = . +DIST_COMMON = README $(am__configure_deps) $(noinst_HEADERS) \ + $(srcdir)/../../depcomp $(srcdir)/../../install-sh \ + $(srcdir)/../../missing $(srcdir)/../../mkinstalldirs \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/siddefs-fp.h.in $(top_srcdir)/configure AUTHORS \ + COPYING ChangeLog INSTALL NEWS +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_CLEAN_FILES = siddefs-fp.h +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +libresidfp_a_AR = $(AR) $(ARFLAGS) +@USE_SSE_TRUE@libresidfp_a_DEPENDENCIES = convolve-sse.o +am__objects_1 = wave6581_PST.$(OBJEXT) wave6581_PS_.$(OBJEXT) \ + wave6581_P_T.$(OBJEXT) wave6581__ST.$(OBJEXT) \ + wave8580_PST.$(OBJEXT) wave8580_PS_.$(OBJEXT) \ + wave8580_P_T.$(OBJEXT) wave8580__ST.$(OBJEXT) +am_libresidfp_a_OBJECTS = sid.$(OBJEXT) voice.$(OBJEXT) wave.$(OBJEXT) \ + envelope.$(OBJEXT) filter.$(OBJEXT) extfilt.$(OBJEXT) \ + pot.$(OBJEXT) version.$(OBJEXT) convolve.$(OBJEXT) \ + $(am__objects_1) +libresidfp_a_OBJECTS = $(am_libresidfp_a_OBJECTS) +SCRIPTS = $(noinst_SCRIPTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) +depcomp = $(SHELL) $(top_srcdir)/../../depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +SOURCES = $(libresidfp_a_SOURCES) +DIST_SOURCES = $(libresidfp_a_SOURCES) +DATA = $(noinst_DATA) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +HAVE_EXPF_PROTOTYPE = @HAVE_EXPF_PROTOTYPE@ +HAVE_LOGF_PROTOTYPE = @HAVE_LOGF_PROTOTYPE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +RANLIB = @RANLIB@ +RESID_HAVE_BOOL = @RESID_HAVE_BOOL@ +RESID_INLINE = @RESID_INLINE@ +RESID_USE_SSE = @RESID_USE_SSE@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_SSE_FALSE = @USE_SSE_FALSE@ +USE_SSE_TRUE = @USE_SSE_TRUE@ +VERSION = @VERSION@ +ac_ct_CXX = @ac_ct_CXX@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +noinst_LIBRARIES = libresidfp.a +libresidfp_a_SOURCES = sid.cc voice.cc wave.cc envelope.cc filter.cc extfilt.cc pot.cc version.cc convolve.cc $(noinst_DATA:.dat=.cc) +BUILT_SOURCES = $(noinst_DATA:.dat=.cc) +noinst_HEADERS = sid.h voice.h wave.h envelope.h filter.h extfilt.h pot.h +noinst_DATA = wave6581_PST.dat wave6581_PS_.dat wave6581_P_T.dat wave6581__ST.dat wave8580_PST.dat wave8580_PS_.dat wave8580_P_T.dat wave8580__ST.dat +noinst_SCRIPTS = samp2src.pl +EXTRA_DIST = $(noinst_HEADERS) $(noinst_DATA) $(noinst_SCRIPTS) README.VICE convolve-sse.cc +SUFFIXES = .dat +@USE_SSE_TRUE@libresidfp_a_LIBADD = convolve-sse.o +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .dat .cc .o .obj +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +siddefs-fp.h: $(top_builddir)/config.status $(srcdir)/siddefs-fp.h.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libresidfp.a: $(libresidfp_a_OBJECTS) $(libresidfp_a_DEPENDENCIES) + -rm -f libresidfp.a + $(libresidfp_a_AR) libresidfp.a $(libresidfp_a_OBJECTS) $(libresidfp_a_LIBADD) + $(RANLIB) libresidfp.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convolve.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/envelope.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extfilt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pot.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/voice.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave6581_PST.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave6581_PS_.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave6581_P_T.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave6581__ST.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave8580_PST.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave8580_PS_.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave8580_P_T.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wave8580__ST.Po@am__quote@ + +.cc.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(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 "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_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 tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkdir_p) $(distdir)/. $(distdir)/../.. + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + 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"; \ + $(mkdir_p) "$(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 + -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 + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | 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 + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + 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 | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && 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 \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +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 in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LIBRARIES) $(SCRIPTS) $(DATA) $(HEADERS) +installdirs: +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) 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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-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 + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ + clean-generic clean-noinstLIBRARIES ctags dist dist-all \ + dist-bzip2 dist-gzip dist-shar dist-tarZ dist-zip distcheck \ + distclean distclean-compile distclean-generic distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-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-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am + + +.dat.cc: + $(PERL) $(srcdir)/samp2src.pl $* $< $(srcdir)/$@ + +@USE_SSE_TRUE@convolve-sse.o: convolve-sse.cc +@USE_SSE_TRUE@ $(CXXCOMPILE) -msse -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< +# 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: diff --git a/src/resid-fp/NEWS b/src/resid-fp/NEWS index 70b2d4f8..decc1949 100644 --- a/src/resid-fp/NEWS +++ b/src/resid-fp/NEWS @@ -1 +1 @@ -See ChangeLog for information about new features. +See ChangeLog for information about new features. diff --git a/src/resid-fp/README b/src/resid-fp/README index ac4f4275..777ee452 100644 --- a/src/resid-fp/README +++ b/src/resid-fp/README @@ -1,79 +1,79 @@ -Please refer to original ../resid/README file for general discussion what -ReSID is. - -This is ReSID-FP, a fork of ReSID that has been adapted to floating point -numbers. Some SSE assembly is used for vector convolutions when both the CPU -and compiler support it. In addition, some liberties have been taken in the -frequency region > 20 kHz which should be inaudible to humans. - -In the emulation front, several changes to the original ReSID (henceforth -classical ReSID) have been made. These changes are listed here: - -Waveforms: - -- Noise waveform control via test bit is now possible. - (Unknown: how long does it take for the noise bits to fade with test bit on?) - This is used in SounDemoN's Tamaking, Bojojoing, etc, and the patch to - implement it in ReSID is his. - -- Waveform 0, the frozen DAC, is emulated, which should make the new 8-bit - sample player routine work. - -- Envelope and waveform outputs contain approximation of the imperfect DACs - (Unknown: are there other significant effects that affect the analog waveform - before it goes into filter, which should be modelled?) - -- I changed voice DC offsets around for 6581 to better match my R4AR 3789. - -Envelope: - -- Performance work at envelope. Validation pending, should ensure that the new - code behaves 100% identically to the old one. - -Mixer: - -- Experimentally, a subtle negative offset is injected into the mixer through - ext-in pin. This part seems, however, physically incorrect and is likely - removed in the future. (The coupling capacitor external to the chip must - eliminate any DC offset, and the ext-in circuit inside the chip has nothing - that could generate offsets. In the meantime, this fix still helps 8580 - Netherworld to play more correctly.) - -- I removed the mixer_DC very subtle effect on 6581, as it already has 10x - more offsets elsewhere. - -Filter: - -- 6581 filter output contains approximation of the distortion effect -- 8580 filter output has bp flipped in phase with the other outputs -- 6581 resonance is slightly boosted. Potentially 8580 resonance needs to be - slightly stronger as well, as many songs show a bit more "punch" on the real - chip and one way to get more of that is increasing resonance. 10-20 % - increment is a practical maximum. - -The upshot of all this is that for i386/x86-64 hardware, ReSID-FP's more -complicated algorithms may not seem any more expensive than the original ReSID. -For high-quality modes, it is virtually certain that ReSID-FP is actually -faster. - -Meanwhile, emulation quality should be improved. If there are bugs, I'd like -to know about them. If the filter sounds wrong, I might be able to improve it, -too. - -Here are some problematic songs, to get a feel for what's left to do: - -- Markus Mueller: Mechanicus - * the distorted guitar effect is too distorted, but don't know how/why. - -- Galway: Wizball - * the initial lead punches through with too much distortion. The "toggle" - between the muffled and more intense sound is too hard, even if similar - things do occur on the chip. - -Undoubtedly, many more such examples will be found. However, samplings and such -are really valueable only if they can be made on a chip that I have modelled -for ReSID-FP. In practice I want to know about badly-playing chips, but might -conclude that it actually plays alright. At any event, information about sound -issues is welcome. - -alankila@bel.fi +Please refer to original ../resid/README file for general discussion what +ReSID is. + +This is ReSID-FP, a fork of ReSID that has been adapted to floating point +numbers. Some SSE assembly is used for vector convolutions when both the CPU +and compiler support it. In addition, some liberties have been taken in the +frequency region > 20 kHz which should be inaudible to humans. + +In the emulation front, several changes to the original ReSID (henceforth +classical ReSID) have been made. These changes are listed here: + +Waveforms: + +- Noise waveform control via test bit is now possible. + (Unknown: how long does it take for the noise bits to fade with test bit on?) + This is used in SounDemoN's Tamaking, Bojojoing, etc, and the patch to + implement it in ReSID is his. + +- Waveform 0, the frozen DAC, is emulated, which should make the new 8-bit + sample player routine work. + +- Envelope and waveform outputs contain approximation of the imperfect DACs + (Unknown: are there other significant effects that affect the analog waveform + before it goes into filter, which should be modelled?) + +- I changed voice DC offsets around for 6581 to better match my R4AR 3789. + +Envelope: + +- Performance work at envelope. Validation pending, should ensure that the new + code behaves 100% identically to the old one. + +Mixer: + +- Experimentally, a subtle negative offset is injected into the mixer through + ext-in pin. This part seems, however, physically incorrect and is likely + removed in the future. (The coupling capacitor external to the chip must + eliminate any DC offset, and the ext-in circuit inside the chip has nothing + that could generate offsets. In the meantime, this fix still helps 8580 + Netherworld to play more correctly.) + +- I removed the mixer_DC very subtle effect on 6581, as it already has 10x + more offsets elsewhere. + +Filter: + +- 6581 filter output contains approximation of the distortion effect +- 8580 filter output has bp flipped in phase with the other outputs +- 6581 resonance is slightly boosted. Potentially 8580 resonance needs to be + slightly stronger as well, as many songs show a bit more "punch" on the real + chip and one way to get more of that is increasing resonance. 10-20 % + increment is a practical maximum. + +The upshot of all this is that for i386/x86-64 hardware, ReSID-FP's more +complicated algorithms may not seem any more expensive than the original ReSID. +For high-quality modes, it is virtually certain that ReSID-FP is actually +faster. + +Meanwhile, emulation quality should be improved. If there are bugs, I'd like +to know about them. If the filter sounds wrong, I might be able to improve it, +too. + +Here are some problematic songs, to get a feel for what's left to do: + +- Markus Mueller: Mechanicus + * the distorted guitar effect is too distorted, but don't know how/why. + +- Galway: Wizball + * the initial lead punches through with too much distortion. The "toggle" + between the muffled and more intense sound is too hard, even if similar + things do occur on the chip. + +Undoubtedly, many more such examples will be found. However, samplings and such +are really valueable only if they can be made on a chip that I have modelled +for ReSID-FP. In practice I want to know about badly-playing chips, but might +conclude that it actually plays alright. At any event, information about sound +issues is welcome. + +alankila@bel.fi diff --git a/src/resid-fp/README.VICE b/src/resid-fp/README.VICE index 02072ce9..d9a74647 100644 --- a/src/resid-fp/README.VICE +++ b/src/resid-fp/README.VICE @@ -1,14 +1,14 @@ -This version of reSID has been modified for use with VICE. It is based on the -work contained in the resid/ directory, with duplicate files removed. All -classes have been renamed with suffix FP to avoid link-time clashes with the -other RESID implementation. - -These files reuse some define terms also defined by resid. You should not mix -resid/* and resid-fp/* files in one compile unit, or the results are probably -invalid. - -In particular, libtool is not used to build the library, and there -might be some workarounds for various substandard compilers. - -Please get the original version if you want to use reSID in your own -project. +This version of reSID has been modified for use with VICE. It is based on the +work contained in the resid/ directory, with duplicate files removed. All +classes have been renamed with suffix FP to avoid link-time clashes with the +other RESID implementation. + +These files reuse some define terms also defined by resid. You should not mix +resid/* and resid-fp/* files in one compile unit, or the results are probably +invalid. + +In particular, libtool is not used to build the library, and there +might be some workarounds for various substandard compilers. + +Please get the original version if you want to use reSID in your own +project. diff --git a/src/resid-fp/aclocal.m4 b/src/resid-fp/aclocal.m4 new file mode 100644 index 00000000..de1006b3 --- /dev/null +++ b/src/resid-fp/aclocal.m4 @@ -0,0 +1,850 @@ +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 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. + +# Copyright (C) 2002, 2003, 2005 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. + +# 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.9"]) + +# 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.9.6])]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 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. + +# 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. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# 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. + +# serial 7 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + 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])]) + + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# 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. + +# 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... + + +# _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 + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + 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 + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # 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. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/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=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + 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_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --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 (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# 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. + +#serial 3 + +# _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 + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. 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 " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/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"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# 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. + +# serial 12 + +# 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. + +# 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_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +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 + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# 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_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# 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 +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_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 +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 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. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +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)]) + +# Copyright (C) 2003, 2005 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. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 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. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +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 | grep -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 +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# 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. + +# serial 4 + +# 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 +]) + +# Copyright (C) 2003, 2004, 2005 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. + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. +# +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 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. + +# serial 3 + +# _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. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# 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. + +# serial 4 + +# 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)]) + +# Copyright (C) 2001, 2003, 2005 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. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# 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])]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 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. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/src/resid-fp/configure b/src/resid-fp/configure new file mode 100644 index 00000000..2ba650d7 --- /dev/null +++ b/src/resid-fp/configure @@ -0,0 +1,5955 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.61. +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 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 more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +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+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# 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 + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +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 -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + 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=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +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+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +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+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # 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 after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, 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 + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\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 sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +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$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval 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="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +exec 7<&0 &1 + +# 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` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="sid.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef 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 +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +CYGPATH_W +PACKAGE +VERSION +ACLOCAL +AUTOCONF +AUTOMAKE +AUTOHEADER +MAKEINFO +install_sh +STRIP +INSTALL_STRIP_PROGRAM +mkdir_p +AWK +SET_MAKE +am__leading_dot +AMTAR +am__tar +am__untar +RESID_INLINE +CXX +CXXFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CXX +EXEEXT +OBJEXT +DEPDIR +am__include +am__quote +AMDEP_TRUE +AMDEP_FALSE +AMDEPBACKSLASH +CXXDEPMODE +am__fastdepCXX_TRUE +am__fastdepCXX_FALSE +AR +RANLIB +PERL +CXXCPP +GREP +EGREP +USE_SSE_TRUE +USE_SSE_FALSE +RESID_HAVE_BOOL +RESID_USE_SSE +HAVE_LOGF_PROTOTYPE +HAVE_EXPF_PROTOTYPE +LIBOBJS +LTLIBOBJS' +ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CXX +CXXFLAGS +LDFLAGS +LIBS +CPPFLAGS +CCC +CXXCPP' + + +# 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. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +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 + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -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) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$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 ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -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'` + 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 ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$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 ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + 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 ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$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'` + 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; }; } + 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 directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +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 + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# 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 the parent directory. + ac_confdir=`$as_dirname -- "$0" || +$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 + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# 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 \`..'] + +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] + --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] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_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 +_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] + --enable-inline enable inlining of functions default=yes + --enable-sse enable the use of SSE default=yes + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Some influential environment variables: + CXX C++ compiler command + CXXFLAGS C++ compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + 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 +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested 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 + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.61 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 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 +fi +cat >config.log <<_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.61. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +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` +/usr/bin/hostinfo = `(/usr/bin/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 +IFS=$as_save_IFS + +} >&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_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_arg'" + ;; + 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: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +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, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + 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.conftest.* && + rm -f -r 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 -f -r conftest* 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 -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" +fi +shift +for ac_site_file +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 $ac_precious_vars; 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 + + + +am__api_version="1.9" +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 + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# 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" +# OS/2's system install, which has a completely different semantic +# ./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/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 +IFS=$as_save_IFS + + +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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + 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 -f 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 + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 +IFS=$as_save_IFS + +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 x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$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 + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# 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 + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE=resid + VERSION=0.16vice + + +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"} + +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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 +IFS=$as_save_IFS + +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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 +IFS=$as_save_IFS + +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 + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +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. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + +LTVERSION=5:0:0 + +ac_ext=cpp +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 + + +# Check whether --enable-inline was given. +if test "${enable_inline+set}" = set; then + enableval=$enable_inline; +fi + +# Check whether --enable-sse was given. +if test "${enable_sse+set}" = set; then + enableval=$enable_sse; +fi + + +if test "$enable_inline" != no; then + RESID_INLINE=inline +else + RESID_INLINE= +fi + + + +ac_ext=cpp +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 -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 +IFS=$as_save_IFS + +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 g++ c++ gpp aCC CC cxx cc++ cl.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 +IFS=$as_save_IFS + +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 + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +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` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 +/* 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 file name" >&5 +echo $ECHO_N "checking for C++ compiler default output file name... $ECHO_C" >&6; } +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then + 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 + +# Check that 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' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 that 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 { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 | *.map | *.inf | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + 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 +/* 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *) 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_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; 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 core conftest.err 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 +{ 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 + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CXXFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +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 +ac_ext=cpp +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 +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +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 | grep -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 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="$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 + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + 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 + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # 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. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/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=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + 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 + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + +if test x"$enable_sse" != "xno"; then + if test "$GXX" = yes; then + if test "$ac_test_CXXFLAGS" != set; then + CXXFLAGS="-g -Wall -O2 -msse" + { echo "$as_me:$LINENO: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo $ECHO_N "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works... $ECHO_C" >&6; } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int test; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + MSSE="-msse" + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + MSSE="" + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + fi +else + MSSE="" +fi + +if test "$GXX" = yes; then + if test "$ac_test_CXXFLAGS" != set; then + CXXFLAGS="-g -Wall -O2 $MSSE -fno-exceptions" + { echo "$as_me:$LINENO: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo $ECHO_N "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int test; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + NO_EXCEPTIONS="-fno-exceptions" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + NO_EXCEPTIONS="" + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +fi + +if test "$GXX" = yes; then + if test "$ac_test_CXXFLAGS" != set; then + CXXFLAGS="-g -Wall -O2 $MSSE -fno-exceptions $NO_EXCEPTIONS -fno-pic" + { echo "$as_me:$LINENO: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo $ECHO_N "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int test; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + NO_PIC="-fno-pic" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + NO_PIC="" + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +fi + +CXXFLAGS="-g -Wall -O2 $MSSE $NO_EXCEPTIONS $NO_PIC" +if test x"$MSSE" = "x-msse"; then + { echo "$as_me:$LINENO: checking if the xmmintrin.h include can be used" >&5 +echo $ECHO_N "checking if the xmmintrin.h include can be used... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +int test; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + MSSE="" + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXXFLAGS="-g -Wall -O2 $NO_EXCEPTIONS $NO_PIC" +fi + +# Extract the first word of "ar", so it can be a program name with args. +set dummy ar; 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_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; 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_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; 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_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; 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_PERL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_PERL="$PERL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PERL="$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 +IFS=$as_save_IFS + + ;; +esac +fi +PERL=$ac_cv_path_PERL +if test -n "$PERL"; then + { echo "$as_me:$LINENO: result: $PERL" >&5 +echo "${ECHO_T}$PERL" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + + + + + +ac_ext=cpp +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 +/* 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 { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.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 nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.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 +/* 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 { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.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 nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.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=cpp +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 for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_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_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_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 +/* 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; 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 core conftest.err 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 +/* 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 +/* 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#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)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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.conftest.* 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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&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 + + +{ echo "$as_me:$LINENO: checking for int" >&5 +echo $ECHO_N "checking for int... $ECHO_C" >&6; } +if test "${ac_cv_type_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef int ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_int=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_int=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 +echo "${ECHO_T}$ac_cv_type_int" >&6; } + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of int" >&5 +echo $ECHO_N "checking size of int... $ECHO_C" >&6; } +if test "${ac_cv_sizeof_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef int ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef int ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef int ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef int ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo= ac_hi= +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef int ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr '(' $ac_mid ')' + 1` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_int=$ac_lo;; +'') if test "$ac_cv_type_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_int=0 + fi ;; +esac +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef int ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) + { + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_int=`cat conftest.val` +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 ) +if test "$ac_cv_type_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_int=0 + fi +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.val +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + + +if test $ac_cv_sizeof_int -lt 4; then + { { echo "$as_me:$LINENO: error: only 32 bit or better CPUs are supported" >&5 +echo "$as_me: error: only 32 bit or better CPUs are supported" >&2;} + { (exit 1); exit 1; }; } +fi + +{ echo "$as_me:$LINENO: checking for working bool" >&5 +echo $ECHO_N "checking for working bool... $ECHO_C" >&6; } +if test "${ac_cv_cxx_bool+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + +bool flag; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_cxx_bool=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_cxx_bool=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_cxx_bool" >&5 +echo "${ECHO_T}$ac_cv_cxx_bool" >&6; } + +if test $ac_cv_cxx_bool = no; then + RESID_HAVE_BOOL=0 +else + RESID_HAVE_BOOL=1 +fi + +if test x"$MSSE" = "x-msse"; then + RESID_USE_SSE=1 + + +if true; then + USE_SSE_TRUE= + USE_SSE_FALSE='#' +else + USE_SSE_TRUE='#' + USE_SSE_FALSE= +fi + +else + RESID_USE_SSE=0 + + +if false; then + USE_SSE_TRUE= + USE_SSE_FALSE='#' +else + USE_SSE_TRUE='#' + USE_SSE_FALSE= +fi + +fi + + + + + + + +for ac_func in logf expf +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* 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_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +{ echo "$as_me:$LINENO: checking if the logf prototype is present" >&5 +echo $ECHO_N "checking if the logf prototype is present... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include +int +main () +{ +printf("%d",logf); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + HAVE_LOGF_PROTOTYPE=1 + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + HAVE_LOGF_PROTOTYPE=0 + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +{ echo "$as_me:$LINENO: checking if the expf prototype is present" >&5 +echo $ECHO_N "checking if the expf prototype is present... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include +int +main () +{ +printf("%d",expf); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + HAVE_EXPF_PROTOTYPE=1 + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + HAVE_EXPF_PROTOTYPE=0 + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + + +ac_config_files="$ac_config_files Makefile siddefs-fp.h" + +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, we kill variables containing newlines. +# 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. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + 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 "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} + 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}' + +# 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 branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +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_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$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 "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${USE_SSE_TRUE}" && test -z "${USE_SSE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"USE_SSE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"USE_SSE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${USE_SSE_TRUE}" && test -z "${USE_SSE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"USE_SSE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"USE_SSE\" 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 more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +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+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# 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 + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +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 -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # 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 after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, 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 + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\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 sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +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$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval 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="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.61. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" + +_ACEOF + +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 and configuration settings, 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.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2006 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +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 + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { 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" + ac_need_defaults=false ;; + + 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 CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "siddefs-fp.h") CONFIG_FILES="$CONFIG_FILES siddefs-fp.h" ;; + + *) { { 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 against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# +# Set up the sed scripts for 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 + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +CYGPATH_W!$CYGPATH_W$ac_delim +PACKAGE!$PACKAGE$ac_delim +VERSION!$VERSION$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOMAKE!$AUTOMAKE$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +install_sh!$install_sh$ac_delim +STRIP!$STRIP$ac_delim +INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim +mkdir_p!$mkdir_p$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +am__leading_dot!$am__leading_dot$ac_delim +AMTAR!$AMTAR$ac_delim +am__tar!$am__tar$ac_delim +am__untar!$am__untar$ac_delim +RESID_INLINE!$RESID_INLINE$ac_delim +CXX!$CXX$ac_delim +CXXFLAGS!$CXXFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CXX!$ac_ct_CXX$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +DEPDIR!$DEPDIR$ac_delim +am__include!$am__include$ac_delim +am__quote!$am__quote$ac_delim +AMDEP_TRUE!$AMDEP_TRUE$ac_delim +AMDEP_FALSE!$AMDEP_FALSE$ac_delim +AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim +CXXDEPMODE!$CXXDEPMODE$ac_delim +am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim +am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim +AR!$AR$ac_delim +RANLIB!$RANLIB$ac_delim +PERL!$PERL$ac_delim +CXXCPP!$CXXCPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +USE_SSE_TRUE!$USE_SSE_TRUE$ac_delim +USE_SSE_FALSE!$USE_SSE_FALSE$ac_delim +RESID_HAVE_BOOL!$RESID_HAVE_BOOL$ac_delim +RESID_USE_SSE!$RESID_USE_SSE$ac_delim +HAVE_LOGF_PROTOTYPE!$HAVE_LOGF_PROTOTYPE$ac_delim +HAVE_EXPF_PROTOTYPE!$HAVE_EXPF_PROTOTYPE$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 89; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# 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 + +cat >>$CONFIG_STATUS <<\_ACEOF +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # 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. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$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'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$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'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +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&@top_builddir@&$ac_top_builddir_sub&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; + + + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) 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=`$as_dirname -- "$mf" || +$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 + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. 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 " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/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_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'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$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'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + + esac +done # for ac_tag + + +{ (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 + diff --git a/src/resid-fp/configure.in b/src/resid-fp/configure.in index f4b3b573..0f689143 100644 --- a/src/resid-fp/configure.in +++ b/src/resid-fp/configure.in @@ -1,166 +1,166 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT(sid.h) - -dnl Use Automake -AM_INIT_AUTOMAKE(resid, 0.16vice) -LTVERSION=5:0:0 - -dnl Use C++ for tests. -AC_LANG_CPLUSPLUS - -dnl Enable inlining. -AC_ARG_ENABLE(inline, -[ --enable-inline enable inlining of functions [default=yes]]) -AC_ARG_ENABLE(sse, -[ --enable-sse enable the use of SSE [default=yes]]) - -if test "$enable_inline" != no; then - RESID_INLINE=inline -else - RESID_INLINE= -fi - -AC_SUBST(RESID_INLINE) - -dnl Checks for programs. -AC_PROG_CXX - -dnl Set CXXFLAGS for g++. Use -msse if supported. -if test x"$enable_sse" != "xno"; then - if test "$GXX" = yes; then - if test "$ac_test_CXXFLAGS" != set; then - CXXFLAGS="-g -Wall -O2 -msse" - AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works]) - AC_TRY_COMPILE([], - [int test;], - [ AC_MSG_RESULT(yes) - MSSE="-msse" - ], - [ AC_MSG_RESULT(no) - MSSE="" - ]) - fi - fi -else - MSSE="" -fi - -dnl Set CXXFLAGS for g++. Use -fno-exceptions if supported. -if test "$GXX" = yes; then - if test "$ac_test_CXXFLAGS" != set; then - CXXFLAGS="-g -Wall -O2 $MSSE -fno-exceptions" - AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works]) - AC_TRY_COMPILE([], - [int test;], - [ AC_MSG_RESULT(yes) - NO_EXCEPTIONS="-fno-exceptions" ], - [ AC_MSG_RESULT(no) - NO_EXCEPTIONS="" - ]) - fi -fi - -dnl Set CXXFLAGS for g++. Use -fno-pic if supported. -if test "$GXX" = yes; then - if test "$ac_test_CXXFLAGS" != set; then - CXXFLAGS="-g -Wall -O2 $MSSE -fno-exceptions $NO_EXCEPTIONS -fno-pic" - AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works]) - AC_TRY_COMPILE([], - [int test;], - [ AC_MSG_RESULT(yes) - NO_PIC="-fno-pic" ], - [ AC_MSG_RESULT(no) - NO_PIC="" - ]) - fi -fi - -CXXFLAGS="-g -Wall -O2 $MSSE $NO_EXCEPTIONS $NO_PIC" -if test x"$MSSE" = "x-msse"; then - AC_MSG_CHECKING([if the xmmintrin.h include can be used]) - AC_TRY_COMPILE([#include ], - [int test;], - [ AC_MSG_RESULT(yes) - ], - [ AC_MSG_RESULT(no) - MSSE="" - ]) - CXXFLAGS="-g -Wall -O2 $NO_EXCEPTIONS $NO_PIC" -fi - -AC_CHECK_PROG(AR, ar, ar, ar) -AC_PROG_RANLIB -AC_PATH_PROG(PERL, perl) - -dnl Libtool - -dnl AC_DISABLE_SHARED -dnl AM_PROG_LIBTOOL -dnl AC_SUBST(LIBTOOL_DEPS) -dnl AC_SUBST(LTVERSION) - -dnl Checks for libraries. - -dnl Checks for header files. - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_CHECK_SIZEOF(int, 4) - -if test $ac_cv_sizeof_int -lt 4; then - AC_MSG_ERROR([only 32 bit or better CPUs are supported]) -fi - -AC_CACHE_CHECK([for working bool], ac_cv_cxx_bool, -[AC_TRY_COMPILE(, -[ -bool flag; -], -ac_cv_cxx_bool=yes, ac_cv_cxx_bool=no)]) - -if test $ac_cv_cxx_bool = no; then - RESID_HAVE_BOOL=0 -else - RESID_HAVE_BOOL=1 -fi - -if test x"$MSSE" = "x-msse"; then - RESID_USE_SSE=1 - AM_CONDITIONAL(USE_SSE, true) -else - RESID_USE_SSE=0 - AM_CONDITIONAL(USE_SSE, false) -fi - -AC_SUBST(RESID_HAVE_BOOL) -AC_SUBST(RESID_USE_SSE) - -dnl Checks for library functions. - -AC_CHECK_FUNCS(logf expf) - -AC_MSG_CHECKING([if the logf prototype is present]) -AC_TRY_COMPILE([#include - #include ], - [printf("%d",logf);], - [ AC_MSG_RESULT(yes) - HAVE_LOGF_PROTOTYPE=1 - ], - [ AC_MSG_RESULT(no) - HAVE_LOGF_PROTOTYPE=0 - ]) - -AC_MSG_CHECKING([if the expf prototype is present]) -AC_TRY_COMPILE([#include - #include ], - [printf("%d",expf);], - [ AC_MSG_RESULT(yes) - HAVE_EXPF_PROTOTYPE=1 - ], - [ AC_MSG_RESULT(no) - HAVE_EXPF_PROTOTYPE=0 - ]) - -AC_SUBST(HAVE_LOGF_PROTOTYPE) -AC_SUBST(HAVE_EXPF_PROTOTYPE) - -AC_OUTPUT(Makefile siddefs-fp.h) +dnl Process this file with autoconf to produce a configure script. +AC_INIT(sid.h) + +dnl Use Automake +AM_INIT_AUTOMAKE(resid, 0.16vice) +LTVERSION=5:0:0 + +dnl Use C++ for tests. +AC_LANG_CPLUSPLUS + +dnl Enable inlining. +AC_ARG_ENABLE(inline, +[ --enable-inline enable inlining of functions [default=yes]]) +AC_ARG_ENABLE(sse, +[ --enable-sse enable the use of SSE [default=yes]]) + +if test "$enable_inline" != no; then + RESID_INLINE=inline +else + RESID_INLINE= +fi + +AC_SUBST(RESID_INLINE) + +dnl Checks for programs. +AC_PROG_CXX + +dnl Set CXXFLAGS for g++. Use -msse if supported. +if test x"$enable_sse" != "xno"; then + if test "$GXX" = yes; then + if test "$ac_test_CXXFLAGS" != set; then + CXXFLAGS="-g -Wall -O2 -msse" + AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works]) + AC_TRY_COMPILE([], + [int test;], + [ AC_MSG_RESULT(yes) + MSSE="-msse" + ], + [ AC_MSG_RESULT(no) + MSSE="" + ]) + fi + fi +else + MSSE="" +fi + +dnl Set CXXFLAGS for g++. Use -fno-exceptions if supported. +if test "$GXX" = yes; then + if test "$ac_test_CXXFLAGS" != set; then + CXXFLAGS="-g -Wall -O2 $MSSE -fno-exceptions" + AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works]) + AC_TRY_COMPILE([], + [int test;], + [ AC_MSG_RESULT(yes) + NO_EXCEPTIONS="-fno-exceptions" ], + [ AC_MSG_RESULT(no) + NO_EXCEPTIONS="" + ]) + fi +fi + +dnl Set CXXFLAGS for g++. Use -fno-pic if supported. +if test "$GXX" = yes; then + if test "$ac_test_CXXFLAGS" != set; then + CXXFLAGS="-g -Wall -O2 $MSSE -fno-exceptions $NO_EXCEPTIONS -fno-pic" + AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works]) + AC_TRY_COMPILE([], + [int test;], + [ AC_MSG_RESULT(yes) + NO_PIC="-fno-pic" ], + [ AC_MSG_RESULT(no) + NO_PIC="" + ]) + fi +fi + +CXXFLAGS="-g -Wall -O2 $MSSE $NO_EXCEPTIONS $NO_PIC" +if test x"$MSSE" = "x-msse"; then + AC_MSG_CHECKING([if the xmmintrin.h include can be used]) + AC_TRY_COMPILE([#include ], + [int test;], + [ AC_MSG_RESULT(yes) + ], + [ AC_MSG_RESULT(no) + MSSE="" + ]) + CXXFLAGS="-g -Wall -O2 $NO_EXCEPTIONS $NO_PIC" +fi + +AC_CHECK_PROG(AR, ar, ar, ar) +AC_PROG_RANLIB +AC_PATH_PROG(PERL, perl) + +dnl Libtool + +dnl AC_DISABLE_SHARED +dnl AM_PROG_LIBTOOL +dnl AC_SUBST(LIBTOOL_DEPS) +dnl AC_SUBST(LTVERSION) + +dnl Checks for libraries. + +dnl Checks for header files. + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_CHECK_SIZEOF(int, 4) + +if test $ac_cv_sizeof_int -lt 4; then + AC_MSG_ERROR([only 32 bit or better CPUs are supported]) +fi + +AC_CACHE_CHECK([for working bool], ac_cv_cxx_bool, +[AC_TRY_COMPILE(, +[ +bool flag; +], +ac_cv_cxx_bool=yes, ac_cv_cxx_bool=no)]) + +if test $ac_cv_cxx_bool = no; then + RESID_HAVE_BOOL=0 +else + RESID_HAVE_BOOL=1 +fi + +if test x"$MSSE" = "x-msse"; then + RESID_USE_SSE=1 + AM_CONDITIONAL(USE_SSE, true) +else + RESID_USE_SSE=0 + AM_CONDITIONAL(USE_SSE, false) +fi + +AC_SUBST(RESID_HAVE_BOOL) +AC_SUBST(RESID_USE_SSE) + +dnl Checks for library functions. + +AC_CHECK_FUNCS(logf expf) + +AC_MSG_CHECKING([if the logf prototype is present]) +AC_TRY_COMPILE([#include + #include ], + [printf("%d",logf);], + [ AC_MSG_RESULT(yes) + HAVE_LOGF_PROTOTYPE=1 + ], + [ AC_MSG_RESULT(no) + HAVE_LOGF_PROTOTYPE=0 + ]) + +AC_MSG_CHECKING([if the expf prototype is present]) +AC_TRY_COMPILE([#include + #include ], + [printf("%d",expf);], + [ AC_MSG_RESULT(yes) + HAVE_EXPF_PROTOTYPE=1 + ], + [ AC_MSG_RESULT(no) + HAVE_EXPF_PROTOTYPE=0 + ]) + +AC_SUBST(HAVE_LOGF_PROTOTYPE) +AC_SUBST(HAVE_EXPF_PROTOTYPE) + +AC_OUTPUT(Makefile siddefs-fp.h) diff --git a/src/resid-fp/convolve-sse.cc b/src/resid-fp/convolve-sse.cc index a64dfd21..708a2ade 100644 --- a/src/resid-fp/convolve-sse.cc +++ b/src/resid-fp/convolve-sse.cc @@ -1,76 +1,76 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 "sid.h" - -#if (RESID_USE_SSE==1) - -#include - -float convolve_sse(const float *a, const float *b, int n) -{ - float out = 0.f; - __m128 out4 = { 0, 0, 0, 0 }; - - /* examine if we can use aligned loads on both pointers */ - int diff = (int) (a - b) & 0xf; - /* long cast is no-op for x86-32, but x86-64 gcc needs 64 bit intermediate - * to convince compiler we mean this. */ - unsigned int a_align = (unsigned int) (unsigned long) a & 0xf; - - /* advance if necessary. We can't let n fall < 0, so no while (n --). */ - while (n > 0 && a_align != 0 && a_align != 16) { - out += (*(a ++)) * (*(b ++)); - --n; - a_align += 4; - } - - int n4 = n / 4; - if (diff == 0) { - for (int i = 0; i < n4; i ++) { - out4 = _mm_add_ps(out4, _mm_mul_ps(_mm_load_ps(a), _mm_load_ps(b))); - a += 4; - b += 4; - } - } else { - /* XXX loadu is 4x slower than load, at least. We could at 4x memory - * use prepare versions of b aligned for any a alignment. We could - * also issue aligned loads and shuffle the halves at each iteration. - * Initial results indicate only very small improvements. */ - for (int i = 0; i < n4; i ++) { - out4 = _mm_add_ps(out4, _mm_mul_ps(_mm_load_ps(a), _mm_loadu_ps(b))); - a += 4; - b += 4; - } - } - - out4 = _mm_add_ps(_mm_movehl_ps(out4, out4), out4); - out4 = _mm_add_ss(_mm_shuffle_ps(out4, out4, 1), out4); - float out_tmp; - _mm_store_ss(&out_tmp, out4); - out += out_tmp; - - n &= 3; - - while (n --) - out += (*(a ++)) * (*(b ++)); - - return out; -} -#endif +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 "sid.h" + +#if (RESID_USE_SSE==1) + +#include + +float convolve_sse(const float *a, const float *b, int n) +{ + float out = 0.f; + __m128 out4 = { 0, 0, 0, 0 }; + + /* examine if we can use aligned loads on both pointers */ + int diff = (int) (a - b) & 0xf; + /* long cast is no-op for x86-32, but x86-64 gcc needs 64 bit intermediate + * to convince compiler we mean this. */ + unsigned int a_align = (unsigned int) (unsigned long) a & 0xf; + + /* advance if necessary. We can't let n fall < 0, so no while (n --). */ + while (n > 0 && a_align != 0 && a_align != 16) { + out += (*(a ++)) * (*(b ++)); + --n; + a_align += 4; + } + + int n4 = n / 4; + if (diff == 0) { + for (int i = 0; i < n4; i ++) { + out4 = _mm_add_ps(out4, _mm_mul_ps(_mm_load_ps(a), _mm_load_ps(b))); + a += 4; + b += 4; + } + } else { + /* XXX loadu is 4x slower than load, at least. We could at 4x memory + * use prepare versions of b aligned for any a alignment. We could + * also issue aligned loads and shuffle the halves at each iteration. + * Initial results indicate only very small improvements. */ + for (int i = 0; i < n4; i ++) { + out4 = _mm_add_ps(out4, _mm_mul_ps(_mm_load_ps(a), _mm_loadu_ps(b))); + a += 4; + b += 4; + } + } + + out4 = _mm_add_ps(_mm_movehl_ps(out4, out4), out4); + out4 = _mm_add_ss(_mm_shuffle_ps(out4, out4, 1), out4); + float out_tmp; + _mm_store_ss(&out_tmp, out4); + out += out_tmp; + + n &= 3; + + while (n --) + out += (*(a ++)) * (*(b ++)); + + return out; +} +#endif diff --git a/src/resid-fp/convolve.cc b/src/resid-fp/convolve.cc index b028ace8..6b6468a3 100644 --- a/src/resid-fp/convolve.cc +++ b/src/resid-fp/convolve.cc @@ -1,27 +1,27 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// --------------------------------------------------------------------------- - -float convolve(const float *a, const float *b, int n) -{ - float out = 0.f; - while (n --) - out += (*(a ++)) * (*(b ++)); - return out; -} - +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// --------------------------------------------------------------------------- + +float convolve(const float *a, const float *b, int n) +{ + float out = 0.f; + while (n --) + out += (*(a ++)) * (*(b ++)); + return out; +} + diff --git a/src/resid-fp/envelope.cc b/src/resid-fp/envelope.cc index 61e6ae38..8048add1 100644 --- a/src/resid-fp/envelope.cc +++ b/src/resid-fp/envelope.cc @@ -1,254 +1,254 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 __ENVELOPE_CC__ -#include "envelope.h" - -// ---------------------------------------------------------------------------- -// Constructor. -// ---------------------------------------------------------------------------- -EnvelopeGeneratorFP::EnvelopeGeneratorFP() -{ - reset(); -} - -// ---------------------------------------------------------------------------- -// SID reset. -// ---------------------------------------------------------------------------- -void EnvelopeGeneratorFP::reset() -{ - envelope_counter = 0; - - attack = 0; - decay = 0; - sustain = 0; - release = 0; - - gate = 0; - - rate_counter = 0; - exponential_counter = 0; - exponential_counter_period = 1; - - state = RELEASE; - rate_period = rate_counter_period[release]; - hold_zero = true; -} - - -// Rate counter periods are calculated from the Envelope Rates table in -// the Programmer's Reference Guide. The rate counter period is the number of -// cycles between each increment of the envelope counter. -// The rates have been verified by sampling ENV3. -// -// The rate counter is a 16 bit register which is incremented each cycle. -// When the counter reaches a specific comparison value, the envelope counter -// is incremented (attack) or decremented (decay/release) and the -// counter is zeroed. -// -// NB! Sampling ENV3 shows that the calculated values are not exact. -// It may seem like most calculated values have been rounded (.5 is rounded -// down) and 1 has beed added to the result. A possible explanation for this -// is that the SID designers have used the calculated values directly -// as rate counter comparison values, not considering a one cycle delay to -// zero the counter. This would yield an actual period of comparison value + 1. -// -// The time of the first envelope count can not be exactly controlled, except -// possibly by resetting the chip. Because of this we cannot do cycle exact -// sampling and must devise another method to calculate the rate counter -// periods. -// -// The exact rate counter periods can be determined e.g. by counting the number -// of cycles from envelope level 1 to envelope level 129, and dividing the -// number of cycles by 128. CIA1 timer A and B in linked mode can perform -// the cycle count. This is the method used to find the rates below. -// -// To avoid the ADSR delay bug, sampling of ENV3 should be done using -// sustain = release = 0. This ensures that the attack state will not lower -// the current rate counter period. -// -// The ENV3 sampling code below yields a maximum timing error of 14 cycles. -// lda #$01 -// l1: cmp $d41c -// bne l1 -// ... -// lda #$ff -// l2: cmp $d41c -// bne l2 -// -// This yields a maximum error for the calculated rate period of 14/128 cycles. -// The described method is thus sufficient for exact calculation of the rate -// periods. -// -reg16 EnvelopeGeneratorFP::rate_counter_period[] = { - 9, // 2ms*1.0MHz/256 = 7.81 - 32, // 8ms*1.0MHz/256 = 31.25 - 63, // 16ms*1.0MHz/256 = 62.50 - 95, // 24ms*1.0MHz/256 = 93.75 - 149, // 38ms*1.0MHz/256 = 148.44 - 220, // 56ms*1.0MHz/256 = 218.75 - 267, // 68ms*1.0MHz/256 = 265.63 - 313, // 80ms*1.0MHz/256 = 312.50 - 392, // 100ms*1.0MHz/256 = 390.63 - 977, // 250ms*1.0MHz/256 = 976.56 - 1954, // 500ms*1.0MHz/256 = 1953.13 - 3126, // 800ms*1.0MHz/256 = 3125.00 - 3907, // 1 s*1.0MHz/256 = 3906.25 - 11720, // 3 s*1.0MHz/256 = 11718.75 - 19532, // 5 s*1.0MHz/256 = 19531.25 - 31251 // 8 s*1.0MHz/256 = 31250.00 -}; - - -// For decay and release, the clock to the envelope counter is sequentially -// divided by 1, 2, 4, 8, 16, 30, 1 to create a piece-wise linear approximation -// of an exponential. The exponential counter period is loaded at the envelope -// counter values 255, 93, 54, 26, 14, 6, 0. The period can be different for the -// same envelope counter value, depending on whether the envelope has been -// rising (attack -> release) or sinking (decay/release). -// -// Since it is not possible to reset the rate counter (the test bit has no -// influence on the envelope generator whatsoever) a method must be devised to -// do cycle exact sampling of ENV3 to do the investigation. This is possible -// with knowledge of the rate period for A=0, found above. -// -// The CPU can be synchronized with ENV3 by first synchronizing with the rate -// counter by setting A=0 and wait in a carefully timed loop for the envelope -// counter _not_ to change for 9 cycles. We can then wait for a specific value -// of ENV3 with another timed loop to fully synchronize with ENV3. -// -// At the first period when an exponential counter period larger than one -// is used (decay or relase), one extra cycle is spent before the envelope is -// decremented. The envelope output is then delayed one cycle until the state -// is changed to attack. Now one cycle less will be spent before the envelope -// is incremented, and the situation is normalized. -// The delay is probably caused by the comparison with the exponential counter, -// and does not seem to affect the rate counter. This has been verified by -// timing 256 consecutive complete envelopes with A = D = R = 1, S = 0, using -// CIA1 timer A and B in linked mode. If the rate counter is not affected the -// period of each complete envelope is -// (255 + 162*1 + 39*2 + 28*4 + 12*8 + 8*16 + 6*30)*32 = 756*32 = 32352 -// which corresponds exactly to the timed value divided by the number of -// complete envelopes. -// NB! This one cycle delay is not modeled. - - -// From the sustain levels it follows that both the low and high 4 bits of the -// envelope counter are compared to the 4-bit sustain value. -// This has been verified by sampling ENV3. -// -reg8 EnvelopeGeneratorFP::sustain_level[] = { - 0x00, - 0x11, - 0x22, - 0x33, - 0x44, - 0x55, - 0x66, - 0x77, - 0x88, - 0x99, - 0xaa, - 0xbb, - 0xcc, - 0xdd, - 0xee, - 0xff, -}; - - -// ---------------------------------------------------------------------------- -// Register functions. -// ---------------------------------------------------------------------------- -void EnvelopeGeneratorFP::writeCONTROL_REG(reg8 control) -{ - reg8 gate_next = control & 0x01; - - // The rate counter is never reset, thus there will be a delay before the - // envelope counter starts counting up (attack) or down (release). - - // Gate bit on: Start attack, decay, sustain. - if (!gate && gate_next) { - state = ATTACK; - update_rate_period(rate_counter_period[attack]); - - // Switching to attack state unlocks the zero freeze. - hold_zero = false; - } - // Gate bit off: Start release. - else if (gate && !gate_next) { - state = RELEASE; - update_rate_period(rate_counter_period[release]); - } - - gate = gate_next; -} - -void EnvelopeGeneratorFP::writeATTACK_DECAY(reg8 attack_decay) -{ - attack = (attack_decay >> 4) & 0x0f; - decay = attack_decay & 0x0f; - if (state == ATTACK) { - update_rate_period(rate_counter_period[attack]); - } - else if (state == DECAY_SUSTAIN) { - update_rate_period(rate_counter_period[decay]); - } -} - -void EnvelopeGeneratorFP::writeSUSTAIN_RELEASE(reg8 sustain_release) -{ - sustain = (sustain_release >> 4) & 0x0f; - release = sustain_release & 0x0f; - if (state == RELEASE) { - update_rate_period(rate_counter_period[release]); - } -} - -reg8 EnvelopeGeneratorFP::readENV() -{ - return output(); -} - -void EnvelopeGeneratorFP::update_rate_period(reg16 newperiod) -{ - rate_period = newperiod; - - /* The ADSR counter is XOR shift register with 0x7fff unique values. - * If the rate_period is adjusted to a value already seen in this cycle, - * the register will wrap around. This is known as the ADSR delay bug. - * - * To simplify the hot path calculation, we simulate this through observing - * that we add the 0x7fff cycle delay by changing the rate_counter variable - * directly. This takes care of the 99 % common case. However, playroutine - * could make multiple consequtive rate_period adjustments, in which case we - * need to cancel the previous adjustment. */ - - /* if the new period exeecds 0x7fff, we need to wrap */ - if (rate_period - rate_counter > 0x7fff) - rate_counter += 0x7fff; - - /* simulate 0x7fff wraparound, if the period-to-be-written - * is less than the current value. */ - if (rate_period <= rate_counter) - rate_counter -= 0x7fff; - - /* at this point it should be impossible for - * rate_counter >= rate_period. If it is, there is a bug... */ -} +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 __ENVELOPE_CC__ +#include "envelope.h" + +// ---------------------------------------------------------------------------- +// Constructor. +// ---------------------------------------------------------------------------- +EnvelopeGeneratorFP::EnvelopeGeneratorFP() +{ + reset(); +} + +// ---------------------------------------------------------------------------- +// SID reset. +// ---------------------------------------------------------------------------- +void EnvelopeGeneratorFP::reset() +{ + envelope_counter = 0; + + attack = 0; + decay = 0; + sustain = 0; + release = 0; + + gate = 0; + + rate_counter = 0; + exponential_counter = 0; + exponential_counter_period = 1; + + state = RELEASE; + rate_period = rate_counter_period[release]; + hold_zero = true; +} + + +// Rate counter periods are calculated from the Envelope Rates table in +// the Programmer's Reference Guide. The rate counter period is the number of +// cycles between each increment of the envelope counter. +// The rates have been verified by sampling ENV3. +// +// The rate counter is a 16 bit register which is incremented each cycle. +// When the counter reaches a specific comparison value, the envelope counter +// is incremented (attack) or decremented (decay/release) and the +// counter is zeroed. +// +// NB! Sampling ENV3 shows that the calculated values are not exact. +// It may seem like most calculated values have been rounded (.5 is rounded +// down) and 1 has beed added to the result. A possible explanation for this +// is that the SID designers have used the calculated values directly +// as rate counter comparison values, not considering a one cycle delay to +// zero the counter. This would yield an actual period of comparison value + 1. +// +// The time of the first envelope count can not be exactly controlled, except +// possibly by resetting the chip. Because of this we cannot do cycle exact +// sampling and must devise another method to calculate the rate counter +// periods. +// +// The exact rate counter periods can be determined e.g. by counting the number +// of cycles from envelope level 1 to envelope level 129, and dividing the +// number of cycles by 128. CIA1 timer A and B in linked mode can perform +// the cycle count. This is the method used to find the rates below. +// +// To avoid the ADSR delay bug, sampling of ENV3 should be done using +// sustain = release = 0. This ensures that the attack state will not lower +// the current rate counter period. +// +// The ENV3 sampling code below yields a maximum timing error of 14 cycles. +// lda #$01 +// l1: cmp $d41c +// bne l1 +// ... +// lda #$ff +// l2: cmp $d41c +// bne l2 +// +// This yields a maximum error for the calculated rate period of 14/128 cycles. +// The described method is thus sufficient for exact calculation of the rate +// periods. +// +reg16 EnvelopeGeneratorFP::rate_counter_period[] = { + 9, // 2ms*1.0MHz/256 = 7.81 + 32, // 8ms*1.0MHz/256 = 31.25 + 63, // 16ms*1.0MHz/256 = 62.50 + 95, // 24ms*1.0MHz/256 = 93.75 + 149, // 38ms*1.0MHz/256 = 148.44 + 220, // 56ms*1.0MHz/256 = 218.75 + 267, // 68ms*1.0MHz/256 = 265.63 + 313, // 80ms*1.0MHz/256 = 312.50 + 392, // 100ms*1.0MHz/256 = 390.63 + 977, // 250ms*1.0MHz/256 = 976.56 + 1954, // 500ms*1.0MHz/256 = 1953.13 + 3126, // 800ms*1.0MHz/256 = 3125.00 + 3907, // 1 s*1.0MHz/256 = 3906.25 + 11720, // 3 s*1.0MHz/256 = 11718.75 + 19532, // 5 s*1.0MHz/256 = 19531.25 + 31251 // 8 s*1.0MHz/256 = 31250.00 +}; + + +// For decay and release, the clock to the envelope counter is sequentially +// divided by 1, 2, 4, 8, 16, 30, 1 to create a piece-wise linear approximation +// of an exponential. The exponential counter period is loaded at the envelope +// counter values 255, 93, 54, 26, 14, 6, 0. The period can be different for the +// same envelope counter value, depending on whether the envelope has been +// rising (attack -> release) or sinking (decay/release). +// +// Since it is not possible to reset the rate counter (the test bit has no +// influence on the envelope generator whatsoever) a method must be devised to +// do cycle exact sampling of ENV3 to do the investigation. This is possible +// with knowledge of the rate period for A=0, found above. +// +// The CPU can be synchronized with ENV3 by first synchronizing with the rate +// counter by setting A=0 and wait in a carefully timed loop for the envelope +// counter _not_ to change for 9 cycles. We can then wait for a specific value +// of ENV3 with another timed loop to fully synchronize with ENV3. +// +// At the first period when an exponential counter period larger than one +// is used (decay or relase), one extra cycle is spent before the envelope is +// decremented. The envelope output is then delayed one cycle until the state +// is changed to attack. Now one cycle less will be spent before the envelope +// is incremented, and the situation is normalized. +// The delay is probably caused by the comparison with the exponential counter, +// and does not seem to affect the rate counter. This has been verified by +// timing 256 consecutive complete envelopes with A = D = R = 1, S = 0, using +// CIA1 timer A and B in linked mode. If the rate counter is not affected the +// period of each complete envelope is +// (255 + 162*1 + 39*2 + 28*4 + 12*8 + 8*16 + 6*30)*32 = 756*32 = 32352 +// which corresponds exactly to the timed value divided by the number of +// complete envelopes. +// NB! This one cycle delay is not modeled. + + +// From the sustain levels it follows that both the low and high 4 bits of the +// envelope counter are compared to the 4-bit sustain value. +// This has been verified by sampling ENV3. +// +reg8 EnvelopeGeneratorFP::sustain_level[] = { + 0x00, + 0x11, + 0x22, + 0x33, + 0x44, + 0x55, + 0x66, + 0x77, + 0x88, + 0x99, + 0xaa, + 0xbb, + 0xcc, + 0xdd, + 0xee, + 0xff, +}; + + +// ---------------------------------------------------------------------------- +// Register functions. +// ---------------------------------------------------------------------------- +void EnvelopeGeneratorFP::writeCONTROL_REG(reg8 control) +{ + reg8 gate_next = control & 0x01; + + // The rate counter is never reset, thus there will be a delay before the + // envelope counter starts counting up (attack) or down (release). + + // Gate bit on: Start attack, decay, sustain. + if (!gate && gate_next) { + state = ATTACK; + update_rate_period(rate_counter_period[attack]); + + // Switching to attack state unlocks the zero freeze. + hold_zero = false; + } + // Gate bit off: Start release. + else if (gate && !gate_next) { + state = RELEASE; + update_rate_period(rate_counter_period[release]); + } + + gate = gate_next; +} + +void EnvelopeGeneratorFP::writeATTACK_DECAY(reg8 attack_decay) +{ + attack = (attack_decay >> 4) & 0x0f; + decay = attack_decay & 0x0f; + if (state == ATTACK) { + update_rate_period(rate_counter_period[attack]); + } + else if (state == DECAY_SUSTAIN) { + update_rate_period(rate_counter_period[decay]); + } +} + +void EnvelopeGeneratorFP::writeSUSTAIN_RELEASE(reg8 sustain_release) +{ + sustain = (sustain_release >> 4) & 0x0f; + release = sustain_release & 0x0f; + if (state == RELEASE) { + update_rate_period(rate_counter_period[release]); + } +} + +reg8 EnvelopeGeneratorFP::readENV() +{ + return output(); +} + +void EnvelopeGeneratorFP::update_rate_period(reg16 newperiod) +{ + rate_period = newperiod; + + /* The ADSR counter is XOR shift register with 0x7fff unique values. + * If the rate_period is adjusted to a value already seen in this cycle, + * the register will wrap around. This is known as the ADSR delay bug. + * + * To simplify the hot path calculation, we simulate this through observing + * that we add the 0x7fff cycle delay by changing the rate_counter variable + * directly. This takes care of the 99 % common case. However, playroutine + * could make multiple consequtive rate_period adjustments, in which case we + * need to cancel the previous adjustment. */ + + /* if the new period exeecds 0x7fff, we need to wrap */ + if (rate_period - rate_counter > 0x7fff) + rate_counter += 0x7fff; + + /* simulate 0x7fff wraparound, if the period-to-be-written + * is less than the current value. */ + if (rate_period <= rate_counter) + rate_counter -= 0x7fff; + + /* at this point it should be impossible for + * rate_counter >= rate_period. If it is, there is a bug... */ +} diff --git a/src/resid-fp/envelope.h b/src/resid-fp/envelope.h index af0764cc..675ec503 100644 --- a/src/resid-fp/envelope.h +++ b/src/resid-fp/envelope.h @@ -1,174 +1,174 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 __ENVELOPE_H__ -#define __ENVELOPE_H__ - -#include "siddefs-fp.h" - -// ---------------------------------------------------------------------------- -// A 15 bit counter is used to implement the envelope rates, in effect -// dividing the clock to the envelope counter by the currently selected rate -// period. -// In addition, another counter is used to implement the exponential envelope -// decay, in effect further dividing the clock to the envelope counter. -// The period of this counter is set to 1, 2, 4, 8, 16, 30 at the envelope -// counter values 255, 93, 54, 26, 14, 6, respectively. -// ---------------------------------------------------------------------------- -class EnvelopeGeneratorFP -{ -public: - EnvelopeGeneratorFP(); - - enum State { ATTACK, DECAY_SUSTAIN, RELEASE }; - - RESID_INLINE void clock(); - void reset(); - - void writeCONTROL_REG(reg8); - void writeATTACK_DECAY(reg8); - void writeSUSTAIN_RELEASE(reg8); - reg8 readENV(); - - // 8-bit envelope output. - RESID_INLINE reg8 output(); - -protected: - void update_rate_period(reg16 period); - - int rate_counter; - int rate_period; - reg8 exponential_counter; - reg8 exponential_counter_period; - reg8 envelope_counter; - bool hold_zero; - - reg4 attack; - reg4 decay; - reg4 sustain; - reg4 release; - - reg8 gate; - - State state; - - // Lookup table to convert from attack, decay, or release value to rate - // counter period. - static reg16 rate_counter_period[]; - - // The 16 selectable sustain levels. - static reg8 sustain_level[]; - -friend class SIDFP; -}; - - -// ---------------------------------------------------------------------------- -// SID clocking - 1 cycle. -// ---------------------------------------------------------------------------- -RESID_INLINE -void EnvelopeGeneratorFP::clock() -{ - if (++ rate_counter != rate_period) - return; - - rate_counter = 0; - - // The first envelope step in the attack state also resets the exponential - // counter. This has been verified by sampling ENV3. - // - if (state == ATTACK || ++exponential_counter == exponential_counter_period) - { - exponential_counter = 0; - - // Check whether the envelope counter is frozen at zero. - if (hold_zero) { - return; - } - - switch (state) { - case ATTACK: - // The envelope counter can flip from 0xff to 0x00 by changing state to - // release, then to attack. The envelope counter is then frozen at - // zero; to unlock this situation the state must be changed to release, - // then to attack. This has been verified by sampling ENV3. - // - ++envelope_counter &= 0xff; - if (envelope_counter == 0xff) { - state = DECAY_SUSTAIN; - update_rate_period(rate_counter_period[decay]); - } - break; - case DECAY_SUSTAIN: - if (envelope_counter != sustain_level[sustain]) { - --envelope_counter; - } - break; - case RELEASE: - // The envelope counter can flip from 0x00 to 0xff by changing state to - // attack, then to release. The envelope counter will then continue - // counting down in the release state. - // This has been verified by sampling ENV3. - // NB! The operation below requires two's complement integer. - // - --envelope_counter &= 0xff; - break; - } - - // Check for change of exponential counter period. - switch (envelope_counter) { - case 0xff: - exponential_counter_period = 1; - break; - case 0x5d: - exponential_counter_period = 2; - break; - case 0x36: - exponential_counter_period = 4; - break; - case 0x1a: - exponential_counter_period = 8; - break; - case 0x0e: - exponential_counter_period = 16; - break; - case 0x06: - exponential_counter_period = 30; - break; - case 0x00: - exponential_counter_period = 1; - - // When the envelope counter is changed to zero, it is frozen at zero. - // This has been verified by sampling ENV3. - hold_zero = true; - break; - } - } -} - -// ---------------------------------------------------------------------------- -// Read the envelope generator output. -// ---------------------------------------------------------------------------- -RESID_INLINE -reg8 EnvelopeGeneratorFP::output() -{ - return envelope_counter; -} - -#endif // not __ENVELOPE_H__ +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 __ENVELOPE_H__ +#define __ENVELOPE_H__ + +#include "siddefs-fp.h" + +// ---------------------------------------------------------------------------- +// A 15 bit counter is used to implement the envelope rates, in effect +// dividing the clock to the envelope counter by the currently selected rate +// period. +// In addition, another counter is used to implement the exponential envelope +// decay, in effect further dividing the clock to the envelope counter. +// The period of this counter is set to 1, 2, 4, 8, 16, 30 at the envelope +// counter values 255, 93, 54, 26, 14, 6, respectively. +// ---------------------------------------------------------------------------- +class EnvelopeGeneratorFP +{ +public: + EnvelopeGeneratorFP(); + + enum State { ATTACK, DECAY_SUSTAIN, RELEASE }; + + RESID_INLINE void clock(); + void reset(); + + void writeCONTROL_REG(reg8); + void writeATTACK_DECAY(reg8); + void writeSUSTAIN_RELEASE(reg8); + reg8 readENV(); + + // 8-bit envelope output. + RESID_INLINE reg8 output(); + +protected: + void update_rate_period(reg16 period); + + int rate_counter; + int rate_period; + reg8 exponential_counter; + reg8 exponential_counter_period; + reg8 envelope_counter; + bool hold_zero; + + reg4 attack; + reg4 decay; + reg4 sustain; + reg4 release; + + reg8 gate; + + State state; + + // Lookup table to convert from attack, decay, or release value to rate + // counter period. + static reg16 rate_counter_period[]; + + // The 16 selectable sustain levels. + static reg8 sustain_level[]; + +friend class SIDFP; +}; + + +// ---------------------------------------------------------------------------- +// SID clocking - 1 cycle. +// ---------------------------------------------------------------------------- +RESID_INLINE +void EnvelopeGeneratorFP::clock() +{ + if (++ rate_counter != rate_period) + return; + + rate_counter = 0; + + // The first envelope step in the attack state also resets the exponential + // counter. This has been verified by sampling ENV3. + // + if (state == ATTACK || ++exponential_counter == exponential_counter_period) + { + exponential_counter = 0; + + // Check whether the envelope counter is frozen at zero. + if (hold_zero) { + return; + } + + switch (state) { + case ATTACK: + // The envelope counter can flip from 0xff to 0x00 by changing state to + // release, then to attack. The envelope counter is then frozen at + // zero; to unlock this situation the state must be changed to release, + // then to attack. This has been verified by sampling ENV3. + // + ++envelope_counter &= 0xff; + if (envelope_counter == 0xff) { + state = DECAY_SUSTAIN; + update_rate_period(rate_counter_period[decay]); + } + break; + case DECAY_SUSTAIN: + if (envelope_counter != sustain_level[sustain]) { + --envelope_counter; + } + break; + case RELEASE: + // The envelope counter can flip from 0x00 to 0xff by changing state to + // attack, then to release. The envelope counter will then continue + // counting down in the release state. + // This has been verified by sampling ENV3. + // NB! The operation below requires two's complement integer. + // + --envelope_counter &= 0xff; + break; + } + + // Check for change of exponential counter period. + switch (envelope_counter) { + case 0xff: + exponential_counter_period = 1; + break; + case 0x5d: + exponential_counter_period = 2; + break; + case 0x36: + exponential_counter_period = 4; + break; + case 0x1a: + exponential_counter_period = 8; + break; + case 0x0e: + exponential_counter_period = 16; + break; + case 0x06: + exponential_counter_period = 30; + break; + case 0x00: + exponential_counter_period = 1; + + // When the envelope counter is changed to zero, it is frozen at zero. + // This has been verified by sampling ENV3. + hold_zero = true; + break; + } + } +} + +// ---------------------------------------------------------------------------- +// Read the envelope generator output. +// ---------------------------------------------------------------------------- +RESID_INLINE +reg8 EnvelopeGeneratorFP::output() +{ + return envelope_counter; +} + +#endif // not __ENVELOPE_H__ diff --git a/src/resid-fp/extfilt.cc b/src/resid-fp/extfilt.cc index 777a23ee..24c4f83e 100644 --- a/src/resid-fp/extfilt.cc +++ b/src/resid-fp/extfilt.cc @@ -1,94 +1,94 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 __EXTFILT_CC__ -#include "extfilt.h" - -// ---------------------------------------------------------------------------- -// Constructor. -// ---------------------------------------------------------------------------- -ExternalFilterFP::ExternalFilterFP() -{ - reset(); - enable_filter(true); - set_chip_model(MOS6581FP); - set_clock_frequency(1e6f); - set_sampling_parameter(15915.6f); -} - - -// ---------------------------------------------------------------------------- -// Enable filter. -// ---------------------------------------------------------------------------- -void ExternalFilterFP::enable_filter(bool enable) -{ - enabled = enable; -} - -// ---------------------------------------------------------------------------- -// Setup of the external filter sampling parameters. -// ---------------------------------------------------------------------------- -void ExternalFilterFP::set_clock_frequency(float clock) -{ - clock_frequency = clock; - _set_sampling_parameter(); -} - -void ExternalFilterFP::set_sampling_parameter(float freq) -{ - pass_frequency = freq; - _set_sampling_parameter(); -} - -void ExternalFilterFP::_set_sampling_parameter() -{ - // Low-pass: R = 10kOhm, C = 1000pF; w0l = 1/RC = 1/(1e4*1e-9) = 100000 - // High-pass: R = 1kOhm, C = 10uF; w0h = 1/RC = 1/(1e3*1e-5) = 100 - w0hp = 100.f / clock_frequency; - w0lp = pass_frequency * 2.f * M_PI_f / clock_frequency; -} - -// ---------------------------------------------------------------------------- -// Set chip model. -// ---------------------------------------------------------------------------- -void ExternalFilterFP::set_chip_model(chip_model model) -{ - if (model == MOS6581FP) { - // Approximate the DC output level to be removed if the external - // filter is turned off. (0x800 - wave_zero + voice DC) * maxenv * voices - // - extin offset... - mixer_DC = (-0x600 + 0x800) * 0xff * 3 - 0x20000; - } - else { - // No DC offsets in the MOS8580. - mixer_DC = 0; - } -} - - -// ---------------------------------------------------------------------------- -// SID reset. -// ---------------------------------------------------------------------------- -void ExternalFilterFP::reset() -{ - // State of filter. - Vlp = 0; - Vhp = 0; - Vo = 0; -} +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 __EXTFILT_CC__ +#include "extfilt.h" + +// ---------------------------------------------------------------------------- +// Constructor. +// ---------------------------------------------------------------------------- +ExternalFilterFP::ExternalFilterFP() +{ + reset(); + enable_filter(true); + set_chip_model(MOS6581FP); + set_clock_frequency(1e6f); + set_sampling_parameter(15915.6f); +} + + +// ---------------------------------------------------------------------------- +// Enable filter. +// ---------------------------------------------------------------------------- +void ExternalFilterFP::enable_filter(bool enable) +{ + enabled = enable; +} + +// ---------------------------------------------------------------------------- +// Setup of the external filter sampling parameters. +// ---------------------------------------------------------------------------- +void ExternalFilterFP::set_clock_frequency(float clock) +{ + clock_frequency = clock; + _set_sampling_parameter(); +} + +void ExternalFilterFP::set_sampling_parameter(float freq) +{ + pass_frequency = freq; + _set_sampling_parameter(); +} + +void ExternalFilterFP::_set_sampling_parameter() +{ + // Low-pass: R = 10kOhm, C = 1000pF; w0l = 1/RC = 1/(1e4*1e-9) = 100000 + // High-pass: R = 1kOhm, C = 10uF; w0h = 1/RC = 1/(1e3*1e-5) = 100 + w0hp = 100.f / clock_frequency; + w0lp = pass_frequency * 2.f * M_PI_f / clock_frequency; +} + +// ---------------------------------------------------------------------------- +// Set chip model. +// ---------------------------------------------------------------------------- +void ExternalFilterFP::set_chip_model(chip_model model) +{ + if (model == MOS6581FP) { + // Approximate the DC output level to be removed if the external + // filter is turned off. (0x800 - wave_zero + voice DC) * maxenv * voices + // - extin offset... + mixer_DC = (-0x600 + 0x800) * 0xff * 3 - 0x20000; + } + else { + // No DC offsets in the MOS8580. + mixer_DC = 0; + } +} + + +// ---------------------------------------------------------------------------- +// SID reset. +// ---------------------------------------------------------------------------- +void ExternalFilterFP::reset() +{ + // State of filter. + Vlp = 0; + Vhp = 0; + Vo = 0; +} diff --git a/src/resid-fp/extfilt.h b/src/resid-fp/extfilt.h index b0e04d3b..50cb4389 100644 --- a/src/resid-fp/extfilt.h +++ b/src/resid-fp/extfilt.h @@ -1,120 +1,120 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 __EXTFILT_H__ -#define __EXTFILT_H__ - -#include - -#include "siddefs-fp.h" - -// ---------------------------------------------------------------------------- -// The audio output stage in a Commodore 64 consists of two STC networks, -// a low-pass filter with 3-dB frequency 16kHz followed by a high-pass -// filter with 3-dB frequency 16Hz (the latter provided an audio equipment -// input impedance of 1kOhm). -// The STC networks are connected with a BJT supposedly meant to act as -// a unity gain buffer, which is not really how it works. A more elaborate -// model would include the BJT, however DC circuit analysis yields BJT -// base-emitter and emitter-base impedances sufficiently low to produce -// additional low-pass and high-pass 3dB-frequencies in the order of hundreds -// of kHz. This calls for a sampling frequency of several MHz, which is far -// too high for practical use. -// ---------------------------------------------------------------------------- -class ExternalFilterFP -{ -public: - ExternalFilterFP(); - - void enable_filter(bool enable); - void set_sampling_parameter(float pass_freq); - void set_chip_model(chip_model model); - void set_clock_frequency(float); - - RESID_INLINE void clock(float Vi); - void reset(); - - // Audio output (20 bits). - RESID_INLINE float output(); - -private: - void _set_sampling_parameter(); - void nuke_denormals(); - - // Filter enabled. - bool enabled; - - // Maximum mixer DC offset. - float mixer_DC; - - // Relevant clocks - float clock_frequency, pass_frequency; - - // State of filters. - float Vlp; // lowpass - float Vhp; // highpass - float Vo; - - // Cutoff frequencies. - float w0lp; - float w0hp; - -friend class SIDFP; -}; - -// ---------------------------------------------------------------------------- -// SID clocking - 1 cycle. -// ---------------------------------------------------------------------------- -RESID_INLINE -void ExternalFilterFP::clock(float Vi) -{ - // This is handy for testing. - if (! enabled) { - // Remove maximum DC level since there is no filter to do it. - Vlp = Vhp = 0.f; - Vo = Vi - mixer_DC; - return; - } - - float dVlp = w0lp * (Vi - Vlp); - float dVhp = w0hp * (Vlp - Vhp); - Vo = Vlp - Vhp; - Vlp += dVlp; - Vhp += dVhp; -} - -// ---------------------------------------------------------------------------- -// Audio output (19.5 bits). -// ---------------------------------------------------------------------------- -RESID_INLINE -float ExternalFilterFP::output() -{ - return Vo; -} - -RESID_INLINE -void ExternalFilterFP::nuke_denormals() -{ - if (Vhp > -1e-12f && Vhp < 1e-12f) - Vhp = 0; - if (Vlp > -1e-12f && Vlp < 1e-12f) - Vlp = 0; -} - -#endif // not __EXTFILT_H__ +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 __EXTFILT_H__ +#define __EXTFILT_H__ + +#include + +#include "siddefs-fp.h" + +// ---------------------------------------------------------------------------- +// The audio output stage in a Commodore 64 consists of two STC networks, +// a low-pass filter with 3-dB frequency 16kHz followed by a high-pass +// filter with 3-dB frequency 16Hz (the latter provided an audio equipment +// input impedance of 1kOhm). +// The STC networks are connected with a BJT supposedly meant to act as +// a unity gain buffer, which is not really how it works. A more elaborate +// model would include the BJT, however DC circuit analysis yields BJT +// base-emitter and emitter-base impedances sufficiently low to produce +// additional low-pass and high-pass 3dB-frequencies in the order of hundreds +// of kHz. This calls for a sampling frequency of several MHz, which is far +// too high for practical use. +// ---------------------------------------------------------------------------- +class ExternalFilterFP +{ +public: + ExternalFilterFP(); + + void enable_filter(bool enable); + void set_sampling_parameter(float pass_freq); + void set_chip_model(chip_model model); + void set_clock_frequency(float); + + RESID_INLINE void clock(float Vi); + void reset(); + + // Audio output (20 bits). + RESID_INLINE float output(); + +private: + void _set_sampling_parameter(); + void nuke_denormals(); + + // Filter enabled. + bool enabled; + + // Maximum mixer DC offset. + float mixer_DC; + + // Relevant clocks + float clock_frequency, pass_frequency; + + // State of filters. + float Vlp; // lowpass + float Vhp; // highpass + float Vo; + + // Cutoff frequencies. + float w0lp; + float w0hp; + +friend class SIDFP; +}; + +// ---------------------------------------------------------------------------- +// SID clocking - 1 cycle. +// ---------------------------------------------------------------------------- +RESID_INLINE +void ExternalFilterFP::clock(float Vi) +{ + // This is handy for testing. + if (! enabled) { + // Remove maximum DC level since there is no filter to do it. + Vlp = Vhp = 0.f; + Vo = Vi - mixer_DC; + return; + } + + float dVlp = w0lp * (Vi - Vlp); + float dVhp = w0hp * (Vlp - Vhp); + Vo = Vlp - Vhp; + Vlp += dVlp; + Vhp += dVhp; +} + +// ---------------------------------------------------------------------------- +// Audio output (19.5 bits). +// ---------------------------------------------------------------------------- +RESID_INLINE +float ExternalFilterFP::output() +{ + return Vo; +} + +RESID_INLINE +void ExternalFilterFP::nuke_denormals() +{ + if (Vhp > -1e-12f && Vhp < 1e-12f) + Vhp = 0; + if (Vlp > -1e-12f && Vlp < 1e-12f) + Vlp = 0; +} + +#endif // not __EXTFILT_H__ diff --git a/src/resid-fp/filter.cc b/src/resid-fp/filter.cc index 20f91755..e828d932 100644 --- a/src/resid-fp/filter.cc +++ b/src/resid-fp/filter.cc @@ -1,194 +1,194 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// --------------------------------------------------------------------------- -// Filter distortion code written by Antti S. Lankila 2007 - 2008. - -#define __FILTER_CC__ -#include "filter.h" -#include "sid.h" - -#ifndef HAVE_LOGF_PROTOTYPE -extern float logf(float val); -#endif - -#ifndef HAVE_EXPF_PROTOTYPE -extern float expf(float val); -#endif - -#ifndef HAVE_LOGF -float logf(float val) -{ - return (float)log((double)val); -} -#endif - -#ifndef HAVE_EXPF -float expf(float val) -{ - return (float)exp((double)val); -} -#endif - -// ---------------------------------------------------------------------------- -// Constructor. -// ---------------------------------------------------------------------------- -FilterFP::FilterFP() -{ - model = (chip_model) 0; // neither 6581/8580; init time only - enable_filter(true); - /* approximate; sid.cc calls us when set_sampling_parameters() occurs. */ - set_clock_frequency(1e6f); - /* these parameters are a work-in-progress. */ - set_distortion_properties(2.5e-3f, 1536.f, 1e-4f); - /* sound similar to alankila6581r4ar3789 */ - set_type3_properties(1.40e6f, 1.47e8f, 1.0059f, 1.55e4f); - /* sound similar to trurl8580r5_3691 */ - set_type4_properties(6.55f, 20.f); - reset(); - set_chip_model(MOS6581FP); -} - - -// ---------------------------------------------------------------------------- -// Enable filter. -// ---------------------------------------------------------------------------- -void FilterFP::enable_filter(bool enable) -{ - enabled = enable; -} - - -// ---------------------------------------------------------------------------- -// Set chip model. -// ---------------------------------------------------------------------------- -void FilterFP::set_chip_model(chip_model model) -{ - this->model = model; - set_Q(); - set_w0(); -} - -/* dist_CT eliminates 1/x at hot spot */ -void FilterFP::set_clock_frequency(float clock) { - clock_frequency = clock; - calculate_helpers(); -} - -void FilterFP::set_distortion_properties(float r, float p, float cft) -{ - distortion_rate = r; - distortion_point = p; - /* baseresistance is used to determine material resistivity later */ - distortion_cf_threshold = cft; - calculate_helpers(); -} - -void FilterFP::set_type4_properties(float k, float b) -{ - type4_k = k; - type4_b = b; -} - -void FilterFP::set_type3_properties(float br, float o, float s, float mfr) -{ - type3_baseresistance = br; - type3_offset = o; - type3_steepness = -logf(s); /* s^x to e^(x*ln(s)), 1/e^x == e^-x. */ - type3_minimumfetresistance = mfr; -} - -void FilterFP::calculate_helpers() -{ - if (clock_frequency != 0.f) - distortion_CT = 1.f / (sidcaps_6581 * clock_frequency); - set_w0(); -} - -// ---------------------------------------------------------------------------- -// SID reset. -// ---------------------------------------------------------------------------- -void FilterFP::reset() -{ - fc = 0; - res = filt = voice3off = hp_bp_lp = 0; - vol = 0; - volf = Vhp = Vbp = Vlp = 0; - set_w0(); - set_Q(); -} - -// ---------------------------------------------------------------------------- -// Register functions. -// ---------------------------------------------------------------------------- -void FilterFP::writeFC_LO(reg8 fc_lo) -{ - fc = (fc & 0x7f8) | (fc_lo & 0x007); - set_w0(); -} - -void FilterFP::writeFC_HI(reg8 fc_hi) -{ - fc = ((fc_hi << 3) & 0x7f8) | (fc & 0x007); - set_w0(); -} - -void FilterFP::writeRES_FILT(reg8 res_filt) -{ - res = (res_filt >> 4) & 0x0f; - set_Q(); - - filt = res_filt & 0x0f; -} - -void FilterFP::writeMODE_VOL(reg8 mode_vol) -{ - voice3off = mode_vol & 0x80; - - hp_bp_lp = (mode_vol >> 4) & 0x07; - - vol = mode_vol & 0x0f; - volf = (float) vol / 15.f; -} - -// Set filter cutoff frequency. -void FilterFP::set_w0() -{ - if (model == MOS6581FP) { - /* div once by extra kinkiness because I fitted the type3 eq with that variant. */ - float type3_fc_kink = SIDFP::kinked_dac(fc, kinkiness, 11) / kinkiness; - type3_fc_kink_exp = type3_offset * expf(type3_fc_kink * type3_steepness); - if (distortion_rate != 0.f) { - type3_fc_distortion_offset_hp = (distortion_point - type3_fc_kink) * (0.5f) / distortion_rate; - type3_fc_distortion_offset_bp = type3_fc_distortion_offset_hp; - } - else { - type3_fc_distortion_offset_bp = 9e9f; - type3_fc_distortion_offset_hp = 9e9f; - } - } - if (model == MOS8580FP) { - type4_w0_cache = type4_w0(); - } -} - -// Set filter resonance. -void FilterFP::set_Q() -{ - float Q = res / 15.f; - _1_div_Q = 1.f / (0.707f + Q * 1.5f); -} +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// --------------------------------------------------------------------------- +// Filter distortion code written by Antti S. Lankila 2007 - 2008. + +#define __FILTER_CC__ +#include "filter.h" +#include "sid.h" + +#ifndef HAVE_LOGF_PROTOTYPE +extern float logf(float val); +#endif + +#ifndef HAVE_EXPF_PROTOTYPE +extern float expf(float val); +#endif + +#ifndef HAVE_LOGF +float logf(float val) +{ + return (float)log((double)val); +} +#endif + +#ifndef HAVE_EXPF +float expf(float val) +{ + return (float)exp((double)val); +} +#endif + +// ---------------------------------------------------------------------------- +// Constructor. +// ---------------------------------------------------------------------------- +FilterFP::FilterFP() +{ + model = (chip_model) 0; // neither 6581/8580; init time only + enable_filter(true); + /* approximate; sid.cc calls us when set_sampling_parameters() occurs. */ + set_clock_frequency(1e6f); + /* these parameters are a work-in-progress. */ + set_distortion_properties(2.5e-3f, 1536.f, 1e-4f); + /* sound similar to alankila6581r4ar3789 */ + set_type3_properties(1.40e6f, 1.47e8f, 1.0059f, 1.55e4f); + /* sound similar to trurl8580r5_3691 */ + set_type4_properties(6.55f, 20.f); + reset(); + set_chip_model(MOS6581FP); +} + + +// ---------------------------------------------------------------------------- +// Enable filter. +// ---------------------------------------------------------------------------- +void FilterFP::enable_filter(bool enable) +{ + enabled = enable; +} + + +// ---------------------------------------------------------------------------- +// Set chip model. +// ---------------------------------------------------------------------------- +void FilterFP::set_chip_model(chip_model model) +{ + this->model = model; + set_Q(); + set_w0(); +} + +/* dist_CT eliminates 1/x at hot spot */ +void FilterFP::set_clock_frequency(float clock) { + clock_frequency = clock; + calculate_helpers(); +} + +void FilterFP::set_distortion_properties(float r, float p, float cft) +{ + distortion_rate = r; + distortion_point = p; + /* baseresistance is used to determine material resistivity later */ + distortion_cf_threshold = cft; + calculate_helpers(); +} + +void FilterFP::set_type4_properties(float k, float b) +{ + type4_k = k; + type4_b = b; +} + +void FilterFP::set_type3_properties(float br, float o, float s, float mfr) +{ + type3_baseresistance = br; + type3_offset = o; + type3_steepness = -logf(s); /* s^x to e^(x*ln(s)), 1/e^x == e^-x. */ + type3_minimumfetresistance = mfr; +} + +void FilterFP::calculate_helpers() +{ + if (clock_frequency != 0.f) + distortion_CT = 1.f / (sidcaps_6581 * clock_frequency); + set_w0(); +} + +// ---------------------------------------------------------------------------- +// SID reset. +// ---------------------------------------------------------------------------- +void FilterFP::reset() +{ + fc = 0; + res = filt = voice3off = hp_bp_lp = 0; + vol = 0; + volf = Vhp = Vbp = Vlp = 0; + set_w0(); + set_Q(); +} + +// ---------------------------------------------------------------------------- +// Register functions. +// ---------------------------------------------------------------------------- +void FilterFP::writeFC_LO(reg8 fc_lo) +{ + fc = (fc & 0x7f8) | (fc_lo & 0x007); + set_w0(); +} + +void FilterFP::writeFC_HI(reg8 fc_hi) +{ + fc = ((fc_hi << 3) & 0x7f8) | (fc & 0x007); + set_w0(); +} + +void FilterFP::writeRES_FILT(reg8 res_filt) +{ + res = (res_filt >> 4) & 0x0f; + set_Q(); + + filt = res_filt & 0x0f; +} + +void FilterFP::writeMODE_VOL(reg8 mode_vol) +{ + voice3off = mode_vol & 0x80; + + hp_bp_lp = (mode_vol >> 4) & 0x07; + + vol = mode_vol & 0x0f; + volf = (float) vol / 15.f; +} + +// Set filter cutoff frequency. +void FilterFP::set_w0() +{ + if (model == MOS6581FP) { + /* div once by extra kinkiness because I fitted the type3 eq with that variant. */ + float type3_fc_kink = SIDFP::kinked_dac(fc, kinkiness, 11) / kinkiness; + type3_fc_kink_exp = type3_offset * expf(type3_fc_kink * type3_steepness); + if (distortion_rate != 0.f) { + type3_fc_distortion_offset_hp = (distortion_point - type3_fc_kink) * (0.5f) / distortion_rate; + type3_fc_distortion_offset_bp = type3_fc_distortion_offset_hp; + } + else { + type3_fc_distortion_offset_bp = 9e9f; + type3_fc_distortion_offset_hp = 9e9f; + } + } + if (model == MOS8580FP) { + type4_w0_cache = type4_w0(); + } +} + +// Set filter resonance. +void FilterFP::set_Q() +{ + float Q = res / 15.f; + _1_div_Q = 1.f / (0.707f + Q * 1.5f); +} diff --git a/src/resid-fp/filter.h b/src/resid-fp/filter.h index 9ca25456..e8641294 100644 --- a/src/resid-fp/filter.h +++ b/src/resid-fp/filter.h @@ -1,383 +1,383 @@ -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// --------------------------------------------------------------------------- -// Filter distortion code written by Antti S. Lankila 2007 - 2008. - -#ifndef __FILTER_H__ -#define __FILTER_H__ - -#include -#include "siddefs-fp.h" - -// ---------------------------------------------------------------------------- -// The SID filter is modeled with a two-integrator-loop biquadratic filter, -// which has been confirmed by Bob Yannes to be the actual circuit used in -// the SID chip. -// -// Measurements show that excellent emulation of the SID filter is achieved, -// except when high resonance is combined with high sustain levels. -// In this case the SID op-amps are performing less than ideally and are -// causing some peculiar behavior of the SID filter. This however seems to -// have more effect on the overall amplitude than on the color of the sound. -// -// The theory for the filter circuit can be found in "Microelectric Circuits" -// by Adel S. Sedra and Kenneth C. Smith. -// The circuit is modeled based on the explanation found there except that -// an additional inverter is used in the feedback from the bandpass output, -// allowing the summer op-amp to operate in single-ended mode. This yields -// inverted filter outputs with levels independent of Q, which corresponds with -// the results obtained from a real SID. -// -// We have been able to model the summer and the two integrators of the circuit -// to form components of an IIR filter. -// Vhp is the output of the summer, Vbp is the output of the first integrator, -// and Vlp is the output of the second integrator in the filter circuit. -// -// According to Bob Yannes, the active stages of the SID filter are not really -// op-amps. Rather, simple NMOS inverters are used. By biasing an inverter -// into its region of quasi-linear operation using a feedback resistor from -// input to output, a MOS inverter can be made to act like an op-amp for -// small signals centered around the switching threshold. -// -// Qualified guesses at SID filter schematics are depicted below. -// -// SID filter -// ---------- -// -// ----------------------------------------------- -// | | -// | ---Rq-- | -// | | | | -// | --------------|--R-----[A>--|--R-----[A>--| -// | | | | -// vi -----R1-- | | | -// -// vhp vbp vlp -// -// -// vi - input voltage -// vhp - highpass output -// vbp - bandpass output -// vlp - lowpass output -// [A> - op-amp -// R1 - summer resistor -// Rq - resistor array controlling resonance (4 resistors) -// R - NMOS FET voltage controlled resistor controlling cutoff frequency -// Rs - shunt resitor -// C - capacitor -// -// -// -// SID integrator -// -------------- -// -// V+ -// -// | -// | -// -----| -// | | -// | ||-- -// -|| -// ---C--- ||-> -// | | | -// |---Rs-----------|---- vo -// | | -// | ||-- -// vi ---- -----|------------|| -// | ^ | ||-> -// |___| | | -// ----- | | -// | | | -// |---R2-- | -// | -// R1 V- -// | -// | -// -// Vw -// -// ---------------------------------------------------------------------------- -class FilterFP -{ -public: - FilterFP(); - - void enable_filter(bool enable); - void set_chip_model(chip_model model); - void set_distortion_properties(float, float, float); - void set_type3_properties(float, float, float, float); - void set_type4_properties(float, float); - void set_clock_frequency(float); - - RESID_INLINE - float clock(float voice1, float voice2, float voice3, - float ext_in); - void reset(); - - // Write registers. - void writeFC_LO(reg8); - void writeFC_HI(reg8); - void writeRES_FILT(reg8); - void writeMODE_VOL(reg8); - -private: - void set_Q(); - void set_w0(); - float type3_w0(const float source, const float offset); - float type4_w0(); - void calculate_helpers(); - void nuke_denormals(); - - // Filter enabled. - bool enabled; - - // 6581/8580 filter model (XXX: we should specialize in separate classes) - chip_model model; - - // Filter cutoff frequency. - reg12 fc; - - // Filter resonance. - reg8 res; - - // Selects which inputs to route through filter. - reg8 filt; - - // Switch voice 3 off. - reg8 voice3off; - - // Highpass, bandpass, and lowpass filter modes. - reg8 hp_bp_lp; - - // Output master volume. - reg4 vol; - float volf; /* avoid integer-to-float conversion at output */ - - // clock - float clock_frequency; - - /* Distortion params for Type3 */ - float distortion_rate, distortion_point, distortion_cf_threshold; - - /* Type3 params. */ - float type3_baseresistance, type3_offset, type3_steepness, type3_minimumfetresistance; - - /* Type4 params */ - float type4_k, type4_b; - - // State of filter. - float Vhp, Vbp, Vlp; - - /* Resonance/Distortion/Type3/Type4 helpers. */ - float type4_w0_cache, _1_div_Q, type3_fc_kink_exp, distortion_CT, - type3_fc_distortion_offset_bp, type3_fc_distortion_offset_hp; - -friend class SIDFP; -}; - -// ---------------------------------------------------------------------------- -// Inline functions. -// The following functions are defined inline because they are called every -// time a sample is calculated. -// ---------------------------------------------------------------------------- - -/* kinkiness of DAC: - * some chips have more, some less. We should make this tunable. */ -const float kinkiness = 0.966f; -const float sidcaps_6581 = 470e-12f; -const float outputleveldifference_lp_bp = 1.4f; -const float outputleveldifference_bp_hp = 1.2f; - -RESID_INLINE -static float fastexp(float val) { - typedef union { - int i; - float f; - } conv; - - conv tmp; - - /* single precision fp has 1 + 8 + 23 bits, exponent bias is 127. - * It therefore follows that we need to shift left by 23 bits, and to - * calculate exp(x) instead of pow(2, x) we divide the power by ln(2). */ - const float a = (1 << 23) / M_LN2_f; - /* The other factor corrects for the exponent bias so that 2^0 = 1. */ - const float b = (1 << 23) * 127; - /* According to "A Fast, Compact Approximation of the Exponential Function" - * by Nicol N. Schraudolph, 60801.48 yields the minimum RMS error for the - * piecewise-linear approximation when using doubles (20 bits residual). - * We have 23 bits, so we scale this value by 8. */ - const float c = 60801.48f * 8.f + 0.5f; - - /* Parenthesis are important: C standard disallows folding subtraction. - * Unfortunately GCC appears to generate a write to memory rather than - * handle this conversion entirely in registers. */ - tmp.i = (int)(a * val + (b - c)); - return tmp.f; -} - -RESID_INLINE -float FilterFP::type3_w0(const float source, const float distoffset) -{ - /* The distortion appears to be the result of MOSFET entering saturation - * mode. The conductance of a FET is proportional to: - * - * ohmic = 2 * (Vgs - Vt) * Vds - Vds^2 - * saturation = (Vgs - Vt)^2 - * - * The FET switches to saturation mode when Vgs - Vt < Vds. - * - * In the circuit, the Vgs is mixed with the Vds signal, which gives - * (Vgs + Vds) / 2 as the gate voltage. Doing the substitutions we get: - * - * ohmic = 2 * ((Vgs + Vds) / 2 - Vt) * Vds - Vds^2 = (Vgs - Vt) * Vds - * saturation = ((Vgs + Vds) / 2 - Vt)^2 - * - * Therefore: once the Vds crosses a threshold given by the gate and - * threshold FET conductance begins to increase faster. The exact shape - * for this effect is a parabola. - * - * The scaling term here tries to match the FC control level with - * the signal level in simulation. On the chip, the FC control is - * biased by forcing its highest DAC bit in the 1 position, thus - * limiting the electrical range to half. Therefore one can guess that - * the real FC range is half of the full voice range. - * - * On the simulation, FC goes to 2047 and the voices to 4095 * 255. - * If the FC control was intact, then the scaling factor would be - * 1/512. (Simulation voices are 512 times "louder" intrinsically.) - * As the real chip's FC has reduced range, the scaling required to - * match levels is 1/256. */ - - float fetresistance = type3_fc_kink_exp; - if (source > distoffset) { - const float dist = source - distoffset; - fetresistance *= fastexp(dist * type3_steepness * distortion_rate); - } - const float dynamic_resistance = type3_minimumfetresistance + fetresistance; - - /* 2 parallel resistors */ - const float _1_div_resistance = (type3_baseresistance + dynamic_resistance) / (type3_baseresistance * dynamic_resistance); - /* 1.f / (clock * caps * resistance) */ - return distortion_CT * _1_div_resistance; -} - -RESID_INLINE -float FilterFP::type4_w0() -{ - const float freq = type4_k * fc + type4_b; - return 2.f * M_PI_f * freq / clock_frequency; -} - -// ---------------------------------------------------------------------------- -// SID clocking - 1 cycle. -// ---------------------------------------------------------------------------- -RESID_INLINE -float FilterFP::clock(float voice1, - float voice2, - float voice3, - float ext_in) -{ - /* Avoid denormal numbers by using small offsets from 0 */ - float Vi = 0.f, Vnf = 0.f, Vf = 0.f; - - // Route voices into or around filter. - ((filt & 1) ? Vi : Vnf) += voice1; - ((filt & 2) ? Vi : Vnf) += voice2; - // NB! Voice 3 is not silenced by voice3off if it is routed through - // the filter. - if (filt & 4) - Vi += voice3; - else if (! voice3off) - Vnf += voice3; - ((filt & 8) ? Vi : Vnf) += ext_in; - - if (! enabled) - return (Vnf - Vi) * volf; - - if (hp_bp_lp & 1) - Vf += Vlp; - if (hp_bp_lp & 2) - Vf += Vbp; - if (hp_bp_lp & 4) - Vf += Vhp; - - if (model == MOS6581FP) { - float diff1, diff2; - - Vhp = Vbp * _1_div_Q * (1.f/outputleveldifference_bp_hp) - Vlp * (1.f/outputleveldifference_bp_hp) - Vi * 0.5f; - - /* the input summer mixing, or something like it... */ - diff1 = (Vlp - Vbp) * distortion_cf_threshold; - diff2 = (Vhp - Vbp) * distortion_cf_threshold; - Vlp -= diff1; - Vbp += diff1; - Vbp += diff2; - Vhp -= diff2; - - /* Model output strip mixing. Doing it now that HP state - * variable modifying still makes some difference. - * (Phase error, though.) */ - if (hp_bp_lp & 1) - Vlp += (Vf + Vnf - Vlp) * distortion_cf_threshold; - if (hp_bp_lp & 2) - Vbp += (Vf + Vnf - Vbp) * distortion_cf_threshold; - if (hp_bp_lp & 4) - Vhp += (Vf + Vnf - Vhp) * distortion_cf_threshold; - - /* Simulating the exponential VCR that the FET block is... */ - Vlp -= Vbp * type3_w0(Vbp, type3_fc_distortion_offset_bp); - Vbp -= Vhp * type3_w0(Vhp, type3_fc_distortion_offset_hp) * outputleveldifference_bp_hp; - - /* Tuned based on Fred Gray's Break Thru. It is probably not a hard - * discontinuity but a saturation effect... */ - if (Vnf > 3.2e6f) - Vnf = 3.2e6f; - - Vf += Vnf + Vlp * (outputleveldifference_lp_bp - 1.f); - } else { - /* On the 8580, BP appears mixed in phase with the rest. */ - Vhp = -Vbp * _1_div_Q - Vlp - Vi; - Vlp += Vbp * type4_w0_cache; - Vbp += Vhp * type4_w0_cache; - - Vf += Vnf; - } - - return Vf * volf; -} - -RESID_INLINE -void FilterFP::nuke_denormals() -{ - /* We could use the flush-to-zero flag or denormals-are-zero on systems - * where compiling with -msse and -mfpmath=sse is acceptable. Since this - * doesn't include general VICE builds, we do this instead. */ - if (Vbp > -1e-12f && Vbp < 1e-12f) - Vbp = 0; - if (Vlp > -1e-12f && Vlp < 1e-12f) - Vlp = 0; -} - -#endif // not __FILTER_H__ +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// --------------------------------------------------------------------------- +// Filter distortion code written by Antti S. Lankila 2007 - 2008. + +#ifndef __FILTER_H__ +#define __FILTER_H__ + +#include +#include "siddefs-fp.h" + +// ---------------------------------------------------------------------------- +// The SID filter is modeled with a two-integrator-loop biquadratic filter, +// which has been confirmed by Bob Yannes to be the actual circuit used in +// the SID chip. +// +// Measurements show that excellent emulation of the SID filter is achieved, +// except when high resonance is combined with high sustain levels. +// In this case the SID op-amps are performing less than ideally and are +// causing some peculiar behavior of the SID filter. This however seems to +// have more effect on the overall amplitude than on the color of the sound. +// +// The theory for the filter circuit can be found in "Microelectric Circuits" +// by Adel S. Sedra and Kenneth C. Smith. +// The circuit is modeled based on the explanation found there except that +// an additional inverter is used in the feedback from the bandpass output, +// allowing the summer op-amp to operate in single-ended mode. This yields +// inverted filter outputs with levels independent of Q, which corresponds with +// the results obtained from a real SID. +// +// We have been able to model the summer and the two integrators of the circuit +// to form components of an IIR filter. +// Vhp is the output of the summer, Vbp is the output of the first integrator, +// and Vlp is the output of the second integrator in the filter circuit. +// +// According to Bob Yannes, the active stages of the SID filter are not really +// op-amps. Rather, simple NMOS inverters are used. By biasing an inverter +// into its region of quasi-linear operation using a feedback resistor from +// input to output, a MOS inverter can be made to act like an op-amp for +// small signals centered around the switching threshold. +// +// Qualified guesses at SID filter schematics are depicted below. +// +// SID filter +// ---------- +// +// ----------------------------------------------- +// | | +// | ---Rq-- | +// | | | | +// | --------------|--R-----[A>--|--R-----[A>--| +// | | | | +// vi -----R1-- | | | +// +// vhp vbp vlp +// +// +// vi - input voltage +// vhp - highpass output +// vbp - bandpass output +// vlp - lowpass output +// [A> - op-amp +// R1 - summer resistor +// Rq - resistor array controlling resonance (4 resistors) +// R - NMOS FET voltage controlled resistor controlling cutoff frequency +// Rs - shunt resitor +// C - capacitor +// +// +// +// SID integrator +// -------------- +// +// V+ +// +// | +// | +// -----| +// | | +// | ||-- +// -|| +// ---C--- ||-> +// | | | +// |---Rs-----------|---- vo +// | | +// | ||-- +// vi ---- -----|------------|| +// | ^ | ||-> +// |___| | | +// ----- | | +// | | | +// |---R2-- | +// | +// R1 V- +// | +// | +// +// Vw +// +// ---------------------------------------------------------------------------- +class FilterFP +{ +public: + FilterFP(); + + void enable_filter(bool enable); + void set_chip_model(chip_model model); + void set_distortion_properties(float, float, float); + void set_type3_properties(float, float, float, float); + void set_type4_properties(float, float); + void set_clock_frequency(float); + + RESID_INLINE + float clock(float voice1, float voice2, float voice3, + float ext_in); + void reset(); + + // Write registers. + void writeFC_LO(reg8); + void writeFC_HI(reg8); + void writeRES_FILT(reg8); + void writeMODE_VOL(reg8); + +private: + void set_Q(); + void set_w0(); + float type3_w0(const float source, const float offset); + float type4_w0(); + void calculate_helpers(); + void nuke_denormals(); + + // Filter enabled. + bool enabled; + + // 6581/8580 filter model (XXX: we should specialize in separate classes) + chip_model model; + + // Filter cutoff frequency. + reg12 fc; + + // Filter resonance. + reg8 res; + + // Selects which inputs to route through filter. + reg8 filt; + + // Switch voice 3 off. + reg8 voice3off; + + // Highpass, bandpass, and lowpass filter modes. + reg8 hp_bp_lp; + + // Output master volume. + reg4 vol; + float volf; /* avoid integer-to-float conversion at output */ + + // clock + float clock_frequency; + + /* Distortion params for Type3 */ + float distortion_rate, distortion_point, distortion_cf_threshold; + + /* Type3 params. */ + float type3_baseresistance, type3_offset, type3_steepness, type3_minimumfetresistance; + + /* Type4 params */ + float type4_k, type4_b; + + // State of filter. + float Vhp, Vbp, Vlp; + + /* Resonance/Distortion/Type3/Type4 helpers. */ + float type4_w0_cache, _1_div_Q, type3_fc_kink_exp, distortion_CT, + type3_fc_distortion_offset_bp, type3_fc_distortion_offset_hp; + +friend class SIDFP; +}; + +// ---------------------------------------------------------------------------- +// Inline functions. +// The following functions are defined inline because they are called every +// time a sample is calculated. +// ---------------------------------------------------------------------------- + +/* kinkiness of DAC: + * some chips have more, some less. We should make this tunable. */ +const float kinkiness = 0.966f; +const float sidcaps_6581 = 470e-12f; +const float outputleveldifference_lp_bp = 1.4f; +const float outputleveldifference_bp_hp = 1.2f; + +RESID_INLINE +static float fastexp(float val) { + typedef union { + int i; + float f; + } conv; + + conv tmp; + + /* single precision fp has 1 + 8 + 23 bits, exponent bias is 127. + * It therefore follows that we need to shift left by 23 bits, and to + * calculate exp(x) instead of pow(2, x) we divide the power by ln(2). */ + const float a = (1 << 23) / M_LN2_f; + /* The other factor corrects for the exponent bias so that 2^0 = 1. */ + const float b = (1 << 23) * 127; + /* According to "A Fast, Compact Approximation of the Exponential Function" + * by Nicol N. Schraudolph, 60801.48 yields the minimum RMS error for the + * piecewise-linear approximation when using doubles (20 bits residual). + * We have 23 bits, so we scale this value by 8. */ + const float c = 60801.48f * 8.f + 0.5f; + + /* Parenthesis are important: C standard disallows folding subtraction. + * Unfortunately GCC appears to generate a write to memory rather than + * handle this conversion entirely in registers. */ + tmp.i = (int)(a * val + (b - c)); + return tmp.f; +} + +RESID_INLINE +float FilterFP::type3_w0(const float source, const float distoffset) +{ + /* The distortion appears to be the result of MOSFET entering saturation + * mode. The conductance of a FET is proportional to: + * + * ohmic = 2 * (Vgs - Vt) * Vds - Vds^2 + * saturation = (Vgs - Vt)^2 + * + * The FET switches to saturation mode when Vgs - Vt < Vds. + * + * In the circuit, the Vgs is mixed with the Vds signal, which gives + * (Vgs + Vds) / 2 as the gate voltage. Doing the substitutions we get: + * + * ohmic = 2 * ((Vgs + Vds) / 2 - Vt) * Vds - Vds^2 = (Vgs - Vt) * Vds + * saturation = ((Vgs + Vds) / 2 - Vt)^2 + * + * Therefore: once the Vds crosses a threshold given by the gate and + * threshold FET conductance begins to increase faster. The exact shape + * for this effect is a parabola. + * + * The scaling term here tries to match the FC control level with + * the signal level in simulation. On the chip, the FC control is + * biased by forcing its highest DAC bit in the 1 position, thus + * limiting the electrical range to half. Therefore one can guess that + * the real FC range is half of the full voice range. + * + * On the simulation, FC goes to 2047 and the voices to 4095 * 255. + * If the FC control was intact, then the scaling factor would be + * 1/512. (Simulation voices are 512 times "louder" intrinsically.) + * As the real chip's FC has reduced range, the scaling required to + * match levels is 1/256. */ + + float fetresistance = type3_fc_kink_exp; + if (source > distoffset) { + const float dist = source - distoffset; + fetresistance *= fastexp(dist * type3_steepness * distortion_rate); + } + const float dynamic_resistance = type3_minimumfetresistance + fetresistance; + + /* 2 parallel resistors */ + const float _1_div_resistance = (type3_baseresistance + dynamic_resistance) / (type3_baseresistance * dynamic_resistance); + /* 1.f / (clock * caps * resistance) */ + return distortion_CT * _1_div_resistance; +} + +RESID_INLINE +float FilterFP::type4_w0() +{ + const float freq = type4_k * fc + type4_b; + return 2.f * M_PI_f * freq / clock_frequency; +} + +// ---------------------------------------------------------------------------- +// SID clocking - 1 cycle. +// ---------------------------------------------------------------------------- +RESID_INLINE +float FilterFP::clock(float voice1, + float voice2, + float voice3, + float ext_in) +{ + /* Avoid denormal numbers by using small offsets from 0 */ + float Vi = 0.f, Vnf = 0.f, Vf = 0.f; + + // Route voices into or around filter. + ((filt & 1) ? Vi : Vnf) += voice1; + ((filt & 2) ? Vi : Vnf) += voice2; + // NB! Voice 3 is not silenced by voice3off if it is routed through + // the filter. + if (filt & 4) + Vi += voice3; + else if (! voice3off) + Vnf += voice3; + ((filt & 8) ? Vi : Vnf) += ext_in; + + if (! enabled) + return (Vnf - Vi) * volf; + + if (hp_bp_lp & 1) + Vf += Vlp; + if (hp_bp_lp & 2) + Vf += Vbp; + if (hp_bp_lp & 4) + Vf += Vhp; + + if (model == MOS6581FP) { + float diff1, diff2; + + Vhp = Vbp * _1_div_Q * (1.f/outputleveldifference_bp_hp) - Vlp * (1.f/outputleveldifference_bp_hp) - Vi * 0.5f; + + /* the input summer mixing, or something like it... */ + diff1 = (Vlp - Vbp) * distortion_cf_threshold; + diff2 = (Vhp - Vbp) * distortion_cf_threshold; + Vlp -= diff1; + Vbp += diff1; + Vbp += diff2; + Vhp -= diff2; + + /* Model output strip mixing. Doing it now that HP state + * variable modifying still makes some difference. + * (Phase error, though.) */ + if (hp_bp_lp & 1) + Vlp += (Vf + Vnf - Vlp) * distortion_cf_threshold; + if (hp_bp_lp & 2) + Vbp += (Vf + Vnf - Vbp) * distortion_cf_threshold; + if (hp_bp_lp & 4) + Vhp += (Vf + Vnf - Vhp) * distortion_cf_threshold; + + /* Simulating the exponential VCR that the FET block is... */ + Vlp -= Vbp * type3_w0(Vbp, type3_fc_distortion_offset_bp); + Vbp -= Vhp * type3_w0(Vhp, type3_fc_distortion_offset_hp) * outputleveldifference_bp_hp; + + /* Tuned based on Fred Gray's Break Thru. It is probably not a hard + * discontinuity but a saturation effect... */ + if (Vnf > 3.2e6f) + Vnf = 3.2e6f; + + Vf += Vnf + Vlp * (outputleveldifference_lp_bp - 1.f); + } else { + /* On the 8580, BP appears mixed in phase with the rest. */ + Vhp = -Vbp * _1_div_Q - Vlp - Vi; + Vlp += Vbp * type4_w0_cache; + Vbp += Vhp * type4_w0_cache; + + Vf += Vnf; + } + + return Vf * volf; +} + +RESID_INLINE +void FilterFP::nuke_denormals() +{ + /* We could use the flush-to-zero flag or denormals-are-zero on systems + * where compiling with -msse and -mfpmath=sse is acceptable. Since this + * doesn't include general VICE builds, we do this instead. */ + if (Vbp > -1e-12f && Vbp < 1e-12f) + Vbp = 0; + if (Vlp > -1e-12f && Vlp < 1e-12f) + Vlp = 0; +} + +#endif // not __FILTER_H__ diff --git a/src/resid-fp/pot.cc b/src/resid-fp/pot.cc index 4cd85a5c..14fefeb5 100644 --- a/src/resid-fp/pot.cc +++ b/src/resid-fp/pot.cc @@ -1,26 +1,26 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 "pot.h" - -reg8 PotentiometerFP::readPOT() -{ - // NB! Not modeled. - return 0xff; -} +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 "pot.h" + +reg8 PotentiometerFP::readPOT() +{ + // NB! Not modeled. + return 0xff; +} diff --git a/src/resid-fp/pot.h b/src/resid-fp/pot.h index e1deeabd..bc893f0e 100644 --- a/src/resid-fp/pot.h +++ b/src/resid-fp/pot.h @@ -1,31 +1,31 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 __POT_H__ -#define __POT_H__ - -#include "siddefs-fp.h" - -class PotentiometerFP -{ -public: - reg8 readPOT(); -}; - -#endif +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 __POT_H__ +#define __POT_H__ + +#include "siddefs-fp.h" + +class PotentiometerFP +{ +public: + reg8 readPOT(); +}; + +#endif diff --git a/src/resid-fp/samp2src.pl b/src/resid-fp/samp2src.pl old mode 100755 new mode 100644 index 368cee02..005c138d --- a/src/resid-fp/samp2src.pl +++ b/src/resid-fp/samp2src.pl @@ -1,65 +1,65 @@ -#! /usr/bin/perl -w -# --------------------------------------------------------------------------- -# This file is part of reSID, a MOS6581 SID emulator engine. -# Copyright (C) 2004 Dag Lem -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# --------------------------------------------------------------------------- - -use strict; - -die("Usage: samp2src name data-in src-out\n") unless @ARGV == 3; -my ($name, $in, $out) = @ARGV; - -open(F, "<$in") or die($!); -local $/ = undef; -my $data = ; -close(F) or die($!); - -open(F, ">$out") or die($!); - -print F <<\EOF; -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// --------------------------------------------------------------------------- - -EOF - -print F "#include \"wave.h\"\n\nreg8 WaveformGeneratorFP::$name\[\] =\n{\n"; - -for (my $i = 0; $i < length($data); $i += 8) { - print F sprintf("/* 0x%03x: */ ", $i), map(sprintf(" 0x%02x,", $_), unpack("C*", substr($data, $i, 8))), "\n"; -} - -print F "};\n"; - -close(F) or die($!); - -exit(0); +#! /usr/bin/perl -w +# --------------------------------------------------------------------------- +# This file is part of reSID, a MOS6581 SID emulator engine. +# Copyright (C) 2004 Dag Lem +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# --------------------------------------------------------------------------- + +use strict; + +die("Usage: samp2src name data-in src-out\n") unless @ARGV == 3; +my ($name, $in, $out) = @ARGV; + +open(F, "<$in") or die($!); +local $/ = undef; +my $data = ; +close(F) or die($!); + +open(F, ">$out") or die($!); + +print F <<\EOF; +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// --------------------------------------------------------------------------- + +EOF + +print F "#include \"wave.h\"\n\nreg8 WaveformGeneratorFP::$name\[\] =\n{\n"; + +for (my $i = 0; $i < length($data); $i += 8) { + print F sprintf("/* 0x%03x: */ ", $i), map(sprintf(" 0x%02x,", $_), unpack("C*", substr($data, $i, 8))), "\n"; +} + +print F "};\n"; + +close(F) or die($!); + +exit(0); diff --git a/src/resid-fp/sid.cc b/src/resid-fp/sid.cc index 165253b9..babfec6c 100644 --- a/src/resid-fp/sid.cc +++ b/src/resid-fp/sid.cc @@ -1,936 +1,936 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 "sid.h" -#include -#include - -extern float convolve(const float *a, const float *b, int n); -extern float convolve_sse(const float *a, const float *b, int n); - -enum host_cpu_feature { - HOST_CPU_MMX=1, HOST_CPU_SSE=2, HOST_CPU_SSE2=4, HOST_CPU_SSE3=8 -}; - -/* This code is appropriate for 32-bit and 64-bit x86 CPUs. */ -#if defined(__x86_64__) || defined(__i386__) || defined(_MSC_VER) - -struct cpu_x86_regs_s { - unsigned int eax; - unsigned int ebx; - unsigned int ecx; - unsigned int edx; -}; -typedef struct cpu_x86_regs_s cpu_x86_regs_t; - -static cpu_x86_regs_t get_cpuid_regs(unsigned int index) -{ - cpu_x86_regs_t retval; - -#if defined(_MSC_VER) /* MSVC assembly */ - __asm { - mov eax, [index] - cpuid - mov [retval.eax], eax - mov [retval.ebx], ebx - mov [retval.ecx], ecx - mov [retval.edx], edx - } -#else /* GNU assembly */ - asm("movl %4, %%eax; cpuid; movl %%eax, %0; movl %%ebx, %1; movl %%ecx, %2; movl %%edx, %3;" - : "=m" (retval.eax), - "=m" (retval.ebx), - "=m" (retval.ecx), - "=m" (retval.edx) - : "r" (index) - : "eax", "ebx", "ecx", "edx"); -#endif - - return retval; -} - -static int host_cpu_features_by_cpuid(void) -{ - cpu_x86_regs_t regs = get_cpuid_regs(1); - - int features = 0; - if (regs.edx & (1 << 23)) - features |= HOST_CPU_MMX; - if (regs.edx & (1 << 25)) - features |= HOST_CPU_SSE; - if (regs.edx & (1 << 26)) - features |= HOST_CPU_SSE2; - if (regs.ecx & (1 << 0)) - features |= HOST_CPU_SSE3; - - return features; -} - -static int host_cpu_features(void) -{ - static int features = 0; - static int features_detected = 0; -/* 32-bit only */ -#if defined(__i386__) || (defined(_MSC_VER) && defined(_WIN32)) - unsigned long temp1, temp2; -#endif - - if (features_detected) - return features; - features_detected = 1; - -#if defined(_MSC_VER) && defined(_WIN32) /* MSVC compatible assembly appropriate for 32-bit Windows */ - /* see if we are dealing with a cpu that has the cpuid instruction */ - __asm { - pushf - pop eax - mov [temp1], eax - xor eax, 0x200000 - push eax - popf - pushf - pop eax - mov [temp2], eax - push [temp1] - popf - } -#endif -#if defined(__i386__) /* GNU assembly */ - asm("pushfl; popl %%eax; movl %%eax, %0; xorl $0x200000, %%eax; pushl %%eax; popfl; pushfl; popl %%eax; movl %%eax, %1; pushl %0; popfl " - : "=r" (temp1), - "=r" (temp2) - : - : "eax"); -#endif -#if defined(__i386__) || (defined(_MSC_VER) && defined(_WIN32)) - temp1 &= 0x200000; - temp2 &= 0x200000; - if (temp1 == temp2) { - /* no cpuid support, so we can't test for SSE availability -> false */ - return 0; - } -#endif - - /* find the highest supported cpuid function, returned in %eax */ - if (get_cpuid_regs(0).eax < 1) { - /* no cpuid 1 function, we can't test for features -> no features */ - return 0; - } - - features = host_cpu_features_by_cpuid(); - return features; -} - -#else /* !__x86_64__ && !__i386__ && !_MSC_VER */ -static int host_cpu_features(void) -{ - return 0; -} -#endif - -float SIDFP::kinked_dac(const int x, const float nonlinearity, const int max) -{ - float value = 0.f; - - int bit = 1; - float weight = 1.f; - const float dir = 2.0f * nonlinearity; - for (int i = 0; i < max; i ++) { - if (x & bit) - value += weight; - bit <<= 1; - weight *= dir; - } - - return value / (weight / nonlinearity) * (1 << max); -} - -// ---------------------------------------------------------------------------- -// Constructor. -// ---------------------------------------------------------------------------- -SIDFP::SIDFP() -{ -#if (RESID_USE_SSE==1) - can_use_sse = (host_cpu_features() & HOST_CPU_SSE) != 0; -#else - can_use_sse = false; -#endif - - // Initialize pointers. - sample = 0; - fir = 0; - - voice[0].set_sync_source(&voice[2]); - voice[1].set_sync_source(&voice[0]); - voice[2].set_sync_source(&voice[1]); - - set_sampling_parameters(985248, SAMPLE_INTERPOLATE, 44100); - - bus_value = 0; - bus_value_ttl = 0; - - input(0); -} - - -// ---------------------------------------------------------------------------- -// Destructor. -// ---------------------------------------------------------------------------- -SIDFP::~SIDFP() -{ - delete[] sample; - delete[] fir; -} - - -// ---------------------------------------------------------------------------- -// Set chip model. -// ---------------------------------------------------------------------------- -void SIDFP::set_chip_model(chip_model model) -{ - for (int i = 0; i < 3; i++) { - voice[i].set_chip_model(model); - } - - filter.set_chip_model(model); - extfilt.set_chip_model(model); -} - -/* nonlinear DAC support, set 1 for 8580 / no effect, about 0.96 otherwise */ -void SIDFP::set_voice_nonlinearity(float nl) -{ - for (int i = 0; i < 3; i++) { - voice[i].set_nonlinearity(nl); - } -} - -// ---------------------------------------------------------------------------- -// SID reset. -// ---------------------------------------------------------------------------- -void SIDFP::reset() -{ - for (int i = 0; i < 3; i++) { - voice[i].reset(); - } - filter.reset(); - extfilt.reset(); - - bus_value = 0; - bus_value_ttl = 0; -} - - -// ---------------------------------------------------------------------------- -// Write 16-bit sample to audio input. -// NB! The caller is responsible for keeping the value within 16 bits. -// Note that to mix in an external audio signal, the signal should be -// resampled to 1MHz first to avoid sampling noise. -// ---------------------------------------------------------------------------- -void SIDFP::input(int sample) -{ - // Voice outputs are 20 bits. Scale up to match three voices in order - // to facilitate simulation of the MOS8580 "digi boost" hardware hack. - ext_in = (float) ( (sample << 4) * 3 ); -} - -float SIDFP::output() -{ - const float range = 1 << 15; - return extfilt.output() / (4095.f * 255.f * 3.f * 1.5f / range); -} - -// ---------------------------------------------------------------------------- -// Read registers. -// -// Reading a write only register returns the last byte written to any SID -// register. The individual bits in this value start to fade down towards -// zero after a few cycles. All bits reach zero within approximately -// $2000 - $4000 cycles. -// It has been claimed that this fading happens in an orderly fashion, however -// sampling of write only registers reveals that this is not the case. -// NB! This is not correctly modeled. -// The actual use of write only registers has largely been made in the belief -// that all SID registers are readable. To support this belief the read -// would have to be done immediately after a write to the same register -// (remember that an intermediate write to another register would yield that -// value instead). With this in mind we return the last value written to -// any SID register for $2000 cycles without modeling the bit fading. -// ---------------------------------------------------------------------------- -reg8 SIDFP::read(reg8 offset) -{ - switch (offset) { - case 0x19: - return potx.readPOT(); - case 0x1a: - return poty.readPOT(); - case 0x1b: - return voice[2].wave.readOSC(); - case 0x1c: - return voice[2].envelope.readENV(); - default: - return bus_value; - } -} - - -// ---------------------------------------------------------------------------- -// Write registers. -// ---------------------------------------------------------------------------- -void SIDFP::write(reg8 offset, reg8 value) -{ - bus_value = value; - bus_value_ttl = 0x4000; - - switch (offset) { - case 0x00: - voice[0].wave.writeFREQ_LO(value); - break; - case 0x01: - voice[0].wave.writeFREQ_HI(value); - break; - case 0x02: - voice[0].wave.writePW_LO(value); - break; - case 0x03: - voice[0].wave.writePW_HI(value); - break; - case 0x04: - voice[0].writeCONTROL_REG(value); - break; - case 0x05: - voice[0].envelope.writeATTACK_DECAY(value); - break; - case 0x06: - voice[0].envelope.writeSUSTAIN_RELEASE(value); - break; - case 0x07: - voice[1].wave.writeFREQ_LO(value); - break; - case 0x08: - voice[1].wave.writeFREQ_HI(value); - break; - case 0x09: - voice[1].wave.writePW_LO(value); - break; - case 0x0a: - voice[1].wave.writePW_HI(value); - break; - case 0x0b: - voice[1].writeCONTROL_REG(value); - break; - case 0x0c: - voice[1].envelope.writeATTACK_DECAY(value); - break; - case 0x0d: - voice[1].envelope.writeSUSTAIN_RELEASE(value); - break; - case 0x0e: - voice[2].wave.writeFREQ_LO(value); - break; - case 0x0f: - voice[2].wave.writeFREQ_HI(value); - break; - case 0x10: - voice[2].wave.writePW_LO(value); - break; - case 0x11: - voice[2].wave.writePW_HI(value); - break; - case 0x12: - voice[2].writeCONTROL_REG(value); - break; - case 0x13: - voice[2].envelope.writeATTACK_DECAY(value); - break; - case 0x14: - voice[2].envelope.writeSUSTAIN_RELEASE(value); - break; - case 0x15: - filter.writeFC_LO(value); - break; - case 0x16: - filter.writeFC_HI(value); - break; - case 0x17: - filter.writeRES_FILT(value); - break; - case 0x18: - filter.writeMODE_VOL(value); - break; - default: - break; - } -} - - -// ---------------------------------------------------------------------------- -// Constructor. -// ---------------------------------------------------------------------------- -SIDFP::State::State() -{ - int i; - - for (i = 0; i < 0x20; i++) { - sid_register[i] = 0; - } - - bus_value = 0; - bus_value_ttl = 0; - - for (i = 0; i < 3; i++) { - accumulator[i] = 0; - shift_register[i] = 0x7ffff8; - rate_counter[i] = 0; - rate_counter_period[i] = 9; - exponential_counter[i] = 0; - exponential_counter_period[i] = 1; - envelope_counter[i] = 0; - envelope_state[i] = EnvelopeGeneratorFP::RELEASE; - hold_zero[i] = true; - } -} - - -// ---------------------------------------------------------------------------- -// Read state. -// ---------------------------------------------------------------------------- -SIDFP::State SIDFP::read_state() -{ - State state; - int i, j; - - for (i = 0, j = 0; i < 3; i++, j += 7) { - WaveformGeneratorFP& wave = voice[i].wave; - EnvelopeGeneratorFP& envelope = voice[i].envelope; - state.sid_register[j + 0] = wave.freq & 0xff; - state.sid_register[j + 1] = wave.freq >> 8; - state.sid_register[j + 2] = wave.pw & 0xff; - state.sid_register[j + 3] = wave.pw >> 8; - state.sid_register[j + 4] = - (wave.waveform << 4) - | (wave.test ? 0x08 : 0) - | (wave.ring_mod ? 0x04 : 0) - | (wave.sync ? 0x02 : 0) - | (envelope.gate ? 0x01 : 0); - state.sid_register[j + 5] = (envelope.attack << 4) | envelope.decay; - state.sid_register[j + 6] = (envelope.sustain << 4) | envelope.release; - } - - state.sid_register[j++] = filter.fc & 0x007; - state.sid_register[j++] = filter.fc >> 3; - state.sid_register[j++] = (filter.res << 4) | filter.filt; - state.sid_register[j++] = - (filter.voice3off ? 0x80 : 0) - | (filter.hp_bp_lp << 4) - | filter.vol; - - // These registers are superfluous, but included for completeness. - for (; j < 0x1d; j++) { - state.sid_register[j] = read(j); - } - for (; j < 0x20; j++) { - state.sid_register[j] = 0; - } - - state.bus_value = bus_value; - state.bus_value_ttl = bus_value_ttl; - - for (i = 0; i < 3; i++) { - state.accumulator[i] = voice[i].wave.accumulator; - state.shift_register[i] = voice[i].wave.shift_register; - state.rate_counter[i] = voice[i].envelope.rate_counter; - state.rate_counter_period[i] = voice[i].envelope.rate_period; - state.exponential_counter[i] = voice[i].envelope.exponential_counter; - state.exponential_counter_period[i] = voice[i].envelope.exponential_counter_period; - state.envelope_counter[i] = voice[i].envelope.envelope_counter; - state.envelope_state[i] = voice[i].envelope.state; - state.hold_zero[i] = voice[i].envelope.hold_zero; - } - - return state; -} - - -// ---------------------------------------------------------------------------- -// Write state. -// ---------------------------------------------------------------------------- -void SIDFP::write_state(const State& state) -{ - int i; - - for (i = 0; i <= 0x18; i++) { - write(i, state.sid_register[i]); - } - - bus_value = state.bus_value; - bus_value_ttl = state.bus_value_ttl; - - for (i = 0; i < 3; i++) { - voice[i].wave.accumulator = state.accumulator[i]; - voice[i].wave.shift_register = state.shift_register[i]; - voice[i].envelope.rate_counter = state.rate_counter[i]; - voice[i].envelope.rate_period = state.rate_counter_period[i]; - voice[i].envelope.exponential_counter = state.exponential_counter[i]; - voice[i].envelope.exponential_counter_period = state.exponential_counter_period[i]; - voice[i].envelope.envelope_counter = state.envelope_counter[i]; - voice[i].envelope.state = state.envelope_state[i]; - voice[i].envelope.hold_zero = state.hold_zero[i]; - } -} - - -// ---------------------------------------------------------------------------- -// Enable filter. -// ---------------------------------------------------------------------------- -void SIDFP::enable_filter(bool enable) -{ - filter.enable_filter(enable); -} - - -// ---------------------------------------------------------------------------- -// Enable external filter. -// ---------------------------------------------------------------------------- -void SIDFP::enable_external_filter(bool enable) -{ - extfilt.enable_filter(enable); -} - - -// ---------------------------------------------------------------------------- -// I0() computes the 0th order modified Bessel function of the first kind. -// This function is originally from resample-1.5/filterkit.c by J. O. Smith. -// ---------------------------------------------------------------------------- -double SIDFP::I0(double x) -{ - // Max error acceptable in I0 could be 1e-6, which gives that 96 dB already. - // I'm overspecify these errors to get a beautiful FFT dump of the FIR. - const double I0e = 1e-10; - - double sum, u, halfx, temp; - int n; - - sum = u = n = 1; - halfx = x/2.0; - - do { - temp = halfx/n++; - u *= temp*temp; - sum += u; - } while (u >= I0e*sum); - - return sum; -} - - -// ---------------------------------------------------------------------------- -// Setting of SID sampling parameters. -// -// Use a clock freqency of 985248Hz for PAL C64, 1022730Hz for NTSC C64. -// The default end of passband frequency is pass_freq = 0.9*sample_freq/2 -// for sample frequencies up to ~ 44.1kHz, and 20kHz for higher sample -// frequencies. -// -// For resampling, the ratio between the clock frequency and the sample -// frequency is limited as follows: -// 125*clock_freq/sample_freq < 16384 -// E.g. provided a clock frequency of ~ 1MHz, the sample frequency can not -// be set lower than ~ 8kHz. A lower sample frequency would make the -// resampling code overfill its 16k sample ring buffer. -// -// The end of passband frequency is also limited: -// pass_freq <= 0.9*sample_freq/2 - -// E.g. for a 44.1kHz sampling rate the end of passband frequency is limited -// to slightly below 20kHz. This constraint ensures that the FIR table is -// not overfilled. -// ---------------------------------------------------------------------------- -bool SIDFP::set_sampling_parameters(float clock_freq, sampling_method method, - float sample_freq, float pass_freq) -{ - clock_frequency = clock_freq; - sampling = method; - - filter.set_clock_frequency(clock_freq); - extfilt.set_clock_frequency(clock_freq); - adjust_sampling_frequency(sample_freq); - - sample_offset = 0; - sample_prev = 0; - - // FIR initialization is only necessary for resampling. - if (method != SAMPLE_RESAMPLE_INTERPOLATE) - { - delete[] sample; - delete[] fir; - sample = 0; - fir = 0; - return true; - } - - const int bits = 16; - - if (pass_freq > 20000) - pass_freq = 20000; - if (2*pass_freq/sample_freq > 0.9) - pass_freq = 0.9f*sample_freq/2; - - // 16 bits -> -96dB stopband attenuation. - const double A = -20*log10(1.0/(1 << bits)); - - // For calculation of beta and N see the reference for the kaiserord - // function in the MATLAB Signal Processing Toolbox: - // http://www.mathworks.com/access/helpdesk/help/toolbox/signal/kaiserord.html - const double beta = 0.1102*(A - 8.7); - const double I0beta = I0(beta); - - double f_samples_per_cycle = sample_freq/clock_freq; - double f_cycles_per_sample = clock_freq/sample_freq; - - /* This code utilizes the fact that aliasing back to 20 kHz from - * sample_freq/2 is inaudible. This allows us to define a passband - * wider than normally. We might also consider aliasing back to pass_freq, - * but as this can be less than 20 kHz, it might become audible... */ - double aliasing_allowance = sample_freq / 2 - 20000; - if (aliasing_allowance < 0) - aliasing_allowance = 0; - - double transition_bandwidth = sample_freq/2 - pass_freq + aliasing_allowance; - { - /* Filter order according to Kaiser's paper. */ - - int N = (int) ((A - 7.95)/(2 * M_PI * 2.285 * transition_bandwidth/sample_freq) + 0.5); - N += N & 1; - - // The filter length is equal to the filter order + 1. - // The filter length must be an odd number (sinc is symmetric about x = 0). - fir_N = int(N*f_cycles_per_sample) + 1; - fir_N |= 1; - - // Check whether the sample ring buffer would overfill. - if (fir_N > RINGSIZE - 1) - return false; - - /* Error is bound by 1.234 / L^2 */ - fir_RES = (int) (sqrt(1.234 * (1 << bits)) / f_cycles_per_sample + 0.5); - } - - // Allocate memory for FIR tables. - delete[] fir; - fir = new float[fir_N*fir_RES]; - - // The cutoff frequency is midway through the transition band. - double wc = (pass_freq + transition_bandwidth/2) / sample_freq * M_PI * 2; - - // Calculate fir_RES FIR tables for linear interpolation. - for (int i = 0; i < fir_RES; i++) { - double j_offset = double(i)/fir_RES; - // Calculate FIR table. This is the sinc function, weighted by the - // Kaiser window. - for (int j = 0; j < fir_N; j ++) { - double jx = j - fir_N/2. - j_offset; - double wt = wc*jx/f_cycles_per_sample; - double temp = jx/(fir_N/2); - double Kaiser = - fabs(temp) <= 1 ? I0(beta*sqrt(1 - temp*temp))/I0beta : 0; - double sincwt = - fabs(wt) >= 1e-8 ? sin(wt)/wt : 1; - fir[i * fir_N + j] = (float) (f_samples_per_cycle*wc/M_PI*sincwt*Kaiser); - } - } - - // Allocate sample buffer. - if (!sample) { - sample = new float[RINGSIZE*2]; - } - // Clear sample buffer. - for (int j = 0; j < RINGSIZE*2; j++) { - sample[j] = 0; - } - sample_index = 0; - - return true; -} - -// ---------------------------------------------------------------------------- -// Adjustment of SID sampling frequency. -// -// In some applications, e.g. a C64 emulator, it can be desirable to -// synchronize sound with a timer source. This is supported by adjustment of -// the SID sampling frequency. -// -// NB! Adjustment of the sampling frequency may lead to noticeable shifts in -// frequency, and should only be used for interactive applications. Note also -// that any adjustment of the sampling frequency will change the -// characteristics of the resampling filter, since the filter is not rebuilt. -// ---------------------------------------------------------------------------- -void SIDFP::adjust_sampling_frequency(float sample_freq) -{ - cycles_per_sample = clock_frequency/sample_freq; -} - -void SIDFP::age_bus_value(cycle_count n) { - if (bus_value_ttl != 0) { - bus_value_ttl -= n; - if (bus_value_ttl <= 0) { - bus_value = 0; - bus_value_ttl = 0; - } - } -} - -// ---------------------------------------------------------------------------- -// SID clocking - 1 cycle. -// ---------------------------------------------------------------------------- -void SIDFP::clock() -{ - int i; - - // Clock amplitude modulators. - for (i = 0; i < 3; i++) { - voice[i].envelope.clock(); - } - - // Clock oscillators. - for (i = 0; i < 3; i++) { - voice[i].wave.clock(); - } - - // Synchronize oscillators. - for (i = 0; i < 3; i++) { - voice[i].wave.synchronize(); - } - - // Clock filter. - extfilt.clock(filter.clock(voice[0].output(), voice[1].output(), voice[2].output(), ext_in)); -} - -// ---------------------------------------------------------------------------- -// SID clocking with audio sampling. -// Fixpoint arithmetics is used. -// -// The example below shows how to clock the SID a specified amount of cycles -// while producing audio output: -// -// while (delta_t) { -// bufindex += sid.clock(delta_t, buf + bufindex, buflength - bufindex); -// write(dsp, buf, bufindex*2); -// bufindex = 0; -// } -// -// ---------------------------------------------------------------------------- -int SIDFP::clock(cycle_count& delta_t, short* buf, int n, int interleave) -{ - /* XXX I assume n is generally large enough for delta_t here... */ - age_bus_value(delta_t); - int res; - switch (sampling) { - default: - case SAMPLE_INTERPOLATE: - res = clock_interpolate(delta_t, buf, n, interleave); - break; - case SAMPLE_RESAMPLE_INTERPOLATE: - res = clock_resample_interpolate(delta_t, buf, n, interleave); - break; - } - - filter.nuke_denormals(); - extfilt.nuke_denormals(); - - return res; -} - -// ---------------------------------------------------------------------------- -// SID clocking with audio sampling - cycle based with linear sample -// interpolation. -// -// Here the chip is clocked every cycle. This yields higher quality -// sound since the samples are linearly interpolated, and since the -// external filter attenuates frequencies above 16kHz, thus reducing -// sampling noise. -// ---------------------------------------------------------------------------- -RESID_INLINE -int SIDFP::clock_interpolate(cycle_count& delta_t, short* buf, int n, - int interleave) -{ - int s = 0; - int i; - - for (;;) { - float next_sample_offset = sample_offset + cycles_per_sample; - int delta_t_sample = (int) next_sample_offset; - if (delta_t_sample > delta_t) { - break; - } - if (s >= n) { - return s; - } - for (i = 0; i < delta_t_sample - 1; i++) { - clock(); - } - if (i < delta_t_sample) { - sample_prev = output(); - clock(); - } - - delta_t -= delta_t_sample; - sample_offset = next_sample_offset - delta_t_sample; - - float sample_now = output(); - int v = (int)(sample_prev + (sample_offset * (sample_now - sample_prev))); - // Saturated arithmetics to guard against 16 bit sample overflow. - const int half = 1 << 15; - if (v >= half) { - v = half - 1; - } - else if (v < -half) { - v = -half; - } - buf[s++*interleave] = v; - - sample_prev = sample_now; - } - - for (i = 0; i < delta_t - 1; i++) { - clock(); - } - if (i < delta_t) { - sample_prev = output(); - clock(); - } - sample_offset -= delta_t; - delta_t = 0; - return s; -} - -// ---------------------------------------------------------------------------- -// SID clocking with audio sampling - cycle based with audio resampling. -// -// This is the theoretically correct (and computationally intensive) audio -// sample generation. The samples are generated by resampling to the specified -// sampling frequency. The work rate is inversely proportional to the -// percentage of the bandwidth allocated to the filter transition band. -// -// This implementation is based on the paper "A Flexible Sampling-Rate -// Conversion Method", by J. O. Smith and P. Gosset, or rather on the -// expanded tutorial on the "Digital Audio Resampling Home Page": -// http://www-ccrma.stanford.edu/~jos/resample/ -// -// By building shifted FIR tables with samples according to the -// sampling frequency, this implementation dramatically reduces the -// computational effort in the filter convolutions, without any loss -// of accuracy. The filter convolutions are also vectorizable on -// current hardware. -// -// Further possible optimizations are: -// * An equiripple filter design could yield a lower filter order, see -// http://www.mwrf.com/Articles/ArticleID/7229/7229.html -// * The Convolution Theorem could be used to bring the complexity of -// convolution down from O(n*n) to O(n*log(n)) using the Fast Fourier -// Transform, see http://en.wikipedia.org/wiki/Convolution_theorem -// * Simply resampling in two steps can also yield computational -// savings, since the transition band will be wider in the first step -// and the required filter order is thus lower in this step. -// Laurent Ganier has found the optimal intermediate sampling frequency -// to be (via derivation of sum of two steps): -// 2 * pass_freq + sqrt [ 2 * pass_freq * orig_sample_freq -// * (dest_sample_freq - 2 * pass_freq) / dest_sample_freq ] -// -// NB! the result of right shifting negative numbers is really -// implementation dependent in the C++ standard. -// ---------------------------------------------------------------------------- -RESID_INLINE -int SIDFP::clock_resample_interpolate(cycle_count& delta_t, short* buf, int n, - int interleave) -{ - int s = 0; - - for (;;) { - float next_sample_offset = sample_offset + cycles_per_sample; - /* full clocks left to next sample */ - int delta_t_sample = (int) next_sample_offset; - if (delta_t_sample > delta_t || s >= n) - break; - - /* clock forward delta_t_sample samples */ - for (int i = 0; i < delta_t_sample; i++) { - clock(); - sample[sample_index] = sample[sample_index + RINGSIZE] = output(); - ++ sample_index; - sample_index &= RINGSIZE - 1; - } - delta_t -= delta_t_sample; - - /* Phase of the sample in terms of clock, [0 .. 1[. */ - sample_offset = next_sample_offset - (float) delta_t_sample; - - /* find the first of the nearest fir tables close to the phase */ - float fir_offset_rmd = sample_offset * fir_RES; - int fir_offset = (int) fir_offset_rmd; - /* [0 .. 1[ */ - fir_offset_rmd -= (float) fir_offset; - - /* find fir_N most recent samples, plus one extra in case the FIR wraps. */ - float* sample_start = sample + sample_index - fir_N + RINGSIZE - 1; - - float v1 = -#if (RESID_USE_SSE==1) - can_use_sse ? convolve_sse(sample_start, fir + fir_offset*fir_N, fir_N) : -#endif - convolve(sample_start, fir + fir_offset*fir_N, fir_N); - - // Use next FIR table, wrap around to first FIR table using - // previous sample. - if (++ fir_offset == fir_RES) { - fir_offset = 0; - ++ sample_start; - } - float v2 = -#if (RESID_USE_SSE==1) - can_use_sse ? convolve_sse(sample_start, fir + fir_offset*fir_N, fir_N) : -#endif - convolve(sample_start, fir + fir_offset*fir_N, fir_N); - - // Linear interpolation between the sinc tables yields good approximation - // for the exact value. - int v = (int) (v1 + fir_offset_rmd * (v2 - v1)); - - // Saturated arithmetics to guard against 16 bit sample overflow. - const int half = 1 << 15; - if (v >= half) { - v = half - 1; - } - else if (v < -half) { - v = -half; - } - - buf[s ++ * interleave] = v; - } - - /* clock forward delta_t samples */ - for (int i = 0; i < delta_t; i++) { - clock(); - sample[sample_index] = sample[sample_index + RINGSIZE] = output(); - ++ sample_index; - sample_index &= RINGSIZE - 1; - } - sample_offset -= (float) delta_t; - delta_t = 0; - return s; -} +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 "sid.h" +#include +#include + +extern float convolve(const float *a, const float *b, int n); +extern float convolve_sse(const float *a, const float *b, int n); + +enum host_cpu_feature { + HOST_CPU_MMX=1, HOST_CPU_SSE=2, HOST_CPU_SSE2=4, HOST_CPU_SSE3=8 +}; + +/* This code is appropriate for 32-bit and 64-bit x86 CPUs. */ +#if defined(__x86_64__) || defined(__i386__) || defined(_MSC_VER) + +struct cpu_x86_regs_s { + unsigned int eax; + unsigned int ebx; + unsigned int ecx; + unsigned int edx; +}; +typedef struct cpu_x86_regs_s cpu_x86_regs_t; + +static cpu_x86_regs_t get_cpuid_regs(unsigned int index) +{ + cpu_x86_regs_t retval; + +#if defined(_MSC_VER) /* MSVC assembly */ + __asm { + mov eax, [index] + cpuid + mov [retval.eax], eax + mov [retval.ebx], ebx + mov [retval.ecx], ecx + mov [retval.edx], edx + } +#else /* GNU assembly */ + asm("movl %4, %%eax; cpuid; movl %%eax, %0; movl %%ebx, %1; movl %%ecx, %2; movl %%edx, %3;" + : "=m" (retval.eax), + "=m" (retval.ebx), + "=m" (retval.ecx), + "=m" (retval.edx) + : "r" (index) + : "eax", "ebx", "ecx", "edx"); +#endif + + return retval; +} + +static int host_cpu_features_by_cpuid(void) +{ + cpu_x86_regs_t regs = get_cpuid_regs(1); + + int features = 0; + if (regs.edx & (1 << 23)) + features |= HOST_CPU_MMX; + if (regs.edx & (1 << 25)) + features |= HOST_CPU_SSE; + if (regs.edx & (1 << 26)) + features |= HOST_CPU_SSE2; + if (regs.ecx & (1 << 0)) + features |= HOST_CPU_SSE3; + + return features; +} + +static int host_cpu_features(void) +{ + static int features = 0; + static int features_detected = 0; +/* 32-bit only */ +#if defined(__i386__) || (defined(_MSC_VER) && defined(_WIN32)) + unsigned long temp1, temp2; +#endif + + if (features_detected) + return features; + features_detected = 1; + +#if defined(_MSC_VER) && defined(_WIN32) /* MSVC compatible assembly appropriate for 32-bit Windows */ + /* see if we are dealing with a cpu that has the cpuid instruction */ + __asm { + pushf + pop eax + mov [temp1], eax + xor eax, 0x200000 + push eax + popf + pushf + pop eax + mov [temp2], eax + push [temp1] + popf + } +#endif +#if defined(__i386__) /* GNU assembly */ + asm("pushfl; popl %%eax; movl %%eax, %0; xorl $0x200000, %%eax; pushl %%eax; popfl; pushfl; popl %%eax; movl %%eax, %1; pushl %0; popfl " + : "=r" (temp1), + "=r" (temp2) + : + : "eax"); +#endif +#if defined(__i386__) || (defined(_MSC_VER) && defined(_WIN32)) + temp1 &= 0x200000; + temp2 &= 0x200000; + if (temp1 == temp2) { + /* no cpuid support, so we can't test for SSE availability -> false */ + return 0; + } +#endif + + /* find the highest supported cpuid function, returned in %eax */ + if (get_cpuid_regs(0).eax < 1) { + /* no cpuid 1 function, we can't test for features -> no features */ + return 0; + } + + features = host_cpu_features_by_cpuid(); + return features; +} + +#else /* !__x86_64__ && !__i386__ && !_MSC_VER */ +static int host_cpu_features(void) +{ + return 0; +} +#endif + +float SIDFP::kinked_dac(const int x, const float nonlinearity, const int max) +{ + float value = 0.f; + + int bit = 1; + float weight = 1.f; + const float dir = 2.0f * nonlinearity; + for (int i = 0; i < max; i ++) { + if (x & bit) + value += weight; + bit <<= 1; + weight *= dir; + } + + return value / (weight / nonlinearity) * (1 << max); +} + +// ---------------------------------------------------------------------------- +// Constructor. +// ---------------------------------------------------------------------------- +SIDFP::SIDFP() +{ +#if (RESID_USE_SSE==1) + can_use_sse = (host_cpu_features() & HOST_CPU_SSE) != 0; +#else + can_use_sse = false; +#endif + + // Initialize pointers. + sample = 0; + fir = 0; + + voice[0].set_sync_source(&voice[2]); + voice[1].set_sync_source(&voice[0]); + voice[2].set_sync_source(&voice[1]); + + set_sampling_parameters(985248, SAMPLE_INTERPOLATE, 44100); + + bus_value = 0; + bus_value_ttl = 0; + + input(0); +} + + +// ---------------------------------------------------------------------------- +// Destructor. +// ---------------------------------------------------------------------------- +SIDFP::~SIDFP() +{ + delete[] sample; + delete[] fir; +} + + +// ---------------------------------------------------------------------------- +// Set chip model. +// ---------------------------------------------------------------------------- +void SIDFP::set_chip_model(chip_model model) +{ + for (int i = 0; i < 3; i++) { + voice[i].set_chip_model(model); + } + + filter.set_chip_model(model); + extfilt.set_chip_model(model); +} + +/* nonlinear DAC support, set 1 for 8580 / no effect, about 0.96 otherwise */ +void SIDFP::set_voice_nonlinearity(float nl) +{ + for (int i = 0; i < 3; i++) { + voice[i].set_nonlinearity(nl); + } +} + +// ---------------------------------------------------------------------------- +// SID reset. +// ---------------------------------------------------------------------------- +void SIDFP::reset() +{ + for (int i = 0; i < 3; i++) { + voice[i].reset(); + } + filter.reset(); + extfilt.reset(); + + bus_value = 0; + bus_value_ttl = 0; +} + + +// ---------------------------------------------------------------------------- +// Write 16-bit sample to audio input. +// NB! The caller is responsible for keeping the value within 16 bits. +// Note that to mix in an external audio signal, the signal should be +// resampled to 1MHz first to avoid sampling noise. +// ---------------------------------------------------------------------------- +void SIDFP::input(int sample) +{ + // Voice outputs are 20 bits. Scale up to match three voices in order + // to facilitate simulation of the MOS8580 "digi boost" hardware hack. + ext_in = (float) ( (sample << 4) * 3 ); +} + +float SIDFP::output() +{ + const float range = 1 << 15; + return extfilt.output() / (4095.f * 255.f * 3.f * 1.5f / range); +} + +// ---------------------------------------------------------------------------- +// Read registers. +// +// Reading a write only register returns the last byte written to any SID +// register. The individual bits in this value start to fade down towards +// zero after a few cycles. All bits reach zero within approximately +// $2000 - $4000 cycles. +// It has been claimed that this fading happens in an orderly fashion, however +// sampling of write only registers reveals that this is not the case. +// NB! This is not correctly modeled. +// The actual use of write only registers has largely been made in the belief +// that all SID registers are readable. To support this belief the read +// would have to be done immediately after a write to the same register +// (remember that an intermediate write to another register would yield that +// value instead). With this in mind we return the last value written to +// any SID register for $2000 cycles without modeling the bit fading. +// ---------------------------------------------------------------------------- +reg8 SIDFP::read(reg8 offset) +{ + switch (offset) { + case 0x19: + return potx.readPOT(); + case 0x1a: + return poty.readPOT(); + case 0x1b: + return voice[2].wave.readOSC(); + case 0x1c: + return voice[2].envelope.readENV(); + default: + return bus_value; + } +} + + +// ---------------------------------------------------------------------------- +// Write registers. +// ---------------------------------------------------------------------------- +void SIDFP::write(reg8 offset, reg8 value) +{ + bus_value = value; + bus_value_ttl = 0x4000; + + switch (offset) { + case 0x00: + voice[0].wave.writeFREQ_LO(value); + break; + case 0x01: + voice[0].wave.writeFREQ_HI(value); + break; + case 0x02: + voice[0].wave.writePW_LO(value); + break; + case 0x03: + voice[0].wave.writePW_HI(value); + break; + case 0x04: + voice[0].writeCONTROL_REG(value); + break; + case 0x05: + voice[0].envelope.writeATTACK_DECAY(value); + break; + case 0x06: + voice[0].envelope.writeSUSTAIN_RELEASE(value); + break; + case 0x07: + voice[1].wave.writeFREQ_LO(value); + break; + case 0x08: + voice[1].wave.writeFREQ_HI(value); + break; + case 0x09: + voice[1].wave.writePW_LO(value); + break; + case 0x0a: + voice[1].wave.writePW_HI(value); + break; + case 0x0b: + voice[1].writeCONTROL_REG(value); + break; + case 0x0c: + voice[1].envelope.writeATTACK_DECAY(value); + break; + case 0x0d: + voice[1].envelope.writeSUSTAIN_RELEASE(value); + break; + case 0x0e: + voice[2].wave.writeFREQ_LO(value); + break; + case 0x0f: + voice[2].wave.writeFREQ_HI(value); + break; + case 0x10: + voice[2].wave.writePW_LO(value); + break; + case 0x11: + voice[2].wave.writePW_HI(value); + break; + case 0x12: + voice[2].writeCONTROL_REG(value); + break; + case 0x13: + voice[2].envelope.writeATTACK_DECAY(value); + break; + case 0x14: + voice[2].envelope.writeSUSTAIN_RELEASE(value); + break; + case 0x15: + filter.writeFC_LO(value); + break; + case 0x16: + filter.writeFC_HI(value); + break; + case 0x17: + filter.writeRES_FILT(value); + break; + case 0x18: + filter.writeMODE_VOL(value); + break; + default: + break; + } +} + + +// ---------------------------------------------------------------------------- +// Constructor. +// ---------------------------------------------------------------------------- +SIDFP::State::State() +{ + int i; + + for (i = 0; i < 0x20; i++) { + sid_register[i] = 0; + } + + bus_value = 0; + bus_value_ttl = 0; + + for (i = 0; i < 3; i++) { + accumulator[i] = 0; + shift_register[i] = 0x7ffff8; + rate_counter[i] = 0; + rate_counter_period[i] = 9; + exponential_counter[i] = 0; + exponential_counter_period[i] = 1; + envelope_counter[i] = 0; + envelope_state[i] = EnvelopeGeneratorFP::RELEASE; + hold_zero[i] = true; + } +} + + +// ---------------------------------------------------------------------------- +// Read state. +// ---------------------------------------------------------------------------- +SIDFP::State SIDFP::read_state() +{ + State state; + int i, j; + + for (i = 0, j = 0; i < 3; i++, j += 7) { + WaveformGeneratorFP& wave = voice[i].wave; + EnvelopeGeneratorFP& envelope = voice[i].envelope; + state.sid_register[j + 0] = wave.freq & 0xff; + state.sid_register[j + 1] = wave.freq >> 8; + state.sid_register[j + 2] = wave.pw & 0xff; + state.sid_register[j + 3] = wave.pw >> 8; + state.sid_register[j + 4] = + (wave.waveform << 4) + | (wave.test ? 0x08 : 0) + | (wave.ring_mod ? 0x04 : 0) + | (wave.sync ? 0x02 : 0) + | (envelope.gate ? 0x01 : 0); + state.sid_register[j + 5] = (envelope.attack << 4) | envelope.decay; + state.sid_register[j + 6] = (envelope.sustain << 4) | envelope.release; + } + + state.sid_register[j++] = filter.fc & 0x007; + state.sid_register[j++] = filter.fc >> 3; + state.sid_register[j++] = (filter.res << 4) | filter.filt; + state.sid_register[j++] = + (filter.voice3off ? 0x80 : 0) + | (filter.hp_bp_lp << 4) + | filter.vol; + + // These registers are superfluous, but included for completeness. + for (; j < 0x1d; j++) { + state.sid_register[j] = read(j); + } + for (; j < 0x20; j++) { + state.sid_register[j] = 0; + } + + state.bus_value = bus_value; + state.bus_value_ttl = bus_value_ttl; + + for (i = 0; i < 3; i++) { + state.accumulator[i] = voice[i].wave.accumulator; + state.shift_register[i] = voice[i].wave.shift_register; + state.rate_counter[i] = voice[i].envelope.rate_counter; + state.rate_counter_period[i] = voice[i].envelope.rate_period; + state.exponential_counter[i] = voice[i].envelope.exponential_counter; + state.exponential_counter_period[i] = voice[i].envelope.exponential_counter_period; + state.envelope_counter[i] = voice[i].envelope.envelope_counter; + state.envelope_state[i] = voice[i].envelope.state; + state.hold_zero[i] = voice[i].envelope.hold_zero; + } + + return state; +} + + +// ---------------------------------------------------------------------------- +// Write state. +// ---------------------------------------------------------------------------- +void SIDFP::write_state(const State& state) +{ + int i; + + for (i = 0; i <= 0x18; i++) { + write(i, state.sid_register[i]); + } + + bus_value = state.bus_value; + bus_value_ttl = state.bus_value_ttl; + + for (i = 0; i < 3; i++) { + voice[i].wave.accumulator = state.accumulator[i]; + voice[i].wave.shift_register = state.shift_register[i]; + voice[i].envelope.rate_counter = state.rate_counter[i]; + voice[i].envelope.rate_period = state.rate_counter_period[i]; + voice[i].envelope.exponential_counter = state.exponential_counter[i]; + voice[i].envelope.exponential_counter_period = state.exponential_counter_period[i]; + voice[i].envelope.envelope_counter = state.envelope_counter[i]; + voice[i].envelope.state = state.envelope_state[i]; + voice[i].envelope.hold_zero = state.hold_zero[i]; + } +} + + +// ---------------------------------------------------------------------------- +// Enable filter. +// ---------------------------------------------------------------------------- +void SIDFP::enable_filter(bool enable) +{ + filter.enable_filter(enable); +} + + +// ---------------------------------------------------------------------------- +// Enable external filter. +// ---------------------------------------------------------------------------- +void SIDFP::enable_external_filter(bool enable) +{ + extfilt.enable_filter(enable); +} + + +// ---------------------------------------------------------------------------- +// I0() computes the 0th order modified Bessel function of the first kind. +// This function is originally from resample-1.5/filterkit.c by J. O. Smith. +// ---------------------------------------------------------------------------- +double SIDFP::I0(double x) +{ + // Max error acceptable in I0 could be 1e-6, which gives that 96 dB already. + // I'm overspecify these errors to get a beautiful FFT dump of the FIR. + const double I0e = 1e-10; + + double sum, u, halfx, temp; + int n; + + sum = u = n = 1; + halfx = x/2.0; + + do { + temp = halfx/n++; + u *= temp*temp; + sum += u; + } while (u >= I0e*sum); + + return sum; +} + + +// ---------------------------------------------------------------------------- +// Setting of SID sampling parameters. +// +// Use a clock freqency of 985248Hz for PAL C64, 1022730Hz for NTSC C64. +// The default end of passband frequency is pass_freq = 0.9*sample_freq/2 +// for sample frequencies up to ~ 44.1kHz, and 20kHz for higher sample +// frequencies. +// +// For resampling, the ratio between the clock frequency and the sample +// frequency is limited as follows: +// 125*clock_freq/sample_freq < 16384 +// E.g. provided a clock frequency of ~ 1MHz, the sample frequency can not +// be set lower than ~ 8kHz. A lower sample frequency would make the +// resampling code overfill its 16k sample ring buffer. +// +// The end of passband frequency is also limited: +// pass_freq <= 0.9*sample_freq/2 + +// E.g. for a 44.1kHz sampling rate the end of passband frequency is limited +// to slightly below 20kHz. This constraint ensures that the FIR table is +// not overfilled. +// ---------------------------------------------------------------------------- +bool SIDFP::set_sampling_parameters(float clock_freq, sampling_method method, + float sample_freq, float pass_freq) +{ + clock_frequency = clock_freq; + sampling = method; + + filter.set_clock_frequency(clock_freq); + extfilt.set_clock_frequency(clock_freq); + adjust_sampling_frequency(sample_freq); + + sample_offset = 0; + sample_prev = 0; + + // FIR initialization is only necessary for resampling. + if (method != SAMPLE_RESAMPLE_INTERPOLATE) + { + delete[] sample; + delete[] fir; + sample = 0; + fir = 0; + return true; + } + + const int bits = 16; + + if (pass_freq > 20000) + pass_freq = 20000; + if (2*pass_freq/sample_freq > 0.9) + pass_freq = 0.9f*sample_freq/2; + + // 16 bits -> -96dB stopband attenuation. + const double A = -20*log10(1.0/(1 << bits)); + + // For calculation of beta and N see the reference for the kaiserord + // function in the MATLAB Signal Processing Toolbox: + // http://www.mathworks.com/access/helpdesk/help/toolbox/signal/kaiserord.html + const double beta = 0.1102*(A - 8.7); + const double I0beta = I0(beta); + + double f_samples_per_cycle = sample_freq/clock_freq; + double f_cycles_per_sample = clock_freq/sample_freq; + + /* This code utilizes the fact that aliasing back to 20 kHz from + * sample_freq/2 is inaudible. This allows us to define a passband + * wider than normally. We might also consider aliasing back to pass_freq, + * but as this can be less than 20 kHz, it might become audible... */ + double aliasing_allowance = sample_freq / 2 - 20000; + if (aliasing_allowance < 0) + aliasing_allowance = 0; + + double transition_bandwidth = sample_freq/2 - pass_freq + aliasing_allowance; + { + /* Filter order according to Kaiser's paper. */ + + int N = (int) ((A - 7.95)/(2 * M_PI * 2.285 * transition_bandwidth/sample_freq) + 0.5); + N += N & 1; + + // The filter length is equal to the filter order + 1. + // The filter length must be an odd number (sinc is symmetric about x = 0). + fir_N = int(N*f_cycles_per_sample) + 1; + fir_N |= 1; + + // Check whether the sample ring buffer would overfill. + if (fir_N > RINGSIZE - 1) + return false; + + /* Error is bound by 1.234 / L^2 */ + fir_RES = (int) (sqrt(1.234 * (1 << bits)) / f_cycles_per_sample + 0.5); + } + + // Allocate memory for FIR tables. + delete[] fir; + fir = new float[fir_N*fir_RES]; + + // The cutoff frequency is midway through the transition band. + double wc = (pass_freq + transition_bandwidth/2) / sample_freq * M_PI * 2; + + // Calculate fir_RES FIR tables for linear interpolation. + for (int i = 0; i < fir_RES; i++) { + double j_offset = double(i)/fir_RES; + // Calculate FIR table. This is the sinc function, weighted by the + // Kaiser window. + for (int j = 0; j < fir_N; j ++) { + double jx = j - fir_N/2. - j_offset; + double wt = wc*jx/f_cycles_per_sample; + double temp = jx/(fir_N/2); + double Kaiser = + fabs(temp) <= 1 ? I0(beta*sqrt(1 - temp*temp))/I0beta : 0; + double sincwt = + fabs(wt) >= 1e-8 ? sin(wt)/wt : 1; + fir[i * fir_N + j] = (float) (f_samples_per_cycle*wc/M_PI*sincwt*Kaiser); + } + } + + // Allocate sample buffer. + if (!sample) { + sample = new float[RINGSIZE*2]; + } + // Clear sample buffer. + for (int j = 0; j < RINGSIZE*2; j++) { + sample[j] = 0; + } + sample_index = 0; + + return true; +} + +// ---------------------------------------------------------------------------- +// Adjustment of SID sampling frequency. +// +// In some applications, e.g. a C64 emulator, it can be desirable to +// synchronize sound with a timer source. This is supported by adjustment of +// the SID sampling frequency. +// +// NB! Adjustment of the sampling frequency may lead to noticeable shifts in +// frequency, and should only be used for interactive applications. Note also +// that any adjustment of the sampling frequency will change the +// characteristics of the resampling filter, since the filter is not rebuilt. +// ---------------------------------------------------------------------------- +void SIDFP::adjust_sampling_frequency(float sample_freq) +{ + cycles_per_sample = clock_frequency/sample_freq; +} + +void SIDFP::age_bus_value(cycle_count n) { + if (bus_value_ttl != 0) { + bus_value_ttl -= n; + if (bus_value_ttl <= 0) { + bus_value = 0; + bus_value_ttl = 0; + } + } +} + +// ---------------------------------------------------------------------------- +// SID clocking - 1 cycle. +// ---------------------------------------------------------------------------- +void SIDFP::clock() +{ + int i; + + // Clock amplitude modulators. + for (i = 0; i < 3; i++) { + voice[i].envelope.clock(); + } + + // Clock oscillators. + for (i = 0; i < 3; i++) { + voice[i].wave.clock(); + } + + // Synchronize oscillators. + for (i = 0; i < 3; i++) { + voice[i].wave.synchronize(); + } + + // Clock filter. + extfilt.clock(filter.clock(voice[0].output(), voice[1].output(), voice[2].output(), ext_in)); +} + +// ---------------------------------------------------------------------------- +// SID clocking with audio sampling. +// Fixpoint arithmetics is used. +// +// The example below shows how to clock the SID a specified amount of cycles +// while producing audio output: +// +// while (delta_t) { +// bufindex += sid.clock(delta_t, buf + bufindex, buflength - bufindex); +// write(dsp, buf, bufindex*2); +// bufindex = 0; +// } +// +// ---------------------------------------------------------------------------- +int SIDFP::clock(cycle_count& delta_t, short* buf, int n, int interleave) +{ + /* XXX I assume n is generally large enough for delta_t here... */ + age_bus_value(delta_t); + int res; + switch (sampling) { + default: + case SAMPLE_INTERPOLATE: + res = clock_interpolate(delta_t, buf, n, interleave); + break; + case SAMPLE_RESAMPLE_INTERPOLATE: + res = clock_resample_interpolate(delta_t, buf, n, interleave); + break; + } + + filter.nuke_denormals(); + extfilt.nuke_denormals(); + + return res; +} + +// ---------------------------------------------------------------------------- +// SID clocking with audio sampling - cycle based with linear sample +// interpolation. +// +// Here the chip is clocked every cycle. This yields higher quality +// sound since the samples are linearly interpolated, and since the +// external filter attenuates frequencies above 16kHz, thus reducing +// sampling noise. +// ---------------------------------------------------------------------------- +RESID_INLINE +int SIDFP::clock_interpolate(cycle_count& delta_t, short* buf, int n, + int interleave) +{ + int s = 0; + int i; + + for (;;) { + float next_sample_offset = sample_offset + cycles_per_sample; + int delta_t_sample = (int) next_sample_offset; + if (delta_t_sample > delta_t) { + break; + } + if (s >= n) { + return s; + } + for (i = 0; i < delta_t_sample - 1; i++) { + clock(); + } + if (i < delta_t_sample) { + sample_prev = output(); + clock(); + } + + delta_t -= delta_t_sample; + sample_offset = next_sample_offset - delta_t_sample; + + float sample_now = output(); + int v = (int)(sample_prev + (sample_offset * (sample_now - sample_prev))); + // Saturated arithmetics to guard against 16 bit sample overflow. + const int half = 1 << 15; + if (v >= half) { + v = half - 1; + } + else if (v < -half) { + v = -half; + } + buf[s++*interleave] = v; + + sample_prev = sample_now; + } + + for (i = 0; i < delta_t - 1; i++) { + clock(); + } + if (i < delta_t) { + sample_prev = output(); + clock(); + } + sample_offset -= delta_t; + delta_t = 0; + return s; +} + +// ---------------------------------------------------------------------------- +// SID clocking with audio sampling - cycle based with audio resampling. +// +// This is the theoretically correct (and computationally intensive) audio +// sample generation. The samples are generated by resampling to the specified +// sampling frequency. The work rate is inversely proportional to the +// percentage of the bandwidth allocated to the filter transition band. +// +// This implementation is based on the paper "A Flexible Sampling-Rate +// Conversion Method", by J. O. Smith and P. Gosset, or rather on the +// expanded tutorial on the "Digital Audio Resampling Home Page": +// http://www-ccrma.stanford.edu/~jos/resample/ +// +// By building shifted FIR tables with samples according to the +// sampling frequency, this implementation dramatically reduces the +// computational effort in the filter convolutions, without any loss +// of accuracy. The filter convolutions are also vectorizable on +// current hardware. +// +// Further possible optimizations are: +// * An equiripple filter design could yield a lower filter order, see +// http://www.mwrf.com/Articles/ArticleID/7229/7229.html +// * The Convolution Theorem could be used to bring the complexity of +// convolution down from O(n*n) to O(n*log(n)) using the Fast Fourier +// Transform, see http://en.wikipedia.org/wiki/Convolution_theorem +// * Simply resampling in two steps can also yield computational +// savings, since the transition band will be wider in the first step +// and the required filter order is thus lower in this step. +// Laurent Ganier has found the optimal intermediate sampling frequency +// to be (via derivation of sum of two steps): +// 2 * pass_freq + sqrt [ 2 * pass_freq * orig_sample_freq +// * (dest_sample_freq - 2 * pass_freq) / dest_sample_freq ] +// +// NB! the result of right shifting negative numbers is really +// implementation dependent in the C++ standard. +// ---------------------------------------------------------------------------- +RESID_INLINE +int SIDFP::clock_resample_interpolate(cycle_count& delta_t, short* buf, int n, + int interleave) +{ + int s = 0; + + for (;;) { + float next_sample_offset = sample_offset + cycles_per_sample; + /* full clocks left to next sample */ + int delta_t_sample = (int) next_sample_offset; + if (delta_t_sample > delta_t || s >= n) + break; + + /* clock forward delta_t_sample samples */ + for (int i = 0; i < delta_t_sample; i++) { + clock(); + sample[sample_index] = sample[sample_index + RINGSIZE] = output(); + ++ sample_index; + sample_index &= RINGSIZE - 1; + } + delta_t -= delta_t_sample; + + /* Phase of the sample in terms of clock, [0 .. 1[. */ + sample_offset = next_sample_offset - (float) delta_t_sample; + + /* find the first of the nearest fir tables close to the phase */ + float fir_offset_rmd = sample_offset * fir_RES; + int fir_offset = (int) fir_offset_rmd; + /* [0 .. 1[ */ + fir_offset_rmd -= (float) fir_offset; + + /* find fir_N most recent samples, plus one extra in case the FIR wraps. */ + float* sample_start = sample + sample_index - fir_N + RINGSIZE - 1; + + float v1 = +#if (RESID_USE_SSE==1) + can_use_sse ? convolve_sse(sample_start, fir + fir_offset*fir_N, fir_N) : +#endif + convolve(sample_start, fir + fir_offset*fir_N, fir_N); + + // Use next FIR table, wrap around to first FIR table using + // previous sample. + if (++ fir_offset == fir_RES) { + fir_offset = 0; + ++ sample_start; + } + float v2 = +#if (RESID_USE_SSE==1) + can_use_sse ? convolve_sse(sample_start, fir + fir_offset*fir_N, fir_N) : +#endif + convolve(sample_start, fir + fir_offset*fir_N, fir_N); + + // Linear interpolation between the sinc tables yields good approximation + // for the exact value. + int v = (int) (v1 + fir_offset_rmd * (v2 - v1)); + + // Saturated arithmetics to guard against 16 bit sample overflow. + const int half = 1 << 15; + if (v >= half) { + v = half - 1; + } + else if (v < -half) { + v = -half; + } + + buf[s ++ * interleave] = v; + } + + /* clock forward delta_t samples */ + for (int i = 0; i < delta_t; i++) { + clock(); + sample[sample_index] = sample[sample_index + RINGSIZE] = output(); + ++ sample_index; + sample_index &= RINGSIZE - 1; + } + sample_offset -= (float) delta_t; + delta_t = 0; + return s; +} diff --git a/src/resid-fp/sid.h b/src/resid-fp/sid.h index 5180898f..c2877e0b 100644 --- a/src/resid-fp/sid.h +++ b/src/resid-fp/sid.h @@ -1,130 +1,130 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 __SID_FP_H__ -#define __SID_FP_H__ - -#include "siddefs-fp.h" -#include "voice.h" -#include "filter.h" -#include "extfilt.h" -#include "pot.h" - -class SIDFP -{ -public: - SIDFP(); - ~SIDFP(); - - static float kinked_dac(const int x, const float nonlinearity, const int bits); - bool sse_enabled() { return can_use_sse; } - - void set_chip_model(chip_model model); - FilterFP& get_filter() { return filter; } - void enable_filter(bool enable); - void enable_external_filter(bool enable); - bool set_sampling_parameters(float clock_freq, sampling_method method, - float sample_freq, float pass_freq = -1); - void adjust_sampling_frequency(float sample_freq); - void set_voice_nonlinearity(float nonlinearity); - - void clock(); - int clock(cycle_count& delta_t, short* buf, int n, int interleave = 1); - void reset(); - - // Read/write registers. - reg8 read(reg8 offset); - void write(reg8 offset, reg8 value); - - // Read/write state. - class State - { - public: - State(); - - char sid_register[0x20]; - - reg8 bus_value; - cycle_count bus_value_ttl; - - reg24 accumulator[3]; - reg24 shift_register[3]; - reg16 rate_counter[3]; - reg16 rate_counter_period[3]; - reg16 exponential_counter[3]; - reg16 exponential_counter_period[3]; - reg8 envelope_counter[3]; - EnvelopeGeneratorFP::State envelope_state[3]; - bool hold_zero[3]; - }; - - State read_state(); - void write_state(const State& state); - - // 16-bit input (EXT IN). - void input(int sample); - - // output in range -32768 .. 32767, not clipped (AUDIO OUT) - float output(); - -protected: - static double I0(double x); - RESID_INLINE int clock_interpolate(cycle_count& delta_t, short* buf, int n, - int interleave); - RESID_INLINE int clock_resample_interpolate(cycle_count& delta_t, short* buf, - int n, int interleave); - RESID_INLINE void age_bus_value(cycle_count); - - VoiceFP voice[3]; - FilterFP filter; - ExternalFilterFP extfilt; - PotentiometerFP potx; - PotentiometerFP poty; - - reg8 bus_value; - cycle_count bus_value_ttl; - - float clock_frequency; - - // External audio input. - float ext_in; - - enum { RINGSIZE = 16384 }; - - // Sampling variables. - sampling_method sampling; - float cycles_per_sample; - float sample_offset; - int sample_index; - int fir_N; - int fir_RES; - - // Linear interpolation helper - float sample_prev; - - // Ring buffer with overflow for contiguous storage of RINGSIZE samples. - float* sample; - - // FIR_RES filter tables (FIR_N*FIR_RES). - float* fir; - - bool can_use_sse; -}; - -#endif // not __SID_H__ +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 __SID_FP_H__ +#define __SID_FP_H__ + +#include "siddefs-fp.h" +#include "voice.h" +#include "filter.h" +#include "extfilt.h" +#include "pot.h" + +class SIDFP +{ +public: + SIDFP(); + ~SIDFP(); + + static float kinked_dac(const int x, const float nonlinearity, const int bits); + bool sse_enabled() { return can_use_sse; } + + void set_chip_model(chip_model model); + FilterFP& get_filter() { return filter; } + void enable_filter(bool enable); + void enable_external_filter(bool enable); + bool set_sampling_parameters(float clock_freq, sampling_method method, + float sample_freq, float pass_freq = -1); + void adjust_sampling_frequency(float sample_freq); + void set_voice_nonlinearity(float nonlinearity); + + void clock(); + int clock(cycle_count& delta_t, short* buf, int n, int interleave = 1); + void reset(); + + // Read/write registers. + reg8 read(reg8 offset); + void write(reg8 offset, reg8 value); + + // Read/write state. + class State + { + public: + State(); + + char sid_register[0x20]; + + reg8 bus_value; + cycle_count bus_value_ttl; + + reg24 accumulator[3]; + reg24 shift_register[3]; + reg16 rate_counter[3]; + reg16 rate_counter_period[3]; + reg16 exponential_counter[3]; + reg16 exponential_counter_period[3]; + reg8 envelope_counter[3]; + EnvelopeGeneratorFP::State envelope_state[3]; + bool hold_zero[3]; + }; + + State read_state(); + void write_state(const State& state); + + // 16-bit input (EXT IN). + void input(int sample); + + // output in range -32768 .. 32767, not clipped (AUDIO OUT) + float output(); + +protected: + static double I0(double x); + RESID_INLINE int clock_interpolate(cycle_count& delta_t, short* buf, int n, + int interleave); + RESID_INLINE int clock_resample_interpolate(cycle_count& delta_t, short* buf, + int n, int interleave); + RESID_INLINE void age_bus_value(cycle_count); + + VoiceFP voice[3]; + FilterFP filter; + ExternalFilterFP extfilt; + PotentiometerFP potx; + PotentiometerFP poty; + + reg8 bus_value; + cycle_count bus_value_ttl; + + float clock_frequency; + + // External audio input. + float ext_in; + + enum { RINGSIZE = 16384 }; + + // Sampling variables. + sampling_method sampling; + float cycles_per_sample; + float sample_offset; + int sample_index; + int fir_N; + int fir_RES; + + // Linear interpolation helper + float sample_prev; + + // Ring buffer with overflow for contiguous storage of RINGSIZE samples. + float* sample; + + // FIR_RES filter tables (FIR_N*FIR_RES). + float* fir; + + bool can_use_sse; +}; + +#endif // not __SID_H__ diff --git a/src/resid-fp/siddefs-fp.h b/src/resid-fp/siddefs-fp.h index 1f3f7271..df24a705 100644 --- a/src/resid-fp/siddefs-fp.h +++ b/src/resid-fp/siddefs-fp.h @@ -1,88 +1,88 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 1999 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 __SIDDEFS_FP_H__ -#define __SIDDEFS_FP_H__ - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#define M_PI_f 3.14159265358979323846f -#else -#define M_PI_f ((float) M_PI) -#endif - -#ifndef M_LN2 -#define M_LN2 0.69314718055994530942 -#define M_LN2_f 0.69314718055994530942f -#else -#define M_LN2_f ((float) M_LN2) -#endif - -// Define bool, true, and false for C++ compilers that lack these keywords. -#define RESID_HAVE_BOOL 1 - -#if !RESID_HAVE_BOOL -typedef int bool; -const bool true = 1; -const bool false = 0; -#endif - -// We could have used the smallest possible data type for each SID register, -// however this would give a slower engine because of data type conversions. -// An int is assumed to be at least 32 bits (necessary in the types reg24, -// cycle_count, and sound_sample). GNU does not support 16-bit machines -// (GNU Coding Standards: Portability between CPUs), so this should be -// a valid assumption. - -typedef unsigned int reg4; -typedef unsigned int reg8; -typedef unsigned int reg12; -typedef unsigned int reg16; -typedef unsigned int reg24; - -typedef int cycle_count; - -enum chip_model { MOS6581FP=1, MOS8580FP }; - -enum sampling_method { SAMPLE_INTERPOLATE=1, SAMPLE_RESAMPLE_INTERPOLATE }; - -extern "C" -{ -#ifndef __VERSION_CC__ -extern const char* resid_version_string; -#else -const char* resid_version_string = VERSION; -#endif -} - -// Inlining on/off. -#define RESID_INLINE inline - -#if defined(__SSE__) || (defined(_MSC_VER) && (_MSC_VER >= 1300)) -#define RESID_USE_SSE 1 -#else -#define RESID_USE_SSE 0 -#endif - -#define HAVE_LOGF -#define HAVE_EXPF -#define HAVE_LOGF_PROTOTYPE -#define HAVE_EXPF_PROTOTYPE - -#endif // not __SIDDEFS_H__ +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 1999 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 __SIDDEFS_FP_H__ +#define __SIDDEFS_FP_H__ + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#define M_PI_f 3.14159265358979323846f +#else +#define M_PI_f ((float) M_PI) +#endif + +#ifndef M_LN2 +#define M_LN2 0.69314718055994530942 +#define M_LN2_f 0.69314718055994530942f +#else +#define M_LN2_f ((float) M_LN2) +#endif + +// Define bool, true, and false for C++ compilers that lack these keywords. +#define RESID_HAVE_BOOL 1 + +#if !RESID_HAVE_BOOL +typedef int bool; +const bool true = 1; +const bool false = 0; +#endif + +// We could have used the smallest possible data type for each SID register, +// however this would give a slower engine because of data type conversions. +// An int is assumed to be at least 32 bits (necessary in the types reg24, +// cycle_count, and sound_sample). GNU does not support 16-bit machines +// (GNU Coding Standards: Portability between CPUs), so this should be +// a valid assumption. + +typedef unsigned int reg4; +typedef unsigned int reg8; +typedef unsigned int reg12; +typedef unsigned int reg16; +typedef unsigned int reg24; + +typedef int cycle_count; + +enum chip_model { MOS6581FP=1, MOS8580FP }; + +enum sampling_method { SAMPLE_INTERPOLATE=1, SAMPLE_RESAMPLE_INTERPOLATE }; + +extern "C" +{ +#ifndef __VERSION_CC__ +extern const char* resid_version_string; +#else +const char* resid_version_string = VERSION; +#endif +} + +// Inlining on/off. +#define RESID_INLINE inline + +#if defined(__SSE__) || (defined(_MSC_VER) && (_MSC_VER >= 1300)) +#define RESID_USE_SSE 1 +#else +#define RESID_USE_SSE 0 +#endif + +#define HAVE_LOGF +#define HAVE_EXPF +#define HAVE_LOGF_PROTOTYPE +#define HAVE_EXPF_PROTOTYPE + +#endif // not __SIDDEFS_H__ diff --git a/src/resid-fp/siddefs-fp.h.in b/src/resid-fp/siddefs-fp.h.in index ec44b361..5431ba87 100644 --- a/src/resid-fp/siddefs-fp.h.in +++ b/src/resid-fp/siddefs-fp.h.in @@ -1,87 +1,87 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 1999 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 __SIDDEFS_FP_H__ -#define __SIDDEFS_FP_H__ - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#define M_PI_f 3.14159265358979323846f -#else -#define M_PI_f ((float) M_PI) -#endif - -#ifndef M_LN2 -#define M_LN2 0.69314718055994530942 -#define M_LN2_f 0.69314718055994530942f -#else -#define M_LN2_f ((float) M_LN2) -#endif - -// Define bool, true, and false for C++ compilers that lack these keywords. -#define RESID_HAVE_BOOL @RESID_HAVE_BOOL@ - -#if !RESID_HAVE_BOOL -typedef int bool; -const bool true = 1; -const bool false = 0; -#endif - -// We could have used the smallest possible data type for each SID register, -// however this would give a slower engine because of data type conversions. -// An int is assumed to be at least 32 bits (necessary in the types reg24, -// cycle_count, and sound_sample). GNU does not support 16-bit machines -// (GNU Coding Standards: Portability between CPUs), so this should be -// a valid assumption. - -typedef unsigned int reg4; -typedef unsigned int reg8; -typedef unsigned int reg12; -typedef unsigned int reg16; -typedef unsigned int reg24; - -typedef int cycle_count; - -enum chip_model { MOS6581FP=1, MOS8580FP }; - -enum sampling_method { SAMPLE_INTERPOLATE=1, SAMPLE_RESAMPLE_INTERPOLATE }; - -extern "C" -{ -#ifndef __VERSION_CC__ -extern const char* resid_version_string; -#else -const char* resid_version_string = VERSION; -#endif -} - -// Inlining on/off. -#define RESID_INLINE @RESID_INLINE@ - -#define RESID_USE_SSE @RESID_USE_SSE@ - -#if @HAVE_LOGF_PROTOTYPE@ -#define HAVE_LOGF_PROTOTYPE -#endif - -#if @HAVE_EXPF_PROTOTYPE@ -#define HAVE_EXPF_PROTOTYPE -#endif - -#endif // not __SIDDEFS_H__ +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 1999 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 __SIDDEFS_FP_H__ +#define __SIDDEFS_FP_H__ + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#define M_PI_f 3.14159265358979323846f +#else +#define M_PI_f ((float) M_PI) +#endif + +#ifndef M_LN2 +#define M_LN2 0.69314718055994530942 +#define M_LN2_f 0.69314718055994530942f +#else +#define M_LN2_f ((float) M_LN2) +#endif + +// Define bool, true, and false for C++ compilers that lack these keywords. +#define RESID_HAVE_BOOL @RESID_HAVE_BOOL@ + +#if !RESID_HAVE_BOOL +typedef int bool; +const bool true = 1; +const bool false = 0; +#endif + +// We could have used the smallest possible data type for each SID register, +// however this would give a slower engine because of data type conversions. +// An int is assumed to be at least 32 bits (necessary in the types reg24, +// cycle_count, and sound_sample). GNU does not support 16-bit machines +// (GNU Coding Standards: Portability between CPUs), so this should be +// a valid assumption. + +typedef unsigned int reg4; +typedef unsigned int reg8; +typedef unsigned int reg12; +typedef unsigned int reg16; +typedef unsigned int reg24; + +typedef int cycle_count; + +enum chip_model { MOS6581FP=1, MOS8580FP }; + +enum sampling_method { SAMPLE_INTERPOLATE=1, SAMPLE_RESAMPLE_INTERPOLATE }; + +extern "C" +{ +#ifndef __VERSION_CC__ +extern const char* resid_version_string; +#else +const char* resid_version_string = VERSION; +#endif +} + +// Inlining on/off. +#define RESID_INLINE @RESID_INLINE@ + +#define RESID_USE_SSE @RESID_USE_SSE@ + +#if @HAVE_LOGF_PROTOTYPE@ +#define HAVE_LOGF_PROTOTYPE +#endif + +#if @HAVE_EXPF_PROTOTYPE@ +#define HAVE_EXPF_PROTOTYPE +#endif + +#endif // not __SIDDEFS_H__ diff --git a/src/resid-fp/version.cc b/src/resid-fp/version.cc index fe9d4595..1175963b 100644 --- a/src/resid-fp/version.cc +++ b/src/resid-fp/version.cc @@ -1,21 +1,21 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 __VERSION_CC__ -#include "siddefs-fp.h" +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 __VERSION_CC__ +#include "siddefs-fp.h" diff --git a/src/resid-fp/voice.cc b/src/resid-fp/voice.cc index 18c36cc7..d1a7dc94 100644 --- a/src/resid-fp/voice.cc +++ b/src/resid-fp/voice.cc @@ -1,102 +1,102 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 __VOICE_CC__ -#include "voice.h" -#include "sid.h" - -// ---------------------------------------------------------------------------- -// Constructor. -// ---------------------------------------------------------------------------- -VoiceFP::VoiceFP() -{ - nonlinearity = 1.f; - set_chip_model(MOS6581FP); -} - -/* Keep this at 1.f for 8580, there are no 6581-only codepaths in this file! */ -void VoiceFP::set_nonlinearity(float nl) -{ - nonlinearity = nl; - calculate_dac_tables(); -} - -// ---------------------------------------------------------------------------- -// Set chip model. -// ---------------------------------------------------------------------------- -void VoiceFP::set_chip_model(chip_model model) -{ - wave.set_chip_model(model); - - if (model == MOS6581FP) { - /* there is some level from each voice even if the env is down and osc - * is stopped. You can hear this by routing a voice into filter (filter - * should be kept disabled for this) as the master level changes. This - * tunable affects the volume of digis. */ - voice_DC = 0x800 * 0xff; - /* In 8580 the waveforms seem well centered, but on the 6581 there is some - * offset change as envelope grows, indicating that the waveforms are not - * perfectly centered. I estimate the value ~ 0x600 for my R4AR, and ReSID - * has used another measurement technique and got 0x380. */ - wave_zero = 0x600; - calculate_dac_tables(); - } - else { - /* 8580 is thought to be perfect, apart from small negative offset due to - * ext-in mixing, I think. */ - voice_DC = 0; - wave_zero = 0x800; - calculate_dac_tables(); - } -} - -void VoiceFP::calculate_dac_tables() -{ - int i; - for (i = 0; i < 256; i ++) - env_dac[i] = SIDFP::kinked_dac(i, nonlinearity, 8); - for (i = 0; i < 4096; i ++) - voice_dac[i] = SIDFP::kinked_dac(i, nonlinearity, 12) - wave_zero; -} - -// ---------------------------------------------------------------------------- -// Set sync source. -// ---------------------------------------------------------------------------- -void VoiceFP::set_sync_source(VoiceFP* source) -{ - wave.set_sync_source(&source->wave); -} - -// ---------------------------------------------------------------------------- -// Register functions. -// ---------------------------------------------------------------------------- -void VoiceFP::writeCONTROL_REG(reg8 control) -{ - wave.writeCONTROL_REG(control); - envelope.writeCONTROL_REG(control); -} - -// ---------------------------------------------------------------------------- -// SID reset. -// ---------------------------------------------------------------------------- -void VoiceFP::reset() -{ - wave.reset(); - envelope.reset(); -} +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 __VOICE_CC__ +#include "voice.h" +#include "sid.h" + +// ---------------------------------------------------------------------------- +// Constructor. +// ---------------------------------------------------------------------------- +VoiceFP::VoiceFP() +{ + nonlinearity = 1.f; + set_chip_model(MOS6581FP); +} + +/* Keep this at 1.f for 8580, there are no 6581-only codepaths in this file! */ +void VoiceFP::set_nonlinearity(float nl) +{ + nonlinearity = nl; + calculate_dac_tables(); +} + +// ---------------------------------------------------------------------------- +// Set chip model. +// ---------------------------------------------------------------------------- +void VoiceFP::set_chip_model(chip_model model) +{ + wave.set_chip_model(model); + + if (model == MOS6581FP) { + /* there is some level from each voice even if the env is down and osc + * is stopped. You can hear this by routing a voice into filter (filter + * should be kept disabled for this) as the master level changes. This + * tunable affects the volume of digis. */ + voice_DC = 0x800 * 0xff; + /* In 8580 the waveforms seem well centered, but on the 6581 there is some + * offset change as envelope grows, indicating that the waveforms are not + * perfectly centered. I estimate the value ~ 0x600 for my R4AR, and ReSID + * has used another measurement technique and got 0x380. */ + wave_zero = 0x600; + calculate_dac_tables(); + } + else { + /* 8580 is thought to be perfect, apart from small negative offset due to + * ext-in mixing, I think. */ + voice_DC = 0; + wave_zero = 0x800; + calculate_dac_tables(); + } +} + +void VoiceFP::calculate_dac_tables() +{ + int i; + for (i = 0; i < 256; i ++) + env_dac[i] = SIDFP::kinked_dac(i, nonlinearity, 8); + for (i = 0; i < 4096; i ++) + voice_dac[i] = SIDFP::kinked_dac(i, nonlinearity, 12) - wave_zero; +} + +// ---------------------------------------------------------------------------- +// Set sync source. +// ---------------------------------------------------------------------------- +void VoiceFP::set_sync_source(VoiceFP* source) +{ + wave.set_sync_source(&source->wave); +} + +// ---------------------------------------------------------------------------- +// Register functions. +// ---------------------------------------------------------------------------- +void VoiceFP::writeCONTROL_REG(reg8 control) +{ + wave.writeCONTROL_REG(control); + envelope.writeCONTROL_REG(control); +} + +// ---------------------------------------------------------------------------- +// SID reset. +// ---------------------------------------------------------------------------- +void VoiceFP::reset() +{ + wave.reset(); + envelope.reset(); +} diff --git a/src/resid-fp/voice.h b/src/resid-fp/voice.h index 3a9e3fc9..02984b32 100644 --- a/src/resid-fp/voice.h +++ b/src/resid-fp/voice.h @@ -1,73 +1,73 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 __VOICE_H__ -#define __VOICE_H__ - -#include "siddefs-fp.h" -#include "wave.h" -#include "envelope.h" - -class VoiceFP -{ -public: - VoiceFP(); - - void set_chip_model(chip_model model); - void set_sync_source(VoiceFP*); - void reset(); - - void writeCONTROL_REG(reg8); - - // Amplitude modulated waveform output. - // Range [-2048*255, 2047*255]. - RESID_INLINE float output(); - - void set_nonlinearity(float nl); -protected: - void calculate_dac_tables(); - - WaveformGeneratorFP wave; - EnvelopeGeneratorFP envelope; - - // Multiplying D/A DC offset. - float voice_DC, wave_zero, nonlinearity; - - float env_dac[256]; - float voice_dac[4096]; -friend class SIDFP; -}; - -// ---------------------------------------------------------------------------- -// Amplitude modulated waveform output. -// Ideal range [-2048*255, 2047*255]. -// ---------------------------------------------------------------------------- - -RESID_INLINE -float VoiceFP::output() -{ - unsigned int w = wave.output(); - unsigned int e = envelope.output(); - float _w = voice_dac[w]; - float _e = env_dac[e]; - - return _w * _e + voice_DC; -} - -#endif // not __VOICE_H__ +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 __VOICE_H__ +#define __VOICE_H__ + +#include "siddefs-fp.h" +#include "wave.h" +#include "envelope.h" + +class VoiceFP +{ +public: + VoiceFP(); + + void set_chip_model(chip_model model); + void set_sync_source(VoiceFP*); + void reset(); + + void writeCONTROL_REG(reg8); + + // Amplitude modulated waveform output. + // Range [-2048*255, 2047*255]. + RESID_INLINE float output(); + + void set_nonlinearity(float nl); +protected: + void calculate_dac_tables(); + + WaveformGeneratorFP wave; + EnvelopeGeneratorFP envelope; + + // Multiplying D/A DC offset. + float voice_DC, wave_zero, nonlinearity; + + float env_dac[256]; + float voice_dac[4096]; +friend class SIDFP; +}; + +// ---------------------------------------------------------------------------- +// Amplitude modulated waveform output. +// Ideal range [-2048*255, 2047*255]. +// ---------------------------------------------------------------------------- + +RESID_INLINE +float VoiceFP::output() +{ + unsigned int w = wave.output(); + unsigned int e = envelope.output(); + float _w = voice_dac[w]; + float _e = env_dac[e]; + + return _w * _e + voice_DC; +} + +#endif // not __VOICE_H__ diff --git a/src/resid-fp/wave.cc b/src/resid-fp/wave.cc index 844a457f..8dc1c89e 100644 --- a/src/resid-fp/wave.cc +++ b/src/resid-fp/wave.cc @@ -1,151 +1,151 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 __WAVE_CC__ -#include "wave.h" - -// ---------------------------------------------------------------------------- -// Constructor. -// ---------------------------------------------------------------------------- -WaveformGeneratorFP::WaveformGeneratorFP() -{ - sync_source = this; - - set_chip_model(MOS6581FP); - - reset(); -} - - -// ---------------------------------------------------------------------------- -// Set sync source. -// ---------------------------------------------------------------------------- -void WaveformGeneratorFP::set_sync_source(WaveformGeneratorFP* source) -{ - sync_source = source; - source->sync_dest = this; -} - - -// ---------------------------------------------------------------------------- -// Set chip model. -// ---------------------------------------------------------------------------- -void WaveformGeneratorFP::set_chip_model(chip_model model) -{ - if (model == MOS6581FP) { - wave__ST = wave6581__ST; - wave_P_T = wave6581_P_T; - wave_PS_ = wave6581_PS_; - wave_PST = wave6581_PST; - } - else { - wave__ST = wave8580__ST; - wave_P_T = wave8580_P_T; - wave_PS_ = wave8580_PS_; - wave_PST = wave8580_PST; - } -} - - -// ---------------------------------------------------------------------------- -// Register functions. -// ---------------------------------------------------------------------------- -void WaveformGeneratorFP::writeFREQ_LO(reg8 freq_lo) -{ - freq = (freq & 0xff00) | (freq_lo & 0x00ff); -} - -void WaveformGeneratorFP::writeFREQ_HI(reg8 freq_hi) -{ - freq = ((freq_hi << 8) & 0xff00) | (freq & 0x00ff); -} - -/* The original form was (acc >> 12) >= pw, where truth value is not affected - * by the contents of the low 12 bits. Therefore the lowest bits must be zero - * in the new formulation acc >= (pw << 12). */ -void WaveformGeneratorFP::writePW_LO(reg8 pw_lo) -{ - pw = (pw & 0xf00) | (pw_lo & 0x0ff); - pw_acc_scale = pw << 12; -} - -void WaveformGeneratorFP::writePW_HI(reg8 pw_hi) -{ - pw = ((pw_hi << 8) & 0xf00) | (pw & 0x0ff); - pw_acc_scale = pw << 12; -} - -void WaveformGeneratorFP::writeCONTROL_REG(reg8 control) -{ - waveform = (control >> 4) & 0x0f; - ring_mod = control & 0x04; - sync = control & 0x02; - - reg8 test_next = control & 0x08; - - /* SounDemoN found out that test bit can be used to control the noise - * register. Hear the result in Bojojoing.sid. */ - - // testbit set. invert bit 19 and write it to bit 1 - if (test_next && !test) { - accumulator = 0; - reg24 bit19 = (shift_register >> 19) & 1; - shift_register = (shift_register & 0x7ffffd) | ((bit19^1) << 1); - noise_overwrite_delay = 200000; /* 200 ms, probably too generous? */ - } - // Test bit cleared. - // The accumulator starts counting, and the shift register is reset to - // the value 0x7ffff8. - else if (!test_next && test) { - reg24 bit0 = ((shift_register >> 22) ^ (shift_register >> 17)) & 0x1; - shift_register <<= 1; - shift_register |= bit0; - } - // clear output bits of shift register if noise and other waveforms - // are selected simultaneously - if (waveform > 8) { - shift_register &= 0x7fffff^(1<<22)^(1<<20)^(1<<16)^(1<<13)^(1<<11)^(1<<7)^(1<<4)^(1<<2); - } - - test = test_next; - - /* update noise anyway, just in case the above paths triggered */ - noise_output_cached = outputN___(); -} - -reg8 WaveformGeneratorFP::readOSC() -{ - return output() >> 4; -} - -// ---------------------------------------------------------------------------- -// SID reset. -// ---------------------------------------------------------------------------- -void WaveformGeneratorFP::reset() -{ - accumulator = 0; - previous = 0; - shift_register = 0x7ffffc; - freq = 0; - pw = 0; - pw_acc_scale = 0; - test = 0; - writeCONTROL_REG(0); - msb_rising = false; -} +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 __WAVE_CC__ +#include "wave.h" + +// ---------------------------------------------------------------------------- +// Constructor. +// ---------------------------------------------------------------------------- +WaveformGeneratorFP::WaveformGeneratorFP() +{ + sync_source = this; + + set_chip_model(MOS6581FP); + + reset(); +} + + +// ---------------------------------------------------------------------------- +// Set sync source. +// ---------------------------------------------------------------------------- +void WaveformGeneratorFP::set_sync_source(WaveformGeneratorFP* source) +{ + sync_source = source; + source->sync_dest = this; +} + + +// ---------------------------------------------------------------------------- +// Set chip model. +// ---------------------------------------------------------------------------- +void WaveformGeneratorFP::set_chip_model(chip_model model) +{ + if (model == MOS6581FP) { + wave__ST = wave6581__ST; + wave_P_T = wave6581_P_T; + wave_PS_ = wave6581_PS_; + wave_PST = wave6581_PST; + } + else { + wave__ST = wave8580__ST; + wave_P_T = wave8580_P_T; + wave_PS_ = wave8580_PS_; + wave_PST = wave8580_PST; + } +} + + +// ---------------------------------------------------------------------------- +// Register functions. +// ---------------------------------------------------------------------------- +void WaveformGeneratorFP::writeFREQ_LO(reg8 freq_lo) +{ + freq = (freq & 0xff00) | (freq_lo & 0x00ff); +} + +void WaveformGeneratorFP::writeFREQ_HI(reg8 freq_hi) +{ + freq = ((freq_hi << 8) & 0xff00) | (freq & 0x00ff); +} + +/* The original form was (acc >> 12) >= pw, where truth value is not affected + * by the contents of the low 12 bits. Therefore the lowest bits must be zero + * in the new formulation acc >= (pw << 12). */ +void WaveformGeneratorFP::writePW_LO(reg8 pw_lo) +{ + pw = (pw & 0xf00) | (pw_lo & 0x0ff); + pw_acc_scale = pw << 12; +} + +void WaveformGeneratorFP::writePW_HI(reg8 pw_hi) +{ + pw = ((pw_hi << 8) & 0xf00) | (pw & 0x0ff); + pw_acc_scale = pw << 12; +} + +void WaveformGeneratorFP::writeCONTROL_REG(reg8 control) +{ + waveform = (control >> 4) & 0x0f; + ring_mod = control & 0x04; + sync = control & 0x02; + + reg8 test_next = control & 0x08; + + /* SounDemoN found out that test bit can be used to control the noise + * register. Hear the result in Bojojoing.sid. */ + + // testbit set. invert bit 19 and write it to bit 1 + if (test_next && !test) { + accumulator = 0; + reg24 bit19 = (shift_register >> 19) & 1; + shift_register = (shift_register & 0x7ffffd) | ((bit19^1) << 1); + noise_overwrite_delay = 200000; /* 200 ms, probably too generous? */ + } + // Test bit cleared. + // The accumulator starts counting, and the shift register is reset to + // the value 0x7ffff8. + else if (!test_next && test) { + reg24 bit0 = ((shift_register >> 22) ^ (shift_register >> 17)) & 0x1; + shift_register <<= 1; + shift_register |= bit0; + } + // clear output bits of shift register if noise and other waveforms + // are selected simultaneously + if (waveform > 8) { + shift_register &= 0x7fffff^(1<<22)^(1<<20)^(1<<16)^(1<<13)^(1<<11)^(1<<7)^(1<<4)^(1<<2); + } + + test = test_next; + + /* update noise anyway, just in case the above paths triggered */ + noise_output_cached = outputN___(); +} + +reg8 WaveformGeneratorFP::readOSC() +{ + return output() >> 4; +} + +// ---------------------------------------------------------------------------- +// SID reset. +// ---------------------------------------------------------------------------- +void WaveformGeneratorFP::reset() +{ + accumulator = 0; + previous = 0; + shift_register = 0x7ffffc; + freq = 0; + pw = 0; + pw_acc_scale = 0; + test = 0; + writeCONTROL_REG(0); + msb_rising = false; +} diff --git a/src/resid-fp/wave.h b/src/resid-fp/wave.h index 64684228..e09ef582 100644 --- a/src/resid-fp/wave.h +++ b/src/resid-fp/wave.h @@ -1,457 +1,457 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 __WAVE_H__ -#define __WAVE_H__ - -#include "siddefs-fp.h" - -// ---------------------------------------------------------------------------- -// A 24 bit accumulator is the basis for waveform generation. FREQ is added to -// the lower 16 bits of the accumulator each cycle. -// The accumulator is set to zero when TEST is set, and starts counting -// when TEST is cleared. -// The noise waveform is taken from intermediate bits of a 23 bit shift -// register. This register is clocked by bit 19 of the accumulator. -// ---------------------------------------------------------------------------- -class WaveformGeneratorFP -{ -public: - WaveformGeneratorFP(); - - void set_sync_source(WaveformGeneratorFP*); - void set_chip_model(chip_model model); - - RESID_INLINE void clock(); - RESID_INLINE void synchronize(); - void reset(); - - void writeFREQ_LO(reg8); - void writeFREQ_HI(reg8); - void writePW_LO(reg8); - void writePW_HI(reg8); - void writeCONTROL_REG(reg8); - reg8 readOSC(); - - // 12-bit waveform output. - RESID_INLINE reg12 output(); - -protected: - const WaveformGeneratorFP* sync_source; - WaveformGeneratorFP* sync_dest; - - // Tell whether the accumulator MSB was set high on this cycle. - bool msb_rising; - - reg24 accumulator; - reg24 shift_register; - reg12 previous, noise_output_cached; - int noise_overwrite_delay; - - // Fout = (Fn*Fclk/16777216)Hz - reg16 freq; - // PWout = (PWn/40.95)%, also the same << 12 for direct comparison against acc - reg12 pw; reg24 pw_acc_scale; - - // The control register right-shifted 4 bits; used for output function - // table lookup. - reg8 waveform; - - // The remaining control register bits. - reg8 test; - reg8 ring_mod; - reg8 sync; - // The gate bit is handled by the EnvelopeGenerator. - - // 16 possible combinations of waveforms. - RESID_INLINE reg12 output___T(); - RESID_INLINE reg12 output__S_(); - RESID_INLINE reg12 output__ST(); - RESID_INLINE reg12 output_P__(); - RESID_INLINE reg12 output_P_T(); - RESID_INLINE reg12 output_PS_(); - RESID_INLINE reg12 output_PST(); - RESID_INLINE reg12 outputN___(); - RESID_INLINE reg12 outputN__T(); - RESID_INLINE reg12 outputN_S_(); - RESID_INLINE reg12 outputN_ST(); - RESID_INLINE reg12 outputNP__(); - RESID_INLINE reg12 outputNP_T(); - RESID_INLINE reg12 outputNPS_(); - RESID_INLINE reg12 outputNPST(); - - // Sample data for combinations of waveforms. - static reg8 wave6581__ST[]; - static reg8 wave6581_P_T[]; - static reg8 wave6581_PS_[]; - static reg8 wave6581_PST[]; - - static reg8 wave8580__ST[]; - static reg8 wave8580_P_T[]; - static reg8 wave8580_PS_[]; - static reg8 wave8580_PST[]; - - reg8* wave__ST; - reg8* wave_P_T; - reg8* wave_PS_; - reg8* wave_PST; - -friend class VoiceFP; -friend class SIDFP; -}; - -// ---------------------------------------------------------------------------- -// SID clocking - 1 cycle. -// ---------------------------------------------------------------------------- -RESID_INLINE -void WaveformGeneratorFP::clock() -{ - /* no digital operation if test bit is set. Only emulate analog fade. */ - if (test) { - if (noise_overwrite_delay != 0) { - if (-- noise_overwrite_delay == 0) { - shift_register |= 0x7ffffc; - noise_output_cached = outputN___(); - } - } - return; - } - - reg24 accumulator_prev = accumulator; - - // Calculate new accumulator value; - accumulator += freq; - accumulator &= 0xffffff; - - // Check whether the MSB became set high. This is used for synchronization. - msb_rising = !(accumulator_prev & 0x800000) && (accumulator & 0x800000); - - // Shift noise register once for each time accumulator bit 19 is set high. - if (!(accumulator_prev & 0x080000) && (accumulator & 0x080000)) { - reg24 bit0 = ((shift_register >> 22) ^ (shift_register >> 17)) & 0x1; - shift_register <<= 1; - // optimization: fall into the bit bucket - //shift_register &= 0x7fffff; - shift_register |= bit0; - - /* since noise changes relatively infrequently, we'll avoid the relatively - * expensive bit shuffling at output time. */ - noise_output_cached = outputN___(); - } - - // clear output bits of shift register if noise and other waveforms - // are selected simultaneously - if (waveform > 8) { - shift_register &= 0x7fffff^(1<<22)^(1<<20)^(1<<16)^(1<<13)^(1<<11)^(1<<7)^(1<<4)^(1<<2); - noise_output_cached = outputN___(); - } -} - -// ---------------------------------------------------------------------------- -// Synchronize oscillators. -// This must be done after all the oscillators have been clock()'ed since the -// oscillators operate in parallel. -// Note that the oscillators must be clocked exactly on the cycle when the -// MSB is set high for hard sync to operate correctly. See SID::clock(). -// ---------------------------------------------------------------------------- -RESID_INLINE -void WaveformGeneratorFP::synchronize() -{ - // A special case occurs when a sync source is synced itself on the same - // cycle as when its MSB is set high. In this case the destination will - // not be synced. This has been verified by sampling OSC3. - if (msb_rising && sync_dest->sync && !(sync && sync_source->msb_rising)) { - sync_dest->accumulator = 0; - } -} - - -// ---------------------------------------------------------------------------- -// Output functions. -// NB! The output from SID 8580 is delayed one cycle compared to SID 6581, -// this is not modeled. -// ---------------------------------------------------------------------------- - -// Triangle: -// The upper 12 bits of the accumulator are used. -// The MSB is used to create the falling edge of the triangle by inverting -// the lower 11 bits. The MSB is thrown away and the lower 11 bits are -// left-shifted (half the resolution, full amplitude). -// Ring modulation substitutes the MSB with MSB EOR sync_source MSB. -// -RESID_INLINE -reg12 WaveformGeneratorFP::output___T() -{ - reg24 msb = (ring_mod ? accumulator ^ sync_source->accumulator : accumulator) - & 0x800000; - return ((msb ? ~accumulator : accumulator) >> 11) & 0xfff; -} - -// Sawtooth: -// The output is identical to the upper 12 bits of the accumulator. -// -RESID_INLINE -reg12 WaveformGeneratorFP::output__S_() -{ - return accumulator >> 12; -} - -// Pulse: -// The upper 12 bits of the accumulator are used. -// These bits are compared to the pulse width register by a 12 bit digital -// comparator; output is either all one or all zero bits. -// NB! The output is actually delayed one cycle after the compare. -// This is not modeled. -// -// The test bit, when set to one, holds the pulse waveform output at 0xfff -// regardless of the pulse width setting. -// -RESID_INLINE -reg12 WaveformGeneratorFP::output_P__() -{ - return (test || accumulator >= pw_acc_scale) ? 0xfff : 0x000; -} - -// Noise: -// The noise output is taken from intermediate bits of a 23-bit shift register -// which is clocked by bit 19 of the accumulator. -// NB! The output is actually delayed 2 cycles after bit 19 is set high. -// This is not modeled. -// -// Operation: Calculate EOR result, shift register, set bit 0 = result. -// -// ----------------------->--------------------- -// | | -// ----EOR---- | -// | | | -// 2 2 2 1 1 1 1 1 1 1 1 1 1 | -// Register bits: 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 <--- -// | | | | | | | | -// OSC3 bits : 7 6 5 4 3 2 1 0 -// -// Since waveform output is 12 bits the output is left-shifted 4 times. -// -RESID_INLINE -reg12 WaveformGeneratorFP::outputN___() -{ - return - ((shift_register & 0x400000) >> 11) | - ((shift_register & 0x100000) >> 10) | - ((shift_register & 0x010000) >> 7) | - ((shift_register & 0x002000) >> 5) | - ((shift_register & 0x000800) >> 4) | - ((shift_register & 0x000080) >> 1) | - ((shift_register & 0x000010) << 1) | - ((shift_register & 0x000004) << 2); -} - -// Combined waveforms: -// By combining waveforms, the bits of each waveform are effectively short -// circuited. A zero bit in one waveform will result in a zero output bit -// (thus the infamous claim that the waveforms are AND'ed). -// However, a zero bit in one waveform will also affect the neighboring bits -// in the output. The reason for this has not been determined. -// -// Example: -// -// 1 1 -// Bit # 1 0 9 8 7 6 5 4 3 2 1 0 -// ----------------------- -// Sawtooth 0 0 0 1 1 1 1 1 1 0 0 0 -// -// Triangle 0 0 1 1 1 1 1 1 0 0 0 0 -// -// AND 0 0 0 1 1 1 1 1 0 0 0 0 -// -// Output 0 0 0 0 1 1 1 0 0 0 0 0 -// -// -// This behavior would be quite difficult to model exactly, since the SID -// in this case does not act as a digital state machine. Tests show that minor -// (1 bit) differences can actually occur in the output from otherwise -// identical samples from OSC3 when waveforms are combined. To further -// complicate the situation the output changes slightly with time (more -// neighboring bits are successively set) when the 12-bit waveform -// registers are kept unchanged. -// -// It is probably possible to come up with a valid model for the -// behavior, however this would be far too slow for practical use since it -// would have to be based on the mutual influence of individual bits. -// -// The output is instead approximated by using the upper bits of the -// accumulator as an index to look up the combined output in a table -// containing actual combined waveform samples from OSC3. -// These samples are 8 bit, so 4 bits of waveform resolution is lost. -// All OSC3 samples are taken with FREQ=0x1000, adding a 1 to the upper 12 -// bits of the accumulator each cycle for a sample period of 4096 cycles. -// -// Sawtooth+Triangle: -// The sawtooth output is used to look up an OSC3 sample. -// -// Pulse+Triangle: -// The triangle output is right-shifted and used to look up an OSC3 sample. -// The sample is output if the pulse output is on. -// The reason for using the triangle output as the index is to handle ring -// modulation. Only the first half of the sample is used, which should be OK -// since the triangle waveform has half the resolution of the accumulator. -// -// Pulse+Sawtooth: -// The sawtooth output is used to look up an OSC3 sample. -// The sample is output if the pulse output is on. -// -// Pulse+Sawtooth+Triangle: -// The sawtooth output is used to look up an OSC3 sample. -// The sample is output if the pulse output is on. -// -RESID_INLINE -reg12 WaveformGeneratorFP::output__ST() -{ - return wave__ST[output__S_()] << 4; -} - -RESID_INLINE -reg12 WaveformGeneratorFP::output_P_T() -{ - /* ring modulation does something odd with this waveform. But I don't know - * how to emulate it. */ - return (wave_P_T[output___T() >> 1] << 4) & output_P__(); -} - -RESID_INLINE -reg12 WaveformGeneratorFP::output_PS_() -{ - return (wave_PS_[output__S_()] << 4) & output_P__(); -} - -RESID_INLINE -reg12 WaveformGeneratorFP::output_PST() -{ - return (wave_PST[output__S_()] << 4) & output_P__(); -} - -// Combined waveforms including noise: -// All waveform combinations including noise output zero after a few cycles. -// NB! The effects of such combinations are not fully explored. It is claimed -// that the shift register may be filled with zeroes and locked up, which -// seems to be true. -// We have not attempted to model this behavior, suffice to say that -// there is very little audible output from waveform combinations including -// noise. We hope that nobody is actually using it. -// -RESID_INLINE -reg12 WaveformGeneratorFP::outputN__T() -{ - return 0; -} - -RESID_INLINE -reg12 WaveformGeneratorFP::outputN_S_() -{ - return 0; -} - -RESID_INLINE -reg12 WaveformGeneratorFP::outputN_ST() -{ - return 0; -} - -RESID_INLINE -reg12 WaveformGeneratorFP::outputNP__() -{ - return 0; -} - -RESID_INLINE -reg12 WaveformGeneratorFP::outputNP_T() -{ - return 0; -} - -RESID_INLINE -reg12 WaveformGeneratorFP::outputNPS_() -{ - return 0; -} - -RESID_INLINE -reg12 WaveformGeneratorFP::outputNPST() -{ - return 0; -} - -// ---------------------------------------------------------------------------- -// Select one of 16 possible combinations of waveforms. -// ---------------------------------------------------------------------------- -RESID_INLINE -reg12 WaveformGeneratorFP::output() -{ - switch (waveform) { - case 0x1: - previous = output___T(); - break; - case 0x2: - previous = output__S_(); - break; - case 0x3: - previous = output__ST(); - break; - case 0x4: - previous = output_P__(); - break; - case 0x5: - previous = output_P_T(); - break; - case 0x6: - previous = output_PS_(); - break; - case 0x7: - previous = output_PST(); - break; - case 0x8: - previous = noise_output_cached; - break; - case 0x9: - previous = outputN__T(); - break; - case 0xa: - previous = outputN_S_(); - break; - case 0xb: - previous = outputN_ST(); - break; - case 0xc: - previous = outputNP__(); - break; - case 0xd: - previous = outputNP_T(); - break; - case 0xe: - previous = outputNPS_(); - break; - case 0xf: - previous = outputNPST(); - break; - default: - break; - } - return previous; -} - -#endif // not __WAVE_H__ +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 __WAVE_H__ +#define __WAVE_H__ + +#include "siddefs-fp.h" + +// ---------------------------------------------------------------------------- +// A 24 bit accumulator is the basis for waveform generation. FREQ is added to +// the lower 16 bits of the accumulator each cycle. +// The accumulator is set to zero when TEST is set, and starts counting +// when TEST is cleared. +// The noise waveform is taken from intermediate bits of a 23 bit shift +// register. This register is clocked by bit 19 of the accumulator. +// ---------------------------------------------------------------------------- +class WaveformGeneratorFP +{ +public: + WaveformGeneratorFP(); + + void set_sync_source(WaveformGeneratorFP*); + void set_chip_model(chip_model model); + + RESID_INLINE void clock(); + RESID_INLINE void synchronize(); + void reset(); + + void writeFREQ_LO(reg8); + void writeFREQ_HI(reg8); + void writePW_LO(reg8); + void writePW_HI(reg8); + void writeCONTROL_REG(reg8); + reg8 readOSC(); + + // 12-bit waveform output. + RESID_INLINE reg12 output(); + +protected: + const WaveformGeneratorFP* sync_source; + WaveformGeneratorFP* sync_dest; + + // Tell whether the accumulator MSB was set high on this cycle. + bool msb_rising; + + reg24 accumulator; + reg24 shift_register; + reg12 previous, noise_output_cached; + int noise_overwrite_delay; + + // Fout = (Fn*Fclk/16777216)Hz + reg16 freq; + // PWout = (PWn/40.95)%, also the same << 12 for direct comparison against acc + reg12 pw; reg24 pw_acc_scale; + + // The control register right-shifted 4 bits; used for output function + // table lookup. + reg8 waveform; + + // The remaining control register bits. + reg8 test; + reg8 ring_mod; + reg8 sync; + // The gate bit is handled by the EnvelopeGenerator. + + // 16 possible combinations of waveforms. + RESID_INLINE reg12 output___T(); + RESID_INLINE reg12 output__S_(); + RESID_INLINE reg12 output__ST(); + RESID_INLINE reg12 output_P__(); + RESID_INLINE reg12 output_P_T(); + RESID_INLINE reg12 output_PS_(); + RESID_INLINE reg12 output_PST(); + RESID_INLINE reg12 outputN___(); + RESID_INLINE reg12 outputN__T(); + RESID_INLINE reg12 outputN_S_(); + RESID_INLINE reg12 outputN_ST(); + RESID_INLINE reg12 outputNP__(); + RESID_INLINE reg12 outputNP_T(); + RESID_INLINE reg12 outputNPS_(); + RESID_INLINE reg12 outputNPST(); + + // Sample data for combinations of waveforms. + static reg8 wave6581__ST[]; + static reg8 wave6581_P_T[]; + static reg8 wave6581_PS_[]; + static reg8 wave6581_PST[]; + + static reg8 wave8580__ST[]; + static reg8 wave8580_P_T[]; + static reg8 wave8580_PS_[]; + static reg8 wave8580_PST[]; + + reg8* wave__ST; + reg8* wave_P_T; + reg8* wave_PS_; + reg8* wave_PST; + +friend class VoiceFP; +friend class SIDFP; +}; + +// ---------------------------------------------------------------------------- +// SID clocking - 1 cycle. +// ---------------------------------------------------------------------------- +RESID_INLINE +void WaveformGeneratorFP::clock() +{ + /* no digital operation if test bit is set. Only emulate analog fade. */ + if (test) { + if (noise_overwrite_delay != 0) { + if (-- noise_overwrite_delay == 0) { + shift_register |= 0x7ffffc; + noise_output_cached = outputN___(); + } + } + return; + } + + reg24 accumulator_prev = accumulator; + + // Calculate new accumulator value; + accumulator += freq; + accumulator &= 0xffffff; + + // Check whether the MSB became set high. This is used for synchronization. + msb_rising = !(accumulator_prev & 0x800000) && (accumulator & 0x800000); + + // Shift noise register once for each time accumulator bit 19 is set high. + if (!(accumulator_prev & 0x080000) && (accumulator & 0x080000)) { + reg24 bit0 = ((shift_register >> 22) ^ (shift_register >> 17)) & 0x1; + shift_register <<= 1; + // optimization: fall into the bit bucket + //shift_register &= 0x7fffff; + shift_register |= bit0; + + /* since noise changes relatively infrequently, we'll avoid the relatively + * expensive bit shuffling at output time. */ + noise_output_cached = outputN___(); + } + + // clear output bits of shift register if noise and other waveforms + // are selected simultaneously + if (waveform > 8) { + shift_register &= 0x7fffff^(1<<22)^(1<<20)^(1<<16)^(1<<13)^(1<<11)^(1<<7)^(1<<4)^(1<<2); + noise_output_cached = outputN___(); + } +} + +// ---------------------------------------------------------------------------- +// Synchronize oscillators. +// This must be done after all the oscillators have been clock()'ed since the +// oscillators operate in parallel. +// Note that the oscillators must be clocked exactly on the cycle when the +// MSB is set high for hard sync to operate correctly. See SID::clock(). +// ---------------------------------------------------------------------------- +RESID_INLINE +void WaveformGeneratorFP::synchronize() +{ + // A special case occurs when a sync source is synced itself on the same + // cycle as when its MSB is set high. In this case the destination will + // not be synced. This has been verified by sampling OSC3. + if (msb_rising && sync_dest->sync && !(sync && sync_source->msb_rising)) { + sync_dest->accumulator = 0; + } +} + + +// ---------------------------------------------------------------------------- +// Output functions. +// NB! The output from SID 8580 is delayed one cycle compared to SID 6581, +// this is not modeled. +// ---------------------------------------------------------------------------- + +// Triangle: +// The upper 12 bits of the accumulator are used. +// The MSB is used to create the falling edge of the triangle by inverting +// the lower 11 bits. The MSB is thrown away and the lower 11 bits are +// left-shifted (half the resolution, full amplitude). +// Ring modulation substitutes the MSB with MSB EOR sync_source MSB. +// +RESID_INLINE +reg12 WaveformGeneratorFP::output___T() +{ + reg24 msb = (ring_mod ? accumulator ^ sync_source->accumulator : accumulator) + & 0x800000; + return ((msb ? ~accumulator : accumulator) >> 11) & 0xfff; +} + +// Sawtooth: +// The output is identical to the upper 12 bits of the accumulator. +// +RESID_INLINE +reg12 WaveformGeneratorFP::output__S_() +{ + return accumulator >> 12; +} + +// Pulse: +// The upper 12 bits of the accumulator are used. +// These bits are compared to the pulse width register by a 12 bit digital +// comparator; output is either all one or all zero bits. +// NB! The output is actually delayed one cycle after the compare. +// This is not modeled. +// +// The test bit, when set to one, holds the pulse waveform output at 0xfff +// regardless of the pulse width setting. +// +RESID_INLINE +reg12 WaveformGeneratorFP::output_P__() +{ + return (test || accumulator >= pw_acc_scale) ? 0xfff : 0x000; +} + +// Noise: +// The noise output is taken from intermediate bits of a 23-bit shift register +// which is clocked by bit 19 of the accumulator. +// NB! The output is actually delayed 2 cycles after bit 19 is set high. +// This is not modeled. +// +// Operation: Calculate EOR result, shift register, set bit 0 = result. +// +// ----------------------->--------------------- +// | | +// ----EOR---- | +// | | | +// 2 2 2 1 1 1 1 1 1 1 1 1 1 | +// Register bits: 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 <--- +// | | | | | | | | +// OSC3 bits : 7 6 5 4 3 2 1 0 +// +// Since waveform output is 12 bits the output is left-shifted 4 times. +// +RESID_INLINE +reg12 WaveformGeneratorFP::outputN___() +{ + return + ((shift_register & 0x400000) >> 11) | + ((shift_register & 0x100000) >> 10) | + ((shift_register & 0x010000) >> 7) | + ((shift_register & 0x002000) >> 5) | + ((shift_register & 0x000800) >> 4) | + ((shift_register & 0x000080) >> 1) | + ((shift_register & 0x000010) << 1) | + ((shift_register & 0x000004) << 2); +} + +// Combined waveforms: +// By combining waveforms, the bits of each waveform are effectively short +// circuited. A zero bit in one waveform will result in a zero output bit +// (thus the infamous claim that the waveforms are AND'ed). +// However, a zero bit in one waveform will also affect the neighboring bits +// in the output. The reason for this has not been determined. +// +// Example: +// +// 1 1 +// Bit # 1 0 9 8 7 6 5 4 3 2 1 0 +// ----------------------- +// Sawtooth 0 0 0 1 1 1 1 1 1 0 0 0 +// +// Triangle 0 0 1 1 1 1 1 1 0 0 0 0 +// +// AND 0 0 0 1 1 1 1 1 0 0 0 0 +// +// Output 0 0 0 0 1 1 1 0 0 0 0 0 +// +// +// This behavior would be quite difficult to model exactly, since the SID +// in this case does not act as a digital state machine. Tests show that minor +// (1 bit) differences can actually occur in the output from otherwise +// identical samples from OSC3 when waveforms are combined. To further +// complicate the situation the output changes slightly with time (more +// neighboring bits are successively set) when the 12-bit waveform +// registers are kept unchanged. +// +// It is probably possible to come up with a valid model for the +// behavior, however this would be far too slow for practical use since it +// would have to be based on the mutual influence of individual bits. +// +// The output is instead approximated by using the upper bits of the +// accumulator as an index to look up the combined output in a table +// containing actual combined waveform samples from OSC3. +// These samples are 8 bit, so 4 bits of waveform resolution is lost. +// All OSC3 samples are taken with FREQ=0x1000, adding a 1 to the upper 12 +// bits of the accumulator each cycle for a sample period of 4096 cycles. +// +// Sawtooth+Triangle: +// The sawtooth output is used to look up an OSC3 sample. +// +// Pulse+Triangle: +// The triangle output is right-shifted and used to look up an OSC3 sample. +// The sample is output if the pulse output is on. +// The reason for using the triangle output as the index is to handle ring +// modulation. Only the first half of the sample is used, which should be OK +// since the triangle waveform has half the resolution of the accumulator. +// +// Pulse+Sawtooth: +// The sawtooth output is used to look up an OSC3 sample. +// The sample is output if the pulse output is on. +// +// Pulse+Sawtooth+Triangle: +// The sawtooth output is used to look up an OSC3 sample. +// The sample is output if the pulse output is on. +// +RESID_INLINE +reg12 WaveformGeneratorFP::output__ST() +{ + return wave__ST[output__S_()] << 4; +} + +RESID_INLINE +reg12 WaveformGeneratorFP::output_P_T() +{ + /* ring modulation does something odd with this waveform. But I don't know + * how to emulate it. */ + return (wave_P_T[output___T() >> 1] << 4) & output_P__(); +} + +RESID_INLINE +reg12 WaveformGeneratorFP::output_PS_() +{ + return (wave_PS_[output__S_()] << 4) & output_P__(); +} + +RESID_INLINE +reg12 WaveformGeneratorFP::output_PST() +{ + return (wave_PST[output__S_()] << 4) & output_P__(); +} + +// Combined waveforms including noise: +// All waveform combinations including noise output zero after a few cycles. +// NB! The effects of such combinations are not fully explored. It is claimed +// that the shift register may be filled with zeroes and locked up, which +// seems to be true. +// We have not attempted to model this behavior, suffice to say that +// there is very little audible output from waveform combinations including +// noise. We hope that nobody is actually using it. +// +RESID_INLINE +reg12 WaveformGeneratorFP::outputN__T() +{ + return 0; +} + +RESID_INLINE +reg12 WaveformGeneratorFP::outputN_S_() +{ + return 0; +} + +RESID_INLINE +reg12 WaveformGeneratorFP::outputN_ST() +{ + return 0; +} + +RESID_INLINE +reg12 WaveformGeneratorFP::outputNP__() +{ + return 0; +} + +RESID_INLINE +reg12 WaveformGeneratorFP::outputNP_T() +{ + return 0; +} + +RESID_INLINE +reg12 WaveformGeneratorFP::outputNPS_() +{ + return 0; +} + +RESID_INLINE +reg12 WaveformGeneratorFP::outputNPST() +{ + return 0; +} + +// ---------------------------------------------------------------------------- +// Select one of 16 possible combinations of waveforms. +// ---------------------------------------------------------------------------- +RESID_INLINE +reg12 WaveformGeneratorFP::output() +{ + switch (waveform) { + case 0x1: + previous = output___T(); + break; + case 0x2: + previous = output__S_(); + break; + case 0x3: + previous = output__ST(); + break; + case 0x4: + previous = output_P__(); + break; + case 0x5: + previous = output_P_T(); + break; + case 0x6: + previous = output_PS_(); + break; + case 0x7: + previous = output_PST(); + break; + case 0x8: + previous = noise_output_cached; + break; + case 0x9: + previous = outputN__T(); + break; + case 0xa: + previous = outputN_S_(); + break; + case 0xb: + previous = outputN_ST(); + break; + case 0xc: + previous = outputNP__(); + break; + case 0xd: + previous = outputNP_T(); + break; + case 0xe: + previous = outputNPS_(); + break; + case 0xf: + previous = outputNPST(); + break; + default: + break; + } + return previous; +} + +#endif // not __WAVE_H__ diff --git a/src/resid-fp/wave6581_PST.cc b/src/resid-fp/wave6581_PST.cc index 19d2126e..555c257d 100644 --- a/src/resid-fp/wave6581_PST.cc +++ b/src/resid-fp/wave6581_PST.cc @@ -1,536 +1,536 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 "wave.h" - -reg8 WaveformGeneratorFP::wave6581_PST[] = -{ -/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x378: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, -/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x528: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x530: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x538: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x540: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x548: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x550: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x558: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x560: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x568: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x570: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x578: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x580: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x588: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x590: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x598: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x600: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x608: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x610: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x618: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x620: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x628: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x630: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x638: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x640: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x648: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x650: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x658: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x660: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x668: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x670: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x678: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x680: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x688: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x690: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x698: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x700: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x708: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x710: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x718: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x720: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x728: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x730: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x738: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x740: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x748: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x750: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x758: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x760: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x768: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x770: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x778: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x780: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x788: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x790: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x798: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, -/* 0x7f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, -/* 0x7f8: */ 0x00, 0x00, 0x00, 0x78, 0x78, 0x7e, 0x7f, 0x7f, -/* 0x800: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x808: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x810: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x818: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x820: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x828: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x830: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x838: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x840: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x848: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x850: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x858: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x860: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x868: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x870: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x878: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x880: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x888: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x890: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x898: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x900: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x908: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x910: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x918: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x920: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x928: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x930: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x938: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x940: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x948: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x950: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x958: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x960: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x968: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x970: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x978: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x980: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x988: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x990: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x998: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xab0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xab8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xac0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xac8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xad0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xad8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xae0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xae8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xba0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xba8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, -/* 0xc00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xca0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xca8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xce0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xce8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xda0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xda8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xde0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xde8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xea0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xea8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xeb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xeb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xec0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xec8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xed0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xed8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xee0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xee8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xef0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xef8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, -/* 0xff0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, -/* 0xff8: */ 0x00, 0x00, 0x00, 0x78, 0x78, 0x7e, 0x7f, 0x7f, -}; +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 "wave.h" + +reg8 WaveformGeneratorFP::wave6581_PST[] = +{ +/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x378: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, +/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x528: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x530: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x538: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x540: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x548: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x550: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x558: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x560: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x568: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x570: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x578: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x580: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x588: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x590: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x598: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x600: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x608: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x610: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x618: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x620: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x628: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x630: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x638: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x640: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x648: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x650: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x658: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x660: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x668: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x670: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x678: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x680: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x688: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x690: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x698: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x700: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x708: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x710: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x718: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x720: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x728: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x730: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x738: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x740: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x748: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x750: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x758: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x760: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x768: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x770: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x778: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x780: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x788: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x790: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x798: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, +/* 0x7f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, +/* 0x7f8: */ 0x00, 0x00, 0x00, 0x78, 0x78, 0x7e, 0x7f, 0x7f, +/* 0x800: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x808: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x810: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x818: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x820: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x828: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x830: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x838: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x840: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x848: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x850: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x858: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x860: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x868: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x870: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x878: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x880: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x888: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x890: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x898: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x900: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x908: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x910: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x918: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x920: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x928: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x930: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x938: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x940: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x948: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x950: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x958: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x960: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x968: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x970: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x978: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x980: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x988: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x990: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x998: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xab0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xab8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xac0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xac8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xad0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xad8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, +/* 0xc00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xea0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xea8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xeb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xeb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xec0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xec8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xed0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xed8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xee0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xee8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xef0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xef8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, +/* 0xff0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, +/* 0xff8: */ 0x00, 0x00, 0x00, 0x78, 0x78, 0x7e, 0x7f, 0x7f, +}; diff --git a/src/resid-fp/wave6581_PS_.cc b/src/resid-fp/wave6581_PS_.cc index bf133e54..9480b35e 100644 --- a/src/resid-fp/wave6581_PS_.cc +++ b/src/resid-fp/wave6581_PS_.cc @@ -1,536 +1,536 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 "wave.h" - -reg8 WaveformGeneratorFP::wave6581_PS_[] = -{ -/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, -/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, -/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, -/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1f, -/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, -/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, -/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x378: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, -/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, -/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3d, -/* 0x3e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, -/* 0x3f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x3f, -/* 0x3f8: */ 0x00, 0x30, 0x38, 0x3f, 0x3e, 0x3f, 0x3f, 0x3f, -/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, -/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, -/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x528: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x530: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x538: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x540: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x548: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x550: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x558: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x560: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x568: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x570: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x578: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, -/* 0x580: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x588: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x590: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x598: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, -/* 0x5c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5d, -/* 0x5e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5e, -/* 0x5f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x5f, -/* 0x5f8: */ 0x00, 0x40, 0x40, 0x5f, 0x5c, 0x5f, 0x5f, 0x5f, -/* 0x600: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x608: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x610: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x618: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x620: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x628: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x630: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x638: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x640: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x648: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x650: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x658: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x660: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x668: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x670: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x678: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, -/* 0x680: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x688: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x690: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x698: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x6b, -/* 0x6c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x6d, -/* 0x6e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0x6e8: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x40, 0x6e, -/* 0x6f0: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x60, 0x60, 0x6f, -/* 0x6f8: */ 0x00, 0x60, 0x60, 0x6f, 0x60, 0x6f, 0x6f, 0x6f, -/* 0x700: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x708: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x710: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x718: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0x720: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x728: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0x730: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0x738: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x60, 0x73, -/* 0x740: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x748: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0x750: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0x758: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x60, 0x60, 0x75, -/* 0x760: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, -/* 0x768: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x60, 0x76, -/* 0x770: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x60, 0x77, -/* 0x778: */ 0x00, 0x70, 0x70, 0x77, 0x70, 0x77, 0x77, 0x77, -/* 0x780: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x788: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, -/* 0x790: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, -/* 0x798: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x60, 0x79, -/* 0x7a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, -/* 0x7a8: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x70, 0x70, 0x7a, -/* 0x7b0: */ 0x00, 0x00, 0x00, 0x70, 0x00, 0x70, 0x70, 0x7b, -/* 0x7b8: */ 0x40, 0x70, 0x70, 0x7b, 0x78, 0x7b, 0x7b, 0x7b, -/* 0x7c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, -/* 0x7c8: */ 0x00, 0x00, 0x00, 0x70, 0x00, 0x70, 0x70, 0x7c, -/* 0x7d0: */ 0x00, 0x00, 0x00, 0x70, 0x40, 0x70, 0x70, 0x7d, -/* 0x7d8: */ 0x40, 0x70, 0x78, 0x7d, 0x78, 0x7d, 0x7d, 0x7d, -/* 0x7e0: */ 0x00, 0x40, 0x40, 0x78, 0x60, 0x78, 0x78, 0x7e, -/* 0x7e8: */ 0x60, 0x78, 0x78, 0x7e, 0x7c, 0x7e, 0x7e, 0x7e, -/* 0x7f0: */ 0x70, 0x7c, 0x7c, 0x7f, 0x7e, 0x7f, 0x7f, 0x7f, -/* 0x7f8: */ 0x7e, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, -/* 0x800: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x808: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x810: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x818: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x820: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x828: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x830: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x838: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x840: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x848: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x850: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x858: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x860: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x868: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x870: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x878: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x880: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x888: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x890: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x898: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, -/* 0x900: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x908: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x910: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x918: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x920: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x928: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x930: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x938: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x940: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x948: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x950: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x958: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x960: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x968: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x970: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x978: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, -/* 0x980: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x988: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x990: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x998: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, -/* 0x9c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1f, -/* 0xa00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, -/* 0xa80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xab0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xab8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0xac0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xac8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xad0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xad8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xae0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xae8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, -/* 0xb00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, -/* 0xb80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xba0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xba8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, -/* 0xbc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3d, -/* 0xbe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, -/* 0xbf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x3f, -/* 0xbf8: */ 0x00, 0x30, 0x38, 0x3f, 0x3e, 0x3f, 0x3f, 0x3f, -/* 0xc00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, -/* 0xc80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xca0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xca8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xce0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xce8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, -/* 0xd00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, -/* 0xd80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xda0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xda8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, -/* 0xdc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5d, -/* 0xde0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xde8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5e, -/* 0xdf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x5f, -/* 0xdf8: */ 0x00, 0x40, 0x40, 0x5f, 0x5c, 0x5f, 0x5f, 0x5f, -/* 0xe00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, -/* 0xe80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xea0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xea8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xeb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xeb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x6b, -/* 0xec0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xec8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xed0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xed8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x6d, -/* 0xee0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0xee8: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x40, 0x6e, -/* 0xef0: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x60, 0x60, 0x6f, -/* 0xef8: */ 0x00, 0x60, 0x60, 0x6f, 0x60, 0x6f, 0x6f, 0x6f, -/* 0xf00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0xf20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0xf30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0xf38: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x60, 0x73, -/* 0xf40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0xf50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0xf58: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x60, 0x60, 0x75, -/* 0xf60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, -/* 0xf68: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x60, 0x76, -/* 0xf70: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x60, 0x77, -/* 0xf78: */ 0x00, 0x70, 0x70, 0x77, 0x70, 0x77, 0x77, 0x77, -/* 0xf80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, -/* 0xf90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, -/* 0xf98: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x60, 0x79, -/* 0xfa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, -/* 0xfa8: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x70, 0x70, 0x7a, -/* 0xfb0: */ 0x00, 0x00, 0x00, 0x70, 0x00, 0x70, 0x70, 0x7b, -/* 0xfb8: */ 0x40, 0x70, 0x70, 0x7b, 0x78, 0x7b, 0x7b, 0x7b, -/* 0xfc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, -/* 0xfc8: */ 0x00, 0x00, 0x00, 0x70, 0x00, 0x70, 0x70, 0x7c, -/* 0xfd0: */ 0x00, 0x00, 0x00, 0x70, 0x40, 0x70, 0x70, 0x7d, -/* 0xfd8: */ 0x40, 0x70, 0x78, 0x7d, 0x78, 0x7d, 0x7d, 0x7d, -/* 0xfe0: */ 0x00, 0x40, 0x40, 0x78, 0x60, 0x78, 0x78, 0x7e, -/* 0xfe8: */ 0x60, 0x78, 0x78, 0x7e, 0x7c, 0x7e, 0x7e, 0x7e, -/* 0xff0: */ 0x70, 0x7c, 0x7c, 0x7f, 0x7c, 0x7f, 0x7f, 0x7f, -/* 0xff8: */ 0x7e, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, -}; +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 "wave.h" + +reg8 WaveformGeneratorFP::wave6581_PS_[] = +{ +/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, +/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1f, +/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, +/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x378: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, +/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, +/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3d, +/* 0x3e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, +/* 0x3f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x3f, +/* 0x3f8: */ 0x00, 0x30, 0x38, 0x3f, 0x3e, 0x3f, 0x3f, 0x3f, +/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, +/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x528: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x530: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x538: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x540: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x548: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x550: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x558: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x560: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x568: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x570: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x578: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, +/* 0x580: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x588: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x590: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x598: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, +/* 0x5c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5d, +/* 0x5e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5e, +/* 0x5f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x5f, +/* 0x5f8: */ 0x00, 0x40, 0x40, 0x5f, 0x5c, 0x5f, 0x5f, 0x5f, +/* 0x600: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x608: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x610: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x618: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x620: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x628: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x630: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x638: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x640: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x648: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x650: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x658: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x660: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x668: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x670: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x678: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, +/* 0x680: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x688: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x690: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x698: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x6b, +/* 0x6c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x6d, +/* 0x6e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0x6e8: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x40, 0x6e, +/* 0x6f0: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x60, 0x60, 0x6f, +/* 0x6f8: */ 0x00, 0x60, 0x60, 0x6f, 0x60, 0x6f, 0x6f, 0x6f, +/* 0x700: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x708: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x710: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x718: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0x720: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x728: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0x730: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0x738: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x60, 0x73, +/* 0x740: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x748: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0x750: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0x758: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x60, 0x60, 0x75, +/* 0x760: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, +/* 0x768: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x60, 0x76, +/* 0x770: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x60, 0x77, +/* 0x778: */ 0x00, 0x70, 0x70, 0x77, 0x70, 0x77, 0x77, 0x77, +/* 0x780: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x788: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, +/* 0x790: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, +/* 0x798: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x60, 0x79, +/* 0x7a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, +/* 0x7a8: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x70, 0x70, 0x7a, +/* 0x7b0: */ 0x00, 0x00, 0x00, 0x70, 0x00, 0x70, 0x70, 0x7b, +/* 0x7b8: */ 0x40, 0x70, 0x70, 0x7b, 0x78, 0x7b, 0x7b, 0x7b, +/* 0x7c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, +/* 0x7c8: */ 0x00, 0x00, 0x00, 0x70, 0x00, 0x70, 0x70, 0x7c, +/* 0x7d0: */ 0x00, 0x00, 0x00, 0x70, 0x40, 0x70, 0x70, 0x7d, +/* 0x7d8: */ 0x40, 0x70, 0x78, 0x7d, 0x78, 0x7d, 0x7d, 0x7d, +/* 0x7e0: */ 0x00, 0x40, 0x40, 0x78, 0x60, 0x78, 0x78, 0x7e, +/* 0x7e8: */ 0x60, 0x78, 0x78, 0x7e, 0x7c, 0x7e, 0x7e, 0x7e, +/* 0x7f0: */ 0x70, 0x7c, 0x7c, 0x7f, 0x7e, 0x7f, 0x7f, 0x7f, +/* 0x7f8: */ 0x7e, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, +/* 0x800: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x808: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x810: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x818: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x820: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x828: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x830: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x838: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x840: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x848: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x850: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x858: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x860: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x868: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x870: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x878: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x880: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x888: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x890: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x898: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, +/* 0x900: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x908: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x910: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x918: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x920: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x928: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x930: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x938: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x940: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x948: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x950: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x958: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x960: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x968: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x970: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x978: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0x980: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x988: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x990: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x998: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0x9c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1f, +/* 0xa00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0xa80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xab0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xab8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0xac0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xac8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xad0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xad8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, +/* 0xb00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, +/* 0xb80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, +/* 0xbc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3d, +/* 0xbe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, +/* 0xbf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x3f, +/* 0xbf8: */ 0x00, 0x30, 0x38, 0x3f, 0x3e, 0x3f, 0x3f, 0x3f, +/* 0xc00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0xc80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, +/* 0xd00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, +/* 0xd80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, +/* 0xdc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5d, +/* 0xde0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5e, +/* 0xdf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x5f, +/* 0xdf8: */ 0x00, 0x40, 0x40, 0x5f, 0x5c, 0x5f, 0x5f, 0x5f, +/* 0xe00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, +/* 0xe80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xea0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xea8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xeb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xeb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x6b, +/* 0xec0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xec8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xed0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xed8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x6d, +/* 0xee0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0xee8: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x40, 0x6e, +/* 0xef0: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x60, 0x60, 0x6f, +/* 0xef8: */ 0x00, 0x60, 0x60, 0x6f, 0x60, 0x6f, 0x6f, 0x6f, +/* 0xf00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0xf20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0xf30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0xf38: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x60, 0x73, +/* 0xf40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0xf50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0xf58: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x60, 0x60, 0x75, +/* 0xf60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, +/* 0xf68: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x60, 0x76, +/* 0xf70: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x60, 0x77, +/* 0xf78: */ 0x00, 0x70, 0x70, 0x77, 0x70, 0x77, 0x77, 0x77, +/* 0xf80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, +/* 0xf90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, +/* 0xf98: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x60, 0x79, +/* 0xfa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, +/* 0xfa8: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x70, 0x70, 0x7a, +/* 0xfb0: */ 0x00, 0x00, 0x00, 0x70, 0x00, 0x70, 0x70, 0x7b, +/* 0xfb8: */ 0x40, 0x70, 0x70, 0x7b, 0x78, 0x7b, 0x7b, 0x7b, +/* 0xfc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, +/* 0xfc8: */ 0x00, 0x00, 0x00, 0x70, 0x00, 0x70, 0x70, 0x7c, +/* 0xfd0: */ 0x00, 0x00, 0x00, 0x70, 0x40, 0x70, 0x70, 0x7d, +/* 0xfd8: */ 0x40, 0x70, 0x78, 0x7d, 0x78, 0x7d, 0x7d, 0x7d, +/* 0xfe0: */ 0x00, 0x40, 0x40, 0x78, 0x60, 0x78, 0x78, 0x7e, +/* 0xfe8: */ 0x60, 0x78, 0x78, 0x7e, 0x7c, 0x7e, 0x7e, 0x7e, +/* 0xff0: */ 0x70, 0x7c, 0x7c, 0x7f, 0x7c, 0x7f, 0x7f, 0x7f, +/* 0xff8: */ 0x7e, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, +}; diff --git a/src/resid-fp/wave6581_P_T.cc b/src/resid-fp/wave6581_P_T.cc index 30736169..909f17f4 100644 --- a/src/resid-fp/wave6581_P_T.cc +++ b/src/resid-fp/wave6581_P_T.cc @@ -1,536 +1,536 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 "wave.h" - -reg8 WaveformGeneratorFP::wave6581_P_T[] = -{ -/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x38, 0x3f, -/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2f8: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x40, 0x5f, -/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0x378: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x60, 0x6f, -/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, -/* 0x3b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, -/* 0x3b8: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x70, 0x77, -/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, -/* 0x3d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, -/* 0x3d8: */ 0x00, 0x00, 0x00, 0x70, 0x40, 0x70, 0x70, 0x7b, -/* 0x3e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x70, -/* 0x3e8: */ 0x00, 0x40, 0x40, 0x70, 0x60, 0x70, 0x78, 0x7d, -/* 0x3f0: */ 0x00, 0x40, 0x60, 0x78, 0x60, 0x78, 0x78, 0x7e, -/* 0x3f8: */ 0x70, 0x7c, 0x7c, 0x7f, 0x7e, 0x7f, 0x7f, 0x7f, -/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x4e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x4f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x4f8: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x9f, -/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x528: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x530: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x538: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x540: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x548: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x550: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x558: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x560: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x568: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x570: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x578: */ 0x00, 0x80, 0x80, 0x80, 0x80, 0xa0, 0xa0, 0xaf, -/* 0x580: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x588: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x590: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x598: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x5a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, -/* 0x5b0: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0xa0, -/* 0x5b8: */ 0x00, 0x80, 0x80, 0xa0, 0x80, 0xa0, 0xb0, 0xb7, -/* 0x5c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x5c8: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0xa0, -/* 0x5d0: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0xa0, -/* 0x5d8: */ 0x00, 0x80, 0x80, 0xa0, 0x80, 0xb0, 0xb0, 0xbb, -/* 0x5e0: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0xb0, -/* 0x5e8: */ 0x80, 0x80, 0x80, 0xb0, 0x80, 0xb0, 0xb8, 0xbd, -/* 0x5f0: */ 0x80, 0x80, 0x80, 0xb8, 0xa0, 0xb8, 0xb8, 0xbe, -/* 0x5f8: */ 0xa0, 0xb8, 0xbc, 0xbf, 0xbe, 0xbf, 0xbf, 0xbf, -/* 0x600: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x608: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x610: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x618: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x620: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x628: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x630: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x638: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, -/* 0x640: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x648: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x650: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x658: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, -/* 0x660: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x668: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0xc0, -/* 0x670: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0xc0, -/* 0x678: */ 0x00, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xcf, -/* 0x680: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x688: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x690: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x698: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0xc0, -/* 0x6a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x6a8: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0xc0, -/* 0x6b0: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0xc0, 0xc0, -/* 0x6b8: */ 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xd0, 0xd7, -/* 0x6c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x6c8: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0xc0, 0xc0, -/* 0x6d0: */ 0x00, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0xc0, -/* 0x6d8: */ 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xd0, 0xd0, 0xdb, -/* 0x6e0: */ 0x00, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0xd0, -/* 0x6e8: */ 0x80, 0xc0, 0xc0, 0xd0, 0xc0, 0xd0, 0xd8, 0xdd, -/* 0x6f0: */ 0xc0, 0xc0, 0xc0, 0xd0, 0xc0, 0xd8, 0xd8, 0xde, -/* 0x6f8: */ 0xc0, 0xd8, 0xdc, 0xdf, 0xdc, 0xdf, 0xdf, 0xdf, -/* 0x700: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x708: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x710: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x718: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, 0xc0, 0xe0, -/* 0x720: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x728: */ 0x00, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0xe0, -/* 0x730: */ 0x00, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0xe0, -/* 0x738: */ 0x80, 0xc0, 0xc0, 0xe0, 0xc0, 0xe0, 0xe0, 0xe7, -/* 0x740: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0xc0, -/* 0x748: */ 0x00, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0xe0, -/* 0x750: */ 0x00, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0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, 0xc0, 0xc0, 0xc0, 0x80, 0x80, -/* 0x878: */ 0xc0, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, -/* 0x880: */ 0xef, 0xef, 0xef, 0xec, 0xef, 0xec, 0xe8, 0xe0, -/* 0x888: */ 0xee, 0xe8, 0xe8, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, -/* 0x890: */ 0xed, 0xe8, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, -/* 0x898: */ 0xe0, 0xe0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, 0x80, -/* 0x8a0: */ 0xeb, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0xc0, 0xc0, -/* 0x8a8: */ 0xe0, 0xc0, 0xc0, 0x80, 0xc0, 0x80, 0x80, 0x00, -/* 0x8b0: */ 0xe0, 0xc0, 0xc0, 0x80, 0xc0, 0x80, 0x80, 0x00, -/* 0x8b8: */ 0xc0, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, -/* 0x8c0: */ 0xe7, 0xe0, 0xe0, 0xc0, 0xe0, 0xc0, 0xc0, 0x80, -/* 0x8c8: */ 0xe0, 0xc0, 0xc0, 0x80, 0xc0, 0x80, 0x80, 0x00, -/* 0x8d0: */ 0xe0, 0xc0, 0xc0, 0x80, 0xc0, 0x80, 0x80, 0x00, -/* 0x8d8: */ 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8e0: */ 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x00, 0x00, 0x00, -/* 0x8e8: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8f0: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x900: */ 0xdf, 0xdf, 0xdf, 0xdc, 0xdf, 0xdc, 0xd8, 0xc0, -/* 0x908: */ 0xde, 0xd8, 0xd8, 0xc0, 0xd8, 0xc0, 0xc0, 0xc0, -/* 0x910: */ 0xdd, 0xd8, 0xd0, 0xc0, 0xd0, 0xc0, 0xc0, 0x80, -/* 0x918: */ 0xd0, 0xc0, 0xc0, 0x80, 0xc0, 0x80, 0x80, 0x00, -/* 0x920: */ 0xdb, 0xd0, 0xd0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, -/* 0x928: */ 0xc0, 0xc0, 0xc0, 0x80, 0xc0, 0x80, 0x80, 0x00, -/* 0x930: */ 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, -/* 0x938: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x940: */ 0xd7, 0xd0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, -/* 0x948: */ 0xc0, 0xc0, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, -/* 0x950: */ 0xc0, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, -/* 0x958: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x960: */ 0xc0, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, -/* 0x968: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x970: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x978: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x980: */ 0xcf, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, 0x80, 0x00, -/* 0x988: */ 0xc0, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, -/* 0x990: */ 0xc0, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, -/* 0x998: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9a0: */ 0xc0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9c0: */ 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa00: */ 0xbf, 0xbf, 0xbf, 0xbe, 0xbf, 0xbc, 0xbc, 0xa0, -/* 0xa08: */ 0xbe, 0xbc, 0xb8, 0xa0, 0xb8, 0xa0, 0x80, 0x80, -/* 0xa10: */ 0xbd, 0xb8, 0xb0, 0x80, 0xb0, 0x80, 0x80, 0x80, -/* 0xa18: */ 0xb0, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, -/* 0xa20: */ 0xbb, 0xb0, 0xb0, 0x80, 0xa0, 0x80, 0x80, 0x00, -/* 0xa28: */ 0xa0, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, -/* 0xa30: */ 0xa0, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, -/* 0xa38: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa40: */ 0xb7, 0xb0, 0xa0, 0x80, 0xa0, 0x80, 0x80, 0x00, -/* 0xa48: */ 0xa0, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, -/* 0xa50: */ 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa60: */ 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa80: */ 0xaf, 0xa0, 0xa0, 0x80, 0x80, 0x80, 0x80, 0x00, -/* 0xa88: */ 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa90: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaa0: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xab0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xab8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xac0: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xac8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xad0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xad8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xae0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xae8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb00: */ 0x9f, 0x90, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, -/* 0xb08: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb10: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb20: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb40: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb80: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xba0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xba8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc00: */ 0x7f, 0x7f, 0x7f, 0x7e, 0x7f, 0x7c, 0x7c, 0x70, -/* 0xc08: */ 0x7e, 0x7c, 0x78, 0x60, 0x78, 0x60, 0x60, 0x00, -/* 0xc10: */ 0x7d, 0x78, 0x78, 0x60, 0x70, 0x40, 0x40, 0x00, -/* 0xc18: */ 0x70, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc20: */ 0x7b, 0x78, 0x70, 0x40, 0x70, 0x40, 0x00, 0x00, -/* 0xc28: */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc30: */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc40: */ 0x77, 0x70, 0x70, 0x00, 0x60, 0x00, 0x00, 0x00, -/* 0xc48: */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc50: */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc60: */ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc80: */ 0x6f, 0x60, 0x60, 0x00, 0x60, 0x00, 0x00, 0x00, -/* 0xc88: */ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc90: */ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xca0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xca8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xce0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xce8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd00: */ 0x5f, 0x58, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00, -/* 0xd08: */ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xda0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xda8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xde0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xde8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe00: */ 0x3f, 0x3c, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xea0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xea8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xeb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xeb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xec0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xec8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xed0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xed8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xee0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xee8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xef0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xef8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xff0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xff8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 "wave.h" + +reg8 WaveformGeneratorFP::wave6581_P_T[] = +{ +/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x38, 0x3f, +/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f8: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x40, 0x5f, +/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0x378: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x60, 0x6f, +/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, +/* 0x3b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, +/* 0x3b8: */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x70, 0x77, +/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, +/* 0x3d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, +/* 0x3d8: */ 0x00, 0x00, 0x00, 0x70, 0x40, 0x70, 0x70, 0x7b, +/* 0x3e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x70, +/* 0x3e8: */ 0x00, 0x40, 0x40, 0x70, 0x60, 0x70, 0x78, 0x7d, +/* 0x3f0: */ 0x00, 0x40, 0x60, 0x78, 0x60, 0x78, 0x78, 0x7e, +/* 0x3f8: */ 0x70, 0x7c, 0x7c, 0x7f, 0x7e, 0x7f, 0x7f, 0x7f, +/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x4e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x4f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x4f8: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x9f, +/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x528: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x530: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x538: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x540: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x548: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x550: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x558: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x560: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x568: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x570: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x578: */ 0x00, 0x80, 0x80, 0x80, 0x80, 0xa0, 0xa0, 0xaf, +/* 0x580: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x588: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x590: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x598: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x5a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, +/* 0x5b0: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0xa0, +/* 0x5b8: */ 0x00, 0x80, 0x80, 0xa0, 0x80, 0xa0, 0xb0, 0xb7, +/* 0x5c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x5c8: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0xa0, +/* 0x5d0: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0xa0, +/* 0x5d8: */ 0x00, 0x80, 0x80, 0xa0, 0x80, 0xb0, 0xb0, 0xbb, +/* 0x5e0: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0xb0, +/* 0x5e8: */ 0x80, 0x80, 0x80, 0xb0, 0x80, 0xb0, 0xb8, 0xbd, +/* 0x5f0: */ 0x80, 0x80, 0x80, 0xb8, 0xa0, 0xb8, 0xb8, 0xbe, +/* 0x5f8: */ 0xa0, 0xb8, 0xbc, 0xbf, 0xbe, 0xbf, 0xbf, 0xbf, +/* 0x600: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x608: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x610: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x618: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x620: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x628: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x630: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x638: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, +/* 0x640: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x648: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x650: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x658: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, +/* 0x660: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x668: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0xc0, +/* 0x670: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0xc0, +/* 0x678: */ 0x00, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xcf, +/* 0x680: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x688: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x690: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x698: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0xc0, +/* 0x6a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x6a8: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0xc0, +/* 0x6b0: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0xc0, 0xc0, +/* 0x6b8: */ 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xd0, 0xd7, +/* 0x6c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x6c8: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0xc0, 0xc0, +/* 0x6d0: */ 0x00, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0xc0, +/* 0x6d8: */ 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xd0, 0xd0, 0xdb, +/* 0x6e0: */ 0x00, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0xd0, +/* 0x6e8: */ 0x80, 0xc0, 0xc0, 0xd0, 0xc0, 0xd0, 0xd8, 0xdd, +/* 0x6f0: */ 0xc0, 0xc0, 0xc0, 0xd0, 0xc0, 0xd8, 0xd8, 0xde, +/* 0x6f8: */ 0xc0, 0xd8, 0xdc, 0xdf, 0xdc, 0xdf, 0xdf, 0xdf, +/* 0x700: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x708: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x710: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x718: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, 0xc0, 0xe0, +/* 0x720: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x728: */ 0x00, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0xe0, +/* 0x730: */ 0x00, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0xe0, +/* 0x738: */ 0x80, 0xc0, 0xc0, 0xe0, 0xc0, 0xe0, 0xe0, 0xe7, +/* 0x740: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0xc0, +/* 0x748: */ 0x00, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0xe0, +/* 0x750: */ 0x00, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0xe0, +/* 0x758: */ 0xc0, 0xc0, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xeb, +/* 0x760: */ 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe0, +/* 0x768: */ 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xed, +/* 0x770: */ 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe8, 0xe8, 0xee, +/* 0x778: */ 0xe0, 0xe8, 0xec, 0xef, 0xec, 0xef, 0xef, 0xef, +/* 0x780: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0xc0, +/* 0x788: */ 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xf0, +/* 0x790: */ 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xe0, 0xe0, 0xf0, +/* 0x798: */ 0xc0, 0xe0, 0xe0, 0xf0, 0xe0, 0xf0, 0xf0, 0xf3, +/* 0x7a0: */ 0x80, 0xc0, 0xc0, 0xe0, 0xc0, 0xe0, 0xe0, 0xf0, +/* 0x7a8: */ 0xc0, 0xe0, 0xe0, 0xf0, 0xe0, 0xf0, 0xf0, 0xf5, +/* 0x7b0: */ 0xe0, 0xe0, 0xe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* 0x840: */ 0xf7, 0xf7, 0xf7, 0xf4, 0xf7, 0xf4, 0xf0, 0xf0, +/* 0x848: */ 0xf6, 0xf0, 0xf0, 0xf0, 0xf0, 0xe0, 0xe0, 0xe0, +/* 0x850: */ 0xf5, 0xf0, 0xf0, 0xe0, 0xf0, 0xe0, 0xe0, 0xc0, +/* 0x858: */ 0xf0, 0xe0, 0xe0, 0xc0, 0xe0, 0xc0, 0xc0, 0x80, +/* 0x860: */ 0xf3, 0xf0, 0xf0, 0xe0, 0xf0, 0xe0, 0xe0, 0xc0, +/* 0x868: */ 0xf0, 0xe0, 0xe0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, +/* 0x870: */ 0xf0, 0xe0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, 0x80, +/* 0x878: */ 0xc0, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, +/* 0x880: */ 0xef, 0xef, 0xef, 0xec, 0xef, 0xec, 0xe8, 0xe0, +/* 0x888: */ 0xee, 0xe8, 0xe8, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, +/* 0x890: */ 0xed, 0xe8, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, +/* 0x898: */ 0xe0, 0xe0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, 0x80, +/* 0x8a0: */ 0xeb, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0xc0, 0xc0, +/* 0x8a8: */ 0xe0, 0xc0, 0xc0, 0x80, 0xc0, 0x80, 0x80, 0x00, +/* 0x8b0: */ 0xe0, 0xc0, 0xc0, 0x80, 0xc0, 0x80, 0x80, 0x00, +/* 0x8b8: */ 0xc0, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, +/* 0x8c0: */ 0xe7, 0xe0, 0xe0, 0xc0, 0xe0, 0xc0, 0xc0, 0x80, +/* 0x8c8: */ 0xe0, 0xc0, 0xc0, 0x80, 0xc0, 0x80, 0x80, 0x00, +/* 0x8d0: */ 0xe0, 0xc0, 0xc0, 0x80, 0xc0, 0x80, 0x80, 0x00, +/* 0x8d8: */ 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e0: */ 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x00, 0x00, 0x00, +/* 0x8e8: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f0: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x900: */ 0xdf, 0xdf, 0xdf, 0xdc, 0xdf, 0xdc, 0xd8, 0xc0, +/* 0x908: */ 0xde, 0xd8, 0xd8, 0xc0, 0xd8, 0xc0, 0xc0, 0xc0, +/* 0x910: */ 0xdd, 0xd8, 0xd0, 0xc0, 0xd0, 0xc0, 0xc0, 0x80, +/* 0x918: */ 0xd0, 0xc0, 0xc0, 0x80, 0xc0, 0x80, 0x80, 0x00, +/* 0x920: */ 0xdb, 0xd0, 0xd0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, +/* 0x928: */ 0xc0, 0xc0, 0xc0, 0x80, 0xc0, 0x80, 0x80, 0x00, +/* 0x930: */ 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, +/* 0x938: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x940: */ 0xd7, 0xd0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, +/* 0x948: */ 0xc0, 0xc0, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, +/* 0x950: */ 0xc0, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, +/* 0x958: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x960: */ 0xc0, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, +/* 0x968: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x970: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x978: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x980: */ 0xcf, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, 0x80, 0x00, +/* 0x988: */ 0xc0, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, +/* 0x990: */ 0xc0, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, +/* 0x998: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a0: */ 0xc0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9c0: */ 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa00: */ 0xbf, 0xbf, 0xbf, 0xbe, 0xbf, 0xbc, 0xbc, 0xa0, +/* 0xa08: */ 0xbe, 0xbc, 0xb8, 0xa0, 0xb8, 0xa0, 0x80, 0x80, +/* 0xa10: */ 0xbd, 0xb8, 0xb0, 0x80, 0xb0, 0x80, 0x80, 0x80, +/* 0xa18: */ 0xb0, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, +/* 0xa20: */ 0xbb, 0xb0, 0xb0, 0x80, 0xa0, 0x80, 0x80, 0x00, +/* 0xa28: */ 0xa0, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, +/* 0xa30: */ 0xa0, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, +/* 0xa38: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa40: */ 0xb7, 0xb0, 0xa0, 0x80, 0xa0, 0x80, 0x80, 0x00, +/* 0xa48: */ 0xa0, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, +/* 0xa50: */ 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa60: */ 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa80: */ 0xaf, 0xa0, 0xa0, 0x80, 0x80, 0x80, 0x80, 0x00, +/* 0xa88: */ 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa90: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaa0: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xab0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xab8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xac0: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xac8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xad0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xad8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb00: */ 0x9f, 0x90, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, +/* 0xb08: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb10: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb20: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb40: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb80: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc00: */ 0x7f, 0x7f, 0x7f, 0x7e, 0x7f, 0x7c, 0x7c, 0x70, +/* 0xc08: */ 0x7e, 0x7c, 0x78, 0x60, 0x78, 0x60, 0x60, 0x00, +/* 0xc10: */ 0x7d, 0x78, 0x78, 0x60, 0x70, 0x40, 0x40, 0x00, +/* 0xc18: */ 0x70, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc20: */ 0x7b, 0x78, 0x70, 0x40, 0x70, 0x40, 0x00, 0x00, +/* 0xc28: */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc30: */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc40: */ 0x77, 0x70, 0x70, 0x00, 0x60, 0x00, 0x00, 0x00, +/* 0xc48: */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc50: */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc60: */ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc80: */ 0x6f, 0x60, 0x60, 0x00, 0x60, 0x00, 0x00, 0x00, +/* 0xc88: */ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc90: */ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd00: */ 0x5f, 0x58, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00, +/* 0xd08: */ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe00: */ 0x3f, 0x3c, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xea0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xea8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xeb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xeb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xec0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xec8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xed0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xed8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xee0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xee8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xef0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xef8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xff0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xff8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/src/resid-fp/wave6581__ST.cc b/src/resid-fp/wave6581__ST.cc index d193550f..b93f6bb9 100644 --- a/src/resid-fp/wave6581__ST.cc +++ b/src/resid-fp/wave6581__ST.cc @@ -1,536 +1,536 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 "wave.h" - -reg8 WaveformGeneratorFP::wave6581__ST[] = -{ -/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, -/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1f8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x0f, -/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, -/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x378: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3f0: */ 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, -/* 0x3f8: */ 0x1e, 0x1e, 0x1e, 0x1e, 0x1f, 0x1f, 0x3f, 0x3f, -/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, -/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x528: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x530: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x538: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x540: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x548: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x550: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x558: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x560: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x568: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x570: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x578: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x580: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x588: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x590: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x598: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x5c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5f8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x1f, -/* 0x600: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x608: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x610: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x618: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x620: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x628: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x630: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x638: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x640: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x648: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x650: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x658: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x660: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x668: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x670: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x678: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x680: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x688: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x690: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x698: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x6c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, -/* 0x700: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x708: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x710: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x718: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x720: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x728: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x730: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x738: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x740: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x748: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x750: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x758: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x760: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x768: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x770: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x778: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x780: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x788: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x790: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x798: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x7c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7e0: */ 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, -/* 0x7e8: */ 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, -/* 0x7f0: */ 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, -/* 0x7f8: */ 0x3e, 0x3e, 0x3f, 0x3f, 0x7f, 0x7f, 0x7f, 0x7f, -/* 0x800: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x808: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x810: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x818: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x820: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x828: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x830: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x838: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x840: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x848: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x850: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x858: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x860: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x868: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x870: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x878: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x880: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x888: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x890: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x898: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x8c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, -/* 0x900: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x908: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x910: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x918: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x920: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x928: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x930: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x938: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x940: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x948: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x950: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x958: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x960: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x968: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x970: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x978: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x980: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x988: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x990: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x998: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x9c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9f8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x0f, -/* 0xa00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0xa80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xab0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xab8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0xac0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xac8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xad0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xad8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xae0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xae8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaf8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, -/* 0xb00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0xb40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0xb80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xba0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xba8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0xbc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbf0: */ 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, -/* 0xbf8: */ 0x1e, 0x1e, 0x1e, 0x1e, 0x1f, 0x1f, 0x3f, 0x3f, -/* 0xc00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0xc80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xca0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xca8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0xcc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xce0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xce8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcf8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, -/* 0xd00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0xd40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0xd80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xda0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xda8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0xdc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xde0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xde8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdf8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x1f, -/* 0xe00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0xe80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xea0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xea8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xeb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xeb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0xec0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xec8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xed0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xed8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xee0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xee8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xef0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xef8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, -/* 0xf00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0xf40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0xf80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0xfc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfe0: */ 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, -/* 0xfe8: */ 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, -/* 0xff0: */ 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, -/* 0xff8: */ 0x3e, 0x3e, 0x3f, 0x3f, 0x7f, 0x7f, 0x7f, 0x7f, -}; +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 "wave.h" + +reg8 WaveformGeneratorFP::wave6581__ST[] = +{ +/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x0f, +/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x378: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3f0: */ 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, +/* 0x3f8: */ 0x1e, 0x1e, 0x1e, 0x1e, 0x1f, 0x1f, 0x3f, 0x3f, +/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x528: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x530: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x538: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x540: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x548: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x550: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x558: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x560: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x568: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x570: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x578: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x580: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x588: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x590: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x598: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x5c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5f8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x1f, +/* 0x600: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x608: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x610: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x618: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x620: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x628: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x630: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x638: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x640: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x648: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x650: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x658: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x660: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x668: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x670: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x678: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x680: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x688: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x690: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x698: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x6c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0x700: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x708: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x710: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x718: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x720: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x728: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x730: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x738: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x740: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x748: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x750: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x758: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x760: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x768: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x770: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x778: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x780: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x788: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x790: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x798: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x7c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7e0: */ 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, +/* 0x7e8: */ 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, +/* 0x7f0: */ 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, +/* 0x7f8: */ 0x3e, 0x3e, 0x3f, 0x3f, 0x7f, 0x7f, 0x7f, 0x7f, +/* 0x800: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x808: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x810: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x818: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x820: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x828: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x830: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x838: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x840: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x848: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x850: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x858: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x860: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x868: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x870: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x878: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x880: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x888: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x890: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x898: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x8c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0x900: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x908: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x910: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x918: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x920: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x928: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x930: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x938: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x940: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x948: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x950: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x958: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x960: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x968: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x970: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x978: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x980: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x988: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x990: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x998: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x9c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9f8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x0f, +/* 0xa00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0xa80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xab0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xab8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0xac0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xac8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xad0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xad8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0xb00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0xb40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0xb80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0xbc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbf0: */ 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, +/* 0xbf8: */ 0x1e, 0x1e, 0x1e, 0x1e, 0x1f, 0x1f, 0x3f, 0x3f, +/* 0xc00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0xc80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0xcc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0xd00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0xd40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0xd80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0xdc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdf8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x1f, +/* 0xe00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0xe80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xea0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xea8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xeb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xeb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0xec0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xec8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xed0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xed8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xee0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xee8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xef0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xef8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0xf00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0xf40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0xf80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0xfc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfe0: */ 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, +/* 0xfe8: */ 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, +/* 0xff0: */ 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, +/* 0xff8: */ 0x3e, 0x3e, 0x3f, 0x3f, 0x7f, 0x7f, 0x7f, 0x7f, +}; diff --git a/src/resid-fp/wave8580_PST.cc b/src/resid-fp/wave8580_PST.cc index 51ae2161..a24bea90 100644 --- a/src/resid-fp/wave8580_PST.cc +++ b/src/resid-fp/wave8580_PST.cc @@ -1,536 +1,536 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 "wave.h" - -reg8 WaveformGeneratorFP::wave8580_PST[] = -{ -/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x378: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, -/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x528: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x530: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x538: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x540: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x548: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x550: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x558: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x560: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x568: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x570: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x578: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x580: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x588: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x590: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x598: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x600: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x608: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x610: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x618: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x620: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x628: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x630: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x638: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x640: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x648: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x650: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x658: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x660: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x668: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x670: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x678: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x680: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x688: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x690: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x698: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x700: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x708: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x710: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x718: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x720: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x728: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x730: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x738: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x740: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x748: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x750: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x758: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x760: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x768: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x770: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x778: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x780: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x788: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x790: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x798: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x70, -/* 0x7f0: */ 0x60, 0x20, 0x70, 0x70, 0x70, 0x70, 0x70, 0x78, -/* 0x7f8: */ 0x78, 0x78, 0x7c, 0x7c, 0x7e, 0x7e, 0x7f, 0x7f, -/* 0x800: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x808: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x810: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x818: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x820: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x828: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x830: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x838: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x840: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x848: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x850: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x858: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x860: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x868: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x870: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x878: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x880: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x888: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x890: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x898: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x900: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x908: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x910: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x918: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x920: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x928: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x930: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x938: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x940: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x948: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x950: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x958: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x960: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x968: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x970: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x978: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x980: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x988: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x990: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x998: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xab0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xab8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xac0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xac8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xad0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xad8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xae0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xae8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xba0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xba8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x1e, 0x3f, -/* 0xc00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xca0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xca8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xce0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xce8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xda0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xda8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xde0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xde8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0xdf8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x8c, 0x9f, -/* 0xe00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, -/* 0xe40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, -/* 0xe60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, -/* 0xe68: */ 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xe70: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xe78: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xe80: */ 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x80, 0x80, -/* 0xe88: */ 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xe90: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xe98: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xea0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xea8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xeb0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xeb8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xec0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xec8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xed0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xed8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xee0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xee8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, -/* 0xef0: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, -/* 0xef8: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xcf, -/* 0xf00: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, -/* 0xf08: */ 0xc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0xe0, 0xe0, 0xe0, 0xe0, -/* 0xf98: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, -/* 0xfa0: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, -/* 0xfa8: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, -/* 0xfb0: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf0, -/* 0xfb8: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, -/* 0xfc0: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, -/* 0xfc8: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, -/* 0xfd0: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, -/* 0xfd8: */ 0xf0, 0xf0, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, -/* 0xfe0: */ 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, -/* 0xfe8: */ 0xf8, 0xf8, 0xf8, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, -/* 0xff0: */ 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfe, 0xfe, 0xfe, -/* 0xff8: */ 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, -}; +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 "wave.h" + +reg8 WaveformGeneratorFP::wave8580_PST[] = +{ +/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x378: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, +/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x528: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x530: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x538: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x540: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x548: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x550: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x558: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x560: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x568: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x570: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x578: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x580: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x588: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x590: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x598: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x600: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x608: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x610: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x618: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x620: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x628: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x630: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x638: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x640: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x648: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x650: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x658: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x660: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x668: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x670: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x678: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x680: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x688: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x690: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x698: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x700: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x708: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x710: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x718: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x720: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x728: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x730: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x738: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x740: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x748: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x750: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x758: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x760: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x768: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x770: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x778: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x780: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x788: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x790: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x798: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x70, +/* 0x7f0: */ 0x60, 0x20, 0x70, 0x70, 0x70, 0x70, 0x70, 0x78, +/* 0x7f8: */ 0x78, 0x78, 0x7c, 0x7c, 0x7e, 0x7e, 0x7f, 0x7f, +/* 0x800: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x808: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x810: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x818: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x820: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x828: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x830: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x838: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x840: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x848: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x850: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x858: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x860: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x868: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x870: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x878: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x880: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x888: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x890: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x898: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x900: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x908: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x910: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x918: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x920: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x928: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x930: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x938: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x940: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x948: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x950: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x958: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x960: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x968: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x970: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x978: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x980: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x988: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x990: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x998: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xab0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xab8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xac0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xac8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xad0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xad8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x1e, 0x3f, +/* 0xc00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0xdf8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x8c, 0x9f, +/* 0xe00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, +/* 0xe40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, +/* 0xe60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, +/* 0xe68: */ 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xe70: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xe78: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xe80: */ 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x80, 0x80, +/* 0xe88: */ 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xe90: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xe98: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xea0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xea8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xeb0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xeb8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xec0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xec8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xed0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xed8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xee0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xee8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, +/* 0xef0: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xef8: */ 0xc0, 0xc0, 0xc0, 0x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 0xe0, +/* 0xf88: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf90: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf98: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xfa0: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xfa8: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xfb0: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf0, +/* 0xfb8: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xfc0: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xfc8: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xfd0: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xfd8: */ 0xf0, 0xf0, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, +/* 0xfe0: */ 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, +/* 0xfe8: */ 0xf8, 0xf8, 0xf8, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, +/* 0xff0: */ 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfe, 0xfe, 0xfe, +/* 0xff8: */ 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +}; diff --git a/src/resid-fp/wave8580_PS_.cc b/src/resid-fp/wave8580_PS_.cc index e33a2cee..3f1e0aea 100644 --- a/src/resid-fp/wave8580_PS_.cc +++ b/src/resid-fp/wave8580_PS_.cc @@ -1,536 +1,536 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 "wave.h" - -reg8 WaveformGeneratorFP::wave8580_PS_[] = -{ -/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, -/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, -/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, -/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, -/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x1f, -/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, -/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, -/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0f, -/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x378: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, -/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, -/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3d, -/* 0x3e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, -/* 0x3f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, -/* 0x3f8: */ 0x00, 0x0c, 0x1c, 0x3f, 0x1e, 0x3f, 0x3f, 0x3f, -/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, -/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, -/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x528: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x530: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x538: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x540: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x548: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x550: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x558: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x560: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x568: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x570: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x578: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, -/* 0x580: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x588: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x590: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x598: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, -/* 0x5c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, -/* 0x5e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5e, -/* 0x5f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, -/* 0x5f8: */ 0x00, 0x00, 0x00, 0x5f, 0x0c, 0x5f, 0x5f, 0x5f, -/* 0x600: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x608: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x610: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x618: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x620: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x628: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x630: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x638: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x640: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x648: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x650: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x658: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x660: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x668: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x670: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x678: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, -/* 0x680: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x688: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x690: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x698: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, -/* 0x6c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, -/* 0x6e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, -/* 0x6f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, -/* 0x6f8: */ 0x00, 0x40, 0x40, 0x6f, 0x40, 0x6f, 0x6f, 0x6f, -/* 0x700: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x708: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x710: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x718: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x720: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x728: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x730: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x738: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, -/* 0x740: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x748: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x750: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x758: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x61, -/* 0x760: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0x768: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x40, 0x70, -/* 0x770: */ 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x70, -/* 0x778: */ 0x40, 0x60, 0x60, 0x77, 0x60, 0x77, 0x77, 0x77, -/* 0x780: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x788: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0x790: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, -/* 0x798: */ 0x00, 0x40, 0x40, 0x60, 0x40, 0x60, 0x60, 0x79, -/* 0x7a0: */ 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x60, -/* 0x7a8: */ 0x40, 0x40, 0x40, 0x60, 0x60, 0x60, 0x60, 0x78, -/* 0x7b0: */ 0x40, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x78, -/* 0x7b8: */ 0x60, 0x70, 0x70, 0x78, 0x70, 0x79, 0x7b, 0x7b, -/* 0x7c0: */ 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x70, -/* 0x7c8: */ 0x60, 0x60, 0x60, 0x70, 0x60, 0x70, 0x70, 0x7c, -/* 0x7d0: */ 0x60, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x7c, -/* 0x7d8: */ 0x70, 0x78, 0x78, 0x7c, 0x78, 0x7c, 0x7c, 0x7d, -/* 0x7e0: */ 0x70, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x7c, -/* 0x7e8: */ 0x78, 0x7c, 0x7c, 0x7e, 0x7c, 0x7e, 0x7e, 0x7e, -/* 0x7f0: */ 0x7c, 0x7c, 0x7c, 0x7e, 0x7e, 0x7f, 0x7f, 0x7f, -/* 0x7f8: */ 0x7e, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0xff, -/* 0x800: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x808: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x810: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x818: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x820: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x828: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x830: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x838: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x840: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x848: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x850: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x858: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x860: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x868: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x870: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x878: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, -/* 0x880: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x888: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x890: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x898: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x8c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, -/* 0x900: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x908: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x910: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x918: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x920: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x928: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x930: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x938: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x940: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x948: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x950: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x958: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x960: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x968: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x970: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x978: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, -/* 0x980: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x988: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x990: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x998: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, -/* 0x9c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x8d, -/* 0x9e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x9e8: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x8e, -/* 0x9f0: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x8f, -/* 0x9f8: */ 0x80, 0x80, 0x80, 0x9f, 0x80, 0x9f, 0x9f, 0x9f, -/* 0xa00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0xa40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0xa70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0xa78: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x87, -/* 0xa80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0xaa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0xab0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0xab8: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x83, -/* 0xac0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xac8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0xad0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, -/* 0xad8: */ 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, -/* 0xae0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xae8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x84, -/* 0xaf0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x87, -/* 0xaf8: */ 0x80, 0x80, 0x80, 0x87, 0x80, 0x8f, 0xaf, 0xaf, -/* 0xb00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0xb10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0xb18: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xb20: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x80, -/* 0xb28: */ 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xb30: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xb38: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x83, -/* 0xb40: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xb48: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xb50: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xb58: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, -/* 0xb60: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xb68: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xa0, -/* 0xb70: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xa0, -/* 0xb78: */ 0x80, 0x80, 0x80, 0xa0, 0x80, 0xa3, 0xb7, 0xb7, -/* 0xb80: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xb88: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xb90: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xb98: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xb1, -/* 0xba0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xba8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xb0, -/* 0xbb0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xb0, -/* 0xbb8: */ 0x80, 0xa0, 0xa0, 0xb0, 0xa0, 0xb8, 0xb9, 0xbb, -/* 0xbc0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xa0, -/* 0xbc8: */ 0x80, 0x80, 0x80, 0xa0, 0x80, 0xa0, 0xa0, 0xb8, -/* 0xbd0: */ 0x80, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xb8, -/* 0xbd8: */ 0xa0, 0xb0, 0xb0, 0xb8, 0xb0, 0xbc, 0xbc, 0xbd, -/* 0xbe0: */ 0xa0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb8, 0xb8, 0xbc, -/* 0xbe8: */ 0xb0, 0xb8, 0xb8, 0xbc, 0xb8, 0xbc, 0xbe, 0xbe, -/* 0xbf0: */ 0xb8, 0xbc, 0xbc, 0xbe, 0xbc, 0xbe, 0xbe, 0xbf, -/* 0xbf8: */ 0xbe, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, -/* 0xc00: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, -/* 0xc08: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, -/* 0xc10: */ 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xc18: */ 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xc20: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xc28: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xc30: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xc38: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, -/* 0xc40: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xc48: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xc50: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xc58: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xc60: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xc68: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xc70: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xc78: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc7, -/* 0xc80: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xc88: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xc90: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xc98: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xca0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xca8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xcb0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xcb8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc3, -/* 0xcc0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xcc8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, -/* 0xcd0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, -/* 0xcd8: */ 0x80, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0xc1, -/* 0xce0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, -/* 0xce8: */ 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, -/* 0xcf0: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc7, -/* 0xcf8: */ 0xc0, 0xc0, 0xc0, 0xc7, 0xc0, 0xcf, 0xcf, 0xcf, -/* 0xd00: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xd08: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xd10: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xd18: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, -/* 0xd20: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xd28: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, -/* 0xd30: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, -/* 0xd38: */ 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc3, -/* 0xd40: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, -/* 0xd48: */ 0x80, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0xc0, -/* 0xd50: */ 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, -/* 0xd58: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc1, -/* 0xd60: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, -/* 0xd68: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, -/* 0xd70: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, -/* 0xd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8, 0xf8, 0xf8, -/* 0xfa8: */ 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xfa, -/* 0xfb0: */ 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xfb, -/* 0xfb8: */ 0xf8, 0xfa, 0xfa, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, -/* 0xfc0: */ 0xf8, 0xf8, 0xf8, 0xfc, 0xf8, 0xfc, 0xfc, 0xfc, -/* 0xfc8: */ 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, -/* 0xfd0: */ 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfd, -/* 0xfd8: */ 0xfc, 0xfc, 0xfc, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, -/* 0xfe0: */ 0xfc, 0xfc, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, -/* 0xfe8: */ 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, -/* 0xff0: */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, -/* 0xff8: */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, -}; +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 "wave.h" + +reg8 WaveformGeneratorFP::wave8580_PS_[] = +{ +/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, +/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, +/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x1f, +/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0f, +/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x378: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, +/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, +/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3d, +/* 0x3e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, +/* 0x3f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, +/* 0x3f8: */ 0x00, 0x0c, 0x1c, 0x3f, 0x1e, 0x3f, 0x3f, 0x3f, +/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, +/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x528: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x530: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x538: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x540: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x548: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x550: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x558: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x560: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x568: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x570: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x578: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, +/* 0x580: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x588: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x590: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x598: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, +/* 0x5c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, +/* 0x5e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5e, +/* 0x5f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, +/* 0x5f8: */ 0x00, 0x00, 0x00, 0x5f, 0x0c, 0x5f, 0x5f, 0x5f, +/* 0x600: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x608: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x610: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x618: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x620: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x628: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x630: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x638: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x640: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x648: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x650: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x658: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x660: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x668: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x670: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x678: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, +/* 0x680: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x688: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x690: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x698: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, +/* 0x6c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, +/* 0x6e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, +/* 0x6f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, +/* 0x6f8: */ 0x00, 0x40, 0x40, 0x6f, 0x40, 0x6f, 0x6f, 0x6f, +/* 0x700: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x708: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x710: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x718: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x720: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x728: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x730: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x738: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, +/* 0x740: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x748: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x750: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x758: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x61, +/* 0x760: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0x768: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x40, 0x70, +/* 0x770: */ 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x70, +/* 0x778: */ 0x40, 0x60, 0x60, 0x77, 0x60, 0x77, 0x77, 0x77, +/* 0x780: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x788: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0x790: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, +/* 0x798: */ 0x00, 0x40, 0x40, 0x60, 0x40, 0x60, 0x60, 0x79, +/* 0x7a0: */ 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x60, +/* 0x7a8: */ 0x40, 0x40, 0x40, 0x60, 0x60, 0x60, 0x60, 0x78, +/* 0x7b0: */ 0x40, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x78, +/* 0x7b8: */ 0x60, 0x70, 0x70, 0x78, 0x70, 0x79, 0x7b, 0x7b, +/* 0x7c0: */ 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x70, +/* 0x7c8: */ 0x60, 0x60, 0x60, 0x70, 0x60, 0x70, 0x70, 0x7c, +/* 0x7d0: */ 0x60, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x7c, +/* 0x7d8: */ 0x70, 0x78, 0x78, 0x7c, 0x78, 0x7c, 0x7c, 0x7d, +/* 0x7e0: */ 0x70, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x7c, +/* 0x7e8: */ 0x78, 0x7c, 0x7c, 0x7e, 0x7c, 0x7e, 0x7e, 0x7e, +/* 0x7f0: */ 0x7c, 0x7c, 0x7c, 0x7e, 0x7e, 0x7f, 0x7f, 0x7f, +/* 0x7f8: */ 0x7e, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0xff, +/* 0x800: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x808: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x810: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x818: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x820: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x828: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x830: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x838: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x840: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x848: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x850: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x858: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x860: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x868: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x870: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x878: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0x880: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x888: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x890: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x898: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x8c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, +/* 0x900: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x908: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x910: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x918: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x920: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x928: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x930: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x938: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x940: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x948: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x950: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x958: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x960: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x968: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x970: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x978: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, +/* 0x980: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x988: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x990: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x998: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, +/* 0x9c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x8d, +/* 0x9e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x9e8: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x8e, +/* 0x9f0: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x8f, +/* 0x9f8: */ 0x80, 0x80, 0x80, 0x9f, 0x80, 0x9f, 0x9f, 0x9f, +/* 0xa00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0xa40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0xa70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0xa78: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x87, +/* 0xa80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0xaa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0xab0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0xab8: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x83, +/* 0xac0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xac8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0xad0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, +/* 0xad8: */ 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, +/* 0xae0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xae8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x84, +/* 0xaf0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x87, +/* 0xaf8: */ 0x80, 0x80, 0x80, 0x87, 0x80, 0x8f, 0xaf, 0xaf, +/* 0xb00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0xb10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0xb18: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb20: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x80, +/* 0xb28: */ 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb30: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb38: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x83, +/* 0xb40: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb48: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb50: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb58: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, +/* 0xb60: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb68: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xa0, +/* 0xb70: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xa0, +/* 0xb78: */ 0x80, 0x80, 0x80, 0xa0, 0x80, 0xa3, 0xb7, 0xb7, +/* 0xb80: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb88: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb90: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb98: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xb1, +/* 0xba0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xba8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xb0, +/* 0xbb0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xb0, +/* 0xbb8: */ 0x80, 0xa0, 0xa0, 0xb0, 0xa0, 0xb8, 0xb9, 0xbb, +/* 0xbc0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xa0, +/* 0xbc8: */ 0x80, 0x80, 0x80, 0xa0, 0x80, 0xa0, 0xa0, 0xb8, +/* 0xbd0: */ 0x80, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xb8, +/* 0xbd8: */ 0xa0, 0xb0, 0xb0, 0xb8, 0xb0, 0xbc, 0xbc, 0xbd, +/* 0xbe0: */ 0xa0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb8, 0xb8, 0xbc, +/* 0xbe8: */ 0xb0, 0xb8, 0xb8, 0xbc, 0xb8, 0xbc, 0xbe, 0xbe, +/* 0xbf0: */ 0xb8, 0xbc, 0xbc, 0xbe, 0xbc, 0xbe, 0xbe, 0xbf, +/* 0xbf8: */ 0xbe, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, +/* 0xc00: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, +/* 0xc08: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, +/* 0xc10: */ 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc18: */ 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc20: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc28: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc30: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc38: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, +/* 0xc40: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc48: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc50: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc58: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc60: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc68: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc70: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc78: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc7, +/* 0xc80: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc88: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc90: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc98: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xca0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xca8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xcb0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xcb8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc3, +/* 0xcc0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xcc8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, +/* 0xcd0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, +/* 0xcd8: */ 0x80, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0xc1, +/* 0xce0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, +/* 0xce8: */ 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xcf0: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc7, +/* 0xcf8: */ 0xc0, 0xc0, 0xc0, 0xc7, 0xc0, 0xcf, 0xcf, 0xcf, +/* 0xd00: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xd08: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xd10: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xd18: */ 0x80,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c, 0xfd, +/* 0xfd8: */ 0xfc, 0xfc, 0xfc, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, +/* 0xfe0: */ 0xfc, 0xfc, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, +/* 0xfe8: */ 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, +/* 0xff0: */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* 0xff8: */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +}; diff --git a/src/resid-fp/wave8580_P_T.cc b/src/resid-fp/wave8580_P_T.cc index 206a9172..f3fcfd91 100644 --- a/src/resid-fp/wave8580_P_T.cc +++ b/src/resid-fp/wave8580_P_T.cc @@ -1,536 +1,536 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 "wave.h" - -reg8 WaveformGeneratorFP::wave8580_P_T[] = -{ -/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, -/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1f8: */ 0x00, 0x00, 0x00, 0x1c, 0x00, 0x3c, 0x3f, 0x3f, -/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5e, 0x5f, -/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0x378: */ 0x00, 0x00, 0x00, 0x40, 0x40, 0x60, 0x60, 0x6f, -/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, -/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, -/* 0x3b0: */ 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x60, -/* 0x3b8: */ 0x40, 0x40, 0x60, 0x60, 0x60, 0x60, 0x70, 0x77, -/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, -/* 0x3c8: */ 0x40, 0x40, 0x40, 0x40, 0x40, 0x60, 0x60, 0x60, -/* 0x3d0: */ 0x40, 0x40, 0x40, 0x60, 0x60, 0x60, 0x60, 0x70, -/* 0x3d8: */ 0x60, 0x60, 0x60, 0x70, 0x70, 0x70, 0x78, 0x7b, -/* 0x3e0: */ 0x60, 0x60, 0x60, 0x70, 0x60, 0x70, 0x70, 0x70, -/* 0x3e8: */ 0x70, 0x70, 0x70, 0x78, 0x78, 0x78, 0x78, 0x7c, -/* 0x3f0: */ 0x78, 0x78, 0x78, 0x7c, 0x78, 0x7c, 0x7c, 0x7e, -/* 0x3f8: */ 0x7c, 0x7e, 0x7e, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, -/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, -/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x4d8: */ 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x4e0: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x4e8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x4f0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x4f8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x8e, 0x9f, -/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x528: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x80, -/* 0x530: */ 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x538: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x540: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x80, -/* 0x548: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x550: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x558: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x560: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x568: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x570: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x578: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xaf, -/* 0x580: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x588: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x590: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x598: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x5a0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x5a8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x5b0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x5b8: */ 0x80, 0x80, 0x80, 0xa0, 0xa0, 0xa0, 0xa0, 0xb7, -/* 0x5c0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x5c8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xa0, -/* 0x5d0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xa0, 0xa0, -/* 0x5d8: */ 0xa0, 0xa0, 0xa0, 0xb0, 0xa0, 0xb0, 0xb0, 0xbb, -/* 0x5e0: */ 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xb0, 0xb0, -/* 0x5e8: */ 0xa0, 0xb0, 0xb0, 0xb8, 0xb0, 0xb8, 0xb8, 0xbc, -/* 0x5f0: */ 0xb0, 0xb8, 0xb8, 0xb8, 0xb8, 0xbc, 0xbc, 0xbe, -/* 0x5f8: */ 0xbc, 0xbc, 0xbe, 0xbf, 0xbe, 0xbf, 0xbf, 0xbf, -/* 0x600: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x608: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x610: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x618: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x620: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x628: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x630: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x638: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, -/* 0x640: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x648: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x650: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, -/* 0x658: */ 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, -/* 0x660: */ 0x80, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0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80, 0x80, 0x80, -/* 0x9b8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x9c0: */ 0xc0, 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x9c8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x9d0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x9d8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x9e0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x9e8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x9f0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0x9f8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xa00: */ 0xbf, 0xbf, 0xbf, 0xbe, 0xbf, 0xbe, 0xbc, 0xbc, -/* 0xa08: */ 0xbe, 0xbc, 0xbc, 0xb8, 0xb8, 0xb8, 0xb8, 0xb0, -/* 0xa10: */ 0xbc, 0xb8, 0xb8, 0xb0, 0xb8, 0xb0, 0xb0, 0xb0, -/* 0xa18: */ 0xb0, 0xb0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, -/* 0xa20: */ 0xbb, 0xb0, 0xb0, 0xa0, 0xb0, 0xa0, 0xa0, 0xa0, -/* 0xa28: */ 0xa0, 0xa0, 0xa0, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xa30: */ 0xa0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xa38: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xa40: */ 0xb7, 0xb0, 0xa0, 0xa0, 0xa0, 0x80, 0x80, 0x80, -/* 0xa48: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xa50: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xa58: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xa60: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xa68: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xa70: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xa78: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xa80: */ 0xaf, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xa88: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xa90: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xa98: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xaa0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xaa8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xab0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xab8: */ 0x80, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, -/* 0xac0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xac8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, -/* 0xad0: */ 0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, -/* 0xad8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xae0: */ 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xae8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb00: */ 0x9f, 0x9e, 0x88, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xb08: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xb10: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xb18: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, -/* 0xb20: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, -/* 0xb28: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb30: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb40: */ 0x80, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, -/* 0xb48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb80: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xba0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xba8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc00: */ 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7e, 0x7e, 0x7c, -/* 0xc08: */ 0x7e, 0x7c, 0x7c, 0x78, 0x7c, 0x78, 0x78, 0x78, -/* 0xc10: */ 0x7c, 0x78, 0x78, 0x78, 0x78, 0x70, 0x70, 0x70, -/* 0xc18: */ 0x78, 0x70, 0x70, 0x60, 0x70, 0x60, 0x60, 0x60, -/* 0xc20: */ 0x7b, 0x78, 0x70, 0x70, 0x70, 0x60, 0x60, 0x60, -/* 0xc28: */ 0x70, 0x60, 0x60, 0x60, 0x60, 0x40, 0x40, 0x40, -/* 0xc30: */ 0x60, 0x60, 0x60, 0x40, 0x40, 0x40, 0x40, 0x40, -/* 0xc38: */ 0x40, 0x40, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00, -/* 0xc40: */ 0x77, 0x70, 0x60, 0x60, 0x60, 0x60, 0x40, 0x40, -/* 0xc48: */ 0x60, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, -/* 0xc50: */ 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc60: */ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc80: */ 0x6f, 0x64, 0x60, 0x40, 0x40, 0x00, 0x00, 0x00, -/* 0xc88: */ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xca0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xca8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xce0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xce8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd00: */ 0x5f, 0x5e, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xda0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xda8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xde0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xde8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe00: */ 0x3f, 0x3f, 0x3e, 0x00, 0x1c, 0x00, 0x00, 0x00, -/* 0xe08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xea0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xea8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xeb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xeb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xec0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xec8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xed0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xed8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xee0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xee8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xef0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xef8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf00: */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xf98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xfe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xff0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xff8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 "wave.h" + +reg8 WaveformGeneratorFP::wave8580_P_T[] = +{ +/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, +/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f8: */ 0x00, 0x00, 0x00, 0x1c, 0x00, 0x3c, 0x3f, 0x3f, +/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5e, 0x5f, +/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0x378: */ 0x00, 0x00, 0x00, 0x40, 0x40, 0x60, 0x60, 0x6f, +/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, +/* 0x3b0: */ 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x60, +/* 0x3b8: */ 0x40, 0x40, 0x60, 0x60, 0x60, 0x60, 0x70, 0x77, +/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, +/* 0x3c8: */ 0x40, 0x40, 0x40, 0x40, 0x40, 0x60, 0x60, 0x60, +/* 0x3d0: */ 0x40, 0x40, 0x40, 0x60, 0x60, 0x60, 0x60, 0x70, +/* 0x3d8: */ 0x60, 0x60, 0x60, 0x70, 0x70, 0x70, 0x78, 0x7b, +/* 0x3e0: */ 0x60, 0x60, 0x60, 0x70, 0x60, 0x70, 0x70, 0x70, +/* 0x3e8: */ 0x70, 0x70, 0x70, 0x78, 0x78, 0x78, 0x78, 0x7c, +/* 0x3f0: */ 0x78, 0x78, 0x78, 0x7c, 0x78, 0x7c, 0x7c, 0x7e, +/* 0x3f8: */ 0x7c, 0x7e, 0x7e, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, +/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, +/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x4d8: */ 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x4e0: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x4e8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x4f0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x4f8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x8e, 0x9f, +/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x528: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x80, +/* 0x530: */ 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x538: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x540: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x80, +/* 0x548: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x550: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x558: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x560: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x568: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x570: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x578: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xaf, +/* 0x580: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x588: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x590: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x598: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x5a0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x5a8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x5b0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x5b8: */ 0x80, 0x80, 0x80, 0xa0, 0xa0, 0xa0, 0xa0, 0xb7, +/* 0x5c0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x5c8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xa0, +/* 0x5d0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xa0, 0xa0, +/* 0x5d8: */ 0xa0, 0xa0, 0xa0, 0xb0, 0xa0, 0xb0, 0xb0, 0xbb, +/* 0x5e0: */ 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xb0, 0xb0, +/* 0x5e8: */ 0xa0, 0xb0, 0xb0, 0xb8, 0xb0, 0xb8, 0xb8, 0xbc, +/* 0x5f0: */ 0xb0, 0xb8, 0xb8, 0xb8, 0xb8, 0xbc, 0xbc, 0xbe, +/* 0x5f8: */ 0xbc, 0xbc, 0xbe, 0xbf, 0xbe, 0xbf, 0xbf, 0xbf, +/* 0x600: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x608: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x610: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x618: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x620: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x628: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x630: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x638: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, +/* 0x640: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x648: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x650: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, +/* 0x658: */ 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x660: */ 0x80, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0xc0, +/* 0x668: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x670: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x678: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xcf, +/* 0x680: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, +/* 0x688: */ 0xc0, 0x80, 0xc0, 0xc0,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, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x950: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x958: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x960: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x968: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x970: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, +/* 0x978: */ 0xc0, 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x980: */ 0xcf, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x988: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x990: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x998: */ 0xc0, 0xc0, 0xc0, 0x80, 0xc0, 0x80, 0x80, 0x80, +/* 0x9a0: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, 0x80, +/* 0x9a8: */ 0xc0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9b0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9b8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9c0: */ 0xc0, 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9c8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9d0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9d8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9e0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9e8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9f0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9f8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa00: */ 0xbf, 0xbf, 0xbf, 0xbe, 0xbf, 0xbe, 0xbc, 0xbc, +/* 0xa08: */ 0xbe, 0xbc, 0xbc, 0xb8, 0xb8, 0xb8, 0xb8, 0xb0, +/* 0xa10: */ 0xbc, 0xb8, 0xb8, 0xb0, 0xb8, 0xb0, 0xb0, 0xb0, +/* 0xa18: */ 0xb0, 0xb0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, +/* 0xa20: */ 0xbb, 0xb0, 0xb0, 0xa0, 0xb0, 0xa0, 0xa0, 0xa0, +/* 0xa28: */ 0xa0, 0xa0, 0xa0, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa30: */ 0xa0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa38: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa40: */ 0xb7, 0xb0, 0xa0, 0xa0, 0xa0, 0x80, 0x80, 0x80, +/* 0xa48: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa50: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa58: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa60: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa68: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa70: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa78: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa80: */ 0xaf, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa88: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa90: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa98: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xaa0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xaa8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xab0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xab8: */ 0x80, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, +/* 0xac0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xac8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, +/* 0xad0: */ 0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, +/* 0xad8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae0: */ 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb00: */ 0x9f, 0x9e, 0x88, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb08: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb10: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb18: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, +/* 0xb20: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, +/* 0xb28: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb30: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb40: */ 0x80, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, +/* 0xb48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb80: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc00: */ 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7e, 0x7e, 0x7c, +/* 0xc08: */ 0x7e, 0x7c, 0x7c, 0x78, 0x7c, 0x78, 0x78, 0x78, +/* 0xc10: */ 0x7c, 0x78, 0x78, 0x78, 0x78, 0x70, 0x70, 0x70, +/* 0xc18: */ 0x78, 0x70, 0x70, 0x60, 0x70, 0x60, 0x60, 0x60, +/* 0xc20: */ 0x7b, 0x78, 0x70, 0x70, 0x70, 0x60, 0x60, 0x60, +/* 0xc28: */ 0x70, 0x60, 0x60, 0x60, 0x60, 0x40, 0x40, 0x40, +/* 0xc30: */ 0x60, 0x60, 0x60, 0x40, 0x40, 0x40, 0x40, 0x40, +/* 0xc38: */ 0x40, 0x40, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00, +/* 0xc40: */ 0x77, 0x70, 0x60, 0x60, 0x60, 0x60, 0x40, 0x40, +/* 0xc48: */ 0x60, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, +/* 0xc50: */ 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc60: */ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc80: */ 0x6f, 0x64, 0x60, 0x40, 0x40, 0x00, 0x00, 0x00, +/* 0xc88: */ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd00: */ 0x5f, 0x5e, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe00: */ 0x3f, 0x3f, 0x3e, 0x00, 0x1c, 0x00, 0x00, 0x00, +/* 0xe08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xea0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xea8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xeb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xeb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xec0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xec8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xed0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xed8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xee0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xee8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xef0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xef8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf00: */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xff0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xff8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/src/resid-fp/wave8580__ST.cc b/src/resid-fp/wave8580__ST.cc index cfe58378..892a6eca 100644 --- a/src/resid-fp/wave8580__ST.cc +++ b/src/resid-fp/wave8580__ST.cc @@ -1,536 +1,536 @@ -// --------------------------------------------------------------------------- -// This file is part of reSID, a MOS6581 SID emulator engine. -// Copyright (C) 2004 Dag Lem -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public 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 "wave.h" - -reg8 WaveformGeneratorFP::wave8580__ST[] = -{ -/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, -/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x1f8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x0f, -/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x2f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, -/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x378: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x3f0: */ 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, -/* 0x3f8: */ 0x1e, 0x1e, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, -/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x4f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, -/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x528: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x530: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x538: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x540: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x548: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x550: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x558: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x560: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x568: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x570: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x578: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x580: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x588: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x590: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x598: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x5f8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x1f, -/* 0x600: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x608: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x610: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x618: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x620: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x628: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x630: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x638: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x640: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x648: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x650: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x658: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x660: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x668: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x670: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x678: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x680: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x688: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x690: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x698: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x6f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, -/* 0x700: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x708: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x710: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x718: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x720: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x728: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x730: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x738: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x740: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x748: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x750: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x758: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x760: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x768: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x770: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x778: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x780: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x788: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x790: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x798: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0x7c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x7e0: */ 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, -/* 0x7e8: */ 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, -/* 0x7f0: */ 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3e, -/* 0x7f8: */ 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, -/* 0x800: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x808: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x810: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x818: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x820: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x828: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x830: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x838: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x840: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x848: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x850: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x858: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x860: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x868: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x870: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x878: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x880: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x888: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x890: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x898: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x8f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, -/* 0x900: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x908: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x910: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x918: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x920: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x928: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x930: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x938: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x940: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x948: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x950: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x958: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x960: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x968: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x970: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x978: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0x980: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x988: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x990: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x998: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0x9f8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x0f, -/* 0xa00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0xa80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xa98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xab0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xab8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xac0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xac8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xad0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xad8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xae0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xae8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xaf8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, -/* 0xb00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0xb80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xb98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xba0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xba8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0xbc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xbf0: */ 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, -/* 0xbf8: */ 0x1e, 0x1e, 0x1f, 0x1f, 0x1f, 0x1f, 0x3f, 0x3f, -/* 0xc00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0xc80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xc98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xca0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xca8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xce0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xce8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xcf8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, -/* 0xd00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -/* 0xd80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xd98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xda0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xda8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -/* 0xdc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xde0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xde8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xdf8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x1f, 0x1f, -/* 0xe00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 0xe78: */ 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x83, 0x83, -/* 0xe80: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xe88: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xe90: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xe98: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xea0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xea8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xeb0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xeb8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xec0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xec8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xed0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xed8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xee0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xee8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xef0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, -/* 0xef8: */ 0x80, 0x80, 0x80, 0x80, 0x87, 0x87, 0x87, 0x8f, -/* 0xf00: */ 0xc0, 0xe0, 0xe0, 0xc0, 0xc0, 0xe0, 0xe0, 0xe0, -/* 0xf08: */ 0xe0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, -/* 0xf10: */ 0xc0, 0xe0, 0xe0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, -/* 0xf18: */ 0xe0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, -/* 0xf20: */ 0xc0, 0xe0, 0xe0, 0xc0, 0xc0, 0xe0, 0xe0, 0xe0, -/* 0xf28: */ 0xe0, 0xe0, 0xe0, 0xc0, 0xe0, 0xc0, 0xe0, 0xe0, -/* 0xf30: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, -/* 0xf38: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, -/* 0xf40: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, -/* 0xf48: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, -/* 0xf50: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, -/* 0xf58: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0,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 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, -/* 0xff0: */ 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, -/* 0xff8: */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, -}; +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2004 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public 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 "wave.h" + +reg8 WaveformGeneratorFP::wave8580__ST[] = +{ +/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x0f, +/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x378: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3f0: */ 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, +/* 0x3f8: */ 0x1e, 0x1e, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, +/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x528: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x530: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x538: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x540: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x548: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x550: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x558: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x560: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x568: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x570: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x578: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x580: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x588: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x590: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x598: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5f8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x1f, +/* 0x600: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x608: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x610: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x618: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x620: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x628: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x630: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x638: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x640: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x648: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x650: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x658: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x660: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x668: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x670: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x678: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x680: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x688: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x690: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x698: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0x700: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x708: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x710: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x718: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x720: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x728: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x730: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x738: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x740: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x748: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x750: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x758: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x760: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x768: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x770: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x778: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x780: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x788: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x790: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x798: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x7c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7e0: */ 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, +/* 0x7e8: */ 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, +/* 0x7f0: */ 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3e, +/* 0x7f8: */ 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, +/* 0x800: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x808: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x810: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x818: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x820: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x828: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x830: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x838: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x840: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x848: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x850: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x858: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x860: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x868: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x870: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x878: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x880: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x888: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x890: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x898: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0x900: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x908: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x910: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x918: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x920: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x928: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x930: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x938: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x940: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x948: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x950: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x958: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x960: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x968: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x970: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x978: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x980: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x988: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x990: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x998: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9f8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x0f, +/* 0xa00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0xa80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xab0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xab8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xac0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xac8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xad0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xad8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0xb00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0xb80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0xbc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbf0: */ 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, +/* 0xbf8: */ 0x1e, 0x1e, 0x1f, 0x1f, 0x1f, 0x1f, 0x3f, 0x3f, +/* 0xc00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0xc80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0xd00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0xd80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0xdc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdf8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x1f, 0x1f, +/* 0xe00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe78: */ 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x83, 0x83, +/* 0xe80: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xe88: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xe90: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xe98: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xea0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xea8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xeb0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xeb8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xec0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xec8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xed0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xed8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xee0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xee8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xef0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xef8: */ 0x80, 0x80, 0x80, 0x80, 0x87, 0x87, 0x87, 0x8f, +/* 0xf00: */ 0xc0, 0xe0, 0xe0, 0xc0, 0xc0, 0xe0, 0xe0, 0xe0, +/* 0xf08: */ 0xe0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf10: */ 0xc0, 0xe0, 0xe0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf18: */ 0xe0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf20: */ 0xc0, 0xe0, 0xe0, 0xc0, 0xc0, 0xe0, 0xe0, 0xe0, +/* 0xf28: */ 0xe0, 0xe0, 0xe0, 0xc0, 0xe0, 0xc0, 0xe0, 0xe0, +/* 0xf30: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf38: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf40: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf48: */ 0xe0, 0xe0, 0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8, 0xf8, 0xf8, 0xf8, +/* 0xfd8: */ 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, +/* 0xfe0: */ 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, +/* 0xfe8: */ 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, +/* 0xff0: */ 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, +/* 0xff8: */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +}; diff --git a/src/resid.cc b/src/resid.cc index 2356d81c..b8f3a201 100644 --- a/src/resid.cc +++ b/src/resid.cc @@ -1,158 +1,158 @@ -/*B-em v2.2 by Tom Walker - resid-fp interfacing code*/ - -#include -#include -#include -#include "resid-fp/sid.h" -#include "sidtypes.h" -#include "sid_b-em.h" - -int sidrunning=0; -extern "C" void sid_init(); -extern "C" void sid_reset(); -extern "C" void sid_settype(int resamp, int model); -extern "C" uint8_t sid_read(uint16_t addr); -extern "C" void sid_write(uint16_t addr, uint8_t val); -extern "C" void sid_fillbuf(int16_t *buf, int len); - -struct sound_s -{ - /* resid sid implementation */ - SIDFP *sid; -}; - -typedef struct sound_s sound_t; - -sound_t *psid; - -void sid_init() -{ - int c; - sampling_method method=SAMPLE_INTERPOLATE; - float cycles_per_sec=1000000; - - psid = new sound_t; - psid->sid = new SIDFP; - - psid->sid->set_chip_model(MOS8580FP); - - psid->sid->set_voice_nonlinearity(1.0f); - psid->sid->get_filter().set_distortion_properties(0.f, 0.f, 0.f); - psid->sid->get_filter().set_type4_properties(6.55f, 20.0f); - - psid->sid->enable_filter(true); - psid->sid->enable_external_filter(true); - - psid->sid->reset(); - - for (c=0;c<32;c++) - psid->sid->write(c,0); - - if (!psid->sid->set_sampling_parameters((float)cycles_per_sec, method, - (float)31250, 0.9*31250.0/2.0)) - { - // printf("reSID failed!\n"); - } -} - -void sid_reset() -{ - int c; - psid->sid->reset(); - - for (c=0;c<32;c++) - psid->sid->write(c,0); - - sidrunning=0; -} - - -void sid_settype(int resamp, int model) -{ - sampling_method method=(resamp)?SAMPLE_RESAMPLE_INTERPOLATE:SAMPLE_INTERPOLATE; - if (!psid->sid->set_sampling_parameters((float)1000000, method,(float)31250, 0.9*31250.0/2.0)) - { -// rpclog("Change failed\n"); - } - - psid->sid->get_filter().set_type4_properties(6.55f, 20.0f); - /* Model numbers 8-15 are reserved for distorted 6581s. */ - if (model < 8 || model > 15) { - psid->sid->set_chip_model((model)?MOS8580FP:MOS6581FP); - psid->sid->set_voice_nonlinearity(1.0f); - psid->sid->get_filter().set_distortion_properties(0.f, 0.f, 0.f); - } else { - psid->sid->set_chip_model(MOS6581FP); - psid->sid->set_voice_nonlinearity(0.96f); - psid->sid->get_filter().set_distortion_properties(3.7e-3f, 2048.f, 1.2e-4f); - } - psid->sid->input(0); - switch (model) - { - case SID_MODEL_8580D: - psid->sid->input(-32768); - break; - case SID_MODEL_8580R5_3691: - psid->sid->get_filter().set_type4_properties(6.55f, 20.0f); - break; - case SID_MODEL_8580R5_3691D: - psid->sid->get_filter().set_type4_properties(6.55f, 20.0f); - psid->sid->input(-32768); - break; - - case SID_MODEL_8580R5_1489: - psid->sid->get_filter().set_type4_properties(5.7f, 20.0f); - break; - case SID_MODEL_8580R5_1489D: - psid->sid->get_filter().set_type4_properties(5.7f, 20.0f); - psid->sid->input(-32768); - break; - - case SID_MODEL_6581R3_4885: - psid->sid->get_filter().set_type3_properties(8.5e5f, 2.2e6f, 1.0075f, 1.8e4f); - break; - case SID_MODEL_6581R3_0486S: - psid->sid->get_filter().set_type3_properties(1.1e6f, 1.5e7f, 1.006f, 1e4f); - break; - case SID_MODEL_6581R3_3984: - psid->sid->get_filter().set_type3_properties(1.8e6f, 3.5e7f, 1.0051f, 1.45e4f); - break; - default: - case SID_MODEL_6581R4AR_3789: - psid->sid->get_filter().set_type3_properties(1.40e6f, 1.47e8f, 1.0059f, 1.55e4f); - break; - case SID_MODEL_6581R3_4485: - psid->sid->get_filter().set_type3_properties(1.3e6f, 5.2e8f, 1.0053f, 1.1e4f); - break; - case SID_MODEL_6581R4_1986S: - psid->sid->get_filter().set_type3_properties(1.33e6f, 2.2e9f, 1.0056f, 7e3f); - break; - } -} - -uint8_t sid_read(uint16_t addr) -{ - return psid->sid->read(addr&0x1F); -// return 0xFF; -} - -void sid_write(uint16_t addr, uint8_t val) -{ - sidrunning=1; - psid->sid->write(addr&0x1F,val); -} - -static void fillbuf2(int& count, int16_t *buf, int len) -{ - int c; - if (sidrunning) c=psid->sid->clock(count, buf, len, 1); - else memset(buf,0,len*2); -// printf("Result %i len %i\n",c,len); -} -void sid_fillbuf(int16_t *buf, int len) -{ - int x=64; - - fillbuf2(x,buf,len); -} +/*B-em v2.2 by Tom Walker + resid-fp interfacing code*/ + +#include +#include +#include +#include "resid-fp/sid.h" +#include "sidtypes.h" +#include "sid_b-em.h" + +int sidrunning=0; +extern "C" void sid_init(); +extern "C" void sid_reset(); +extern "C" void sid_settype(int resamp, int model); +extern "C" uint8_t sid_read(uint16_t addr); +extern "C" void sid_write(uint16_t addr, uint8_t val); +extern "C" void sid_fillbuf(int16_t *buf, int len); + +struct sound_s +{ + /* resid sid implementation */ + SIDFP *sid; +}; + +typedef struct sound_s sound_t; + +sound_t *psid; + +void sid_init() +{ + int c; + sampling_method method=SAMPLE_INTERPOLATE; + float cycles_per_sec=1000000; + + psid = new sound_t; + psid->sid = new SIDFP; + + psid->sid->set_chip_model(MOS8580FP); + + psid->sid->set_voice_nonlinearity(1.0f); + psid->sid->get_filter().set_distortion_properties(0.f, 0.f, 0.f); + psid->sid->get_filter().set_type4_properties(6.55f, 20.0f); + + psid->sid->enable_filter(true); + psid->sid->enable_external_filter(true); + + psid->sid->reset(); + + for (c=0;c<32;c++) + psid->sid->write(c,0); + + if (!psid->sid->set_sampling_parameters((float)cycles_per_sec, method, + (float)31250, 0.9*31250.0/2.0)) + { + // printf("reSID failed!\n"); + } +} + +void sid_reset() +{ + int c; + psid->sid->reset(); + + for (c=0;c<32;c++) + psid->sid->write(c,0); + + sidrunning=0; +} + + +void sid_settype(int resamp, int model) +{ + sampling_method method=(resamp)?SAMPLE_RESAMPLE_INTERPOLATE:SAMPLE_INTERPOLATE; + if (!psid->sid->set_sampling_parameters((float)1000000, method,(float)31250, 0.9*31250.0/2.0)) + { +// rpclog("Change failed\n"); + } + + psid->sid->get_filter().set_type4_properties(6.55f, 20.0f); + /* Model numbers 8-15 are reserved for distorted 6581s. */ + if (model < 8 || model > 15) { + psid->sid->set_chip_model((model)?MOS8580FP:MOS6581FP); + psid->sid->set_voice_nonlinearity(1.0f); + psid->sid->get_filter().set_distortion_properties(0.f, 0.f, 0.f); + } else { + psid->sid->set_chip_model(MOS6581FP); + psid->sid->set_voice_nonlinearity(0.96f); + psid->sid->get_filter().set_distortion_properties(3.7e-3f, 2048.f, 1.2e-4f); + } + psid->sid->input(0); + switch (model) + { + case SID_MODEL_8580D: + psid->sid->input(-32768); + break; + case SID_MODEL_8580R5_3691: + psid->sid->get_filter().set_type4_properties(6.55f, 20.0f); + break; + case SID_MODEL_8580R5_3691D: + psid->sid->get_filter().set_type4_properties(6.55f, 20.0f); + psid->sid->input(-32768); + break; + + case SID_MODEL_8580R5_1489: + psid->sid->get_filter().set_type4_properties(5.7f, 20.0f); + break; + case SID_MODEL_8580R5_1489D: + psid->sid->get_filter().set_type4_properties(5.7f, 20.0f); + psid->sid->input(-32768); + break; + + case SID_MODEL_6581R3_4885: + psid->sid->get_filter().set_type3_properties(8.5e5f, 2.2e6f, 1.0075f, 1.8e4f); + break; + case SID_MODEL_6581R3_0486S: + psid->sid->get_filter().set_type3_properties(1.1e6f, 1.5e7f, 1.006f, 1e4f); + break; + case SID_MODEL_6581R3_3984: + psid->sid->get_filter().set_type3_properties(1.8e6f, 3.5e7f, 1.0051f, 1.45e4f); + break; + default: + case SID_MODEL_6581R4AR_3789: + psid->sid->get_filter().set_type3_properties(1.40e6f, 1.47e8f, 1.0059f, 1.55e4f); + break; + case SID_MODEL_6581R3_4485: + psid->sid->get_filter().set_type3_properties(1.3e6f, 5.2e8f, 1.0053f, 1.1e4f); + break; + case SID_MODEL_6581R4_1986S: + psid->sid->get_filter().set_type3_properties(1.33e6f, 2.2e9f, 1.0056f, 7e3f); + break; + } +} + +uint8_t sid_read(uint16_t addr) +{ + return psid->sid->read(addr&0x1F); +// return 0xFF; +} + +void sid_write(uint16_t addr, uint8_t val) +{ + sidrunning=1; + psid->sid->write(addr&0x1F,val); +} + +static void fillbuf2(int& count, int16_t *buf, int len) +{ + int c; + if (sidrunning) c=psid->sid->clock(count, buf, len, 1); + else memset(buf,0,len*2); +// printf("Result %i len %i\n",c,len); +} +void sid_fillbuf(int16_t *buf, int len) +{ + int x=64; + + fillbuf2(x,buf,len); +} diff --git a/src/resources.h b/src/resources.h index 10c1f938..f7ec8792 100644 --- a/src/resources.h +++ b/src/resources.h @@ -1,91 +1,91 @@ -//#define NS32016 -/*Uncomment the above to enable (buggy) 32016 emulation. Currently it just aborts - constantly, but when it didn't I couldn't get any programs to run, so you're - just stuck at the CLI prompt. Anyone want to help? - You'll need the file Pandora.rom in roms/tube - So far no one wants to help :( - */ - -#include "sidtypes.h" - -#define IDM_FILE_RESET 40000 -#define IDM_FILE_LSTATE 40001 -#define IDM_FILE_SSTATE 40002 -#define IDM_FILE_EXIT 40003 -#define IDM_DISC_LOAD_0 40010 -#define IDM_DISC_LOAD_1 40011 -#define IDM_DISC_EJECT_0 40012 -#define IDM_DISC_EJECT_1 40013 -#define IDM_DISC_NEW_0 40014 -#define IDM_DISC_NEW_1 40015 -#define IDM_DISC_WPROT_0 40016 -#define IDM_DISC_WPROT_1 40017 -#define IDM_DISC_WPROT_D 40018 -#define IDM_DISC_AUTOBOOT 40019 -#define IDM_TAPE_LOAD 40020 -#define IDM_TAPE_EJECT 40021 -#define IDM_TAPE_REWIND 40022 -#define IDM_TAPE_CAT 40023 -#define IDM_TAPES_NORMAL 40025 -#define IDM_TAPES_FAST 40026 -#define IDM_VIDEO_NOBORDERS 40030 -#define IDM_VIDEO_MBORDERS 40031 -#define IDM_VIDEO_FBORDERS 40032 -#define IDM_VIDEO_FULLSCR 40035 -#define IDM_VIDEO_RESIZE 40036 -#define IDM_SOUND_INTERNAL 40040 -#define IDM_SOUND_BEEBSID 40041 -#define IDM_SOUND_DAC 40042 -#define IDM_SOUND_DDNOISE 40043 -#define IDM_SOUND_TAPE 40044 -#define IDM_SOUND_FILTER 40099 -#define IDM_WAVE_SQUARE 40045 -#define IDM_WAVE_SAW 40046 -#define IDM_WAVE_SINE 40047 -#define IDM_WAVE_TRI 40048 -#define IDM_WAVE_SID 40049 -#define IDM_VIDEO_SLINEDBL 40050 -#define IDM_VIDEO_LINEDBL 40051 -#define IDM_VIDEO_SCANLINES 40052 -#define IDM_VIDEO_INTERLACED 40053 -#define IDM_VIDEO_PAL 40054 -#define IDM_VIDEO_PALI 40055 -#define IDM_KEY_REDEFINE 40060 -#define IDM_KEY_AS 40061 -#define IDM_DDV_33 40070 -#define IDM_DDV_66 40071 -#define IDM_DDV_100 40072 -#define IDM_DDT_525 40075 -#define IDM_DDT_35 40076 -#define IDM_IDE_ENABLE 40080 -#define IDM_MOUSE_AMX 40090 -#define IDM_DEBUGGER 40100 -#define IDM_BREAK 40102 -#define IDM_SCRSHOT 40101 -#define IDM_MODEL_0 41000 -#define IDM_TUBE_NONE 41050 -#define IDM_TUBE_6502 41051 -#define IDM_TUBE_Z80 41053 -#define IDM_TUBE_65816 41055 -#define IDM_TUBE_32016 41056 -#define IDM_TUBES_4 41060 -#define IDM_TUBES_8 41061 -#define IDM_TUBES_16 41062 -#define IDM_TUBES_32 41063 -#define IDM_TUBES_64 41064 -#define IDM_SPD_10 41080 -#define IDM_SPD_25 41081 -#define IDM_SPD_50 41082 -#define IDM_SPD_75 41083 -#define IDM_SPD_100 41084 -#define IDM_SPD_150 41085 -#define IDM_SPD_200 41086 -#define IDM_SPD_300 41087 -#define IDM_SPD_400 41088 -#define IDM_SPD_500 41089 -#define IDM_SID_TYPE 41100 -#define IDM_SID_INTERP 41200 -#define IDM_SID_RESAMP 41201 - -#define Button1 1000 -#define ListBox1 40900 +//#define NS32016 +/*Uncomment the above to enable (buggy) 32016 emulation. Currently it just aborts + constantly, but when it didn't I couldn't get any programs to run, so you're + just stuck at the CLI prompt. Anyone want to help? + You'll need the file Pandora.rom in roms/tube + So far no one wants to help :( + */ + +#include "sidtypes.h" + +#define IDM_FILE_RESET 40000 +#define IDM_FILE_LSTATE 40001 +#define IDM_FILE_SSTATE 40002 +#define IDM_FILE_EXIT 40003 +#define IDM_DISC_LOAD_0 40010 +#define IDM_DISC_LOAD_1 40011 +#define IDM_DISC_EJECT_0 40012 +#define IDM_DISC_EJECT_1 40013 +#define IDM_DISC_NEW_0 40014 +#define IDM_DISC_NEW_1 40015 +#define IDM_DISC_WPROT_0 40016 +#define IDM_DISC_WPROT_1 40017 +#define IDM_DISC_WPROT_D 40018 +#define IDM_DISC_AUTOBOOT 40019 +#define IDM_TAPE_LOAD 40020 +#define IDM_TAPE_EJECT 40021 +#define IDM_TAPE_REWIND 40022 +#define IDM_TAPE_CAT 40023 +#define IDM_TAPES_NORMAL 40025 +#define IDM_TAPES_FAST 40026 +#define IDM_VIDEO_NOBORDERS 40030 +#define IDM_VIDEO_MBORDERS 40031 +#define IDM_VIDEO_FBORDERS 40032 +#define IDM_VIDEO_FULLSCR 40035 +#define IDM_VIDEO_RESIZE 40036 +#define IDM_SOUND_INTERNAL 40040 +#define IDM_SOUND_BEEBSID 40041 +#define IDM_SOUND_DAC 40042 +#define IDM_SOUND_DDNOISE 40043 +#define IDM_SOUND_TAPE 40044 +#define IDM_SOUND_FILTER 40099 +#define IDM_WAVE_SQUARE 40045 +#define IDM_WAVE_SAW 40046 +#define IDM_WAVE_SINE 40047 +#define IDM_WAVE_TRI 40048 +#define IDM_WAVE_SID 40049 +#define IDM_VIDEO_SLINEDBL 40050 +#define IDM_VIDEO_LINEDBL 40051 +#define IDM_VIDEO_SCANLINES 40052 +#define IDM_VIDEO_INTERLACED 40053 +#define IDM_VIDEO_PAL 40054 +#define IDM_VIDEO_PALI 40055 +#define IDM_KEY_REDEFINE 40060 +#define IDM_KEY_AS 40061 +#define IDM_DDV_33 40070 +#define IDM_DDV_66 40071 +#define IDM_DDV_100 40072 +#define IDM_DDT_525 40075 +#define IDM_DDT_35 40076 +#define IDM_IDE_ENABLE 40080 +#define IDM_MOUSE_AMX 40090 +#define IDM_DEBUGGER 40100 +#define IDM_BREAK 40102 +#define IDM_SCRSHOT 40101 +#define IDM_MODEL_0 41000 +#define IDM_TUBE_NONE 41050 +#define IDM_TUBE_6502 41051 +#define IDM_TUBE_Z80 41053 +#define IDM_TUBE_65816 41055 +#define IDM_TUBE_32016 41056 +#define IDM_TUBES_4 41060 +#define IDM_TUBES_8 41061 +#define IDM_TUBES_16 41062 +#define IDM_TUBES_32 41063 +#define IDM_TUBES_64 41064 +#define IDM_SPD_10 41080 +#define IDM_SPD_25 41081 +#define IDM_SPD_50 41082 +#define IDM_SPD_75 41083 +#define IDM_SPD_100 41084 +#define IDM_SPD_150 41085 +#define IDM_SPD_200 41086 +#define IDM_SPD_300 41087 +#define IDM_SPD_400 41088 +#define IDM_SPD_500 41089 +#define IDM_SID_TYPE 41100 +#define IDM_SID_INTERP 41200 +#define IDM_SID_RESAMP 41201 + +#define Button1 1000 +#define ListBox1 40900 diff --git a/src/savestate.c b/src/savestate.c index df521ff9..3e911f11 100644 --- a/src/savestate.c +++ b/src/savestate.c @@ -1,98 +1,98 @@ -/*B-em v2.2 by Tom Walker - Savestate handling*/ -#include -#include "b-em.h" - -#include "6502.h" -#include "acia.h" -#include "adc.h" -#include "main.h" -#include "mem.h" -#include "model.h" -#include "savestate.h" -#include "serial.h" -#include "sn76489.h" -#include "via.h" -#include "sysvia.h" -#include "uservia.h" -#include "video.h" - -int savestate_wantsave, savestate_wantload; -char savestate_name[260]; - -void savestate_save() -{ -// rpclog("Save state\n"); - savestate_wantsave = 1; -} - -void savestate_load() -{ - savestate_wantload = 1; -} - -void savestate_dosave() -{ - FILE *f; - f = fopen(savestate_name, "wb"); -// rpclog("DoSave state\n"); - putc('B', f); putc('E', f); putc('M', f); putc('S', f); - putc('N', f); putc('A', f); putc('P', f); putc('1', f); - - putc(curmodel, f); - - m6502_savestate(f); - mem_savestate(f); - sysvia_savestate(f); - uservia_savestate(f); - videoula_savestate(f); - crtc_savestate(f); - video_savestate(f); - sn_savestate(f); - adc_savestate(f); - acia_savestate(f); - serial_savestate(f); - - fclose(f); - - savestate_wantsave = 0; -} - -void savestate_doload() -{ - int c; - char id[9]; - FILE *f = fopen(savestate_name, "rb"); - for (c = 0; c < 8; c++) id[c] = getc(f); - id[8] = 0; - if (strcmp(id, "BEMSNAP1")) - { - fclose(f); - bem_error("Not a B-em v2.x save state."); - return; - } - - curmodel = getc(f); - selecttube = curtube = -1; - rpclog("Restart BBC\n"); - main_restart(); - rpclog("Done!\n"); - - m6502_loadstate(f); - mem_loadstate(f); - sysvia_loadstate(f); - uservia_loadstate(f); - videoula_loadstate(f); - crtc_loadstate(f); - video_loadstate(f); - sn_loadstate(f); - adc_loadstate(f); - acia_loadstate(f); - serial_loadstate(f); - - rpclog("Loadstate done!\n"); - - fclose(f); - - savestate_wantload = 0; -} +/*B-em v2.2 by Tom Walker + Savestate handling*/ +#include +#include "b-em.h" + +#include "6502.h" +#include "acia.h" +#include "adc.h" +#include "main.h" +#include "mem.h" +#include "model.h" +#include "savestate.h" +#include "serial.h" +#include "sn76489.h" +#include "via.h" +#include "sysvia.h" +#include "uservia.h" +#include "video.h" + +int savestate_wantsave, savestate_wantload; +char savestate_name[260]; + +void savestate_save() +{ +// rpclog("Save state\n"); + savestate_wantsave = 1; +} + +void savestate_load() +{ + savestate_wantload = 1; +} + +void savestate_dosave() +{ + FILE *f; + f = fopen(savestate_name, "wb"); +// rpclog("DoSave state\n"); + putc('B', f); putc('E', f); putc('M', f); putc('S', f); + putc('N', f); putc('A', f); putc('P', f); putc('1', f); + + putc(curmodel, f); + + m6502_savestate(f); + mem_savestate(f); + sysvia_savestate(f); + uservia_savestate(f); + videoula_savestate(f); + crtc_savestate(f); + video_savestate(f); + sn_savestate(f); + adc_savestate(f); + acia_savestate(f); + serial_savestate(f); + + fclose(f); + + savestate_wantsave = 0; +} + +void savestate_doload() +{ + int c; + char id[9]; + FILE *f = fopen(savestate_name, "rb"); + for (c = 0; c < 8; c++) id[c] = getc(f); + id[8] = 0; + if (strcmp(id, "BEMSNAP1")) + { + fclose(f); + bem_error("Not a B-em v2.x save state."); + return; + } + + curmodel = getc(f); + selecttube = curtube = -1; + rpclog("Restart BBC\n"); + main_restart(); + rpclog("Done!\n"); + + m6502_loadstate(f); + mem_loadstate(f); + sysvia_loadstate(f); + uservia_loadstate(f); + videoula_loadstate(f); + crtc_loadstate(f); + video_loadstate(f); + sn_loadstate(f); + adc_loadstate(f); + acia_loadstate(f); + serial_loadstate(f); + + rpclog("Loadstate done!\n"); + + fclose(f); + + savestate_wantload = 0; +} diff --git a/src/savestate.h b/src/savestate.h index 9af59dc7..5e458cfa 100644 --- a/src/savestate.h +++ b/src/savestate.h @@ -1,7 +1,7 @@ -extern int savestate_wantsave, savestate_wantload; -extern char savestate_name[260]; - -void savestate_save(); -void savestate_load(); -void savestate_dosave(); -void savestate_doload(); +extern int savestate_wantsave, savestate_wantload; +extern char savestate_name[260]; + +void savestate_save(); +void savestate_load(); +void savestate_dosave(); +void savestate_doload(); diff --git a/src/scan2bbc.h b/src/scan2bbc.h index 63d3d260..aab38cff 100644 --- a/src/scan2bbc.h +++ b/src/scan2bbc.h @@ -1,44 +1,44 @@ -/*PC Scancode to BBC col+row table*/ - -unsigned char scan2bbc[128]= // IBM SCAN CODE BBC -{ - 0xAA,0x70,0x30,0x31, // .ESC12 0,1,2,3 - 0x11,0x12,0x13,0x34, // 3456 4,5,6,7 - 0x24,0x15,0x26,0x27, // 7890 8,9,10,11 - 0x17,0x18,0x59, // -=DEL 12,13,14 - - 0x60,0x10,0x21,0x22, // TABqwe 15,16,17,18 TABqwe - 0x33,0x23,0x44,0x35, // rtyu 19,20,21,22 rtyu - 0x25,0x36,0x37,0x47,0x38,0x49, // iop[]RET 23,24,25,26,27,28 iop@[RET (miss _) - - 0x01,0x41,0x51,0x32, // CTRLasd 29,30,31,32 CTRLasd - 0x43,0x53,0x54,0x45, // fghj 33,34,35,36 fghj - 0x46,0x56,0x57,0x48,0x28, // kl;'~ 37,38,39,40,41 kl+*] - - 0x00,0x58,0x61,0x42,0x52, // LSH\zxc 42,43,44,45,46 - 0x63,0x64,0x55,0x65, // vbnm 47,48,49,50 - 0x66,0x67,0x68,0x00,0x5b, // <>?RSH. 51,52,53,54,55 - 0x50,0x62,0x40, // ALT,SPC,CAPS 56,57,58 SHIFTLOCK,SPC,CAPs - 0x71,0x72, // f1,f2 59,60 f0,f1 - 0x73,0x14, // f3,f4 61,62 - 0x74,0x75, // f5,f6 63,64 - 0x16,0x76, // f7,f8 65,66 - 0x77,0x20,0xAA, // f9,f10 67,68,69 - 0xAA, // 70 - 0xAA,0x39,0xAA,0x3b, // hme upA pgu min 71,72,73,74 - 0x19,0xaa,0x79,0x3a, // lft mid rgt plu 74,75,76,77 - 0x69,0x29,0xaa, // end dna pgd 78,79,80 - 0xAA,0x59, // ins del ... 81,82 - 0x4c,0xaa, // 83,84 - 0x78, // 85 - 0x28,0xaa, // f11,f12 86,88 --,BRK - 0xaa,0xaa,0xaa,0xaa, // 89,90,91,92 - 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa, // 93-99 - 0x6a,0x6b,0x7c,0x6c,0x7a, // 100-104 - 0x7b,0x1a,0x1b,0x2a,0x2b, // 105-109 - 0xaa,0x3c,0xaa,0x5a,0x4a, // 110-114 - 0x4c,0x5c,0xaa,0xaa,0xaa, // 115-119 - 0xaa,0xaa,0xaa,0xaa,0xaa, // 120-124 - 0xaa,0xaa,0xaa // 120-127 - -}; +/*PC Scancode to BBC col+row table*/ + +unsigned char scan2bbc[128]= // IBM SCAN CODE BBC +{ + 0xAA,0x70,0x30,0x31, // .ESC12 0,1,2,3 + 0x11,0x12,0x13,0x34, // 3456 4,5,6,7 + 0x24,0x15,0x26,0x27, // 7890 8,9,10,11 + 0x17,0x18,0x59, // -=DEL 12,13,14 + + 0x60,0x10,0x21,0x22, // TABqwe 15,16,17,18 TABqwe + 0x33,0x23,0x44,0x35, // rtyu 19,20,21,22 rtyu + 0x25,0x36,0x37,0x47,0x38,0x49, // iop[]RET 23,24,25,26,27,28 iop@[RET (miss _) + + 0x01,0x41,0x51,0x32, // CTRLasd 29,30,31,32 CTRLasd + 0x43,0x53,0x54,0x45, // fghj 33,34,35,36 fghj + 0x46,0x56,0x57,0x48,0x28, // kl;'~ 37,38,39,40,41 kl+*] + + 0x00,0x58,0x61,0x42,0x52, // LSH\zxc 42,43,44,45,46 + 0x63,0x64,0x55,0x65, // vbnm 47,48,49,50 + 0x66,0x67,0x68,0x00,0x5b, // <>?RSH. 51,52,53,54,55 + 0x50,0x62,0x40, // ALT,SPC,CAPS 56,57,58 SHIFTLOCK,SPC,CAPs + 0x71,0x72, // f1,f2 59,60 f0,f1 + 0x73,0x14, // f3,f4 61,62 + 0x74,0x75, // f5,f6 63,64 + 0x16,0x76, // f7,f8 65,66 + 0x77,0x20,0xAA, // f9,f10 67,68,69 + 0xAA, // 70 + 0xAA,0x39,0xAA,0x3b, // hme upA pgu min 71,72,73,74 + 0x19,0xaa,0x79,0x3a, // lft mid rgt plu 74,75,76,77 + 0x69,0x29,0xaa, // end dna pgd 78,79,80 + 0xAA,0x59, // ins del ... 81,82 + 0x4c,0xaa, // 83,84 + 0x78, // 85 + 0x28,0xaa, // f11,f12 86,88 --,BRK + 0xaa,0xaa,0xaa,0xaa, // 89,90,91,92 + 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa, // 93-99 + 0x6a,0x6b,0x7c,0x6c,0x7a, // 100-104 + 0x7b,0x1a,0x1b,0x2a,0x2b, // 105-109 + 0xaa,0x3c,0xaa,0x5a,0x4a, // 110-114 + 0x4c,0x5c,0xaa,0xaa,0xaa, // 115-119 + 0xaa,0xaa,0xaa,0xaa,0xaa, // 120-124 + 0xaa,0xaa,0xaa // 120-127 + +}; diff --git a/src/serial.c b/src/serial.c index c8478b26..0b19d3b3 100644 --- a/src/serial.c +++ b/src/serial.c @@ -1,59 +1,59 @@ -/*B-em v2.2 by Tom Walker - Serial ULA emulation*/ - -#include -#include "b-em.h" -#include "serial.h" -#include "acia.h" -#include "tape.h" -#include "tapenoise.h" - -int motor; - -static uint8_t serial_reg; -static uint8_t serial_transmit_rate, serial_recive_rate; - -void serial_reset() -{ - /*Dunno what happens to this on reset*/ - serial_reg = serial_transmit_rate = serial_recive_rate=0; - motor=0; -} - -void serial_write(uint16_t addr, uint8_t val) -{ - serial_reg = val; - serial_transmit_rate = val & 0x7; - serial_recive_rate = (val >> 3) & 0x7; - if (motor != (val & 0x80)) - tapenoise_motorchange(val>>7); - motor = (val & 0x80) && tape_loaded; - if (val & 0x40) - { - /*RS423*/ - acia_sr &= ~4; /*Clear acia DCD*/ - } - else - { - /*Tape*/ - acia_sr &= ~8; /*Clear acia CTS*/ - } -} - - -uint8_t serial_read(uint16_t addr) -{ - /*Reading from this has the same effect as writing &FE*/ - serial_write(0, 0xFE); - return 0; -} - -void serial_savestate(FILE *f) -{ - putc(serial_reg, f); -} - -void serial_loadstate(FILE *f) -{ - serial_write(0, getc(f)); -} +/*B-em v2.2 by Tom Walker + Serial ULA emulation*/ + +#include +#include "b-em.h" +#include "serial.h" +#include "acia.h" +#include "tape.h" +#include "tapenoise.h" + +int motor; + +static uint8_t serial_reg; +static uint8_t serial_transmit_rate, serial_recive_rate; + +void serial_reset() +{ + /*Dunno what happens to this on reset*/ + serial_reg = serial_transmit_rate = serial_recive_rate=0; + motor=0; +} + +void serial_write(uint16_t addr, uint8_t val) +{ + serial_reg = val; + serial_transmit_rate = val & 0x7; + serial_recive_rate = (val >> 3) & 0x7; + if (motor != (val & 0x80)) + tapenoise_motorchange(val>>7); + motor = (val & 0x80) && tape_loaded; + if (val & 0x40) + { + /*RS423*/ + acia_sr &= ~4; /*Clear acia DCD*/ + } + else + { + /*Tape*/ + acia_sr &= ~8; /*Clear acia CTS*/ + } +} + + +uint8_t serial_read(uint16_t addr) +{ + /*Reading from this has the same effect as writing &FE*/ + serial_write(0, 0xFE); + return 0; +} + +void serial_savestate(FILE *f) +{ + putc(serial_reg, f); +} + +void serial_loadstate(FILE *f) +{ + serial_write(0, getc(f)); +} diff --git a/src/serial.h b/src/serial.h index 62c18899..22a34ec7 100644 --- a/src/serial.h +++ b/src/serial.h @@ -1,8 +1,8 @@ -void serial_write(uint16_t addr, uint8_t val); -uint8_t serial_read(uint16_t addr); -void serial_reset(); - -void serial_savestate(FILE *f); -void serial_loadstate(FILE *f); - -extern int motor; +void serial_write(uint16_t addr, uint8_t val); +uint8_t serial_read(uint16_t addr); +void serial_reset(); + +void serial_savestate(FILE *f); +void serial_loadstate(FILE *f); + +extern int motor; diff --git a/src/sid_b-em.h b/src/sid_b-em.h index 0524d2b0..86f84d15 100644 --- a/src/sid_b-em.h +++ b/src/sid_b-em.h @@ -1,17 +1,17 @@ -#ifdef __cplusplus -extern "C" { -#endif - -void sid_init(); -void sid_reset(); -void sid_settype(int resamp, int model); -uint8_t sid_read(uint16_t addr); -void sid_write(uint16_t addr, uint8_t val); -void sid_fillbuf(int16_t *buf, int len); - -extern int cursid; -extern int sidmethod; - -#ifdef __cplusplus -} -#endif +#ifdef __cplusplus +extern "C" { +#endif + +void sid_init(); +void sid_reset(); +void sid_settype(int resamp, int model); +uint8_t sid_read(uint16_t addr); +void sid_write(uint16_t addr, uint8_t val); +void sid_fillbuf(int16_t *buf, int len); + +extern int cursid; +extern int sidmethod; + +#ifdef __cplusplus +} +#endif diff --git a/src/sidtypes.h b/src/sidtypes.h index d8032ded..320c713e 100644 --- a/src/sidtypes.h +++ b/src/sidtypes.h @@ -1,14 +1,14 @@ -#define SID_MODEL_6581 0 -#define SID_MODEL_8580 1 -#define SID_MODEL_8580D 2 -#define SID_MODEL_6581R4 3 -#define SID_MODEL_6581R3_4885 8 -#define SID_MODEL_6581R3_0486S 9 -#define SID_MODEL_6581R3_3984 10 -#define SID_MODEL_6581R4AR_3789 11 -#define SID_MODEL_6581R3_4485 12 -#define SID_MODEL_6581R4_1986S 13 -#define SID_MODEL_8580R5_3691 16 -#define SID_MODEL_8580R5_3691D 17 -#define SID_MODEL_8580R5_1489 18 -#define SID_MODEL_8580R5_1489D 19 +#define SID_MODEL_6581 0 +#define SID_MODEL_8580 1 +#define SID_MODEL_8580D 2 +#define SID_MODEL_6581R4 3 +#define SID_MODEL_6581R3_4885 8 +#define SID_MODEL_6581R3_0486S 9 +#define SID_MODEL_6581R3_3984 10 +#define SID_MODEL_6581R4AR_3789 11 +#define SID_MODEL_6581R3_4485 12 +#define SID_MODEL_6581R4_1986S 13 +#define SID_MODEL_8580R5_3691 16 +#define SID_MODEL_8580R5_3691D 17 +#define SID_MODEL_8580R5_1489 18 +#define SID_MODEL_8580R5_1489D 19 diff --git a/src/sn76489.c b/src/sn76489.c index 744384cc..ad425e90 100644 --- a/src/sn76489.c +++ b/src/sn76489.c @@ -1,254 +1,254 @@ -/*B-em v2.2 by Tom Walker - Internal SN sound chip emulation*/ - -#include -#include -#include "b-em.h" -#include "sid_b-em.h" -#include "sn76489.h" -#include "sound.h" -#include "via.h" -#include "uservia.h" - -uint8_t sn_freqhi[4], sn_freqlo[4]; -uint8_t sn_vol[4]; -uint8_t sn_noise; -static uint16_t sn_shift; -static int lasttone; -static fixed sn_count[4], sn_stat[4]; -uint32_t sn_latch[4]; - -static int sn_rect_pos = 0,sn_rect_dir = 0; - -int curwave = 0; - -static float volslog[16] = -{ - 0.00000f, 0.59715f, 0.75180f, 0.94650f, - 1.19145f, 1.50000f, 1.88835f, 2.37735f, - 2.99295f, 3.76785f, 4.74345f, 5.97165f, - 7.51785f, 9.46440f, 11.9194f, 15.0000f -}; - -/*static int volume_table[16] = { - 32767, 26028, 20675, 16422, 13045, 10362, 8231, 6568, - 5193, 4125, 3277, 2603, 2067, 1642, 1304, 0 -};*/ - -static int16_t snwaves[5][32] = -{ - { - 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, - -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127 - - }, - { - -120, -112, -104, -96, -88, -80, -72, -64, -56, -48, -40, -32, -24, -16, -8, 0, - 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 127 - }, - { - 16, 32, 48, 64, 80, 96, 112, 128, 112, 96, 80, 64, 48, 32, 16, 0, - -16, -32, -48, -64, -80, -96, -112, -128, -112, -96, -80, -64, -48, -32, -16, 0 - }, - { - 0, 24, 48, 70, 89, 105, 117, 124, 126, 124, 117, 105, 89, 70, 48, 24, - 0, -24, -48, -70, -89, -105, -117, -124, -126, -124, -117, -105, -90, -70, -48, -25 - } -}; - -static void sn_updaterectwave(int d) -{ - int c; - - for (c = 0; c < d; c++) snwaves[4][c] = 127; - for ( ;c < 32; c++) snwaves[4][c] = -127; -} - - - - -void sn_fillbuf(int16_t *buffer, int len) -{ - int c, d; - static int sidcount = 0; - - for (d = 0; d < len; d++) - { - for (c = 0; c < 3; c++) - { - c++; - if (sn_latch[c] > 256) buffer[d] += (int16_t) (snwaves[curwave][sn_stat[c]] * volslog[sn_vol[c]]); - else buffer[d] += (int16_t) (volslog[sn_vol[c]] * 127); - - sn_count[c] -= 8192; - while ((int)sn_count[c] < 0 && sn_latch[c]) - { - sn_count[c] += sn_latch[c]; - sn_stat[c]++; - sn_stat[c] &= 31; - } - c--; - } - if (!(sn_noise & 4)) - { - if (curwave == 4) buffer[d] += (snwaves[4][sn_stat[0] & 31] * volslog[sn_vol[0]]); - else buffer[d] += (((sn_shift & 1) ^ 1) * 127 * volslog[sn_vol[0]] * 2); - } - else buffer[d] += (((sn_shift & 1) ^ 1) * 127 * volslog[sn_vol[0]] * 2); - - sn_count[0] -= 512; - while ((int)sn_count[0] < 0 && sn_latch[0]) - { - sn_count[0] += (sn_latch[0] * 2); - if (!(sn_noise & 4)) - { - if (sn_shift & 1) sn_shift |= 0x8000; - sn_shift >>= 1; - } - else - { - if ((sn_shift & 1) ^ ((sn_shift >> 1) & 1)) sn_shift |= 0x8000; - sn_shift >>= 1; - } - sn_stat[0]++; - } - if (!(sn_noise & 4)) - { - while (sn_stat[0] >= 30) sn_stat[0] -= 30; - } - else - sn_stat[0] &= 32767; -// buffer[d] += (lpt_dac * 32); - - sidcount++; - if (sidcount == 624) - { - sidcount = 0; - if (!sn_rect_dir) - { - sn_rect_pos++; - if (sn_rect_pos == 30) sn_rect_dir = 1; - } - else - { - sn_rect_pos--; - if (sn_rect_pos == 1) sn_rect_dir = 0; - } - sn_updaterectwave(sn_rect_pos); - } - } -} - -void sn_init() -{ - int c; -// for (c = 0; c < 16; c++) -// volslog[c] = (float)volume_table[15 - c] / 2048.0; - - for (c = 0; c < 32; c++) - snwaves[3][c] -= 128; - - - sn_latch[0] = sn_latch[1] = sn_latch[2] = sn_latch[3] = 0x3FF << 6; - sn_vol[0] = 0; - sn_vol[1] = sn_vol[2] = sn_vol[3] = 8; - srand(time(NULL)); - sn_count[0] = 0; - sn_count[1] = (rand()&0x3FF)<<6; - sn_count[2] = (rand()&0x3FF)<<6; - sn_count[3] = (rand()&0x3FF)<<6; - sn_noise = 3; - sn_shift = 0x4000; -} - -static uint8_t firstdat; -void sn_write(uint8_t data) -{ - int freq; - - if (data & 0x80) - { - firstdat = data; - switch (data & 0x70) - { - case 0: - sn_freqlo[3] = data & 0xF; - sn_latch[3] = (sn_freqlo[3] | (sn_freqhi[3] << 4)) << 6; - lasttone = 3; - break; - case 0x10: - data &= 0xF; - sn_vol[3] = 0xF - data; - break; - case 0x20: - sn_freqlo[2] = data & 0xF; - sn_latch[2] = (sn_freqlo[2] | (sn_freqhi[2] << 4)) << 6; - lasttone = 2; - break; - case 0x30: - data &= 0xF; - sn_vol[2] = 0xF - data; - break; - case 0x40: - sn_freqlo[1] = data & 0xF; - sn_latch[1] = (sn_freqlo[1] | (sn_freqhi[1] << 4)) << 6; - lasttone = 1; - break; - case 0x50: - data &= 0xF; - sn_vol[1] = 0xF - data; - break; - case 0x60: - sn_shift = 0x4000; - if ((data & 3) != (sn_noise & 3)) sn_count[0] = 0; - sn_noise = data & 0xF; - if ((data & 3) == 3) sn_latch[0] = sn_latch[1]; - else sn_latch[0] = 0x400 << (data & 3); - break; - case 0x70: - data &= 0xF; - sn_vol[0] = 0xF - data; - break; - } - } - else - { - if ((firstdat & 0x70) == 0x60) - { - sn_shift = 0x4000; - if ((data & 3) != (sn_noise & 3)) sn_count[0] = 0; - sn_noise = data & 0xF; - if ((data & 3) == 3) sn_latch[0] = sn_latch[1]; - else sn_latch[0] = 0x400 << (data & 3); - return; - } - sn_freqhi[lasttone] = data & 0x3F; - freq=sn_freqlo[lasttone] | (sn_freqhi[lasttone] << 4); - if ((sn_noise & 3) == 3 && lasttone == 1) - sn_latch[0] = freq << 6; - sn_latch[lasttone] = freq << 6; - sn_count[lasttone] = 0; - } -} - - - -void sn_savestate(FILE *f) -{ - fwrite(sn_latch, 16, 1, f); - fwrite(sn_count, 16, 1, f); - fwrite(sn_stat, 16, 1, f); - fwrite(sn_vol, 4, 1, f); - putc(sn_noise, f); - putc(sn_shift, f); putc(sn_shift >> 8, f); -} - -void sn_loadstate(FILE *f) -{ - fread(sn_latch, 16, 1, f); - fread(sn_count, 16, 1, f); - fread(sn_stat, 16, 1, f); - fread(sn_vol, 4, 1, f); - sn_noise = getc(f); - sn_shift = getc(f); sn_shift |= getc(f) << 8; -} +/*B-em v2.2 by Tom Walker + Internal SN sound chip emulation*/ + +#include +#include +#include "b-em.h" +#include "sid_b-em.h" +#include "sn76489.h" +#include "sound.h" +#include "via.h" +#include "uservia.h" + +uint8_t sn_freqhi[4], sn_freqlo[4]; +uint8_t sn_vol[4]; +uint8_t sn_noise; +static uint16_t sn_shift; +static int lasttone; +static fixed sn_count[4], sn_stat[4]; +uint32_t sn_latch[4]; + +static int sn_rect_pos = 0,sn_rect_dir = 0; + +int curwave = 0; + +static float volslog[16] = +{ + 0.00000f, 0.59715f, 0.75180f, 0.94650f, + 1.19145f, 1.50000f, 1.88835f, 2.37735f, + 2.99295f, 3.76785f, 4.74345f, 5.97165f, + 7.51785f, 9.46440f, 11.9194f, 15.0000f +}; + +/*static int volume_table[16] = { + 32767, 26028, 20675, 16422, 13045, 10362, 8231, 6568, + 5193, 4125, 3277, 2603, 2067, 1642, 1304, 0 +};*/ + +static int16_t snwaves[5][32] = +{ + { + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127 + + }, + { + -120, -112, -104, -96, -88, -80, -72, -64, -56, -48, -40, -32, -24, -16, -8, 0, + 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 127 + }, + { + 16, 32, 48, 64, 80, 96, 112, 128, 112, 96, 80, 64, 48, 32, 16, 0, + -16, -32, -48, -64, -80, -96, -112, -128, -112, -96, -80, -64, -48, -32, -16, 0 + }, + { + 0, 24, 48, 70, 89, 105, 117, 124, 126, 124, 117, 105, 89, 70, 48, 24, + 0, -24, -48, -70, -89, -105, -117, -124, -126, -124, -117, -105, -90, -70, -48, -25 + } +}; + +static void sn_updaterectwave(int d) +{ + int c; + + for (c = 0; c < d; c++) snwaves[4][c] = 127; + for ( ;c < 32; c++) snwaves[4][c] = -127; +} + + + + +void sn_fillbuf(int16_t *buffer, int len) +{ + int c, d; + static int sidcount = 0; + + for (d = 0; d < len; d++) + { + for (c = 0; c < 3; c++) + { + c++; + if (sn_latch[c] > 256) buffer[d] += (int16_t) (snwaves[curwave][sn_stat[c]] * volslog[sn_vol[c]]); + else buffer[d] += (int16_t) (volslog[sn_vol[c]] * 127); + + sn_count[c] -= 8192; + while ((int)sn_count[c] < 0 && sn_latch[c]) + { + sn_count[c] += sn_latch[c]; + sn_stat[c]++; + sn_stat[c] &= 31; + } + c--; + } + if (!(sn_noise & 4)) + { + if (curwave == 4) buffer[d] += (snwaves[4][sn_stat[0] & 31] * volslog[sn_vol[0]]); + else buffer[d] += (((sn_shift & 1) ^ 1) * 127 * volslog[sn_vol[0]] * 2); + } + else buffer[d] += (((sn_shift & 1) ^ 1) * 127 * volslog[sn_vol[0]] * 2); + + sn_count[0] -= 512; + while ((int)sn_count[0] < 0 && sn_latch[0]) + { + sn_count[0] += (sn_latch[0] * 2); + if (!(sn_noise & 4)) + { + if (sn_shift & 1) sn_shift |= 0x8000; + sn_shift >>= 1; + } + else + { + if ((sn_shift & 1) ^ ((sn_shift >> 1) & 1)) sn_shift |= 0x8000; + sn_shift >>= 1; + } + sn_stat[0]++; + } + if (!(sn_noise & 4)) + { + while (sn_stat[0] >= 30) sn_stat[0] -= 30; + } + else + sn_stat[0] &= 32767; +// buffer[d] += (lpt_dac * 32); + + sidcount++; + if (sidcount == 624) + { + sidcount = 0; + if (!sn_rect_dir) + { + sn_rect_pos++; + if (sn_rect_pos == 30) sn_rect_dir = 1; + } + else + { + sn_rect_pos--; + if (sn_rect_pos == 1) sn_rect_dir = 0; + } + sn_updaterectwave(sn_rect_pos); + } + } +} + +void sn_init() +{ + int c; +// for (c = 0; c < 16; c++) +// volslog[c] = (float)volume_table[15 - c] / 2048.0; + + for (c = 0; c < 32; c++) + snwaves[3][c] -= 128; + + + sn_latch[0] = sn_latch[1] = sn_latch[2] = sn_latch[3] = 0x3FF << 6; + sn_vol[0] = 0; + sn_vol[1] = sn_vol[2] = sn_vol[3] = 8; + srand(time(NULL)); + sn_count[0] = 0; + sn_count[1] = (rand()&0x3FF)<<6; + sn_count[2] = (rand()&0x3FF)<<6; + sn_count[3] = (rand()&0x3FF)<<6; + sn_noise = 3; + sn_shift = 0x4000; +} + +static uint8_t firstdat; +void sn_write(uint8_t data) +{ + int freq; + + if (data & 0x80) + { + firstdat = data; + switch (data & 0x70) + { + case 0: + sn_freqlo[3] = data & 0xF; + sn_latch[3] = (sn_freqlo[3] | (sn_freqhi[3] << 4)) << 6; + lasttone = 3; + break; + case 0x10: + data &= 0xF; + sn_vol[3] = 0xF - data; + break; + case 0x20: + sn_freqlo[2] = data & 0xF; + sn_latch[2] = (sn_freqlo[2] | (sn_freqhi[2] << 4)) << 6; + lasttone = 2; + break; + case 0x30: + data &= 0xF; + sn_vol[2] = 0xF - data; + break; + case 0x40: + sn_freqlo[1] = data & 0xF; + sn_latch[1] = (sn_freqlo[1] | (sn_freqhi[1] << 4)) << 6; + lasttone = 1; + break; + case 0x50: + data &= 0xF; + sn_vol[1] = 0xF - data; + break; + case 0x60: + sn_shift = 0x4000; + if ((data & 3) != (sn_noise & 3)) sn_count[0] = 0; + sn_noise = data & 0xF; + if ((data & 3) == 3) sn_latch[0] = sn_latch[1]; + else sn_latch[0] = 0x400 << (data & 3); + break; + case 0x70: + data &= 0xF; + sn_vol[0] = 0xF - data; + break; + } + } + else + { + if ((firstdat & 0x70) == 0x60) + { + sn_shift = 0x4000; + if ((data & 3) != (sn_noise & 3)) sn_count[0] = 0; + sn_noise = data & 0xF; + if ((data & 3) == 3) sn_latch[0] = sn_latch[1]; + else sn_latch[0] = 0x400 << (data & 3); + return; + } + sn_freqhi[lasttone] = data & 0x3F; + freq=sn_freqlo[lasttone] | (sn_freqhi[lasttone] << 4); + if ((sn_noise & 3) == 3 && lasttone == 1) + sn_latch[0] = freq << 6; + sn_latch[lasttone] = freq << 6; + sn_count[lasttone] = 0; + } +} + + + +void sn_savestate(FILE *f) +{ + fwrite(sn_latch, 16, 1, f); + fwrite(sn_count, 16, 1, f); + fwrite(sn_stat, 16, 1, f); + fwrite(sn_vol, 4, 1, f); + putc(sn_noise, f); + putc(sn_shift, f); putc(sn_shift >> 8, f); +} + +void sn_loadstate(FILE *f) +{ + fread(sn_latch, 16, 1, f); + fread(sn_count, 16, 1, f); + fread(sn_stat, 16, 1, f); + fread(sn_vol, 4, 1, f); + sn_noise = getc(f); + sn_shift = getc(f); sn_shift |= getc(f) << 8; +} diff --git a/src/sn76489.h b/src/sn76489.h index 6e641e52..4dd05023 100644 --- a/src/sn76489.h +++ b/src/sn76489.h @@ -1,12 +1,12 @@ -void sn_init(); -void sn_fillbuf(int16_t *buffer, int len); -void sn_write(uint8_t data); -void sn_savestate(FILE *f); -void sn_loadstate(FILE *f); - -extern uint8_t sn_freqhi[4],sn_freqlo[4]; -extern uint8_t sn_vol[4]; -extern uint8_t sn_noise; -extern uint32_t sn_latch[4]; - -extern int curwave; +void sn_init(); +void sn_fillbuf(int16_t *buffer, int len); +void sn_write(uint8_t data); +void sn_savestate(FILE *f); +void sn_loadstate(FILE *f); + +extern uint8_t sn_freqhi[4],sn_freqlo[4]; +extern uint8_t sn_vol[4]; +extern uint8_t sn_noise; +extern uint32_t sn_latch[4]; + +extern int curwave; diff --git a/src/sound.c b/src/sound.c index 049ad37d..9350f014 100644 --- a/src/sound.c +++ b/src/sound.c @@ -1,99 +1,99 @@ -/*B-em v2.2 by Tom Walker - Internal SN sound chip emulation*/ - -#include -#include -#include "b-em.h" -#include "sid_b-em.h" -#include "sn76489.h" -#include "sound.h" -#include "via.h" -#include "uservia.h" -#include "soundopenal.h" - -#define BUFLEN 2000 - -int sound_internal = 0, sound_beebsid = 0, sound_dac = 0, sound_ddnoise = 0, sound_tape = 0; -int sound_filter = 0; - -static int sound_pos = 0; -static short sound_buffer[BUFLEN]; - -#define NCoef 4 -static float iir(float NewSample) { - float ACoef[NCoef+1] = { - 0.30631912757971225000, - 0.00000000000000000000, - -0.61263825515942449000, - 0.00000000000000000000, - 0.30631912757971225000 - }; - - float BCoef[NCoef+1] = { - 1.00000000000000000000, - -1.86772356053227330000, - 1.08459167506874430000, - -0.37711292573951394000, - 0.17253125052500490000 - }; - - static float y[NCoef+1]; //output samples - static float x[NCoef+1]; //input samples - int n; - - //shift the old samples - for(n=NCoef; n>0; n--) { - x[n] = x[n-1]; - y[n] = y[n-1]; - } - - //Calculate the new output - x[0] = NewSample; - y[0] = ACoef[0] * x[0]; - for(n=1; n<=NCoef; n++) - y[0] += ACoef[n] * x[n] - BCoef[n] * y[n]; - - return y[0]; -} - -void sound_poll() -{ - int c; - - if (!(sound_internal || sound_beebsid || sound_dac)) return; - - if (sound_beebsid) sid_fillbuf(sound_buffer + (sound_pos << 1), 2); - if (sound_internal) sn_fillbuf( sound_buffer + (sound_pos << 1), 2); - if (sound_dac) - { - sound_buffer[(sound_pos << 1)] += (((int)lpt_dac - 0x80) * 32); - sound_buffer[(sound_pos << 1)+1] += (((int)lpt_dac - 0x80) * 32); - } - - sound_pos++; - if (sound_pos == (BUFLEN >> 1)) - { - if (BUFLEN & 1) - { - if (sound_beebsid) sid_fillbuf(sound_buffer+ (sound_pos << 1), 1); - if (sound_internal) sn_fillbuf( sound_buffer+ (sound_pos << 1), 1); - if (sound_dac) sound_buffer[(sound_pos << 1)] += (((int)lpt_dac - 0x80) * 32); - } - - if (sound_filter) - { - for (c = 0; c < BUFLEN; c++) - sound_buffer[c] = (int)iir((float)sound_buffer[c]); - } - - sound_pos = 0; - al_givebuffer(sound_buffer); - - memset(sound_buffer, 0, sizeof(sound_buffer)); - } -} - -void sound_init() -{ -} - +/*B-em v2.2 by Tom Walker + Internal SN sound chip emulation*/ + +#include +#include +#include "b-em.h" +#include "sid_b-em.h" +#include "sn76489.h" +#include "sound.h" +#include "via.h" +#include "uservia.h" +#include "soundopenal.h" + +#define BUFLEN 2000 + +int sound_internal = 0, sound_beebsid = 0, sound_dac = 0, sound_ddnoise = 0, sound_tape = 0; +int sound_filter = 0; + +static int sound_pos = 0; +static short sound_buffer[BUFLEN]; + +#define NCoef 4 +static float iir(float NewSample) { + float ACoef[NCoef+1] = { + 0.30631912757971225000, + 0.00000000000000000000, + -0.61263825515942449000, + 0.00000000000000000000, + 0.30631912757971225000 + }; + + float BCoef[NCoef+1] = { + 1.00000000000000000000, + -1.86772356053227330000, + 1.08459167506874430000, + -0.37711292573951394000, + 0.17253125052500490000 + }; + + static float y[NCoef+1]; //output samples + static float x[NCoef+1]; //input samples + int n; + + //shift the old samples + for(n=NCoef; n>0; n--) { + x[n] = x[n-1]; + y[n] = y[n-1]; + } + + //Calculate the new output + x[0] = NewSample; + y[0] = ACoef[0] * x[0]; + for(n=1; n<=NCoef; n++) + y[0] += ACoef[n] * x[n] - BCoef[n] * y[n]; + + return y[0]; +} + +void sound_poll() +{ + int c; + + if (!(sound_internal || sound_beebsid || sound_dac)) return; + + if (sound_beebsid) sid_fillbuf(sound_buffer + (sound_pos << 1), 2); + if (sound_internal) sn_fillbuf( sound_buffer + (sound_pos << 1), 2); + if (sound_dac) + { + sound_buffer[(sound_pos << 1)] += (((int)lpt_dac - 0x80) * 32); + sound_buffer[(sound_pos << 1)+1] += (((int)lpt_dac - 0x80) * 32); + } + + sound_pos++; + if (sound_pos == (BUFLEN >> 1)) + { + if (BUFLEN & 1) + { + if (sound_beebsid) sid_fillbuf(sound_buffer+ (sound_pos << 1), 1); + if (sound_internal) sn_fillbuf( sound_buffer+ (sound_pos << 1), 1); + if (sound_dac) sound_buffer[(sound_pos << 1)] += (((int)lpt_dac - 0x80) * 32); + } + + if (sound_filter) + { + for (c = 0; c < BUFLEN; c++) + sound_buffer[c] = (int)iir((float)sound_buffer[c]); + } + + sound_pos = 0; + al_givebuffer(sound_buffer); + + memset(sound_buffer, 0, sizeof(sound_buffer)); + } +} + +void sound_init() +{ +} + diff --git a/src/sound.h b/src/sound.h index 4db20592..e0a45df9 100644 --- a/src/sound.h +++ b/src/sound.h @@ -1,5 +1,5 @@ -extern int sound_internal, sound_beebsid, sound_dac, sound_ddnoise, sound_tape; -extern int sound_filter; - -void sound_init(); -void sound_poll(); +extern int sound_internal, sound_beebsid, sound_dac, sound_ddnoise, sound_tape; +extern int sound_filter; + +void sound_init(); +void sound_poll(); diff --git a/src/soundopenal.c b/src/soundopenal.c index 6d7774f7..0a8bf367 100644 --- a/src/soundopenal.c +++ b/src/soundopenal.c @@ -1,184 +1,184 @@ -/*B-em v2.2 by Tom Walker - OpenAL interface*/ - -#include -#include -#include -#include "b-em.h" -#include "sound.h" -#include "soundopenal.h" - -static ALuint buffers[4]; // front and back buffers -static ALuint source[2]; // audio source -static ALuint buffersdd[4]; // front and back buffers -static ALenum format; // internal format - -#define FREQ 31250 -//#define BUFLEN (3125<<2) -#define BUFLEN (2000<<2) - -static void check() -{ - ALenum error; - if ((error = alGetError()) != AL_NO_ERROR) - { - //printf("AL Error : %08X\n", error); - //printf("Description : %s\n",alGetErrorString(error)); - } -/* if ((error = alutGetError()) != ALUT_ERROR_NO_ERROR) - { - printf("ALut Error : %08X\n", error); - printf("Description : %s\n",alutGetErrorString(error)); - }*/ -} - -void al_init_main(int argc, char *argv[]) -{ - alutInit(0, NULL);//&argc, argv); - check(); -// atexit(closeal); -// printf("AlutInit\n"); -} - -void al_close() -{ - alutExit(); -} - -static int16_t tempbuf[BUFLEN>>1]; -static int16_t tempbufdd[4410*2]; - -void al_init() -{ - int c; - format = AL_FORMAT_STEREO16; - check(); - - alGenBuffers(4, buffers); - check(); - - alGenSources(2, source); - check(); - - alSource3f(source[0], AL_POSITION, 0.0, 0.0, 0.0); - alSource3f(source[0], AL_VELOCITY, 0.0, 0.0, 0.0); - alSource3f(source[0], AL_DIRECTION, 0.0, 0.0, 0.0); - alSourcef (source[0], AL_ROLLOFF_FACTOR, 0.0 ); - alSourcei (source[0], AL_SOURCE_RELATIVE, AL_TRUE ); - check(); - - memset(tempbuf, 0, BUFLEN); - - for (c = 0; c < 4; c++) - alBufferData(buffers[c], AL_FORMAT_STEREO16, tempbuf, BUFLEN, 31250); - alSourceQueueBuffers(source[0], 4, buffers); - check(); - alSourcePlay(source[0]); - check(); -// printf("InitAL\n"); - - alGenBuffers(4, buffersdd); - check(); - - alSource3f(source[1], AL_POSITION, 0.0, 0.0, 0.0); - alSource3f(source[1], AL_VELOCITY, 0.0, 0.0, 0.0); - alSource3f(source[1], AL_DIRECTION, 0.0, 0.0, 0.0); - alSourcef (source[1], AL_ROLLOFF_FACTOR, 0.0 ); - alSourcei (source[1], AL_SOURCE_RELATIVE, AL_TRUE ); - check(); - - memset(tempbufdd, 0, 4410 * 4); - - for (c = 0; c < 4; c++) - alBufferData(buffersdd[c], AL_FORMAT_STEREO16, tempbufdd, 4410*4, 44100); - alSourceQueueBuffers(source[1], 4, buffersdd); - check(); - alSourcePlay(source[1]); - check(); -// printf("InitAL\n"); -} - -static int16_t zbuf[16384]; - -void al_givebuffer(int16_t *buf) -{ - int processed; - int state; - int c; - -//return; - alGetSourcei(source[0], AL_SOURCE_STATE, &state); - - if (state == 0x1014) - { - alSourcePlay(source[0]); -// printf("Resetting sound\n"); - } -// printf("State - %i %08X\n",state,state); - alGetSourcei(source[0], AL_BUFFERS_PROCESSED, &processed); - -// printf("P "); - check(); -// printf("Processed - %i\n",processed); - - if (processed>=1) - { - ALuint buffer; - - alSourceUnqueueBuffers(source[0], 1, &buffer); -// printf("U "); - check(); - - for (c = 0; c < (BUFLEN >> 1); c++) zbuf[c] = buf[c >> 1]; - - alBufferData(buffer, AL_FORMAT_STEREO16, zbuf, BUFLEN, 31250); -// printf("B "); - check(); - - alSourceQueueBuffers(source[0], 1, &buffer); -// printf("Q "); - check(); - - } -} - -void al_givebufferdd(int16_t *buf) -{ - int processed; - int state; - int c; - - if (!sound_ddnoise && !sound_tape) return; - - alGetSourcei(source[1], AL_SOURCE_STATE, &state); - - if (state == 0x1014) - { - alSourcePlay(source[1]); -// printf("Resetting sounddd\n"); - } - alGetSourcei(source[1], AL_BUFFERS_PROCESSED, &processed); -//rpclog("Get source\n"); - check(); -//rpclog("Got source\n"); - if (processed>=1) - { - ALuint buffer; - -//rpclog("Unqueue\n"); - alSourceUnqueueBuffers(source[1], 1, &buffer); - check(); - - for (c = 0; c < (4410 * 2); c++) zbuf[c] = buf[c >> 1];//^0x8000; - -//rpclog("BufferData\n"); - alBufferData(buffer, AL_FORMAT_STEREO16, zbuf, 4410*4, 44100); - check(); - -//rpclog("Queue\n"); - alSourceQueueBuffers(source[1], 1, &buffer); - check(); - } - -// rpclog("DDnoise3\n"); -} +/*B-em v2.2 by Tom Walker + OpenAL interface*/ + +#include +#include +#include +#include "b-em.h" +#include "sound.h" +#include "soundopenal.h" + +static ALuint buffers[4]; // front and back buffers +static ALuint source[2]; // audio source +static ALuint buffersdd[4]; // front and back buffers +static ALenum format; // internal format + +#define FREQ 31250 +//#define BUFLEN (3125<<2) +#define BUFLEN (2000<<2) + +static void check() +{ + ALenum error; + if ((error = alGetError()) != AL_NO_ERROR) + { + //printf("AL Error : %08X\n", error); + //printf("Description : %s\n",alGetErrorString(error)); + } +/* if ((error = alutGetError()) != ALUT_ERROR_NO_ERROR) + { + printf("ALut Error : %08X\n", error); + printf("Description : %s\n",alutGetErrorString(error)); + }*/ +} + +void al_init_main(int argc, char *argv[]) +{ + alutInit(0, NULL);//&argc, argv); + check(); +// atexit(closeal); +// printf("AlutInit\n"); +} + +void al_close() +{ + alutExit(); +} + +static int16_t tempbuf[BUFLEN>>1]; +static int16_t tempbufdd[4410*2]; + +void al_init() +{ + int c; + format = AL_FORMAT_STEREO16; + check(); + + alGenBuffers(4, buffers); + check(); + + alGenSources(2, source); + check(); + + alSource3f(source[0], AL_POSITION, 0.0, 0.0, 0.0); + alSource3f(source[0], AL_VELOCITY, 0.0, 0.0, 0.0); + alSource3f(source[0], AL_DIRECTION, 0.0, 0.0, 0.0); + alSourcef (source[0], AL_ROLLOFF_FACTOR, 0.0 ); + alSourcei (source[0], AL_SOURCE_RELATIVE, AL_TRUE ); + check(); + + memset(tempbuf, 0, BUFLEN); + + for (c = 0; c < 4; c++) + alBufferData(buffers[c], AL_FORMAT_STEREO16, tempbuf, BUFLEN, 31250); + alSourceQueueBuffers(source[0], 4, buffers); + check(); + alSourcePlay(source[0]); + check(); +// printf("InitAL\n"); + + alGenBuffers(4, buffersdd); + check(); + + alSource3f(source[1], AL_POSITION, 0.0, 0.0, 0.0); + alSource3f(source[1], AL_VELOCITY, 0.0, 0.0, 0.0); + alSource3f(source[1], AL_DIRECTION, 0.0, 0.0, 0.0); + alSourcef (source[1], AL_ROLLOFF_FACTOR, 0.0 ); + alSourcei (source[1], AL_SOURCE_RELATIVE, AL_TRUE ); + check(); + + memset(tempbufdd, 0, 4410 * 4); + + for (c = 0; c < 4; c++) + alBufferData(buffersdd[c], AL_FORMAT_STEREO16, tempbufdd, 4410*4, 44100); + alSourceQueueBuffers(source[1], 4, buffersdd); + check(); + alSourcePlay(source[1]); + check(); +// printf("InitAL\n"); +} + +static int16_t zbuf[16384]; + +void al_givebuffer(int16_t *buf) +{ + int processed; + int state; + int c; + +//return; + alGetSourcei(source[0], AL_SOURCE_STATE, &state); + + if (state == 0x1014) + { + alSourcePlay(source[0]); +// printf("Resetting sound\n"); + } +// printf("State - %i %08X\n",state,state); + alGetSourcei(source[0], AL_BUFFERS_PROCESSED, &processed); + +// printf("P "); + check(); +// printf("Processed - %i\n",processed); + + if (processed>=1) + { + ALuint buffer; + + alSourceUnqueueBuffers(source[0], 1, &buffer); +// printf("U "); + check(); + + for (c = 0; c < (BUFLEN >> 1); c++) zbuf[c] = buf[c >> 1]; + + alBufferData(buffer, AL_FORMAT_STEREO16, zbuf, BUFLEN, 31250); +// printf("B "); + check(); + + alSourceQueueBuffers(source[0], 1, &buffer); +// printf("Q "); + check(); + + } +} + +void al_givebufferdd(int16_t *buf) +{ + int processed; + int state; + int c; + + if (!sound_ddnoise && !sound_tape) return; + + alGetSourcei(source[1], AL_SOURCE_STATE, &state); + + if (state == 0x1014) + { + alSourcePlay(source[1]); +// printf("Resetting sounddd\n"); + } + alGetSourcei(source[1], AL_BUFFERS_PROCESSED, &processed); +//rpclog("Get source\n"); + check(); +//rpclog("Got source\n"); + if (processed>=1) + { + ALuint buffer; + +//rpclog("Unqueue\n"); + alSourceUnqueueBuffers(source[1], 1, &buffer); + check(); + + for (c = 0; c < (4410 * 2); c++) zbuf[c] = buf[c >> 1];//^0x8000; + +//rpclog("BufferData\n"); + alBufferData(buffer, AL_FORMAT_STEREO16, zbuf, 4410*4, 44100); + check(); + +//rpclog("Queue\n"); + alSourceQueueBuffers(source[1], 1, &buffer); + check(); + } + +// rpclog("DDnoise3\n"); +} diff --git a/src/soundopenal.h b/src/soundopenal.h index 23845ef9..eac772d6 100644 --- a/src/soundopenal.h +++ b/src/soundopenal.h @@ -1,5 +1,5 @@ -void al_init_main(int argc, char *argv[]); -void al_init(); -void al_close(); -void al_givebuffer(int16_t *buf); -void al_givebufferdd(int16_t *buf); +void al_init_main(int argc, char *argv[]); +void al_init(); +void al_close(); +void al_givebuffer(int16_t *buf); +void al_givebufferdd(int16_t *buf); diff --git a/src/ssd.c b/src/ssd.c index b3059a39..3ae28f1d 100644 --- a/src/ssd.c +++ b/src/ssd.c @@ -1,269 +1,269 @@ -/*B-em v2.2 by Tom Walker - SSD/DSD disc handling*/ -#include -#include "b-em.h" -#include "ssd.h" -#include "disc.h" - -static FILE *ssd_f[2]; -static uint8_t trackinfo[2][2][10*256]; -static int dsd[2],ssd_trackc[2]; -int writeprot[2],fwriteprot[2]; - -static int ssd_sector, ssd_track, ssd_side, ssd_drive; -static int ssd_inread, ssd_inwrite, ssd_readpos, ssd_inreadaddr; -static int ssd_time; -static int ssd_notfound; -static int ssd_rsector = 0; -static int ssd_informat = 0; - -void ssd_init() -{ - ssd_f[0] = ssd_f[1] = 0; - dsd[0] = dsd[1] = 0; - ssd_notfound = 0; -} - -void ssd_load(int drive, char *fn) -{ - writeprot[drive] = 0; - ssd_f[drive] = fopen(fn, "rb+"); - if (!ssd_f[drive]) - { - ssd_f[drive] = fopen(fn, "rb"); - if (!ssd_f[drive]) return; - writeprot[drive] = 1; - } - fwriteprot[drive] = writeprot[drive]; - dsd[drive] = 0; - drives[drive].seek = ssd_seek; - drives[drive].readsector = ssd_readsector; - drives[drive].writesector = ssd_writesector; - drives[drive].readaddress = ssd_readaddress; - drives[drive].poll = ssd_poll; - drives[drive].format = ssd_format; -} - -void dsd_load(int drive, char *fn) -{ - writeprot[drive] = 0; - ssd_f[drive] = fopen(fn, "rb+"); - if (!ssd_f[drive]) - { - ssd_f[drive] = fopen(fn, "rb"); - if (!ssd_f[drive]) return; - writeprot[drive] = 1; - } - fwriteprot[drive] = writeprot[drive]; - dsd[drive] = 1; - drives[drive].seek = ssd_seek; - drives[drive].readsector = ssd_readsector; - drives[drive].writesector = ssd_writesector; - drives[drive].readaddress = ssd_readaddress; - drives[drive].poll = ssd_poll; - drives[drive].format = ssd_format; -} - -void ssd_close(int drive) -{ - if (ssd_f[drive]) fclose(ssd_f[drive]); - ssd_f[drive] = NULL; -} - -void ssd_seek(int drive, int track) -{ - if (!ssd_f[drive]) return; -// printf("Seek :%i to %i\n",drive,track); - ssd_trackc[drive] = track; - if (dsd[drive]) - { - fseek(ssd_f[drive], track * 20 * 256, SEEK_SET); - fread(trackinfo[drive][0],10 * 256, 1, ssd_f[drive]); - fread(trackinfo[drive][1],10 * 256, 1, ssd_f[drive]); - } - else - { - fseek(ssd_f[drive], track * 10 * 256, SEEK_SET); - fread(trackinfo[drive][0], 10 * 256, 1, ssd_f[drive]); - } -} - -void ssd_writeback(int drive, int track) -{ - if (!ssd_f[drive]) return; - if (dsd[drive]) - { - fseek(ssd_f[drive], track * 20 * 256, SEEK_SET); - fwrite(trackinfo[drive][0], 10 * 256, 1, ssd_f[drive]); - fwrite(trackinfo[drive][1], 10 * 256, 1, ssd_f[drive]); - } - else - { - fseek(ssd_f[drive], track * 10 * 256, SEEK_SET); - fwrite(trackinfo[drive][0], 10 * 256, 1, ssd_f[drive]); - } -} - -void ssd_readsector(int drive, int sector, int track, int side, int density) -{ - ssd_sector = sector; - ssd_track = track; - ssd_side = side; - ssd_drive = drive; -// printf("Read sector %i %i %i %i\n",drive,side,track,sector); - - if (!ssd_f[drive] || (side && !dsd[drive]) || density || track != ssd_trackc[drive]) - { - ssd_notfound = 500; -/// printf("Not found!\n"); - return; - } - ssd_inread = 1; - ssd_readpos = 0; -// printf("GO\n"); -} - -void ssd_writesector(int drive, int sector, int track, int side, int density) -{ - ssd_sector = sector; - ssd_track = track; - ssd_side = side; - ssd_drive = drive; -// printf("Write sector %i %i %i %i\n",drive,side,track,sector); - - if (!ssd_f[drive] || (side && !dsd[drive]) || density || track != ssd_trackc[drive]) - { - ssd_notfound=500; - return; - } - ssd_inwrite = 1; - ssd_readpos = 0; - ssd_time = -1000; -} - -void ssd_readaddress(int drive, int track, int side, int density) -{ - ssd_track = track; - ssd_side = side; - ssd_drive = drive; -// printf("Read address %i %i %i %i\n",drive,track,side,density); - - if (!ssd_f[drive] || (side && !dsd[drive]) || density || track != ssd_trackc[drive]) - { - ssd_notfound = 500; - return; - } - ssd_rsector = 0; - ssd_readpos = 0; - ssd_inreadaddr = 1; -} - -void ssd_format(int drive, int track, int side, int density) -{ - ssd_track = track; - ssd_side = side; - ssd_drive = drive; - - if (!ssd_f[drive] || (side && !dsd[drive]) || density || track != ssd_trackc[drive]) - { - ssd_notfound = 500; - return; - } - ssd_sector = 0; - ssd_readpos = 0; - ssd_informat = 1; -} - -void ssd_poll() -{ - int c; -// printf("POLL %i\n",ssdtime); - ssd_time++; - if (ssd_time < 16) return; - ssd_time = 0; - - if (ssd_notfound) - { - ssd_notfound--; - if (!ssd_notfound) - { - fdc_notfound(); - } - } - if (ssd_inread && ssd_f[ssd_drive]) - { -// printf("Read %i\n",ssdreadpos); - fdc_data(trackinfo[ssd_drive][ssd_side][(ssd_sector << 8) + ssd_readpos]); - ssd_readpos++; - if (ssd_readpos == 256) - { - ssd_inread = 0; - fdc_finishread(); - } - } - if (ssd_inwrite && ssd_f[ssd_drive]) - { - if (writeprot[ssd_drive]) - { - fdc_writeprotect(); - ssd_inwrite = 0; - return; - } -// printf("Write data %i\n",ssdreadpos); - c = fdc_getdata(ssd_readpos == 255); - if (c == -1) - { -// printf("Data overflow!\n"); -// exit(-1); - } - trackinfo[ssd_drive][ssd_side][(ssd_sector << 8) + ssd_readpos] = c; - ssd_readpos++; - if (ssd_readpos == 256) - { - ssd_inwrite = 0; - fdc_finishread(); - ssd_writeback(ssd_drive, ssd_track); - } - } - if (ssd_inreadaddr && ssd_f[ssd_drive]) - { - switch (ssd_readpos) - { - case 0: fdc_data(ssd_track); break; - case 1: fdc_data(ssd_side); break; - case 2: fdc_data(ssd_rsector); break; - case 3: fdc_data(1); break; - case 4: fdc_data(0); break; - case 5: fdc_data(0); break; - case 6: - ssd_inreadaddr = 0; - fdc_finishread(); - ssd_rsector++; - if (ssd_rsector == 10) ssd_rsector=0; - break; - } - ssd_readpos++; - } - if (ssd_informat && ssd_f[ssd_drive]) - { - if (writeprot[ssd_drive]) - { - fdc_writeprotect(); - ssd_informat = 0; - return; - } - trackinfo[ssd_drive][ssd_side][(ssd_sector << 8) + ssd_readpos] = 0; - ssd_readpos++; - if (ssd_readpos == 256) - { - ssd_readpos = 0; - ssd_sector++; - if (ssd_sector == 10) - { - ssd_informat = 0; - fdc_finishread(); - ssd_writeback(ssd_drive, ssd_track); - } - } - } -} +/*B-em v2.2 by Tom Walker + SSD/DSD disc handling*/ +#include +#include "b-em.h" +#include "ssd.h" +#include "disc.h" + +static FILE *ssd_f[2]; +static uint8_t trackinfo[2][2][10*256]; +static int dsd[2],ssd_trackc[2]; +int writeprot[2],fwriteprot[2]; + +static int ssd_sector, ssd_track, ssd_side, ssd_drive; +static int ssd_inread, ssd_inwrite, ssd_readpos, ssd_inreadaddr; +static int ssd_time; +static int ssd_notfound; +static int ssd_rsector = 0; +static int ssd_informat = 0; + +void ssd_init() +{ + ssd_f[0] = ssd_f[1] = 0; + dsd[0] = dsd[1] = 0; + ssd_notfound = 0; +} + +void ssd_load(int drive, char *fn) +{ + writeprot[drive] = 0; + ssd_f[drive] = fopen(fn, "rb+"); + if (!ssd_f[drive]) + { + ssd_f[drive] = fopen(fn, "rb"); + if (!ssd_f[drive]) return; + writeprot[drive] = 1; + } + fwriteprot[drive] = writeprot[drive]; + dsd[drive] = 0; + drives[drive].seek = ssd_seek; + drives[drive].readsector = ssd_readsector; + drives[drive].writesector = ssd_writesector; + drives[drive].readaddress = ssd_readaddress; + drives[drive].poll = ssd_poll; + drives[drive].format = ssd_format; +} + +void dsd_load(int drive, char *fn) +{ + writeprot[drive] = 0; + ssd_f[drive] = fopen(fn, "rb+"); + if (!ssd_f[drive]) + { + ssd_f[drive] = fopen(fn, "rb"); + if (!ssd_f[drive]) return; + writeprot[drive] = 1; + } + fwriteprot[drive] = writeprot[drive]; + dsd[drive] = 1; + drives[drive].seek = ssd_seek; + drives[drive].readsector = ssd_readsector; + drives[drive].writesector = ssd_writesector; + drives[drive].readaddress = ssd_readaddress; + drives[drive].poll = ssd_poll; + drives[drive].format = ssd_format; +} + +void ssd_close(int drive) +{ + if (ssd_f[drive]) fclose(ssd_f[drive]); + ssd_f[drive] = NULL; +} + +void ssd_seek(int drive, int track) +{ + if (!ssd_f[drive]) return; +// printf("Seek :%i to %i\n",drive,track); + ssd_trackc[drive] = track; + if (dsd[drive]) + { + fseek(ssd_f[drive], track * 20 * 256, SEEK_SET); + fread(trackinfo[drive][0],10 * 256, 1, ssd_f[drive]); + fread(trackinfo[drive][1],10 * 256, 1, ssd_f[drive]); + } + else + { + fseek(ssd_f[drive], track * 10 * 256, SEEK_SET); + fread(trackinfo[drive][0], 10 * 256, 1, ssd_f[drive]); + } +} + +void ssd_writeback(int drive, int track) +{ + if (!ssd_f[drive]) return; + if (dsd[drive]) + { + fseek(ssd_f[drive], track * 20 * 256, SEEK_SET); + fwrite(trackinfo[drive][0], 10 * 256, 1, ssd_f[drive]); + fwrite(trackinfo[drive][1], 10 * 256, 1, ssd_f[drive]); + } + else + { + fseek(ssd_f[drive], track * 10 * 256, SEEK_SET); + fwrite(trackinfo[drive][0], 10 * 256, 1, ssd_f[drive]); + } +} + +void ssd_readsector(int drive, int sector, int track, int side, int density) +{ + ssd_sector = sector; + ssd_track = track; + ssd_side = side; + ssd_drive = drive; +// printf("Read sector %i %i %i %i\n",drive,side,track,sector); + + if (!ssd_f[drive] || (side && !dsd[drive]) || density || track != ssd_trackc[drive]) + { + ssd_notfound = 500; +/// printf("Not found!\n"); + return; + } + ssd_inread = 1; + ssd_readpos = 0; +// printf("GO\n"); +} + +void ssd_writesector(int drive, int sector, int track, int side, int density) +{ + ssd_sector = sector; + ssd_track = track; + ssd_side = side; + ssd_drive = drive; +// printf("Write sector %i %i %i %i\n",drive,side,track,sector); + + if (!ssd_f[drive] || (side && !dsd[drive]) || density || track != ssd_trackc[drive]) + { + ssd_notfound=500; + return; + } + ssd_inwrite = 1; + ssd_readpos = 0; + ssd_time = -1000; +} + +void ssd_readaddress(int drive, int track, int side, int density) +{ + ssd_track = track; + ssd_side = side; + ssd_drive = drive; +// printf("Read address %i %i %i %i\n",drive,track,side,density); + + if (!ssd_f[drive] || (side && !dsd[drive]) || density || track != ssd_trackc[drive]) + { + ssd_notfound = 500; + return; + } + ssd_rsector = 0; + ssd_readpos = 0; + ssd_inreadaddr = 1; +} + +void ssd_format(int drive, int track, int side, int density) +{ + ssd_track = track; + ssd_side = side; + ssd_drive = drive; + + if (!ssd_f[drive] || (side && !dsd[drive]) || density || track != ssd_trackc[drive]) + { + ssd_notfound = 500; + return; + } + ssd_sector = 0; + ssd_readpos = 0; + ssd_informat = 1; +} + +void ssd_poll() +{ + int c; +// printf("POLL %i\n",ssdtime); + ssd_time++; + if (ssd_time < 16) return; + ssd_time = 0; + + if (ssd_notfound) + { + ssd_notfound--; + if (!ssd_notfound) + { + fdc_notfound(); + } + } + if (ssd_inread && ssd_f[ssd_drive]) + { +// printf("Read %i\n",ssdreadpos); + fdc_data(trackinfo[ssd_drive][ssd_side][(ssd_sector << 8) + ssd_readpos]); + ssd_readpos++; + if (ssd_readpos == 256) + { + ssd_inread = 0; + fdc_finishread(); + } + } + if (ssd_inwrite && ssd_f[ssd_drive]) + { + if (writeprot[ssd_drive]) + { + fdc_writeprotect(); + ssd_inwrite = 0; + return; + } +// printf("Write data %i\n",ssdreadpos); + c = fdc_getdata(ssd_readpos == 255); + if (c == -1) + { +// printf("Data overflow!\n"); +// exit(-1); + } + trackinfo[ssd_drive][ssd_side][(ssd_sector << 8) + ssd_readpos] = c; + ssd_readpos++; + if (ssd_readpos == 256) + { + ssd_inwrite = 0; + fdc_finishread(); + ssd_writeback(ssd_drive, ssd_track); + } + } + if (ssd_inreadaddr && ssd_f[ssd_drive]) + { + switch (ssd_readpos) + { + case 0: fdc_data(ssd_track); break; + case 1: fdc_data(ssd_side); break; + case 2: fdc_data(ssd_rsector); break; + case 3: fdc_data(1); break; + case 4: fdc_data(0); break; + case 5: fdc_data(0); break; + case 6: + ssd_inreadaddr = 0; + fdc_finishread(); + ssd_rsector++; + if (ssd_rsector == 10) ssd_rsector=0; + break; + } + ssd_readpos++; + } + if (ssd_informat && ssd_f[ssd_drive]) + { + if (writeprot[ssd_drive]) + { + fdc_writeprotect(); + ssd_informat = 0; + return; + } + trackinfo[ssd_drive][ssd_side][(ssd_sector << 8) + ssd_readpos] = 0; + ssd_readpos++; + if (ssd_readpos == 256) + { + ssd_readpos = 0; + ssd_sector++; + if (ssd_sector == 10) + { + ssd_informat = 0; + fdc_finishread(); + ssd_writeback(ssd_drive, ssd_track); + } + } + } +} diff --git a/src/ssd.h b/src/ssd.h index fe69b67c..58de2a34 100644 --- a/src/ssd.h +++ b/src/ssd.h @@ -1,10 +1,10 @@ -void ssd_init(); -void ssd_load(int drive, char *fn); -void ssd_close(int drive); -void dsd_load(int drive, char *fn); -void ssd_seek(int drive, int track); -void ssd_readsector(int drive, int sector, int track, int side, int density); -void ssd_writesector(int drive, int sector, int track, int side, int density); -void ssd_readaddress(int drive, int sector, int side, int density); -void ssd_format(int drive, int sector, int side, int density); -void ssd_poll(); +void ssd_init(); +void ssd_load(int drive, char *fn); +void ssd_close(int drive); +void dsd_load(int drive, char *fn); +void ssd_seek(int drive, int track); +void ssd_readsector(int drive, int sector, int track, int side, int density); +void ssd_writesector(int drive, int sector, int track, int side, int density); +void ssd_readaddress(int drive, int sector, int side, int density); +void ssd_format(int drive, int sector, int side, int density); +void ssd_poll(); diff --git a/src/sysvia.c b/src/sysvia.c index 2f1e4425..a29d8f6c 100644 --- a/src/sysvia.c +++ b/src/sysvia.c @@ -1,207 +1,207 @@ -/*B-em v2.2 by Tom Walker - System VIA + keyboard emulation*/ - -#include -#include -#include "b-em.h" -#include "model.h" -#include "cmos.h" -#include "compactcmos.h" -#include "keyboard.h" -#include "via.h" -#include "sysvia.h" -#include "sn76489.h" -#include "video.h" - -VIA sysvia; - - - -void sysvia_set_ca1(int level) -{ - via_set_ca1(&sysvia,level); -} -void sysvia_set_ca2(int level) -{ - if (OS01) level = !level; /*OS 0.1 programs CA2 to interrupt on negative edge and expects the keyboard to still work*/ - via_set_ca2(&sysvia,level); -} -void sysvia_set_cb1(int level) -{ - via_set_cb1(&sysvia,level); -} -void sysvia_set_cb2(int level) -{ - via_set_cb2(&sysvia,level); -} - -void sysvia_via_set_cb2(int level) -{ - if (level && !sysvia.cb2) /*Low -> high*/ - crtc_latchpen(); -} - -/*Slow data bus - - Port A is the slow data bus, and is connected to - - Keyboard - SN76489 - Speech chip (B/B+ only, not emulated) - CMOS RAM (Master 128 only) - - Port B bits 0-3 control the bus, and are connected on a model B to IC32, a - 74LS249 latch. This also controls screen size (for hardware scrolling) and the - caps and scroll lock LEDs. - - This code emulates bus contention, which is entirely possible if developing - software under emulation and inadvertently enabling multiple bus masters*/ - - -/*Current state of IC32 output*/ -uint8_t IC32=0; -/*Current effective state of the slow data bus*/ -uint8_t sdbval; -/*What the System VIA is actually outputting to the slow data bus - For use when contending with whatever else is outputting to the bus*/ -static uint8_t sysvia_sdb_out; - -int scrsize; - -/*Calculate current state of slow data bus - B-em emulates three bus masters - the System VIA itself, the keyboard (bit 7 - only) and the CMOS RAM (Master 128 only)*/ -static void sysvia_update_sdb() -{ - sdbval = sysvia_sdb_out; - if (MASTER && !compactcmos) sdbval &= cmos_read(); - - keyrow = (sdbval >> 4) & 7; - keycol = sdbval & 0xF; - key_update(); - if (!(IC32 & 8) && !bbckey[keycol][keyrow]) sdbval &= 0x7f; -} - -static void sysvia_write_IC32(uint8_t val) -{ - uint8_t oldIC32 = IC32; - int temp = 0; - - if (val & 8) - IC32 |= (1 << (val & 7)); - else - IC32 &= ~(1 << (val & 7)); - - sysvia_update_sdb(); - - if (!(IC32 & 1) && (oldIC32 & 1)) - sn_write(sdbval); - - scrsize = ((IC32 & 0x10) ? 2 : 0) | ((IC32 & 0x20) ? 1 : 0); - - if ((IC32 & 0xC0) != (oldIC32 & 0xC0)) - { - if (!(IC32 & 0x40)) temp |= KB_CAPSLOCK_FLAG; - if (!(IC32 & 0x80)) temp |= KB_SCROLOCK_FLAG; - } - if (MASTER && !compactcmos) cmos_update(IC32, sdbval); -} - -void sysvia_write_portA(uint8_t val) -{ - sysvia_sdb_out = val; - - sysvia_update_sdb(); - - if (MASTER && !compactcmos) cmos_update(IC32, sdbval); -} - -void sysvia_write_portB(uint8_t val) -{ - sysvia_write_IC32(val); - /*Master 128 reuses the speech processor inputs*/ - if (MASTER && !compactcmos) - cmos_writeaddr(val); - /*Master Compact reuses the joystick fire inputs*/ - if (compactcmos) - compactcmos_i2cchange(val & 0x20, val & 0x10); -} - -uint8_t sysvia_read_portA() -{ - sysvia_update_sdb(); - - return sdbval; -} - -uint8_t sysvia_read_portB() -{ - uint8_t temp = 0xFF; - if (compactcmos) - { - temp &= ~0x30; - if (i2c_clock) temp |= 0x20; - if (i2c_data) temp |= 0x10; - } - else - { - temp |= 0xF0; - if (joybutton[0]) temp &= ~0x10; - if (joybutton[1]) temp &= ~0x20; - } - return temp; -} - -int autoboot; - - -void sysvia_write(uint16_t addr, uint8_t val) -{ -// rpclog("SYSVIA write %04X %02X\n",addr,val); - via_write(&sysvia, addr, val); -} - -uint8_t sysvia_read(uint16_t addr) -{ - uint8_t temp = via_read(&sysvia, addr); -// rpclog("SYSVIA read %04X %02X\n",addr,temp); - return temp; -} - -void sysvia_updatetimers() -{ - via_updatetimers(&sysvia); -} -void sysvia_reset() -{ - via_reset(&sysvia); - - sysvia.read_portA = sysvia_read_portA; - sysvia.read_portB = sysvia_read_portB; - - sysvia.write_portA = sysvia_write_portA; - sysvia.write_portB = sysvia_write_portB; - - sysvia.set_cb2 = sysvia_via_set_cb2; /*Lightpen*/ - - sysvia.intnum = 1; - - if (autoboot) - key_press(0,0); -} - - -void sysvia_savestate(FILE *f) -{ - via_savestate(&sysvia, f); - - putc(IC32,f); -} - -void sysvia_loadstate(FILE *f) -{ - via_loadstate(&sysvia, f); - - IC32=getc(f); - scrsize=((IC32&16)?2:0)|((IC32&32)?1:0); -} +/*B-em v2.2 by Tom Walker + System VIA + keyboard emulation*/ + +#include +#include +#include "b-em.h" +#include "model.h" +#include "cmos.h" +#include "compactcmos.h" +#include "keyboard.h" +#include "via.h" +#include "sysvia.h" +#include "sn76489.h" +#include "video.h" + +VIA sysvia; + + + +void sysvia_set_ca1(int level) +{ + via_set_ca1(&sysvia,level); +} +void sysvia_set_ca2(int level) +{ + if (OS01) level = !level; /*OS 0.1 programs CA2 to interrupt on negative edge and expects the keyboard to still work*/ + via_set_ca2(&sysvia,level); +} +void sysvia_set_cb1(int level) +{ + via_set_cb1(&sysvia,level); +} +void sysvia_set_cb2(int level) +{ + via_set_cb2(&sysvia,level); +} + +void sysvia_via_set_cb2(int level) +{ + if (level && !sysvia.cb2) /*Low -> high*/ + crtc_latchpen(); +} + +/*Slow data bus + + Port A is the slow data bus, and is connected to + + Keyboard + SN76489 + Speech chip (B/B+ only, not emulated) + CMOS RAM (Master 128 only) + + Port B bits 0-3 control the bus, and are connected on a model B to IC32, a + 74LS249 latch. This also controls screen size (for hardware scrolling) and the + caps and scroll lock LEDs. + + This code emulates bus contention, which is entirely possible if developing + software under emulation and inadvertently enabling multiple bus masters*/ + + +/*Current state of IC32 output*/ +uint8_t IC32=0; +/*Current effective state of the slow data bus*/ +uint8_t sdbval; +/*What the System VIA is actually outputting to the slow data bus + For use when contending with whatever else is outputting to the bus*/ +static uint8_t sysvia_sdb_out; + +int scrsize; + +/*Calculate current state of slow data bus + B-em emulates three bus masters - the System VIA itself, the keyboard (bit 7 + only) and the CMOS RAM (Master 128 only)*/ +static void sysvia_update_sdb() +{ + sdbval = sysvia_sdb_out; + if (MASTER && !compactcmos) sdbval &= cmos_read(); + + keyrow = (sdbval >> 4) & 7; + keycol = sdbval & 0xF; + key_update(); + if (!(IC32 & 8) && !bbckey[keycol][keyrow]) sdbval &= 0x7f; +} + +static void sysvia_write_IC32(uint8_t val) +{ + uint8_t oldIC32 = IC32; + int temp = 0; + + if (val & 8) + IC32 |= (1 << (val & 7)); + else + IC32 &= ~(1 << (val & 7)); + + sysvia_update_sdb(); + + if (!(IC32 & 1) && (oldIC32 & 1)) + sn_write(sdbval); + + scrsize = ((IC32 & 0x10) ? 2 : 0) | ((IC32 & 0x20) ? 1 : 0); + + if ((IC32 & 0xC0) != (oldIC32 & 0xC0)) + { + if (!(IC32 & 0x40)) temp |= KB_CAPSLOCK_FLAG; + if (!(IC32 & 0x80)) temp |= KB_SCROLOCK_FLAG; + } + if (MASTER && !compactcmos) cmos_update(IC32, sdbval); +} + +void sysvia_write_portA(uint8_t val) +{ + sysvia_sdb_out = val; + + sysvia_update_sdb(); + + if (MASTER && !compactcmos) cmos_update(IC32, sdbval); +} + +void sysvia_write_portB(uint8_t val) +{ + sysvia_write_IC32(val); + /*Master 128 reuses the speech processor inputs*/ + if (MASTER && !compactcmos) + cmos_writeaddr(val); + /*Master Compact reuses the joystick fire inputs*/ + if (compactcmos) + compactcmos_i2cchange(val & 0x20, val & 0x10); +} + +uint8_t sysvia_read_portA() +{ + sysvia_update_sdb(); + + return sdbval; +} + +uint8_t sysvia_read_portB() +{ + uint8_t temp = 0xFF; + if (compactcmos) + { + temp &= ~0x30; + if (i2c_clock) temp |= 0x20; + if (i2c_data) temp |= 0x10; + } + else + { + temp |= 0xF0; + if (joybutton[0]) temp &= ~0x10; + if (joybutton[1]) temp &= ~0x20; + } + return temp; +} + +int autoboot; + + +void sysvia_write(uint16_t addr, uint8_t val) +{ +// rpclog("SYSVIA write %04X %02X\n",addr,val); + via_write(&sysvia, addr, val); +} + +uint8_t sysvia_read(uint16_t addr) +{ + uint8_t temp = via_read(&sysvia, addr); +// rpclog("SYSVIA read %04X %02X\n",addr,temp); + return temp; +} + +void sysvia_updatetimers() +{ + via_updatetimers(&sysvia); +} +void sysvia_reset() +{ + via_reset(&sysvia); + + sysvia.read_portA = sysvia_read_portA; + sysvia.read_portB = sysvia_read_portB; + + sysvia.write_portA = sysvia_write_portA; + sysvia.write_portB = sysvia_write_portB; + + sysvia.set_cb2 = sysvia_via_set_cb2; /*Lightpen*/ + + sysvia.intnum = 1; + + if (autoboot) + key_press(0,0); +} + + +void sysvia_savestate(FILE *f) +{ + via_savestate(&sysvia, f); + + putc(IC32,f); +} + +void sysvia_loadstate(FILE *f) +{ + via_loadstate(&sysvia, f); + + IC32=getc(f); + scrsize=((IC32&16)?2:0)|((IC32&32)?1:0); +} diff --git a/src/sysvia.h b/src/sysvia.h index b3cc7d2a..793266d7 100644 --- a/src/sysvia.h +++ b/src/sysvia.h @@ -1,18 +1,18 @@ -extern VIA sysvia; - -void sysvia_reset(); -void sysvia_write(uint16_t addr, uint8_t val); -uint8_t sysvia_read(uint16_t addr); -void sysvia_updatetimers(); - -void sysvia_savestate(FILE *f); -void sysvia_loadstate(FILE *f); - -extern uint8_t IC32; -extern uint8_t sdbval; -extern int scrsize; - -void sysvia_set_ca1(int level); -void sysvia_set_ca2(int level); -void sysvia_set_cb1(int level); -void sysvia_set_cb2(int level); +extern VIA sysvia; + +void sysvia_reset(); +void sysvia_write(uint16_t addr, uint8_t val); +uint8_t sysvia_read(uint16_t addr); +void sysvia_updatetimers(); + +void sysvia_savestate(FILE *f); +void sysvia_loadstate(FILE *f); + +extern uint8_t IC32; +extern uint8_t sdbval; +extern int scrsize; + +void sysvia_set_ca1(int level); +void sysvia_set_ca2(int level); +void sysvia_set_cb1(int level); +void sysvia_set_cb2(int level); diff --git a/src/tape.c b/src/tape.c index df3689e3..91055d85 100644 --- a/src/tape.c +++ b/src/tape.c @@ -1,56 +1,54 @@ -#include -#include "b-em.h" -#include "tape.h" -#include "uef.h" -#include "csw.h" - -int tapelcount,tapellatch; - -int tape_loaded = 0; -char tape_fn[260] = ""; - -static struct -{ - char *ext; - void (*load)(char *fn); - void (*close)(); -} -loaders[]= -{ - {"UEF", uef_load, uef_close}, - {"CSW", csw_load, csw_close}, - {0,0,0} -}; - -static int tape_loader; - -void tape_load(char *fn) -{ - int c = 0; - char *p; - - if (!fn) return; - p = get_extension(fn); - if (!p) return; - rpclog("Loading %s %s\n", fn, p); - while (loaders[c].ext) - { - if (!strcasecmp(p, loaders[c].ext)) - { - tape_loader = c; - loaders[c].load(fn); - return; - } - c++; - } - tape_loaded = 0; -} - -void tape_close() -{ - if (tape_loaded && tape_loader < 2) - { - tape_loaded = 0; - loaders[tape_loader].close(); - } -} +#include +#include "b-em.h" +#include "tape.h" +#include "uef.h" +#include "csw.h" + +int tapelcount,tapellatch; + +int tape_loaded = 0; +char tape_fn[260] = ""; + +static struct +{ + char *ext; + void (*load)(char *fn); + void (*close)(); +} +loaders[]= +{ + {"UEF", uef_load, uef_close}, + {"CSW", csw_load, csw_close}, + {0,0,0} +}; + +static int tape_loader; + +void tape_load(char *fn) +{ + int c = 0; + char *p; + + if (!fn) return; + p = get_extension(fn); + if (!p) return; + rpclog("Loading %s %s\n", fn, p); + while (loaders[c].ext) + { + if (!strcasecmp(p, loaders[c].ext)) + { + tape_loader = c; + loaders[c].load(fn); + return; + } + c++; + } + tape_loaded = 0; +} + +void tape_close() +{ + if (tape_loaded && tape_loader < 2) + loaders[tape_loader].close(); + tape_loaded = 0; +} diff --git a/src/tape.h b/src/tape.h index d9b3319a..cf7c4bff 100644 --- a/src/tape.h +++ b/src/tape.h @@ -1,8 +1,8 @@ -extern char tape_fn[260]; -extern int tape_loaded; - -void tape_load(char *fn); -void tape_close(); - -extern int tapelcount,tapellatch; -extern int fasttape; +extern char tape_fn[260]; +extern int tape_loaded; + +void tape_load(char *fn); +void tape_close(); + +extern int tapelcount,tapellatch; +extern int fasttape; diff --git a/src/tapenoise.c b/src/tapenoise.c index 0c9f572b..cc551653 100644 --- a/src/tapenoise.c +++ b/src/tapenoise.c @@ -1,142 +1,142 @@ -/*B-em v2.2 by Tom Walker - Tape noise (not very good)*/ - -#include -#include -#include -#include "b-em.h" -#include "tapenoise.h" -#include "sound.h" - -static int tpnoisep = 0; -static int tmcount = 0; -static int16_t tapenoise[4410]; - -static float swavepos = 0; - -static int sinewave[32]; - -#define PI 3.142 - -static SAMPLE *tsamples[2]; - -void tapenoise_init() -{ - char path[512], p2[512]; - int c; - - getcwd(p2, 511); - sprintf(path, "%sddnoise", exedir); -// printf("path now %s\n",path); - chdir(path); - tsamples[0] = safe_load_wav("motoron.wav"); - tsamples[1] = safe_load_wav("motoroff.wav"); - chdir(p2); - for (c = 0; c < 32; c++) - { - sinewave[c] = (int)(sin((float)c * ((2.0 * PI) / 32.0)) * 128.0); - } -} - -void tapenoise_close() -{ - destroy_sample(tsamples[0]); - destroy_sample(tsamples[1]); -} - -void tapenoise_addhigh() -{ - int c; - float wavediv = (32.0f * 2400.0f) / 44100.0f; -// rpclog("Wavediv %f %i\n",wavediv,tmcount); - tmcount++; - for (c = 0; c < 368; c++) - { - if (tpnoisep >= 4410) return; - tapenoise[tpnoisep++] = sinewave[((int)swavepos) & 0x1F] * 64; - swavepos += wavediv; - } -} - -void tapenoise_adddat(uint8_t dat) -{ - int c, d,e = 0; - float wavediv = (32.0f * 2400.0f) / 44100.0f; -// swavepos=0; - for (c = 0; c < 30; c++) /*Start bit*/ - { - if (tpnoisep >= 4410) return; - tapenoise[tpnoisep++] = sinewave[((int)swavepos) & 0x1F] * 64; - e++; - swavepos += (wavediv / 2); - } - swavepos = fmod(swavepos, 32.0); - while (swavepos < 32.0) - { - if (tpnoisep >= 4410) return; - tapenoise[tpnoisep++] = sinewave[((int)swavepos) & 0x1F] * 64; - swavepos += (wavediv / 2); - e++; - } - for (d = 0; d < 8; d++) - { - swavepos = fmod(swavepos, 32.0); - while (swavepos < 32.0) - { - if (tpnoisep >= 4410) return; - tapenoise[tpnoisep++] = sinewave[((int)swavepos) & 0x1F] * ((dat & 1) ? 50 : 64); - if (dat & 1) swavepos += wavediv; - else swavepos += (wavediv / 2); - e++; - } - dat >>= 1; - } -// swavepos=0; - for ( ;e < 368; e++) /*Stop bit*/ - { - if (tpnoisep >= 4410) return; - tapenoise[tpnoisep++] = sinewave[((int)swavepos) & 0x1F] * 64; - swavepos += (wavediv / 2); - } - - tapenoise_addhigh(); -} - -static int tnoise_sstat = -1, tnoise_spos; - -void tapenoise_motorchange(int stat) -{ - tnoise_sstat = stat ^ 1; - tnoise_spos = 0; -} - -void tapenoise_mix(int16_t *tapebuffer) -{ - int c; - tpnoisep = 0; - if (!sound_tape) return; -// rpclog("Mix!\n"); - - for (c = 0; c < 4410; c++) - { - tapebuffer[c] += tapenoise[c]; - tapenoise[c] = 0; - } - - for (c = 0; c < 4410; c++) - { - if (tnoise_sstat >= 0) - { - if (tnoise_spos >= tsamples[tnoise_sstat]->len) - { - tnoise_spos = 0; - tnoise_sstat = -1; - } - else - { - tapebuffer[c] += ((int16_t)((((int16_t *)tsamples[tnoise_sstat]->data)[(int)tnoise_spos]) ^ 0x8000) / 4); - tnoise_spos += ((float)tsamples[tnoise_sstat]->freq / 44100.0); - } - } - } -} +/*B-em v2.2 by Tom Walker + Tape noise (not very good)*/ + +#include +#include +#include +#include "b-em.h" +#include "tapenoise.h" +#include "sound.h" + +static int tpnoisep = 0; +static int tmcount = 0; +static int16_t tapenoise[4410]; + +static float swavepos = 0; + +static int sinewave[32]; + +#define PI 3.142 + +static SAMPLE *tsamples[2]; + +void tapenoise_init() +{ + char path[512], p2[512]; + int c; + + getcwd(p2, 511); + sprintf(path, "%sddnoise", exedir); +// printf("path now %s\n",path); + chdir(path); + tsamples[0] = load_wav("motoron.wav"); + tsamples[1] = load_wav("motoroff.wav"); + chdir(p2); + for (c = 0; c < 32; c++) + { + sinewave[c] = (int)(sin((float)c * ((2.0 * PI) / 32.0)) * 128.0); + } +} + +void tapenoise_close() +{ + destroy_sample(tsamples[0]); + destroy_sample(tsamples[1]); +} + +void tapenoise_addhigh() +{ + int c; + float wavediv = (32.0f * 2400.0f) / 44100.0f; +// rpclog("Wavediv %f %i\n",wavediv,tmcount); + tmcount++; + for (c = 0; c < 368; c++) + { + if (tpnoisep >= 4410) return; + tapenoise[tpnoisep++] = sinewave[((int)swavepos) & 0x1F] * 64; + swavepos += wavediv; + } +} + +void tapenoise_adddat(uint8_t dat) +{ + int c, d,e = 0; + float wavediv = (32.0f * 2400.0f) / 44100.0f; +// swavepos=0; + for (c = 0; c < 30; c++) /*Start bit*/ + { + if (tpnoisep >= 4410) return; + tapenoise[tpnoisep++] = sinewave[((int)swavepos) & 0x1F] * 64; + e++; + swavepos += (wavediv / 2); + } + swavepos = fmod(swavepos, 32.0); + while (swavepos < 32.0) + { + if (tpnoisep >= 4410) return; + tapenoise[tpnoisep++] = sinewave[((int)swavepos) & 0x1F] * 64; + swavepos += (wavediv / 2); + e++; + } + for (d = 0; d < 8; d++) + { + swavepos = fmod(swavepos, 32.0); + while (swavepos < 32.0) + { + if (tpnoisep >= 4410) return; + tapenoise[tpnoisep++] = sinewave[((int)swavepos) & 0x1F] * ((dat & 1) ? 50 : 64); + if (dat & 1) swavepos += wavediv; + else swavepos += (wavediv / 2); + e++; + } + dat >>= 1; + } +// swavepos=0; + for ( ;e < 368; e++) /*Stop bit*/ + { + if (tpnoisep >= 4410) return; + tapenoise[tpnoisep++] = sinewave[((int)swavepos) & 0x1F] * 64; + swavepos += (wavediv / 2); + } + + tapenoise_addhigh(); +} + +static int tnoise_sstat = -1, tnoise_spos; + +void tapenoise_motorchange(int stat) +{ + tnoise_sstat = stat ^ 1; + tnoise_spos = 0; +} + +void tapenoise_mix(int16_t *tapebuffer) +{ + int c; + tpnoisep = 0; + if (!sound_tape) return; +// rpclog("Mix!\n"); + + for (c = 0; c < 4410; c++) + { + tapebuffer[c] += tapenoise[c]; + tapenoise[c] = 0; + } + + for (c = 0; c < 4410; c++) + { + if (tnoise_sstat >= 0) + { + if (tnoise_spos >= tsamples[tnoise_sstat]->len) + { + tnoise_spos = 0; + tnoise_sstat = -1; + } + else + { + tapebuffer[c] += ((int16_t)((((int16_t *)tsamples[tnoise_sstat]->data)[(int)tnoise_spos]) ^ 0x8000) / 4); + tnoise_spos += ((float)tsamples[tnoise_sstat]->freq / 44100.0); + } + } + } +} diff --git a/src/tapenoise.h b/src/tapenoise.h index f29fd723..b41c01dc 100644 --- a/src/tapenoise.h +++ b/src/tapenoise.h @@ -1,6 +1,6 @@ -void tapenoise_init(); -void tapenoise_close(); -void tapenoise_addhigh(); -void tapenoise_adddat(uint8_t dat); -void tapenoise_motorchange(int stat); -void tapenoise_mix(int16_t *tapebuffer); +void tapenoise_init(); +void tapenoise_close(); +void tapenoise_addhigh(); +void tapenoise_adddat(uint8_t dat); +void tapenoise_motorchange(int stat); +void tapenoise_mix(int16_t *tapebuffer); diff --git a/src/tube.c b/src/tube.c index de9ae32e..20dd716c 100644 --- a/src/tube.c +++ b/src/tube.c @@ -1,340 +1,340 @@ -/*B-em v2.2 by Tom Walker - Tube ULA emulation*/ - -#include -#include "b-em.h" -#include "6502.h" -#include "tube.h" - -#include "32016.h" -#include "6502tube.h" -#include "65816.h" -#include "arm.h" -#include "x86_tube.h" -#include "z80.h" - -#define TUBE6502 1 -#define TUBEZ80 2 -#define TUBEARM 3 -#define TUBEX86 4 -#define TUBE65816 5 -#define TUBE32016 6 - -int tube_shift; -int tube_6502_speed=1; -int tubecycles = 0; - -int tube_irq=0; -int tube_type=TUBEX86; - -static int tube_romin=1; - -struct -{ - uint8_t ph1[24],ph2,ph3[2],ph4; - uint8_t hp1,hp2,hp3[2],hp4; - uint8_t hstat[4],pstat[4],r1stat; - int ph1pos,ph3pos,hp3pos; -} tubeula; - -void tube_updateints() -{ - tube_irq = 0; - interrupt &= ~8; - - if ((tubeula.r1stat & 1) && (tubeula.hstat[3] & 128)) interrupt |= 8; - - if ((tubeula.r1stat & 2) && (tubeula.pstat[0] & 128)) tube_irq |= 1; - if ((tubeula.r1stat & 4) && (tubeula.pstat[3] & 128)) tube_irq |= 1; - - if ((tubeula.r1stat & 8) && !(tubeula.r1stat & 16) && ((tubeula.hp3pos > 0) || (tubeula.ph3pos == 0))) tube_irq|=2; - if ((tubeula.r1stat & 8) && (tubeula.r1stat & 16) && ((tubeula.hp3pos > 1) || (tubeula.ph3pos == 0))) tube_irq|=2; -} - -uint8_t tube_host_read(uint16_t addr) -{ - uint8_t temp = 0; - int c; - if (!tube_exec) return 0xFE; - switch (addr & 7) - { - case 0: /*Reg 1 Stat*/ - temp = (tubeula.hstat[0] & 0xC0) | tubeula.r1stat; - break; - case 1: /*Register 1*/ - temp = tubeula.ph1[0]; - for (c = 0; c < 23; c++) tubeula.ph1[c] = tubeula.ph1[c + 1]; - tubeula.ph1pos--; - tubeula.pstat[0] |= 0x40; - if (!tubeula.ph1pos) tubeula.hstat[0] &= ~0x80; - break; - case 2: /*Register 2 Stat*/ - temp = tubeula.hstat[1]; - break; - case 3: /*Register 2*/ - temp = tubeula.ph2; - if (tubeula.hstat[1] & 0x80) - { - tubeula.hstat[1] &= ~0x80; - tubeula.pstat[1] |= 0x40; - } - break; - case 4: /*Register 3 Stat*/ - temp = tubeula.hstat[2]; - break; - case 5: /*Register 3*/ - temp = tubeula.ph3[0]; - if (tubeula.ph3pos > 0) - { - tubeula.ph3[0] = tubeula.ph3[1]; - tubeula.ph3pos--; - tubeula.pstat[2] |= 0x40; - if (!tubeula.ph3pos) tubeula.hstat[2] &= ~0x80; - } - break; - case 6: /*Register 4 Stat*/ - temp = tubeula.hstat[3]; - break; - case 7: /*Register 4*/ - temp = tubeula.ph4; - if (tubeula.hstat[3] & 0x80) - { - tubeula.hstat[3] &= ~0x80; - tubeula.pstat[3] |= 0x40; - } - break; - } - tube_updateints(); - return temp; -} - -void tube_host_write(uint16_t addr, uint8_t val) -{ - if (!tube_exec) return; - switch (addr & 7) - { - case 0: /*Register 1 stat*/ - if (val & 0x80) tubeula.r1stat |= (val&0x3F); - else tubeula.r1stat &= ~(val&0x3F); - tubeula.hstat[0] = (tubeula.hstat[0] & 0xC0) | (val & 0x3F); - break; - case 1: /*Register 1*/ - tubeula.hp1 = val; - tubeula.pstat[0] |= 0x80; - tubeula.hstat[0] &= ~0x40; - break; - case 3: /*Register 2*/ - tubeula.hp2 = val; - tubeula.pstat[1] |= 0x80; - tubeula.hstat[1] &= ~0x40; - break; - case 5: /*Register 3*/ - if (tubeula.r1stat & 16) - { - if (tubeula.hp3pos < 2) - tubeula.hp3[tubeula.hp3pos++] = val; - if (tubeula.hp3pos == 2) - { - tubeula.pstat[2] |= 0x80; - tubeula.hstat[2] &= ~0x40; - } - } - else - { - tubeula.hp3[0] = val; - tubeula.hp3pos = 1; - tubeula.pstat[2] |= 0x80; - tubeula.hstat[2] &= ~0x40; - tube_updateints(); - } -// printf("Write R3 %i\n",tubeula.hp3pos); - break; - case 7: /*Register 4*/ - tubeula.hp4 = val; - tubeula.pstat[3] |= 0x80; - tubeula.hstat[3] &= ~0x40; - break; - } - tube_updateints(); -} - -uint8_t tube_parasite_read(uint32_t addr) -{ - uint8_t temp = 0; - switch (addr & 7) - { - case 0: /*Register 1 stat*/ - if (tube_romin) - { - if (tube_type == TUBE6502 || tube_type == TUBE65816) - tube_6502_mapoutrom(); - tube_romin = 0; - } - temp = tubeula.pstat[0] | tubeula.r1stat; - break; - case 1: /*Register 1*/ - temp = tubeula.hp1; - if (tubeula.pstat[0] & 0x80) - { - tubeula.pstat[0] &= ~0x80; - tubeula.hstat[0] |= 0x40; - } - break; - case 2: /*Register 2 stat*/ - temp = tubeula.pstat[1]; - break; - case 3: /*Register 2*/ - temp = tubeula.hp2; - if (tubeula.pstat[1] & 0x80) - { - tubeula.pstat[1] &= ~0x80; - tubeula.hstat[1] |= 0x40; - } - break; - case 4: /*Register 3 stat*/ - temp = tubeula.pstat[2]; - break; - case 5: /*Register 3*/ - temp = tubeula.hp3[0]; - if (tubeula.hp3pos>0) - { - tubeula.hp3[0] = tubeula.hp3[1]; - tubeula.hp3pos--; - if (!tubeula.hp3pos) - { - tubeula.hstat[2] |= 0x40; - tubeula.pstat[2] &= ~0x80; - } - } - break; - case 6: /*Register 4 stat*/ - temp = tubeula.pstat[3]; - break; - case 7: /*Register 4*/ - temp = tubeula.hp4; - if (tubeula.pstat[3] & 0x80) - { - tubeula.pstat[3] &= ~0x80; - tubeula.hstat[3] |= 0x40; - } - break; - } - tube_updateints(); - return temp; -} - -void tube_parasite_write(uint32_t addr, uint8_t val) -{ - switch (addr & 7) - { - case 1: /*Register 1*/ - if (tubeula.ph1pos < 24) - { - tubeula.ph1[tubeula.ph1pos++] = val; - tubeula.hstat[0] |= 0x80; - if (tubeula.ph1pos == 24) tubeula.pstat[0] &= ~0x40; - } - break; - case 3: /*Register 2*/ - tubeula.ph2 = val; - tubeula.hstat[1] |= 0x80; - tubeula.pstat[1] &= ~0x40; - break; - case 5: /*Register 3*/ - if (tubeula.r1stat & 16) - { - if (tubeula.ph3pos < 2) - tubeula.ph3[tubeula.ph3pos++] = val; - if (tubeula.ph3pos == 2) - { - tubeula.hstat[2] |= 0x80; - tubeula.pstat[2] &= ~0x40; - } - } - else - { - tubeula.ph3[0] = val; - tubeula.ph3pos = 1; - tubeula.hstat[2] |= 0x80; - tubeula.pstat[2] &= ~0x40; - } - break; - case 7: /*Register 4*/ - tubeula.ph4 = val; - tubeula.hstat[3] |= 0x80; - tubeula.pstat[3] &= ~0x40; - break; - } - tube_updateints(); -} - -void tube_6502_init() -{ - tube_type = TUBE6502; - tube_6502_init_cpu(); - tube_6502_reset(); - tube_exec = tube_6502_exec; - tube_shift = tube_6502_speed; -} - -void tube_updatespeed() -{ - if (tube_type == TUBE6502) tube_shift = tube_6502_speed; -} - -void tube_arm_init() -{ - tube_type = TUBEARM; - arm_init(); - arm_reset(); - tube_exec = arm_exec; - tube_shift = 1; -} - -void tube_z80_init() -{ - tube_type = TUBEZ80; - z80_init(); - z80_reset(); - tube_exec = z80_exec; - tube_shift = 2; -} - -void tube_x86_init() -{ - tube_type = TUBEX86; - x86_init(); - x86_reset(); - tube_exec = x86_exec; - tube_shift = 2; -} - -void tube_65816_init() -{ - tube_type = TUBE65816; - w65816_init(); - w65816_reset(); - tube_exec = w65816_exec; - tube_shift = 3; -} - -void tube_32016_init() -{ - tube_type = TUBE32016; - n32016_init(); - n32016_reset(); - tube_exec = n32016_exec; - tube_shift = 2; -} - -void tube_reset() -{ - tubeula.ph1pos = tubeula.hp3pos = 0; - tubeula.ph3pos = 1; - tubeula.r1stat = 0; - tubeula.hstat[0] = tubeula.hstat[1] = tubeula.hstat[3] = 0x40; - tubeula.pstat[0] = tubeula.pstat[1] = tubeula.pstat[2] = tubeula.pstat[3] = 0x40; - tubeula.hstat[2] = 0xC0; - tube_romin = 1; -} - +/*B-em v2.2 by Tom Walker + Tube ULA emulation*/ + +#include +#include "b-em.h" +#include "6502.h" +#include "tube.h" + +#include "32016.h" +#include "6502tube.h" +#include "65816.h" +#include "arm.h" +#include "x86_tube.h" +#include "z80.h" + +#define TUBE6502 1 +#define TUBEZ80 2 +#define TUBEARM 3 +#define TUBEX86 4 +#define TUBE65816 5 +#define TUBE32016 6 + +int tube_shift; +int tube_6502_speed=1; +int tubecycles = 0; + +int tube_irq=0; +int tube_type=TUBEX86; + +static int tube_romin=1; + +struct +{ + uint8_t ph1[24],ph2,ph3[2],ph4; + uint8_t hp1,hp2,hp3[2],hp4; + uint8_t hstat[4],pstat[4],r1stat; + int ph1pos,ph3pos,hp3pos; +} tubeula; + +void tube_updateints() +{ + tube_irq = 0; + interrupt &= ~8; + + if ((tubeula.r1stat & 1) && (tubeula.hstat[3] & 128)) interrupt |= 8; + + if ((tubeula.r1stat & 2) && (tubeula.pstat[0] & 128)) tube_irq |= 1; + if ((tubeula.r1stat & 4) && (tubeula.pstat[3] & 128)) tube_irq |= 1; + + if ((tubeula.r1stat & 8) && !(tubeula.r1stat & 16) && ((tubeula.hp3pos > 0) || (tubeula.ph3pos == 0))) tube_irq|=2; + if ((tubeula.r1stat & 8) && (tubeula.r1stat & 16) && ((tubeula.hp3pos > 1) || (tubeula.ph3pos == 0))) tube_irq|=2; +} + +uint8_t tube_host_read(uint16_t addr) +{ + uint8_t temp = 0; + int c; + if (!tube_exec) return 0xFE; + switch (addr & 7) + { + case 0: /*Reg 1 Stat*/ + temp = (tubeula.hstat[0] & 0xC0) | tubeula.r1stat; + break; + case 1: /*Register 1*/ + temp = tubeula.ph1[0]; + for (c = 0; c < 23; c++) tubeula.ph1[c] = tubeula.ph1[c + 1]; + tubeula.ph1pos--; + tubeula.pstat[0] |= 0x40; + if (!tubeula.ph1pos) tubeula.hstat[0] &= ~0x80; + break; + case 2: /*Register 2 Stat*/ + temp = tubeula.hstat[1]; + break; + case 3: /*Register 2*/ + temp = tubeula.ph2; + if (tubeula.hstat[1] & 0x80) + { + tubeula.hstat[1] &= ~0x80; + tubeula.pstat[1] |= 0x40; + } + break; + case 4: /*Register 3 Stat*/ + temp = tubeula.hstat[2]; + break; + case 5: /*Register 3*/ + temp = tubeula.ph3[0]; + if (tubeula.ph3pos > 0) + { + tubeula.ph3[0] = tubeula.ph3[1]; + tubeula.ph3pos--; + tubeula.pstat[2] |= 0x40; + if (!tubeula.ph3pos) tubeula.hstat[2] &= ~0x80; + } + break; + case 6: /*Register 4 Stat*/ + temp = tubeula.hstat[3]; + break; + case 7: /*Register 4*/ + temp = tubeula.ph4; + if (tubeula.hstat[3] & 0x80) + { + tubeula.hstat[3] &= ~0x80; + tubeula.pstat[3] |= 0x40; + } + break; + } + tube_updateints(); + return temp; +} + +void tube_host_write(uint16_t addr, uint8_t val) +{ + if (!tube_exec) return; + switch (addr & 7) + { + case 0: /*Register 1 stat*/ + if (val & 0x80) tubeula.r1stat |= (val&0x3F); + else tubeula.r1stat &= ~(val&0x3F); + tubeula.hstat[0] = (tubeula.hstat[0] & 0xC0) | (val & 0x3F); + break; + case 1: /*Register 1*/ + tubeula.hp1 = val; + tubeula.pstat[0] |= 0x80; + tubeula.hstat[0] &= ~0x40; + break; + case 3: /*Register 2*/ + tubeula.hp2 = val; + tubeula.pstat[1] |= 0x80; + tubeula.hstat[1] &= ~0x40; + break; + case 5: /*Register 3*/ + if (tubeula.r1stat & 16) + { + if (tubeula.hp3pos < 2) + tubeula.hp3[tubeula.hp3pos++] = val; + if (tubeula.hp3pos == 2) + { + tubeula.pstat[2] |= 0x80; + tubeula.hstat[2] &= ~0x40; + } + } + else + { + tubeula.hp3[0] = val; + tubeula.hp3pos = 1; + tubeula.pstat[2] |= 0x80; + tubeula.hstat[2] &= ~0x40; + tube_updateints(); + } +// printf("Write R3 %i\n",tubeula.hp3pos); + break; + case 7: /*Register 4*/ + tubeula.hp4 = val; + tubeula.pstat[3] |= 0x80; + tubeula.hstat[3] &= ~0x40; + break; + } + tube_updateints(); +} + +uint8_t tube_parasite_read(uint32_t addr) +{ + uint8_t temp = 0; + switch (addr & 7) + { + case 0: /*Register 1 stat*/ + if (tube_romin) + { + if (tube_type == TUBE6502 || tube_type == TUBE65816) + tube_6502_mapoutrom(); + tube_romin = 0; + } + temp = tubeula.pstat[0] | tubeula.r1stat; + break; + case 1: /*Register 1*/ + temp = tubeula.hp1; + if (tubeula.pstat[0] & 0x80) + { + tubeula.pstat[0] &= ~0x80; + tubeula.hstat[0] |= 0x40; + } + break; + case 2: /*Register 2 stat*/ + temp = tubeula.pstat[1]; + break; + case 3: /*Register 2*/ + temp = tubeula.hp2; + if (tubeula.pstat[1] & 0x80) + { + tubeula.pstat[1] &= ~0x80; + tubeula.hstat[1] |= 0x40; + } + break; + case 4: /*Register 3 stat*/ + temp = tubeula.pstat[2]; + break; + case 5: /*Register 3*/ + temp = tubeula.hp3[0]; + if (tubeula.hp3pos>0) + { + tubeula.hp3[0] = tubeula.hp3[1]; + tubeula.hp3pos--; + if (!tubeula.hp3pos) + { + tubeula.hstat[2] |= 0x40; + tubeula.pstat[2] &= ~0x80; + } + } + break; + case 6: /*Register 4 stat*/ + temp = tubeula.pstat[3]; + break; + case 7: /*Register 4*/ + temp = tubeula.hp4; + if (tubeula.pstat[3] & 0x80) + { + tubeula.pstat[3] &= ~0x80; + tubeula.hstat[3] |= 0x40; + } + break; + } + tube_updateints(); + return temp; +} + +void tube_parasite_write(uint32_t addr, uint8_t val) +{ + switch (addr & 7) + { + case 1: /*Register 1*/ + if (tubeula.ph1pos < 24) + { + tubeula.ph1[tubeula.ph1pos++] = val; + tubeula.hstat[0] |= 0x80; + if (tubeula.ph1pos == 24) tubeula.pstat[0] &= ~0x40; + } + break; + case 3: /*Register 2*/ + tubeula.ph2 = val; + tubeula.hstat[1] |= 0x80; + tubeula.pstat[1] &= ~0x40; + break; + case 5: /*Register 3*/ + if (tubeula.r1stat & 16) + { + if (tubeula.ph3pos < 2) + tubeula.ph3[tubeula.ph3pos++] = val; + if (tubeula.ph3pos == 2) + { + tubeula.hstat[2] |= 0x80; + tubeula.pstat[2] &= ~0x40; + } + } + else + { + tubeula.ph3[0] = val; + tubeula.ph3pos = 1; + tubeula.hstat[2] |= 0x80; + tubeula.pstat[2] &= ~0x40; + } + break; + case 7: /*Register 4*/ + tubeula.ph4 = val; + tubeula.hstat[3] |= 0x80; + tubeula.pstat[3] &= ~0x40; + break; + } + tube_updateints(); +} + +void tube_6502_init() +{ + tube_type = TUBE6502; + tube_6502_init_cpu(); + tube_6502_reset(); + tube_exec = tube_6502_exec; + tube_shift = tube_6502_speed; +} + +void tube_updatespeed() +{ + if (tube_type == TUBE6502) tube_shift = tube_6502_speed; +} + +void tube_arm_init() +{ + tube_type = TUBEARM; + arm_init(); + arm_reset(); + tube_exec = arm_exec; + tube_shift = 1; +} + +void tube_z80_init() +{ + tube_type = TUBEZ80; + z80_init(); + z80_reset(); + tube_exec = z80_exec; + tube_shift = 2; +} + +void tube_x86_init() +{ + tube_type = TUBEX86; + x86_init(); + x86_reset(); + tube_exec = x86_exec; + tube_shift = 2; +} + +void tube_65816_init() +{ + tube_type = TUBE65816; + w65816_init(); + w65816_reset(); + tube_exec = w65816_exec; + tube_shift = 3; +} + +void tube_32016_init() +{ + tube_type = TUBE32016; + n32016_init(); + n32016_reset(); + tube_exec = n32016_exec; + tube_shift = 2; +} + +void tube_reset() +{ + tubeula.ph1pos = tubeula.hp3pos = 0; + tubeula.ph3pos = 1; + tubeula.r1stat = 0; + tubeula.hstat[0] = tubeula.hstat[1] = tubeula.hstat[3] = 0x40; + tubeula.pstat[0] = tubeula.pstat[1] = tubeula.pstat[2] = tubeula.pstat[3] = 0x40; + tubeula.hstat[2] = 0xC0; + tube_romin = 1; +} + diff --git a/src/tube.h b/src/tube.h index 2bca4bbd..742fa2d8 100644 --- a/src/tube.h +++ b/src/tube.h @@ -1,23 +1,23 @@ -void tube_reset(); -void tube_6502_init(); -void tube_arm_init(); -void tube_z80_init(); -void tube_x86_init(); -void tube_65816_init(); -void tube_32016_init(); - -void (*tube_exec)(); -extern int tubecycles; - -uint8_t tube_host_read(uint16_t addr); -void tube_host_write(uint16_t addr, uint8_t val); -uint8_t tube_parasite_read(uint32_t addr); -void tube_parasite_write(uint32_t addr, uint8_t val); - -extern int tube_shift; -extern int tube_6502_speed; - -extern int tube_irq; - -void tube_reset(); -void tube_updatespeed(); +void tube_reset(); +void tube_6502_init(); +void tube_arm_init(); +void tube_z80_init(); +void tube_x86_init(); +void tube_65816_init(); +void tube_32016_init(); + +void (*tube_exec)(); +extern int tubecycles; + +uint8_t tube_host_read(uint16_t addr); +void tube_host_write(uint16_t addr, uint8_t val); +uint8_t tube_parasite_read(uint32_t addr); +void tube_parasite_write(uint32_t addr, uint8_t val); + +extern int tube_shift; +extern int tube_6502_speed; + +extern int tube_irq; + +void tube_reset(); +void tube_updatespeed(); diff --git a/src/uef.c b/src/uef.c index 1935ee4a..531cc922 100644 --- a/src/uef.c +++ b/src/uef.c @@ -1,400 +1,400 @@ -/*B-em v2.2 by Tom Walker - UEF/HQ-UEF tape support*/ - -#include -#include -#include -#include "b-em.h" -#include "acia.h" -#include "csw.h" -#include "uef.h" -#include "tape.h" - -int tapelcount, tapellatch, pps; -gzFile uef_f = NULL; - -int uef_toneon = 0; - -static int uef_inchunk = 0, uef_chunkid = 0, uef_chunklen = 0; -static int uef_chunkpos = 0, uef_chunkdatabits = 8; -static int uef_startchunk; -static float uef_chunkf; -static int uef_intone = 0; - -void uef_load(char *fn) -{ - int c; -// printf("OpenUEF %s %08X\n",fn,uef); - if (uef_f) - gzclose(uef_f); - uef_f = gzopen(fn, "rb"); - if (!uef_f) { /*printf("Fail!\n");*/ return; } - for (c = 0; c < 12; c++) - gzgetc(uef_f); - uef_inchunk = uef_chunklen = uef_chunkid = 0; - tapellatch = (1000000 / (1200 / 10)) / 64; - tapelcount = 0; - pps = 120; - csw_ena = 0; -// printf("Tapellatch %i\n",tapellatch); - tape_loaded = 1; -// gzseek(uef,27535,SEEK_SET); -} - -void uef_close() -{ -//printf("CloseUEF\n"); - if (uef_f) - { - gzclose(uef_f); - uef_f = NULL; - } -} - -int infilenames = 0; -int uefloop = 0; -uint8_t fdat; -int ffound; -static void uef_receive(uint8_t val) -{ - uef_toneon--; - if (infilenames) - { - ffound = 1; - fdat = val; -// rpclog("Dat %02X %c\n",val,(val<33)?'.':val); - } - else - { - acia_receive(val); -// rpclog("Dat %02X\n",val); - } -} - -void uef_poll() -{ - int c; - uint32_t templ; - float *tempf; - uint8_t temp; - if (!uef_f) - return; - if (!uef_inchunk) - { - uef_startchunk = 1; -// printf("%i ",gztell(uef)); - gzread(uef_f, &uef_chunkid, 2); - gzread(uef_f, &uef_chunklen, 4); - if (gzeof(uef_f)) - { - gzseek(uef_f, 12, SEEK_SET); - gzread(uef_f, &uef_chunkid, 2); - gzread(uef_f, &uef_chunklen, 4); - uefloop = 1; - } - uef_inchunk = 1; - uef_chunkpos = 0; -// printf("Chunk ID %04X len %i\n",uef_chunkid,uef_chunklen); - } -// else -// printf("Chunk %04X\n",uef_chunkid); - switch (uef_chunkid) - { - case 0x000: /*Origin*/ - for (c = 0; c < uef_chunklen; c++) - gzgetc(uef_f); - uef_inchunk = 0; - return; - - case 0x005: /*Target platform*/ - for (c = 0; c < uef_chunklen; c++) - gzgetc(uef_f); - uef_inchunk = 0; - return; - - case 0x100: /*Raw data*/ - if (uef_startchunk) - { - dcdlow(); - uef_startchunk = 0; - } - uef_chunklen--; - if (!uef_chunklen) - { - uef_inchunk = 0; - } - uef_receive(gzgetc(uef_f)); - return; - - case 0x104: /*Defined data*/ - if (!uef_chunkpos) - { - uef_chunkdatabits = gzgetc(uef_f); - gzgetc(uef_f); - gzgetc(uef_f); - uef_chunklen -= 3; - uef_chunkpos = 1; - } - else - { - uef_chunklen--; - if (uef_chunklen <= 0) - uef_inchunk = 0; - temp = gzgetc(uef_f); -// printf("%i : %i %02X\n",gztell(uef),uef_chunklen,temp); - if (uef_chunkdatabits == 7) uef_receive(temp & 0x7F); - else uef_receive(temp); - } - return; - - case 0x110: /*High tone*/ - uef_toneon = 2; - if (!uef_intone) - { - dcd(); - uef_intone = gzgetc(uef_f); - uef_intone |= (gzgetc(uef_f) << 8); - uef_intone /= 20; - if (!uef_intone) uef_intone = 1; -// printf("uef_intone %i\n",uef_intone); - } - else - { - uef_intone--; - if (uef_intone == 0) - { - uef_inchunk = 0; - } - } - return; - - case 0x111: /*High tone with dummy byte*/ - uef_toneon = 2; - if (!uef_intone) - { - dcd(); - uef_intone = gzgetc(uef_f); - uef_intone |= (gzgetc(uef_f)<<8); - uef_intone /= 20; - if (!uef_intone) uef_intone = 1; - } - else - { - uef_intone--; - if (uef_intone == 0 && uef_inchunk == 2) - { - uef_inchunk = 0; - } - else if (!uef_intone) - { - uef_inchunk = 2; - uef_intone = gzgetc(uef_f); - uef_intone |= (gzgetc(uef_f) << 8); - uef_intone /= 20; - if (!uef_intone) uef_intone = 1; - uef_receive(0xAA); - } - } - return; - - case 0x112: /*Gap*/ - uef_toneon = 0; - if (!uef_intone) - { -// dcd(); - uef_intone = gzgetc(uef_f); - uef_intone |= (gzgetc(uef_f) << 8); - uef_intone /= 20; -// printf("gap uef_intone %i\n",uef_intone); - if (!uef_intone) uef_intone = 1; - } - else - { - uef_intone--; - if (uef_intone == 0) - { - uef_inchunk = 0; - } - } - return; - - case 0x113: /*Float baud rate*/ - templ = gzgetc(uef_f); - templ |= (gzgetc(uef_f) << 8); - templ |= (gzgetc(uef_f) << 16); - templ |= (gzgetc(uef_f) << 24); - tempf = (float *)&templ; - tapellatch = (1000000 / ((*tempf) / 10)) / 64; - pps = (*tempf) / 10; - uef_inchunk = 0; - return; - - case 0x116: /*Float gap*/ - uef_toneon = 0; - if (!uef_chunkpos) - { - templ = gzgetc(uef_f); - templ |= (gzgetc(uef_f) << 8); - templ |= (gzgetc(uef_f) << 16); - templ |= (gzgetc(uef_f) << 24); - tempf = (float *)&templ; - uef_chunkf = *tempf; - //printf("Gap %f %i\n",uef_chunkf,pps); - uef_chunkpos = 1; -// uef_chunkf=4; - } - else - { -// printf("Gap now %f\n",uef_chunkf); - uef_chunkf -= ((float)1 / (float)pps); - if (uef_chunkf <= 0) uef_inchunk = 0; - } - return; - - case 0x114: /*Security waves*/ - case 0x115: /*Polarity change*/ -// default: - for (c = 0; c < uef_chunklen; c++) - gzgetc(uef_f); - uef_inchunk = 0; - return; - - default: - for (c = 0; c < uef_chunklen; c++) - gzgetc(uef_f); - uef_inchunk = 0; - return; -//116 : float gap -//113 : float baud rate - - } -// allegro_exit(); -// printf("Bad chunk ID %04X length %i\n",uef_chunkid,uef_chunklen); -// exit(-1); -} - -uint8_t fbuffer[4]; - -#define getuefbyte() ffound = 0; \ - while (!ffound && !uefloop) \ - { \ - uef_poll(); \ - } \ - if (uefloop) break; - -uint8_t ffilename[16]; -void uef_findfilenames() -{ - int temp; - uint8_t tb; - int c; - int fsize = 0; - char s[256]; - uint32_t run, load; - uint8_t status; - int skip; - int binchunk = uef_inchunk, bchunkid = uef_chunkid, bchunklen = uef_chunklen; - int bchunkpos = uef_chunkpos, bchunkdatabits = uef_chunkdatabits; - int bintone = uef_intone, bffound = ffound; - float bchunkf = uef_chunkf; - uint8_t bdat = fdat; - if (!uef_f) return; - - uef_inchunk = 0; uef_chunkid = 0; uef_chunklen = 0; - uef_chunkpos = 0; uef_chunkdatabits = 8; uef_intone = 0; - uef_chunkf = 0; - - startblit(); - temp=gztell(uef_f); - gzseek(uef_f, 12, SEEK_SET); - uefloop = 0; - infilenames = 1; - while (!uefloop) - { - ffound = 0; - while (!ffound && !uefloop) - { - uef_poll(); - } - if (uefloop) break; - fbuffer[0] = fbuffer[1]; - fbuffer[1] = fbuffer[2]; - fbuffer[2] = fbuffer[3]; - fbuffer[3] = fdat; - if (fdat == 0x2A && uef_toneon == 1) - { - fbuffer[3] = 0; - c = 0; - do - { - ffound = 0; - while (!ffound && !uefloop) - { - uef_poll(); - } - if (uefloop) break; - ffilename[c++] = fdat; - } while (fdat != 0x0 && c < 10); - if (uefloop) break; - c--; - while (c < 13) ffilename[c++] = 32; - ffilename[c] = 0; - - getuefbyte(); - tb = fdat; - getuefbyte(); - load = tb | (fdat << 8); - getuefbyte(); - tb = fdat; - getuefbyte(); - load |= (tb | (fdat << 8)) << 16; - - getuefbyte(); - tb = fdat; - getuefbyte(); - run = tb | (fdat << 8); - getuefbyte(); - tb = fdat; - getuefbyte(); - run |= (tb | (fdat << 8)) << 16; - - getuefbyte(); - getuefbyte(); - - getuefbyte(); - tb = fdat; - getuefbyte(); - skip = tb | (fdat << 8); - - fsize += skip; - - getuefbyte(); - status = fdat; - - if (status & 0x80) - { - sprintf(s, "%s Size %04X Load %08X Run %08X", ffilename, fsize, load, run); - cataddname(s); - fsize = 0; - } - for (c = 0; c +#include +#include +#include "b-em.h" +#include "acia.h" +#include "csw.h" +#include "uef.h" +#include "tape.h" + +int tapelcount, tapellatch, pps; +gzFile uef_f = NULL; + +int uef_toneon = 0; + +static int uef_inchunk = 0, uef_chunkid = 0, uef_chunklen = 0; +static int uef_chunkpos = 0, uef_chunkdatabits = 8; +static int uef_startchunk; +static float uef_chunkf; +static int uef_intone = 0; + +void uef_load(char *fn) +{ + int c; +// printf("OpenUEF %s %08X\n",fn,uef); + if (uef_f) + gzclose(uef_f); + uef_f = gzopen(fn, "rb"); + if (!uef_f) { /*printf("Fail!\n");*/ return; } + for (c = 0; c < 12; c++) + gzgetc(uef_f); + uef_inchunk = uef_chunklen = uef_chunkid = 0; + tapellatch = (1000000 / (1200 / 10)) / 64; + tapelcount = 0; + pps = 120; + csw_ena = 0; +// printf("Tapellatch %i\n",tapellatch); + tape_loaded = 1; +// gzseek(uef,27535,SEEK_SET); +} + +void uef_close() +{ +//printf("CloseUEF\n"); + if (uef_f) + { + gzclose(uef_f); + uef_f = NULL; + } +} + +int infilenames = 0; +int uefloop = 0; +uint8_t fdat; +int ffound; +static void uef_receive(uint8_t val) +{ + uef_toneon--; + if (infilenames) + { + ffound = 1; + fdat = val; +// rpclog("Dat %02X %c\n",val,(val<33)?'.':val); + } + else + { + acia_receive(val); +// rpclog("Dat %02X\n",val); + } +} + +void uef_poll() +{ + int c; + uint32_t templ; + float *tempf; + uint8_t temp; + if (!uef_f) + return; + if (!uef_inchunk) + { + uef_startchunk = 1; +// printf("%i ",gztell(uef)); + gzread(uef_f, &uef_chunkid, 2); + gzread(uef_f, &uef_chunklen, 4); + if (gzeof(uef_f)) + { + gzseek(uef_f, 12, SEEK_SET); + gzread(uef_f, &uef_chunkid, 2); + gzread(uef_f, &uef_chunklen, 4); + uefloop = 1; + } + uef_inchunk = 1; + uef_chunkpos = 0; +// printf("Chunk ID %04X len %i\n",uef_chunkid,uef_chunklen); + } +// else +// printf("Chunk %04X\n",uef_chunkid); + switch (uef_chunkid) + { + case 0x000: /*Origin*/ + for (c = 0; c < uef_chunklen; c++) + gzgetc(uef_f); + uef_inchunk = 0; + return; + + case 0x005: /*Target platform*/ + for (c = 0; c < uef_chunklen; c++) + gzgetc(uef_f); + uef_inchunk = 0; + return; + + case 0x100: /*Raw data*/ + if (uef_startchunk) + { + dcdlow(); + uef_startchunk = 0; + } + uef_chunklen--; + if (!uef_chunklen) + { + uef_inchunk = 0; + } + uef_receive(gzgetc(uef_f)); + return; + + case 0x104: /*Defined data*/ + if (!uef_chunkpos) + { + uef_chunkdatabits = gzgetc(uef_f); + gzgetc(uef_f); + gzgetc(uef_f); + uef_chunklen -= 3; + uef_chunkpos = 1; + } + else + { + uef_chunklen--; + if (uef_chunklen <= 0) + uef_inchunk = 0; + temp = gzgetc(uef_f); +// printf("%i : %i %02X\n",gztell(uef),uef_chunklen,temp); + if (uef_chunkdatabits == 7) uef_receive(temp & 0x7F); + else uef_receive(temp); + } + return; + + case 0x110: /*High tone*/ + uef_toneon = 2; + if (!uef_intone) + { + dcd(); + uef_intone = gzgetc(uef_f); + uef_intone |= (gzgetc(uef_f) << 8); + uef_intone /= 20; + if (!uef_intone) uef_intone = 1; +// printf("uef_intone %i\n",uef_intone); + } + else + { + uef_intone--; + if (uef_intone == 0) + { + uef_inchunk = 0; + } + } + return; + + case 0x111: /*High tone with dummy byte*/ + uef_toneon = 2; + if (!uef_intone) + { + dcd(); + uef_intone = gzgetc(uef_f); + uef_intone |= (gzgetc(uef_f)<<8); + uef_intone /= 20; + if (!uef_intone) uef_intone = 1; + } + else + { + uef_intone--; + if (uef_intone == 0 && uef_inchunk == 2) + { + uef_inchunk = 0; + } + else if (!uef_intone) + { + uef_inchunk = 2; + uef_intone = gzgetc(uef_f); + uef_intone |= (gzgetc(uef_f) << 8); + uef_intone /= 20; + if (!uef_intone) uef_intone = 1; + uef_receive(0xAA); + } + } + return; + + case 0x112: /*Gap*/ + uef_toneon = 0; + if (!uef_intone) + { +// dcd(); + uef_intone = gzgetc(uef_f); + uef_intone |= (gzgetc(uef_f) << 8); + uef_intone /= 20; +// printf("gap uef_intone %i\n",uef_intone); + if (!uef_intone) uef_intone = 1; + } + else + { + uef_intone--; + if (uef_intone == 0) + { + uef_inchunk = 0; + } + } + return; + + case 0x113: /*Float baud rate*/ + templ = gzgetc(uef_f); + templ |= (gzgetc(uef_f) << 8); + templ |= (gzgetc(uef_f) << 16); + templ |= (gzgetc(uef_f) << 24); + tempf = (float *)&templ; + tapellatch = (1000000 / ((*tempf) / 10)) / 64; + pps = (*tempf) / 10; + uef_inchunk = 0; + return; + + case 0x116: /*Float gap*/ + uef_toneon = 0; + if (!uef_chunkpos) + { + templ = gzgetc(uef_f); + templ |= (gzgetc(uef_f) << 8); + templ |= (gzgetc(uef_f) << 16); + templ |= (gzgetc(uef_f) << 24); + tempf = (float *)&templ; + uef_chunkf = *tempf; + //printf("Gap %f %i\n",uef_chunkf,pps); + uef_chunkpos = 1; +// uef_chunkf=4; + } + else + { +// printf("Gap now %f\n",uef_chunkf); + uef_chunkf -= ((float)1 / (float)pps); + if (uef_chunkf <= 0) uef_inchunk = 0; + } + return; + + case 0x114: /*Security waves*/ + case 0x115: /*Polarity change*/ +// default: + for (c = 0; c < uef_chunklen; c++) + gzgetc(uef_f); + uef_inchunk = 0; + return; + + default: + for (c = 0; c < uef_chunklen; c++) + gzgetc(uef_f); + uef_inchunk = 0; + return; +//116 : float gap +//113 : float baud rate + + } +// allegro_exit(); +// printf("Bad chunk ID %04X length %i\n",uef_chunkid,uef_chunklen); +// exit(-1); +} + +uint8_t fbuffer[4]; + +#define getuefbyte() ffound = 0; \ + while (!ffound && !uefloop) \ + { \ + uef_poll(); \ + } \ + if (uefloop) break; + +uint8_t ffilename[16]; +void uef_findfilenames() +{ + int temp; + uint8_t tb; + int c; + int fsize = 0; + char s[256]; + uint32_t run, load; + uint8_t status; + int skip; + int binchunk = uef_inchunk, bchunkid = uef_chunkid, bchunklen = uef_chunklen; + int bchunkpos = uef_chunkpos, bchunkdatabits = uef_chunkdatabits; + int bintone = uef_intone, bffound = ffound; + float bchunkf = uef_chunkf; + uint8_t bdat = fdat; + if (!uef_f) return; + + uef_inchunk = 0; uef_chunkid = 0; uef_chunklen = 0; + uef_chunkpos = 0; uef_chunkdatabits = 8; uef_intone = 0; + uef_chunkf = 0; + + startblit(); + temp=gztell(uef_f); + gzseek(uef_f, 12, SEEK_SET); + uefloop = 0; + infilenames = 1; + while (!uefloop) + { + ffound = 0; + while (!ffound && !uefloop) + { + uef_poll(); + } + if (uefloop) break; + fbuffer[0] = fbuffer[1]; + fbuffer[1] = fbuffer[2]; + fbuffer[2] = fbuffer[3]; + fbuffer[3] = fdat; + if (fdat == 0x2A && uef_toneon == 1) + { + fbuffer[3] = 0; + c = 0; + do + { + ffound = 0; + while (!ffound && !uefloop) + { + uef_poll(); + } + if (uefloop) break; + ffilename[c++] = fdat; + } while (fdat != 0x0 && c < 10); + if (uefloop) break; + c--; + while (c < 13) ffilename[c++] = 32; + ffilename[c] = 0; + + getuefbyte(); + tb = fdat; + getuefbyte(); + load = tb | (fdat << 8); + getuefbyte(); + tb = fdat; + getuefbyte(); + load |= (tb | (fdat << 8)) << 16; + + getuefbyte(); + tb = fdat; + getuefbyte(); + run = tb | (fdat << 8); + getuefbyte(); + tb = fdat; + getuefbyte(); + run |= (tb | (fdat << 8)) << 16; + + getuefbyte(); + getuefbyte(); + + getuefbyte(); + tb = fdat; + getuefbyte(); + skip = tb | (fdat << 8); + + fsize += skip; + + getuefbyte(); + status = fdat; + + if (status & 0x80) + { + sprintf(s, "%s Size %04X Load %08X Run %08X", ffilename, fsize, load, run); + cataddname(s); + fsize = 0; + } + for (c = 0; c -#include -#include "b-em.h" -#include "via.h" -#include "uservia.h" -#include "model.h" -#include "compact_joystick.h" -#include "mouse.h" - -VIA uservia; - -uint8_t lpt_dac; - -void uservia_set_ca1(int level) -{ - via_set_ca1(&uservia, level); -} -void uservia_set_ca2(int level) -{ - via_set_ca2(&uservia, level); -} -void uservia_set_cb1(int level) -{ - via_set_cb1(&uservia, level); -} -void uservia_set_cb2(int level) -{ - via_set_cb2(&uservia, level); -} - -void uservia_write_portA(uint8_t val) -{ - lpt_dac = val; /*Printer port - no printer, just 8-bit DAC*/ -} - -void uservia_write_portB(uint8_t val) -{ - /*User port - nothing emulated*/ -} - - -uint8_t uservia_read_portA() -{ - return 0xff; /*Printer port - read only*/ -} -uint8_t uservia_read_portB() -{ - if (curtube == 3 || mouse_amx) return mouse_portb; - if (compactcmos) return compact_joystick_read(); - return 0xff; /*User port - nothing emulated*/ -} - -void uservia_write(uint16_t addr, uint8_t val) -{ - via_write(&uservia, addr, val); -} - -uint8_t uservia_read(uint16_t addr) -{ - return via_read(&uservia, addr); -} - -void uservia_updatetimers() -{ - via_updatetimers(&uservia); -} - -void uservia_reset() -{ - via_reset(&uservia); - - uservia.read_portA = uservia_read_portA; - uservia.read_portB = uservia_read_portB; - - uservia.write_portA = uservia_write_portA; - uservia.write_portB = uservia_write_portB; - - uservia.intnum = 2; -} - -void dumpuservia() -{ - rpclog("T1 = %04X %04X T2 = %04X %04X\n",uservia.t1c,uservia.t1l,uservia.t2c,uservia.t2l); - rpclog("%02X %02X %02X %02X\n",uservia.ifr,uservia.ier,uservia.pcr,uservia.acr); -} - -void uservia_savestate(FILE *f) -{ - via_savestate(&uservia, f); -} - -void uservia_loadstate(FILE *f) -{ - via_loadstate(&uservia, f); -} +/*B-em v2.1 by Tom Walker + User VIA + Master 512 mouse emulation*/ + +#include +#include +#include "b-em.h" +#include "via.h" +#include "uservia.h" +#include "model.h" +#include "compact_joystick.h" +#include "mouse.h" + +VIA uservia; + +uint8_t lpt_dac; + +void uservia_set_ca1(int level) +{ + via_set_ca1(&uservia, level); +} +void uservia_set_ca2(int level) +{ + via_set_ca2(&uservia, level); +} +void uservia_set_cb1(int level) +{ + via_set_cb1(&uservia, level); +} +void uservia_set_cb2(int level) +{ + via_set_cb2(&uservia, level); +} + +void uservia_write_portA(uint8_t val) +{ + lpt_dac = val; /*Printer port - no printer, just 8-bit DAC*/ +} + +void uservia_write_portB(uint8_t val) +{ + /*User port - nothing emulated*/ +} + + +uint8_t uservia_read_portA() +{ + return 0xff; /*Printer port - read only*/ +} +uint8_t uservia_read_portB() +{ + if (curtube == 3 || mouse_amx) return mouse_portb; + if (compactcmos) return compact_joystick_read(); + return 0xff; /*User port - nothing emulated*/ +} + +void uservia_write(uint16_t addr, uint8_t val) +{ + via_write(&uservia, addr, val); +} + +uint8_t uservia_read(uint16_t addr) +{ + return via_read(&uservia, addr); +} + +void uservia_updatetimers() +{ + via_updatetimers(&uservia); +} + +void uservia_reset() +{ + via_reset(&uservia); + + uservia.read_portA = uservia_read_portA; + uservia.read_portB = uservia_read_portB; + + uservia.write_portA = uservia_write_portA; + uservia.write_portB = uservia_write_portB; + + uservia.intnum = 2; +} + +void dumpuservia() +{ + rpclog("T1 = %04X %04X T2 = %04X %04X\n",uservia.t1c,uservia.t1l,uservia.t2c,uservia.t2l); + rpclog("%02X %02X %02X %02X\n",uservia.ifr,uservia.ier,uservia.pcr,uservia.acr); +} + +void uservia_savestate(FILE *f) +{ + via_savestate(&uservia, f); +} + +void uservia_loadstate(FILE *f) +{ + via_loadstate(&uservia, f); +} diff --git a/src/uservia.h b/src/uservia.h index edb37ff7..c483afa9 100644 --- a/src/uservia.h +++ b/src/uservia.h @@ -1,16 +1,16 @@ -extern VIA uservia; - -void uservia_reset(); -void uservia_write(uint16_t addr, uint8_t val); -uint8_t uservia_read(uint16_t addr); -void uservia_updatetimers(); - -void uservia_savestate(FILE *f); -void uservia_loadstate(FILE *f); - -extern uint8_t lpt_dac; - -void uservia_set_ca1(int level); -void uservia_set_ca2(int level); -void uservia_set_cb1(int level); -void uservia_set_cb2(int level); +extern VIA uservia; + +void uservia_reset(); +void uservia_write(uint16_t addr, uint8_t val); +uint8_t uservia_read(uint16_t addr); +void uservia_updatetimers(); + +void uservia_savestate(FILE *f); +void uservia_loadstate(FILE *f); + +extern uint8_t lpt_dac; + +void uservia_set_ca1(int level); +void uservia_set_ca2(int level); +void uservia_set_cb1(int level); +void uservia_set_cb2(int level); diff --git a/src/via.c b/src/via.c index a7e12f89..0c526f6e 100644 --- a/src/via.c +++ b/src/via.c @@ -1,433 +1,433 @@ -#include "b-em.h" -#include "6502.h" -#include "via.h" - -#define INT_CA1 0x02 -#define INT_CA2 0x01 -#define INT_CB1 0x10 -#define INT_CB2 0x08 -#define INT_TIMER1 0x40 -#define INT_TIMER2 0x20 - -#define ORB 0x00 -#define ORA 0x01 -#define DDRB 0x02 -#define DDRA 0x03 -#define T1CL 0x04 -#define T1CH 0x05 -#define T1LL 0x06 -#define T1LH 0x07 -#define T2CL 0x08 -#define T2CH 0x09 -#define SR 0x0a -#define ACR 0x0b -#define PCR 0x0c -#define IFR 0x0d -#define IER 0x0e -#define ORAnh 0x0f - -void via_updateIFR(VIA *v) -{ - if ((v->ifr & 0x7F) & (v->ier & 0x7F)) - { - v->ifr |= 0x80; - interrupt |= v->intnum; - } - else - { - v->ifr &= ~0x80; - interrupt &= ~v->intnum; - } -} - -void via_updatetimers(VIA *v) -{ - if (v->t1c<-3) - { - while (v->t1c<-3) - v->t1c+=v->t1l+4; - if (!v->t1hit) - { - v->ifr |= INT_TIMER1; - via_updateIFR(v); - } - if ((v->acr & 0x80) && !v->t1hit) /*Output to PB7*/ - v->orb ^= 0x80; - if (!(v->acr & 0x40)) - v->t1hit = 1; - } - if (!(v->acr & 0x20)) - { - if (v->t2c < -3 && !v->t2hit) - { - if (!v->t2hit) - { - v->ifr |= INT_TIMER2; - via_updateIFR(v); - } - v->t2hit=1; - } - } -} - -void via_write(VIA *v, uint16_t addr, uint8_t val) -{ - switch (addr&0xF) - { - case ORA: - v->ifr &= ~INT_CA1; - if ((v->pcr & 0xA) != 0x2) /*Not independent interrupt for CA2*/ - v->ifr &= ~INT_CA2; - via_updateIFR(v); - - if ((v->pcr & 0x0E) == 0x08) /*Handshake mode*/ - { - v->set_ca2(0); - v->ca2 = 0; - } - if ((v->pcr & 0x0E) == 0x0A) /*Pulse mode*/ - { - v->set_ca2(0); - v->set_ca2(1); - v->ca2 = 1; - } - - case ORAnh: - v->write_portA((val & v->ddra) | ~v->ddra); - v->ora=val; - break; - - case ORB: - v->ifr &= ~INT_CB1; - if ((v->pcr & 0xA0) != 0x20) /*Not independent interrupt for CB2*/ - v->ifr &= ~INT_CB2; - via_updateIFR(v); - - v->write_portB((val & v->ddrb) | ~v->ddrb); - v->orb=val; - - if ((v->pcr & 0xE0) == 0x80) /*Handshake mode*/ - { - v->set_cb2(0); - v->cb2 = 0; - } - if ((v->pcr & 0xE0) == 0xA0) /*Pulse mode*/ - { - v->set_cb2(0); - v->set_cb2(1); - v->cb2 = 1; - } - break; - - case DDRA: - v->ddra = val; - v->write_portA((v->ora & v->ddra) | ~v->ddra); - break; - case DDRB: - v->ddrb = val; - v->write_portB((v->orb & v->ddrb) | ~v->ddrb); - break; - case ACR: - v->acr = val; - break; - case PCR: - v->pcr = val; - - rpclog("PCR write %04X %02X\n",addr,val); - - if ((val & 0xE) == 0xC) - { - v->set_ca2(0); - v->ca2 = 0; - } - else if (val & 0x8) - { - v->set_ca2(1); - v->ca2 = 1; - } - - if ((val & 0xE0) == 0xC0) - { - v->set_cb2(0); - v->cb2 = 0; - } - else if (val & 0x80) - { - v->set_cb2(1); - v->cb2 = 1; - } - break; - case SR: - v->sr = val; - break; - case T1LL: - case T1CL: - v->t1l &= 0x1FE00; - v->t1l |= (val<<1); - break; - case T1LH: - v->t1l &= 0x1FE; - v->t1l |= (val<<9); - if (v->acr & 0x40) - { - v->ifr &= ~INT_TIMER1; - via_updateIFR(v); - } - break; - case T1CH: - if ((v->acr & 0xC0) == 0x80) v->orb &= ~0x80; /*Lower PB7 for one-shot timer*/ - v->t1l &= 0x1FE; - v->t1l |= (val<<9); - v->t1c = v->t1l + 1; - v->t1hit = 0; - v->ifr &= ~INT_TIMER1; - via_updateIFR(v); - break; - case T2CL: - v->t2l &= 0x1FE00; - v->t2l |= (val << 1); - break; - case T2CH: - /*Fix for Kevin Edwards protection - if interrupt triggers in cycle before write then let it run*/ - if ((v->t2c == -3 && (v->ier & INT_TIMER2)) || - (v->ifr & v->ier & INT_TIMER2)) - { - interrupt |= 128; - } - v->t2l &= 0x1FE; - v->t2l |= (val << 9); - v->t2c = v->t2l + 1; - v->ifr &= ~INT_TIMER2; - via_updateIFR(v); - v->t2hit=0; - break; - case IER: - if (val & 0x80) - v->ier |= (val&0x7F); - else - v->ier &= ~(val&0x7F); - via_updateIFR(v); - break; - case IFR: - v->ifr &= ~(val & 0x7F); - via_updateIFR(v); - break; - } -} - -uint8_t via_read(VIA *v, uint16_t addr) -{ - uint8_t temp; - switch (addr&0xF) - { - case ORA: - v->ifr &= ~INT_CA1; - if ((v->pcr & 0xA) != 0x2) /*Not independent interrupt for CA2*/ - v->ifr &= ~INT_CA2; - via_updateIFR(v); - case ORAnh: - temp=v->ora & v->ddra; - if (v->acr & 1) - temp|=(v->ira & ~v->ddra); /*Read latch*/ - else - temp|=(v->read_portA() & ~v->ddra); /*Read current port values*/ - return temp; - - case ORB: - v->ifr &= ~INT_CB1; - if ((v->pcr & 0xA0) != 0x20) /*Not independent interrupt for CB2*/ - v->ifr &= ~INT_CB2; - via_updateIFR(v); - - temp=v->orb & v->ddrb; - if (v->acr & 2) - temp|=(v->irb & ~v->ddrb); /*Read latch*/ - else - temp|=(v->read_portB() & ~v->ddrb); /*Read current port values*/ - return temp; - - case DDRA: - return v->ddra; - - case DDRB: - return v->ddrb; - - case T1LL: - return (v->t1l & 0x1FE) >> 1; - - case T1LH: - return v->t1l >> 9; - - case T1CL: - v->ifr &= ~INT_TIMER1; - via_updateIFR(v); - if (v->t1c < -1) return 0xFF; /*Return 0xFF during reload*/ - return ((v->t1c + 1) >> 1) & 0xFF; - - case T1CH: - if (v->t1c<-1) return 0xFF; /*Return 0xFF during reload*/ - return (v->t1c+1)>>9; - - case T2CL: - v->ifr &= ~INT_TIMER2; - via_updateIFR(v); - return ((v->t2c + 1) >> 1) & 0xFF; - - case T2CH: - return (v->t2c+1)>>9; - - case SR: - return v->sr; - - case ACR: - return v->acr; - - case PCR: - return v->pcr; - - case IER: - return v->ier | 0x80; - - case IFR: - return v->ifr; - } - return 0xFE; -} - -void via_set_ca1(VIA *v, int level) -{ - if (level == v->ca1) return; - if (((v->pcr & 0x01) && level) || (!(v->pcr & 0x01) && !level)) - { - if (v->acr & 0x01) v->ira = v->read_portA(); /*Latch port A*/ - v->ifr |= INT_CA1; - via_updateIFR(v); - if ((v->pcr & 0x0C) == 0x08) /*Handshaking mode*/ - { - v->ca2 = 1; - v->set_ca2(1); - } - } - v->ca1 = level; -} - -void via_set_ca2(VIA *v, int level) -{ - if (level == v->ca2) return; - if (v->pcr & 0x08) return; /*Output mode*/ - if (((v->pcr & 0x04) && level) || (!(v->pcr & 0x04) && !level)) - { - v->ifr |= INT_CA2; - via_updateIFR(v); - } - v->ca2 = level; -} - -void via_set_cb1(VIA *v, int level) -{ - if (level == v->cb1) return; - if (((v->pcr & 0x10) && level) || (!(v->pcr & 0x10) && !level)) - { - if (v->acr & 0x02) v->irb = v->read_portB(); /*Latch port B*/ - v->ifr |= INT_CB1; - via_updateIFR(v); - if ((v->pcr & 0xC0) == 0x80) /*Handshaking mode*/ - { - v->cb2 = 1; - v->set_cb2(1); - } - } - v->cb1 = level; -} - -void via_set_cb2(VIA *v, int level) -{ - if (level == v->cb2) return; - if (v->pcr & 0x80) return; /*Output mode*/ - if (((v->pcr & 0x40) && level) || (!(v->pcr & 0x40) && !level)) - { - v->ifr |= INT_CB2; - via_updateIFR(v); - } - v->cb2 = level; -} - - -uint8_t via_read_null() -{ - return 0xFF; -} - -void via_write_null(uint8_t val) -{ -} - -void via_set_null(int level) -{ -} - -void via_reset(VIA *v) -{ - v->ora = v->orb = 0xFF; - v->ddra = v->ddrb = 0xFF; - v->ifr = v->ier = 0; - v->t1c = v->t1l = 0x1FFFE; - v->t2c = v->t2l = 0x1FFFE; - v->t1hit = v->t2hit = 1; - v->acr = v->pcr = 0; - - v->read_portA = v->read_portB = via_read_null; - v->write_portA = v->write_portB = via_write_null; - - v->set_ca1 = v->set_ca2 = v->set_cb1 = v->set_cb2 = via_set_null; -} - -void via_savestate(VIA *v, FILE *f) -{ - putc(v->ora,f); - putc(v->orb,f); - putc(v->ira,f); - putc(v->irb,f); - putc(v->read_portA(),f); - putc(v->read_portA(),f); - putc(v->ddra,f); - putc(v->ddrb,f); - putc(v->sr,f); - putc(v->acr,f); - putc(v->pcr,f); - putc(v->ifr,f); - putc(v->ier,f); - putc(v->t1l,f); putc(v->t1l>>8,f); putc(v->t1l>>16,f); putc(v->t1l>>24,f); - putc(v->t2l,f); putc(v->t2l>>8,f); putc(v->t2l>>16,f); putc(v->t2l>>24,f); - putc(v->t1c,f); putc(v->t1c>>8,f); putc(v->t1c>>16,f); putc(v->t1c>>24,f); - putc(v->t2c,f); putc(v->t2c>>8,f); putc(v->t2c>>16,f); putc(v->t2c>>24,f); - putc(v->t1hit,f); - putc(v->t2hit,f); - putc(v->ca1,f); - putc(v->ca2,f); -} - -void via_loadstate(VIA *v, FILE *f) -{ - v->ora=getc(f); - v->orb=getc(f); - v->ira=getc(f); - v->irb=getc(f); - /*v->porta=*/getc(f); - /*v->portb=*/getc(f); - v->ddra=getc(f); - v->ddrb=getc(f); - v->sr=getc(f); - v->acr=getc(f); - v->pcr=getc(f); - v->ifr=getc(f); - v->ier=getc(f); - v->t1l=getc(f); v->t1l|=getc(f)<<8; v->t1l|=getc(f)<<16; v->t1l|=getc(f)<<24; - v->t2l=getc(f); v->t2l|=getc(f)<<8; v->t2l|=getc(f)<<16; v->t2l|=getc(f)<<24; - v->t1c=getc(f); v->t1c|=getc(f)<<8; v->t1c|=getc(f)<<16; v->t1c|=getc(f)<<24; - v->t2c=getc(f); v->t2c|=getc(f)<<8; v->t2c|=getc(f)<<16; v->t2c|=getc(f)<<24; - v->t1hit=getc(f); - v->t2hit=getc(f); - v->ca1=getc(f); - v->ca2=getc(f); -} +#include "b-em.h" +#include "6502.h" +#include "via.h" + +#define INT_CA1 0x02 +#define INT_CA2 0x01 +#define INT_CB1 0x10 +#define INT_CB2 0x08 +#define INT_TIMER1 0x40 +#define INT_TIMER2 0x20 + +#define ORB 0x00 +#define ORA 0x01 +#define DDRB 0x02 +#define DDRA 0x03 +#define T1CL 0x04 +#define T1CH 0x05 +#define T1LL 0x06 +#define T1LH 0x07 +#define T2CL 0x08 +#define T2CH 0x09 +#define SR 0x0a +#define ACR 0x0b +#define PCR 0x0c +#define IFR 0x0d +#define IER 0x0e +#define ORAnh 0x0f + +void via_updateIFR(VIA *v) +{ + if ((v->ifr & 0x7F) & (v->ier & 0x7F)) + { + v->ifr |= 0x80; + interrupt |= v->intnum; + } + else + { + v->ifr &= ~0x80; + interrupt &= ~v->intnum; + } +} + +void via_updatetimers(VIA *v) +{ + if (v->t1c<-3) + { + while (v->t1c<-3) + v->t1c+=v->t1l+4; + if (!v->t1hit) + { + v->ifr |= INT_TIMER1; + via_updateIFR(v); + } + if ((v->acr & 0x80) && !v->t1hit) /*Output to PB7*/ + v->orb ^= 0x80; + if (!(v->acr & 0x40)) + v->t1hit = 1; + } + if (!(v->acr & 0x20)) + { + if (v->t2c < -3 && !v->t2hit) + { + if (!v->t2hit) + { + v->ifr |= INT_TIMER2; + via_updateIFR(v); + } + v->t2hit=1; + } + } +} + +void via_write(VIA *v, uint16_t addr, uint8_t val) +{ + switch (addr&0xF) + { + case ORA: + v->ifr &= ~INT_CA1; + if ((v->pcr & 0xA) != 0x2) /*Not independent interrupt for CA2*/ + v->ifr &= ~INT_CA2; + via_updateIFR(v); + + if ((v->pcr & 0x0E) == 0x08) /*Handshake mode*/ + { + v->set_ca2(0); + v->ca2 = 0; + } + if ((v->pcr & 0x0E) == 0x0A) /*Pulse mode*/ + { + v->set_ca2(0); + v->set_ca2(1); + v->ca2 = 1; + } + + case ORAnh: + v->write_portA((val & v->ddra) | ~v->ddra); + v->ora=val; + break; + + case ORB: + v->ifr &= ~INT_CB1; + if ((v->pcr & 0xA0) != 0x20) /*Not independent interrupt for CB2*/ + v->ifr &= ~INT_CB2; + via_updateIFR(v); + + v->write_portB((val & v->ddrb) | ~v->ddrb); + v->orb=val; + + if ((v->pcr & 0xE0) == 0x80) /*Handshake mode*/ + { + v->set_cb2(0); + v->cb2 = 0; + } + if ((v->pcr & 0xE0) == 0xA0) /*Pulse mode*/ + { + v->set_cb2(0); + v->set_cb2(1); + v->cb2 = 1; + } + break; + + case DDRA: + v->ddra = val; + v->write_portA((v->ora & v->ddra) | ~v->ddra); + break; + case DDRB: + v->ddrb = val; + v->write_portB((v->orb & v->ddrb) | ~v->ddrb); + break; + case ACR: + v->acr = val; + break; + case PCR: + v->pcr = val; + + rpclog("PCR write %04X %02X\n",addr,val); + + if ((val & 0xE) == 0xC) + { + v->set_ca2(0); + v->ca2 = 0; + } + else if (val & 0x8) + { + v->set_ca2(1); + v->ca2 = 1; + } + + if ((val & 0xE0) == 0xC0) + { + v->set_cb2(0); + v->cb2 = 0; + } + else if (val & 0x80) + { + v->set_cb2(1); + v->cb2 = 1; + } + break; + case SR: + v->sr = val; + break; + case T1LL: + case T1CL: + v->t1l &= 0x1FE00; + v->t1l |= (val<<1); + break; + case T1LH: + v->t1l &= 0x1FE; + v->t1l |= (val<<9); + if (v->acr & 0x40) + { + v->ifr &= ~INT_TIMER1; + via_updateIFR(v); + } + break; + case T1CH: + if ((v->acr & 0xC0) == 0x80) v->orb &= ~0x80; /*Lower PB7 for one-shot timer*/ + v->t1l &= 0x1FE; + v->t1l |= (val<<9); + v->t1c = v->t1l + 1; + v->t1hit = 0; + v->ifr &= ~INT_TIMER1; + via_updateIFR(v); + break; + case T2CL: + v->t2l &= 0x1FE00; + v->t2l |= (val << 1); + break; + case T2CH: + /*Fix for Kevin Edwards protection - if interrupt triggers in cycle before write then let it run*/ + if ((v->t2c == -3 && (v->ier & INT_TIMER2)) || + (v->ifr & v->ier & INT_TIMER2)) + { + interrupt |= 128; + } + v->t2l &= 0x1FE; + v->t2l |= (val << 9); + v->t2c = v->t2l + 1; + v->ifr &= ~INT_TIMER2; + via_updateIFR(v); + v->t2hit=0; + break; + case IER: + if (val & 0x80) + v->ier |= (val&0x7F); + else + v->ier &= ~(val&0x7F); + via_updateIFR(v); + break; + case IFR: + v->ifr &= ~(val & 0x7F); + via_updateIFR(v); + break; + } +} + +uint8_t via_read(VIA *v, uint16_t addr) +{ + uint8_t temp; + switch (addr&0xF) + { + case ORA: + v->ifr &= ~INT_CA1; + if ((v->pcr & 0xA) != 0x2) /*Not independent interrupt for CA2*/ + v->ifr &= ~INT_CA2; + via_updateIFR(v); + case ORAnh: + temp=v->ora & v->ddra; + if (v->acr & 1) + temp|=(v->ira & ~v->ddra); /*Read latch*/ + else + temp|=(v->read_portA() & ~v->ddra); /*Read current port values*/ + return temp; + + case ORB: + v->ifr &= ~INT_CB1; + if ((v->pcr & 0xA0) != 0x20) /*Not independent interrupt for CB2*/ + v->ifr &= ~INT_CB2; + via_updateIFR(v); + + temp=v->orb & v->ddrb; + if (v->acr & 2) + temp|=(v->irb & ~v->ddrb); /*Read latch*/ + else + temp|=(v->read_portB() & ~v->ddrb); /*Read current port values*/ + return temp; + + case DDRA: + return v->ddra; + + case DDRB: + return v->ddrb; + + case T1LL: + return (v->t1l & 0x1FE) >> 1; + + case T1LH: + return v->t1l >> 9; + + case T1CL: + v->ifr &= ~INT_TIMER1; + via_updateIFR(v); + if (v->t1c < -1) return 0xFF; /*Return 0xFF during reload*/ + return ((v->t1c + 1) >> 1) & 0xFF; + + case T1CH: + if (v->t1c<-1) return 0xFF; /*Return 0xFF during reload*/ + return (v->t1c+1)>>9; + + case T2CL: + v->ifr &= ~INT_TIMER2; + via_updateIFR(v); + return ((v->t2c + 1) >> 1) & 0xFF; + + case T2CH: + return (v->t2c+1)>>9; + + case SR: + return v->sr; + + case ACR: + return v->acr; + + case PCR: + return v->pcr; + + case IER: + return v->ier | 0x80; + + case IFR: + return v->ifr; + } + return 0xFE; +} + +void via_set_ca1(VIA *v, int level) +{ + if (level == v->ca1) return; + if (((v->pcr & 0x01) && level) || (!(v->pcr & 0x01) && !level)) + { + if (v->acr & 0x01) v->ira = v->read_portA(); /*Latch port A*/ + v->ifr |= INT_CA1; + via_updateIFR(v); + if ((v->pcr & 0x0C) == 0x08) /*Handshaking mode*/ + { + v->ca2 = 1; + v->set_ca2(1); + } + } + v->ca1 = level; +} + +void via_set_ca2(VIA *v, int level) +{ + if (level == v->ca2) return; + if (v->pcr & 0x08) return; /*Output mode*/ + if (((v->pcr & 0x04) && level) || (!(v->pcr & 0x04) && !level)) + { + v->ifr |= INT_CA2; + via_updateIFR(v); + } + v->ca2 = level; +} + +void via_set_cb1(VIA *v, int level) +{ + if (level == v->cb1) return; + if (((v->pcr & 0x10) && level) || (!(v->pcr & 0x10) && !level)) + { + if (v->acr & 0x02) v->irb = v->read_portB(); /*Latch port B*/ + v->ifr |= INT_CB1; + via_updateIFR(v); + if ((v->pcr & 0xC0) == 0x80) /*Handshaking mode*/ + { + v->cb2 = 1; + v->set_cb2(1); + } + } + v->cb1 = level; +} + +void via_set_cb2(VIA *v, int level) +{ + if (level == v->cb2) return; + if (v->pcr & 0x80) return; /*Output mode*/ + if (((v->pcr & 0x40) && level) || (!(v->pcr & 0x40) && !level)) + { + v->ifr |= INT_CB2; + via_updateIFR(v); + } + v->cb2 = level; +} + + +uint8_t via_read_null() +{ + return 0xFF; +} + +void via_write_null(uint8_t val) +{ +} + +void via_set_null(int level) +{ +} + +void via_reset(VIA *v) +{ + v->ora = v->orb = 0xFF; + v->ddra = v->ddrb = 0xFF; + v->ifr = v->ier = 0; + v->t1c = v->t1l = 0x1FFFE; + v->t2c = v->t2l = 0x1FFFE; + v->t1hit = v->t2hit = 1; + v->acr = v->pcr = 0; + + v->read_portA = v->read_portB = via_read_null; + v->write_portA = v->write_portB = via_write_null; + + v->set_ca1 = v->set_ca2 = v->set_cb1 = v->set_cb2 = via_set_null; +} + +void via_savestate(VIA *v, FILE *f) +{ + putc(v->ora,f); + putc(v->orb,f); + putc(v->ira,f); + putc(v->irb,f); + putc(v->read_portA(),f); + putc(v->read_portA(),f); + putc(v->ddra,f); + putc(v->ddrb,f); + putc(v->sr,f); + putc(v->acr,f); + putc(v->pcr,f); + putc(v->ifr,f); + putc(v->ier,f); + putc(v->t1l,f); putc(v->t1l>>8,f); putc(v->t1l>>16,f); putc(v->t1l>>24,f); + putc(v->t2l,f); putc(v->t2l>>8,f); putc(v->t2l>>16,f); putc(v->t2l>>24,f); + putc(v->t1c,f); putc(v->t1c>>8,f); putc(v->t1c>>16,f); putc(v->t1c>>24,f); + putc(v->t2c,f); putc(v->t2c>>8,f); putc(v->t2c>>16,f); putc(v->t2c>>24,f); + putc(v->t1hit,f); + putc(v->t2hit,f); + putc(v->ca1,f); + putc(v->ca2,f); +} + +void via_loadstate(VIA *v, FILE *f) +{ + v->ora=getc(f); + v->orb=getc(f); + v->ira=getc(f); + v->irb=getc(f); + /*v->porta=*/getc(f); + /*v->portb=*/getc(f); + v->ddra=getc(f); + v->ddrb=getc(f); + v->sr=getc(f); + v->acr=getc(f); + v->pcr=getc(f); + v->ifr=getc(f); + v->ier=getc(f); + v->t1l=getc(f); v->t1l|=getc(f)<<8; v->t1l|=getc(f)<<16; v->t1l|=getc(f)<<24; + v->t2l=getc(f); v->t2l|=getc(f)<<8; v->t2l|=getc(f)<<16; v->t2l|=getc(f)<<24; + v->t1c=getc(f); v->t1c|=getc(f)<<8; v->t1c|=getc(f)<<16; v->t1c|=getc(f)<<24; + v->t2c=getc(f); v->t2c|=getc(f)<<8; v->t2c|=getc(f)<<16; v->t2c|=getc(f)<<24; + v->t1hit=getc(f); + v->t2hit=getc(f); + v->ca1=getc(f); + v->ca2=getc(f); +} diff --git a/src/via.h b/src/via.h index 1f79ca27..b89d910d 100644 --- a/src/via.h +++ b/src/via.h @@ -1,35 +1,35 @@ -typedef struct VIA -{ - uint8_t ora, orb, ira, irb; - uint8_t ddra, ddrb; - uint8_t sr; - uint32_t t1l, t2l; - int t1c, t2c; - uint8_t acr, pcr, ifr, ier; - int t1hit, t2hit; - int ca1, ca2, cb1, cb2; - int intnum; - - uint8_t (*read_portA)(); - uint8_t (*read_portB)(); - void (*write_portA)(uint8_t val); - void (*write_portB)(uint8_t val); - - void (*set_ca1)(int level); - void (*set_ca2)(int level); - void (*set_cb1)(int level); - void (*set_cb2)(int level); -} VIA; - -uint8_t via_read(VIA *v, uint16_t addr); -void via_write(VIA *v, uint16_t addr, uint8_t val); -void via_reset(VIA *v); -void via_updatetimers(VIA *v); - -void via_set_ca1(VIA *v, int level); -void via_set_ca2(VIA *v, int level); -void via_set_cb1(VIA *v, int level); -void via_set_cb2(VIA *v, int level); - -void via_savestate(VIA *v, FILE *f); -void via_loadstate(VIA *v, FILE *f); +typedef struct VIA +{ + uint8_t ora, orb, ira, irb; + uint8_t ddra, ddrb; + uint8_t sr; + uint32_t t1l, t2l; + int t1c, t2c; + uint8_t acr, pcr, ifr, ier; + int t1hit, t2hit; + int ca1, ca2, cb1, cb2; + int intnum; + + uint8_t (*read_portA)(); + uint8_t (*read_portB)(); + void (*write_portA)(uint8_t val); + void (*write_portB)(uint8_t val); + + void (*set_ca1)(int level); + void (*set_ca2)(int level); + void (*set_cb1)(int level); + void (*set_cb2)(int level); +} VIA; + +uint8_t via_read(VIA *v, uint16_t addr); +void via_write(VIA *v, uint16_t addr, uint8_t val); +void via_reset(VIA *v); +void via_updatetimers(VIA *v); + +void via_set_ca1(VIA *v, int level); +void via_set_ca2(VIA *v, int level); +void via_set_cb1(VIA *v, int level); +void via_set_cb2(VIA *v, int level); + +void via_savestate(VIA *v, FILE *f); +void via_loadstate(VIA *v, FILE *f); diff --git a/src/vidalleg.c b/src/vidalleg.c index f2a5262e..d8833237 100644 --- a/src/vidalleg.c +++ b/src/vidalleg.c @@ -1,252 +1,252 @@ -/*B-em v2.2 by Tom Walker - Allegro video code*/ -#include -#include "b-em.h" -#ifdef WIN32 -#include "pal.h" -#endif -#include "serial.h" -#include "tape.h" -#include "video.h" -#include "video_render.h" - -int vid_interlace, vid_linedbl, vid_pal, vid_scanlines; -int vid_fskipmax = 3; -int vid_fullborders = 1; - -static int fskipcount; - -int vid_savescrshot = 0; -char vid_scrshotname[260]; - -static BITMAP *scrshotb, *scrshotb2; - -int vid_clear = 0; - -void video_clearscreen() -{ - set_color_depth(dcol); - #ifdef WIN32 - clear(vb); - #endif - clear(b16); - clear(b16x); - clear(b32); - clear(screen); - set_color_depth(8); - clear_to_color(b, 0); -} - -void video_close() -{ - destroy_bitmap(b32); - destroy_bitmap(b16x); - destroy_bitmap(b16); - destroy_bitmap(b); - #ifdef WIN32 - destroy_bitmap(vb); - #endif -} - -void video_enterfullscreen() -{ - #ifdef WIN32 - destroy_bitmap(vb); - #endif - set_color_depth(dcol); - set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 800, 600, 0, 0); - #ifdef WIN32 - vb=create_video_bitmap(924, 614); - #endif - set_color_depth(8); - set_palette(pal); -} -void video_leavefullscreen() -{ - #ifdef WIN32 - destroy_bitmap(vb); - #endif - set_color_depth(dcol); -#ifdef WIN32 - set_gfx_mode(GFX_AUTODETECT_WINDOWED, 2048, 2048, 0, 0); -#else - set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0); -#endif - #ifdef WIN32 - vb=create_video_bitmap(924, 614); - #endif - set_color_depth(8); - set_palette(pal); - updatewindowsize(640, 480); -} - -void video_doblit() -{ - int c; -// printf("%03i %03i %03i %03i\n",firstx,lastx,firsty,lasty); -//rpclog("Blit\n"); - - startblit(); - -// printf("Blit\n"); - if (vid_savescrshot) - { - vid_savescrshot--; - if (!vid_savescrshot) - { - set_color_depth(dcol); - scrshotb = create_bitmap(lastx - firstx, (lasty-firsty) << 1); - scrshotb2 = create_bitmap(lastx - firstx, lasty-firsty); - if (vid_interlace || vid_linedbl) - { - blit(b, scrshotb, firstx, firsty << 1, 0, 0, lastx - firstx, (lasty - firsty) << 1); - } - else - { - blit(b, scrshotb2, firstx, firsty, 0, 0, lastx - firstx, lasty - firsty); - stretch_blit(scrshotb2, scrshotb, 0, 0, lastx - firstx, lasty - firsty, 0, 0, lastx - firstx,(lasty - firsty) << 1); - } - save_bmp(vid_scrshotname, scrshotb, NULL); - destroy_bitmap(scrshotb2); - destroy_bitmap(scrshotb); - set_color_depth(8); - } - } - - fskipcount++; - if (fskipcount >= ((motor && fasttape) ? 5 : vid_fskipmax)) - { -// rpclog("Blit start\n"); - lasty++; - if (vid_fullborders == 1) - { -// rpclog("%i %i %i %i ",firstx,lastx,firsty,lasty); -/* c = (lastx + firstx) / 2; - firstx = c - 336; - lastx = c + 336; - c = (lasty + firsty) / 2; - firsty = c - 136; - lasty = c + 136;*/ -// rpclog(" %i %i %i %i\n",firstx,lastx,firsty,lasty); - - firstx = 320; - lastx = 992; - firsty = 24; - lasty = 296; - - } - else if (vid_fullborders == 2) - { - firstx = 240; - lastx = 240 + 832; - firsty = 8; - lasty = 312; - } - if (fullscreen) - { - firstx = 256; - lastx = 256 + 800; - firsty = 8; - lasty = 300; - } - if (videoresize && !fullscreen) - { - fskipcount = 0; - if (vid_scanlines) - { - #ifdef WIN32 - for (c = firsty; c < lasty; c++) blit(b, b16x, firstx, c, 0, c << 1, lastx - firstx, 1); - blit(b16x, vb, 0, firsty << 1, 0, 0, lastx - firstx, (lasty - firsty) << 1); - stretch_blit(vb, screen, 0, 0, lastx - firstx, (lasty - firsty) << 1, 0, 0, winsizex, winsizey); - #else - blit(b, b16x, firstx, firsty, 0, 0, lastx - firstx, lasty - firsty); - for (c = firsty; c < lasty; c++) blit(b16x, screen, 0, c - firsty, 0, (c - firsty) << 1, lastx - firstx, 1); - #endif - } - #ifdef WIN32 - else if (vid_interlace && vid_pal) - { - pal_convert(b, firstx, (firsty << 1) + (interlline ? 1 : 0), lastx, (lasty << 1) + (interlline ? 1 : 0), 2); - blit(b32, vb, (firstx * 922) / 832, firsty << 1, 0,0, ((lastx - firstx) * 922) / 832, (lasty - firsty) << 1); - stretch_blit(vb, screen, 0, 0, ((lastx - firstx) * 922) / 832, (lasty - firsty) << 1, 0, 0, winsizex, winsizey); - } - else if (vid_pal) - { - pal_convert(b, firstx, firsty, lastx, lasty, 1); - blit(b32, vb, (firstx * 922) / 832, firsty, 0,0, ((lastx - firstx) * 922) / 832, lasty - firsty); - stretch_blit(vb, screen, 0, 0, ((lastx - firstx) * 922) / 832, lasty-firsty, 0, 0, winsizex, winsizey); - } - #endif - else if (vid_interlace || vid_linedbl) - { - #ifdef WIN32 - blit(b, vb, firstx, firsty << 1, 0, 0, lastx - firstx, (lasty - firsty) << 1); - stretch_blit(vb, screen, 0, 0, lastx - firstx, (lasty - firsty) << 1, 0, 0, winsizex, winsizey); - #else - blit(b, screen, firstx, firsty << 1, 0, 0, lastx - firstx, (lasty - firsty) << 1); - #endif - } - else - { - #ifdef WIN32 - blit(b, vb, firstx, firsty, 0, 0, lastx - firstx, lasty - firsty); - stretch_blit(vb, screen, 0, 0, lastx - firstx, lasty - firsty, 0, 0, winsizex, winsizey); - #else - for (c = (firsty << 1); c < (lasty << 1); c++) blit(b, b16x, firstx, c >> 1, 0, c, lastx - firstx, 1); - blit(b16x, screen, 0, firsty << 1, 0, 0, lastx - firstx, (lasty - firsty) << 1); - #endif - } - } - else - { - if (!fullscreen) updatewindowsize((lastx - firstx) + 2, ((lasty - firsty) << 1) + 2); - fskipcount = 0; - if (vid_scanlines) - { - #ifdef WIN32 - for (c = firsty; c < lasty; c++) blit(b, b16x, firstx, c, 0, c << 1, lastx - firstx, 1); - blit(b16x, screen, 0, firsty << 1, 0, 0, lastx - firstx, (lasty - firsty) << 1); - #else - blit(b, b16x, firstx, firsty, 0, 0, lastx - firstx, lasty - firsty); - for (c = firsty; c < lasty; c++) blit(b16x, screen, 0, c - firsty, 0, (c - firsty) << 1, lastx - firstx, 1); - #endif - } - #ifdef WIN32 - else if (vid_interlace && vid_pal) - { - pal_convert(b, firstx, (firsty << 1) + (interlline ? 1 : 0), lastx, (lasty << 1) + (interlline ? 1 : 0), 2); - blit(b32, vb, (firstx * 922) / 832, firsty << 1, 0,0, ((lastx - firstx) * 922) / 832, (lasty - firsty) << 1); - stretch_blit(vb, screen, 0, 0, ((lastx - firstx) * 922) / 832, (lasty - firsty) << 1, 0, 0, (lastx - firstx), (lasty - firsty) << 1); - } - else if (vid_pal) - { - pal_convert(b, firstx, firsty, lastx, lasty, 1); - blit(b32, vb, (firstx * 922) / 832, firsty, 0,0, ((lastx - firstx) * 922) / 832, lasty - firsty); - stretch_blit(vb, screen, 0, 0, ((lastx - firstx) * 922) / 832, lasty-firsty, 0, 0, (lastx - firstx), (lasty - firsty) << 1); - } - #endif - else if (vid_interlace || vid_linedbl) - { - //rpclog("Blit %i,%i %i,%i\n", firstx, firsty << 1, lastx - firstx, (lasty - firsty) << 1); - blit(b, screen, firstx, firsty << 1, 0, 0, lastx - firstx, (lasty - firsty) << 1); - } - else - { - #ifdef WIN32 - blit(b, vb, firstx, firsty, 0, 0, lastx - firstx, lasty - firsty); - stretch_blit(vb, screen, 0, 0, lastx - firstx, lasty - firsty, 0, 0, lastx - firstx, (lasty - firsty) << 1); - #else - for (c = (firsty << 1); c < (lasty << 1); c++) blit(b, b16x, firstx, c >> 1, 0, c, lastx - firstx, 1); - blit(b16x, screen, 0, firsty << 1, 0, 0, lastx - firstx, (lasty - firsty) << 1); - #endif - } - if (fullscreen) - rectfill(screen, 0, 584, 799, 599, 0); - } -// rpclog("Blit end\n"); -// textprintf(screen,font,0,0,makecol(255,255,255),"%08X",uefpos()); - } - firstx = firsty = 65535; - lastx = lasty = 0; - endblit(); -} +/*B-em v2.2 by Tom Walker + Allegro video code*/ +#include +#include "b-em.h" +#ifdef WIN32 +#include "pal.h" +#endif +#include "serial.h" +#include "tape.h" +#include "video.h" +#include "video_render.h" + +int vid_interlace, vid_linedbl, vid_pal, vid_scanlines; +int vid_fskipmax = 3; +int vid_fullborders = 1; + +static int fskipcount; + +int vid_savescrshot = 0; +char vid_scrshotname[260]; + +static BITMAP *scrshotb, *scrshotb2; + +int vid_clear = 0; + +void video_clearscreen() +{ + set_color_depth(dcol); + #ifdef WIN32 + clear(vb); + #endif + clear(b16); + clear(b16x); + clear(b32); + clear(screen); + set_color_depth(8); + clear_to_color(b, 0); +} + +void video_close() +{ + destroy_bitmap(b32); + destroy_bitmap(b16x); + destroy_bitmap(b16); + destroy_bitmap(b); + #ifdef WIN32 + destroy_bitmap(vb); + #endif +} + +void video_enterfullscreen() +{ + #ifdef WIN32 + destroy_bitmap(vb); + #endif + set_color_depth(dcol); + set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 800, 600, 0, 0); + #ifdef WIN32 + vb=create_video_bitmap(924, 614); + #endif + set_color_depth(8); + set_palette(pal); +} +void video_leavefullscreen() +{ + #ifdef WIN32 + destroy_bitmap(vb); + #endif + set_color_depth(dcol); +#ifdef WIN32 + set_gfx_mode(GFX_AUTODETECT_WINDOWED, 2048, 2048, 0, 0); +#else + set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0); +#endif + #ifdef WIN32 + vb=create_video_bitmap(924, 614); + #endif + set_color_depth(8); + set_palette(pal); + updatewindowsize(640, 480); +} + +void video_doblit() +{ + int c; +// printf("%03i %03i %03i %03i\n",firstx,lastx,firsty,lasty); +//rpclog("Blit\n"); + + startblit(); + +// printf("Blit\n"); + if (vid_savescrshot) + { + vid_savescrshot--; + if (!vid_savescrshot) + { + set_color_depth(dcol); + scrshotb = create_bitmap(lastx - firstx, (lasty-firsty) << 1); + scrshotb2 = create_bitmap(lastx - firstx, lasty-firsty); + if (vid_interlace || vid_linedbl) + { + blit(b, scrshotb, firstx, firsty << 1, 0, 0, lastx - firstx, (lasty - firsty) << 1); + } + else + { + blit(b, scrshotb2, firstx, firsty, 0, 0, lastx - firstx, lasty - firsty); + stretch_blit(scrshotb2, scrshotb, 0, 0, lastx - firstx, lasty - firsty, 0, 0, lastx - firstx,(lasty - firsty) << 1); + } + save_bmp(vid_scrshotname, scrshotb, NULL); + destroy_bitmap(scrshotb2); + destroy_bitmap(scrshotb); + set_color_depth(8); + } + } + + fskipcount++; + if (fskipcount >= ((motor && fasttape) ? 5 : vid_fskipmax)) + { +// rpclog("Blit start\n"); + lasty++; + if (vid_fullborders == 1) + { +// rpclog("%i %i %i %i ",firstx,lastx,firsty,lasty); +/* c = (lastx + firstx) / 2; + firstx = c - 336; + lastx = c + 336; + c = (lasty + firsty) / 2; + firsty = c - 136; + lasty = c + 136;*/ +// rpclog(" %i %i %i %i\n",firstx,lastx,firsty,lasty); + + firstx = 320; + lastx = 992; + firsty = 24; + lasty = 296; + + } + else if (vid_fullborders == 2) + { + firstx = 240; + lastx = 240 + 832; + firsty = 8; + lasty = 312; + } + if (fullscreen) + { + firstx = 256; + lastx = 256 + 800; + firsty = 8; + lasty = 300; + } + if (videoresize && !fullscreen) + { + fskipcount = 0; + if (vid_scanlines) + { + #ifdef WIN32 + for (c = firsty; c < lasty; c++) blit(b, b16x, firstx, c, 0, c << 1, lastx - firstx, 1); + blit(b16x, vb, 0, firsty << 1, 0, 0, lastx - firstx, (lasty - firsty) << 1); + stretch_blit(vb, screen, 0, 0, lastx - firstx, (lasty - firsty) << 1, 0, 0, winsizex, winsizey); + #else + blit(b, b16x, firstx, firsty, 0, 0, lastx - firstx, lasty - firsty); + for (c = firsty; c < lasty; c++) blit(b16x, screen, 0, c - firsty, 0, (c - firsty) << 1, lastx - firstx, 1); + #endif + } + #ifdef WIN32 + else if (vid_interlace && vid_pal) + { + pal_convert(b, firstx, (firsty << 1) + (interlline ? 1 : 0), lastx, (lasty << 1) + (interlline ? 1 : 0), 2); + blit(b32, vb, (firstx * 922) / 832, firsty << 1, 0,0, ((lastx - firstx) * 922) / 832, (lasty - firsty) << 1); + stretch_blit(vb, screen, 0, 0, ((lastx - firstx) * 922) / 832, (lasty - firsty) << 1, 0, 0, winsizex, winsizey); + } + else if (vid_pal) + { + pal_convert(b, firstx, firsty, lastx, lasty, 1); + blit(b32, vb, (firstx * 922) / 832, firsty, 0,0, ((lastx - firstx) * 922) / 832, lasty - firsty); + stretch_blit(vb, screen, 0, 0, ((lastx - firstx) * 922) / 832, lasty-firsty, 0, 0, winsizex, winsizey); + } + #endif + else if (vid_interlace || vid_linedbl) + { + #ifdef WIN32 + blit(b, vb, firstx, firsty << 1, 0, 0, lastx - firstx, (lasty - firsty) << 1); + stretch_blit(vb, screen, 0, 0, lastx - firstx, (lasty - firsty) << 1, 0, 0, winsizex, winsizey); + #else + blit(b, screen, firstx, firsty << 1, 0, 0, lastx - firstx, (lasty - firsty) << 1); + #endif + } + else + { + #ifdef WIN32 + blit(b, vb, firstx, firsty, 0, 0, lastx - firstx, lasty - firsty); + stretch_blit(vb, screen, 0, 0, lastx - firstx, lasty - firsty, 0, 0, winsizex, winsizey); + #else + for (c = (firsty << 1); c < (lasty << 1); c++) blit(b, b16x, firstx, c >> 1, 0, c, lastx - firstx, 1); + blit(b16x, screen, 0, firsty << 1, 0, 0, lastx - firstx, (lasty - firsty) << 1); + #endif + } + } + else + { + if (!fullscreen) updatewindowsize((lastx - firstx) + 2, ((lasty - firsty) << 1) + 2); + fskipcount = 0; + if (vid_scanlines) + { + #ifdef WIN32 + for (c = firsty; c < lasty; c++) blit(b, b16x, firstx, c, 0, c << 1, lastx - firstx, 1); + blit(b16x, screen, 0, firsty << 1, 0, 0, lastx - firstx, (lasty - firsty) << 1); + #else + blit(b, b16x, firstx, firsty, 0, 0, lastx - firstx, lasty - firsty); + for (c = firsty; c < lasty; c++) blit(b16x, screen, 0, c - firsty, 0, (c - firsty) << 1, lastx - firstx, 1); + #endif + } + #ifdef WIN32 + else if (vid_interlace && vid_pal) + { + pal_convert(b, firstx, (firsty << 1) + (interlline ? 1 : 0), lastx, (lasty << 1) + (interlline ? 1 : 0), 2); + blit(b32, vb, (firstx * 922) / 832, firsty << 1, 0,0, ((lastx - firstx) * 922) / 832, (lasty - firsty) << 1); + stretch_blit(vb, screen, 0, 0, ((lastx - firstx) * 922) / 832, (lasty - firsty) << 1, 0, 0, (lastx - firstx), (lasty - firsty) << 1); + } + else if (vid_pal) + { + pal_convert(b, firstx, firsty, lastx, lasty, 1); + blit(b32, vb, (firstx * 922) / 832, firsty, 0,0, ((lastx - firstx) * 922) / 832, lasty - firsty); + stretch_blit(vb, screen, 0, 0, ((lastx - firstx) * 922) / 832, lasty-firsty, 0, 0, (lastx - firstx), (lasty - firsty) << 1); + } + #endif + else if (vid_interlace || vid_linedbl) + { + //rpclog("Blit %i,%i %i,%i\n", firstx, firsty << 1, lastx - firstx, (lasty - firsty) << 1); + blit(b, screen, firstx, firsty << 1, 0, 0, lastx - firstx, (lasty - firsty) << 1); + } + else + { + #ifdef WIN32 + blit(b, vb, firstx, firsty, 0, 0, lastx - firstx, lasty - firsty); + stretch_blit(vb, screen, 0, 0, lastx - firstx, lasty - firsty, 0, 0, lastx - firstx, (lasty - firsty) << 1); + #else + for (c = (firsty << 1); c < (lasty << 1); c++) blit(b, b16x, firstx, c >> 1, 0, c, lastx - firstx, 1); + blit(b16x, screen, 0, firsty << 1, 0, 0, lastx - firstx, (lasty - firsty) << 1); + #endif + } + if (fullscreen) + rectfill(screen, 0, 584, 799, 599, 0); + } +// rpclog("Blit end\n"); +// textprintf(screen,font,0,0,makecol(255,255,255),"%08X",uefpos()); + } + firstx = firsty = 65535; + lastx = lasty = 0; + endblit(); +} diff --git a/src/video.c b/src/video.c index 8fd20deb..7f0d822a 100644 --- a/src/video.c +++ b/src/video.c @@ -1,872 +1,872 @@ -/*B-em v2.2 by Tom Walker - Video emulation - Incorporates 6845 CRTC, Video ULA and SAA5050*/ - -#include -#include -#include -#include "b-em.h" - -#include "bbctext.h" -#include "mem.h" -#include "model.h" -#include "serial.h" -#include "tape.h" -#include "via.h" -#include "sysvia.h" -#include "video.h" -#include "video_render.h" - - -int fullscreen = 0; - -int scrx, scry; -int interlline = 0; - - -/*6845 CRTC*/ -uint8_t crtc[32]; -static uint8_t crtc_mask[32]={0xFF,0xFF,0xFF,0xFF,0x7F,0x1F,0x7F,0x7F,0xF3,0x1F,0x7F,0x1F,0x3F,0xFF,0x3F,0xFF,0x3F,0xFF}; -int crtc_i; - -int hc,vc,sc,vadj; -uint16_t ma,maback; - -void crtc_reset() -{ - hc = vc = sc = vadj = 0; - crtc[9] = 10; -} - -void crtc_write(uint16_t addr, uint8_t val) -{ -// rpclog("Write CRTC %04X %02X %04X\n",addr,val,pc); - if (!(addr & 1)) crtc_i = val & 31; - else - { - crtc[crtc_i] = val & crtc_mask[crtc_i]; -// if (crtci!=12 && crtci!=13 && crtci!=14 && crtci!=15) printf("Write CRTC R%i %02X\n",crtci,val); - } -} - -uint8_t crtc_read(uint16_t addr) -{ - if (!(addr & 1)) return crtc_i; - return crtc[crtc_i]; -} - -void crtc_latchpen() -{ - crtc[0x10]=(ma>>8)&0x3F; - crtc[0x11]=ma&0xFF; -} - -void crtc_savestate(FILE *f) -{ - int c; - for (c=0;c<18;c++) putc(crtc[c],f); - putc(vc,f); - putc(sc,f); - putc(hc,f); - putc(ma,f); putc(ma>>8,f); - putc(maback,f); putc(maback>>8,f); -} - -void crtc_loadstate(FILE *f) -{ - int c; - for (c=0;c<18;c++) crtc[c]=getc(f); - vc=getc(f); - sc=getc(f); - hc=getc(f); - ma=getc(f); ma|=getc(f)<<8; - maback=getc(f); maback|=getc(f)<<8; -} - - -/*Video ULA (VIDPROC)*/ -uint8_t ula_ctrl; -static uint8_t ula_pal[16]; -uint8_t ula_palbak[16]; -static int ula_mode; -static int crtc_mode; -static int collook[8]; - -static uint8_t table4bpp[4][256][16]; - -void videoula_write(uint16_t addr, uint8_t val) -{ - int c; -// rpclog("ULA write %04X %02X %i %i\n",addr,val,hc,vc); - if (!(addr & 1)) - { -// printf("ULA write %04X %02X\n",addr,val); - if ((ula_ctrl ^ val) & 1) - { - if (val & 1) - { - for (c = 0; c < 16; c++) - { - if (ula_palbak[c]&8) ula_pal[c]=collook[ula_palbak[c] & 7]; - else ula_pal[c]=collook[(ula_palbak[c] & 7) ^ 7]; - } - } - else - { - for (c = 0; c < 16; c++) - ula_pal[c]=collook[(ula_palbak[c] & 7) ^ 7]; - } - } - ula_ctrl=val; - ula_mode=(ula_ctrl >> 2) & 3; - if (val&2) crtc_mode=0; - else if (val&0x10) crtc_mode=1; - else crtc_mode=2; -// printf("ULAmode %i\n",ulamode); - } - else - { -// rpclog("ULA write %04X %02X\n",addr,val); - c = ula_palbak[val >> 4]; - ula_palbak[val >> 4] = val & 15; - ula_pal[val >> 4] = collook[(val & 7) ^ 7]; - if (val & 8 && ula_ctrl & 1) ula_pal[val >> 4] = collook[val & 7]; - } -} - -void videoula_savestate(FILE *f) -{ - int c; - putc(ula_ctrl,f); - for (c=0;c<16;c++) putc(ula_palbak[c],f); -} - -void videoula_loadstate(FILE *f) -{ - int c; - videoula_write(0,getc(f)); - for (c=0;c<16;c++) videoula_write(1,getc(f)|(c<<4)); -} - - -/*Mode 7 (SAA5050)*/ -static uint8_t mode7_chars[96*160], mode7_charsi[96*160], mode7_graph[96*160], mode7_graphi[96*160], mode7_sepgraph[96*160], mode7_sepgraphi[96*160], mode7_tempi[96*120], mode7_tempi2[96*120]; -static uint8_t mode7_lookup[8][8][16]; - -static int mode7_col = 7, mode7_bg = 0; -static int mode7_sep = 0; -static int mode7_dbl, mode7_nextdbl, mode7_wasdbl; -static int mode7_gfx; -static int mode7_flash, mode7_flashon = 0, mode7_flashtime = 0; -static uint8_t mode7_buf[2]; -static uint8_t *mode7_p[2] = {mode7_chars, mode7_charsi}; -static uint8_t mode7_heldchar, mode7_holdchar; -static uint8_t *mode7_heldp[2]; - -void mode7_makechars() -{ - int c, d, y; - int offs1 = 0, offs2 = 0; - float x; - int x2; - int stat; - uint8_t *p = teletext_characters, *p2 = mode7_tempi; - for (c = 0; c < (96 * 60); c++) teletext_characters[c] *= 15; - for (c = 0; c < (96 * 60); c++) teletext_graphics[c] *= 15; - for (c = 0; c < (96 * 60); c++) teletext_separated_graphics[c] *= 15; - for (c = 0; c < (96 * 120); c++) mode7_tempi2[c] = teletext_characters[c >> 1]; - for (c = 0; c < 960; c++) - { - x = 0; - x2 = 0; - for (d = 0; d < 16; d++) - { - mode7_graph[offs2 + d] = (int)(((float)teletext_graphics[offs1 + x2] * (1.0 - x))+((float)teletext_graphics[offs1 + x2 + 1] * x)); - mode7_sepgraph[offs2+d] = (int)(((float)teletext_separated_graphics[offs1 + x2] * (1.0 - x)) + ((float)teletext_separated_graphics[offs1 + x2 + 1] * x)); - if (!d) - { - mode7_graph[offs2 + d] = mode7_graphi[offs2 + d] = teletext_graphics[offs1]; - mode7_sepgraph[offs2 + d] = mode7_sepgraphi[offs2 + d] = teletext_separated_graphics[offs1]; - } - else if (d==15) - { - mode7_graph[offs2 + d] = mode7_graphi[offs2 + d] = teletext_graphics[offs1 + 5]; - mode7_sepgraph[offs2 + d] = mode7_sepgraphi[offs2 + d] = teletext_separated_graphics[offs1 + 5]; - } - else - { - mode7_graph[offs2 + d] = mode7_graphi[offs2 + d] = teletext_graphics[offs1 + x2]; - mode7_sepgraph[offs2 + d] = mode7_sepgraphi[offs2 + d] = teletext_separated_graphics[offs1 + x2]; - } - x += (5.0 / 15.0); - if (x >= 1.0) - { - x2++; - x -= 1.0; - } - mode7_charsi[offs2 + d] = 0; - } - - offs1 += 6; - offs2 += 16; - } - for (c = 0; c < 96; c++) - { - for (y = 0; y < 10; y++) - { - for (d = 0; d < 6; d++) - { - stat = 0; - if (y < 9 && p[(y * 6) + d] && p[(y * 6) + d + 6]) stat|=3; /*Above + below - set both*/ - if (y < 9 && d > 0 && p[(y * 6) + d] && p[(y * 6) + d + 5] && !p[(y * 6) + d - 1]) stat|=1; /*Above + left - set left*/ - if (y < 9 && d > 0 && p[(y * 6) + d + 6] && p[(y * 6) + d - 1] && !p[(y * 6) + d + 5]) stat|=1; /*Below + left - set left*/ - if (y < 9 && d < 5 && p[(y * 6) + d] && p[(y * 6) + d + 7] && !p[(y * 6) + d + 1]) stat|=2; /*Above + right - set right*/ - if (y < 9 && d < 5 && p[(y * 6) + d + 6] && p[(y * 6) + d + 1] && !p[(y * 6) + d + 7]) stat|=2; /*Below + right - set right*/ - - p2[0] = (stat & 1) ? 15 : 0; - p2[1] = (stat & 2) ? 15 : 0; - p2 += 2; - } - } - p += 60; - } - offs1 = offs2 = 0; - for (c = 0; c < 960; c++) - { - x = 0; - x2 = 0; - for (d = 0; d < 16; d++) - { - mode7_chars[offs2 + d] = (int)(((float)mode7_tempi2[offs1 + x2] * (1.0 - x)) + ((float)mode7_tempi2[offs1 + x2 + 1] * x)); - mode7_charsi[offs2 + d] = (int)(((float)mode7_tempi[offs1 + x2] * (1.0 - x)) + ((float)mode7_tempi[offs1 + x2 + 1] * x)); - x += (11.0 / 15.0); - if (x >= 1.0) - { - x2++; - x -= 1.0; - } - if (c >= 320 && c < 640) - { - mode7_graph[offs2 + d] = mode7_sepgraph[offs2 + d] = mode7_chars[offs2 + d]; - mode7_graphi[offs2 + d] = mode7_sepgraphi[offs2 + d] = mode7_charsi[offs2 + d]; - } - } - offs1 += 12; - offs2 += 16; - } -} - -static inline void mode7_render(uint8_t dat) -{ - int t, c; - int off; - int mcolx = mode7_col; - int holdoff = 0, holdclear = 0; - uint8_t *mode7_px[2]; - int mode7_flashx = mode7_flash, mode7_dblx = mode7_dbl; - uint8_t *on; - - t = mode7_buf[0]; - mode7_buf[0] = mode7_buf[1]; - mode7_buf[1] = dat; - dat = t; - mode7_px[0] = mode7_p[0]; - mode7_px[1] = mode7_p[1]; - - if (!mode7_dbl && mode7_nextdbl) on = mode7_lookup[mode7_bg & 7][mode7_bg & 7]; - if (dat == 255) - { - for (c = 0; c < 16; c++) - { - b->line[scry][scrx + c + 16] = collook[0]; - } - if (vid_linedbl) - { - for (c = 0; c < 16; c++) - { - b->line[scry + 1][scrx + c + 16] = collook[0]; - } - } - return; - } - - if (dat < 0x20) - { - switch (dat) - { - case 1: case 2: case 3: case 4: case 5: case 6: case 7: - mode7_gfx = 0; - mode7_col = dat; - mode7_p[0] = mode7_chars; - mode7_p[1] = mode7_charsi; - holdclear = 1; - break; - case 8: mode7_flash = 1; break; - case 9: mode7_flash = 0; break; - case 12: case 13: - mode7_dbl = dat & 1; - if (mode7_dbl) mode7_wasdbl = 1; - break; - case 17: case 18: case 19: case 20: case 21: case 22: case 23: - mode7_gfx = 1; - mode7_col = dat & 7; - if (mode7_sep) - { - mode7_p[0] = mode7_sepgraph; - mode7_p[1] = mode7_sepgraphi; - } - else - { - mode7_p[0] = mode7_graph; - mode7_p[1] = mode7_graphi; - } - break; - case 24: mode7_col = mcolx = mode7_bg; break; - case 25: if (mode7_gfx) { mode7_p[0] = mode7_graph; mode7_p[1] = mode7_graphi; } mode7_sep = 0; break; - case 26: if (mode7_gfx) { mode7_p[0] = mode7_sepgraph; mode7_p[1] = mode7_sepgraphi; } mode7_sep = 1; break; - case 28: mode7_bg = 0; break; - case 29: mode7_bg = mode7_col; break; - case 30: mode7_holdchar = 1; break; - case 31: holdoff = 1; break; - } - if (mode7_holdchar) - { - dat = mode7_heldchar; - if (dat >= 0x40 && dat < 0x60) dat = 32; - mode7_px[0] = mode7_heldp[0]; - mode7_px[1] = mode7_heldp[1]; - } - else - dat = 0x20; - if (mode7_dblx != mode7_dbl) dat = 32; /*Double height doesn't respect held characters*/ - } - else if (mode7_p[0] != mode7_chars) - { - mode7_heldchar = dat; - mode7_heldp[0] = mode7_px[0]; - mode7_heldp[1] = mode7_px[1]; - } - - if (mode7_dblx && !mode7_nextdbl) t = ((dat - 0x20) * 160) + ((sc >> 1) * 16); - else if (mode7_dblx) t = ((dat - 0x20) * 160) + ((sc >> 1) * 16) + (5 * 16); - else t = ((dat - 0x20) * 160) + (sc * 16); - - off = mode7_lookup[0][mode7_bg & 7][0]; - if (!mode7_dbl && mode7_nextdbl) on = mode7_lookup[mode7_bg & 7][mode7_bg & 7]; - else on = mode7_lookup[mcolx & 7][mode7_bg & 7]; - - for (c = 0; c < 16; c++) - { - if (mode7_flashx && !mode7_flashon) b->line[scry][scrx + c + 16] = off; - else if (mode7_dblx) b->line[scry][scrx + c + 16] = on[mode7_px[sc & 1][t] & 15]; - else b->line[scry][scrx + c + 16] = on[mode7_px[vid_interlace & interlline][t] & 15]; - t++; - } - - if (vid_linedbl) - { - t -= 16; - for (c = 0; c < 16; c++) - { - if (mode7_flashx && !mode7_flashon) b->line[scry + 1][scrx + c + 16] = off; - else if (mode7_dblx) b->line[scry + 1][scrx + c + 16] = on[mode7_px[sc & 1][t] & 15]; - else b->line[scry + 1][scrx + c + 16] = on[mode7_px[1][t] & 15]; - t++; - } - } - - if ((scrx + 16) < firstx) firstx = scrx + 16; - if ((scrx + 32) > lastx) lastx = scrx + 32; - - if (holdoff) - { - mode7_holdchar=0; - mode7_heldchar=32; - } - if (holdclear) mode7_heldchar=32; -} - - - - - -uint16_t vidbank; -int screenlen[4] = {0x4000, 0x5000, 0x2000, 0x2800}; - -uint32_t col0; - - -int vsynctime; -int interline; -int hvblcount; -int frameodd; -int con, cdraw, coff; -int cursoron; -int frcount; -int charsleft; -int vdispen, dispen; - - -int vidclocks = 0; -int oddclock = 0; -int vidbytes = 0; - -int oldr8; - -int firstx, firsty, lastx, lasty; - - -BITMAP *b, *b16, *b16x, *b32, *tb; -#ifdef WIN32 -BITMAP *vb; -#endif - -int inverttbl[256]; -int dcol; -PALETTE pal; -BITMAP *tvb; - -void video_init() -{ - int c,d; - int temp,temp2,left; - - dcol = desktop_color_depth(); - set_color_depth(dcol); -#ifdef WIN32 - set_gfx_mode(GFX_AUTODETECT_WINDOWED, 2048, 2048, 0, 0); -#else - set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0); -#endif - #ifdef WIN32 - vb = create_video_bitmap(924, 614); - #endif - b16x = create_bitmap(832, 614); - b16 = create_bitmap(832, 614); - set_color_depth(32); - b32 = create_bitmap(1536, 800); - set_color_depth(8); - - generate_332_palette(pal); - set_palette(pal); - - collook[0] = makecol(0, 0, 0); - col0 = collook[0] | (collook[0] << 8) | (collook[0] << 16) | (collook[0] << 24); - collook[1] = makecol(255, 0, 0); - collook[2] = makecol(0, 255, 0); - collook[3] = makecol(255, 255, 0); - collook[4] = makecol(0, 0, 255); - collook[5] = makecol(255, 0, 255); - collook[6] = makecol(0, 255, 255); - collook[7] = makecol(255, 255, 255); - for (c = 0; c < 16; c++) - { - for (d = 0; d < 64; d++) - { - mode7_lookup[d & 7][(d >> 3) & 7][c] = makecol( (((d & 1) * c) * 255) / 15 + ((((d & 8) >> 3) * (15 - c)) * 255) / 15, - ((((d & 2) >> 1) * c) * 255) / 15 + ((((d & 16) >> 4) * (15 - c)) * 255) / 15, - ((((d & 4) >> 2) * c) * 255) / 15 + ((((d & 32) >> 5) * (15 - c)) * 255) / 15); - } - } - for (temp = 0; temp < 256; temp++) - { - temp2 = temp; - for (c = 0; c < 16; c++) - { - left = 0; - if (temp2 & 2) - left |= 1; - if (temp2 & 8) - left |= 2; - if (temp2 & 32) - left |= 4; - if (temp2 & 128) - left |= 8; - table4bpp[3][temp][c] = left; - temp2 <<= 1; temp2 |= 1; - } - for (c = 0; c < 16; c++) - { - table4bpp[2][temp][c] = table4bpp[3][temp][c >> 1]; - table4bpp[1][temp][c] = table4bpp[3][temp][c >> 2]; - table4bpp[0][temp][c] = table4bpp[3][temp][c >> 3]; - } - } -// set_palette(beebpal); - b=create_bitmap(1280, 800); - clear_to_color(b, collook[0]); - for (c = 0; c < 256; c++) inverttbl[c]=makecol((63 - pal[c].r) << 2,(63 - pal[c].g) << 2,(63 - pal[c].b) << 2); -} - - -uint8_t cursorlook[7] = {0, 0, 0, 0x80, 0x40, 0x20, 0x20}; -int cdrawlook[4] = {3, 2, 1, 0}; - -int cmask[4] = {0, 0, 16, 32}; - -int lasthc0 = 0, lasthc; -int olddispen; -int oldlen; -int ccount = 0; - -int vid_cleared; - -int firstdispen = 0; - - -void video_reset() -{ - interline = 0; - vsynctime = 0; - hvblcount = 0; - frameodd = 0; - con = cdraw = 0; - cursoron = 0; - charsleft = 0; -} - -void video_poll(int clocks) -{ - int c, oldvc; - uint16_t addr; - uint8_t dat; - while (clocks--) - { - scrx += 8; - vidclocks++; - oddclock = !oddclock; - if (!(ula_ctrl & 0x10) && !oddclock) continue; - - if (hc == crtc[1]) - { - if (ula_ctrl & 2 && dispen) charsleft = 3; - else charsleft = 0; - dispen = 0; - } - if (hc == crtc[2]) - { - if (ula_ctrl & 0x10) scrx = 128 - ((crtc[3] & 15) * 4); - else scrx = 128 - ((crtc[3] & 15) * 8); - /*Don't need this as we blit from 240 onwards*/ -// if (interlace) memset(b->line[(scry<<1)+interlline],0,scrx); -// else memset(b->line[scry],0,scrx); -// scrx=0; - scry++; - if (scry >= 384) - { - scry = 0; - video_doblit(); - } - } - - if (vid_interlace) scry = (scry << 1) + interlline; - if (vid_linedbl) scry <<= 1; - if (dispen) - { - if (!((ma ^ (crtc[15] | (crtc[14] <<8 ))) & 0x3FFF) && con) cdraw = cdrawlook[crtc[8] >> 6]; - - if (ma & 0x2000) dat = ram[0x7C00 | (ma & 0x3FF) | vidbank]; - else - { - if ((crtc[8] & 3) == 3) addr = (ma << 3) | ((sc & 3) << 1) | interlline; - else addr = (ma << 3) | (sc & 7); - if (addr & 0x8000) addr -= screenlen[scrsize]; - dat = ram[(addr & 0x7FFF) | vidbank]; - } - - if (scrx < 1280) - { - if ((crtc[8] & 0x30) == 0x30 || ((sc & 8) && !(ula_ctrl & 2))) - { - for (c = 0; c < ((ula_ctrl & 0x10) ? 8 : 16); c++) - { - ((uint32_t *)b->line[scry])[(scrx + c) >> 2]=col0; - } - if (vid_linedbl) - { - for (c = 0; c < ((ula_ctrl & 0x10) ? 8 : 16); c++) - { - ((uint32_t *)b->line[scry + 1])[(scrx + c) >> 2] = col0; - } - } - } - else switch (crtc_mode) - { - case 0: - mode7_render(dat & 0x7F); - break; - case 1: - if (scrx < firstx) firstx = scrx; - if ((scrx + 8) > lastx) lastx = scrx + 8; - for (c = 0; c < 8; c++) - { - b->line[scry][scrx + c] = ula_pal[table4bpp[ula_mode][dat][c]]; - } - if (vid_linedbl) - { - for (c = 0; c < 8; c++) - { - b->line[scry + 1][scrx + c] = ula_pal[table4bpp[ula_mode][dat][c]]; - } - } - break; - case 2: - if (scrx < firstx) firstx = scrx; - if ((scrx + 16) > lastx) lastx = scrx + 16; - for (c = 0; c < 16; c++) - { - b->line[scry][scrx + c] = ula_pal[table4bpp[ula_mode][dat][c]]; - } - if (vid_linedbl) - { - for (c = 0;c < 16; c++) - { - b->line[scry + 1][scrx + c] = ula_pal[table4bpp[ula_mode][dat][c]]; - } - } - break; - } - if (cdraw) - { - if (cursoron && (ula_ctrl & cursorlook[cdraw])) - { - for (c = 0; c < ((ula_ctrl & 0x10) ? 8 : 16); c++) - { - b->line[scry][scrx + c] = inverttbl[b->line[scry][scrx + c]]; - } - if (vid_linedbl) - { - for (c = 0; c < ((ula_ctrl & 0x10) ? 8 : 16); c++) - { - b->line[scry + 1][scrx + c] = inverttbl[b->line[scry + 1][scrx + c]]; - } - } - } - cdraw++; - if (cdraw == 7) cdraw = 0; - } - } - ma++; - vidbytes++; - } - else - { - if (charsleft) - { - if (charsleft != 1) mode7_render(255); - charsleft--; - - } - else if (scrx < 1280) - { - for (c = 0; c < ((ula_ctrl & 0x10) ? 8 : 16); c+=4) - { - *((uint32_t *)&b->line[scry][scrx + c]) = col0; - } - - if (vid_linedbl) - { - for (c = 0; c < ((ula_ctrl & 0x10) ? 8 : 16); c += 4) - { - *((uint32_t *)&b->line[scry + 1][scrx + c])=col0; - } - } - if (!crtc_mode) - { - for (c = 0;c < 16;c += 4) - { - *((uint32_t *)&b->line[scry][scrx + c + 16]) = col0; - } - if (vid_linedbl) - { - for (c = 0; c < 16; c += 4) - { - *((uint32_t *)&b->line[scry + 1][scrx + c + 16]) = col0; - } - } - } - } - if (cdraw && scrx < 1280) - { - if (cursoron && (ula_ctrl & cursorlook[cdraw])) - { - for (c = 0; c < ((ula_ctrl & 0x10) ? 8 : 16); c++) - { - b->line[scry][scrx + c] = inverttbl[b->line[scry][scrx + c]]; - } - if (vid_linedbl) - { - for (c = 0; c < ((ula_ctrl & 0x10) ? 8 : 16); c++) - { - b->line[scry + 1][scrx + c] = inverttbl[b->line[scry + 1][scrx + c]]; - } - } - } - cdraw++; - if (cdraw == 7) cdraw = 0; - } - } - - if (vid_linedbl) scry >>= 1; - if (vid_interlace) scry >>= 1; - - if (hvblcount) - { - hvblcount--; - if (!hvblcount) - sysvia_set_ca1(0); - } - - if (interline && hc == (crtc[0] >> 1)) - { - hc = interline = 0; - lasthc0 = 1; - - if (ula_ctrl & 0x10) scrx = 128 - ((crtc[3] & 15) * 4); - else scrx = 128 - ((crtc[3] & 15) * 8); - } - else if (hc == crtc[0]) - { - mode7_col = 7; - mode7_bg = 0; - mode7_holdchar = 0; - mode7_heldchar = 0x20; - mode7_p[0] = mode7_chars; - mode7_p[1] = mode7_charsi; - mode7_flash = 0; - mode7_sep = 0; - mode7_gfx = 0; - mode7_heldp[0] = mode7_p[0]; - mode7_heldp[1] = mode7_p[1]; - - hc = 0; - if (sc == (crtc[11] & 31) || ((crtc[8] & 3) == 3 && sc == ((crtc[11] & 31) >> 1))) { con = 0; coff = 1; } - if (vadj) - { - sc++; - sc &= 31; - ma = maback; - vadj--; - if (!vadj) - { - vdispen = 1; - ma = maback = (crtc[13] | (crtc[12] << 8)) & 0x3FFF; - sc = 0; - } - } - else if (sc == crtc[9] || ((crtc[8] & 3) == 3 && sc == (crtc[9] >> 1))) - { - maback = ma; - sc = 0; - con = 0; - coff = 0; - if (mode7_nextdbl) mode7_nextdbl = 0; - else mode7_nextdbl = mode7_wasdbl; - oldvc = vc; - vc++; - vc &= 127; - if (vc == crtc[6]) vdispen = 0; - if (oldvc == crtc[4]) - { - vc = 0; - vadj = crtc[5]; - if (!vadj) vdispen = 1; - if (!vadj) ma = maback = (crtc[13] | (crtc[12] << 8)) & 0x3FFF; - - frcount++; - if (!(crtc[10] & 0x60)) cursoron = 1; - else cursoron = frcount & cmask[(crtc[10] & 0x60) >> 5]; - } - if (vc == crtc[7]) - { - if (!(crtc[8] & 1) && oldr8) - { - clear_to_color(b, col0); - clear(b32); - } - frameodd ^= 1; - if (frameodd) interline = (crtc[8] & 1); - interlline = frameodd && (crtc[8] & 1); - oldr8 = crtc[8] & 1; - if (vidclocks > 1024 && !ccount) - { - video_doblit(); - vid_cleared = 0; - } - else if (vidclocks <= 1024 && !vid_cleared) - { - vid_cleared = 1; - clear_to_color(b, col0); - video_doblit(); - } - ccount++; - if (ccount == 10 || ((!motor || !fasttape) && !key[KEY_PGUP])) ccount = 0; - scry = 0; - sysvia_set_ca1(1); - - vsynctime = (crtc[3] >> 4) + 1; - if (!(crtc[3] >> 4)) vsynctime = 17; - - mode7_flashtime++; - if ((mode7_flashon && mode7_flashtime == 32) || (!mode7_flashon && mode7_flashtime == 16)) - { - mode7_flashon = !mode7_flashon; - mode7_flashtime = 0; - } - - vidclocks = vidbytes = 0; - } - } - else - { - sc++; - sc &= 31; - ma = maback; - } - - mode7_dbl = mode7_wasdbl = 0; - if ((sc == (crtc[10] & 31) || ((crtc[8] & 3) == 3 && sc == ((crtc[10] & 31) >> 1))) && !coff) con = 1; - - if (vsynctime) - { - vsynctime--; - if (!vsynctime) - { - hvblcount = 1; - if (frameodd) interline = (crtc[8] & 1); - } - } - - dispen = vdispen; - if (dispen || vadj) - { - if (scry < firsty) firsty = scry; - if ((scry + 1) > lasty) lasty = scry; - } - - firstdispen = 1; - lasthc0 = 1; - } - else - { - hc++; - hc &= 255; - } - lasthc = hc; - } -} - -void video_savestate(FILE *f) -{ - putc(scrx,f); putc(scrx>>8,f); - putc(scry,f); putc(scry>>8,f); - putc(oddclock,f); - putc(vidclocks,f); putc(vidclocks>>8,f); putc(vidclocks>>16,f); putc(vidclocks>>24,f); -} - -void video_loadstate(FILE *f) -{ - scrx=getc(f); scrx|=getc(f)<<8; - scry=getc(f); scry|=getc(f)<<8; - vidclocks=getc(f); vidclocks=getc(f)<<8; vidclocks=getc(f)<<16; vidclocks=getc(f)<<24; -} +/*B-em v2.2 by Tom Walker + Video emulation + Incorporates 6845 CRTC, Video ULA and SAA5050*/ + +#include +#include +#include +#include "b-em.h" + +#include "bbctext.h" +#include "mem.h" +#include "model.h" +#include "serial.h" +#include "tape.h" +#include "via.h" +#include "sysvia.h" +#include "video.h" +#include "video_render.h" + + +int fullscreen = 0; + +int scrx, scry; +int interlline = 0; + + +/*6845 CRTC*/ +uint8_t crtc[32]; +static uint8_t crtc_mask[32]={0xFF,0xFF,0xFF,0xFF,0x7F,0x1F,0x7F,0x7F,0xF3,0x1F,0x7F,0x1F,0x3F,0xFF,0x3F,0xFF,0x3F,0xFF}; +int crtc_i; + +int hc,vc,sc,vadj; +uint16_t ma,maback; + +void crtc_reset() +{ + hc = vc = sc = vadj = 0; + crtc[9] = 10; +} + +void crtc_write(uint16_t addr, uint8_t val) +{ +// rpclog("Write CRTC %04X %02X %04X\n",addr,val,pc); + if (!(addr & 1)) crtc_i = val & 31; + else + { + crtc[crtc_i] = val & crtc_mask[crtc_i]; +// if (crtci!=12 && crtci!=13 && crtci!=14 && crtci!=15) printf("Write CRTC R%i %02X\n",crtci,val); + } +} + +uint8_t crtc_read(uint16_t addr) +{ + if (!(addr & 1)) return crtc_i; + return crtc[crtc_i]; +} + +void crtc_latchpen() +{ + crtc[0x10]=(ma>>8)&0x3F; + crtc[0x11]=ma&0xFF; +} + +void crtc_savestate(FILE *f) +{ + int c; + for (c=0;c<18;c++) putc(crtc[c],f); + putc(vc,f); + putc(sc,f); + putc(hc,f); + putc(ma,f); putc(ma>>8,f); + putc(maback,f); putc(maback>>8,f); +} + +void crtc_loadstate(FILE *f) +{ + int c; + for (c=0;c<18;c++) crtc[c]=getc(f); + vc=getc(f); + sc=getc(f); + hc=getc(f); + ma=getc(f); ma|=getc(f)<<8; + maback=getc(f); maback|=getc(f)<<8; +} + + +/*Video ULA (VIDPROC)*/ +uint8_t ula_ctrl; +static uint8_t ula_pal[16]; +uint8_t ula_palbak[16]; +static int ula_mode; +static int crtc_mode; +static int collook[8]; + +static uint8_t table4bpp[4][256][16]; + +void videoula_write(uint16_t addr, uint8_t val) +{ + int c; +// rpclog("ULA write %04X %02X %i %i\n",addr,val,hc,vc); + if (!(addr & 1)) + { +// printf("ULA write %04X %02X\n",addr,val); + if ((ula_ctrl ^ val) & 1) + { + if (val & 1) + { + for (c = 0; c < 16; c++) + { + if (ula_palbak[c]&8) ula_pal[c]=collook[ula_palbak[c] & 7]; + else ula_pal[c]=collook[(ula_palbak[c] & 7) ^ 7]; + } + } + else + { + for (c = 0; c < 16; c++) + ula_pal[c]=collook[(ula_palbak[c] & 7) ^ 7]; + } + } + ula_ctrl=val; + ula_mode=(ula_ctrl >> 2) & 3; + if (val&2) crtc_mode=0; + else if (val&0x10) crtc_mode=1; + else crtc_mode=2; +// printf("ULAmode %i\n",ulamode); + } + else + { +// rpclog("ULA write %04X %02X\n",addr,val); + c = ula_palbak[val >> 4]; + ula_palbak[val >> 4] = val & 15; + ula_pal[val >> 4] = collook[(val & 7) ^ 7]; + if (val & 8 && ula_ctrl & 1) ula_pal[val >> 4] = collook[val & 7]; + } +} + +void videoula_savestate(FILE *f) +{ + int c; + putc(ula_ctrl,f); + for (c=0;c<16;c++) putc(ula_palbak[c],f); +} + +void videoula_loadstate(FILE *f) +{ + int c; + videoula_write(0,getc(f)); + for (c=0;c<16;c++) videoula_write(1,getc(f)|(c<<4)); +} + + +/*Mode 7 (SAA5050)*/ +static uint8_t mode7_chars[96*160], mode7_charsi[96*160], mode7_graph[96*160], mode7_graphi[96*160], mode7_sepgraph[96*160], mode7_sepgraphi[96*160], mode7_tempi[96*120], mode7_tempi2[96*120]; +static uint8_t mode7_lookup[8][8][16]; + +static int mode7_col = 7, mode7_bg = 0; +static int mode7_sep = 0; +static int mode7_dbl, mode7_nextdbl, mode7_wasdbl; +static int mode7_gfx; +static int mode7_flash, mode7_flashon = 0, mode7_flashtime = 0; +static uint8_t mode7_buf[2]; +static uint8_t *mode7_p[2] = {mode7_chars, mode7_charsi}; +static uint8_t mode7_heldchar, mode7_holdchar; +static uint8_t *mode7_heldp[2]; + +void mode7_makechars() +{ + int c, d, y; + int offs1 = 0, offs2 = 0; + float x; + int x2; + int stat; + uint8_t *p = teletext_characters, *p2 = mode7_tempi; + for (c = 0; c < (96 * 60); c++) teletext_characters[c] *= 15; + for (c = 0; c < (96 * 60); c++) teletext_graphics[c] *= 15; + for (c = 0; c < (96 * 60); c++) teletext_separated_graphics[c] *= 15; + for (c = 0; c < (96 * 120); c++) mode7_tempi2[c] = teletext_characters[c >> 1]; + for (c = 0; c < 960; c++) + { + x = 0; + x2 = 0; + for (d = 0; d < 16; d++) + { + mode7_graph[offs2 + d] = (int)(((float)teletext_graphics[offs1 + x2] * (1.0 - x))+((float)teletext_graphics[offs1 + x2 + 1] * x)); + mode7_sepgraph[offs2+d] = (int)(((float)teletext_separated_graphics[offs1 + x2] * (1.0 - x)) + ((float)teletext_separated_graphics[offs1 + x2 + 1] * x)); + if (!d) + { + mode7_graph[offs2 + d] = mode7_graphi[offs2 + d] = teletext_graphics[offs1]; + mode7_sepgraph[offs2 + d] = mode7_sepgraphi[offs2 + d] = teletext_separated_graphics[offs1]; + } + else if (d==15) + { + mode7_graph[offs2 + d] = mode7_graphi[offs2 + d] = teletext_graphics[offs1 + 5]; + mode7_sepgraph[offs2 + d] = mode7_sepgraphi[offs2 + d] = teletext_separated_graphics[offs1 + 5]; + } + else + { + mode7_graph[offs2 + d] = mode7_graphi[offs2 + d] = teletext_graphics[offs1 + x2]; + mode7_sepgraph[offs2 + d] = mode7_sepgraphi[offs2 + d] = teletext_separated_graphics[offs1 + x2]; + } + x += (5.0 / 15.0); + if (x >= 1.0) + { + x2++; + x -= 1.0; + } + mode7_charsi[offs2 + d] = 0; + } + + offs1 += 6; + offs2 += 16; + } + for (c = 0; c < 96; c++) + { + for (y = 0; y < 10; y++) + { + for (d = 0; d < 6; d++) + { + stat = 0; + if (y < 9 && p[(y * 6) + d] && p[(y * 6) + d + 6]) stat|=3; /*Above + below - set both*/ + if (y < 9 && d > 0 && p[(y * 6) + d] && p[(y * 6) + d + 5] && !p[(y * 6) + d - 1]) stat|=1; /*Above + left - set left*/ + if (y < 9 && d > 0 && p[(y * 6) + d + 6] && p[(y * 6) + d - 1] && !p[(y * 6) + d + 5]) stat|=1; /*Below + left - set left*/ + if (y < 9 && d < 5 && p[(y * 6) + d] && p[(y * 6) + d + 7] && !p[(y * 6) + d + 1]) stat|=2; /*Above + right - set right*/ + if (y < 9 && d < 5 && p[(y * 6) + d + 6] && p[(y * 6) + d + 1] && !p[(y * 6) + d + 7]) stat|=2; /*Below + right - set right*/ + + p2[0] = (stat & 1) ? 15 : 0; + p2[1] = (stat & 2) ? 15 : 0; + p2 += 2; + } + } + p += 60; + } + offs1 = offs2 = 0; + for (c = 0; c < 960; c++) + { + x = 0; + x2 = 0; + for (d = 0; d < 16; d++) + { + mode7_chars[offs2 + d] = (int)(((float)mode7_tempi2[offs1 + x2] * (1.0 - x)) + ((float)mode7_tempi2[offs1 + x2 + 1] * x)); + mode7_charsi[offs2 + d] = (int)(((float)mode7_tempi[offs1 + x2] * (1.0 - x)) + ((float)mode7_tempi[offs1 + x2 + 1] * x)); + x += (11.0 / 15.0); + if (x >= 1.0) + { + x2++; + x -= 1.0; + } + if (c >= 320 && c < 640) + { + mode7_graph[offs2 + d] = mode7_sepgraph[offs2 + d] = mode7_chars[offs2 + d]; + mode7_graphi[offs2 + d] = mode7_sepgraphi[offs2 + d] = mode7_charsi[offs2 + d]; + } + } + offs1 += 12; + offs2 += 16; + } +} + +static inline void mode7_render(uint8_t dat) +{ + int t, c; + int off; + int mcolx = mode7_col; + int holdoff = 0, holdclear = 0; + uint8_t *mode7_px[2]; + int mode7_flashx = mode7_flash, mode7_dblx = mode7_dbl; + uint8_t *on; + + t = mode7_buf[0]; + mode7_buf[0] = mode7_buf[1]; + mode7_buf[1] = dat; + dat = t; + mode7_px[0] = mode7_p[0]; + mode7_px[1] = mode7_p[1]; + + if (!mode7_dbl && mode7_nextdbl) on = mode7_lookup[mode7_bg & 7][mode7_bg & 7]; + if (dat == 255) + { + for (c = 0; c < 16; c++) + { + b->line[scry][scrx + c + 16] = collook[0]; + } + if (vid_linedbl) + { + for (c = 0; c < 16; c++) + { + b->line[scry + 1][scrx + c + 16] = collook[0]; + } + } + return; + } + + if (dat < 0x20) + { + switch (dat) + { + case 1: case 2: case 3: case 4: case 5: case 6: case 7: + mode7_gfx = 0; + mode7_col = dat; + mode7_p[0] = mode7_chars; + mode7_p[1] = mode7_charsi; + holdclear = 1; + break; + case 8: mode7_flash = 1; break; + case 9: mode7_flash = 0; break; + case 12: case 13: + mode7_dbl = dat & 1; + if (mode7_dbl) mode7_wasdbl = 1; + break; + case 17: case 18: case 19: case 20: case 21: case 22: case 23: + mode7_gfx = 1; + mode7_col = dat & 7; + if (mode7_sep) + { + mode7_p[0] = mode7_sepgraph; + mode7_p[1] = mode7_sepgraphi; + } + else + { + mode7_p[0] = mode7_graph; + mode7_p[1] = mode7_graphi; + } + break; + case 24: mode7_col = mcolx = mode7_bg; break; + case 25: if (mode7_gfx) { mode7_p[0] = mode7_graph; mode7_p[1] = mode7_graphi; } mode7_sep = 0; break; + case 26: if (mode7_gfx) { mode7_p[0] = mode7_sepgraph; mode7_p[1] = mode7_sepgraphi; } mode7_sep = 1; break; + case 28: mode7_bg = 0; break; + case 29: mode7_bg = mode7_col; break; + case 30: mode7_holdchar = 1; break; + case 31: holdoff = 1; break; + } + if (mode7_holdchar) + { + dat = mode7_heldchar; + if (dat >= 0x40 && dat < 0x60) dat = 32; + mode7_px[0] = mode7_heldp[0]; + mode7_px[1] = mode7_heldp[1]; + } + else + dat = 0x20; + if (mode7_dblx != mode7_dbl) dat = 32; /*Double height doesn't respect held characters*/ + } + else if (mode7_p[0] != mode7_chars) + { + mode7_heldchar = dat; + mode7_heldp[0] = mode7_px[0]; + mode7_heldp[1] = mode7_px[1]; + } + + if (mode7_dblx && !mode7_nextdbl) t = ((dat - 0x20) * 160) + ((sc >> 1) * 16); + else if (mode7_dblx) t = ((dat - 0x20) * 160) + ((sc >> 1) * 16) + (5 * 16); + else t = ((dat - 0x20) * 160) + (sc * 16); + + off = mode7_lookup[0][mode7_bg & 7][0]; + if (!mode7_dbl && mode7_nextdbl) on = mode7_lookup[mode7_bg & 7][mode7_bg & 7]; + else on = mode7_lookup[mcolx & 7][mode7_bg & 7]; + + for (c = 0; c < 16; c++) + { + if (mode7_flashx && !mode7_flashon) b->line[scry][scrx + c + 16] = off; + else if (mode7_dblx) b->line[scry][scrx + c + 16] = on[mode7_px[sc & 1][t] & 15]; + else b->line[scry][scrx + c + 16] = on[mode7_px[vid_interlace & interlline][t] & 15]; + t++; + } + + if (vid_linedbl) + { + t -= 16; + for (c = 0; c < 16; c++) + { + if (mode7_flashx && !mode7_flashon) b->line[scry + 1][scrx + c + 16] = off; + else if (mode7_dblx) b->line[scry + 1][scrx + c + 16] = on[mode7_px[sc & 1][t] & 15]; + else b->line[scry + 1][scrx + c + 16] = on[mode7_px[1][t] & 15]; + t++; + } + } + + if ((scrx + 16) < firstx) firstx = scrx + 16; + if ((scrx + 32) > lastx) lastx = scrx + 32; + + if (holdoff) + { + mode7_holdchar=0; + mode7_heldchar=32; + } + if (holdclear) mode7_heldchar=32; +} + + + + + +uint16_t vidbank; +int screenlen[4] = {0x4000, 0x5000, 0x2000, 0x2800}; + +uint32_t col0; + + +int vsynctime; +int interline; +int hvblcount; +int frameodd; +int con, cdraw, coff; +int cursoron; +int frcount; +int charsleft; +int vdispen, dispen; + + +int vidclocks = 0; +int oddclock = 0; +int vidbytes = 0; + +int oldr8; + +int firstx, firsty, lastx, lasty; + + +BITMAP *b, *b16, *b16x, *b32, *tb; +#ifdef WIN32 +BITMAP *vb; +#endif + +int inverttbl[256]; +int dcol; +PALETTE pal; +BITMAP *tvb; + +void video_init() +{ + int c,d; + int temp,temp2,left; + + dcol = desktop_color_depth(); + set_color_depth(dcol); +#ifdef WIN32 + set_gfx_mode(GFX_AUTODETECT_WINDOWED, 2048, 2048, 0, 0); +#else + set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0); +#endif + #ifdef WIN32 + vb = create_video_bitmap(924, 614); + #endif + b16x = create_bitmap(832, 614); + b16 = create_bitmap(832, 614); + set_color_depth(32); + b32 = create_bitmap(1536, 800); + set_color_depth(8); + + generate_332_palette(pal); + set_palette(pal); + + collook[0] = makecol(0, 0, 0); + col0 = collook[0] | (collook[0] << 8) | (collook[0] << 16) | (collook[0] << 24); + collook[1] = makecol(255, 0, 0); + collook[2] = makecol(0, 255, 0); + collook[3] = makecol(255, 255, 0); + collook[4] = makecol(0, 0, 255); + collook[5] = makecol(255, 0, 255); + collook[6] = makecol(0, 255, 255); + collook[7] = makecol(255, 255, 255); + for (c = 0; c < 16; c++) + { + for (d = 0; d < 64; d++) + { + mode7_lookup[d & 7][(d >> 3) & 7][c] = makecol( (((d & 1) * c) * 255) / 15 + ((((d & 8) >> 3) * (15 - c)) * 255) / 15, + ((((d & 2) >> 1) * c) * 255) / 15 + ((((d & 16) >> 4) * (15 - c)) * 255) / 15, + ((((d & 4) >> 2) * c) * 255) / 15 + ((((d & 32) >> 5) * (15 - c)) * 255) / 15); + } + } + for (temp = 0; temp < 256; temp++) + { + temp2 = temp; + for (c = 0; c < 16; c++) + { + left = 0; + if (temp2 & 2) + left |= 1; + if (temp2 & 8) + left |= 2; + if (temp2 & 32) + left |= 4; + if (temp2 & 128) + left |= 8; + table4bpp[3][temp][c] = left; + temp2 <<= 1; temp2 |= 1; + } + for (c = 0; c < 16; c++) + { + table4bpp[2][temp][c] = table4bpp[3][temp][c >> 1]; + table4bpp[1][temp][c] = table4bpp[3][temp][c >> 2]; + table4bpp[0][temp][c] = table4bpp[3][temp][c >> 3]; + } + } +// set_palette(beebpal); + b=create_bitmap(1280, 800); + clear_to_color(b, collook[0]); + for (c = 0; c < 256; c++) inverttbl[c]=makecol((63 - pal[c].r) << 2,(63 - pal[c].g) << 2,(63 - pal[c].b) << 2); +} + + +uint8_t cursorlook[7] = {0, 0, 0, 0x80, 0x40, 0x20, 0x20}; +int cdrawlook[4] = {3, 2, 1, 0}; + +int cmask[4] = {0, 0, 16, 32}; + +int lasthc0 = 0, lasthc; +int olddispen; +int oldlen; +int ccount = 0; + +int vid_cleared; + +int firstdispen = 0; + + +void video_reset() +{ + interline = 0; + vsynctime = 0; + hvblcount = 0; + frameodd = 0; + con = cdraw = 0; + cursoron = 0; + charsleft = 0; +} + +void video_poll(int clocks) +{ + int c, oldvc; + uint16_t addr; + uint8_t dat; + while (clocks--) + { + scrx += 8; + vidclocks++; + oddclock = !oddclock; + if (!(ula_ctrl & 0x10) && !oddclock) continue; + + if (hc == crtc[1]) + { + if (ula_ctrl & 2 && dispen) charsleft = 3; + else charsleft = 0; + dispen = 0; + } + if (hc == crtc[2]) + { + if (ula_ctrl & 0x10) scrx = 128 - ((crtc[3] & 15) * 4); + else scrx = 128 - ((crtc[3] & 15) * 8); + /*Don't need this as we blit from 240 onwards*/ +// if (interlace) memset(b->line[(scry<<1)+interlline],0,scrx); +// else memset(b->line[scry],0,scrx); +// scrx=0; + scry++; + if (scry >= 384) + { + scry = 0; + video_doblit(); + } + } + + if (vid_interlace) scry = (scry << 1) + interlline; + if (vid_linedbl) scry <<= 1; + if (dispen) + { + if (!((ma ^ (crtc[15] | (crtc[14] <<8 ))) & 0x3FFF) && con) cdraw = cdrawlook[crtc[8] >> 6]; + + if (ma & 0x2000) dat = ram[0x7C00 | (ma & 0x3FF) | vidbank]; + else + { + if ((crtc[8] & 3) == 3) addr = (ma << 3) | ((sc & 3) << 1) | interlline; + else addr = (ma << 3) | (sc & 7); + if (addr & 0x8000) addr -= screenlen[scrsize]; + dat = ram[(addr & 0x7FFF) | vidbank]; + } + + if (scrx < 1280) + { + if ((crtc[8] & 0x30) == 0x30 || ((sc & 8) && !(ula_ctrl & 2))) + { + for (c = 0; c < ((ula_ctrl & 0x10) ? 8 : 16); c++) + { + ((uint32_t *)b->line[scry])[(scrx + c) >> 2]=col0; + } + if (vid_linedbl) + { + for (c = 0; c < ((ula_ctrl & 0x10) ? 8 : 16); c++) + { + ((uint32_t *)b->line[scry + 1])[(scrx + c) >> 2] = col0; + } + } + } + else switch (crtc_mode) + { + case 0: + mode7_render(dat & 0x7F); + break; + case 1: + if (scrx < firstx) firstx = scrx; + if ((scrx + 8) > lastx) lastx = scrx + 8; + for (c = 0; c < 8; c++) + { + b->line[scry][scrx + c] = ula_pal[table4bpp[ula_mode][dat][c]]; + } + if (vid_linedbl) + { + for (c = 0; c < 8; c++) + { + b->line[scry + 1][scrx + c] = ula_pal[table4bpp[ula_mode][dat][c]]; + } + } + break; + case 2: + if (scrx < firstx) firstx = scrx; + if ((scrx + 16) > lastx) lastx = scrx + 16; + for (c = 0; c < 16; c++) + { + b->line[scry][scrx + c] = ula_pal[table4bpp[ula_mode][dat][c]]; + } + if (vid_linedbl) + { + for (c = 0;c < 16; c++) + { + b->line[scry + 1][scrx + c] = ula_pal[table4bpp[ula_mode][dat][c]]; + } + } + break; + } + if (cdraw) + { + if (cursoron && (ula_ctrl & cursorlook[cdraw])) + { + for (c = 0; c < ((ula_ctrl & 0x10) ? 8 : 16); c++) + { + b->line[scry][scrx + c] = inverttbl[b->line[scry][scrx + c]]; + } + if (vid_linedbl) + { + for (c = 0; c < ((ula_ctrl & 0x10) ? 8 : 16); c++) + { + b->line[scry + 1][scrx + c] = inverttbl[b->line[scry + 1][scrx + c]]; + } + } + } + cdraw++; + if (cdraw == 7) cdraw = 0; + } + } + ma++; + vidbytes++; + } + else + { + if (charsleft) + { + if (charsleft != 1) mode7_render(255); + charsleft--; + + } + else if (scrx < 1280) + { + for (c = 0; c < ((ula_ctrl & 0x10) ? 8 : 16); c+=4) + { + *((uint32_t *)&b->line[scry][scrx + c]) = col0; + } + + if (vid_linedbl) + { + for (c = 0; c < ((ula_ctrl & 0x10) ? 8 : 16); c += 4) + { + *((uint32_t *)&b->line[scry + 1][scrx + c])=col0; + } + } + if (!crtc_mode) + { + for (c = 0;c < 16;c += 4) + { + *((uint32_t *)&b->line[scry][scrx + c + 16]) = col0; + } + if (vid_linedbl) + { + for (c = 0; c < 16; c += 4) + { + *((uint32_t *)&b->line[scry + 1][scrx + c + 16]) = col0; + } + } + } + } + if (cdraw && scrx < 1280) + { + if (cursoron && (ula_ctrl & cursorlook[cdraw])) + { + for (c = 0; c < ((ula_ctrl & 0x10) ? 8 : 16); c++) + { + b->line[scry][scrx + c] = inverttbl[b->line[scry][scrx + c]]; + } + if (vid_linedbl) + { + for (c = 0; c < ((ula_ctrl & 0x10) ? 8 : 16); c++) + { + b->line[scry + 1][scrx + c] = inverttbl[b->line[scry + 1][scrx + c]]; + } + } + } + cdraw++; + if (cdraw == 7) cdraw = 0; + } + } + + if (vid_linedbl) scry >>= 1; + if (vid_interlace) scry >>= 1; + + if (hvblcount) + { + hvblcount--; + if (!hvblcount) + sysvia_set_ca1(0); + } + + if (interline && hc == (crtc[0] >> 1)) + { + hc = interline = 0; + lasthc0 = 1; + + if (ula_ctrl & 0x10) scrx = 128 - ((crtc[3] & 15) * 4); + else scrx = 128 - ((crtc[3] & 15) * 8); + } + else if (hc == crtc[0]) + { + mode7_col = 7; + mode7_bg = 0; + mode7_holdchar = 0; + mode7_heldchar = 0x20; + mode7_p[0] = mode7_chars; + mode7_p[1] = mode7_charsi; + mode7_flash = 0; + mode7_sep = 0; + mode7_gfx = 0; + mode7_heldp[0] = mode7_p[0]; + mode7_heldp[1] = mode7_p[1]; + + hc = 0; + if (sc == (crtc[11] & 31) || ((crtc[8] & 3) == 3 && sc == ((crtc[11] & 31) >> 1))) { con = 0; coff = 1; } + if (vadj) + { + sc++; + sc &= 31; + ma = maback; + vadj--; + if (!vadj) + { + vdispen = 1; + ma = maback = (crtc[13] | (crtc[12] << 8)) & 0x3FFF; + sc = 0; + } + } + else if (sc == crtc[9] || ((crtc[8] & 3) == 3 && sc == (crtc[9] >> 1))) + { + maback = ma; + sc = 0; + con = 0; + coff = 0; + if (mode7_nextdbl) mode7_nextdbl = 0; + else mode7_nextdbl = mode7_wasdbl; + oldvc = vc; + vc++; + vc &= 127; + if (vc == crtc[6]) vdispen = 0; + if (oldvc == crtc[4]) + { + vc = 0; + vadj = crtc[5]; + if (!vadj) vdispen = 1; + if (!vadj) ma = maback = (crtc[13] | (crtc[12] << 8)) & 0x3FFF; + + frcount++; + if (!(crtc[10] & 0x60)) cursoron = 1; + else cursoron = frcount & cmask[(crtc[10] & 0x60) >> 5]; + } + if (vc == crtc[7]) + { + if (!(crtc[8] & 1) && oldr8) + { + clear_to_color(b, col0); + clear(b32); + } + frameodd ^= 1; + if (frameodd) interline = (crtc[8] & 1); + interlline = frameodd && (crtc[8] & 1); + oldr8 = crtc[8] & 1; + if (vidclocks > 1024 && !ccount) + { + video_doblit(); + vid_cleared = 0; + } + else if (vidclocks <= 1024 && !vid_cleared) + { + vid_cleared = 1; + clear_to_color(b, col0); + video_doblit(); + } + ccount++; + if (ccount == 10 || ((!motor || !fasttape) && !key[KEY_PGUP])) ccount = 0; + scry = 0; + sysvia_set_ca1(1); + + vsynctime = (crtc[3] >> 4) + 1; + if (!(crtc[3] >> 4)) vsynctime = 17; + + mode7_flashtime++; + if ((mode7_flashon && mode7_flashtime == 32) || (!mode7_flashon && mode7_flashtime == 16)) + { + mode7_flashon = !mode7_flashon; + mode7_flashtime = 0; + } + + vidclocks = vidbytes = 0; + } + } + else + { + sc++; + sc &= 31; + ma = maback; + } + + mode7_dbl = mode7_wasdbl = 0; + if ((sc == (crtc[10] & 31) || ((crtc[8] & 3) == 3 && sc == ((crtc[10] & 31) >> 1))) && !coff) con = 1; + + if (vsynctime) + { + vsynctime--; + if (!vsynctime) + { + hvblcount = 1; + if (frameodd) interline = (crtc[8] & 1); + } + } + + dispen = vdispen; + if (dispen || vadj) + { + if (scry < firsty) firsty = scry; + if ((scry + 1) > lasty) lasty = scry; + } + + firstdispen = 1; + lasthc0 = 1; + } + else + { + hc++; + hc &= 255; + } + lasthc = hc; + } +} + +void video_savestate(FILE *f) +{ + putc(scrx,f); putc(scrx>>8,f); + putc(scry,f); putc(scry>>8,f); + putc(oddclock,f); + putc(vidclocks,f); putc(vidclocks>>8,f); putc(vidclocks>>16,f); putc(vidclocks>>24,f); +} + +void video_loadstate(FILE *f) +{ + scrx=getc(f); scrx|=getc(f)<<8; + scry=getc(f); scry|=getc(f)<<8; + vidclocks=getc(f); vidclocks=getc(f)<<8; vidclocks=getc(f)<<16; vidclocks=getc(f)<<24; +} diff --git a/src/video.h b/src/video.h index fa8849eb..9b7b1988 100644 --- a/src/video.h +++ b/src/video.h @@ -1,35 +1,35 @@ -/*CRTC (6845)*/ -void crtc_reset(); -void crtc_write(uint16_t addr, uint8_t val); -uint8_t crtc_read(uint16_t addr); -void crtc_latchpen(); -void crtc_savestate(FILE *f); -void crtc_loadstate(FILE *f); - -extern uint8_t crtc[32]; -extern int crtc_i; - -extern int hc, vc, sc, vadj; -extern uint16_t ma, maback; - - -/*Video ULA (VIDPROC)*/ -void videoula_write(uint16_t addr, uint8_t val); -void videoula_savestate(FILE *f); -void videoula_loadstate(FILE *f); - -extern uint8_t ula_ctrl; -extern uint8_t ula_palbak[16]; - - -void video_init(); -void video_reset(); -void video_poll(int clocks); -void video_savestate(FILE *f); -void video_loadstate(FILE *f); - - -extern uint16_t vidbank; - -void mode7_makechars(); -extern int interlline; +/*CRTC (6845)*/ +void crtc_reset(); +void crtc_write(uint16_t addr, uint8_t val); +uint8_t crtc_read(uint16_t addr); +void crtc_latchpen(); +void crtc_savestate(FILE *f); +void crtc_loadstate(FILE *f); + +extern uint8_t crtc[32]; +extern int crtc_i; + +extern int hc, vc, sc, vadj; +extern uint16_t ma, maback; + + +/*Video ULA (VIDPROC)*/ +void videoula_write(uint16_t addr, uint8_t val); +void videoula_savestate(FILE *f); +void videoula_loadstate(FILE *f); + +extern uint8_t ula_ctrl; +extern uint8_t ula_palbak[16]; + + +void video_init(); +void video_reset(); +void video_poll(int clocks); +void video_savestate(FILE *f); +void video_loadstate(FILE *f); + + +extern uint16_t vidbank; + +void mode7_makechars(); +extern int interlline; diff --git a/src/video_render.h b/src/video_render.h index f65ad12b..0392ca3e 100644 --- a/src/video_render.h +++ b/src/video_render.h @@ -1,33 +1,33 @@ -extern PALETTE pal; -extern BITMAP *b, *b16, *b16x, *b32, *tb; -#ifdef WIN32 -extern BITMAP *vb; -#endif - -extern int firstx, firsty, lastx, lasty; - -extern int winsizex, winsizey; - -extern int fullscreen; -extern int dcol; - -extern int vid_linedbl; -extern int vid_interlace, vid_pal; -extern int vid_fskipmax, vid_scanlines; -extern int vid_fullborders; - -extern int videoresize; - -extern int vid_savescrshot; -extern char vid_scrshotname[260]; - -void video_doblit(); -void video_enterfullscreen(); -void video_leavefullscreen(); -void video_clearscreen(); - -void video_close(); - -void clearscreen(); - - +extern PALETTE pal; +extern BITMAP *b, *b16, *b16x, *b32, *tb; +#ifdef WIN32 +extern BITMAP *vb; +#endif + +extern int firstx, firsty, lastx, lasty; + +extern int winsizex, winsizey; + +extern int fullscreen; +extern int dcol; + +extern int vid_linedbl; +extern int vid_interlace, vid_pal; +extern int vid_fskipmax, vid_scanlines; +extern int vid_fullborders; + +extern int videoresize; + +extern int vid_savescrshot; +extern char vid_scrshotname[260]; + +void video_doblit(); +void video_enterfullscreen(); +void video_leavefullscreen(); +void video_clearscreen(); + +void video_close(); + +void clearscreen(); + + diff --git a/src/wd1770.c b/src/wd1770.c index bfa32586..8c8f2de9 100644 --- a/src/wd1770.c +++ b/src/wd1770.c @@ -1,342 +1,342 @@ -/*B-em v2.2 by Tom Walker - 1770 FDC emulation*/ -#include -#include -#include "b-em.h" -#include "6502.h" -#include "wd1770.h" -#include "disc.h" -#include "model.h" - -#define ABS(x) (((x)>0)?(x):-(x)) - -void wd1770_callback(); -void wd1770_data(uint8_t dat); -void wd1770_spindown(); -void wd1770_finishread(); -void wd1770_notfound(); -void wd1770_datacrcerror(); -void wd1770_headercrcerror(); -void wd1770_writeprotect(); -int wd1770_getdata(int last); - -struct -{ - uint8_t command, sector, track, status, data; - uint8_t ctrl; - int curside,curtrack; - int density; - int written; - int stepdir; -} wd1770; - -int byte; - -void wd1770_reset() -{ - nmi = 0; - wd1770.status = 0; - motorspin = 0; -// rpclog("Reset 1770\n"); - fdc_time = 0; - if (WD1770) - { - fdc_callback = wd1770_callback; - fdc_data = wd1770_data; - fdc_spindown = wd1770_spindown; - fdc_finishread = wd1770_finishread; - fdc_notfound = wd1770_notfound; - fdc_datacrcerror = wd1770_datacrcerror; - fdc_headercrcerror = wd1770_headercrcerror; - fdc_writeprotect = wd1770_writeprotect; - fdc_getdata = wd1770_getdata; - } - motorspin = 45000; -} - -void wd1770_spinup() -{ - wd1770.status |= 0x80; - motoron = 1; - motorspin = 0; -} - -void wd1770_spindown() -{ - wd1770.status &= ~0x80; - motoron = 0; -} - -void wd1770_setspindown() -{ - motorspin = 45000; -} - -#define track0 (wd1770.curtrack ? 4 : 0) - -void wd1770_write(uint16_t addr, uint8_t val) -{ -// rpclog("Write 1770 %04X %02X\n",addr,val); - switch (addr) - { - case 0xFE80: -// rpclog("Write CTRL FE80 %02X\n",val); - wd1770.ctrl = val; - curdrive = (val & 2) ? 1 : 0; - wd1770.curside = (wd1770.ctrl & 4) ? 1 : 0; - wd1770.density = !(wd1770.ctrl & 8); - break; - case 0xFE24: -// rpclog("Write CTRL FE24 %02X\n",val); - wd1770.ctrl = val; - curdrive = (val & 2) ? 1 : 0; - wd1770.curside = (wd1770.ctrl & 16) ? 1 : 0; - wd1770.density = !(wd1770.ctrl & 0x20); - break; - case 0xFE84: - case 0xFE28: - if (wd1770.status & 1 && (val >> 4) != 0xD) { rpclog("Command rejected\n"); return; } -// rpclog("FDC command %02X %i %i %i\n",val,wd1770.curside,wd1770.track,wd1770.sector); - wd1770.command = val; - if ((val >> 4) != 0xD)/* && !(val&8)) */wd1770_spinup(); - switch (val >> 4) - { - case 0x0: /*Restore*/ - wd1770.status = 0x80 | 0x21 | track0; - disc_seek(curdrive, 0); - break; - - case 0x1: /*Seek*/ - wd1770.status = 0x80 | 0x21 | track0; - disc_seek(curdrive, wd1770.data); - break; - - case 0x2: - case 0x3: /*Step*/ - wd1770.status = 0x80 | 0x21 | track0; - wd1770.curtrack += wd1770.stepdir; - if (wd1770.curtrack < 0) wd1770.curtrack = 0; - disc_seek(curdrive, wd1770.curtrack); - break; - - case 0x4: - case 0x5: /*Step in*/ - wd1770.status = 0x80 | 0x21 | track0; - wd1770.curtrack++; - disc_seek(curdrive, wd1770.curtrack); - wd1770.stepdir = 1; - break; - case 0x6: - case 0x7: /*Step out*/ - wd1770.status = 0x80 | 0x21 | track0; - wd1770.curtrack--; - if (wd1770.curtrack < 0) wd1770.curtrack = 0; - disc_seek(curdrive, wd1770.curtrack); - wd1770.stepdir = -1; - break; - - case 0x8: /*Read sector*/ - wd1770.status = 0x80 | 0x1; - disc_readsector(curdrive, wd1770.sector, wd1770.track, wd1770.curside, wd1770.density); - //printf("Read sector %i %i %i %i %i\n",curdrive,wd1770.sector,wd1770.track,wd1770.curside,wd1770.density); - byte = 0; - break; - case 0xA: /*Write sector*/ - wd1770.status = 0x80 | 0x1; - disc_writesector(curdrive, wd1770.sector, wd1770.track, wd1770.curside, wd1770.density); - byte = 0; - nmi |= 2; - wd1770.status |= 2; - -//Carlo Concari: wait for first data byte before starting sector write - wd1770.written = 0; - break; - case 0xC: /*Read address*/ - wd1770.status = 0x80 | 0x1; - disc_readaddress(curdrive, wd1770.track, wd1770.curside, wd1770.density); - byte = 0; - break; - case 0xD: /*Force interrupt*/ -// rpclog("Force interrupt\n"); - fdc_time = 0; - wd1770.status = 0x80 | track0; - nmi = (val & 8) ? 1 : 0; - wd1770_spindown(); - break; - case 0xF: /*Write track*/ - wd1770.status = 0x80 | 0x1; - disc_format(curdrive, wd1770.track, wd1770.curside, wd1770.density); - break; - - default: -// rpclog("Bad 1770 command %02X\n",val); - fdc_time = 0; - nmi = 1; - wd1770.status = 0x90; - wd1770_spindown(); - break; -/* rpclog("Bad 1770 command %02X\n", val); - dumpregs(); - mem_dump(); - exit(-1);*/ - } - break; - case 0xFE85: - case 0xFE29: - wd1770.track = val; - break; - case 0xFE86: - case 0xFE2A: - wd1770.sector = val; - break; - case 0xFE87: - case 0xFE2B: - nmi &= ~2; - wd1770.status &= ~2; - wd1770.data = val; - wd1770.written = 1; - break; - } -} - -uint8_t wd1770_read(uint16_t addr) -{ -// rpclog("Read 1770 %04X %04X\n",addr,pc); - switch (addr) - { - case 0xFE84: - case 0xFE28: - nmi &= ~1; -// rpclog("Status %02X\n",wd1770.status); - return wd1770.status; - case 0xFE85: - case 0xFE29: - return wd1770.track; - case 0xFE86: - case 0xFE2A: - return wd1770.sector; - case 0xFE87: - case 0xFE2B: - nmi &= ~2; - wd1770.status &= ~2; -// rpclog("Read data %02X %04X\n",wd1770.data,pc); - return wd1770.data; - } - return 0xFE; -} - -void wd1770_callback() -{ -// rpclog("FDC callback %02X\n",wd1770.command); - fdc_time = 0; - switch (wd1770.command >> 4) - { - case 0: /*Restore*/ - wd1770.curtrack = wd1770.track = 0; - wd1770.status = 0x80; - wd1770_setspindown(); - nmi |= 1; -// disc_seek(curdrive,0); - break; - case 1: /*Seek*/ - wd1770.curtrack = wd1770.track = wd1770.data; - wd1770.status = 0x80 | track0; - wd1770_setspindown(); - nmi |= 1; -// disc_seek(curdrive,wd1770.curtrack); - break; - case 3: /*Step*/ - case 5: /*Step in*/ - case 7: /*Step out*/ - wd1770.track = wd1770.curtrack; - case 2: /*Step*/ - case 4: /*Step in*/ - case 6: /*Step out*/ - wd1770.status = 0x80 | track0; - wd1770_setspindown(); - nmi |= 1; - break; - - case 8: /*Read sector*/ - wd1770.status = 0x80; - wd1770_setspindown(); - nmi |= 1; - break; - case 0xA: /*Write sector*/ - wd1770.status = 0x80; - wd1770_setspindown(); - nmi |= 1; - break; - case 0xC: /*Read address*/ - wd1770.status = 0x80; - wd1770_setspindown(); - nmi |= 1; - wd1770.sector = wd1770.track; - break; - case 0xF: /*Write tracl*/ - wd1770.status = 0x80; - wd1770_setspindown(); - nmi |= 1; - break; - } -} - -void wd1770_data(uint8_t dat) -{ - wd1770.data = dat; - wd1770.status |= 2; - nmi |= 2; -} - -void wd1770_finishread() -{ - fdc_time = 200; -} - -void wd1770_notfound() -{ -// rpclog("Not found\n"); - fdc_time = 0; - nmi = 1; - wd1770.status = 0x90; - wd1770_spindown(); -} - -void wd1770_datacrcerror() -{ -// rpclog("Data CRC\n"); - fdc_time = 0; - nmi = 1; - wd1770.status = 0x88; - wd1770_spindown(); -} - -void wd1770_headercrcerror() -{ -// rpclog("Header CRC\n"); - fdc_time = 0; - nmi = 1; - wd1770.status = 0x98; - wd1770_spindown(); -} - -int wd1770_getdata(int last) -{ -// rpclog("Disc get data\n"); - if (!wd1770.written) return -1; - if (!last) - { - nmi |= 2; - wd1770.status |= 2; - } - wd1770.written = 0; - return wd1770.data; -} - -void wd1770_writeprotect() -{ - fdc_time = 0; - nmi = 1; - wd1770.status = 0xC0; - wd1770_spindown(); -} +/*B-em v2.2 by Tom Walker + 1770 FDC emulation*/ +#include +#include +#include "b-em.h" +#include "6502.h" +#include "wd1770.h" +#include "disc.h" +#include "model.h" + +#define ABS(x) (((x)>0)?(x):-(x)) + +void wd1770_callback(); +void wd1770_data(uint8_t dat); +void wd1770_spindown(); +void wd1770_finishread(); +void wd1770_notfound(); +void wd1770_datacrcerror(); +void wd1770_headercrcerror(); +void wd1770_writeprotect(); +int wd1770_getdata(int last); + +struct +{ + uint8_t command, sector, track, status, data; + uint8_t ctrl; + int curside,curtrack; + int density; + int written; + int stepdir; +} wd1770; + +int byte; + +void wd1770_reset() +{ + nmi = 0; + wd1770.status = 0; + motorspin = 0; +// rpclog("Reset 1770\n"); + fdc_time = 0; + if (WD1770) + { + fdc_callback = wd1770_callback; + fdc_data = wd1770_data; + fdc_spindown = wd1770_spindown; + fdc_finishread = wd1770_finishread; + fdc_notfound = wd1770_notfound; + fdc_datacrcerror = wd1770_datacrcerror; + fdc_headercrcerror = wd1770_headercrcerror; + fdc_writeprotect = wd1770_writeprotect; + fdc_getdata = wd1770_getdata; + } + motorspin = 45000; +} + +void wd1770_spinup() +{ + wd1770.status |= 0x80; + motoron = 1; + motorspin = 0; +} + +void wd1770_spindown() +{ + wd1770.status &= ~0x80; + motoron = 0; +} + +void wd1770_setspindown() +{ + motorspin = 45000; +} + +#define track0 (wd1770.curtrack ? 4 : 0) + +void wd1770_write(uint16_t addr, uint8_t val) +{ +// rpclog("Write 1770 %04X %02X\n",addr,val); + switch (addr) + { + case 0xFE80: +// rpclog("Write CTRL FE80 %02X\n",val); + wd1770.ctrl = val; + curdrive = (val & 2) ? 1 : 0; + wd1770.curside = (wd1770.ctrl & 4) ? 1 : 0; + wd1770.density = !(wd1770.ctrl & 8); + break; + case 0xFE24: +// rpclog("Write CTRL FE24 %02X\n",val); + wd1770.ctrl = val; + curdrive = (val & 2) ? 1 : 0; + wd1770.curside = (wd1770.ctrl & 16) ? 1 : 0; + wd1770.density = !(wd1770.ctrl & 0x20); + break; + case 0xFE84: + case 0xFE28: + if (wd1770.status & 1 && (val >> 4) != 0xD) { rpclog("Command rejected\n"); return; } +// rpclog("FDC command %02X %i %i %i\n",val,wd1770.curside,wd1770.track,wd1770.sector); + wd1770.command = val; + if ((val >> 4) != 0xD)/* && !(val&8)) */wd1770_spinup(); + switch (val >> 4) + { + case 0x0: /*Restore*/ + wd1770.status = 0x80 | 0x21 | track0; + disc_seek(curdrive, 0); + break; + + case 0x1: /*Seek*/ + wd1770.status = 0x80 | 0x21 | track0; + disc_seek(curdrive, wd1770.data); + break; + + case 0x2: + case 0x3: /*Step*/ + wd1770.status = 0x80 | 0x21 | track0; + wd1770.curtrack += wd1770.stepdir; + if (wd1770.curtrack < 0) wd1770.curtrack = 0; + disc_seek(curdrive, wd1770.curtrack); + break; + + case 0x4: + case 0x5: /*Step in*/ + wd1770.status = 0x80 | 0x21 | track0; + wd1770.curtrack++; + disc_seek(curdrive, wd1770.curtrack); + wd1770.stepdir = 1; + break; + case 0x6: + case 0x7: /*Step out*/ + wd1770.status = 0x80 | 0x21 | track0; + wd1770.curtrack--; + if (wd1770.curtrack < 0) wd1770.curtrack = 0; + disc_seek(curdrive, wd1770.curtrack); + wd1770.stepdir = -1; + break; + + case 0x8: /*Read sector*/ + wd1770.status = 0x80 | 0x1; + disc_readsector(curdrive, wd1770.sector, wd1770.track, wd1770.curside, wd1770.density); + //printf("Read sector %i %i %i %i %i\n",curdrive,wd1770.sector,wd1770.track,wd1770.curside,wd1770.density); + byte = 0; + break; + case 0xA: /*Write sector*/ + wd1770.status = 0x80 | 0x1; + disc_writesector(curdrive, wd1770.sector, wd1770.track, wd1770.curside, wd1770.density); + byte = 0; + nmi |= 2; + wd1770.status |= 2; + +//Carlo Concari: wait for first data byte before starting sector write + wd1770.written = 0; + break; + case 0xC: /*Read address*/ + wd1770.status = 0x80 | 0x1; + disc_readaddress(curdrive, wd1770.track, wd1770.curside, wd1770.density); + byte = 0; + break; + case 0xD: /*Force interrupt*/ +// rpclog("Force interrupt\n"); + fdc_time = 0; + wd1770.status = 0x80 | track0; + nmi = (val & 8) ? 1 : 0; + wd1770_spindown(); + break; + case 0xF: /*Write track*/ + wd1770.status = 0x80 | 0x1; + disc_format(curdrive, wd1770.track, wd1770.curside, wd1770.density); + break; + + default: +// rpclog("Bad 1770 command %02X\n",val); + fdc_time = 0; + nmi = 1; + wd1770.status = 0x90; + wd1770_spindown(); + break; +/* rpclog("Bad 1770 command %02X\n", val); + dumpregs(); + mem_dump(); + exit(-1);*/ + } + break; + case 0xFE85: + case 0xFE29: + wd1770.track = val; + break; + case 0xFE86: + case 0xFE2A: + wd1770.sector = val; + break; + case 0xFE87: + case 0xFE2B: + nmi &= ~2; + wd1770.status &= ~2; + wd1770.data = val; + wd1770.written = 1; + break; + } +} + +uint8_t wd1770_read(uint16_t addr) +{ +// rpclog("Read 1770 %04X %04X\n",addr,pc); + switch (addr) + { + case 0xFE84: + case 0xFE28: + nmi &= ~1; +// rpclog("Status %02X\n",wd1770.status); + return wd1770.status; + case 0xFE85: + case 0xFE29: + return wd1770.track; + case 0xFE86: + case 0xFE2A: + return wd1770.sector; + case 0xFE87: + case 0xFE2B: + nmi &= ~2; + wd1770.status &= ~2; +// rpclog("Read data %02X %04X\n",wd1770.data,pc); + return wd1770.data; + } + return 0xFE; +} + +void wd1770_callback() +{ +// rpclog("FDC callback %02X\n",wd1770.command); + fdc_time = 0; + switch (wd1770.command >> 4) + { + case 0: /*Restore*/ + wd1770.curtrack = wd1770.track = 0; + wd1770.status = 0x80; + wd1770_setspindown(); + nmi |= 1; +// disc_seek(curdrive,0); + break; + case 1: /*Seek*/ + wd1770.curtrack = wd1770.track = wd1770.data; + wd1770.status = 0x80 | track0; + wd1770_setspindown(); + nmi |= 1; +// disc_seek(curdrive,wd1770.curtrack); + break; + case 3: /*Step*/ + case 5: /*Step in*/ + case 7: /*Step out*/ + wd1770.track = wd1770.curtrack; + case 2: /*Step*/ + case 4: /*Step in*/ + case 6: /*Step out*/ + wd1770.status = 0x80 | track0; + wd1770_setspindown(); + nmi |= 1; + break; + + case 8: /*Read sector*/ + wd1770.status = 0x80; + wd1770_setspindown(); + nmi |= 1; + break; + case 0xA: /*Write sector*/ + wd1770.status = 0x80; + wd1770_setspindown(); + nmi |= 1; + break; + case 0xC: /*Read address*/ + wd1770.status = 0x80; + wd1770_setspindown(); + nmi |= 1; + wd1770.sector = wd1770.track; + break; + case 0xF: /*Write tracl*/ + wd1770.status = 0x80; + wd1770_setspindown(); + nmi |= 1; + break; + } +} + +void wd1770_data(uint8_t dat) +{ + wd1770.data = dat; + wd1770.status |= 2; + nmi |= 2; +} + +void wd1770_finishread() +{ + fdc_time = 200; +} + +void wd1770_notfound() +{ +// rpclog("Not found\n"); + fdc_time = 0; + nmi = 1; + wd1770.status = 0x90; + wd1770_spindown(); +} + +void wd1770_datacrcerror() +{ +// rpclog("Data CRC\n"); + fdc_time = 0; + nmi = 1; + wd1770.status = 0x88; + wd1770_spindown(); +} + +void wd1770_headercrcerror() +{ +// rpclog("Header CRC\n"); + fdc_time = 0; + nmi = 1; + wd1770.status = 0x98; + wd1770_spindown(); +} + +int wd1770_getdata(int last) +{ +// rpclog("Disc get data\n"); + if (!wd1770.written) return -1; + if (!last) + { + nmi |= 2; + wd1770.status |= 2; + } + wd1770.written = 0; + return wd1770.data; +} + +void wd1770_writeprotect() +{ + fdc_time = 0; + nmi = 1; + wd1770.status = 0xC0; + wd1770_spindown(); +} diff --git a/src/wd1770.h b/src/wd1770.h index fb0d8a29..c50aa751 100644 --- a/src/wd1770.h +++ b/src/wd1770.h @@ -1,4 +1,4 @@ -void wd1770_reset(); -uint8_t wd1770_read(uint16_t addr); -void wd1770_write(uint16_t addr, uint8_t val); - +void wd1770_reset(); +uint8_t wd1770_read(uint16_t addr); +void wd1770_write(uint16_t addr, uint8_t val); + diff --git a/src/win-catalogue.c b/src/win-catalogue.c index f18c428e..20dc9577 100644 --- a/src/win-catalogue.c +++ b/src/win-catalogue.c @@ -1,75 +1,75 @@ -/*B-em v2.2 by Tom Walker - Windows tape catalogue window*/ - -#ifdef WIN32 -#include - -#include "b-em.h" -#include "csw.h" -#include "uef.h" - -#include "resources.h" - -void findfilenamescsw(); -void findfilenamesuef(); - -HWND hwndCat; -HWND cath; -int catwindowopen=0; - -void clearcatwindow() -{ - int c; - if (!catwindowopen) return; - for (c=100;c>=0;c--) - SendMessage(cath,LB_DELETESTRING,c,(LPARAM)NULL); -} - -void cataddname(char *s) -{ - if (!catwindowopen) return; - SendMessage(cath,LB_ADDSTRING,(WPARAM)NULL,(LPARAM)s); -} - -BOOL CALLBACK catdlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch (message) - { - case WM_INITDIALOG: - cath=GetDlgItem(hdlg,ListBox1); - catwindowopen=1; - if (csw_ena) csw_findfilenames(); - else uef_findfilenames(); -// SendMessage(h,LB_ADDSTRING,NULL,"test"); - return TRUE; - case WM_COMMAND: - switch (LOWORD(wParam)) - { - case IDCANCEL: case IDOK: return TRUE; - } - break; - case WM_SYSCOMMAND: - switch (LOWORD(wParam)&0xFFF0) - { - case SC_CLOSE: - DestroyWindow(hdlg); - catwindowopen=0; - return TRUE; - } - break; - } - return FALSE; -} - -void showcatalogue(HINSTANCE hinstance, HWND hwnd) -{ - if (!IsWindow(hwndCat)) - { - hwndCat = CreateDialog(hinstance, - TEXT("Catalogue"), - hwnd, - (DLGPROC)catdlgproc); - ShowWindow(hwndCat, SW_SHOW); - } -} -#endif +/*B-em v2.2 by Tom Walker + Windows tape catalogue window*/ + +#ifdef WIN32 +#include + +#include "b-em.h" +#include "csw.h" +#include "uef.h" + +#include "resources.h" + +void findfilenamescsw(); +void findfilenamesuef(); + +HWND hwndCat; +HWND cath; +int catwindowopen=0; + +void clearcatwindow() +{ + int c; + if (!catwindowopen) return; + for (c=100;c>=0;c--) + SendMessage(cath,LB_DELETESTRING,c,(LPARAM)NULL); +} + +void cataddname(char *s) +{ + if (!catwindowopen) return; + SendMessage(cath,LB_ADDSTRING,(WPARAM)NULL,(LPARAM)s); +} + +BOOL CALLBACK catdlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + cath=GetDlgItem(hdlg,ListBox1); + catwindowopen=1; + if (csw_ena) csw_findfilenames(); + else uef_findfilenames(); +// SendMessage(h,LB_ADDSTRING,NULL,"test"); + return TRUE; + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDCANCEL: case IDOK: return TRUE; + } + break; + case WM_SYSCOMMAND: + switch (LOWORD(wParam)&0xFFF0) + { + case SC_CLOSE: + DestroyWindow(hdlg); + catwindowopen=0; + return TRUE; + } + break; + } + return FALSE; +} + +void showcatalogue(HINSTANCE hinstance, HWND hwnd) +{ + if (!IsWindow(hwndCat)) + { + hwndCat = CreateDialog(hinstance, + TEXT("Catalogue"), + hwnd, + (DLGPROC)catdlgproc); + ShowWindow(hwndCat, SW_SHOW); + } +} +#endif diff --git a/src/win-keydefine.c b/src/win-keydefine.c index 26b29318..76b6c1ed 100644 --- a/src/win-keydefine.c +++ b/src/win-keydefine.c @@ -1,260 +1,260 @@ -/*B-em v2.2 by Tom Walker - Windows key redefinition*/ - -#ifdef WIN32 -#include -#include -#include "resources.h" - -#include "b-em.h" -#include "keyboard.h" -#include "model.h" -#include "win.h" - - -char szClasskey[] = "B-emKeyWnd"; - -HWND khwnd=NULL; -LRESULT CALLBACK KeyWindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); -int keywind=0,windcurkey; - -void getkey(HWND parent) -{ - MSG messages; - WNDCLASSEX wincl; /* Data structure for the windowclass */ - if (!GetClassInfoEx(hinstance,szClasskey,&wincl)) - { - /* The Window structure */ - wincl.hInstance = hinstance; - wincl.lpszClassName = szClasskey; - wincl.lpfnWndProc = KeyWindowProcedure; /* This function is called by windows */ - wincl.style = CS_DBLCLKS; /* Catch double-clicks */ - wincl.cbSize = sizeof (WNDCLASSEX); - - /* Use default icon and mouse-pointer */ - wincl.hIcon = LoadIcon(hinstance, "allegro_icon"); - wincl.hIconSm = LoadIcon(hinstance, "allegro_icon"); - wincl.hCursor = LoadCursor (NULL, IDC_ARROW); - wincl.lpszMenuName = NULL; /* No menu */ - wincl.cbClsExtra = 0; /* No extra bytes after the window class */ - wincl.cbWndExtra = 0; /* structure or the window instance */ - /* Use Windows's default color as the background of the window */ - wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND; - - /* Register the window class, and if it fails quit the program */ - if (!RegisterClassEx (&wincl)) - return; - } - - if (khwnd) SendMessage(khwnd, WM_CLOSE, 0, 0); - - /* The class is registered, let's create the window*/ - khwnd = CreateWindowEx ( - 0, /* Extended possibilites for variation */ - szClasskey, /* Classname */ - "Press key to define", /* Title Text */ - WS_OVERLAPPEDWINDOW&~WS_SIZEBOX, /* default window */ - CW_USEDEFAULT, /* Windows decides the position */ - CW_USEDEFAULT, /* where the window ends up on the screen */ - 240, - 80, - parent, /* The window is a child-window to desktop */ - NULL, - hinstance, /* Program Instance handler */ - NULL /* No Window Creation data */ - ); - ShowWindow(khwnd, SW_SHOW); - keywind = 0; - while (!keywind) - { - if (PeekMessage(&messages, NULL, 0, 0, PM_REMOVE)) - { - if (messages.message == WM_QUIT) keywind = 1; - TranslateMessage(&messages); - DispatchMessage(&messages); - } - else - Sleep(10); - } - khwnd = NULL; -} - -char *key_names[] = -{ - "", "A", "B", "C", - "D", "E", "F", "G", - "H", "I", "J", "K", - "L", "M", "N", "O", - "P", "Q", "R", "S", - "T", "U", "V", "W", - "X", "Y", "Z", "0", - "1", "2", "3", "4", - "5", "6", "7", "8", - "9", "0_PAD", "1_PAD", "2_PAD", - "3_PAD", "4_PAD", "5_PAD", "6_PAD", - "7_PAD", "8_PAD", "9_PAD", "F1", - "F2", "F3", "F4", "F5", - "F6", "F7", "F8", "F9", - "F10", "F11", "F12", "ESC", - "TILDE", "MINUS", "EQUALS", "BACKSPACE", - "TAB", "OPENBRACE", "CLOSEBRACE", "ENTER", - "COLON", "QUOTE", "BACKSLASH", "BACKSLASH2", - "COMMA", "STOP", "SLASH", "SPACE", - "INSERT", "DEL", "HOME", "END", - "PGUP", "PGDN", "LEFT", "RIGHT", - "UP", "DOWN", "SLASH_PAD", "ASTERISK", - "MINUS_PAD", "PLUS_PAD", "DEL_PAD", "ENTER_PAD", - "PRTSCR", "PAUSE", "ABNT_C1", "YEN", - "KANA", "CONVERT", "NOCONVERT", "AT", - "CIRCUMFLEX", "COLON2", "KANJI", "EQUALS_PAD", - "BACKQUOTE", "SEMICOLON", "COMMAND", "UNKNOWN1", - "UNKNOWN2", "UNKNOWN3", "UNKNOWN4", "UNKNOWN5", - "UNKNOWN6", "UNKNOWN7", "UNKNOWN8", "LSHIFT", - "RSHIFT", "LCONTROL", "RCONTROL", "ALT", - "ALTGR", "LWIN", "RWIN", "MENU", - "SCRLOCK", "NUMLOCK", "CAPSLOCK", "MAX" -}; -HWND hwndCtrl; -unsigned char hw_to_mycode[256] = { - /* 0x00 */ 0, KEY_ESC, KEY_1, KEY_2, - /* 0x04 */ KEY_3, KEY_4, KEY_5, KEY_6, - /* 0x08 */ KEY_7, KEY_8, KEY_9, KEY_0, - /* 0x0C */ KEY_MINUS, KEY_EQUALS, KEY_BACKSPACE, KEY_TAB, - /* 0x10 */ KEY_Q, KEY_W, KEY_E, KEY_R, - /* 0x14 */ KEY_T, KEY_Y, KEY_U, KEY_I, - /* 0x18 */ KEY_O, KEY_P, KEY_OPENBRACE, KEY_CLOSEBRACE, - /* 0x1C */ KEY_ENTER, KEY_LCONTROL, KEY_A, KEY_S, - /* 0x20 */ KEY_D, KEY_F, KEY_G, KEY_H, - /* 0x24 */ KEY_J, KEY_K, KEY_L, KEY_SEMICOLON, - /* 0x28 */ KEY_QUOTE, KEY_TILDE, KEY_LSHIFT, KEY_BACKSLASH, - /* 0x2C */ KEY_Z, KEY_X, KEY_C, KEY_V, - /* 0x30 */ KEY_B, KEY_N, KEY_M, KEY_COMMA, - /* 0x34 */ KEY_STOP, KEY_SLASH, KEY_RSHIFT, KEY_ASTERISK, - /* 0x38 */ KEY_ALT, KEY_SPACE, KEY_CAPSLOCK, KEY_F1, - /* 0x3C */ KEY_F2, KEY_F3, KEY_F4, KEY_F5, - /* 0x40 */ KEY_F6, KEY_F7, KEY_F8, KEY_F9, - /* 0x44 */ KEY_F10, KEY_NUMLOCK, KEY_SCRLOCK, KEY_7_PAD, - /* 0x48 */ KEY_8_PAD, KEY_9_PAD, KEY_MINUS_PAD, KEY_4_PAD, - /* 0x4C */ KEY_5_PAD, KEY_6_PAD, KEY_PLUS_PAD, KEY_1_PAD, - /* 0x50 */ KEY_2_PAD, KEY_3_PAD, KEY_0_PAD, KEY_DEL_PAD, - /* 0x54 */ KEY_PRTSCR, 0, KEY_BACKSLASH2, KEY_F11, - /* 0x58 */ KEY_F12, 0, 0, KEY_LWIN, - /* 0x5C */ KEY_RWIN, KEY_MENU, 0, 0, - /* 0x60 */ 0, 0, 0, 0, - /* 0x64 */ 0, 0, 0, 0, - /* 0x68 */ 0, 0, 0, 0, - /* 0x6C */ 0, 0, 0, 0, - /* 0x70 */ KEY_KANA, 0, 0, KEY_ABNT_C1, - /* 0x74 */ 0, 0, 0, 0, - /* 0x78 */ 0, KEY_CONVERT, 0, KEY_NOCONVERT, - /* 0x7C */ 0, KEY_YEN, 0, 0, - /* 0x80 */ 0, 0, 0, 0, - /* 0x84 */ 0, 0, 0, 0, - /* 0x88 */ 0, 0, 0, 0, - /* 0x8C */ 0, 0, 0, 0, - /* 0x90 */ 0, KEY_AT, KEY_COLON2, 0, - /* 0x94 */ KEY_KANJI, 0, 0, 0, - /* 0x98 */ 0, 0, 0, 0, - /* 0x9C */ KEY_ENTER_PAD, KEY_RCONTROL, 0, 0, - /* 0xA0 */ 0, 0, 0, 0, - /* 0xA4 */ 0, 0, 0, 0, - /* 0xA8 */ 0, 0, 0, 0, - /* 0xAC */ 0, 0, 0, 0, - /* 0xB0 */ 0, 0, 0, 0, - /* 0xB4 */ 0, KEY_SLASH_PAD, 0, KEY_PRTSCR, - /* 0xB8 */ KEY_ALTGR, 0, 0, 0, - /* 0xBC */ 0, 0, 0, 0, - /* 0xC0 */ 0, 0, 0, 0, - /* 0xC4 */ 0, KEY_PAUSE, 0, KEY_HOME, - /* 0xC8 */ KEY_UP, KEY_PGUP, 0, KEY_LEFT, - /* 0xCC */ 0, KEY_RIGHT, 0, KEY_END, - /* 0xD0 */ KEY_DOWN, KEY_PGDN, KEY_INSERT, KEY_DEL, - /* 0xD4 */ 0, 0, 0, 0, - /* 0xD8 */ 0, 0, 0, KEY_LWIN, - /* 0xDC */ KEY_RWIN, KEY_MENU, 0, 0, - /* 0xE0 */ 0, 0, 0, 0, - /* 0xE4 */ 0, 0, 0, 0, - /* 0xE8 */ 0, 0, 0, 0, - /* 0xEC */ 0, 0, 0, 0, - /* 0xF0 */ 0, 0, 0, 0, - /* 0xF4 */ 0, 0, 0, 0, - /* 0xF8 */ 0, 0, 0, 0, - /* 0xFC */ 0, 0, 0, 0 -}; -LRESULT CALLBACK KeyWindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - char s[1024], s2[1024], s3[64]; - int c; - switch (message) - { - case WM_CREATE: - sprintf(s, "Redefining %s", key_names[windcurkey]); - hwndCtrl = CreateWindow( "STATIC", s, WS_CHILD | SS_SIMPLE | WS_VISIBLE, 4, 4, 240-10, 16, hwnd, NULL, hinstance, NULL ); - hwndCtrl = CreateWindow( "STATIC", "Assigned to PC key(s): ", WS_CHILD | SS_SIMPLE | WS_VISIBLE, 4, 20, 240-10, 16, hwnd, NULL, hinstance, NULL ); - s[0] = 0; - for (c = 0; c < 128; c++) - { - if (keylookup[c] == windcurkey) - { - if (s[0]) sprintf(s3, ", %s", key_names[c]); - else sprintf(s3, "%s", key_names[c]); - sprintf(s2, "%s%s", s, s3); - strcpy(s, s2); - } - } - hwndCtrl = CreateWindow( "STATIC", s, WS_CHILD | SS_SIMPLE | WS_VISIBLE, 4, 36, 240-10, 16, hwnd, NULL, hinstance, NULL ); - break; - - case WM_SYSKEYUP: - case WM_KEYUP: - if (LOWORD(wParam) != 255) - { - c = MapVirtualKey(LOWORD(wParam), 0); - c = hw_to_mycode[c]; - keylookup[c] = windcurkey; - PostMessage(hwnd, WM_CLOSE, 0, 0); - break; - } - break; - - case WM_DESTROY: - PostQuitMessage (0); /* send a WM_QUIT to the message queue */ - break; - - default: - return DefWindowProc (hwnd, message, wParam, lParam); - } - return 0; -} - -BOOL CALLBACK redefinedlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch (message) - { - case WM_INITDIALOG: - return TRUE; - case WM_COMMAND: - switch (LOWORD(wParam)) - { - case IDOK: - case IDCANCEL: - EndDialog(hdlg, 0); - return TRUE; - } - if (LOWORD(wParam) >= Button1 && LOWORD(wParam) <= (Button1 + 128) && !khwnd) - { - windcurkey = LOWORD(wParam) - Button1; - getkey(hdlg); -// DialogBox(hinstance,TEXT("KeyDlg"),hdlg,keydlgproc); - } - break; - } - return FALSE; -} - -void redefinekeys() -{ - if (MASTER) DialogBox(hinstance, TEXT("RedefineM"), ghwnd, redefinedlgproc); - else DialogBox(hinstance, TEXT("Redefine"), ghwnd, redefinedlgproc); -} -#endif +/*B-em v2.2 by Tom Walker + Windows key redefinition*/ + +#ifdef WIN32 +#include +#include +#include "resources.h" + +#include "b-em.h" +#include "keyboard.h" +#include "model.h" +#include "win.h" + + +char szClasskey[] = "B-emKeyWnd"; + +HWND khwnd=NULL; +LRESULT CALLBACK KeyWindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); +int keywind=0,windcurkey; + +void getkey(HWND parent) +{ + MSG messages; + WNDCLASSEX wincl; /* Data structure for the windowclass */ + if (!GetClassInfoEx(hinstance,szClasskey,&wincl)) + { + /* The Window structure */ + wincl.hInstance = hinstance; + wincl.lpszClassName = szClasskey; + wincl.lpfnWndProc = KeyWindowProcedure; /* This function is called by windows */ + wincl.style = CS_DBLCLKS; /* Catch double-clicks */ + wincl.cbSize = sizeof (WNDCLASSEX); + + /* Use default icon and mouse-pointer */ + wincl.hIcon = LoadIcon(hinstance, "allegro_icon"); + wincl.hIconSm = LoadIcon(hinstance, "allegro_icon"); + wincl.hCursor = LoadCursor (NULL, IDC_ARROW); + wincl.lpszMenuName = NULL; /* No menu */ + wincl.cbClsExtra = 0; /* No extra bytes after the window class */ + wincl.cbWndExtra = 0; /* structure or the window instance */ + /* Use Windows's default color as the background of the window */ + wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND; + + /* Register the window class, and if it fails quit the program */ + if (!RegisterClassEx (&wincl)) + return; + } + + if (khwnd) SendMessage(khwnd, WM_CLOSE, 0, 0); + + /* The class is registered, let's create the window*/ + khwnd = CreateWindowEx ( + 0, /* Extended possibilites for variation */ + szClasskey, /* Classname */ + "Press key to define", /* Title Text */ + WS_OVERLAPPEDWINDOW&~WS_SIZEBOX, /* default window */ + CW_USEDEFAULT, /* Windows decides the position */ + CW_USEDEFAULT, /* where the window ends up on the screen */ + 240, + 80, + parent, /* The window is a child-window to desktop */ + NULL, + hinstance, /* Program Instance handler */ + NULL /* No Window Creation data */ + ); + ShowWindow(khwnd, SW_SHOW); + keywind = 0; + while (!keywind) + { + if (PeekMessage(&messages, NULL, 0, 0, PM_REMOVE)) + { + if (messages.message == WM_QUIT) keywind = 1; + TranslateMessage(&messages); + DispatchMessage(&messages); + } + else + Sleep(10); + } + khwnd = NULL; +} + +char *key_names[] = +{ + "", "A", "B", "C", + "D", "E", "F", "G", + "H", "I", "J", "K", + "L", "M", "N", "O", + "P", "Q", "R", "S", + "T", "U", "V", "W", + "X", "Y", "Z", "0", + "1", "2", "3", "4", + "5", "6", "7", "8", + "9", "0_PAD", "1_PAD", "2_PAD", + "3_PAD", "4_PAD", "5_PAD", "6_PAD", + "7_PAD", "8_PAD", "9_PAD", "F1", + "F2", "F3", "F4", "F5", + "F6", "F7", "F8", "F9", + "F10", "F11", "F12", "ESC", + "TILDE", "MINUS", "EQUALS", "BACKSPACE", + "TAB", "OPENBRACE", "CLOSEBRACE", "ENTER", + "COLON", "QUOTE", "BACKSLASH", "BACKSLASH2", + "COMMA", "STOP", "SLASH", "SPACE", + "INSERT", "DEL", "HOME", "END", + "PGUP", "PGDN", "LEFT", "RIGHT", + "UP", "DOWN", "SLASH_PAD", "ASTERISK", + "MINUS_PAD", "PLUS_PAD", "DEL_PAD", "ENTER_PAD", + "PRTSCR", "PAUSE", "ABNT_C1", "YEN", + "KANA", "CONVERT", "NOCONVERT", "AT", + "CIRCUMFLEX", "COLON2", "KANJI", "EQUALS_PAD", + "BACKQUOTE", "SEMICOLON", "COMMAND", "UNKNOWN1", + "UNKNOWN2", "UNKNOWN3", "UNKNOWN4", "UNKNOWN5", + "UNKNOWN6", "UNKNOWN7", "UNKNOWN8", "LSHIFT", + "RSHIFT", "LCONTROL", "RCONTROL", "ALT", + "ALTGR", "LWIN", "RWIN", "MENU", + "SCRLOCK", "NUMLOCK", "CAPSLOCK", "MAX" +}; +HWND hwndCtrl; +unsigned char hw_to_mycode[256] = { + /* 0x00 */ 0, KEY_ESC, KEY_1, KEY_2, + /* 0x04 */ KEY_3, KEY_4, KEY_5, KEY_6, + /* 0x08 */ KEY_7, KEY_8, KEY_9, KEY_0, + /* 0x0C */ KEY_MINUS, KEY_EQUALS, KEY_BACKSPACE, KEY_TAB, + /* 0x10 */ KEY_Q, KEY_W, KEY_E, KEY_R, + /* 0x14 */ KEY_T, KEY_Y, KEY_U, KEY_I, + /* 0x18 */ KEY_O, KEY_P, KEY_OPENBRACE, KEY_CLOSEBRACE, + /* 0x1C */ KEY_ENTER, KEY_LCONTROL, KEY_A, KEY_S, + /* 0x20 */ KEY_D, KEY_F, KEY_G, KEY_H, + /* 0x24 */ KEY_J, KEY_K, KEY_L, KEY_SEMICOLON, + /* 0x28 */ KEY_QUOTE, KEY_TILDE, KEY_LSHIFT, KEY_BACKSLASH, + /* 0x2C */ KEY_Z, KEY_X, KEY_C, KEY_V, + /* 0x30 */ KEY_B, KEY_N, KEY_M, KEY_COMMA, + /* 0x34 */ KEY_STOP, KEY_SLASH, KEY_RSHIFT, KEY_ASTERISK, + /* 0x38 */ KEY_ALT, KEY_SPACE, KEY_CAPSLOCK, KEY_F1, + /* 0x3C */ KEY_F2, KEY_F3, KEY_F4, KEY_F5, + /* 0x40 */ KEY_F6, KEY_F7, KEY_F8, KEY_F9, + /* 0x44 */ KEY_F10, KEY_NUMLOCK, KEY_SCRLOCK, KEY_7_PAD, + /* 0x48 */ KEY_8_PAD, KEY_9_PAD, KEY_MINUS_PAD, KEY_4_PAD, + /* 0x4C */ KEY_5_PAD, KEY_6_PAD, KEY_PLUS_PAD, KEY_1_PAD, + /* 0x50 */ KEY_2_PAD, KEY_3_PAD, KEY_0_PAD, KEY_DEL_PAD, + /* 0x54 */ KEY_PRTSCR, 0, KEY_BACKSLASH2, KEY_F11, + /* 0x58 */ KEY_F12, 0, 0, KEY_LWIN, + /* 0x5C */ KEY_RWIN, KEY_MENU, 0, 0, + /* 0x60 */ 0, 0, 0, 0, + /* 0x64 */ 0, 0, 0, 0, + /* 0x68 */ 0, 0, 0, 0, + /* 0x6C */ 0, 0, 0, 0, + /* 0x70 */ KEY_KANA, 0, 0, KEY_ABNT_C1, + /* 0x74 */ 0, 0, 0, 0, + /* 0x78 */ 0, KEY_CONVERT, 0, KEY_NOCONVERT, + /* 0x7C */ 0, KEY_YEN, 0, 0, + /* 0x80 */ 0, 0, 0, 0, + /* 0x84 */ 0, 0, 0, 0, + /* 0x88 */ 0, 0, 0, 0, + /* 0x8C */ 0, 0, 0, 0, + /* 0x90 */ 0, KEY_AT, KEY_COLON2, 0, + /* 0x94 */ KEY_KANJI, 0, 0, 0, + /* 0x98 */ 0, 0, 0, 0, + /* 0x9C */ KEY_ENTER_PAD, KEY_RCONTROL, 0, 0, + /* 0xA0 */ 0, 0, 0, 0, + /* 0xA4 */ 0, 0, 0, 0, + /* 0xA8 */ 0, 0, 0, 0, + /* 0xAC */ 0, 0, 0, 0, + /* 0xB0 */ 0, 0, 0, 0, + /* 0xB4 */ 0, KEY_SLASH_PAD, 0, KEY_PRTSCR, + /* 0xB8 */ KEY_ALTGR, 0, 0, 0, + /* 0xBC */ 0, 0, 0, 0, + /* 0xC0 */ 0, 0, 0, 0, + /* 0xC4 */ 0, KEY_PAUSE, 0, KEY_HOME, + /* 0xC8 */ KEY_UP, KEY_PGUP, 0, KEY_LEFT, + /* 0xCC */ 0, KEY_RIGHT, 0, KEY_END, + /* 0xD0 */ KEY_DOWN, KEY_PGDN, KEY_INSERT, KEY_DEL, + /* 0xD4 */ 0, 0, 0, 0, + /* 0xD8 */ 0, 0, 0, KEY_LWIN, + /* 0xDC */ KEY_RWIN, KEY_MENU, 0, 0, + /* 0xE0 */ 0, 0, 0, 0, + /* 0xE4 */ 0, 0, 0, 0, + /* 0xE8 */ 0, 0, 0, 0, + /* 0xEC */ 0, 0, 0, 0, + /* 0xF0 */ 0, 0, 0, 0, + /* 0xF4 */ 0, 0, 0, 0, + /* 0xF8 */ 0, 0, 0, 0, + /* 0xFC */ 0, 0, 0, 0 +}; +LRESULT CALLBACK KeyWindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + char s[1024], s2[1024], s3[64]; + int c; + switch (message) + { + case WM_CREATE: + sprintf(s, "Redefining %s", key_names[windcurkey]); + hwndCtrl = CreateWindow( "STATIC", s, WS_CHILD | SS_SIMPLE | WS_VISIBLE, 4, 4, 240-10, 16, hwnd, NULL, hinstance, NULL ); + hwndCtrl = CreateWindow( "STATIC", "Assigned to PC key(s): ", WS_CHILD | SS_SIMPLE | WS_VISIBLE, 4, 20, 240-10, 16, hwnd, NULL, hinstance, NULL ); + s[0] = 0; + for (c = 0; c < 128; c++) + { + if (keylookup[c] == windcurkey) + { + if (s[0]) sprintf(s3, ", %s", key_names[c]); + else sprintf(s3, "%s", key_names[c]); + sprintf(s2, "%s%s", s, s3); + strcpy(s, s2); + } + } + hwndCtrl = CreateWindow( "STATIC", s, WS_CHILD | SS_SIMPLE | WS_VISIBLE, 4, 36, 240-10, 16, hwnd, NULL, hinstance, NULL ); + break; + + case WM_SYSKEYUP: + case WM_KEYUP: + if (LOWORD(wParam) != 255) + { + c = MapVirtualKey(LOWORD(wParam), 0); + c = hw_to_mycode[c]; + keylookup[c] = windcurkey; + PostMessage(hwnd, WM_CLOSE, 0, 0); + break; + } + break; + + case WM_DESTROY: + PostQuitMessage (0); /* send a WM_QUIT to the message queue */ + break; + + default: + return DefWindowProc (hwnd, message, wParam, lParam); + } + return 0; +} + +BOOL CALLBACK redefinedlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + return TRUE; + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDOK: + case IDCANCEL: + EndDialog(hdlg, 0); + return TRUE; + } + if (LOWORD(wParam) >= Button1 && LOWORD(wParam) <= (Button1 + 128) && !khwnd) + { + windcurkey = LOWORD(wParam) - Button1; + getkey(hdlg); +// DialogBox(hinstance,TEXT("KeyDlg"),hdlg,keydlgproc); + } + break; + } + return FALSE; +} + +void redefinekeys() +{ + if (MASTER) DialogBox(hinstance, TEXT("RedefineM"), ghwnd, redefinedlgproc); + else DialogBox(hinstance, TEXT("Redefine"), ghwnd, redefinedlgproc); +} +#endif diff --git a/src/win-opengl.c b/src/win-opengl.c new file mode 100644 index 00000000..77023eb9 --- /dev/null +++ b/src/win-opengl.c @@ -0,0 +1,109 @@ +#include +#include +#include +#include + +void flipgl(); +HDC hDC; +HGLRC hRC; + +int initgl(HWND hwnd) +{ + GLuint PixelFormat; +// int dcol=desktop_color_depth(); + + static PIXELFORMATDESCRIPTOR pfd= // pfd Tells Windows How We Want Things To Be + { + sizeof(PIXELFORMATDESCRIPTOR), // Size Of This Pixel Format Descriptor + 1, // Version Number + PFD_DRAW_TO_WINDOW | // Format Must Support Window + PFD_SUPPORT_OPENGL | // Format Must Support OpenGL + PFD_DOUBLEBUFFER, // Must Support Double Buffering + PFD_TYPE_RGBA, // Request An RGBA Format + 32, // Select Our Color Depth + 0, 0, 0, 0, 0, 0, // Color Bits Ignored + 0, // No Alpha Buffer + 0, // Shift Bit Ignored + 0, // No Accumulation Buffer + 0, 0, 0, 0, // Accumulation Bits Ignored + 16, // 16Bit Z-Buffer (Depth Buffer) + 0, // No Stencil Buffer + 0, // No Auxiliary Buffer + PFD_MAIN_PLANE, // Main Drawing Layer + 0, // Reserved + 0, 0, 0 // Layer Masks Ignored + }; + + if (!(hDC=GetDC(hwnd))) // Did We Get A Device Context? + { + MessageBox(NULL,"Can't Create A GL Device Context.","ERROR",MB_OK|MB_ICONEXCLAMATION); + return FALSE; // Return FALSE + } + + if (PixelFormat = GetPixelFormat(hDC)) { + + // obtain a detailed description of that pixel format + DescribePixelFormat(hDC, PixelFormat, + sizeof(PIXELFORMATDESCRIPTOR), &pfd); + } + else if (!(PixelFormat=ChoosePixelFormat(hDC,&pfd))) // Did Windows Find A Matching Pixel Format? + { + MessageBox(NULL,"Can't Find A Suitable PixelFormat.","ERROR",MB_OK|MB_ICONEXCLAMATION); + return FALSE; // Return FALSE + } + + if(!SetPixelFormat(hDC,PixelFormat,&pfd)) // Are We Able To Set The Pixel Format? + { + MessageBox(NULL,"Can't Set The PixelFormat.","ERROR",MB_OK|MB_ICONEXCLAMATION); + return FALSE; // Return FALSE + } + + if (!(hRC=wglCreateContext(hDC))) // Are We Able To Get A Rendering Context? + { + MessageBox(NULL,"Can't Create A GL Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION); + return FALSE; // Return FALSE + } + + if(!wglMakeCurrent(hDC,hRC)) // Try To Activate The Rendering Context + { + MessageBox(NULL,"Can't Activate The GL Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION); + return FALSE; // Return FALSE + } + +// glViewport(0, 0, 640, 480); + + + glViewport(0,0,640,480); // Reset The Current Viewport + + glMatrixMode(GL_PROJECTION); // Select The Projection Matrix + glLoadIdentity(); // Reset The Projection Matrix + + // Calculate The Aspect Ratio Of The Window + gluPerspective(45.0f,(GLfloat)640/(GLfloat)480,0.1f,100.0f); + + glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix + glLoadIdentity(); // Reset The Modelview Matrix + + + glShadeModel(GL_SMOOTH); // Enable Smooth Shading + glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background + glClearDepth(1.0f); // Depth Buffer Setup + glEnable(GL_DEPTH_TEST); // Enables Depth Testing + glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective Calculations + + + return TRUE; +} + +void closegl() +{ + wglMakeCurrent(NULL,NULL); + wglDeleteContext(hRC); +} + +void flipgl() +{ + SwapBuffers(hDC); + rpclog("Swapping buffers...\n"); +} diff --git a/src/win.c b/src/win.c index db982c88..871b90d0 100644 --- a/src/win.c +++ b/src/win.c @@ -1,955 +1,955 @@ -/*B-em v2.2 by Tom Walker - Windows main*/ - -#ifdef WIN32 -#include -#include -#include -#include "resources.h" - -#include "b-em.h" - -#include "config.h" -#include "ddnoise.h" -#include "debugger.h" -#include "disc.h" -#include "ide.h" -#include "keyboard.h" -#include "main.h" -#include "model.h" -#include "mouse.h" -#include "savestate.h" -#include "sid_b-em.h" -#include "sound.h" -#include "sn76489.h" -#include "tape.h" -#include "tube.h" -#include "video_render.h" -#include "win.h" - -RECT oldclip, newclip; -int mousecapture = 0; -int videoresize = 0; - -/* Declare Windows procedure */ -LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM); - -/* Make the class name into a global variable */ -char szClassName[] = "B-emMainWnd"; - -HWND ghwnd; -int winsizex = 640, winsizey = 480; - -void updatewindowsize(int x, int y) -{ - RECT r; - if (x < 128) x = 128; - if (y < 64) y = 64; - if (x == winsizex && y == winsizey) return; - if (!videoresize) { x--; y--; } - winsizex = x; - winsizey = y; - GetWindowRect(ghwnd, &r); - MoveWindow(ghwnd, r.left, r.top, - x + (GetSystemMetrics(SM_CXFIXEDFRAME) * 2), - y + (GetSystemMetrics(SM_CYFIXEDFRAME) * 2) + GetSystemMetrics(SM_CYMENUSIZE) + GetSystemMetrics(SM_CYCAPTION) + 1, - TRUE); -} - -static int quited = 0; -void setquit() -{ - quited = 1; -} - -HINSTANCE hinstance; - -static char **argv; -static int argc; -static char *argbuf; - -static void processcommandline() -{ - char *cmdline; - int argc_max; - int i, q; - - /* can't use parameter because it doesn't include the executable name */ - cmdline = GetCommandLine(); - i = strlen(cmdline) + 1; - argbuf = malloc(i); - memcpy(argbuf, cmdline, i); - - argc = 0; - argc_max = 64; - argv = malloc(sizeof(char *) * argc_max); - if (!argv) { - free(argbuf); - return; - } - - i = 0; - - /* parse commandline into argc/argv format */ - while (argbuf[i]) { - while ((argbuf[i]) && (uisspace(argbuf[i]))) - i++; - - if (argbuf[i]) { - if ((argbuf[i] == '\'') || (argbuf[i] == '"')) { - q = argbuf[i++]; - if (!argbuf[i]) - break; - } - else - q = 0; - - argv[argc++] = &argbuf[i]; - - if (argc >= argc_max) { - argc_max += 64; - argv = realloc(argv, sizeof(char *) * argc_max); - if (!argv) { - free(argbuf); - return; - } - } - - while ((argbuf[i]) && ((q) ? (argbuf[i] != q) : (!uisspace(argbuf[i])))) - i++; - - if (argbuf[i]) { - argbuf[i] = 0; - i++; - } - rpclog("Arg %i - %s\n",argc-1,argv[argc-1]); - } - } - - argv[argc] = NULL; -// free(argbuf); -} - -static void initmenu() -{ - char t[512]; - HMENU hmenu = GetMenu(ghwnd); - - CheckMenuItem(hmenu, IDM_DISC_WPROT_0, (writeprot[0]) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_DISC_WPROT_1, (writeprot[1]) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_DISC_WPROT_D, (defaultwriteprot) ? MF_CHECKED : MF_UNCHECKED); - - CheckMenuItem(hmenu, IDM_TUBE_6502 + selecttube, MF_CHECKED); - CheckMenuItem(hmenu, IDM_MODEL_0 + curmodel, MF_CHECKED); - - if (vid_scanlines) CheckMenuItem(hmenu, IDM_VIDEO_SCANLINES, MF_CHECKED); - else if (vid_interlace) CheckMenuItem(hmenu, IDM_VIDEO_INTERLACED, MF_CHECKED); - else if (vid_linedbl) CheckMenuItem(hmenu, IDM_VIDEO_SLINEDBL, MF_CHECKED); - else if (vid_pal) CheckMenuItem(hmenu, IDM_VIDEO_PAL, MF_CHECKED); - else CheckMenuItem(hmenu, IDM_VIDEO_LINEDBL, MF_CHECKED); - - if (sound_internal) CheckMenuItem(hmenu, IDM_SOUND_INTERNAL, MF_CHECKED); - if (sound_beebsid) CheckMenuItem(hmenu, IDM_SOUND_BEEBSID, MF_CHECKED); - if (sound_ddnoise) CheckMenuItem(hmenu, IDM_SOUND_DDNOISE, MF_CHECKED); - if (sound_tape) CheckMenuItem(hmenu, IDM_SOUND_TAPE, MF_CHECKED); - - CheckMenuItem(hmenu, IDM_SOUND_FILTER, (sound_filter) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_WAVE_SQUARE + curwave, MF_CHECKED); - - CheckMenuItem(hmenu, IDM_SID_TYPE + cursid, MF_CHECKED); - CheckMenuItem(hmenu, IDM_SID_INTERP + sidmethod, MF_CHECKED); - - CheckMenuItem(hmenu, IDM_DDT_525 + ddnoise_type, MF_CHECKED); - CheckMenuItem(hmenu, (IDM_DDV_33 + ddnoise_vol) - 1, MF_CHECKED); - - CheckMenuItem(hmenu, IDM_TAPES_NORMAL + fasttape, MF_CHECKED); - - CheckMenuItem(hmenu, IDM_TUBES_4 + (tube_6502_speed - 1), MF_CHECKED); - - CheckMenuItem(hmenu, IDM_VIDEO_NOBORDERS + vid_fullborders, MF_CHECKED); - - append_filename(t, exedir, "roms\\tube\\ReCo6502ROM_816", 511); - if (!file_exists(t, FA_ALL, NULL)) EnableMenuItem(hmenu, IDM_TUBE_65816, MF_GRAYED); - - if (keyas) CheckMenuItem(hmenu, IDM_KEY_AS, MF_CHECKED); - - if (mouse_amx) CheckMenuItem(hmenu, IDM_MOUSE_AMX, MF_CHECKED); - - CheckMenuItem(hmenu, IDM_IDE_ENABLE, ide_enable ? MF_CHECKED : MF_UNCHECKED); - - CheckMenuItem(hmenu, IDM_VIDEO_RESIZE, (videoresize) ? MF_CHECKED : MF_UNCHECKED); - - CheckMenuItem(hmenu, IDM_SPD_100, MF_CHECKED); -} - -static HANDLE mainthread; - -static int bempause = 0, bemwaiting = 0; -static int doautoboot = 0; - -void _mainthread(PVOID pvoid) -{ - HMENU hmenu; - main_init(argc, argv); - -//Carlo Concari: show correct disc protected status at startup - hmenu=GetMenu(ghwnd); - CheckMenuItem(hmenu, IDM_DISC_WPROT_0, (writeprot[0]) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_DISC_WPROT_1, (writeprot[1]) ? MF_CHECKED : MF_UNCHECKED); - - while (1) - { - if (bempause) - { - bemwaiting = 1; - Sleep(100); - } - else - { - bemwaiting = 0; - main_run(); - } - if (doautoboot) - { - main_reset(); - disc_close(0); - disc_load(0, discfns[0]); - if (defaultwriteprot) writeprot[0] = 1; - hmenu = GetMenu(ghwnd); - CheckMenuItem(hmenu, IDM_DISC_WPROT_0, (writeprot[0]) ? MF_CHECKED : MF_UNCHECKED); - autoboot = 150; - doautoboot = 0; - } - } -} - -void waitforready() -{ - bempause = 1; - while (!bemwaiting) Sleep(100); -} - -void resumeready() -{ - bempause = 0; -} - -CRITICAL_SECTION cs; - -void startblit() -{ -// rpclog("startblit\n"); - EnterCriticalSection(&cs); -} - -void endblit() -{ -// rpclog("endblit\n"); - LeaveCriticalSection(&cs); -} - -void setejecttext(int drive, char *fn) -{ - MENUITEMINFO mi; - HMENU hmenu; - char s[128]; - if (fn[0]) sprintf(s,"Eject drive :%i/%i - %s", drive, drive + 2, get_filename(fn)); - else sprintf(s,"Eject drive :%i/%i", drive, drive + 2); - memset(&mi, 0, sizeof(MENUITEMINFO)); - mi.cbSize = sizeof(MENUITEMINFO); - mi.fMask = MIIM_STRING; - mi.fType = MFT_STRING; - mi.dwTypeData = s; - hmenu = GetMenu(ghwnd); - SetMenuItemInfo(hmenu, IDM_DISC_EJECT_0 + drive, 0, &mi); - CheckMenuItem(hmenu, IDM_DISC_WPROT_0 + drive, (writeprot[drive]) ? MF_CHECKED : MF_UNCHECKED); -} - -void updatewindowtitle() -{ - if (curtube == 3 || mouse_amx) - { - if (!mousecapture) set_window_title(B_EM_VERSION " - click to capture mouse"); - else set_window_title(B_EM_VERSION " - CTRL-END to release mouse"); - } - else - set_window_title(B_EM_VERSION); -} - -void bem_error(char *s) -{ - MessageBox(ghwnd, s, "B-em error", MB_OK | MB_ICONEXCLAMATION); -} - -int WINAPI WinMain (HINSTANCE hThisInstance, - HINSTANCE hPrevInstance, - LPSTR lpszArgument, - int nFunsterStil) - -{ - HWND hwnd; /* This is the handle for our window */ - MSG messages; /* Here messages to the application are saved */ - WNDCLASSEX wincl; /* Data structure for the windowclass */ - int c; - int oldf = 0; - char *p; - - for (c = 0; c < 128; c++) keylookup[c] = c; - - processcommandline(); - - hinstance = hThisInstance; - /* The Window structure */ - wincl.hInstance = hThisInstance; - wincl.lpszClassName = szClassName; - wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */ - wincl.style = CS_DBLCLKS; /* Catch double-clicks */ - wincl.cbSize = sizeof (WNDCLASSEX); - - /* Use default icon and mouse-pointer */ - wincl.hIcon = LoadIcon(hThisInstance, "allegro_icon"); - wincl.hIconSm = LoadIcon(hThisInstance, "allegro_icon"); - wincl.hCursor = LoadCursor (NULL, IDC_ARROW); - wincl.lpszMenuName = NULL; /* No menu */ - wincl.cbClsExtra = 0; /* No extra bytes after the window class */ - wincl.cbWndExtra = 0; /* structure or the window instance */ - /* Use Windows's default color as the background of the window */ - wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND; - - /* Register the window class, and if it fails quit the program */ - if (!RegisterClassEx (&wincl)) - return 0; - - /* The class is registered, let's create the program*/ - hwnd = CreateWindowEx ( - 0, /* Extended possibilites for variation */ - szClassName, /* Classname */ - B_EM_VERSION, /* Title Text */ - WS_OVERLAPPEDWINDOW/*&~WS_SIZEBOX&~WS_THICKFRAME&~WS_MAXIMIZEBOX*/, /* default window */ - CW_USEDEFAULT, /* Windows decides the position */ - CW_USEDEFAULT, /* where the window ends up on the screen */ - 640 + (GetSystemMetrics(SM_CXFIXEDFRAME) * 2), /* The programs width */ - 480 + (GetSystemMetrics(SM_CYFIXEDFRAME) * 2) + GetSystemMetrics(SM_CYMENUSIZE) + GetSystemMetrics(SM_CYCAPTION) + 1, /* and height in pixels */ - HWND_DESKTOP, /* The window is a child-window to desktop */ - LoadMenu(hThisInstance, TEXT("MainMenu")), /* No menu */ - hThisInstance, /* Program Instance handler */ - NULL /* No Window Creation data */ - ); - - ghwnd = hwnd; - - win_set_window(hwnd); - - allegro_init(); - - get_executable_name(exedir, 511); - p = get_filename(exedir); - p[0] = 0; - - config_load(); - - InitializeCriticalSection(&cs); - - /* Make the window visible on the screen */ - ShowWindow (hwnd, nFunsterStil); - - initmenu(); - - mainthread = (HANDLE)_beginthread(_mainthread, 0, NULL); - - updatewindowtitle(); - - - /* Run the message loop. It will run until GetMessage() returns 0 */ - while (!quited) - { -// runbbc(); - if (PeekMessage(&messages, NULL, 0, 0, PM_REMOVE)) - { - if (messages.message == WM_QUIT) - { - quited=1; - } - TranslateMessage(&messages); - DispatchMessage(&messages); - } - else - Sleep(10); - if ((key[KEY_LCONTROL] || key[KEY_RCONTROL]) && key[KEY_END] && mousecapture) - { - ClipCursor(&oldclip); - mousecapture = 0; - updatewindowtitle(); - } - if (key[KEY_ALT] && key[KEY_ENTER] && fullscreen && !oldf) - { - EnterCriticalSection(&cs); - fullscreen = 0; - video_leavefullscreen(); - LeaveCriticalSection(&cs); - } - else if (key[KEY_ALT] && key[KEY_ENTER] && !fullscreen && !oldf) - { - EnterCriticalSection(&cs); - fullscreen = 1; - video_enterfullscreen(); - LeaveCriticalSection(&cs); - } - oldf = key[KEY_ALT] && key[KEY_ENTER]; - } - - EnterCriticalSection(&cs); - TerminateThread(mainthread, 0); - debug_kill(); - main_close(); - DeleteCriticalSection(&cs); - - return messages.wParam; -} - -static char openfilestring[260]; -static int getfile(HWND hwnd, char *f, char *fn) -{ - OPENFILENAME ofn; // common dialog box structure - EnterCriticalSection(&cs); - - // Initialize OPENFILENAME - ZeroMemory(&ofn, sizeof(ofn)); - ofn.lStructSize = sizeof(ofn); - ofn.hwndOwner = hwnd; - ofn.lpstrFile = openfilestring; - // - // Set lpstrFile[0] to '\0' so that GetOpenFileName does not - // use the contents of szFile to initialize itself. - // -// ofn.lpstrFile[0] = '\0'; - strcpy(ofn.lpstrFile, fn); - ofn.nMaxFile = sizeof(openfilestring); - ofn.lpstrFilter = f;//"All\0*.*\0Text\0*.TXT\0"; - ofn.nFilterIndex = 1; - ofn.lpstrFileTitle = NULL; - ofn.nMaxFileTitle = 0; - ofn.lpstrInitialDir = NULL; - ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; - - // Display the Open dialog box. - - if (GetOpenFileName(&ofn)) - { - LeaveCriticalSection(&cs); - strcpy(fn, openfilestring); - return 0; - } - LeaveCriticalSection(&cs); - return 1; -} -static int getsfile(HWND hwnd, char *f, char *fn, char *de) -{ - OPENFILENAME ofn; // common dialog box structure - EnterCriticalSection(&cs); - - // Initialize OPENFILENAME - ZeroMemory(&ofn, sizeof(ofn)); - ofn.lStructSize = sizeof(ofn); - ofn.hwndOwner = hwnd; - ofn.lpstrFile = openfilestring; - // - // Set lpstrFile[0] to '\0' so that GetOpenFileName does not - // use the contents of szFile to initialize itself. - // -// ofn.lpstrFile[0] = '\0'; - strcpy(ofn.lpstrFile,fn); - ofn.nMaxFile = sizeof(openfilestring); - ofn.lpstrFilter = f;//"All\0*.*\0Text\0*.TXT\0"; - ofn.nFilterIndex = 1; - ofn.lpstrFileTitle = NULL; - ofn.nMaxFileTitle = 0; - ofn.lpstrInitialDir = NULL; - ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; - ofn.lpstrDefExt = de; - - // Display the Open dialog box. - - if (GetSaveFileName(&ofn)) - { - LeaveCriticalSection(&cs); - strcpy(fn, openfilestring); - return 0; - } - LeaveCriticalSection(&cs); - return 1; -} - -extern unsigned char hw_to_mycode[256]; - -int timerspeeds[] = {5, 12, 25, 38, 50, 75, 100, 150, 200, 250}; -int frameskips[] = {0, 0, 0, 0, 0, 0, 1, 2, 3, 4}; -int emuspeed = 4; - -LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - HMENU hmenu; - RECT rect; - int c; - LRESULT r; - - switch (message) - { - case WM_COMMAND: - hmenu = GetMenu(hwnd); - switch (LOWORD(wParam)) - { - case IDM_FILE_RESET: - EnterCriticalSection(&cs); - main_reset(); - LeaveCriticalSection(&cs); - break; - - case IDM_FILE_LSTATE: - EnterCriticalSection(&cs); - if (!getfile(hwnd, "Save State (*.SNP)\0*.SNP\0All files (*.*)\0*.*\0\0", savestate_name)) - { - CheckMenuItem(hmenu, IDM_TUBE_6502 + selecttube, MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_MODEL_0 + curmodel, MF_UNCHECKED); - savestate_load(); - CheckMenuItem(hmenu, IDM_TUBE_6502 + selecttube, MF_CHECKED); - CheckMenuItem(hmenu, IDM_MODEL_0 + curmodel, MF_CHECKED); - } - main_cleardrawit(); - LeaveCriticalSection(&cs); - break; - case IDM_FILE_SSTATE: - EnterCriticalSection(&cs); - if (curtube != -1) - { - bem_error("Second processor save states not supported yet."); - } - else - { - if (!getsfile(hwnd, "Save State (*.SNP)\0*.SNP\0All files (*.*)\0*.*\0\0", savestate_name, "SNP")) - savestate_save(); - } - main_cleardrawit(); - LeaveCriticalSection(&cs); - break; - - case IDM_FILE_EXIT: - PostQuitMessage (0); /* send a WM_QUIT to the message queue */ - break; - - - case IDM_DISC_AUTOBOOT: - if (!getfile(hwnd, "Disc image (*.SSD;*.DSD;*.IMG;*.ADF;*.ADL;*.FDI)\0*.SSD;*.DSD;*.IMG;*.ADF;*.ADL;*.FDI\0All files (*.*)\0*.*\0", discfns[0])) - { - doautoboot = 1; - } - break; - case IDM_DISC_LOAD_0: - if (!getfile(hwnd, "Disc image (*.SSD;*.DSD;*.IMG;*.ADF;*.ADL;*.FDI)\0*.SSD;*.DSD;*.IMG;*.ADF;*.ADL;*.FDI\0All files (*.*)\0*.*\0", discfns[0])) - { - disc_close(0); - disc_load(0, discfns[0]); - if (defaultwriteprot) writeprot[0] = 1; - CheckMenuItem(hmenu, IDM_DISC_WPROT_0, (writeprot[0]) ? MF_CHECKED : MF_UNCHECKED); - } - break; - case IDM_DISC_LOAD_1: - if (!getfile(hwnd, "Disc image (*.SSD;*.DSD;*.IMG;*.ADF;*.ADL;*.FDI)\0*.SSD;*.DSD;*.IMG;*.ADF;*.ADL;*.FDI\0All files (*.*)\0*.*\0", discfns[1])) - { - disc_close(1); - disc_load(1, discfns[1]); - if (defaultwriteprot) writeprot[1] = 1; - CheckMenuItem(hmenu, IDM_DISC_WPROT_1, (writeprot[1]) ? MF_CHECKED : MF_UNCHECKED); - } - break; - case IDM_DISC_EJECT_0: - disc_close(0); - discfns[0][0] = 0; - setejecttext(0, ""); - break; - case IDM_DISC_EJECT_1: - disc_close(1); - discfns[1][0] = 0; - setejecttext(1, ""); - break; - case IDM_DISC_NEW_0: - if (!getsfile(hwnd, "Disc image (*.SSD;*.DSD;*.ADF;*.ADL)\0*.SSD;*.DSD;*.ADF;*.ADL\0All files (*.*)\0*.*\0", discfns[0], "SSD")) - { - disc_close(0); - disc_new(0, discfns[0]); - if (defaultwriteprot) writeprot[0] = 1; - CheckMenuItem(hmenu, IDM_DISC_WPROT_0, (writeprot[0]) ? MF_CHECKED : MF_UNCHECKED); - } - break; - case IDM_DISC_NEW_1: - if (!getsfile(hwnd, "Disc image (*.SSD;*.DSD;*.ADF;*.ADL)\0*.SSD;*.DSD;*.ADF;*.ADL\0All files (*.*)\0*.*\0", discfns[1], "SSD")) - { - disc_close(1); - disc_new(1, discfns[1]); - if (defaultwriteprot) writeprot[1] = 1; - CheckMenuItem(hmenu, IDM_DISC_WPROT_1, (writeprot[1]) ? MF_CHECKED : MF_UNCHECKED); - } - break; - case IDM_DISC_WPROT_0: - writeprot[0] = !writeprot[0]; - if (fwriteprot[0]) writeprot[0] = 1; - CheckMenuItem(hmenu, IDM_DISC_WPROT_0, (writeprot[0]) ? MF_CHECKED : MF_UNCHECKED); - break; - case IDM_DISC_WPROT_1: - writeprot[1] = !writeprot[1]; - if (fwriteprot[1]) writeprot[1] = 1; - CheckMenuItem(hmenu, IDM_DISC_WPROT_1, (writeprot[1]) ? MF_CHECKED : MF_UNCHECKED); - break; - case IDM_DISC_WPROT_D: - defaultwriteprot = !defaultwriteprot; - CheckMenuItem(hmenu, IDM_DISC_WPROT_D, (defaultwriteprot) ? MF_CHECKED : MF_UNCHECKED); - break; - - case IDM_TAPE_LOAD: - if (!getfile(hwnd, "Tape image (*.UEF;*.CSW)\0*.UEF;*.CSW\0All files (*.*)\0*.*\0", tape_fn)) - { - tape_close(); - tape_load(tape_fn); - tape_loaded = 1; - } - break; - case IDM_TAPE_EJECT: - tape_close(); - tape_loaded = 0; - break; - - case IDM_TAPE_REWIND: - tape_close(); - tape_load(tape_fn); - break; - case IDM_TAPE_CAT: - showcatalogue(hinstance, ghwnd); - break; - - case IDM_TAPES_NORMAL: case IDM_TAPES_FAST: - fasttape = LOWORD(wParam) - IDM_TAPES_NORMAL; - CheckMenuItem(hmenu, IDM_TAPES_NORMAL, MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_TAPES_FAST, MF_UNCHECKED); - CheckMenuItem(hmenu, LOWORD(wParam), MF_CHECKED); - break; - - case IDM_VIDEO_NOBORDERS: case IDM_VIDEO_MBORDERS: case IDM_VIDEO_FBORDERS: - CheckMenuItem(hmenu, IDM_VIDEO_NOBORDERS + vid_fullborders, MF_UNCHECKED); - vid_fullborders = LOWORD(wParam) - IDM_VIDEO_NOBORDERS; - CheckMenuItem(hmenu, IDM_VIDEO_NOBORDERS + vid_fullborders, MF_CHECKED); - break; - case IDM_VIDEO_FULLSCR: - fullscreen = 1; - EnterCriticalSection(&cs); - video_enterfullscreen(); - LeaveCriticalSection(&cs); - break; - case IDM_VIDEO_RESIZE: - videoresize = !videoresize; - CheckMenuItem(hmenu, IDM_VIDEO_RESIZE, (videoresize) ? MF_CHECKED : MF_UNCHECKED); - if (videoresize) SetWindowLong(hwnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE); - else SetWindowLong(hwnd, GWL_STYLE, (WS_OVERLAPPEDWINDOW & ~WS_SIZEBOX & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX) | WS_VISIBLE); - GetWindowRect(hwnd, &rect); - SetWindowPos(hwnd, 0, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER | SWP_FRAMECHANGED); - break; - - case IDM_VIDEO_SLINEDBL: case IDM_VIDEO_LINEDBL: case IDM_VIDEO_SCANLINES: case IDM_VIDEO_INTERLACED: case IDM_VIDEO_PAL: case IDM_VIDEO_PALI: - CheckMenuItem(hmenu, IDM_VIDEO_SLINEDBL, MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_VIDEO_LINEDBL, MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_VIDEO_SCANLINES, MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_VIDEO_INTERLACED, MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_VIDEO_PAL, MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_VIDEO_PALI, MF_UNCHECKED); - CheckMenuItem(hmenu, LOWORD(wParam), MF_CHECKED); - vid_scanlines = vid_interlace = vid_linedbl = vid_pal = 0; - if (LOWORD(wParam) == IDM_VIDEO_INTERLACED) vid_interlace = 1; - if (LOWORD(wParam) == IDM_VIDEO_SCANLINES) vid_scanlines = 1; - if (LOWORD(wParam) == IDM_VIDEO_SLINEDBL) vid_linedbl = 1; - if (LOWORD(wParam) == IDM_VIDEO_PAL) vid_pal = 1; - if (LOWORD(wParam) == IDM_VIDEO_PALI) vid_interlace = vid_pal = 1; - video_clearscreen(); - break; - case IDM_TUBE_NONE: case IDM_TUBE_6502: case IDM_TUBE_Z80: case IDM_TUBE_65816: case IDM_TUBE_32016: - CheckMenuItem(hmenu, IDM_TUBE_NONE, MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_TUBE_6502, MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_TUBE_65816, MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_TUBE_Z80, MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_TUBE_32016, MF_UNCHECKED); - CheckMenuItem(hmenu, LOWORD(wParam), MF_CHECKED); - selecttube = LOWORD(wParam) - IDM_TUBE_6502; - main_restart(); - break; - case IDM_TUBES_4: case IDM_TUBES_8: case IDM_TUBES_16: case IDM_TUBES_32: case IDM_TUBES_64: - CheckMenuItem(hmenu, IDM_TUBES_4, MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_TUBES_8, MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_TUBES_16, MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_TUBES_32, MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_TUBES_64, MF_UNCHECKED); - CheckMenuItem(hmenu, LOWORD(wParam), MF_CHECKED); - tube_6502_speed = (LOWORD(wParam) - IDM_TUBES_4) + 1; - tube_updatespeed(); - break; - - case IDM_SOUND_INTERNAL: - sound_internal = !sound_internal; - CheckMenuItem(hmenu, IDM_SOUND_INTERNAL, (sound_internal) ? MF_CHECKED : MF_UNCHECKED); - break; - case IDM_SOUND_BEEBSID: - sound_beebsid = !sound_beebsid; - CheckMenuItem(hmenu, IDM_SOUND_BEEBSID, (sound_beebsid) ? MF_CHECKED : MF_UNCHECKED); - break; - case IDM_SOUND_DAC: - sound_dac = !sound_dac; - CheckMenuItem(hmenu, IDM_SOUND_BEEBSID, (sound_dac) ? MF_CHECKED : MF_UNCHECKED); - break; - case IDM_SOUND_DDNOISE: - sound_ddnoise = !sound_ddnoise; - CheckMenuItem(hmenu, IDM_SOUND_DDNOISE, (sound_ddnoise) ? MF_CHECKED : MF_UNCHECKED); - break; - case IDM_SOUND_TAPE: - sound_tape = !sound_tape; - CheckMenuItem(hmenu, IDM_SOUND_TAPE, (sound_tape) ? MF_CHECKED : MF_UNCHECKED); - break; - case IDM_SOUND_FILTER: - sound_filter = !sound_filter; - CheckMenuItem(hmenu, IDM_SOUND_FILTER, (sound_filter) ? MF_CHECKED : MF_UNCHECKED); - break; - - case IDM_WAVE_SQUARE: case IDM_WAVE_SAW: case IDM_WAVE_SINE: case IDM_WAVE_TRI: case IDM_WAVE_SID: - CheckMenuItem(hmenu, IDM_WAVE_SQUARE + curwave, MF_UNCHECKED); - curwave = LOWORD(wParam) - IDM_WAVE_SQUARE; - CheckMenuItem(hmenu, IDM_WAVE_SQUARE + curwave, MF_CHECKED); - break; - - case IDM_SID_INTERP: case IDM_SID_RESAMP: - CheckMenuItem(hmenu, IDM_SID_INTERP, MF_UNCHECKED); - CheckMenuItem(hmenu, IDM_SID_RESAMP, MF_UNCHECKED); - CheckMenuItem(hmenu, LOWORD(wParam), MF_CHECKED); - sidmethod = LOWORD(wParam) - IDM_SID_INTERP; - sid_settype(sidmethod, cursid); - break; - - case IDM_DDV_33: case IDM_DDV_66: case IDM_DDV_100: - CheckMenuItem(hmenu, (IDM_DDV_33 + ddnoise_vol) - 1, MF_UNCHECKED); - ddnoise_vol = (LOWORD(wParam) - IDM_DDV_33) + 1; - CheckMenuItem(hmenu, (IDM_DDV_33 + ddnoise_vol) - 1, MF_CHECKED); - break; - - case IDM_DDT_525: case IDM_DDT_35: - CheckMenuItem(hmenu, IDM_DDT_525 + ddnoise_type, MF_UNCHECKED); - ddnoise_type = LOWORD(wParam) - IDM_DDT_525; - CheckMenuItem(hmenu, IDM_DDT_525 + ddnoise_type, MF_CHECKED); - ddnoise_close(); - ddnoise_init(); - break; - - case IDM_DEBUGGER: - EnterCriticalSection(&cs); - rest(200); - if (!debugon) - { - debug = debugon = 1; - debug_start(); -// EnableMenuItem(hmenu,IDM_BREAK,MF_ENABLED); - } - else - { - debug ^= 1; - debug_end(); -// EnableMenuItem(hmenu,IDM_BREAK,MF_GRAYED); - } - CheckMenuItem(hmenu, IDM_DEBUGGER, (debug) ? MF_CHECKED: MF_UNCHECKED); - LeaveCriticalSection(&cs); - break; - case IDM_BREAK: - debug = 1; - break; - - case IDM_SCRSHOT: - if (!getsfile(hwnd, "Bitmap file (*.BMP)\0*.BMP\0All files (*.*)\0*.*\0", vid_scrshotname, "BMP")) - { - vid_savescrshot = 1; - } - break; - - case IDM_KEY_REDEFINE: - redefinekeys(); - break; - - case IDM_KEY_AS: - keyas = !keyas; - CheckMenuItem(hmenu, IDM_KEY_AS, (keyas) ? MF_CHECKED : MF_UNCHECKED); - break; - - case IDM_MOUSE_AMX: - mouse_amx = !mouse_amx; - CheckMenuItem(hmenu, IDM_MOUSE_AMX, (mouse_amx) ? MF_CHECKED : MF_UNCHECKED); - main_setmouse(); - updatewindowtitle(); - break; - - case IDM_IDE_ENABLE: - EnterCriticalSection(&cs); - CheckMenuItem(hmenu, IDM_IDE_ENABLE, (!ide_enable) ? MF_CHECKED : MF_UNCHECKED); - ide_enable = !ide_enable; - main_restart(); - LeaveCriticalSection(&cs); - break; - - case IDM_SPD_10: case IDM_SPD_25: case IDM_SPD_50: case IDM_SPD_75: case IDM_SPD_100: - case IDM_SPD_150: case IDM_SPD_200: case IDM_SPD_300: case IDM_SPD_400: case IDM_SPD_500: - CheckMenuItem(hmenu, IDM_SPD_10 + emuspeed, MF_UNCHECKED); - emuspeed = curmodel = LOWORD(wParam) - IDM_SPD_10; - changetimerspeed(timerspeeds[emuspeed]); - vid_fskipmax = frameskips[emuspeed]; - CheckMenuItem(hmenu, IDM_SPD_10 + emuspeed, MF_CHECKED); - break; - } - if (LOWORD(wParam) >= IDM_MODEL_0 && LOWORD(wParam) < (IDM_MODEL_0 + 50)) - { - CheckMenuItem(hmenu, IDM_MODEL_0 + curmodel, MF_UNCHECKED); - oldmodel = curmodel; - curmodel = LOWORD(wParam) - IDM_MODEL_0; - CheckMenuItem(hmenu, IDM_MODEL_0 + curmodel, MF_CHECKED); - main_restart(); - updatewindowtitle(); - } - if (LOWORD(wParam) >= IDM_SID_TYPE && LOWORD(wParam) < (IDM_SID_TYPE + 100)) - { - CheckMenuItem(hmenu, IDM_SID_TYPE + cursid, MF_UNCHECKED); - cursid = LOWORD(wParam) - IDM_SID_TYPE; - CheckMenuItem(hmenu, IDM_SID_TYPE + cursid, MF_CHECKED); - sid_settype(sidmethod, cursid); - } - return 0; - - case WM_USER: - if (videoresize) SetWindowLong(hwnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE); - else SetWindowLong(hwnd, GWL_STYLE, (WS_OVERLAPPEDWINDOW & ~WS_SIZEBOX & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX) | WS_VISIBLE); - GetWindowRect(hwnd, &rect); - SetWindowPos(hwnd, 0, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER | SWP_FRAMECHANGED); - break; - - case WM_USER+1: - if (videoresize) SetWindowLong(hwnd, GWL_STYLE, WS_OVERLAPPEDWINDOW & ~WS_VISIBLE); - else SetWindowLong(hwnd, GWL_STYLE, (WS_OVERLAPPEDWINDOW & ~WS_SIZEBOX & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX) & ~WS_VISIBLE); - GetWindowRect(hwnd,&rect); - SetWindowPos(hwnd, 0, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER | SWP_FRAMECHANGED); - break; - - case WM_DESTROY: - PostQuitMessage (0); /* send a WM_QUIT to the message queue */ - break; - - case WM_KILLFOCUS: -// rpclog("KillFocus\n"); -// infocus=0; -// spdcount=0; - if (mousecapture) - { - ClipCursor(&oldclip); - mousecapture = 0; - updatewindowtitle(); - } - break; - - case WM_LBUTTONUP: - if (!mousecapture && (curtube == 3 || mouse_amx)) - { - GetClipCursor(&oldclip); - GetWindowRect(hwnd, &newclip); - newclip.left += GetSystemMetrics(SM_CXFIXEDFRAME) + 10; - newclip.right -= GetSystemMetrics(SM_CXFIXEDFRAME) + 10; - newclip.top += GetSystemMetrics(SM_CXFIXEDFRAME) + GetSystemMetrics(SM_CYMENUSIZE) + GetSystemMetrics(SM_CYCAPTION) + 10; - newclip.bottom -= GetSystemMetrics(SM_CXFIXEDFRAME) + 10; - ClipCursor(&newclip); - mousecapture = 1; - updatewindowtitle(); - } - break; - - case WM_ENTERMENULOOP: -// rpclog("EnterMenuLoop\n"); - bempause = 1; - //EnterCriticalSection(&cs); - break; - case WM_EXITMENULOOP: -// rpclog("ExitMenuLoop\n"); - bempause = 0; - key_clear(); - for (c = 0; c < 128; c++) key[c] = 0; - //LeaveCriticalSection(&cs); - break; - - case WM_SETFOCUS: -// rpclog("SetFocus\n"); - key_clear(); - for (c = 0; c < 128; c++) key[c] = 0; - bempause = 0; - break; - - case WM_SIZE: - winsizex = lParam & 0xFFFF; - winsizey = lParam >> 16; - break; - - case WM_SYSKEYDOWN: - case WM_KEYDOWN: - if (LOWORD(wParam) != 255) - { - //rpclog("Key %04X %04X\n",LOWORD(wParam),VK_LEFT); - c = MapVirtualKey(LOWORD(wParam),0); - c = hw_to_mycode[c]; -// rpclog("MVK %i %i %i\n",c,hw_to_mycode[c],KEY_PGUP); - if (LOWORD(wParam) == VK_LEFT) c = KEY_LEFT; - if (LOWORD(wParam) == VK_RIGHT) c = KEY_RIGHT; - if (LOWORD(wParam) == VK_UP) c = KEY_UP; - if (LOWORD(wParam) == VK_DOWN) c = KEY_DOWN; - if (LOWORD(wParam) == VK_HOME) c = KEY_HOME; - if (LOWORD(wParam) == VK_END) c = KEY_END; - if (LOWORD(wParam) == VK_INSERT) c = KEY_INSERT; - if (LOWORD(wParam) == VK_DELETE) c = KEY_DEL; - if (LOWORD(wParam) == VK_PRIOR) c = KEY_PGUP; - if (LOWORD(wParam) == VK_NEXT) c = KEY_PGDN; - //rpclog("MVK2 %i %i %i\n",c,hw_to_mycode[c],KEY_PGUP); - key[c]=1; - } - break; - case WM_SYSKEYUP: - case WM_KEYUP: - if (LOWORD(wParam) != 255) - { -// rpclog("Key %04X %04X\n",LOWORD(wParam),VK_LEFT); - c = MapVirtualKey(LOWORD(wParam), 0); - c = hw_to_mycode[c]; - if (LOWORD(wParam) == VK_LEFT) c = KEY_LEFT; - if (LOWORD(wParam) == VK_RIGHT) c = KEY_RIGHT; - if (LOWORD(wParam) == VK_UP) c = KEY_UP; - if (LOWORD(wParam) == VK_DOWN) c = KEY_DOWN; - if (LOWORD(wParam) == VK_HOME) c = KEY_HOME; - if (LOWORD(wParam) == VK_END) c = KEY_END; - if (LOWORD(wParam) == VK_INSERT) c = KEY_INSERT; - if (LOWORD(wParam) == VK_DELETE) c = KEY_DEL; - if (LOWORD(wParam) == VK_PRIOR) c = KEY_PGUP; - if (LOWORD(wParam) == VK_NEXT) c = KEY_PGDN; -// rpclog("MVK %i\n",c); - key[c] = 0; - } - break; - - case WM_CREATE: - -// initbbc(argc,argv); - -// free(argv); - -// mainthread=(HANDLE)_beginthread(_mainthread,0,NULL); - break; - - default: - r = DefWindowProc (hwnd, message, wParam, lParam); - return r; - } - return 0; -} -#endif +/*B-em v2.2 by Tom Walker + Windows main*/ + +#ifdef WIN32 +#include +#include +#include +#include "resources.h" + +#include "b-em.h" + +#include "config.h" +#include "ddnoise.h" +#include "debugger.h" +#include "disc.h" +#include "ide.h" +#include "keyboard.h" +#include "main.h" +#include "model.h" +#include "mouse.h" +#include "savestate.h" +#include "sid_b-em.h" +#include "sound.h" +#include "sn76489.h" +#include "tape.h" +#include "tube.h" +#include "video_render.h" +#include "win.h" + +RECT oldclip, newclip; +int mousecapture = 0; +int videoresize = 0; + +/* Declare Windows procedure */ +LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM); + +/* Make the class name into a global variable */ +char szClassName[] = "B-emMainWnd"; + +HWND ghwnd; +int winsizex = 640, winsizey = 480; + +void updatewindowsize(int x, int y) +{ + RECT r; + if (x < 128) x = 128; + if (y < 64) y = 64; + if (x == winsizex && y == winsizey) return; + if (!videoresize) { x--; y--; } + winsizex = x; + winsizey = y; + GetWindowRect(ghwnd, &r); + MoveWindow(ghwnd, r.left, r.top, + x + (GetSystemMetrics(SM_CXFIXEDFRAME) * 2), + y + (GetSystemMetrics(SM_CYFIXEDFRAME) * 2) + GetSystemMetrics(SM_CYMENUSIZE) + GetSystemMetrics(SM_CYCAPTION) + 1, + TRUE); +} + +static int quited = 0; +void setquit() +{ + quited = 1; +} + +HINSTANCE hinstance; + +static char **argv; +static int argc; +static char *argbuf; + +static void processcommandline() +{ + char *cmdline; + int argc_max; + int i, q; + + /* can't use parameter because it doesn't include the executable name */ + cmdline = GetCommandLine(); + i = strlen(cmdline) + 1; + argbuf = malloc(i); + memcpy(argbuf, cmdline, i); + + argc = 0; + argc_max = 64; + argv = malloc(sizeof(char *) * argc_max); + if (!argv) { + free(argbuf); + return; + } + + i = 0; + + /* parse commandline into argc/argv format */ + while (argbuf[i]) { + while ((argbuf[i]) && (uisspace(argbuf[i]))) + i++; + + if (argbuf[i]) { + if ((argbuf[i] == '\'') || (argbuf[i] == '"')) { + q = argbuf[i++]; + if (!argbuf[i]) + break; + } + else + q = 0; + + argv[argc++] = &argbuf[i]; + + if (argc >= argc_max) { + argc_max += 64; + argv = realloc(argv, sizeof(char *) * argc_max); + if (!argv) { + free(argbuf); + return; + } + } + + while ((argbuf[i]) && ((q) ? (argbuf[i] != q) : (!uisspace(argbuf[i])))) + i++; + + if (argbuf[i]) { + argbuf[i] = 0; + i++; + } + rpclog("Arg %i - %s\n",argc-1,argv[argc-1]); + } + } + + argv[argc] = NULL; +// free(argbuf); +} + +static void initmenu() +{ + char t[512]; + HMENU hmenu = GetMenu(ghwnd); + + CheckMenuItem(hmenu, IDM_DISC_WPROT_0, (writeprot[0]) ? MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_DISC_WPROT_1, (writeprot[1]) ? MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_DISC_WPROT_D, (defaultwriteprot) ? MF_CHECKED : MF_UNCHECKED); + + CheckMenuItem(hmenu, IDM_TUBE_6502 + selecttube, MF_CHECKED); + CheckMenuItem(hmenu, IDM_MODEL_0 + curmodel, MF_CHECKED); + + if (vid_scanlines) CheckMenuItem(hmenu, IDM_VIDEO_SCANLINES, MF_CHECKED); + else if (vid_interlace) CheckMenuItem(hmenu, IDM_VIDEO_INTERLACED, MF_CHECKED); + else if (vid_linedbl) CheckMenuItem(hmenu, IDM_VIDEO_SLINEDBL, MF_CHECKED); + else if (vid_pal) CheckMenuItem(hmenu, IDM_VIDEO_PAL, MF_CHECKED); + else CheckMenuItem(hmenu, IDM_VIDEO_LINEDBL, MF_CHECKED); + + if (sound_internal) CheckMenuItem(hmenu, IDM_SOUND_INTERNAL, MF_CHECKED); + if (sound_beebsid) CheckMenuItem(hmenu, IDM_SOUND_BEEBSID, MF_CHECKED); + if (sound_ddnoise) CheckMenuItem(hmenu, IDM_SOUND_DDNOISE, MF_CHECKED); + if (sound_tape) CheckMenuItem(hmenu, IDM_SOUND_TAPE, MF_CHECKED); + + CheckMenuItem(hmenu, IDM_SOUND_FILTER, (sound_filter) ? MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_WAVE_SQUARE + curwave, MF_CHECKED); + + CheckMenuItem(hmenu, IDM_SID_TYPE + cursid, MF_CHECKED); + CheckMenuItem(hmenu, IDM_SID_INTERP + sidmethod, MF_CHECKED); + + CheckMenuItem(hmenu, IDM_DDT_525 + ddnoise_type, MF_CHECKED); + CheckMenuItem(hmenu, (IDM_DDV_33 + ddnoise_vol) - 1, MF_CHECKED); + + CheckMenuItem(hmenu, IDM_TAPES_NORMAL + fasttape, MF_CHECKED); + + CheckMenuItem(hmenu, IDM_TUBES_4 + (tube_6502_speed - 1), MF_CHECKED); + + CheckMenuItem(hmenu, IDM_VIDEO_NOBORDERS + vid_fullborders, MF_CHECKED); + + append_filename(t, exedir, "roms\\tube\\ReCo6502ROM_816", 511); + if (!file_exists(t, FA_ALL, NULL)) EnableMenuItem(hmenu, IDM_TUBE_65816, MF_GRAYED); + + if (keyas) CheckMenuItem(hmenu, IDM_KEY_AS, MF_CHECKED); + + if (mouse_amx) CheckMenuItem(hmenu, IDM_MOUSE_AMX, MF_CHECKED); + + CheckMenuItem(hmenu, IDM_IDE_ENABLE, ide_enable ? MF_CHECKED : MF_UNCHECKED); + + CheckMenuItem(hmenu, IDM_VIDEO_RESIZE, (videoresize) ? MF_CHECKED : MF_UNCHECKED); + + CheckMenuItem(hmenu, IDM_SPD_100, MF_CHECKED); +} + +static HANDLE mainthread; + +static int bempause = 0, bemwaiting = 0; +static int doautoboot = 0; + +void _mainthread(PVOID pvoid) +{ + HMENU hmenu; + main_init(argc, argv); + +//Carlo Concari: show correct disc protected status at startup + hmenu=GetMenu(ghwnd); + CheckMenuItem(hmenu, IDM_DISC_WPROT_0, (writeprot[0]) ? MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_DISC_WPROT_1, (writeprot[1]) ? MF_CHECKED : MF_UNCHECKED); + + while (1) + { + if (bempause) + { + bemwaiting = 1; + Sleep(100); + } + else + { + bemwaiting = 0; + main_run(); + } + if (doautoboot) + { + main_reset(); + disc_close(0); + disc_load(0, discfns[0]); + if (defaultwriteprot) writeprot[0] = 1; + hmenu = GetMenu(ghwnd); + CheckMenuItem(hmenu, IDM_DISC_WPROT_0, (writeprot[0]) ? MF_CHECKED : MF_UNCHECKED); + autoboot = 150; + doautoboot = 0; + } + } +} + +void waitforready() +{ + bempause = 1; + while (!bemwaiting) Sleep(100); +} + +void resumeready() +{ + bempause = 0; +} + +CRITICAL_SECTION cs; + +void startblit() +{ +// rpclog("startblit\n"); + EnterCriticalSection(&cs); +} + +void endblit() +{ +// rpclog("endblit\n"); + LeaveCriticalSection(&cs); +} + +void setejecttext(int drive, char *fn) +{ + MENUITEMINFO mi; + HMENU hmenu; + char s[128]; + if (fn[0]) sprintf(s,"Eject drive :%i/%i - %s", drive, drive + 2, get_filename(fn)); + else sprintf(s,"Eject drive :%i/%i", drive, drive + 2); + memset(&mi, 0, sizeof(MENUITEMINFO)); + mi.cbSize = sizeof(MENUITEMINFO); + mi.fMask = MIIM_STRING; + mi.fType = MFT_STRING; + mi.dwTypeData = s; + hmenu = GetMenu(ghwnd); + SetMenuItemInfo(hmenu, IDM_DISC_EJECT_0 + drive, 0, &mi); + CheckMenuItem(hmenu, IDM_DISC_WPROT_0 + drive, (writeprot[drive]) ? MF_CHECKED : MF_UNCHECKED); +} + +void updatewindowtitle() +{ + if (curtube == 3 || mouse_amx) + { + if (!mousecapture) set_window_title("B-em v2.2 - click to capture mouse"); + else set_window_title("B-em v2.2 - CTRL-END to release mouse"); + } + else + set_window_title("B-em v2.2"); +} + +void bem_error(char *s) +{ + MessageBox(ghwnd, s, "B-em error", MB_OK | MB_ICONEXCLAMATION); +} + +int WINAPI WinMain (HINSTANCE hThisInstance, + HINSTANCE hPrevInstance, + LPSTR lpszArgument, + int nFunsterStil) + +{ + HWND hwnd; /* This is the handle for our window */ + MSG messages; /* Here messages to the application are saved */ + WNDCLASSEX wincl; /* Data structure for the windowclass */ + int c; + int oldf = 0; + char *p; + + for (c = 0; c < 128; c++) keylookup[c] = c; + + processcommandline(); + + hinstance = hThisInstance; + /* The Window structure */ + wincl.hInstance = hThisInstance; + wincl.lpszClassName = szClassName; + wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */ + wincl.style = CS_DBLCLKS; /* Catch double-clicks */ + wincl.cbSize = sizeof (WNDCLASSEX); + + /* Use default icon and mouse-pointer */ + wincl.hIcon = LoadIcon(hThisInstance, "allegro_icon"); + wincl.hIconSm = LoadIcon(hThisInstance, "allegro_icon"); + wincl.hCursor = LoadCursor (NULL, IDC_ARROW); + wincl.lpszMenuName = NULL; /* No menu */ + wincl.cbClsExtra = 0; /* No extra bytes after the window class */ + wincl.cbWndExtra = 0; /* structure or the window instance */ + /* Use Windows's default color as the background of the window */ + wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND; + + /* Register the window class, and if it fails quit the program */ + if (!RegisterClassEx (&wincl)) + return 0; + + /* The class is registered, let's create the program*/ + hwnd = CreateWindowEx ( + 0, /* Extended possibilites for variation */ + szClassName, /* Classname */ + "B-em v2.2", /* Title Text */ + WS_OVERLAPPEDWINDOW/*&~WS_SIZEBOX&~WS_THICKFRAME&~WS_MAXIMIZEBOX*/, /* default window */ + CW_USEDEFAULT, /* Windows decides the position */ + CW_USEDEFAULT, /* where the window ends up on the screen */ + 640 + (GetSystemMetrics(SM_CXFIXEDFRAME) * 2), /* The programs width */ + 480 + (GetSystemMetrics(SM_CYFIXEDFRAME) * 2) + GetSystemMetrics(SM_CYMENUSIZE) + GetSystemMetrics(SM_CYCAPTION) + 1, /* and height in pixels */ + HWND_DESKTOP, /* The window is a child-window to desktop */ + LoadMenu(hThisInstance, TEXT("MainMenu")), /* No menu */ + hThisInstance, /* Program Instance handler */ + NULL /* No Window Creation data */ + ); + + ghwnd = hwnd; + + win_set_window(hwnd); + + allegro_init(); + + get_executable_name(exedir, 511); + p = get_filename(exedir); + p[0] = 0; + + config_load(); + + InitializeCriticalSection(&cs); + + /* Make the window visible on the screen */ + ShowWindow (hwnd, nFunsterStil); + + initmenu(); + + mainthread = (HANDLE)_beginthread(_mainthread, 0, NULL); + + updatewindowtitle(); + + + /* Run the message loop. It will run until GetMessage() returns 0 */ + while (!quited) + { +// runbbc(); + if (PeekMessage(&messages, NULL, 0, 0, PM_REMOVE)) + { + if (messages.message == WM_QUIT) + { + quited=1; + } + TranslateMessage(&messages); + DispatchMessage(&messages); + } + else + Sleep(10); + if ((key[KEY_LCONTROL] || key[KEY_RCONTROL]) && key[KEY_END] && mousecapture) + { + ClipCursor(&oldclip); + mousecapture = 0; + updatewindowtitle(); + } + if (key[KEY_ALT] && key[KEY_ENTER] && fullscreen && !oldf) + { + EnterCriticalSection(&cs); + fullscreen = 0; + video_leavefullscreen(); + LeaveCriticalSection(&cs); + } + else if (key[KEY_ALT] && key[KEY_ENTER] && !fullscreen && !oldf) + { + EnterCriticalSection(&cs); + fullscreen = 1; + video_enterfullscreen(); + LeaveCriticalSection(&cs); + } + oldf = key[KEY_ALT] && key[KEY_ENTER]; + } + + EnterCriticalSection(&cs); + TerminateThread(mainthread, 0); + debug_kill(); + main_close(); + DeleteCriticalSection(&cs); + + return messages.wParam; +} + +static char openfilestring[260]; +static int getfile(HWND hwnd, char *f, char *fn) +{ + OPENFILENAME ofn; // common dialog box structure + EnterCriticalSection(&cs); + + // Initialize OPENFILENAME + ZeroMemory(&ofn, sizeof(ofn)); + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = hwnd; + ofn.lpstrFile = openfilestring; + // + // Set lpstrFile[0] to '\0' so that GetOpenFileName does not + // use the contents of szFile to initialize itself. + // +// ofn.lpstrFile[0] = '\0'; + strcpy(ofn.lpstrFile, fn); + ofn.nMaxFile = sizeof(openfilestring); + ofn.lpstrFilter = f;//"All\0*.*\0Text\0*.TXT\0"; + ofn.nFilterIndex = 1; + ofn.lpstrFileTitle = NULL; + ofn.nMaxFileTitle = 0; + ofn.lpstrInitialDir = NULL; + ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; + + // Display the Open dialog box. + + if (GetOpenFileName(&ofn)) + { + LeaveCriticalSection(&cs); + strcpy(fn, openfilestring); + return 0; + } + LeaveCriticalSection(&cs); + return 1; +} +static int getsfile(HWND hwnd, char *f, char *fn, char *de) +{ + OPENFILENAME ofn; // common dialog box structure + EnterCriticalSection(&cs); + + // Initialize OPENFILENAME + ZeroMemory(&ofn, sizeof(ofn)); + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = hwnd; + ofn.lpstrFile = openfilestring; + // + // Set lpstrFile[0] to '\0' so that GetOpenFileName does not + // use the contents of szFile to initialize itself. + // +// ofn.lpstrFile[0] = '\0'; + strcpy(ofn.lpstrFile,fn); + ofn.nMaxFile = sizeof(openfilestring); + ofn.lpstrFilter = f;//"All\0*.*\0Text\0*.TXT\0"; + ofn.nFilterIndex = 1; + ofn.lpstrFileTitle = NULL; + ofn.nMaxFileTitle = 0; + ofn.lpstrInitialDir = NULL; + ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; + ofn.lpstrDefExt = de; + + // Display the Open dialog box. + + if (GetSaveFileName(&ofn)) + { + LeaveCriticalSection(&cs); + strcpy(fn, openfilestring); + return 0; + } + LeaveCriticalSection(&cs); + return 1; +} + +extern unsigned char hw_to_mycode[256]; + +int timerspeeds[] = {5, 12, 25, 38, 50, 75, 100, 150, 200, 250}; +int frameskips[] = {0, 0, 0, 0, 0, 0, 1, 2, 3, 4}; +int emuspeed = 4; + +LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + HMENU hmenu; + RECT rect; + int c; + LRESULT r; + + switch (message) + { + case WM_COMMAND: + hmenu = GetMenu(hwnd); + switch (LOWORD(wParam)) + { + case IDM_FILE_RESET: + EnterCriticalSection(&cs); + main_reset(); + LeaveCriticalSection(&cs); + break; + + case IDM_FILE_LSTATE: + EnterCriticalSection(&cs); + if (!getfile(hwnd, "Save State (*.SNP)\0*.SNP\0All files (*.*)\0*.*\0\0", savestate_name)) + { + CheckMenuItem(hmenu, IDM_TUBE_6502 + selecttube, MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_MODEL_0 + curmodel, MF_UNCHECKED); + savestate_load(); + CheckMenuItem(hmenu, IDM_TUBE_6502 + selecttube, MF_CHECKED); + CheckMenuItem(hmenu, IDM_MODEL_0 + curmodel, MF_CHECKED); + } + main_cleardrawit(); + LeaveCriticalSection(&cs); + break; + case IDM_FILE_SSTATE: + EnterCriticalSection(&cs); + if (curtube != -1) + { + bem_error("Second processor save states not supported yet."); + } + else + { + if (!getsfile(hwnd, "Save State (*.SNP)\0*.SNP\0All files (*.*)\0*.*\0\0", savestate_name, "SNP")) + savestate_save(); + } + main_cleardrawit(); + LeaveCriticalSection(&cs); + break; + + case IDM_FILE_EXIT: + PostQuitMessage (0); /* send a WM_QUIT to the message queue */ + break; + + + case IDM_DISC_AUTOBOOT: + if (!getfile(hwnd, "Disc image (*.SSD;*.DSD;*.IMG;*.ADF;*.ADL;*.FDI)\0*.SSD;*.DSD;*.IMG;*.ADF;*.ADL;*.FDI\0All files (*.*)\0*.*\0", discfns[0])) + { + doautoboot = 1; + } + break; + case IDM_DISC_LOAD_0: + if (!getfile(hwnd, "Disc image (*.SSD;*.DSD;*.IMG;*.ADF;*.ADL;*.FDI)\0*.SSD;*.DSD;*.IMG;*.ADF;*.ADL;*.FDI\0All files (*.*)\0*.*\0", discfns[0])) + { + disc_close(0); + disc_load(0, discfns[0]); + if (defaultwriteprot) writeprot[0] = 1; + CheckMenuItem(hmenu, IDM_DISC_WPROT_0, (writeprot[0]) ? MF_CHECKED : MF_UNCHECKED); + } + break; + case IDM_DISC_LOAD_1: + if (!getfile(hwnd, "Disc image (*.SSD;*.DSD;*.IMG;*.ADF;*.ADL;*.FDI)\0*.SSD;*.DSD;*.IMG;*.ADF;*.ADL;*.FDI\0All files (*.*)\0*.*\0", discfns[1])) + { + disc_close(1); + disc_load(1, discfns[1]); + if (defaultwriteprot) writeprot[1] = 1; + CheckMenuItem(hmenu, IDM_DISC_WPROT_1, (writeprot[1]) ? MF_CHECKED : MF_UNCHECKED); + } + break; + case IDM_DISC_EJECT_0: + disc_close(0); + discfns[0][0] = 0; + setejecttext(0, ""); + break; + case IDM_DISC_EJECT_1: + disc_close(1); + discfns[1][0] = 0; + setejecttext(1, ""); + break; + case IDM_DISC_NEW_0: + if (!getsfile(hwnd, "Disc image (*.SSD;*.DSD;*.ADF;*.ADL)\0*.SSD;*.DSD;*.ADF;*.ADL\0All files (*.*)\0*.*\0", discfns[0], "SSD")) + { + disc_close(0); + disc_new(0, discfns[0]); + if (defaultwriteprot) writeprot[0] = 1; + CheckMenuItem(hmenu, IDM_DISC_WPROT_0, (writeprot[0]) ? MF_CHECKED : MF_UNCHECKED); + } + break; + case IDM_DISC_NEW_1: + if (!getsfile(hwnd, "Disc image (*.SSD;*.DSD;*.ADF;*.ADL)\0*.SSD;*.DSD;*.ADF;*.ADL\0All files (*.*)\0*.*\0", discfns[1], "SSD")) + { + disc_close(1); + disc_new(1, discfns[1]); + if (defaultwriteprot) writeprot[1] = 1; + CheckMenuItem(hmenu, IDM_DISC_WPROT_1, (writeprot[1]) ? MF_CHECKED : MF_UNCHECKED); + } + break; + case IDM_DISC_WPROT_0: + writeprot[0] = !writeprot[0]; + if (fwriteprot[0]) writeprot[0] = 1; + CheckMenuItem(hmenu, IDM_DISC_WPROT_0, (writeprot[0]) ? MF_CHECKED : MF_UNCHECKED); + break; + case IDM_DISC_WPROT_1: + writeprot[1] = !writeprot[1]; + if (fwriteprot[1]) writeprot[1] = 1; + CheckMenuItem(hmenu, IDM_DISC_WPROT_1, (writeprot[1]) ? MF_CHECKED : MF_UNCHECKED); + break; + case IDM_DISC_WPROT_D: + defaultwriteprot = !defaultwriteprot; + CheckMenuItem(hmenu, IDM_DISC_WPROT_D, (defaultwriteprot) ? MF_CHECKED : MF_UNCHECKED); + break; + + case IDM_TAPE_LOAD: + if (!getfile(hwnd, "Tape image (*.UEF;*.CSW)\0*.UEF;*.CSW\0All files (*.*)\0*.*\0", tape_fn)) + { + tape_close(); + tape_load(tape_fn); + tape_loaded = 1; + } + break; + case IDM_TAPE_EJECT: + tape_close(); + tape_loaded = 0; + break; + + case IDM_TAPE_REWIND: + tape_close(); + tape_load(tape_fn); + break; + case IDM_TAPE_CAT: + showcatalogue(hinstance, ghwnd); + break; + + case IDM_TAPES_NORMAL: case IDM_TAPES_FAST: + fasttape = LOWORD(wParam) - IDM_TAPES_NORMAL; + CheckMenuItem(hmenu, IDM_TAPES_NORMAL, MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_TAPES_FAST, MF_UNCHECKED); + CheckMenuItem(hmenu, LOWORD(wParam), MF_CHECKED); + break; + + case IDM_VIDEO_NOBORDERS: case IDM_VIDEO_MBORDERS: case IDM_VIDEO_FBORDERS: + CheckMenuItem(hmenu, IDM_VIDEO_NOBORDERS + vid_fullborders, MF_UNCHECKED); + vid_fullborders = LOWORD(wParam) - IDM_VIDEO_NOBORDERS; + CheckMenuItem(hmenu, IDM_VIDEO_NOBORDERS + vid_fullborders, MF_CHECKED); + break; + case IDM_VIDEO_FULLSCR: + fullscreen = 1; + EnterCriticalSection(&cs); + video_enterfullscreen(); + LeaveCriticalSection(&cs); + break; + case IDM_VIDEO_RESIZE: + videoresize = !videoresize; + CheckMenuItem(hmenu, IDM_VIDEO_RESIZE, (videoresize) ? MF_CHECKED : MF_UNCHECKED); + if (videoresize) SetWindowLong(hwnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE); + else SetWindowLong(hwnd, GWL_STYLE, (WS_OVERLAPPEDWINDOW & ~WS_SIZEBOX & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX) | WS_VISIBLE); + GetWindowRect(hwnd, &rect); + SetWindowPos(hwnd, 0, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER | SWP_FRAMECHANGED); + break; + + case IDM_VIDEO_SLINEDBL: case IDM_VIDEO_LINEDBL: case IDM_VIDEO_SCANLINES: case IDM_VIDEO_INTERLACED: case IDM_VIDEO_PAL: case IDM_VIDEO_PALI: + CheckMenuItem(hmenu, IDM_VIDEO_SLINEDBL, MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_VIDEO_LINEDBL, MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_VIDEO_SCANLINES, MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_VIDEO_INTERLACED, MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_VIDEO_PAL, MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_VIDEO_PALI, MF_UNCHECKED); + CheckMenuItem(hmenu, LOWORD(wParam), MF_CHECKED); + vid_scanlines = vid_interlace = vid_linedbl = vid_pal = 0; + if (LOWORD(wParam) == IDM_VIDEO_INTERLACED) vid_interlace = 1; + if (LOWORD(wParam) == IDM_VIDEO_SCANLINES) vid_scanlines = 1; + if (LOWORD(wParam) == IDM_VIDEO_SLINEDBL) vid_linedbl = 1; + if (LOWORD(wParam) == IDM_VIDEO_PAL) vid_pal = 1; + if (LOWORD(wParam) == IDM_VIDEO_PALI) vid_interlace = vid_pal = 1; + video_clearscreen(); + break; + case IDM_TUBE_NONE: case IDM_TUBE_6502: case IDM_TUBE_Z80: case IDM_TUBE_65816: case IDM_TUBE_32016: + CheckMenuItem(hmenu, IDM_TUBE_NONE, MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_TUBE_6502, MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_TUBE_65816, MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_TUBE_Z80, MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_TUBE_32016, MF_UNCHECKED); + CheckMenuItem(hmenu, LOWORD(wParam), MF_CHECKED); + selecttube = LOWORD(wParam) - IDM_TUBE_6502; + main_restart(); + break; + case IDM_TUBES_4: case IDM_TUBES_8: case IDM_TUBES_16: case IDM_TUBES_32: case IDM_TUBES_64: + CheckMenuItem(hmenu, IDM_TUBES_4, MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_TUBES_8, MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_TUBES_16, MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_TUBES_32, MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_TUBES_64, MF_UNCHECKED); + CheckMenuItem(hmenu, LOWORD(wParam), MF_CHECKED); + tube_6502_speed = (LOWORD(wParam) - IDM_TUBES_4) + 1; + tube_updatespeed(); + break; + + case IDM_SOUND_INTERNAL: + sound_internal = !sound_internal; + CheckMenuItem(hmenu, IDM_SOUND_INTERNAL, (sound_internal) ? MF_CHECKED : MF_UNCHECKED); + break; + case IDM_SOUND_BEEBSID: + sound_beebsid = !sound_beebsid; + CheckMenuItem(hmenu, IDM_SOUND_BEEBSID, (sound_beebsid) ? MF_CHECKED : MF_UNCHECKED); + break; + case IDM_SOUND_DAC: + sound_dac = !sound_dac; + CheckMenuItem(hmenu, IDM_SOUND_BEEBSID, (sound_dac) ? MF_CHECKED : MF_UNCHECKED); + break; + case IDM_SOUND_DDNOISE: + sound_ddnoise = !sound_ddnoise; + CheckMenuItem(hmenu, IDM_SOUND_DDNOISE, (sound_ddnoise) ? MF_CHECKED : MF_UNCHECKED); + break; + case IDM_SOUND_TAPE: + sound_tape = !sound_tape; + CheckMenuItem(hmenu, IDM_SOUND_TAPE, (sound_tape) ? MF_CHECKED : MF_UNCHECKED); + break; + case IDM_SOUND_FILTER: + sound_filter = !sound_filter; + CheckMenuItem(hmenu, IDM_SOUND_FILTER, (sound_filter) ? MF_CHECKED : MF_UNCHECKED); + break; + + case IDM_WAVE_SQUARE: case IDM_WAVE_SAW: case IDM_WAVE_SINE: case IDM_WAVE_TRI: case IDM_WAVE_SID: + CheckMenuItem(hmenu, IDM_WAVE_SQUARE + curwave, MF_UNCHECKED); + curwave = LOWORD(wParam) - IDM_WAVE_SQUARE; + CheckMenuItem(hmenu, IDM_WAVE_SQUARE + curwave, MF_CHECKED); + break; + + case IDM_SID_INTERP: case IDM_SID_RESAMP: + CheckMenuItem(hmenu, IDM_SID_INTERP, MF_UNCHECKED); + CheckMenuItem(hmenu, IDM_SID_RESAMP, MF_UNCHECKED); + CheckMenuItem(hmenu, LOWORD(wParam), MF_CHECKED); + sidmethod = LOWORD(wParam) - IDM_SID_INTERP; + sid_settype(sidmethod, cursid); + break; + + case IDM_DDV_33: case IDM_DDV_66: case IDM_DDV_100: + CheckMenuItem(hmenu, (IDM_DDV_33 + ddnoise_vol) - 1, MF_UNCHECKED); + ddnoise_vol = (LOWORD(wParam) - IDM_DDV_33) + 1; + CheckMenuItem(hmenu, (IDM_DDV_33 + ddnoise_vol) - 1, MF_CHECKED); + break; + + case IDM_DDT_525: case IDM_DDT_35: + CheckMenuItem(hmenu, IDM_DDT_525 + ddnoise_type, MF_UNCHECKED); + ddnoise_type = LOWORD(wParam) - IDM_DDT_525; + CheckMenuItem(hmenu, IDM_DDT_525 + ddnoise_type, MF_CHECKED); + ddnoise_close(); + ddnoise_init(); + break; + + case IDM_DEBUGGER: + EnterCriticalSection(&cs); + rest(200); + if (!debugon) + { + debug = debugon = 1; + debug_start(); +// EnableMenuItem(hmenu,IDM_BREAK,MF_ENABLED); + } + else + { + debug ^= 1; + debug_end(); +// EnableMenuItem(hmenu,IDM_BREAK,MF_GRAYED); + } + CheckMenuItem(hmenu, IDM_DEBUGGER, (debug) ? MF_CHECKED: MF_UNCHECKED); + LeaveCriticalSection(&cs); + break; + case IDM_BREAK: + debug = 1; + break; + + case IDM_SCRSHOT: + if (!getsfile(hwnd, "Bitmap file (*.BMP)\0*.BMP\0All files (*.*)\0*.*\0", vid_scrshotname, "BMP")) + { + vid_savescrshot = 1; + } + break; + + case IDM_KEY_REDEFINE: + redefinekeys(); + break; + + case IDM_KEY_AS: + keyas = !keyas; + CheckMenuItem(hmenu, IDM_KEY_AS, (keyas) ? MF_CHECKED : MF_UNCHECKED); + break; + + case IDM_MOUSE_AMX: + mouse_amx = !mouse_amx; + CheckMenuItem(hmenu, IDM_MOUSE_AMX, (mouse_amx) ? MF_CHECKED : MF_UNCHECKED); + main_setmouse(); + updatewindowtitle(); + break; + + case IDM_IDE_ENABLE: + EnterCriticalSection(&cs); + CheckMenuItem(hmenu, IDM_IDE_ENABLE, (!ide_enable) ? MF_CHECKED : MF_UNCHECKED); + ide_enable = !ide_enable; + main_restart(); + LeaveCriticalSection(&cs); + break; + + case IDM_SPD_10: case IDM_SPD_25: case IDM_SPD_50: case IDM_SPD_75: case IDM_SPD_100: + case IDM_SPD_150: case IDM_SPD_200: case IDM_SPD_300: case IDM_SPD_400: case IDM_SPD_500: + CheckMenuItem(hmenu, IDM_SPD_10 + emuspeed, MF_UNCHECKED); + emuspeed = curmodel = LOWORD(wParam) - IDM_SPD_10; + changetimerspeed(timerspeeds[emuspeed]); + vid_fskipmax = frameskips[emuspeed]; + CheckMenuItem(hmenu, IDM_SPD_10 + emuspeed, MF_CHECKED); + break; + } + if (LOWORD(wParam) >= IDM_MODEL_0 && LOWORD(wParam) < (IDM_MODEL_0 + 50)) + { + CheckMenuItem(hmenu, IDM_MODEL_0 + curmodel, MF_UNCHECKED); + oldmodel = curmodel; + curmodel = LOWORD(wParam) - IDM_MODEL_0; + CheckMenuItem(hmenu, IDM_MODEL_0 + curmodel, MF_CHECKED); + main_restart(); + updatewindowtitle(); + } + if (LOWORD(wParam) >= IDM_SID_TYPE && LOWORD(wParam) < (IDM_SID_TYPE + 100)) + { + CheckMenuItem(hmenu, IDM_SID_TYPE + cursid, MF_UNCHECKED); + cursid = LOWORD(wParam) - IDM_SID_TYPE; + CheckMenuItem(hmenu, IDM_SID_TYPE + cursid, MF_CHECKED); + sid_settype(sidmethod, cursid); + } + return 0; + + case WM_USER: + if (videoresize) SetWindowLong(hwnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE); + else SetWindowLong(hwnd, GWL_STYLE, (WS_OVERLAPPEDWINDOW & ~WS_SIZEBOX & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX) | WS_VISIBLE); + GetWindowRect(hwnd, &rect); + SetWindowPos(hwnd, 0, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER | SWP_FRAMECHANGED); + break; + + case WM_USER+1: + if (videoresize) SetWindowLong(hwnd, GWL_STYLE, WS_OVERLAPPEDWINDOW & ~WS_VISIBLE); + else SetWindowLong(hwnd, GWL_STYLE, (WS_OVERLAPPEDWINDOW & ~WS_SIZEBOX & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX) & ~WS_VISIBLE); + GetWindowRect(hwnd,&rect); + SetWindowPos(hwnd, 0, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER | SWP_FRAMECHANGED); + break; + + case WM_DESTROY: + PostQuitMessage (0); /* send a WM_QUIT to the message queue */ + break; + + case WM_KILLFOCUS: +// rpclog("KillFocus\n"); +// infocus=0; +// spdcount=0; + if (mousecapture) + { + ClipCursor(&oldclip); + mousecapture = 0; + updatewindowtitle(); + } + break; + + case WM_LBUTTONUP: + if (!mousecapture && (curtube == 3 || mouse_amx)) + { + GetClipCursor(&oldclip); + GetWindowRect(hwnd, &newclip); + newclip.left += GetSystemMetrics(SM_CXFIXEDFRAME) + 10; + newclip.right -= GetSystemMetrics(SM_CXFIXEDFRAME) + 10; + newclip.top += GetSystemMetrics(SM_CXFIXEDFRAME) + GetSystemMetrics(SM_CYMENUSIZE) + GetSystemMetrics(SM_CYCAPTION) + 10; + newclip.bottom -= GetSystemMetrics(SM_CXFIXEDFRAME) + 10; + ClipCursor(&newclip); + mousecapture = 1; + updatewindowtitle(); + } + break; + + case WM_ENTERMENULOOP: +// rpclog("EnterMenuLoop\n"); + bempause = 1; + //EnterCriticalSection(&cs); + break; + case WM_EXITMENULOOP: +// rpclog("ExitMenuLoop\n"); + bempause = 0; + key_clear(); + for (c = 0; c < 128; c++) key[c] = 0; + //LeaveCriticalSection(&cs); + break; + + case WM_SETFOCUS: +// rpclog("SetFocus\n"); + key_clear(); + for (c = 0; c < 128; c++) key[c] = 0; + bempause = 0; + break; + + case WM_SIZE: + winsizex = lParam & 0xFFFF; + winsizey = lParam >> 16; + break; + + case WM_SYSKEYDOWN: + case WM_KEYDOWN: + if (LOWORD(wParam) != 255) + { + //rpclog("Key %04X %04X\n",LOWORD(wParam),VK_LEFT); + c = MapVirtualKey(LOWORD(wParam),0); + c = hw_to_mycode[c]; +// rpclog("MVK %i %i %i\n",c,hw_to_mycode[c],KEY_PGUP); + if (LOWORD(wParam) == VK_LEFT) c = KEY_LEFT; + if (LOWORD(wParam) == VK_RIGHT) c = KEY_RIGHT; + if (LOWORD(wParam) == VK_UP) c = KEY_UP; + if (LOWORD(wParam) == VK_DOWN) c = KEY_DOWN; + if (LOWORD(wParam) == VK_HOME) c = KEY_HOME; + if (LOWORD(wParam) == VK_END) c = KEY_END; + if (LOWORD(wParam) == VK_INSERT) c = KEY_INSERT; + if (LOWORD(wParam) == VK_DELETE) c = KEY_DEL; + if (LOWORD(wParam) == VK_PRIOR) c = KEY_PGUP; + if (LOWORD(wParam) == VK_NEXT) c = KEY_PGDN; + //rpclog("MVK2 %i %i %i\n",c,hw_to_mycode[c],KEY_PGUP); + key[c]=1; + } + break; + case WM_SYSKEYUP: + case WM_KEYUP: + if (LOWORD(wParam) != 255) + { +// rpclog("Key %04X %04X\n",LOWORD(wParam),VK_LEFT); + c = MapVirtualKey(LOWORD(wParam), 0); + c = hw_to_mycode[c]; + if (LOWORD(wParam) == VK_LEFT) c = KEY_LEFT; + if (LOWORD(wParam) == VK_RIGHT) c = KEY_RIGHT; + if (LOWORD(wParam) == VK_UP) c = KEY_UP; + if (LOWORD(wParam) == VK_DOWN) c = KEY_DOWN; + if (LOWORD(wParam) == VK_HOME) c = KEY_HOME; + if (LOWORD(wParam) == VK_END) c = KEY_END; + if (LOWORD(wParam) == VK_INSERT) c = KEY_INSERT; + if (LOWORD(wParam) == VK_DELETE) c = KEY_DEL; + if (LOWORD(wParam) == VK_PRIOR) c = KEY_PGUP; + if (LOWORD(wParam) == VK_NEXT) c = KEY_PGDN; +// rpclog("MVK %i\n",c); + key[c] = 0; + } + break; + + case WM_CREATE: + +// initbbc(argc,argv); + +// free(argv); + +// mainthread=(HANDLE)_beginthread(_mainthread,0,NULL); + break; + + default: + r = DefWindowProc (hwnd, message, wParam, lParam); + return r; + } + return 0; +} +#endif diff --git a/src/win.h b/src/win.h index 1058f8d4..1f06348c 100644 --- a/src/win.h +++ b/src/win.h @@ -1,3 +1,3 @@ -extern HINSTANCE hinstance; -extern HWND ghwnd; - +extern HINSTANCE hinstance; +extern HWND ghwnd; + diff --git a/src/x86.c b/src/x86.c index 8ca7f248..e6c7b9a3 100644 --- a/src/x86.c +++ b/src/x86.c @@ -1,3525 +1,3525 @@ -/*B-em v2.2 by Tom Walker - 80186 emulation - Originally from PCem - A few bits of 80286 emulation hanging around also*/ -#include -#include -#include -#include "b-em.h" -#include "x86.h" -#include "tube.h" - -static int x86ins=0; - -#define loadcs(seg) CS=seg; cs=seg<<4 - -static void loadseg(uint16_t val, x86seg *seg) -{ - seg->seg=val; - seg->base=val<<4; -} - -#define readmembl(a) (((a)<0xE0000)?x86ram[(a)]:readmemblx86(a)) -#define writemembl(a,b) x86ram[(a)&0xFFFFF]=b; -#define readmemwl(s,a) ((((s)+(a))<0xE0000)?*(uint16_t *)(&x86ram[(s)+(a)]):readmemwlx86(s,a)) -#define writememwl(s,a,b) *(uint16_t *)(&x86ram[((s)+(a))&0xFFFFF])=b; - -#define pc x86pc - -static void x86dumpregs(); - -static uint32_t old8,old82,old83; -static uint16_t oldcs; - -static int tempc; -static uint16_t getword(); -static uint8_t opcode; -static int noint=0; - -static uint8_t readmemblx86(uint32_t addr); -static uint16_t readmemwlx86(uint32_t seg, uint32_t addr); - -static uint8_t *x86ram,*x86rom; - -static int ssegs; - -/*EA calculation*/ - -/*R/M - bits 0-2 - R/M bits 3-5 - Reg bits 6-7 - mod - From 386 programmers manual : -r8(/r) AL CL DL BL AH CH DH BH -r16(/r) AX CX DX BX SP BP SI DI -r32(/r) EAX ECX EDX EBX ESP EBP ESI EDI -/digit (Opcode) 0 1 2 3 4 5 6 7 -REG = 000 001 010 011 100 101 110 111 - ┌───Address -disp8 denotes an 8-bit displacement following the ModR/M byte, to be -sign-extended and added to the index. disp16 denotes a 16-bit displacement -following the ModR/M byte, to be added to the index. Default segment -register is SS for the effective addresses containing a BP index, DS for -other effective addresses. - ──┠┌Mod R/M┠┌────────ModR/M Values in Hexadecimal────────┠- -[BX + SI] 000 00 08 10 18 20 28 30 38 -[BX + DI] 001 01 09 11 19 21 29 31 39 -[BP + SI] 010 02 0A 12 1A 22 2A 32 3A -[BP + DI] 011 03 0B 13 1B 23 2B 33 3B -[SI] 00 100 04 0C 14 1C 24 2C 34 3C -[DI] 101 05 0D 15 1D 25 2D 35 3D -disp16 110 06 0E 16 1E 26 2E 36 3E -[BX] 111 07 0F 17 1F 27 2F 37 3F - -[BX+SI]+disp8 000 40 48 50 58 60 68 70 78 -[BX+DI]+disp8 001 41 49 51 59 61 69 71 79 -[BP+SI]+disp8 010 42 4A 52 5A 62 6A 72 7A -[BP+DI]+disp8 011 43 4B 53 5B 63 6B 73 7B -[SI]+disp8 01 100 44 4C 54 5C 64 6C 74 7C -[DI]+disp8 101 45 4D 55 5D 65 6D 75 7D -[BP]+disp8 110 46 4E 56 5E 66 6E 76 7E -[BX]+disp8 111 47 4F 57 5F 67 6F 77 7F - -[BX+SI]+disp16 000 80 88 90 98 A0 A8 B0 B8 -[BX+DI]+disp16 001 81 89 91 99 A1 A9 B1 B9 -[BX+SI]+disp16 010 82 8A 92 9A A2 AA B2 BA -[BX+DI]+disp16 011 83 8B 93 9B A3 AB B3 BB -[SI]+disp16 10 100 84 8C 94 9C A4 AC B4 BC -[DI]+disp16 101 85 8D 95 9D A5 AD B5 BD -[BP]+disp16 110 86 8E 96 9E A6 AE B6 BE -[BX]+disp16 111 87 8F 97 9F A7 AF B7 BF - -EAX/AX/AL 000 C0 C8 D0 D8 E0 E8 F0 F8 -ECX/CX/CL 001 C1 C9 D1 D9 E1 E9 F1 F9 -EDX/DX/DL 010 C2 CA D2 DA E2 EA F2 FA -EBX/BX/BL 011 C3 CB D3 DB E3 EB F3 FB -ESP/SP/AH 11 100 C4 CC D4 DC E4 EC F4 FC -EBP/BP/CH 101 C5 CD D5 DD E5 ED F5 FD -ESI/SI/DH 110 C6 CE D6 DE E6 EE F6 FE -EDI/DI/BH 111 C7 CF D7 DF E7 EF F7 FF - -mod = 11 - register - 10 - address + 16 bit displacement - 01 - address + 8 bit displacement - 00 - address - -reg = If mod=11, (depending on data size, 16 bits/8 bits, 32 bits=extend 16 bit registers) - 0=AX/AL 1=CX/CL 2=DX/DL 3=BX/BL - 4=SP/AH 5=BP/CH 6=SI/DH 7=DI/BH - - Otherwise, LSB selects SI/DI (0=SI), NMSB selects BX/BP (0=BX), and MSB - selects whether BX/BP are used at all (0=used). - - mod=00 is an exception though - 6=16 bit displacement only - 7=[BX] - - Usage varies with instructions. - - MOV AL,BL has ModR/M as C3, for example. - mod=11, reg=0, r/m=3 - MOV uses reg as dest, and r/m as src. - reg 0 is AL, reg 3 is BL - - If BP or SP are in address calc, seg is SS, else DS -*/ - -static int x86cycles=0; -#define cycles x86cycles - -static uint32_t easeg,eaaddr; -static int rm,reg,mod,rmdat; - -static uint16_t zero=0; -static uint16_t *mod1add[2][8]; -static uint32_t *mod1seg[8]; - -static void makemod1table() -{ - mod1add[0][0]=&BX; mod1add[0][1]=&BX; mod1add[0][2]=&BP; mod1add[0][3]=&BP; - mod1add[0][4]=&SI; mod1add[0][5]=&DI; mod1add[0][6]=&BP; mod1add[0][7]=&BX; - mod1add[1][0]=&SI; mod1add[1][1]=&DI; mod1add[1][2]=&SI; mod1add[1][3]=&DI; - mod1add[1][4]=&zero; mod1add[1][5]=&zero; mod1add[1][6]=&zero; mod1add[1][7]=&zero; - mod1seg[0]=&ds; mod1seg[1]=&ds; mod1seg[2]=&ss; mod1seg[3]=&ss; - mod1seg[4]=&ds; mod1seg[5]=&ds; mod1seg[6]=&ss; mod1seg[7]=&ds; -} - -static void fetcheal() -{ - if (!mod && rm==6) { eaaddr=getword(); easeg=ds; } - else - { - switch (mod) - { - case 0: eaaddr=0; break; - case 1: eaaddr=(uint16_t)(signed char)readmembl(cs+pc); pc++; break; - case 2: eaaddr=getword(); break; - } - eaaddr+=(*mod1add[0][rm])+(*mod1add[1][rm]); - easeg=*mod1seg[rm]; - eaaddr&=0xFFFF; - } -} - -static inline uint8_t geteab() -{ - if (mod==3) - return (rm&4)?regs[rm&3].b.h:regs[rm&3].b.l; - cycles-=3; - return readmembl(easeg+eaaddr); -} - -static inline uint16_t geteaw() -{ - if (mod==3) - return regs[rm].w; - cycles-=3; - return readmemwl(easeg,eaaddr); -} - -static inline uint16_t geteaw2() -{ - if (mod==3) - return regs[rm].w; - cycles-=2; - return readmemwl(easeg,(eaaddr+2)&0xFFFF); -} - -static inline void seteab(uint8_t val) -{ - if (mod==3) - { - if (rm&4) regs[rm&3].b.h=val; - else regs[rm&3].b.l=val; - } - else - { - cycles-=2; - writemembl(easeg+eaaddr,val); - } -} - -static inline void seteaw(uint16_t val) -{ - if (mod==3) - regs[rm].w=val; - else - { - cycles-=2; - writememwl(easeg,eaaddr,val); - } -} - -#define getr8(r) ((r&4)?regs[r&3].b.h:regs[r&3].b.l) - -#define setr8(r,v) if (r&4) regs[r&3].b.h=v; \ - else regs[r&3].b.l=v; - - -/*Flags*/ -static uint8_t znptable8[256]; -static uint16_t znptable16[65536]; - -static void x86makeznptable() -{ - int c,d; - for (c=0;c<256;c++) - { - d=0; - if (c&1) d++; - if (c&2) d++; - if (c&4) d++; - if (c&8) d++; - if (c&16) d++; - if (c&32) d++; - if (c&64) d++; - if (c&128) d++; - if (d&1) - znptable8[c]=0; - else - znptable8[c]=P_FLAG; - if (!c) znptable8[c]|=Z_FLAG; - if (c&0x80) znptable8[c]|=N_FLAG; - } - for (c=0;c<65536;c++) - { - d=0; - if (c&1) d++; - if (c&2) d++; - if (c&4) d++; - if (c&8) d++; - if (c&16) d++; - if (c&32) d++; - if (c&64) d++; - if (c&128) d++; - if (d&1) - znptable16[c]=0; - else - znptable16[c]=P_FLAG; - if (!c) znptable16[c]|=Z_FLAG; - if (c&0x8000) znptable16[c]|=N_FLAG; - } -} - -static uint8_t readmemblx86(uint32_t addr) -{ - if (addr<0xE0000) return x86ram[addr]; -// if (addr<0xC0000) return x86ram[addr-0x40000]; - if (addr>0xF0000) return x86rom[addr&0x3FFF]; - return 0xFF; -} - -static uint16_t readmemwlx86(uint32_t seg, uint32_t addr) -{ - uint32_t addr2=seg+addr; - if (addr2<0xE0000) return *(uint16_t *)(&x86ram[addr2]); -// if (addr2<0xC0000) return *(uint16_t *)(&x86ram[addr2-0x40000]); - if (addr2>0xF0000) return *(uint16_t *)(&x86rom[addr2&0x3FFF]); - return 0xFFFF; -} - -static uint16_t getword() -{ - pc+=2; - return readmemwl(cs,(pc-2)); -} - -static void x86dumpregs() -{ - FILE *f; - int c; - f=fopen("x86ram.dmp","wb"); - fwrite(x86ram,896*1024,1,f); - for (c=0xE0000;c<0x100000;c+=0x4000) fwrite(x86rom,16*1024,1,f); - fclose(f); - printf("AX=%04X BX=%04X CX=%04X DX=%04X DI=%04X SI=%04X BP=%04X SP=%04X\n",AX,BX,CX,DX,DI,SI,BP,SP); - printf("PC=%04X CS=%04X DS=%04X ES=%04X SS=%04X FLAGS=%04X\n",pc,CS,DS,ES,SS,flags); - printf("%04X:%04X %08X %08X %08X\n",oldcs,oldpc,old8,old82,old83); - printf("%i %04X %04X\n",x86ins,pc,x86pc); -/* if (is386) - printf("In %s mode\n",(msw&1)?((eflags&VM_FLAG)?"V86":"protected"):"real"); - else - printf("In %s mode\n",(msw&1)?"protected":"real"); - printf("CS : base=%06X limit=%04X access=%02X\n",cs,_cs.limit,_cs.access); - printf("DS : base=%06X limit=%04X access=%02X\n",ds,_ds.limit,_ds.access); - printf("ES : base=%06X limit=%04X access=%02X\n",es,_es.limit,_es.access); - if (is386) - { - printf("FS : base=%06X limit=%04X access=%02X\n",fs,_fs.limit,_fs.access); - printf("GS : base=%06X limit=%04X access=%02X\n",gs,_gs.limit,_gs.access); - } - printf("SS : base=%06X limit=%04X access=%02X\n",ss,_ss.limit,_ss.access); - printf("GDT : base=%06X limit=%04X\n",gdt.base,gdt.limit); - printf("LDT : base=%06X limit=%04X\n",ldt.base,ldt.limit); - printf("IDT : base=%06X limit=%04X\n",idt.base,idt.limit); - printf("TR : base=%06X limit=%04X\n", tr.base, tr.limit); - if (is386) - { - printf("386 in %s mode stack in %s mode\n",(use32)?"32-bit":"16-bit",(stack32)?"32-bit":"16-bit"); - printf("CR0=%08X CR2=%08X CR3=%08X\n",cr0,cr2,cr3); - }*/ -} - -void x86_reset() -{ -// return; - pc=0; - loadcs(0xFFFF); - flags=2; - makemod1table(); -} - -void x86_init() -{ - FILE *f; - char fn[512]; - if (!x86ram) x86ram=malloc(0x100000); - if (!x86rom) x86rom=malloc(0x4000); - x86makeznptable(); - memset(x86ram,0,0x100000); - append_filename(fn,exedir,"roms/tube/BIOS.ROM",511); - f=fopen(fn,"rb"); - fread(x86rom,0x4000,1,f); - fclose(f); -} - -void x86_close() -{ - if (x86rom) free(x86rom); - if (x86ram) free(x86ram); -} - -static void setznp8(uint8_t val) -{ - flags&=~0xC4; - flags|=znptable8[val]; -} - -#define setznp168 setznp16 -static void setznp16(uint16_t val) -{ - flags&=~0xC4; -// flags|=((val&0x8000)?N_FLAG:((!val)?Z_FLAG:0)); -// flags|=(((znptable8[val&0xFF]&P_FLAG)==(znptable8[val>>8]&P_FLAG))?P_FLAG:0); - flags|=znptable16[val]; -} - -/*void setznp168(uint16_t val) -{ - flags&=~0xC4; - flags|=(znptable16[val]&0xC0)|(znptable8[val&0xFF]&4); -}*/ - -static void setadd8(uint8_t a, uint8_t b) -{ - uint16_t c=(uint16_t)a+(uint16_t)b; - flags&=~0x8D5; - flags|=znptable8[c&0xFF]; - if (c&0x100) flags|=C_FLAG; - if (!((a^b)&0x80)&&((a^c)&0x80)) flags|=V_FLAG; - if (((a&0xF)+(b&0xF))&0x10) flags|=A_FLAG; -} -static void setadd8nc(uint8_t a, uint8_t b) -{ - uint16_t c=(uint16_t)a+(uint16_t)b; - flags&=~0x8D4; - flags|=znptable8[c&0xFF]; - if (!((a^b)&0x80)&&((a^c)&0x80)) flags|=V_FLAG; - if (((a&0xF)+(b&0xF))&0x10) flags|=A_FLAG; -} -static void setadc8(uint8_t a, uint8_t b) -{ - uint16_t c=(uint16_t)a+(uint16_t)b+tempc; - flags&=~0x8D5; - flags|=znptable8[c&0xFF]; - if (c&0x100) flags|=C_FLAG; - if (!((a^b)&0x80)&&((a^c)&0x80)) flags|=V_FLAG; - if (((a&0xF)+(b&0xF))&0x10) flags|=A_FLAG; -} -static void setadd16(uint16_t a, uint16_t b) -{ - uint32_t c=(uint32_t)a+(uint32_t)b; - flags&=~0x8D5; - flags|=znptable16[c&0xFFFF]; - if (c&0x10000) flags|=C_FLAG; - if (!((a^b)&0x8000)&&((a^c)&0x8000)) flags|=V_FLAG; - if (((a&0xF)+(b&0xF))&0x10) flags|=A_FLAG; -} -static void setadd16nc(uint16_t a, uint16_t b) -{ - uint32_t c=(uint32_t)a+(uint32_t)b; - flags&=~0x8D4; - flags|=znptable16[c&0xFFFF]; - if (!((a^b)&0x8000)&&((a^c)&0x8000)) flags|=V_FLAG; - if (((a&0xF)+(b&0xF))&0x10) flags|=A_FLAG; -} -static void x86setadc16(uint16_t a, uint16_t b) -{ - uint32_t c=(uint32_t)a+(uint32_t)b+tempc; - flags&=~0x8D5; - flags|=znptable16[c&0xFFFF]; - if (c&0x10000) flags|=C_FLAG; - if (!((a^b)&0x8000)&&((a^c)&0x8000)) flags|=V_FLAG; - if (((a&0xF)+(b&0xF))&0x10) flags|=A_FLAG; -} - -static void setsub8(uint8_t a, uint8_t b) -{ - uint16_t c=(uint16_t)a-(uint16_t)b; - flags&=~0x8D5; - flags|=znptable8[c&0xFF]; - if (c&0x100) flags|=C_FLAG; - if ((a^b)&(a^c)&0x80) flags|=V_FLAG; - if (((a&0xF)-(b&0xF))&0x10) flags|=A_FLAG; -} -static void setsub8nc(uint8_t a, uint8_t b) -{ - uint16_t c=(uint16_t)a-(uint16_t)b; - flags&=~0x8D4; - flags|=znptable8[c&0xFF]; - if ((a^b)&(a^c)&0x80) flags|=V_FLAG; - if (((a&0xF)-(b&0xF))&0x10) flags|=A_FLAG; -} -static void setsbc8(uint8_t a, uint8_t b) -{ - uint16_t c=(uint16_t)a-(((uint16_t)b)+tempc); - flags&=~0x8D5; - flags|=znptable8[c&0xFF]; - if (c&0x100) flags|=C_FLAG; - if ((a^b)&(a^c)&0x80) flags|=V_FLAG; - if (((a&0xF)-(b&0xF))&0x10) flags|=A_FLAG; -} -static void setsub16(uint16_t a, uint16_t b) -{ - uint32_t c=(uint32_t)a-(uint32_t)b; - flags&=~0x8D5; - flags|=znptable16[c&0xFFFF]; - if (c&0x10000) flags|=C_FLAG; - if ((a^b)&(a^c)&0x8000) flags|=V_FLAG; -// if (x86output) printf("%04X %04X %i\n",a^b,a^c,flags&V_FLAG); - if (((a&0xF)-(b&0xF))&0x10) flags|=A_FLAG; -} -static void setsub16nc(uint16_t a, uint16_t b) -{ - uint32_t c=(uint32_t)a-(uint32_t)b; - flags&=~0x8D4; - flags|=(znptable16[c&0xFFFF]&~4); - flags|=(znptable8[c&0xFF]&4); - if ((a^b)&(a^c)&0x8000) flags|=V_FLAG; - if (((a&0xF)-(b&0xF))&0x10) flags|=A_FLAG; -} -static void x86setsbc16(uint16_t a, uint16_t b) -{ - uint32_t c=(uint32_t)a-(((uint32_t)b)+tempc); - flags&=~0x8D5; - flags|=(znptable16[c&0xFFFF]&~4); - flags|=(znptable8[c&0xFF]&4); - if (c&0x10000) flags|=C_FLAG; - if ((a^b)&(a^c)&0x8000) flags|=V_FLAG; - if (((a&0xF)-(b&0xF))&0x10) flags|=A_FLAG; -} - -static uint32_t x86sa,x86ss,x86src; -static uint32_t x86da,x86ds,x86dst; -static uint16_t x86ena; -static uint16_t x86imask=0; - -static uint8_t inb(uint16_t port) -{ - if ((port&~0xF)==0x80) return tube_parasite_read(port>>1); - return 0xFF; - printf("Bad IN port %04X %04X:%04X\n",port,cs>>4,pc); - x86dumpregs(); - exit(-1); -} - -static void outb(uint16_t port, uint8_t val) -{ -// port&=0xFF; -// printf("OUT %04X %02X %04X:%04X\n",port,val,cs>>4,pc); - switch (port) - { - case 0xFF28: x86imask=val; return; - case 0xFFC0: x86sa=(x86sa&0xFF00)|val; x86src=x86sa+((x86ss&0xF)<<16); return; - case 0xFFC1: x86sa=(x86sa&0xFF)|(val<<8); x86src=x86sa+((x86ss&0xF)<<16); return;//printf("SRC now %05X %04X:%04X\n",x86src,CS,pc); return; - case 0xFFC2: x86ss=(x86ss&0xFF00)|val; x86src=x86sa+((x86ss&0xF)<<16); return; - case 0xFFC3: x86ss=(x86ss&0xFF)|(val<<8); x86src=x86sa+((x86ss&0xF)<<16); return;//printf("SRC now %05X %04X:%04X\n",x86src,CS,pc); return; - case 0xFFC4: x86da=(x86da&0xFF00)|val; x86dst=x86da+((x86ds&0xF)<<16); return; - case 0xFFC5: x86da=(x86da&0xFF)|(val<<8); x86dst=x86da+((x86ds&0xF)<<16); return;//printf("DST now %05X %04X:%04X\n",x86dst,CS,pc); return; - case 0xFFC6: x86ds=(x86ds&0xFF00)|val; x86dst=x86da+((x86ds&0xF)<<16); return; - case 0xFFC7: x86ds=(x86ds&0xFF)|(val<<8); x86dst=x86da+((x86ds&0xF)<<16); return;//printf("DST now %05X %04X:%04X\n",x86dst,CS,pc); return; - case 0xFFCA: x86ena=(x86ena&0xFF00)|val; return; - case 0xFFCB: x86ena=(x86ena&0xFF)|(val<<8); return; - } - if ((port&~0xF)==0x80) - { -// if (port!=0x8E || val!=0) printf("Tube write %02X %02X\n",port,val); - tube_parasite_write(port>>1,val); - return; - } -} - -static void x86_dma() -{ - if (!(x86ena&2)) return; -// printf("Src %05X %04X:%04X Dst %05X %04X:%04X\n",x86src,x86ss,x86sa, x86dst,x86ds,x86da); - if (x86src<0x100) - { -/* if (x86dst==256*1024) - { - x86dumpregs(); - exit(-1); - }*/ - writemembl(x86dst,inb(x86src)); - x86dst++; - } - else - { - outb(x86dst,readmembl(x86src)); - x86src++; - } -} - -static int firstrepcycle=1; -static void rep(int fv) -{ - uint8_t temp; - int c=CX; - uint8_t temp2; - uint16_t tempw,tempw2; - uint16_t ipc=oldpc;//pc-1; - int changeds = 0; - uint32_t oldds = 0; - startrep: - temp=readmembl(cs+pc); pc++; -// if (firstrepcycle && temp==0xA5) printf("REP MOVSW %06X:%04X %06X:%04X\n",ds,SI,es,DI); -// if (x86output) printf("REP %02X %04X\n",temp,ipc); - switch (temp) - { - case 0x08: - pc=ipc+1; - cycles-=2; - break; - case 0x26: /*ES:*/ - oldds=ds; - ds=es; - changeds=1; - cycles-=2; - goto startrep; - break; - case 0x2E: /*CS:*/ - oldds=ds; - ds=cs; - changeds=1; - cycles-=2; - goto startrep; - break; - case 0x36: /*SS:*/ - oldds=ds; - ds=ss; - changeds=1; - cycles-=2; - goto startrep; - break; - case 0x6E: /*REP OUTSB*/ - if (c>0) - { - temp2=readmembl(ds+SI); - outb(DX,temp2); - if (flags&D_FLAG) SI--; - else SI++; - c--; - cycles-=5; - } - if (c>0) { firstrepcycle=0; pc=ipc; if (ssegs) ssegs++; } - else firstrepcycle=1; - break; - case 0xA4: /*REP MOVSB*/ - if (c>0) - { - temp2=readmembl(ds+SI); - writemembl(es+DI,temp2); -// if (x86output) printf("Moved %02X from %04X:%04X to %04X:%04X\n",temp2,ds>>4,SI,es>>4,DI); - if (flags&D_FLAG) { DI--; SI--; } - else { DI++; SI++; } - c--; - cycles-=8; - } - if (c>0) { firstrepcycle=0; pc=ipc; if (ssegs) ssegs++; } - else firstrepcycle=1; -// } - break; - case 0xA5: /*REP MOVSW*/ - if (c>0) - { - tempw=readmemwl(ds,SI); - writememwl(es,DI,tempw); - if (flags&D_FLAG) { DI-=2; SI-=2; } - else { DI+=2; SI+=2; } - c--; - cycles-=8; - } - if (c>0) { firstrepcycle=0; pc=ipc; if (ssegs) ssegs++; } - else firstrepcycle=1; -// } - break; - case 0xA6: /*REP CMPSB*/ - if (fv) flags|=Z_FLAG; - else flags&=~Z_FLAG; - if ((c>0) && (fv==((flags&Z_FLAG)?1:0))) - { - temp=readmembl(ds+SI); - temp2=readmembl(es+DI); -// printf("CMPSB %c %c %i %05X %05X %04X:%04X\n",temp,temp2,c,ds+SI,es+DI,cs>>4,pc); - if (flags&D_FLAG) { DI--; SI--; } - else { DI++; SI++; } - c--; - cycles-=22; - setsub8(temp,temp2); - } - if ((c>0) && (fv==((flags&Z_FLAG)?1:0))) { pc=ipc; firstrepcycle=0; if (ssegs) ssegs++; } - else firstrepcycle=1; - break; - case 0xA7: /*REP CMPSW*/ - if (fv) flags|=Z_FLAG; - else flags&=~Z_FLAG; - if ((c>0) && (fv==((flags&Z_FLAG)?1:0))) - { - tempw=readmemwl(ds,SI); - tempw2=readmemwl(es,DI); - if (flags&D_FLAG) { DI-=2; SI-=2; } - else { DI+=2; SI+=2; } - c--; - cycles-=22; - setsub16(tempw,tempw2); - } - if ((c>0) && (fv==((flags&Z_FLAG)?1:0))) { pc=ipc; firstrepcycle=0; if (ssegs) ssegs++; } - else firstrepcycle=1; - break; - case 0xAA: /*REP STOSB*/ - if (c>0) - { - writemembl(es+DI,AL); - if (flags&D_FLAG) DI--; - else DI++; - c--; - cycles-=9; - } - if (c>0) { firstrepcycle=0; pc=ipc; if (ssegs) ssegs++; } - else firstrepcycle=1; - break; - case 0xAB: /*REP STOSW*/ - if (c>0) - { - writememwl(es,DI,AX); - if (flags&D_FLAG) DI-=2; - else DI+=2; - c--; - cycles-=9; - } - if (c>0) { firstrepcycle=0; pc=ipc; if (ssegs) ssegs++; } - else firstrepcycle=1; -// printf("REP STOSW %04X:%04X %04X:%04X %04X %04X\n",CS,pc,ES,DI,AX,CX); } - break; - case 0xAC: /*REP LODSB*/ - if (c>0) - { - temp2=readmembl(ds+SI); - if (flags&D_FLAG) SI--; - else SI++; - c--; - cycles-=4; - } - if (c>0) { firstrepcycle=0; pc=ipc; if (ssegs) ssegs++; } - else firstrepcycle=1; - break; - case 0xAD: /*REP LODSW*/ - if (c>0) - { - tempw2=readmemwl(ds,SI); - if (flags&D_FLAG) SI-=2; - else SI+=2; - c--; - cycles-=4; - } - if (c>0) { firstrepcycle=0; pc=ipc; if (ssegs) ssegs++; } - else firstrepcycle=1; - break; - case 0xAE: /*REP SCASB*/ - if (fv) flags|=Z_FLAG; - else flags&=~Z_FLAG; - if ((c>0) && (fv==((flags&Z_FLAG)?1:0))) - { - temp2=readmembl(es+DI); -// if (x86output) printf("SCASB %02X %c %02X %05X ",temp2,temp2,AL,es+DI); - setsub8(AL,temp2); -// if (x86output && flags&Z_FLAG) printf("Match %02X %02X\n",AL,temp2); - if (flags&D_FLAG) DI--; - else DI++; - c--; - cycles-=15; - } -//if (x86output) printf("%i %i %i %i\n",c,(c>0),(fv==((flags&Z_FLAG)?1:0)),((c>0) && (fv==((flags&Z_FLAG)?1:0)))); - if ((c>0) && (fv==((flags&Z_FLAG)?1:0))) { pc=ipc; firstrepcycle=0; if (ssegs) ssegs++; } - else firstrepcycle=1; -// cycles-=120; - break; - case 0xAF: /*REP SCASW*/ - if (fv) flags|=Z_FLAG; - else flags&=~Z_FLAG; - if ((c>0) && (fv==((flags&Z_FLAG)?1:0))) - { - tempw=readmemwl(es,DI); - setsub16(AX,tempw); - if (flags&D_FLAG) DI-=2; - else DI+=2; - c--; - cycles-=15; - } - if ((c>0) && (fv==((flags&Z_FLAG)?1:0))) { pc=ipc; firstrepcycle=0; if (ssegs) ssegs++; } - else firstrepcycle=1; - break; - default: - pc=ipc; - cycles-=20; -// printf("Bad REP %02X\n",temp); -// x86dumpregs(); -// exit(-1); - } - CX=c; - if (changeds) ds=oldds; -} - -static int inhlt=0; -static uint16_t lastpc,lastcs; -static int skipnextprint=0; -//#if 0 -void x86_exec() -{ - uint8_t temp = 0, temp2; - uint16_t addr, tempw, tempw2, tempw3, tempw4; - signed char offset; - int tempws; - uint32_t templ; - int c,cycdiff; - int tempi; -// tubecycles+=(cycs<<2); -// printf("X86exec %i %i\n",tubecycles,cycs); - while (tubecycles>0) - { - cycdiff=tubecycles; -// old83=old82; -// old82=old8; -// old8=pc+(CS<<16); - oldcs=CS; - oldpc=pc; - opcodestart: - opcode=readmembl(cs+pc); - tempc=flags&C_FLAG; -#if 0 - if (x86output && /*cs<0xF0000 && */!ssegs)//opcode!=0x26 && opcode!=0x36 && opcode!=0x2E && opcode!=0x3E) - { - if ((opcode!=0xF2 && opcode!=0xF3) || firstrepcycle) - { - if (!skipnextprint) printf("%04X:%04X : %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %02X %04X\n",cs,pc,AX,BX,CX,DX,CS,DS,ES,SS,DI,SI,BP,SP,opcode,flags,rmdat); - skipnextprint=0; -// ins++; -/* if (ins==50000) - { - x86dumpregs(); - exit(-1); - }*/ -/* if (ins==500000) - { - x86dumpregs(); - exit(-1); - }*/ - } - } -#endif - pc++; - inhlt=0; -// if (ins==500000) { x86dumpregs(); exit(0); }*/ - switch (opcode) - { - case 0x00: /*ADD 8,reg*/ - fetchea(); - temp=geteab(); - setadd8(temp,getr8(reg)); - temp+=getr8(reg); - seteab(temp); - tubecycles-=((mod==3)?3:10); - break; - case 0x01: /*ADD 16,reg*/ - fetchea(); - tempw=geteaw(); - setadd16(tempw,regs[reg].w); - tempw+=regs[reg].w; - seteaw(tempw); - tubecycles-=((mod==3)?3:10); - break; - case 0x02: /*ADD reg,8*/ - fetchea(); - temp=geteab(); - setadd8(getr8(reg),temp); - setr8(reg,getr8(reg)+temp); - tubecycles-=((mod==3)?3:10); - break; - case 0x03: /*ADD reg,16*/ - fetchea(); - tempw=geteaw(); - setadd16(regs[reg].w,tempw); - regs[reg].w+=tempw; - tubecycles-=((mod==3)?3:10); - break; - case 0x04: /*ADD AL,#8*/ - temp=readmembl(cs+pc); pc++; - setadd8(AL,temp); - AL+=temp; - tubecycles-=4; - break; - case 0x05: /*ADD AX,#16*/ - tempw=getword(); - setadd16(AX,tempw); - AX+=tempw; - tubecycles-=4; - break; - - case 0x06: /*PUSH ES*/ - if (ssegs) ss=oldss; - writememwl(ss,((SP-2)&0xFFFF),ES); - SP-=2; - tubecycles-=9; - break; - case 0x07: /*POP ES*/ - if (ssegs) ss=oldss; - tempw=readmemwl(ss,SP); - loadseg(tempw,&_es); - SP+=2; - tubecycles-=8; - break; - - case 0x08: /*OR 8,reg*/ - fetchea(); - temp=geteab(); - temp|=getr8(reg); - setznp8(temp); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - seteab(temp); - tubecycles-=((mod==3)?3:10); - break; - case 0x09: /*OR 16,reg*/ - fetchea(); - tempw=geteaw(); - tempw|=regs[reg].w; - setznp16(tempw); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - seteaw(tempw); - tubecycles-=((mod==3)?3:10); - break; - case 0x0A: /*OR reg,8*/ - fetchea(); - temp=geteab(); - temp|=getr8(reg); - setznp8(temp); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - setr8(reg,temp); - tubecycles-=((mod==3)?3:10); - break; - case 0x0B: /*OR reg,16*/ - fetchea(); - tempw=geteaw(); - tempw|=regs[reg].w; - setznp16(tempw); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - regs[reg].w=tempw; - tubecycles-=((mod==3)?3:10); - break; - case 0x0C: /*OR AL,#8*/ - AL|=readmembl(cs+pc); pc++; - setznp8(AL); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - tubecycles-=4; - break; - case 0x0D: /*OR AX,#16*/ - AX|=getword(); - setznp16(AX); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - tubecycles-=4; - break; - - case 0x0E: /*PUSH CS*/ - if (ssegs) ss=oldss; - writememwl(ss,((SP-2)&0xFFFF),CS); - SP-=2; - tubecycles-=9; - break; - - case 0x0F: - temp=readmembl(cs+pc); pc++; - switch (temp) - { - case 0x84: /*JE*/ - tempw=getword(); - if (flags&Z_FLAG) pc+=tempw; - tubecycles-=4; - break; - case 0x85: /*JNE*/ - tempw=getword(); - if (!(flags&Z_FLAG)) pc+=tempw; - tubecycles-=4; - break; - - case 0xFF: /*Invalid - Windows 3.1 syscall trap?*/ - pc-=2; - if (ssegs) ss=oldss; - writememwl(ss,((SP-2)&0xFFFF),flags|0xF000); - writememwl(ss,((SP-4)&0xFFFF),CS); - writememwl(ss,((SP-6)&0xFFFF),pc); - SP-=6; - addr=6<<2; -// flags&=~I_FLAG; - pc=readmemwl(0,addr); - loadcs(readmemwl(0,addr+2)); - /*if (!pc && !cs) - { - printf("Bad int %02X %04X:%04X\n",temp,oldcs,oldpc); - x86dumpregs(); - exit(-1); - }*/ - tubecycles-=70; - break; - - default: - break; -// printf("Bad 0F opcode %02X\n",temp); -// pc-=2; -// x86dumpregs(); -// exit(-1); - } - break; - - case 0x10: /*ADC 8,reg*/ - fetchea(); - temp=geteab(); - temp2=getr8(reg); - setadc8(temp,temp2); - temp+=temp2+tempc; - seteab(temp); - tubecycles-=((mod==3)?3:10); - break; - case 0x11: /*ADC 16,reg*/ - fetchea(); - tempw=geteaw(); - tempw2=regs[reg].w; - x86setadc16(tempw,tempw2); - tempw+=tempw2+tempc; - seteaw(tempw); - tubecycles-=((mod==3)?3:10); - break; - case 0x12: /*ADC reg,8*/ - fetchea(); - temp=geteab(); - setadc8(getr8(reg),temp); - setr8(reg,getr8(reg)+temp+tempc); - tubecycles-=((mod==3)?3:10); - break; - case 0x13: /*ADC reg,16*/ - fetchea(); - tempw=geteaw(); - x86setadc16(regs[reg].w,tempw); - regs[reg].w+=tempw+tempc; - tubecycles-=((mod==3)?3:10); - break; - case 0x14: /*ADC AL,#8*/ - tempw=readmembl(cs+pc); pc++; - setadc8(AL,tempw); - AL+=tempw+tempc; - tubecycles-=4; - break; - case 0x15: /*ADC AX,#16*/ - tempw=getword(); - x86setadc16(AX,tempw); - AX+=tempw+tempc; - tubecycles-=4; - break; - - case 0x16: /*PUSH SS*/ - if (ssegs) ss=oldss; - writememwl(ss,((SP-2)&0xFFFF),SS); - SP-=2; - tubecycles-=9; - break; - case 0x17: /*POP SS*/ - if (ssegs) ss=oldss; - tempw=readmemwl(ss,SP); - loadseg(tempw,&_ss); - SP+=2; - noint=1; - tubecycles-=8; -// x86output=1; - break; - - case 0x18: /*SBB 8,reg*/ - fetchea(); - temp=geteab(); - temp2=getr8(reg); - setsbc8(temp,temp2); - temp-=(temp2+tempc); - seteab(temp); - tubecycles-=((mod==3)?3:10); - break; - case 0x19: /*SBB 16,reg*/ - fetchea(); - tempw=geteaw(); - tempw2=regs[reg].w; - x86setsbc16(tempw,tempw2); - tempw-=(tempw2+tempc); - seteaw(tempw); - tubecycles-=((mod==3)?3:10); - break; - case 0x1A: /*SBB reg,8*/ - fetchea(); - temp=geteab(); - setsbc8(getr8(reg),temp); - setr8(reg,getr8(reg)-(temp+tempc)); - tubecycles-=((mod==3)?3:10); - break; - case 0x1B: /*SBB reg,16*/ - fetchea(); - tempw=geteaw(); - tempw2=regs[reg].w; - x86setsbc16(tempw2,tempw); - tempw2-=(tempw+tempc); - regs[reg].w=tempw2; - tubecycles-=((mod==3)?3:10); - break; - case 0x1C: /*SBB AL,#8*/ - temp=readmembl(cs+pc); pc++; - setsbc8(AL,temp); - AL-=(temp+tempc); - tubecycles-=4; - break; - case 0x1D: /*SBB AX,#16*/ - tempw=getword(); - x86setsbc16(AX,tempw); - AX-=(tempw+tempc); - tubecycles-=4; - break; - - case 0x1E: /*PUSH DS*/ - if (ssegs) ss=oldss; - writememwl(ss,((SP-2)&0xFFFF),DS); - SP-=2; - tubecycles-=9; - break; - case 0x1F: /*POP DS*/ - if (ssegs) ss=oldss; - tempw=readmemwl(ss,SP); - loadseg(tempw,&_ds); - if (ssegs) oldds=ds; - SP+=2; - tubecycles-=8; - break; - - case 0x20: /*AND 8,reg*/ - fetchea(); - temp=geteab(); - temp&=getr8(reg); - setznp8(temp); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - seteab(temp); - tubecycles-=((mod==3)?3:10); - break; - case 0x21: /*AND 16,reg*/ - fetchea(); - tempw=geteaw(); - tempw&=regs[reg].w; - setznp16(tempw); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - seteaw(tempw); - tubecycles-=((mod==3)?3:10); - break; - case 0x22: /*AND reg,8*/ - fetchea(); - temp=geteab(); - temp&=getr8(reg); - setznp8(temp); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - setr8(reg,temp); - tubecycles-=((mod==3)?3:10); - break; - case 0x23: /*AND reg,16*/ - fetchea(); - tempw=geteaw(); - tempw&=regs[reg].w; - setznp16(tempw); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - regs[reg].w=tempw; - tubecycles-=((mod==3)?3:10); - break; - case 0x24: /*AND AL,#8*/ - AL&=readmembl(cs+pc); pc++; - setznp8(AL); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - tubecycles-=4; - break; - case 0x25: /*AND AX,#16*/ - AX&=getword(); - setznp16(AX); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - tubecycles-=4; - break; - - case 0x26: /*ES:*/ - oldss=ss; - oldds=ds; - ds=ss=es; - ssegs=2; - tubecycles-=4; - goto opcodestart; -// break; - - case 0x27: /*DAA*/ - if ((flags&A_FLAG) || ((AL&0xF)>9)) - { - tempi=((uint16_t)AL)+6; - AL+=6; - flags|=A_FLAG; - if (tempi&0x100) flags|=C_FLAG; - } - if ((flags&C_FLAG) || (AL>0x9F)) - { - AL+=0x60; - flags|=C_FLAG; - } - setznp8(AL); - tubecycles-=4; - break; - - case 0x28: /*SUB 8,reg*/ - fetchea(); - temp=geteab(); - setsub8(temp,getr8(reg)); - temp-=getr8(reg); - seteab(temp); - tubecycles-=((mod==3)?3:10); - break; - case 0x29: /*SUB 16,reg*/ - fetchea(); - tempw=geteaw(); - setsub16(tempw,regs[reg].w); - tempw-=regs[reg].w; - seteaw(tempw); - tubecycles-=((mod==3)?3:10); - break; - case 0x2A: /*SUB reg,8*/ - fetchea(); - temp=geteab(); - setsub8(getr8(reg),temp); - setr8(reg,getr8(reg)-temp); - tubecycles-=((mod==3)?3:10); - break; - case 0x2B: /*SUB reg,16*/ - fetchea(); - tempw=geteaw(); - setsub16(regs[reg].w,tempw); - regs[reg].w-=tempw; - tubecycles-=((mod==3)?3:10); - break; - case 0x2C: /*SUB AL,#8*/ - temp=readmembl(cs+pc); pc++; - setsub8(AL,temp); - AL-=temp; - tubecycles-=4; - break; - case 0x2D: /*SUB AX,#16*/ - tempw=getword(); - setsub16(AX,tempw); - AX-=tempw; - tubecycles-=4; - break; - case 0x2E: /*CS:*/ - oldss=ss; - oldds=ds; - ds=ss=cs; - ssegs=2; - tubecycles-=4; - goto opcodestart; - case 0x2F: /*DAS*/ - if ((flags&A_FLAG)||((AL&0xF)>9)) - { - tempi=((uint16_t)AL)-6; - AL-=6; - flags|=A_FLAG; - if (tempi&0x100) flags|=C_FLAG; - } - if ((flags&C_FLAG)||(AL>0x9F)) - { - AL-=0x60; - flags|=C_FLAG; - } - setznp8(AL); - tubecycles-=4; - break; - case 0x30: /*XOR 8,reg*/ - fetchea(); - temp=geteab(); - temp^=getr8(reg); - setznp8(temp); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - seteab(temp); - tubecycles-=((mod==3)?3:10); - break; - case 0x31: /*XOR 16,reg*/ - fetchea(); - tempw=geteaw(); - tempw^=regs[reg].w; - setznp16(tempw); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - seteaw(tempw); - tubecycles-=((mod==3)?3:10); - break; - case 0x32: /*XOR reg,8*/ - fetchea(); - temp=geteab(); - temp^=getr8(reg); - setznp8(temp); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - setr8(reg,temp); - tubecycles-=((mod==3)?3:10); - break; - case 0x33: /*XOR reg,16*/ - fetchea(); - tempw=geteaw(); - tempw^=regs[reg].w; - setznp16(tempw); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - regs[reg].w=tempw; - tubecycles-=((mod==3)?3:10); - break; - case 0x34: /*XOR AL,#8*/ - AL^=readmembl(cs+pc); pc++; - setznp8(AL); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - tubecycles-=4; - break; - case 0x35: /*XOR AX,#16*/ - AX^=getword(); - setznp16(AX); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - tubecycles-=4; - break; - - case 0x36: /*SS:*/ - oldss=ss; - oldds=ds; - ds=ss=ss; - ssegs=2; - tubecycles-=4; - goto opcodestart; -// break; - - case 0x37: /*AAA*/ - if ((flags&A_FLAG)||((AL&0xF)>9)) - { - AL+=6; - AH++; - flags|=(A_FLAG|C_FLAG); - } - else - flags&=~(A_FLAG|C_FLAG); - AL&=0xF; - tubecycles-=8; - break; - - case 0x38: /*CMP 8,reg*/ - fetchea(); - temp=geteab(); - setsub8(temp,getr8(reg)); - tubecycles-=((mod==3)?3:10); - break; - case 0x39: /*CMP 16,reg*/ - fetchea(); - tempw=geteaw(); - setsub16(tempw,regs[reg].w); - tubecycles-=((mod==3)?3:10); - break; - case 0x3A: /*CMP reg,8*/ - fetchea(); - temp=geteab(); - setsub8(getr8(reg),temp); - tubecycles-=((mod==3)?3:10); - break; - case 0x3B: /*CMP reg,16*/ - fetchea(); - tempw=geteaw(); - setsub16(regs[reg].w,tempw); - tubecycles-=((mod==3)?3:10); - break; - case 0x3C: /*CMP AL,#8*/ - temp=readmembl(cs+pc); pc++; - setsub8(AL,temp); - tubecycles-=4; - break; - case 0x3D: /*CMP AX,#16*/ - tempw=getword(); - setsub16(AX,tempw); - tubecycles-=4; - break; - - case 0x3E: /*DS:*/ - oldss=ss; - oldds=ds; - ds=ss=ds; - ssegs=2; - tubecycles-=4; - goto opcodestart; -// break; - - case 0x3F: /*AAS*/ - if ((flags&A_FLAG)||((AL&0xF)>9)) - { - AL-=6; - AH--; - flags|=(A_FLAG|C_FLAG); - } - else - flags&=~(A_FLAG|C_FLAG); - AL&=0xF; - tubecycles-=7; - break; - - case 0x40: case 0x41: case 0x42: case 0x43: /*INC r16*/ - case 0x44: case 0x45: case 0x46: case 0x47: - setadd16nc(regs[opcode&7].w,1); - regs[opcode&7].w++; - tubecycles-=3; - break; - case 0x48: case 0x49: case 0x4A: case 0x4B: /*DEC r16*/ - case 0x4C: case 0x4D: case 0x4E: case 0x4F: - setsub16nc(regs[opcode&7].w,1); - regs[opcode&7].w--; - tubecycles-=3; - break; - - case 0x50: case 0x51: case 0x52: case 0x53: /*PUSH r16*/ - case 0x54: case 0x55: case 0x56: case 0x57: - if (ssegs) ss=oldss; - SP-=2; - writememwl(ss,SP,regs[opcode&7].w); - tubecycles-=10; - break; - case 0x58: case 0x59: case 0x5A: case 0x5B: /*POP r16*/ - case 0x5C: case 0x5D: case 0x5E: case 0x5F: - if (ssegs) ss=oldss; - SP+=2; - regs[opcode&7].w=readmemwl(ss,(SP-2)&0xFFFF); - tubecycles-=8; - break; - - case 0x60: /*PUSHA*/ - writememwl(ss,((SP-2)&0xFFFF),AX); - writememwl(ss,((SP-4)&0xFFFF),CX); - writememwl(ss,((SP-6)&0xFFFF),DX); - writememwl(ss,((SP-8)&0xFFFF),BX); - writememwl(ss,((SP-10)&0xFFFF),SP); - writememwl(ss,((SP-12)&0xFFFF),BP); - writememwl(ss,((SP-14)&0xFFFF),SI); - writememwl(ss,((SP-16)&0xFFFF),DI); - SP-=16; - tubecycles-=36; - break; - case 0x61: /*POPA*/ - DI=readmemwl(ss,((SP)&0xFFFF)); - SI=readmemwl(ss,((SP+2)&0xFFFF)); - BP=readmemwl(ss,((SP+4)&0xFFFF)); - BX=readmemwl(ss,((SP+8)&0xFFFF)); - DX=readmemwl(ss,((SP+10)&0xFFFF)); - CX=readmemwl(ss,((SP+12)&0xFFFF)); - AX=readmemwl(ss,((SP+14)&0xFFFF)); - SP+=16; - tubecycles-=51; - break; -// case 0x66: /*BIOS trap*/ -// callbios(); -// tubecycles-=16; -// break; -//#if 0 - case 0x68: /*PUSH #w*/ - tempw=getword(); - writememwl(ss,((SP-2)&0xFFFF),tempw); - SP-=2; - tubecycles-=9; - break; - case 0x69: /*IMUL r16*/ - fetchea(); - tempw=geteaw(); - tempw2=getword(); - templ=((int)(signed short)tempw)*((int)(signed short)tempw2); -// printf("%04X*%04X = %08X\n",tempw,tempw2,templ); - if ((templ>>16)!=0 && (templ>>16)!=0xFFFF) flags|=C_FLAG|V_FLAG; - else flags&=~(C_FLAG|V_FLAG); - regs[reg].w=templ&0xFFFF; -// seteaw(templ&0xFFFF); - tubecycles-=((mod==3)?40:34); - break; - case 0x6A: /*PUSH #eb*/ - tempw=readmembl(cs+pc); pc++; - if (tempw&0x80) tempw|=0xFF00; - writememwl(ss,((SP-2)&0xFFFF),tempw); - SP-=2; - tubecycles-=9; - break; -// #if 0 - case 0x6B: /*IMUL r8*/ - fetchea(); - tempw=geteaw(); - tempw2=readmembl(cs+pc); pc++; - if (tempw2&0x80) tempw2|=0xFF00; -// printf("%04X * %04X = ",tempw,tempw2); - templ=((int)(signed short)tempw)*((int)(signed short)tempw2); -// printf("%08X\n",templ); - if ((templ>>16)!=0 && (templ>>16)!=0xFFFF) flags|=C_FLAG|V_FLAG; - else flags&=~(C_FLAG|V_FLAG); - regs[reg].w=templ&0xFFFF; -// seteaw(templ&0xFFFF); - tubecycles-=((mod==3)?34:25); - break; -//#endif - case 0x6C: /*INSB*/ - temp=inb(DX); - writemembl(es+DI,temp); - if (flags&D_FLAG) DI--; - else DI++; - tubecycles-=14; - break; - case 0x6E: /*OUTSB*/ - temp=readmembl(ds+SI); - if (flags&D_FLAG) SI--; - else SI++; - outb(DX,temp); - tubecycles-=14; - break; -// #endif - - case 0x70: /*JO*/ - offset=(signed char)readmembl(cs+pc); pc++; - if (flags&V_FLAG) { pc+=offset; tubecycles-=9; } - tubecycles-=4; - break; - case 0x71: /*JNO*/ - offset=(signed char)readmembl(cs+pc); pc++; - if (!(flags&V_FLAG)) { pc+=offset; tubecycles-=9; } - tubecycles-=4; - break; - case 0x72: /*JB*/ - offset=(signed char)readmembl(cs+pc); pc++; - if (flags&C_FLAG) { pc+=offset; tubecycles-=9; } - tubecycles-=4; - break; - case 0x73: /*JNB*/ - offset=(signed char)readmembl(cs+pc); pc++; - if (!(flags&C_FLAG)) { pc+=offset; tubecycles-=9; } - tubecycles-=4; - break; - case 0x74: /*JZ*/ - offset=(signed char)readmembl(cs+pc); pc++; - if (flags&Z_FLAG) { pc+=offset; tubecycles-=9; } - tubecycles-=4; - break; - case 0x75: /*JNZ*/ - offset=(signed char)readmembl(cs+pc); pc++; - if (!(flags&Z_FLAG)) { pc+=offset; tubecycles-=9; } - tubecycles-=4; - break; - case 0x76: /*JBE*/ - offset=(signed char)readmembl(cs+pc); pc++; - if (flags&(C_FLAG|Z_FLAG)) { pc+=offset; tubecycles-=9; } - tubecycles-=4; - break; - case 0x77: /*JNBE*/ - offset=(signed char)readmembl(cs+pc); pc++; - if (!(flags&(C_FLAG|Z_FLAG))) { pc+=offset; tubecycles-=9; } - tubecycles-=4; - break; - case 0x78: /*JS*/ - offset=(signed char)readmembl(cs+pc); pc++; - if (flags&N_FLAG) { pc+=offset; tubecycles-=9; } - tubecycles-=4; - break; - case 0x79: /*JNS*/ - offset=(signed char)readmembl(cs+pc); pc++; - if (!(flags&N_FLAG)) { pc+=offset; tubecycles-=9; } - tubecycles-=4; - break; - case 0x7A: /*JP*/ - offset=(signed char)readmembl(cs+pc); pc++; - if (flags&P_FLAG) { pc+=offset; tubecycles-=9; } - tubecycles-=4; - break; - case 0x7B: /*JNP*/ - offset=(signed char)readmembl(cs+pc); pc++; - if (!(flags&P_FLAG)) { pc+=offset; tubecycles-=9; } - tubecycles-=4; - break; - case 0x7C: /*JL*/ - offset=(signed char)readmembl(cs+pc); pc++; - temp=(flags&N_FLAG)?1:0; - temp2=(flags&V_FLAG)?1:0; - if (temp!=temp2) { pc+=offset; tubecycles-=9; } - tubecycles-=4; - break; - case 0x7D: /*JNL*/ - offset=(signed char)readmembl(cs+pc); pc++; - temp=(flags&N_FLAG)?1:0; - temp2=(flags&V_FLAG)?1:0; - if (temp==temp2) { pc+=offset; tubecycles-=9; } - tubecycles-=4; - break; - case 0x7E: /*JLE*/ - offset=(signed char)readmembl(cs+pc); pc++; - temp=(flags&N_FLAG)?1:0; - temp2=(flags&V_FLAG)?1:0; - if ((flags&Z_FLAG) || (temp!=temp2)) { pc+=offset; tubecycles-=9; } - tubecycles-=4; - break; - case 0x7F: /*JNLE*/ - offset=(signed char)readmembl(cs+pc); pc++; - temp=(flags&N_FLAG)?1:0; - temp2=(flags&V_FLAG)?1:0; - if (!((flags&Z_FLAG) || (temp!=temp2))) { pc+=offset; tubecycles-=9; } - tubecycles-=4; - break; - - case 0x80: case 0x82: - fetchea(); - temp=geteab(); - temp2=readmembl(cs+pc); pc++; - switch (rmdat&0x38) - { - case 0x00: /*ADD b,#8*/ - setadd8(temp,temp2); - seteab(temp+temp2); - tubecycles-=((mod==3)?4:16); - break; - case 0x08: /*OR b,#8*/ - temp|=temp2; - setznp8(temp); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - seteab(temp); - tubecycles-=((mod==3)?4:16); - break; - case 0x10: /*ADC b,#8*/ -// temp2+=(flags&C_FLAG); - setadc8(temp,temp2); - seteab(temp+temp2+tempc); - tubecycles-=((mod==3)?4:16); - break; - case 0x18: /*SBB b,#8*/ -// temp2+=(flags&C_FLAG); - setsbc8(temp,temp2); - seteab(temp-(temp2+tempc)); - tubecycles-=((mod==3)?4:16); - break; - case 0x20: /*AND b,#8*/ - temp&=temp2; - setznp8(temp); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - seteab(temp); - tubecycles-=((mod==3)?4:16); - break; - case 0x28: /*SUB b,#8*/ - setsub8(temp,temp2); - seteab(temp-temp2); - tubecycles-=((mod==3)?4:16); - break; - case 0x30: /*XOR b,#8*/ - temp^=temp2; - setznp8(temp); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - seteab(temp); - tubecycles-=((mod==3)?4:16); - break; - case 0x38: /*CMP b,#8*/ - setsub8(temp,temp2); - tubecycles-=((mod==3)?4:10); - break; - - default: - printf("Bad 80 opcode %02X\n",rmdat&0x38); -// x86dumpregs(); -// exit(-1); - } - break; - - case 0x81: - fetchea(); - tempw=geteaw(); - tempw2=getword(); - switch (rmdat&0x38) - { - case 0x00: /*ADD w,#16*/ - setadd16(tempw,tempw2); - tempw+=tempw2; - seteaw(tempw); - tubecycles-=((mod==3)?4:16); - break; - case 0x08: /*OR w,#16*/ - tempw|=tempw2; - setznp16(tempw); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - seteaw(tempw); - tubecycles-=((mod==3)?4:16); - break; - case 0x10: /*ADC w,#16*/ -// tempw2+=(flags&C_FLAG); - x86setadc16(tempw,tempw2); - tempw+=tempw2+tempc; - seteaw(tempw); - tubecycles-=((mod==3)?4:16); - break; - case 0x20: /*AND w,#16*/ - tempw&=tempw2; - setznp16(tempw); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - seteaw(tempw); - tubecycles-=((mod==3)?4:16); - break; - case 0x18: /*SBB w,#16*/ -// tempw2+=(flags&C_FLAG); - x86setsbc16(tempw,tempw2); - seteaw(tempw-(tempw2+tempc)); - tubecycles-=((mod==3)?4:16); - break; - case 0x28: /*SUB w,#16*/ - setsub16(tempw,tempw2); - tempw-=tempw2; - seteaw(tempw); - tubecycles-=((mod==3)?4:16); - break; - case 0x30: /*XOR w,#16*/ - tempw^=tempw2; - setznp16(tempw); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - seteaw(tempw); - tubecycles-=((mod==3)?4:16); - break; - case 0x38: /*CMP w,#16*/ - setsub16(tempw,tempw2); - tubecycles-=((mod==3)?4:10); - break; - - default: - printf("Bad 81 opcode %02X\n",rmdat&0x38); -// x86dumpregs(); -// exit(-1); - } - break; - - case 0x83: - fetchea(); - tempw=geteaw(); - tempw2=readmembl(cs+pc); pc++; - if (tempw2&0x80) tempw2|=0xFF00; - switch (rmdat&0x38) - { - case 0x00: /*ADD w,#8*/ - setadd16(tempw,tempw2); - tempw+=tempw2; - seteaw(tempw); - tubecycles-=((mod==3)?4:16); - break; - case 0x08: /*OR w,#8*/ - tempw|=tempw2; - setznp16(tempw); - seteaw(tempw); - flags&=~(C_FLAG|A_FLAG|V_FLAG); - tubecycles-=((mod==3)?4:16); - break; - case 0x10: /*ADC w,#8*/ -// tempw2+=(flags&C_FLAG); - x86setadc16(tempw,tempw2); - tempw+=tempw2+tempc; - seteaw(tempw); - tubecycles-=((mod==3)?4:16); - break; - case 0x18: /*SBB w,#8*/ -// tempw2+=(flags&C_FLAG); - x86setsbc16(tempw,tempw2); - tempw-=(tempw2+tempc); - seteaw(tempw); - tubecycles-=((mod==3)?4:16); - break; - case 0x20: /*AND w,#8*/ - tempw&=tempw2; - setznp16(tempw); - seteaw(tempw); - tubecycles-=((mod==3)?4:16); - flags&=~(C_FLAG|A_FLAG|V_FLAG); - break; - case 0x28: /*SUB w,#8*/ - setsub16(tempw,tempw2); - tempw-=tempw2; - seteaw(tempw); - tubecycles-=((mod==3)?4:16); - break; - case 0x30: /*XOR w,#8*/ - tempw^=tempw2; - setznp16(tempw); - seteaw(tempw); - tubecycles-=((mod==3)?4:16); - flags&=~(C_FLAG|A_FLAG|V_FLAG); - break; - case 0x38: /*CMP w,#8*/ - setsub16(tempw,tempw2); - tubecycles-=((mod==3)?4:10); - break; - - default: - printf("Bad 83 opcode %02X\n",rmdat&0x38); -// x86dumpregs(); -// exit(-1); - } - break; - - case 0x84: /*TEST b,reg*/ - fetchea(); - temp=geteab(); - temp2=getr8(reg); - setznp8(temp&temp2); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - tubecycles-=((mod==3)?3:10); - break; - case 0x85: /*TEST w,reg*/ - fetchea(); - tempw=geteaw(); - tempw2=regs[reg].w; - setznp16(tempw&tempw2); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - tubecycles-=((mod==3)?3:10); - break; - case 0x86: /*XCHG b,reg*/ - fetchea(); - temp=geteab(); - seteab(getr8(reg)); - setr8(reg,temp); - tubecycles-=((mod==3)?4:17); - break; - case 0x87: /*XCHG w,reg*/ - fetchea(); - tempw=geteaw(); - seteaw(regs[reg].w); - regs[reg].w=tempw; - tubecycles-=((mod==3)?4:17); - break; - - case 0x88: /*MOV b,reg*/ - fetchea(); - seteab(getr8(reg)); - tubecycles-=((mod==3)?2:9); - break; - case 0x89: /*MOV w,reg*/ - fetchea(); - seteaw(regs[reg].w); - tubecycles-=((mod==3)?2:9); - break; - case 0x8A: /*MOV reg,b*/ - fetchea(); - temp=geteab(); - setr8(reg,temp); - tubecycles-=((mod==3)?2:12); - break; - case 0x8B: /*MOV reg,w*/ - fetchea(); - tempw=geteaw(); - regs[reg].w=tempw; - tubecycles-=((mod==3)?2:12); - break; - - case 0x8C: /*MOV w,sreg*/ - fetchea(); - switch (rmdat&0x38) - { - case 0x00: /*ES*/ - seteaw(ES); - break; - case 0x08: /*CS*/ - seteaw(CS); - break; - case 0x18: /*DS*/ - if (ssegs) ds=oldds; - seteaw(DS); - break; - case 0x10: /*SS*/ - if (ssegs) ss=oldss; - seteaw(SS); - break; - } - tubecycles-=((mod==3)?2:11); - break; - - case 0x8D: /*LEA*/ - fetchea(); - regs[reg].w=eaaddr; - tubecycles-=6; - break; - - case 0x8E: /*MOV sreg,w*/ -// if (x86output) printf("MOV %04X ",pc); - fetchea(); -// if (x86output) printf("%04X %02X\n",pc,rmdat); - switch (rmdat&0x38) - { - case 0x00: /*ES*/ - tempw=geteaw(); - loadseg(tempw,&_es); - break; - case 0x18: /*DS*/ - tempw=geteaw(); - loadseg(tempw,&_ds); - if (ssegs) oldds=ds; - break; - case 0x10: /*SS*/ - tempw=geteaw(); - loadseg(tempw,&_ss); - if (ssegs) oldss=ss; - skipnextprint=1; - noint=1; -// printf("LOAD SS %04X %04X\n",tempw,SS); -// printf("SS loaded with %04X %04X:%04X %04X %04X %04X\n",ss>>4,cs>>4,pc,CX,DX,es>>4); - break; - } - tubecycles-=((mod==3)?2:9); - break; - - case 0x8F: /*POPW*/ - fetchea(); - if (ssegs) ss=oldss; - tempw=readmemwl(ss,SP); - SP+=2; - //if (x86output) printf("POPW - %04X\n",tempw); - seteaw(tempw); - tubecycles-=((mod==3)?10:20); - break; - - case 0x90: /*NOP*/ - tubecycles-=3; - break; - - case 0x91: case 0x92: case 0x93: /*XCHG AX*/ - case 0x94: case 0x95: case 0x96: case 0x97: - tempw=AX; - AX=regs[opcode&7].w; - regs[opcode&7].w=tempw; - tubecycles-=3; - break; - - case 0x98: /*CBW*/ - AH=(AL&0x80)?0xFF:0; - tubecycles-=2; - break; - case 0x99: /*CWD*/ - DX=(AX&0x8000)?0xFFFF:0; - tubecycles-=4; - break; - case 0x9A: /*CALL FAR*/ - tempw=getword(); - tempw2=getword(); - tempw3=CS; - tempw4=pc; - if (ssegs) ss=oldss; - pc=tempw; - loadcs(tempw2); -/* if ((msw&1) && !(_cs.access&4) && ((CS&3)<(tempw3&3))) - { - printf("Call to non-confirming inner segment!\n"); - x86dumpregs(); - exit(-1); - }*/ - writememwl(ss,(SP-2)&0xFFFF,tempw3); - writememwl(ss,(SP-4)&0xFFFF,tempw4); - SP-=4; - tubecycles-=23; - break; - case 0x9B: /*WAIT*/ - tubecycles-=4; - break; - case 0x9C: /*PUSHF*/ -// printf("PUSHF %04X:%04X\n",CS,pc); - if (ssegs) ss=oldss; - writememwl(ss,((SP-2)&0xFFFF),flags|0xF000); - SP-=2; - tubecycles-=9; - break; - case 0x9D: /*POPF*/ -// printf("POPF %04X:%04X\n",CS,pc); -/* if (CS==0xFFFF) - { - x86dumpregs(); - exit(-1); - }*/ - if (ssegs) ss=oldss; - flags=readmemwl(ss,SP)&0xFFF; - SP+=2; - tubecycles-=8; - break; - case 0x9E: /*SAHF*/ - flags=(flags&0xFF00)|AH; - tubecycles-=3; - break; - case 0x9F: /*LAHF*/ - AH=flags&0xFF; - tubecycles-=2; - break; - - case 0xA0: /*MOV AL,(w)*/ - addr=getword(); - AL=readmembl(ds+addr); - tubecycles-=8; - break; - case 0xA1: /*MOV AX,(w)*/ - addr=getword(); -// printf("Reading AX from %05X %04X:%04X\n",ds+addr,ds>>4,addr); - AX=readmemwl(ds,addr); - tubecycles-=8; - break; - case 0xA2: /*MOV (w),AL*/ - addr=getword(); - writemembl(ds+addr,AL); - tubecycles-=9; - break; - case 0xA3: /*MOV (w),AX*/ - addr=getword(); -// if (!addr) printf("Write !addr %04X:%04X\n",cs>>4,pc); - writememwl(ds,addr,AX); - tubecycles-=9; - break; - - case 0xA4: /*MOVSB*/ - temp=readmembl(ds+SI); - writemembl(es+DI,temp); - if (flags&D_FLAG) { DI--; SI--; } - else { DI++; SI++; } - tubecycles-=9; - break; - case 0xA5: /*MOVSW*/ - tempw=readmemwl(ds,SI); - writememwl(es,DI,tempw); - if (flags&D_FLAG) { DI-=2; SI-=2; } - else { DI+=2; SI+=2; } - tubecycles-=9; - break; - case 0xA6: /*CMPSB*/ - temp =readmembl(ds+SI); - temp2=readmembl(es+DI); - setsub8(temp,temp2); - if (flags&D_FLAG) { DI--; SI--; } - else { DI++; SI++; } - tubecycles-=22; - break; - case 0xA7: /*CMPSW*/ - tempw =readmemwl(ds,SI); - tempw2=readmemwl(es,DI); - setsub16(tempw,tempw2); - if (flags&D_FLAG) { DI-=2; SI-=2; } - else { DI+=2; SI+=2; } - tubecycles-=22; - break; - case 0xA8: /*TEST AL,#8*/ - temp=readmembl(cs+pc); pc++; - setznp8(AL&temp); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - tubecycles-=4; - break; - case 0xA9: /*TEST AX,#16*/ - tempw=getword(); - setznp16(AX&tempw); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - tubecycles-=4; - break; - case 0xAA: /*STOSB*/ - writemembl(es+DI,AL); - if (flags&D_FLAG) DI--; - else DI++; - tubecycles-=10; - break; - case 0xAB: /*STOSW*/ - writememwl(es,DI,AX); - if (flags&D_FLAG) DI-=2; - else DI+=2; - tubecycles-=10; - break; - case 0xAC: /*LODSB*/ - AL=readmembl(ds+SI); -// printf("LODSB %04X:%04X %02X %04X:%04X\n",cs>>4,pc,AL,ds>>4,SI); - if (flags&D_FLAG) SI--; - else SI++; - tubecycles-=10; - break; - case 0xAD: /*LODSW*/ -// if (times) printf("LODSW %04X:%04X\n",cs>>4,pc); - AX=readmemwl(ds,SI); - if (flags&D_FLAG) SI-=2; - else SI+=2; - tubecycles-=10; - break; - case 0xAE: /*SCASB*/ - temp=readmembl(es+DI); - setsub8(AL,temp); - if (flags&D_FLAG) DI--; - else DI++; - tubecycles-=15; - break; - case 0xAF: /*SCASW*/ - tempw=readmemwl(es,DI); - setsub16(AX,tempw); - if (flags&D_FLAG) DI-=2; - else DI+=2; - tubecycles-=15; - break; - - case 0xB0: /*MOV AL,#8*/ - AL=readmembl(cs+pc),pc++; - tubecycles-=4; - break; - case 0xB1: /*MOV CL,#8*/ - CL=readmembl(cs+pc),pc++; - tubecycles-=4; - break; - case 0xB2: /*MOV DL,#8*/ - DL=readmembl(cs+pc),pc++; - tubecycles-=4; - break; - case 0xB3: /*MOV BL,#8*/ - BL=readmembl(cs+pc),pc++; - tubecycles-=4; - break; - case 0xB4: /*MOV AH,#8*/ - AH=readmembl(cs+pc),pc++; - tubecycles-=4; - break; - case 0xB5: /*MOV CH,#8*/ - CH=readmembl(cs+pc),pc++; - tubecycles-=4; - break; - case 0xB6: /*MOV DH,#8*/ - DH=readmembl(cs+pc),pc++; - tubecycles-=4; - break; - case 0xB7: /*MOV BH,#8*/ - BH=readmembl(cs+pc),pc++; - tubecycles-=4; - break; - case 0xB8: case 0xB9: case 0xBA: case 0xBB: /*MOV reg,#16*/ - case 0xBC: case 0xBD: case 0xBE: case 0xBF: - regs[opcode&7].w=getword(); - tubecycles-=4; - break; - - case 0xC0: - fetchea(); - c=readmembl(cs+pc); pc++; - temp=geteab(); - c&=31; - if (!c) break; - switch (rmdat&0x38) - { - case 0x00: /*ROL b,CL*/ - while (c>0) - { - temp2=(temp&0x80)?1:0; - temp=(temp<<1)|temp2; - c--; - tubecycles--; - } - if (temp2) flags|=C_FLAG; - else flags&=~C_FLAG; - seteab(temp); - if ((flags&C_FLAG)^(temp>>7)) flags|=V_FLAG; - else flags&=~V_FLAG; -// setznp8(temp); - tubecycles-=((mod==3)?5:17); - break; - case 0x08: /*ROR b,CL*/ - while (c>0) - { - temp2=temp&1; - temp>>=1; - if (temp2) temp|=0x80; - c--; - tubecycles--; - } - if (temp2) flags|=C_FLAG; - else flags&=~C_FLAG; - seteab(temp); - if ((temp^(temp>>1))&0x40) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?5:17); - break; - case 0x10: /*RCL b,CL*/ - while (c>0) - { - tempc=(flags&C_FLAG)?1:0; - if (temp&0x80) flags|=C_FLAG; - else flags&=~C_FLAG; - temp=(temp<<1)|tempc; - c--; - tubecycles--; - } - seteab(temp); - if ((flags&C_FLAG)^(temp>>7)) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?5:17); - break; - case 0x18: /*RCR b,CL*/ - while (c>0) - { - tempc=(flags&C_FLAG)?0x80:0; - if (temp&1) flags|=C_FLAG; - else flags&=~C_FLAG; - temp=(temp>>1)|tempc; - c--; - tubecycles--; - } - seteab(temp); - if ((temp^(temp>>1))&0x40) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?5:17); - break; - case 0x20: case 0x30: /*SHL b,CL*/ - if ((temp<<(c-1))&0x80) flags|=C_FLAG; - else flags&=~C_FLAG; - temp<<=c; - seteab(temp); - setznp8(temp); - tubecycles-=c; - tubecycles-=((mod==3)?5:17); - flags|=A_FLAG; - break; - case 0x28: /*SHR b,CL*/ - if ((temp>>(c-1))&1) flags|=C_FLAG; - else flags&=~C_FLAG; - temp>>=c; - seteab(temp); - setznp8(temp); - tubecycles-=c; - tubecycles-=((mod==3)?5:17); - flags|=A_FLAG; - break; - case 0x38: /*SAR b,CL*/ - if ((temp>>(c-1))&1) flags|=C_FLAG; - else flags&=~C_FLAG; - while (c>0) - { - temp>>=1; - if (temp&0x40) temp|=0x80; - c--; - tubecycles--; - } - seteab(temp); - setznp8(temp); - tubecycles-=((mod==3)?5:17); - flags|=A_FLAG; - break; - - default: - printf("Bad C0 opcode %02X\n",rmdat&0x38); -// x86dumpregs(); -// exit(-1); - } - break; - - case 0xC1: - fetchea(); - c=readmembl(cs+pc); pc++; - c&=31; - tempw=geteaw(); - if (!c) break; - switch (rmdat&0x38) - { - case 0x00: /*ROL w,CL*/ - while (c>0) - { - temp=(tempw&0x8000)?1:0; - tempw=(tempw<<1)|temp; - c--; - tubecycles--; - } - if (temp) flags|=C_FLAG; - else flags&=~C_FLAG; - seteaw(tempw); - if ((flags&C_FLAG)^(tempw>>15)) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?5:17); - break; - case 0x08: /*ROR w,CL*/ - while (c>0) - { - tempw2=(tempw&1)?0x8000:0; - tempw=(tempw>>1)|tempw2; - c--; - tubecycles--; - } - if (tempw2) flags|=C_FLAG; - else flags&=~C_FLAG; - seteaw(tempw); - if ((tempw^(tempw>>1))&0x4000) flags|=V_FLAG; - else flags&=~V_FLAG; -// setznp16(tempw); - tubecycles-=((mod==3)?5:17); - break; - case 0x10: /*RCL w,CL*/ - while (c>0) - { - tempc=(flags&C_FLAG)?1:0; - if (tempw&0x8000) flags|=C_FLAG; - else flags&=~C_FLAG; - tempw=(tempw<<1)|tempc; - c--; - tubecycles--; - } - seteaw(tempw); - if ((flags&C_FLAG)^(tempw>>15)) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?5:17); - break; - case 0x18: /*RCR w,CL*/ - while (c>0) - { - tempc=(flags&C_FLAG)?0x8000:0; - if (tempw&1) flags|=C_FLAG; - else flags&=~C_FLAG; - tempw=(tempw>>1)|tempc; - c--; - tubecycles--; - } - seteaw(tempw); - if ((tempw^(tempw>>1))&0x4000) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?5:17); - break; - - case 0x20: case 0x30: /*SHL w,CL*/ - if ((tempw<<(c-1))&0x8000) flags|=C_FLAG; - else flags&=~C_FLAG; - tempw<<=c; - seteaw(tempw); - setznp16(tempw); - tubecycles-=c; - tubecycles-=((mod==3)?5:17); - flags|=A_FLAG; - break; - - case 0x28: /*SHR w,CL*/ - if ((tempw>>(c-1))&1) flags|=C_FLAG; - else flags&=~C_FLAG; - tempw>>=c; - seteaw(tempw); - setznp16(tempw); - tubecycles-=c; - tubecycles-=((mod==3)?5:17); - flags|=A_FLAG; - break; - - case 0x38: /*SAR w,CL*/ - tempw2=tempw&0x8000; - if ((tempw>>(c-1))&1) flags|=C_FLAG; - else flags&=~C_FLAG; - while (c>0) - { - tempw=(tempw>>1)|tempw2; - c--; - tubecycles--; - } - seteaw(tempw); - setznp16(tempw); - tubecycles-=((mod==3)?5:17); - flags|=A_FLAG; - break; - - default: - printf("Bad C1 opcode %02X\n",rmdat&0x38); -// x86dumpregs(); -// exit(-1); - } - break; - - case 0xC2: /*RET*/ - tempw=getword(); - if (ssegs) ss=oldss; - pc=readmemwl(ss,SP); -// printf("RET to %04X\n",pc); - SP+=2+tempw; - tubecycles-=18; - break; - case 0xC3: /*RET*/ - if (ssegs) ss=oldss; - pc=readmemwl(ss,SP); -// if (x86output) printf("RET to %04X %05X\n",pc,ss+SP); - SP+=2; - tubecycles-=16; - break; - case 0xC4: /*LES*/ - fetchea(); - regs[reg].w=readmemwl(easeg,eaaddr); //geteaw(); - tempw=readmemwl(easeg,(eaaddr+2)&0xFFFF); //geteaw2(); - loadseg(tempw,&_es); - tubecycles-=18; - break; - case 0xC5: /*LDS*/ - fetchea(); - regs[reg].w=readmemwl(easeg,eaaddr); - tempw=readmemwl(easeg,(eaaddr+2)&0xFFFF); - loadseg(tempw,&_ds); - if (ssegs) oldds=ds; - tubecycles-=18; - break; - case 0xC6: /*MOV b,#8*/ - fetchea(); - temp=readmembl(cs+pc); pc++; - seteab(temp); - tubecycles-=((mod==3)?4:13); - break; - case 0xC7: /*MOV w,#16*/ - fetchea(); - tempw=getword(); - seteaw(tempw); - tubecycles-=((mod==3)?4:13); - break; - case 0xC8: /*ENTER*/ - tempw3=getword(); - tempi=readmembl(cs+pc); pc++; - writememwl(ss,((SP-2)&0xFFFF),BP); SP-=2; - tempw2=SP; - if (tempi>0) - { - while (--tempi) - { - BP-=2; - tempw=readmemwl(ss,BP); - writememwl(ss,((SP-2)&0xFFFF),tempw); SP-=2; - tubecycles-=16; - } - writememwl(ss,((SP-2)&0xFFFF),tempw2); SP-=2; - } - BP=tempw2; SP-=tempw3; - tubecycles-=15; - break; - case 0xC9: /*LEAVE*/ - SP=BP; - BP=readmemwl(ss,SP); - SP+=2; - tubecycles-=8; - break; - case 0xCA: /*RETF*/ - tempw=getword(); - if (ssegs) ss=oldss; - pc=readmemwl(ss,SP); - loadcs(readmemwl(ss,SP+2)); - SP+=4; - SP+=tempw; -// cs=CS<<4; - tubecycles-=25; - break; - case 0xCB: /*RETF*/ - if (ssegs) ss=oldss; - pc=readmemwl(ss,SP); - loadcs(readmemwl(ss,SP+2)); - SP+=4; -// cs=CS<<4; - tubecycles-=22; - break; - case 0xCC: /*INT 3*/ - if (ssegs) ss=oldss; - writememwl(ss,((SP-2)&0xFFFF),flags|0xF000); - writememwl(ss,((SP-4)&0xFFFF),CS); - writememwl(ss,((SP-6)&0xFFFF),pc); - SP-=6; - addr=3<<2; - flags&=~I_FLAG; - pc=readmemwl(0,addr); - loadcs(readmemwl(0,addr+2)); - tubecycles-=45; - break; - case 0xCD: /*INT*/ - lastpc=pc; - lastcs=CS; - temp=readmembl(cs+pc); pc++; - if (temp==0xE0 && CL==0x32) rpclog("XIOS call %02X %04X:%04X\n",readmembl(ds+DX),CS,pc); -/* if (temp==0x45) - { - printf("OSFILE %02X\n",AL); - } - if ((temp&~0xF)==0x40) - { - printf("BBC INT! %02X %02X\n",temp,AL); - }*/ -// if (temp==0x10 && !AH) printf("Entering mode %02X\n",AL); -// if (temp==0x18 || temp==0x19) { printf("INT %02X\n",temp); x86output=1; } -// printf("INT %02X %04X %04X %04X %04X\n",temp,AX,BX,CX,DX); -/* if (temp==0x21) printf("INT 21 %04X %04X %04X %04X %04X:%04X %06X %06X\n",AX,BX,CX,DX,cs>>4,pc,ds,ds+DX); - if (temp==0x21 && AH==9) - { - addr=0; - while (ram[ds+DX+addr]!='$') - { - printf("%c",ram[ds+DX+addr]); - addr++; - } - printf("\n"); - printf("Called from %04X\n",readmemwl(ss,SP)); - }*/ -// x86output=0; -// if (temp==0x13 && AH==3) printf("Write sector %04X:%04X %05X\n",es>>4,BX,es+BX); -/* if (temp==0x13 && (DL==0x80 || DL==0x81) && AH>0) - { - int13hdc(); - } - else if (temp==0x13 && AH==2 && DL<2 && FASTDISC) - { - int13read(); - } - else if (temp==0x13 && AH==3 && DL<2 && FASTDISC) - { - int13write(); - } - else if (temp==0x13 && AH==4 && DL<2 && FASTDISC) - { - AH=0; - flags&=~C_FLAG; - } - else - {*/ - if (ssegs) ss=oldss; - writememwl(ss,((SP-2)&0xFFFF),flags|0xF000); - writememwl(ss,((SP-4)&0xFFFF),CS); - writememwl(ss,((SP-6)&0xFFFF),pc); - SP-=6; - addr=temp<<2; -// flags&=~I_FLAG; - pc=readmemwl(0,addr); - loadcs(readmemwl(0,addr+2)); -/* if (!pc && !cs) - { - printf("Bad int %02X %04X:%04X\n",temp,oldcs,oldpc); - x86dumpregs(); - exit(-1); - }*/ -// } - tubecycles-=47; - break; - case 0xCF: /*IRET*/ -// if (inint) printf("IRET %04X %04X:%04X\n",flags,cs>>4,pc,SP); -/* if (x86output) - { - x86dumpregs(); - exit(-1); - }*/ -// if (!inint) x86output=0; - if (ssegs) ss=oldss; - tempw=CS; - tempw2=pc; -// inint=0; - pc=readmemwl(ss,SP); - loadcs(readmemwl(ss,((SP+2)&0xFFFF))); - flags=readmemwl(ss,((SP+4)&0xFFFF))&0xFFF; - SP+=6; - tubecycles-=28; -// printf("%04X %04X\n",flags,SP); - break; - case 0xD0: - fetchea(); - temp=geteab(); - switch (rmdat&0x38) - { - case 0x00: /*ROL b,1*/ - if (temp&0x80) flags|=C_FLAG; - else flags&=~C_FLAG; - temp<<=1; - if (flags&C_FLAG) temp|=1; - seteab(temp); - if ((flags&C_FLAG)^(temp>>7)) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?2:15); - break; - case 0x08: /*ROR b,1*/ - if (temp&1) flags|=C_FLAG; - else flags&=~C_FLAG; - temp>>=1; - if (flags&C_FLAG) temp|=0x80; - seteab(temp); -// setznp8(temp); - if ((temp^(temp>>1))&0x40) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?2:15); - break; - case 0x10: /*RCL b,1*/ - temp2=flags&C_FLAG; - if (temp&0x80) flags|=C_FLAG; - else flags&=~C_FLAG; - temp<<=1; - if (temp2) temp|=1; - seteab(temp); -// setznp8(temp); - if ((flags&C_FLAG)^(temp>>7)) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?2:15); - break; - case 0x18: /*RCR b,1*/ - temp2=flags&C_FLAG; - if (temp&1) flags|=C_FLAG; - else flags&=~C_FLAG; - temp>>=1; - if (temp2) temp|=0x80; - seteab(temp); -// setznp8(temp); - if ((temp^(temp>>1))&0x40) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?2:15); - break; - case 0x20: /*SHL b,1*/ - if (temp&0x80) flags|=C_FLAG; - else flags&=~C_FLAG; - if ((temp^(temp<<1))&0x80) flags|=V_FLAG; - else flags&=~V_FLAG; - temp<<=1; - seteab(temp); - setznp8(temp); - tubecycles-=((mod==3)?2:15); - flags|=A_FLAG; - break; - case 0x28: /*SHR b,1*/ - if (temp&1) flags|=C_FLAG; - else flags&=~C_FLAG; - if (temp&0x80) flags|=V_FLAG; - else flags&=~V_FLAG; - temp>>=1; - seteab(temp); - setznp8(temp); - tubecycles-=((mod==3)?2:15); - flags|=A_FLAG; - break; - case 0x38: /*SAR b,1*/ - if (temp&1) flags|=C_FLAG; - else flags&=~C_FLAG; - temp>>=1; - if (temp&0x40) temp|=0x80; - seteab(temp); - setznp8(temp); - tubecycles-=((mod==3)?2:15); - flags|=A_FLAG; - flags&=~V_FLAG; - break; - - default: - printf("Bad D0 opcode %02X\n",rmdat&0x38); -// x86dumpregs(); -// exit(-1); - } - break; - - case 0xD1: - fetchea(); - tempw=geteaw(); - switch (rmdat&0x38) - { - case 0x00: /*ROL w,1*/ - if (tempw&0x8000) flags|=C_FLAG; - else flags&=~C_FLAG; - tempw<<=1; - if (flags&C_FLAG) tempw|=1; - seteaw(tempw); -// setznp16(tempw); - if ((flags&C_FLAG)^(tempw>>15)) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?2:15); - break; - case 0x08: /*ROR w,1*/ - if (tempw&1) flags|=C_FLAG; - else flags&=~C_FLAG; - tempw>>=1; - if (flags&C_FLAG) tempw|=0x8000; - seteaw(tempw); -// setznp16(tempw); - if ((tempw^(tempw>>1))&0x4000) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?2:15); - break; - case 0x10: /*RCL w,1*/ - temp2=flags&C_FLAG; - if (tempw&0x8000) flags|=C_FLAG; - else flags&=~C_FLAG; - tempw<<=1; - if (temp2) tempw|=1; - seteaw(tempw); - if ((flags&C_FLAG)^(tempw>>15)) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?2:15); - break; - case 0x18: /*RCR w,1*/ - temp2=flags&C_FLAG; - if (tempw&1) flags|=C_FLAG; - else flags&=~C_FLAG; - tempw>>=1; - if (temp2) tempw|=0x8000; - seteaw(tempw); -// setznp16(tempw); - if ((tempw^(tempw>>1))&0x4000) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?2:15); - break; - case 0x20: /*SHL w,1*/ - if (tempw&0x8000) flags|=C_FLAG; - else flags&=~C_FLAG; - if ((tempw^(tempw<<1))&0x8000) flags|=V_FLAG; - else flags&=~V_FLAG; - tempw<<=1; - seteaw(tempw); - setznp16(tempw); - tubecycles-=((mod==3)?2:15); - flags|=A_FLAG; - break; - case 0x28: /*SHR w,1*/ - if (tempw&1) flags|=C_FLAG; - else flags&=~C_FLAG; - if (tempw&0x8000) flags|=V_FLAG; - else flags&=~V_FLAG; - tempw>>=1; - seteaw(tempw); - setznp16(tempw); - tubecycles-=((mod==3)?2:15); - flags|=A_FLAG; - break; - - case 0x38: /*SAR w,1*/ - if (tempw&1) flags|=C_FLAG; - else flags&=~C_FLAG; - tempw>>=1; - if (tempw&0x4000) tempw|=0x8000; - seteaw(tempw); - setznp16(tempw); - tubecycles-=((mod==3)?2:15); - flags|=A_FLAG; - flags&=~V_FLAG; - break; - - default: - printf("Bad D1 opcode %02X\n",rmdat&0x38); -// x86dumpregs(); -// exit(-1); - } - break; - - case 0xD2: - fetchea(); - temp=geteab(); - c=CL&31; -// tubecycles-=c; - if (!c) break; -// if (c>7) printf("Shiftb %i %02X\n",rmdat&0x38,c); - switch (rmdat&0x38) - { - case 0x00: /*ROL b,CL*/ - while (c>0) - { - temp2=(temp&0x80)?1:0; - temp=(temp<<1)|temp2; - c--; - tubecycles--; - } - if (temp2) flags|=C_FLAG; - else flags&=~C_FLAG; - seteab(temp); -// setznp8(temp); - if ((flags&C_FLAG)^(temp>>7)) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?5:17); - break; - case 0x08: /*ROR b,CL*/ - while (c>0) - { - temp2=temp&1; - temp>>=1; - if (temp2) temp|=0x80; - c--; - tubecycles--; - } - if (temp2) flags|=C_FLAG; - else flags&=~C_FLAG; - seteab(temp); - if ((temp^(temp>>1))&0x40) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?5:17); - break; - case 0x10: /*RCL b,CL*/ -// printf("RCL %i %02X %02X\n",c,CL,temp); - while (c>0) - { - templ=flags&C_FLAG; - temp2=temp&0x80; - temp<<=1; - if (temp2) flags|=C_FLAG; - else flags&=~C_FLAG; - if (templ) temp|=1; - c--; - tubecycles--; - } -// printf("Now %02X\n",temp); - seteab(temp); - if ((flags&C_FLAG)^(temp>>7)) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?5:17); - break; - case 0x18: /*RCR b,CL*/ - while (c>0) - { - templ=flags&C_FLAG; - temp2=temp&1; - temp>>=1; - if (temp2) flags|=C_FLAG; - else flags&=~C_FLAG; - if (templ) temp|=0x80; - c--; - tubecycles--; - } -// if (temp2) flags|=C_FLAG; -// else flags&=~C_FLAG; - seteab(temp); - if ((temp^(temp>>1))&0x40) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?5:17); - break; - case 0x20: case 0x30: /*SHL b,CL*/ - if ((temp<<(c-1))&0x80) flags|=C_FLAG; - else flags&=~C_FLAG; - temp<<=c; - seteab(temp); - setznp8(temp); - tubecycles-=c; - tubecycles-=((mod==3)?5:17); - flags|=A_FLAG; - break; - case 0x28: /*SHR b,CL*/ - if ((temp>>(c-1))&1) flags|=C_FLAG; - else flags&=~C_FLAG; - temp>>=c; - seteab(temp); - setznp8(temp); - tubecycles-=c; - tubecycles-=((mod==3)?5:17); - flags|=A_FLAG; - break; - case 0x38: /*SAR b,CL*/ - if ((temp>>(c-1))&1) flags|=C_FLAG; - else flags&=~C_FLAG; - while (c>0) - { - temp>>=1; - if (temp&0x40) temp|=0x80; - c--; - tubecycles--; - } - seteab(temp); - setznp8(temp); - tubecycles-=((mod==3)?5:17); - flags|=A_FLAG; - break; - - default: - printf("Bad D2 opcode %02X\n",rmdat&0x38); -// x86dumpregs(); -// exit(-1); - } - break; - - case 0xD3: - fetchea(); - tempw=geteaw(); - c=CL&31; -// tubecycles-=c; - if (!c) break; -// if (c>15) printf("Shiftw %i %02X\n",rmdat&0x38,c); - switch (rmdat&0x38) - { - case 0x00: /*ROL w,CL*/ - while (c>0) - { - temp=(tempw&0x8000)?1:0; - tempw=(tempw<<1)|temp; - c--; - tubecycles--; - } - if (temp) flags|=C_FLAG; - else flags&=~C_FLAG; - seteaw(tempw); - if ((flags&C_FLAG)^(tempw>>15)) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?5:17); - break; - case 0x08: /*ROR w,CL*/ - while (c>0) - { - tempw2=(tempw&1)?0x8000:0; - tempw=(tempw>>1)|tempw2; - c--; - tubecycles--; - } - if (tempw2) flags|=C_FLAG; - else flags&=~C_FLAG; - seteaw(tempw); - if ((tempw^(tempw>>1))&0x4000) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?5:17); - break; - case 0x10: /*RCL w,CL*/ - while (c>0) - { - templ=flags&C_FLAG; - if (tempw&0x8000) flags|=C_FLAG; - else flags&=~C_FLAG; - tempw=(tempw<<1)|templ; - c--; - tubecycles--; - } - if (temp) flags|=C_FLAG; - else flags&=~C_FLAG; - seteaw(tempw); - if ((flags&C_FLAG)^(tempw>>15)) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?5:17); - break; - case 0x18: /*RCR w,CL*/ - while (c>0) - { - templ=flags&C_FLAG; - tempw2=(templ&1)?0x8000:0; - if (tempw&1) flags|=C_FLAG; - else flags&=~C_FLAG; - tempw=(tempw>>1)|tempw2; - c--; - tubecycles--; - } - if (tempw2) flags|=C_FLAG; - else flags&=~C_FLAG; - seteaw(tempw); - if ((tempw^(tempw>>1))&0x4000) flags|=V_FLAG; - else flags&=~V_FLAG; - tubecycles-=((mod==3)?5:17); - break; - - case 0x20: case 0x30: /*SHL w,CL*/ - if (c>16) - { - tempw=0; - flags&=~C_FLAG; - } - else - { - if ((tempw<<(c-1))&0x8000) flags|=C_FLAG; - else flags&=~C_FLAG; - tempw<<=c; - } - seteaw(tempw); - setznp16(tempw); - tubecycles-=c; - tubecycles-=((mod==3)?5:17); - flags|=A_FLAG; - break; - - case 0x28: /*SHR w,CL*/ - if ((tempw>>(c-1))&1) flags|=C_FLAG; - else flags&=~C_FLAG; - tempw>>=c; - seteaw(tempw); - setznp16(tempw); - tubecycles-=c; - tubecycles-=((mod==3)?5:17); - flags|=A_FLAG; - break; - - case 0x38: /*SAR w,CL*/ - tempw2=tempw&0x8000; - if ((tempw>>(c-1))&1) flags|=C_FLAG; - else flags&=~C_FLAG; - while (c>0) - { - tempw=(tempw>>1)|tempw2; - c--; - tubecycles--; - } - seteaw(tempw); - setznp16(tempw); - tubecycles-=((mod==3)?5:17); - flags|=A_FLAG; - break; - - default: - printf("Bad D3 opcode %02X\n",rmdat&0x38); -// x86dumpregs(); -// exit(-1); - } - break; - - case 0xD4: /*AAM*/ - tempws=readmembl(cs+pc); pc++; - AH=AL/tempws; - AL%=tempws; - setznp168(AX); - tubecycles-=19; - break; - case 0xD5: /*AAD*/ - tempws=readmembl(cs+pc); pc++; - AL=(AH*tempws)+AL; - AH=0; - setznp168(AX); - tubecycles-=15; - break; - case 0xD7: /*XLAT*/ - addr=BX+AL; - AL=readmembl(ds+addr); - tubecycles-=11; - break; - case 0xD9: case 0xDA: case 0xDB: case 0xDD: /*ESCAPE*/ - case 0xDC: case 0xDE: case 0xDF: case 0xD8: - fetchea(); - geteab(); - tubecycles-=6; - break; - - case 0xE0: /*LOOPNE*/ - offset=(signed char)readmembl(cs+pc); pc++; - CX--; - if (CX && !(flags&Z_FLAG)) { pc+=offset; tubecycles-=11; } - tubecycles-=5; - break; - case 0xE1: /*LOOPE*/ - offset=(signed char)readmembl(cs+pc); pc++; - CX--; - if (CX && (flags&Z_FLAG)) { pc+=offset; tubecycles-=11; } - tubecycles-=5; - break; - case 0xE2: /*LOOP*/ - offset=(signed char)readmembl(cs+pc); pc++; - CX--; - if (CX) { pc+=offset; tubecycles-=10; } - tubecycles-=5; - break; - case 0xE3: /*JCXZ*/ - offset=(signed char)readmembl(cs+pc); pc++; - if (!CX) { pc+=offset; tubecycles-=11; } - tubecycles-=5; - break; - - case 0xE4: /*IN AL*/ - temp=readmembl(cs+pc); pc++; - AL=inb(temp); - tubecycles-=10; - break; - case 0xE5: /*IN AX*/ - temp=readmembl(cs+pc); pc++; - AL=inb(temp); - AH=inb(temp+1); - tubecycles-=10; - break; - case 0xE6: /*OUT AL*/ - temp=readmembl(cs+pc); pc++; - outb(temp,AL); - tubecycles-=9; - break; - case 0xE7: /*OUT AX*/ - temp=readmembl(cs+pc); pc++; - outb(temp,AL); - outb(temp+1,AH); - tubecycles-=9; - break; - - case 0xE8: /*CALL rel 16*/ - tempw=getword(); - if (ssegs) ss=oldss; - writememwl(ss,((SP-2)&0xFFFF),pc); - SP-=2; - pc+=tempw; - tubecycles-=14; - break; - case 0xE9: /*JMP rel 16*/ -// printf("PC was %04X\n",pc); - pc+=getword(); -// printf("PC now %04X\n",pc); - tubecycles-=13; - break; - case 0xEA: /*JMP far*/ - addr=getword(); - tempw=getword(); - pc=addr; - loadcs(tempw); -// cs=loadcs(CS); -// cs=CS<<4; - tubecycles-=13; - break; - case 0xEB: /*JMP rel*/ - offset=(signed char)readmembl(cs+pc); pc++; - pc+=offset; - tubecycles-=13; - break; - case 0xEC: /*IN AL,DX*/ - AL=inb(DX); - tubecycles-=8; - break; - case 0xED: /*IN AX,DX*/ - AL=inb(DX); - AH=inb(DX+1); - tubecycles-=8; - break; - case 0xEE: /*OUT DX,AL*/ - outb(DX,AL); - tubecycles-=7; - break; - case 0xEF: /*OUT DX,AX*/ - outb(DX,AL); - outb(DX+1,AH); - tubecycles-=7; - break; - - case 0xF0: /*LOCK*/ - tubecycles-=4; - break; - - case 0xF2: /*REPNE*/ - rep(0); - break; - case 0xF3: /*REPE*/ - rep(1); - break; - - case 0xF4: /*HLT*/ -// printf("IN HLT!!!! %04X:%04X %08X %08X %08X\n",oldcs,oldpc,old8,old82,old83); -// x86dumpregs(); -// exit(-1); - inhlt=1; - pc--; - tubecycles-=2; - break; - case 0xF5: /*CMC*/ - flags^=C_FLAG; - tubecycles-=2; - break; - - case 0xF6: - fetchea(); - temp=geteab(); - switch (rmdat&0x38) - { - case 0x00: /*TEST b,#8*/ - temp2=readmembl(cs+pc); pc++; - temp&=temp2; - setznp8(temp); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - tubecycles-=((mod==3)?4:10); - break; - case 0x10: /*NOT b*/ - temp=~temp; - seteab(temp); - tubecycles-=((mod==3)?3:13); - break; - case 0x18: /*NEG b*/ - setsub8(0,temp); - temp=0-temp; - seteab(temp); - tubecycles-=((mod==3)?3:13); - break; - case 0x20: /*MUL AL,b*/ - setznp8(AL); - AX=AL*temp; - if (AX) flags&=~Z_FLAG; - else flags|=Z_FLAG; - if (AH) flags|=(C_FLAG|V_FLAG); - else flags&=~(C_FLAG|V_FLAG); - tubecycles-=26; - break; - case 0x28: /*IMUL AL,b*/ - setznp8(AL); - tempws=(int)((signed char)AL)*(int)((signed char)temp); - AX=tempws&0xFFFF; - if (AX) flags&=~Z_FLAG; - else flags|=Z_FLAG; - if (AH) flags|=(C_FLAG|V_FLAG); - else flags&=~(C_FLAG|V_FLAG); - tubecycles-=25; - break; - case 0x30: /*DIV AL,b*/ - tempw=AX; - if (temp) - { - tempw2=tempw%temp; -/* if (!tempw) - { - writememwl((ss+SP)-2,flags|0xF000); - writememwl((ss+SP)-4,cs>>4); - writememwl((ss+SP)-6,pc); - SP-=6; - flags&=~I_FLAG; - pc=readmemwl(0); - cs=readmemwl(2)<<4; - printf("Div by zero %04X:%04X\n",cs>>4,pc); -// x86dumpregs(); -// exit(-1); - } - else - {*/ - AH=tempw2; - tempw/=temp; - AL=tempw&0xFF; -// } - } - else - { - printf("DIVb BY 0 %04X:%04X\n",cs>>4,pc); - writememwl(ss,(SP-2)&0xFFFF,flags|0xF000); - writememwl(ss,(SP-4)&0xFFFF,CS); - writememwl(ss,(SP-6)&0xFFFF,pc); - SP-=6; - flags&=~I_FLAG; - pc=readmemwl(0,0); - loadcs(readmemwl(0,2)); -// cs=loadcs(CS); -// cs=CS<<4; -// printf("Div by zero %04X:%04X %02X %02X\n",cs>>4,pc,0xf6,0x30); -// x86dumpregs(); -// exit(-1); - } - tubecycles-=29; - break; - case 0x38: /*IDIV AL,b*/ - tempws=(int)AX; - if (temp) - { - tempw2=tempws%(int)((signed char)temp); -/* if (!tempw) - { - writememwl((ss+SP)-2,flags|0xF000); - writememwl((ss+SP)-4,cs>>4); - writememwl((ss+SP)-6,pc); - SP-=6; - flags&=~I_FLAG; - pc=readmemwl(0); - cs=readmemwl(2)<<4; - printf("Div by zero %04X:%04X\n",cs>>4,pc); - } - else - {*/ - AH=tempw2&0xFF; - tempws/=(int)((signed char)temp); - AL=tempws&0xFF; -// } - } - else - { - printf("IDIVb BY 0 %04X:%04X\n",cs>>4,pc); - writememwl(ss,(SP-2)&0xFFFF,flags|0xF000); - writememwl(ss,(SP-4)&0xFFFF,CS); - writememwl(ss,(SP-6)&0xFFFF,pc); - SP-=6; - flags&=~I_FLAG; - pc=readmemwl(0,0); - loadcs(readmemwl(0,2)); -// cs=loadcs(CS); -// cs=CS<<4; -// printf("Div by zero %04X:%04X %02X %02X\n",cs>>4,pc,0xf6,0x38); - } - tubecycles-=44; - break; - - default: - printf("Bad F6 opcode %02X\n",rmdat&0x38); -// x86dumpregs(); -// exit(-1); - } - break; - - case 0xF7: - fetchea(); - tempw=geteaw(); - switch (rmdat&0x38) - { - case 0x00: /*TEST w*/ - tempw2=getword(); - setznp16(tempw&tempw2); - flags&=~(C_FLAG|V_FLAG|A_FLAG); - tubecycles-=((mod==3)?4:10); - break; - case 0x10: /*NOT w*/ - seteaw(~tempw); - tubecycles-=((mod==3)?3:13); - break; - case 0x18: /*NEG w*/ - setsub16(0,tempw); - tempw=0-tempw; - seteaw(tempw); - tubecycles-=((mod==3)?3:13); - break; - case 0x20: /*MUL AX,w*/ - setznp16(AX); - templ=AX*tempw; - AX=templ&0xFFFF; - DX=templ>>16; - if (AX|DX) flags&=~Z_FLAG; - else flags|=Z_FLAG; - if (DX) flags|=(C_FLAG|V_FLAG); - else flags&=~(C_FLAG|V_FLAG); - tubecycles-=35; - break; - case 0x28: /*IMUL AX,w*/ - setznp16(AX); -// printf("IMUL %i %i ",(int)((signed short)AX),(int)((signed short)tempw)); - tempws=(int)((signed short)AX)*(int)((signed short)tempw); - if ((tempws>>15) && ((tempws>>15)!=-1)) flags|=(C_FLAG|V_FLAG); - else flags&=~(C_FLAG|V_FLAG); -// printf("%i ",tempws); - AX=tempws&0xFFFF; - tempws=(uint16_t)(tempws>>16); - DX=tempws&0xFFFF; -// printf("%04X %04X\n",AX,DX); -// x86dumpregs(); -// exit(-1); - if (AX|DX) flags&=~Z_FLAG; - else flags|=Z_FLAG; - tubecycles-=34; - break; - case 0x30: /*DIV AX,w*/ - templ=(DX<<16)|AX; -// printf("DIV %08X/%04X\n",templ,tempw); - if (tempw) - { - tempw2=templ%tempw; - DX=tempw2; - templ/=tempw; - AX=templ&0xFFFF; - } - else - { -// printf("DIVw BY 0 %04X:%04X\n",cs>>4,pc); -// x86dumpregs(); -// exit(-1); -// printf("%04X:%04X\n",cs>>4,pc); - writememwl(ss,(SP-2)&0xFFFF,flags|0xF000); - writememwl(ss,(SP-4)&0xFFFF,CS); - writememwl(ss,(SP-6)&0xFFFF,pc); - SP-=6; - flags&=~I_FLAG; - pc=readmemwl(0,0); - loadcs(readmemwl(0,2)); -// cs=loadcs(CS); -// cs=CS<<4; -// printf("Div by zero %04X:%04X %02X %02X 1\n",cs>>4,pc,0xf7,0x30); - } - tubecycles-=38; - break; - case 0x38: /*IDIV AX,w*/ - tempws=(int)((DX<<16)|AX); -// printf("IDIV %i %i ",tempws,tempw); - if (tempw) - { - tempw2=tempws%(int)((signed short)tempw); -// printf("%04X ",tempw2); - DX=tempw2; - tempws/=(int)((signed short)tempw); - AX=tempws&0xFFFF; - } - else - { -// printf("IDIVw BY 0 %04X:%04X\n",cs>>4,pc); -// printf("%04X:%04X\n",cs>>4,pc); - writememwl(ss,(SP-2)&0xFFFF,flags|0xF000); - writememwl(ss,(SP-4)&0xFFFF,CS); - writememwl(ss,(SP-6)&0xFFFF,pc); - SP-=6; - flags&=~I_FLAG; - pc=readmemwl(0,0); - loadcs(readmemwl(0,2)); -// cs=loadcs(CS); -// cs=CS<<4; -// printf("Div by zero %04X:%04X %02X %02X 1\n",cs>>4,pc,0xf7,0x38); - } - tubecycles-=53; - break; - - default: - printf("Bad F7 opcode %02X\n",rmdat&0x38); -// x86dumpregs(); -// exit(-1); - } - break; - - case 0xF8: /*CLC*/ - flags&=~C_FLAG; - tubecycles-=2; - break; - case 0xF9: /*STC*/ -// printf("STC %04X\n",pc); - flags|=C_FLAG; - tubecycles-=2; - break; - case 0xFA: /*CLI*/ - flags&=~I_FLAG; -// printf("CLI at %04X:%04X\n",cs>>4,pc); - tubecycles-=3; - break; - case 0xFB: /*STI*/ - flags|=I_FLAG; -// printf("STI at %04X:%04X\n",cs>>4,pc); - tubecycles-=2; - break; - case 0xFC: /*CLD*/ - flags&=~D_FLAG; - tubecycles-=2; - break; - case 0xFD: /*STD*/ - flags|=D_FLAG; - tubecycles-=2; - break; - - case 0xFE: /*INC/DEC b*/ - fetchea(); - temp=geteab(); - flags&=~V_FLAG; - if (rmdat&0x38) - { - setsub8nc(temp,1); - temp2=temp-1; - if ((temp&0x80) && !(temp2&0x80)) flags|=V_FLAG; - } - else - { - setadd8nc(temp,1); - temp2=temp+1; - if ((temp2&0x80) && !(temp&0x80)) flags|=V_FLAG; - } - seteab(temp2); - tubecycles-=((mod==3)?3:15); - break; - - case 0xFF: - fetchea(); - switch (rmdat&0x38) - { - case 0x00: /*INC w*/ - tempw=geteaw(); - setadd16nc(tempw,1); -// setznp16(tempw+1); - seteaw(tempw+1); - tubecycles-=((mod==3)?3:15); - break; - case 0x08: /*DEC w*/ - tempw=geteaw(); - setsub16nc(tempw,1); - seteaw(tempw-1); - tubecycles-=((mod==3)?3:15); - break; - case 0x10: /*CALL*/ - tempw=geteaw(); - if (ssegs) ss=oldss; - writememwl(ss,(SP-2)&0xFFFF,pc); - SP-=2; - pc=tempw; - tubecycles-=((mod==3)?13:19); - break; - case 0x18: /*CALL far*/ -/* if (CS==0x6012 && pc==0x15EE) - { - rpclog("Mouse trap!\n"); - getmousepos(&AX,&CX,&DX); - }*/ - tempw=readmemwl(easeg,eaaddr); - tempw2=readmemwl(easeg,(eaaddr+2)&0xFFFF); //geteaw2(); -// printf("Call FAR %04X:%04X %04X:%04X\n",CS,pc,tempw2,tempw); - tempw3=CS; - tempw4=pc; - if (ssegs) ss=oldss; - pc=tempw; - loadcs(tempw2); - writememwl(ss,(SP-2)&0xFFFF,tempw3); - writememwl(ss,((SP-4)&0xFFFF),tempw4); - SP-=4; - tubecycles-=38; - break; - case 0x20: /*JMP*/ - pc=geteaw(); - tubecycles-=((mod==3)?17:11); - break; - case 0x28: /*JMP far*/ - pc=readmemwl(easeg,eaaddr); //geteaw(); - loadcs(readmemwl(easeg,(eaaddr+2)&0xFFFF)); //geteaw2(); -// cs=loadcs(CS); -// cs=CS<<4; - tubecycles-=26; - break; - case 0x30: /*PUSH w*/ - tempw=geteaw(); -// if (x86output) printf("PUSH %04X %i %02X %04X %04X %02X %02X\n",tempw,rm,rmdat,easeg,eaaddr,ram[0x22340+0x5638],ram[0x22340+0x5639]); - if (ssegs) ss=oldss; - writememwl(ss,((SP-2)&0xFFFF),tempw); - SP-=2; - tubecycles-=((mod==3)?10:16); - break; - - default: - break; -// printf("Bad FF opcode %02X\n",rmdat&0x38); -// x86dumpregs(); -// exit(-1); - } - break; - - default: - pc++; - tubecycles-=8; -/* if (!AT) - { - pc++; - tubecycles-=8; - } - else - {*/ -// printf("Bad opcode %02X at %04X:%04X from %04X:%04X %08X\n",opcode,cs>>4,pc,old8>>16,old8&0xFFFF,old82); -// x86dumpregs(); -// exit(-1); -// } - break; - - pc--; - tubecycles-=8; - break; - printf("Bad opcode %02X at %04X:%04X from %04X:%04X %08X\n",opcode,cs>>4,pc,old8>>16,old8&0xFFFF,old82); - x86dumpregs(); - exit(-1); - } - pc&=0xFFFF; -// if (CS==0x1490 && pc==0x3BBA) rpclog("Here from %04X:%04X %08X %02X\n",oldcs,oldpc,old8,opcode); - -// if (CS==0x6012 && pc==3) rpclog("XIOS direct call %02X %04X %04X %04X %04X\n",AL,CX,DX,BX,SI); - -/* if (!CS && !pc) - { - printf("At zero!\n"); - x86dumpregs(); - exit(-1); - }*/ - - if (tube_irq&2) - { - //tube_irq&=~2; -// printf("Let's do DMA! %i\n",tube_irq); - x86_dma(); - } -/* if (tube_irq&2 && !x86oldnmi && ram[4]) - { - if (inhlt) pc++; - if (AT) writememwl(ss,(SP-2)&0xFFFF,flags&~0xF000); - else writememwl(ss,(SP-2)&0xFFFF,flags|0xF000); - writememwl(ss,(SP-4)&0xFFFF,CS); - writememwl(ss,(SP-6)&0xFFFF,pc); - SP-=6; - temp=2; - addr=temp<<2; - flags&=~I_FLAG; - pc=readmemwl(0,addr); - loadcs(readmemwl(0,addr+2)); - } - x86oldnmi=tube_irq&2;*/ - - if (ssegs) - { - ds=oldds; - ss=oldss; - ssegs=0; - } - cycdiff-=tubecycles; - -x86ins++; -//if (x86ins==65300000) x86output=1; - if ((flags&I_FLAG) && !ssegs && (tube_irq&1)) - { - if (inhlt) pc++; - writememwl(ss,(SP-2)&0xFFFF,flags|0xF000); - writememwl(ss,(SP-4)&0xFFFF,CS); - writememwl(ss,(SP-6)&0xFFFF,pc); - SP-=6; - temp=12; - addr=temp<<2; - flags&=~I_FLAG; - pc=readmemwl(0,addr); - loadcs(readmemwl(0,addr+2)); -// inint=1; - } - -/* if (pc==0xCC32 && es>0x180000) - { - pc=0xCBEB; -// x86output=1; -// timetolive=500000; - }*/ - -// if (noint) noint=0; -// ins++; - } -} -//#endif +/*B-em v2.2 by Tom Walker + 80186 emulation + Originally from PCem + A few bits of 80286 emulation hanging around also*/ +#include +#include +#include +#include "b-em.h" +#include "x86.h" +#include "tube.h" + +static int x86ins=0; + +#define loadcs(seg) CS=seg; cs=seg<<4 + +static void loadseg(uint16_t val, x86seg *seg) +{ + seg->seg=val; + seg->base=val<<4; +} + +#define readmembl(a) (((a)<0xE0000)?x86ram[(a)]:readmemblx86(a)) +#define writemembl(a,b) x86ram[(a)&0xFFFFF]=b; +#define readmemwl(s,a) ((((s)+(a))<0xE0000)?*(uint16_t *)(&x86ram[(s)+(a)]):readmemwlx86(s,a)) +#define writememwl(s,a,b) *(uint16_t *)(&x86ram[((s)+(a))&0xFFFFF])=b; + +#define pc x86pc + +static void x86dumpregs(); + +static uint32_t old8,old82,old83; +static uint16_t oldcs; + +static int tempc; +static uint16_t getword(); +static uint8_t opcode; +static int noint=0; + +static uint8_t readmemblx86(uint32_t addr); +static uint16_t readmemwlx86(uint32_t seg, uint32_t addr); + +static uint8_t *x86ram,*x86rom; + +static int ssegs; + +/*EA calculation*/ + +/*R/M - bits 0-2 - R/M bits 3-5 - Reg bits 6-7 - mod + From 386 programmers manual : +r8(/r) AL CL DL BL AH CH DH BH +r16(/r) AX CX DX BX SP BP SI DI +r32(/r) EAX ECX EDX EBX ESP EBP ESI EDI +/digit (Opcode) 0 1 2 3 4 5 6 7 +REG = 000 001 010 011 100 101 110 111 + ÚÄÄÄAddress +disp8 denotes an 8-bit displacement following the ModR/M byte, to be +sign-extended and added to the index. disp16 denotes a 16-bit displacement +following the ModR/M byte, to be added to the index. Default segment +register is SS for the effective addresses containing a BP index, DS for +other effective addresses. + ÄÄ¿ ÚMod R/M¿ ÚÄÄÄÄÄÄÄÄModR/M Values in HexadecimalÄÄÄÄÄÄÄÄ¿ + +[BX + SI] 000 00 08 10 18 20 28 30 38 +[BX + DI] 001 01 09 11 19 21 29 31 39 +[BP + SI] 010 02 0A 12 1A 22 2A 32 3A +[BP + DI] 011 03 0B 13 1B 23 2B 33 3B +[SI] 00 100 04 0C 14 1C 24 2C 34 3C +[DI] 101 05 0D 15 1D 25 2D 35 3D +disp16 110 06 0E 16 1E 26 2E 36 3E +[BX] 111 07 0F 17 1F 27 2F 37 3F + +[BX+SI]+disp8 000 40 48 50 58 60 68 70 78 +[BX+DI]+disp8 001 41 49 51 59 61 69 71 79 +[BP+SI]+disp8 010 42 4A 52 5A 62 6A 72 7A +[BP+DI]+disp8 011 43 4B 53 5B 63 6B 73 7B +[SI]+disp8 01 100 44 4C 54 5C 64 6C 74 7C +[DI]+disp8 101 45 4D 55 5D 65 6D 75 7D +[BP]+disp8 110 46 4E 56 5E 66 6E 76 7E +[BX]+disp8 111 47 4F 57 5F 67 6F 77 7F + +[BX+SI]+disp16 000 80 88 90 98 A0 A8 B0 B8 +[BX+DI]+disp16 001 81 89 91 99 A1 A9 B1 B9 +[BX+SI]+disp16 010 82 8A 92 9A A2 AA B2 BA +[BX+DI]+disp16 011 83 8B 93 9B A3 AB B3 BB +[SI]+disp16 10 100 84 8C 94 9C A4 AC B4 BC +[DI]+disp16 101 85 8D 95 9D A5 AD B5 BD +[BP]+disp16 110 86 8E 96 9E A6 AE B6 BE +[BX]+disp16 111 87 8F 97 9F A7 AF B7 BF + +EAX/AX/AL 000 C0 C8 D0 D8 E0 E8 F0 F8 +ECX/CX/CL 001 C1 C9 D1 D9 E1 E9 F1 F9 +EDX/DX/DL 010 C2 CA D2 DA E2 EA F2 FA +EBX/BX/BL 011 C3 CB D3 DB E3 EB F3 FB +ESP/SP/AH 11 100 C4 CC D4 DC E4 EC F4 FC +EBP/BP/CH 101 C5 CD D5 DD E5 ED F5 FD +ESI/SI/DH 110 C6 CE D6 DE E6 EE F6 FE +EDI/DI/BH 111 C7 CF D7 DF E7 EF F7 FF + +mod = 11 - register + 10 - address + 16 bit displacement + 01 - address + 8 bit displacement + 00 - address + +reg = If mod=11, (depending on data size, 16 bits/8 bits, 32 bits=extend 16 bit registers) + 0=AX/AL 1=CX/CL 2=DX/DL 3=BX/BL + 4=SP/AH 5=BP/CH 6=SI/DH 7=DI/BH + + Otherwise, LSB selects SI/DI (0=SI), NMSB selects BX/BP (0=BX), and MSB + selects whether BX/BP are used at all (0=used). + + mod=00 is an exception though + 6=16 bit displacement only + 7=[BX] + + Usage varies with instructions. + + MOV AL,BL has ModR/M as C3, for example. + mod=11, reg=0, r/m=3 + MOV uses reg as dest, and r/m as src. + reg 0 is AL, reg 3 is BL + + If BP or SP are in address calc, seg is SS, else DS +*/ + +static int x86cycles=0; +#define cycles x86cycles + +static uint32_t easeg,eaaddr; +static int rm,reg,mod,rmdat; + +static uint16_t zero=0; +static uint16_t *mod1add[2][8]; +static uint32_t *mod1seg[8]; + +static void makemod1table() +{ + mod1add[0][0]=&BX; mod1add[0][1]=&BX; mod1add[0][2]=&BP; mod1add[0][3]=&BP; + mod1add[0][4]=&SI; mod1add[0][5]=&DI; mod1add[0][6]=&BP; mod1add[0][7]=&BX; + mod1add[1][0]=&SI; mod1add[1][1]=&DI; mod1add[1][2]=&SI; mod1add[1][3]=&DI; + mod1add[1][4]=&zero; mod1add[1][5]=&zero; mod1add[1][6]=&zero; mod1add[1][7]=&zero; + mod1seg[0]=&ds; mod1seg[1]=&ds; mod1seg[2]=&ss; mod1seg[3]=&ss; + mod1seg[4]=&ds; mod1seg[5]=&ds; mod1seg[6]=&ss; mod1seg[7]=&ds; +} + +static void fetcheal() +{ + if (!mod && rm==6) { eaaddr=getword(); easeg=ds; } + else + { + switch (mod) + { + case 0: eaaddr=0; break; + case 1: eaaddr=(uint16_t)(signed char)readmembl(cs+pc); pc++; break; + case 2: eaaddr=getword(); break; + } + eaaddr+=(*mod1add[0][rm])+(*mod1add[1][rm]); + easeg=*mod1seg[rm]; + eaaddr&=0xFFFF; + } +} + +static inline uint8_t geteab() +{ + if (mod==3) + return (rm&4)?regs[rm&3].b.h:regs[rm&3].b.l; + cycles-=3; + return readmembl(easeg+eaaddr); +} + +static inline uint16_t geteaw() +{ + if (mod==3) + return regs[rm].w; + cycles-=3; + return readmemwl(easeg,eaaddr); +} + +static inline uint16_t geteaw2() +{ + if (mod==3) + return regs[rm].w; + cycles-=2; + return readmemwl(easeg,(eaaddr+2)&0xFFFF); +} + +static inline void seteab(uint8_t val) +{ + if (mod==3) + { + if (rm&4) regs[rm&3].b.h=val; + else regs[rm&3].b.l=val; + } + else + { + cycles-=2; + writemembl(easeg+eaaddr,val); + } +} + +static inline void seteaw(uint16_t val) +{ + if (mod==3) + regs[rm].w=val; + else + { + cycles-=2; + writememwl(easeg,eaaddr,val); + } +} + +#define getr8(r) ((r&4)?regs[r&3].b.h:regs[r&3].b.l) + +#define setr8(r,v) if (r&4) regs[r&3].b.h=v; \ + else regs[r&3].b.l=v; + + +/*Flags*/ +static uint8_t znptable8[256]; +static uint16_t znptable16[65536]; + +static void x86makeznptable() +{ + int c,d; + for (c=0;c<256;c++) + { + d=0; + if (c&1) d++; + if (c&2) d++; + if (c&4) d++; + if (c&8) d++; + if (c&16) d++; + if (c&32) d++; + if (c&64) d++; + if (c&128) d++; + if (d&1) + znptable8[c]=0; + else + znptable8[c]=P_FLAG; + if (!c) znptable8[c]|=Z_FLAG; + if (c&0x80) znptable8[c]|=N_FLAG; + } + for (c=0;c<65536;c++) + { + d=0; + if (c&1) d++; + if (c&2) d++; + if (c&4) d++; + if (c&8) d++; + if (c&16) d++; + if (c&32) d++; + if (c&64) d++; + if (c&128) d++; + if (d&1) + znptable16[c]=0; + else + znptable16[c]=P_FLAG; + if (!c) znptable16[c]|=Z_FLAG; + if (c&0x8000) znptable16[c]|=N_FLAG; + } +} + +static uint8_t readmemblx86(uint32_t addr) +{ + if (addr<0xE0000) return x86ram[addr]; +// if (addr<0xC0000) return x86ram[addr-0x40000]; + if (addr>0xF0000) return x86rom[addr&0x3FFF]; + return 0xFF; +} + +static uint16_t readmemwlx86(uint32_t seg, uint32_t addr) +{ + uint32_t addr2=seg+addr; + if (addr2<0xE0000) return *(uint16_t *)(&x86ram[addr2]); +// if (addr2<0xC0000) return *(uint16_t *)(&x86ram[addr2-0x40000]); + if (addr2>0xF0000) return *(uint16_t *)(&x86rom[addr2&0x3FFF]); + return 0xFFFF; +} + +static uint16_t getword() +{ + pc+=2; + return readmemwl(cs,(pc-2)); +} + +static void x86dumpregs() +{ + FILE *f; + int c; + f=fopen("x86ram.dmp","wb"); + fwrite(x86ram,896*1024,1,f); + for (c=0xE0000;c<0x100000;c+=0x4000) fwrite(x86rom,16*1024,1,f); + fclose(f); + printf("AX=%04X BX=%04X CX=%04X DX=%04X DI=%04X SI=%04X BP=%04X SP=%04X\n",AX,BX,CX,DX,DI,SI,BP,SP); + printf("PC=%04X CS=%04X DS=%04X ES=%04X SS=%04X FLAGS=%04X\n",pc,CS,DS,ES,SS,flags); + printf("%04X:%04X %08X %08X %08X\n",oldcs,oldpc,old8,old82,old83); + printf("%i %04X %04X\n",x86ins,pc,x86pc); +/* if (is386) + printf("In %s mode\n",(msw&1)?((eflags&VM_FLAG)?"V86":"protected"):"real"); + else + printf("In %s mode\n",(msw&1)?"protected":"real"); + printf("CS : base=%06X limit=%04X access=%02X\n",cs,_cs.limit,_cs.access); + printf("DS : base=%06X limit=%04X access=%02X\n",ds,_ds.limit,_ds.access); + printf("ES : base=%06X limit=%04X access=%02X\n",es,_es.limit,_es.access); + if (is386) + { + printf("FS : base=%06X limit=%04X access=%02X\n",fs,_fs.limit,_fs.access); + printf("GS : base=%06X limit=%04X access=%02X\n",gs,_gs.limit,_gs.access); + } + printf("SS : base=%06X limit=%04X access=%02X\n",ss,_ss.limit,_ss.access); + printf("GDT : base=%06X limit=%04X\n",gdt.base,gdt.limit); + printf("LDT : base=%06X limit=%04X\n",ldt.base,ldt.limit); + printf("IDT : base=%06X limit=%04X\n",idt.base,idt.limit); + printf("TR : base=%06X limit=%04X\n", tr.base, tr.limit); + if (is386) + { + printf("386 in %s mode stack in %s mode\n",(use32)?"32-bit":"16-bit",(stack32)?"32-bit":"16-bit"); + printf("CR0=%08X CR2=%08X CR3=%08X\n",cr0,cr2,cr3); + }*/ +} + +void x86_reset() +{ +// return; + pc=0; + loadcs(0xFFFF); + flags=2; + makemod1table(); +} + +void x86_init() +{ + FILE *f; + char fn[512]; + if (!x86ram) x86ram=malloc(0x100000); + if (!x86rom) x86rom=malloc(0x4000); + x86makeznptable(); + memset(x86ram,0,0x100000); + append_filename(fn,exedir,"roms/tube/BIOS.ROM",511); + f=fopen(fn,"rb"); + fread(x86rom,0x4000,1,f); + fclose(f); +} + +void x86_close() +{ + if (x86rom) free(x86rom); + if (x86ram) free(x86ram); +} + +static void setznp8(uint8_t val) +{ + flags&=~0xC4; + flags|=znptable8[val]; +} + +#define setznp168 setznp16 +static void setznp16(uint16_t val) +{ + flags&=~0xC4; +// flags|=((val&0x8000)?N_FLAG:((!val)?Z_FLAG:0)); +// flags|=(((znptable8[val&0xFF]&P_FLAG)==(znptable8[val>>8]&P_FLAG))?P_FLAG:0); + flags|=znptable16[val]; +} + +/*void setznp168(uint16_t val) +{ + flags&=~0xC4; + flags|=(znptable16[val]&0xC0)|(znptable8[val&0xFF]&4); +}*/ + +static void setadd8(uint8_t a, uint8_t b) +{ + uint16_t c=(uint16_t)a+(uint16_t)b; + flags&=~0x8D5; + flags|=znptable8[c&0xFF]; + if (c&0x100) flags|=C_FLAG; + if (!((a^b)&0x80)&&((a^c)&0x80)) flags|=V_FLAG; + if (((a&0xF)+(b&0xF))&0x10) flags|=A_FLAG; +} +static void setadd8nc(uint8_t a, uint8_t b) +{ + uint16_t c=(uint16_t)a+(uint16_t)b; + flags&=~0x8D4; + flags|=znptable8[c&0xFF]; + if (!((a^b)&0x80)&&((a^c)&0x80)) flags|=V_FLAG; + if (((a&0xF)+(b&0xF))&0x10) flags|=A_FLAG; +} +static void setadc8(uint8_t a, uint8_t b) +{ + uint16_t c=(uint16_t)a+(uint16_t)b+tempc; + flags&=~0x8D5; + flags|=znptable8[c&0xFF]; + if (c&0x100) flags|=C_FLAG; + if (!((a^b)&0x80)&&((a^c)&0x80)) flags|=V_FLAG; + if (((a&0xF)+(b&0xF))&0x10) flags|=A_FLAG; +} +static void setadd16(uint16_t a, uint16_t b) +{ + uint32_t c=(uint32_t)a+(uint32_t)b; + flags&=~0x8D5; + flags|=znptable16[c&0xFFFF]; + if (c&0x10000) flags|=C_FLAG; + if (!((a^b)&0x8000)&&((a^c)&0x8000)) flags|=V_FLAG; + if (((a&0xF)+(b&0xF))&0x10) flags|=A_FLAG; +} +static void setadd16nc(uint16_t a, uint16_t b) +{ + uint32_t c=(uint32_t)a+(uint32_t)b; + flags&=~0x8D4; + flags|=znptable16[c&0xFFFF]; + if (!((a^b)&0x8000)&&((a^c)&0x8000)) flags|=V_FLAG; + if (((a&0xF)+(b&0xF))&0x10) flags|=A_FLAG; +} +static void x86setadc16(uint16_t a, uint16_t b) +{ + uint32_t c=(uint32_t)a+(uint32_t)b+tempc; + flags&=~0x8D5; + flags|=znptable16[c&0xFFFF]; + if (c&0x10000) flags|=C_FLAG; + if (!((a^b)&0x8000)&&((a^c)&0x8000)) flags|=V_FLAG; + if (((a&0xF)+(b&0xF))&0x10) flags|=A_FLAG; +} + +static void setsub8(uint8_t a, uint8_t b) +{ + uint16_t c=(uint16_t)a-(uint16_t)b; + flags&=~0x8D5; + flags|=znptable8[c&0xFF]; + if (c&0x100) flags|=C_FLAG; + if ((a^b)&(a^c)&0x80) flags|=V_FLAG; + if (((a&0xF)-(b&0xF))&0x10) flags|=A_FLAG; +} +static void setsub8nc(uint8_t a, uint8_t b) +{ + uint16_t c=(uint16_t)a-(uint16_t)b; + flags&=~0x8D4; + flags|=znptable8[c&0xFF]; + if ((a^b)&(a^c)&0x80) flags|=V_FLAG; + if (((a&0xF)-(b&0xF))&0x10) flags|=A_FLAG; +} +static void setsbc8(uint8_t a, uint8_t b) +{ + uint16_t c=(uint16_t)a-(((uint16_t)b)+tempc); + flags&=~0x8D5; + flags|=znptable8[c&0xFF]; + if (c&0x100) flags|=C_FLAG; + if ((a^b)&(a^c)&0x80) flags|=V_FLAG; + if (((a&0xF)-(b&0xF))&0x10) flags|=A_FLAG; +} +static void setsub16(uint16_t a, uint16_t b) +{ + uint32_t c=(uint32_t)a-(uint32_t)b; + flags&=~0x8D5; + flags|=znptable16[c&0xFFFF]; + if (c&0x10000) flags|=C_FLAG; + if ((a^b)&(a^c)&0x8000) flags|=V_FLAG; +// if (x86output) printf("%04X %04X %i\n",a^b,a^c,flags&V_FLAG); + if (((a&0xF)-(b&0xF))&0x10) flags|=A_FLAG; +} +static void setsub16nc(uint16_t a, uint16_t b) +{ + uint32_t c=(uint32_t)a-(uint32_t)b; + flags&=~0x8D4; + flags|=(znptable16[c&0xFFFF]&~4); + flags|=(znptable8[c&0xFF]&4); + if ((a^b)&(a^c)&0x8000) flags|=V_FLAG; + if (((a&0xF)-(b&0xF))&0x10) flags|=A_FLAG; +} +static void x86setsbc16(uint16_t a, uint16_t b) +{ + uint32_t c=(uint32_t)a-(((uint32_t)b)+tempc); + flags&=~0x8D5; + flags|=(znptable16[c&0xFFFF]&~4); + flags|=(znptable8[c&0xFF]&4); + if (c&0x10000) flags|=C_FLAG; + if ((a^b)&(a^c)&0x8000) flags|=V_FLAG; + if (((a&0xF)-(b&0xF))&0x10) flags|=A_FLAG; +} + +static uint32_t x86sa,x86ss,x86src; +static uint32_t x86da,x86ds,x86dst; +static uint16_t x86ena; +static uint16_t x86imask=0; + +static uint8_t inb(uint16_t port) +{ + if ((port&~0xF)==0x80) return tube_parasite_read(port>>1); + return 0xFF; + printf("Bad IN port %04X %04X:%04X\n",port,cs>>4,pc); + x86dumpregs(); + exit(-1); +} + +static void outb(uint16_t port, uint8_t val) +{ +// port&=0xFF; +// printf("OUT %04X %02X %04X:%04X\n",port,val,cs>>4,pc); + switch (port) + { + case 0xFF28: x86imask=val; return; + case 0xFFC0: x86sa=(x86sa&0xFF00)|val; x86src=x86sa+((x86ss&0xF)<<16); return; + case 0xFFC1: x86sa=(x86sa&0xFF)|(val<<8); x86src=x86sa+((x86ss&0xF)<<16); return;//printf("SRC now %05X %04X:%04X\n",x86src,CS,pc); return; + case 0xFFC2: x86ss=(x86ss&0xFF00)|val; x86src=x86sa+((x86ss&0xF)<<16); return; + case 0xFFC3: x86ss=(x86ss&0xFF)|(val<<8); x86src=x86sa+((x86ss&0xF)<<16); return;//printf("SRC now %05X %04X:%04X\n",x86src,CS,pc); return; + case 0xFFC4: x86da=(x86da&0xFF00)|val; x86dst=x86da+((x86ds&0xF)<<16); return; + case 0xFFC5: x86da=(x86da&0xFF)|(val<<8); x86dst=x86da+((x86ds&0xF)<<16); return;//printf("DST now %05X %04X:%04X\n",x86dst,CS,pc); return; + case 0xFFC6: x86ds=(x86ds&0xFF00)|val; x86dst=x86da+((x86ds&0xF)<<16); return; + case 0xFFC7: x86ds=(x86ds&0xFF)|(val<<8); x86dst=x86da+((x86ds&0xF)<<16); return;//printf("DST now %05X %04X:%04X\n",x86dst,CS,pc); return; + case 0xFFCA: x86ena=(x86ena&0xFF00)|val; return; + case 0xFFCB: x86ena=(x86ena&0xFF)|(val<<8); return; + } + if ((port&~0xF)==0x80) + { +// if (port!=0x8E || val!=0) printf("Tube write %02X %02X\n",port,val); + tube_parasite_write(port>>1,val); + return; + } +} + +static void x86_dma() +{ + if (!(x86ena&2)) return; +// printf("Src %05X %04X:%04X Dst %05X %04X:%04X\n",x86src,x86ss,x86sa, x86dst,x86ds,x86da); + if (x86src<0x100) + { +/* if (x86dst==256*1024) + { + x86dumpregs(); + exit(-1); + }*/ + writemembl(x86dst,inb(x86src)); + x86dst++; + } + else + { + outb(x86dst,readmembl(x86src)); + x86src++; + } +} + +static int firstrepcycle=1; +static void rep(int fv) +{ + uint8_t temp; + int c=CX; + uint8_t temp2; + uint16_t tempw,tempw2; + uint16_t ipc=oldpc;//pc-1; + int changeds = 0; + uint32_t oldds = 0; + startrep: + temp=readmembl(cs+pc); pc++; +// if (firstrepcycle && temp==0xA5) printf("REP MOVSW %06X:%04X %06X:%04X\n",ds,SI,es,DI); +// if (x86output) printf("REP %02X %04X\n",temp,ipc); + switch (temp) + { + case 0x08: + pc=ipc+1; + cycles-=2; + break; + case 0x26: /*ES:*/ + oldds=ds; + ds=es; + changeds=1; + cycles-=2; + goto startrep; + break; + case 0x2E: /*CS:*/ + oldds=ds; + ds=cs; + changeds=1; + cycles-=2; + goto startrep; + break; + case 0x36: /*SS:*/ + oldds=ds; + ds=ss; + changeds=1; + cycles-=2; + goto startrep; + break; + case 0x6E: /*REP OUTSB*/ + if (c>0) + { + temp2=readmembl(ds+SI); + outb(DX,temp2); + if (flags&D_FLAG) SI--; + else SI++; + c--; + cycles-=5; + } + if (c>0) { firstrepcycle=0; pc=ipc; if (ssegs) ssegs++; } + else firstrepcycle=1; + break; + case 0xA4: /*REP MOVSB*/ + if (c>0) + { + temp2=readmembl(ds+SI); + writemembl(es+DI,temp2); +// if (x86output) printf("Moved %02X from %04X:%04X to %04X:%04X\n",temp2,ds>>4,SI,es>>4,DI); + if (flags&D_FLAG) { DI--; SI--; } + else { DI++; SI++; } + c--; + cycles-=8; + } + if (c>0) { firstrepcycle=0; pc=ipc; if (ssegs) ssegs++; } + else firstrepcycle=1; +// } + break; + case 0xA5: /*REP MOVSW*/ + if (c>0) + { + tempw=readmemwl(ds,SI); + writememwl(es,DI,tempw); + if (flags&D_FLAG) { DI-=2; SI-=2; } + else { DI+=2; SI+=2; } + c--; + cycles-=8; + } + if (c>0) { firstrepcycle=0; pc=ipc; if (ssegs) ssegs++; } + else firstrepcycle=1; +// } + break; + case 0xA6: /*REP CMPSB*/ + if (fv) flags|=Z_FLAG; + else flags&=~Z_FLAG; + if ((c>0) && (fv==((flags&Z_FLAG)?1:0))) + { + temp=readmembl(ds+SI); + temp2=readmembl(es+DI); +// printf("CMPSB %c %c %i %05X %05X %04X:%04X\n",temp,temp2,c,ds+SI,es+DI,cs>>4,pc); + if (flags&D_FLAG) { DI--; SI--; } + else { DI++; SI++; } + c--; + cycles-=22; + setsub8(temp,temp2); + } + if ((c>0) && (fv==((flags&Z_FLAG)?1:0))) { pc=ipc; firstrepcycle=0; if (ssegs) ssegs++; } + else firstrepcycle=1; + break; + case 0xA7: /*REP CMPSW*/ + if (fv) flags|=Z_FLAG; + else flags&=~Z_FLAG; + if ((c>0) && (fv==((flags&Z_FLAG)?1:0))) + { + tempw=readmemwl(ds,SI); + tempw2=readmemwl(es,DI); + if (flags&D_FLAG) { DI-=2; SI-=2; } + else { DI+=2; SI+=2; } + c--; + cycles-=22; + setsub16(tempw,tempw2); + } + if ((c>0) && (fv==((flags&Z_FLAG)?1:0))) { pc=ipc; firstrepcycle=0; if (ssegs) ssegs++; } + else firstrepcycle=1; + break; + case 0xAA: /*REP STOSB*/ + if (c>0) + { + writemembl(es+DI,AL); + if (flags&D_FLAG) DI--; + else DI++; + c--; + cycles-=9; + } + if (c>0) { firstrepcycle=0; pc=ipc; if (ssegs) ssegs++; } + else firstrepcycle=1; + break; + case 0xAB: /*REP STOSW*/ + if (c>0) + { + writememwl(es,DI,AX); + if (flags&D_FLAG) DI-=2; + else DI+=2; + c--; + cycles-=9; + } + if (c>0) { firstrepcycle=0; pc=ipc; if (ssegs) ssegs++; } + else firstrepcycle=1; +// printf("REP STOSW %04X:%04X %04X:%04X %04X %04X\n",CS,pc,ES,DI,AX,CX); } + break; + case 0xAC: /*REP LODSB*/ + if (c>0) + { + temp2=readmembl(ds+SI); + if (flags&D_FLAG) SI--; + else SI++; + c--; + cycles-=4; + } + if (c>0) { firstrepcycle=0; pc=ipc; if (ssegs) ssegs++; } + else firstrepcycle=1; + break; + case 0xAD: /*REP LODSW*/ + if (c>0) + { + tempw2=readmemwl(ds,SI); + if (flags&D_FLAG) SI-=2; + else SI+=2; + c--; + cycles-=4; + } + if (c>0) { firstrepcycle=0; pc=ipc; if (ssegs) ssegs++; } + else firstrepcycle=1; + break; + case 0xAE: /*REP SCASB*/ + if (fv) flags|=Z_FLAG; + else flags&=~Z_FLAG; + if ((c>0) && (fv==((flags&Z_FLAG)?1:0))) + { + temp2=readmembl(es+DI); +// if (x86output) printf("SCASB %02X %c %02X %05X ",temp2,temp2,AL,es+DI); + setsub8(AL,temp2); +// if (x86output && flags&Z_FLAG) printf("Match %02X %02X\n",AL,temp2); + if (flags&D_FLAG) DI--; + else DI++; + c--; + cycles-=15; + } +//if (x86output) printf("%i %i %i %i\n",c,(c>0),(fv==((flags&Z_FLAG)?1:0)),((c>0) && (fv==((flags&Z_FLAG)?1:0)))); + if ((c>0) && (fv==((flags&Z_FLAG)?1:0))) { pc=ipc; firstrepcycle=0; if (ssegs) ssegs++; } + else firstrepcycle=1; +// cycles-=120; + break; + case 0xAF: /*REP SCASW*/ + if (fv) flags|=Z_FLAG; + else flags&=~Z_FLAG; + if ((c>0) && (fv==((flags&Z_FLAG)?1:0))) + { + tempw=readmemwl(es,DI); + setsub16(AX,tempw); + if (flags&D_FLAG) DI-=2; + else DI+=2; + c--; + cycles-=15; + } + if ((c>0) && (fv==((flags&Z_FLAG)?1:0))) { pc=ipc; firstrepcycle=0; if (ssegs) ssegs++; } + else firstrepcycle=1; + break; + default: + pc=ipc; + cycles-=20; +// printf("Bad REP %02X\n",temp); +// x86dumpregs(); +// exit(-1); + } + CX=c; + if (changeds) ds=oldds; +} + +static int inhlt=0; +static uint16_t lastpc,lastcs; +static int skipnextprint=0; +//#if 0 +void x86_exec() +{ + uint8_t temp = 0, temp2; + uint16_t addr, tempw, tempw2, tempw3, tempw4; + signed char offset; + int tempws; + uint32_t templ; + int c,cycdiff; + int tempi; +// tubecycles+=(cycs<<2); +// printf("X86exec %i %i\n",tubecycles,cycs); + while (tubecycles>0) + { + cycdiff=tubecycles; +// old83=old82; +// old82=old8; +// old8=pc+(CS<<16); + oldcs=CS; + oldpc=pc; + opcodestart: + opcode=readmembl(cs+pc); + tempc=flags&C_FLAG; +#if 0 + if (x86output && /*cs<0xF0000 && */!ssegs)//opcode!=0x26 && opcode!=0x36 && opcode!=0x2E && opcode!=0x3E) + { + if ((opcode!=0xF2 && opcode!=0xF3) || firstrepcycle) + { + if (!skipnextprint) printf("%04X:%04X : %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %02X %04X\n",cs,pc,AX,BX,CX,DX,CS,DS,ES,SS,DI,SI,BP,SP,opcode,flags,rmdat); + skipnextprint=0; +// ins++; +/* if (ins==50000) + { + x86dumpregs(); + exit(-1); + }*/ +/* if (ins==500000) + { + x86dumpregs(); + exit(-1); + }*/ + } + } +#endif + pc++; + inhlt=0; +// if (ins==500000) { x86dumpregs(); exit(0); }*/ + switch (opcode) + { + case 0x00: /*ADD 8,reg*/ + fetchea(); + temp=geteab(); + setadd8(temp,getr8(reg)); + temp+=getr8(reg); + seteab(temp); + tubecycles-=((mod==3)?3:10); + break; + case 0x01: /*ADD 16,reg*/ + fetchea(); + tempw=geteaw(); + setadd16(tempw,regs[reg].w); + tempw+=regs[reg].w; + seteaw(tempw); + tubecycles-=((mod==3)?3:10); + break; + case 0x02: /*ADD reg,8*/ + fetchea(); + temp=geteab(); + setadd8(getr8(reg),temp); + setr8(reg,getr8(reg)+temp); + tubecycles-=((mod==3)?3:10); + break; + case 0x03: /*ADD reg,16*/ + fetchea(); + tempw=geteaw(); + setadd16(regs[reg].w,tempw); + regs[reg].w+=tempw; + tubecycles-=((mod==3)?3:10); + break; + case 0x04: /*ADD AL,#8*/ + temp=readmembl(cs+pc); pc++; + setadd8(AL,temp); + AL+=temp; + tubecycles-=4; + break; + case 0x05: /*ADD AX,#16*/ + tempw=getword(); + setadd16(AX,tempw); + AX+=tempw; + tubecycles-=4; + break; + + case 0x06: /*PUSH ES*/ + if (ssegs) ss=oldss; + writememwl(ss,((SP-2)&0xFFFF),ES); + SP-=2; + tubecycles-=9; + break; + case 0x07: /*POP ES*/ + if (ssegs) ss=oldss; + tempw=readmemwl(ss,SP); + loadseg(tempw,&_es); + SP+=2; + tubecycles-=8; + break; + + case 0x08: /*OR 8,reg*/ + fetchea(); + temp=geteab(); + temp|=getr8(reg); + setznp8(temp); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + seteab(temp); + tubecycles-=((mod==3)?3:10); + break; + case 0x09: /*OR 16,reg*/ + fetchea(); + tempw=geteaw(); + tempw|=regs[reg].w; + setznp16(tempw); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + seteaw(tempw); + tubecycles-=((mod==3)?3:10); + break; + case 0x0A: /*OR reg,8*/ + fetchea(); + temp=geteab(); + temp|=getr8(reg); + setznp8(temp); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + setr8(reg,temp); + tubecycles-=((mod==3)?3:10); + break; + case 0x0B: /*OR reg,16*/ + fetchea(); + tempw=geteaw(); + tempw|=regs[reg].w; + setznp16(tempw); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + regs[reg].w=tempw; + tubecycles-=((mod==3)?3:10); + break; + case 0x0C: /*OR AL,#8*/ + AL|=readmembl(cs+pc); pc++; + setznp8(AL); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + tubecycles-=4; + break; + case 0x0D: /*OR AX,#16*/ + AX|=getword(); + setznp16(AX); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + tubecycles-=4; + break; + + case 0x0E: /*PUSH CS*/ + if (ssegs) ss=oldss; + writememwl(ss,((SP-2)&0xFFFF),CS); + SP-=2; + tubecycles-=9; + break; + + case 0x0F: + temp=readmembl(cs+pc); pc++; + switch (temp) + { + case 0x84: /*JE*/ + tempw=getword(); + if (flags&Z_FLAG) pc+=tempw; + tubecycles-=4; + break; + case 0x85: /*JNE*/ + tempw=getword(); + if (!(flags&Z_FLAG)) pc+=tempw; + tubecycles-=4; + break; + + case 0xFF: /*Invalid - Windows 3.1 syscall trap?*/ + pc-=2; + if (ssegs) ss=oldss; + writememwl(ss,((SP-2)&0xFFFF),flags|0xF000); + writememwl(ss,((SP-4)&0xFFFF),CS); + writememwl(ss,((SP-6)&0xFFFF),pc); + SP-=6; + addr=6<<2; +// flags&=~I_FLAG; + pc=readmemwl(0,addr); + loadcs(readmemwl(0,addr+2)); + /*if (!pc && !cs) + { + printf("Bad int %02X %04X:%04X\n",temp,oldcs,oldpc); + x86dumpregs(); + exit(-1); + }*/ + tubecycles-=70; + break; + + default: + break; +// printf("Bad 0F opcode %02X\n",temp); +// pc-=2; +// x86dumpregs(); +// exit(-1); + } + break; + + case 0x10: /*ADC 8,reg*/ + fetchea(); + temp=geteab(); + temp2=getr8(reg); + setadc8(temp,temp2); + temp+=temp2+tempc; + seteab(temp); + tubecycles-=((mod==3)?3:10); + break; + case 0x11: /*ADC 16,reg*/ + fetchea(); + tempw=geteaw(); + tempw2=regs[reg].w; + x86setadc16(tempw,tempw2); + tempw+=tempw2+tempc; + seteaw(tempw); + tubecycles-=((mod==3)?3:10); + break; + case 0x12: /*ADC reg,8*/ + fetchea(); + temp=geteab(); + setadc8(getr8(reg),temp); + setr8(reg,getr8(reg)+temp+tempc); + tubecycles-=((mod==3)?3:10); + break; + case 0x13: /*ADC reg,16*/ + fetchea(); + tempw=geteaw(); + x86setadc16(regs[reg].w,tempw); + regs[reg].w+=tempw+tempc; + tubecycles-=((mod==3)?3:10); + break; + case 0x14: /*ADC AL,#8*/ + tempw=readmembl(cs+pc); pc++; + setadc8(AL,tempw); + AL+=tempw+tempc; + tubecycles-=4; + break; + case 0x15: /*ADC AX,#16*/ + tempw=getword(); + x86setadc16(AX,tempw); + AX+=tempw+tempc; + tubecycles-=4; + break; + + case 0x16: /*PUSH SS*/ + if (ssegs) ss=oldss; + writememwl(ss,((SP-2)&0xFFFF),SS); + SP-=2; + tubecycles-=9; + break; + case 0x17: /*POP SS*/ + if (ssegs) ss=oldss; + tempw=readmemwl(ss,SP); + loadseg(tempw,&_ss); + SP+=2; + noint=1; + tubecycles-=8; +// x86output=1; + break; + + case 0x18: /*SBB 8,reg*/ + fetchea(); + temp=geteab(); + temp2=getr8(reg); + setsbc8(temp,temp2); + temp-=(temp2+tempc); + seteab(temp); + tubecycles-=((mod==3)?3:10); + break; + case 0x19: /*SBB 16,reg*/ + fetchea(); + tempw=geteaw(); + tempw2=regs[reg].w; + x86setsbc16(tempw,tempw2); + tempw-=(tempw2+tempc); + seteaw(tempw); + tubecycles-=((mod==3)?3:10); + break; + case 0x1A: /*SBB reg,8*/ + fetchea(); + temp=geteab(); + setsbc8(getr8(reg),temp); + setr8(reg,getr8(reg)-(temp+tempc)); + tubecycles-=((mod==3)?3:10); + break; + case 0x1B: /*SBB reg,16*/ + fetchea(); + tempw=geteaw(); + tempw2=regs[reg].w; + x86setsbc16(tempw2,tempw); + tempw2-=(tempw+tempc); + regs[reg].w=tempw2; + tubecycles-=((mod==3)?3:10); + break; + case 0x1C: /*SBB AL,#8*/ + temp=readmembl(cs+pc); pc++; + setsbc8(AL,temp); + AL-=(temp+tempc); + tubecycles-=4; + break; + case 0x1D: /*SBB AX,#16*/ + tempw=getword(); + x86setsbc16(AX,tempw); + AX-=(tempw+tempc); + tubecycles-=4; + break; + + case 0x1E: /*PUSH DS*/ + if (ssegs) ss=oldss; + writememwl(ss,((SP-2)&0xFFFF),DS); + SP-=2; + tubecycles-=9; + break; + case 0x1F: /*POP DS*/ + if (ssegs) ss=oldss; + tempw=readmemwl(ss,SP); + loadseg(tempw,&_ds); + if (ssegs) oldds=ds; + SP+=2; + tubecycles-=8; + break; + + case 0x20: /*AND 8,reg*/ + fetchea(); + temp=geteab(); + temp&=getr8(reg); + setznp8(temp); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + seteab(temp); + tubecycles-=((mod==3)?3:10); + break; + case 0x21: /*AND 16,reg*/ + fetchea(); + tempw=geteaw(); + tempw&=regs[reg].w; + setznp16(tempw); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + seteaw(tempw); + tubecycles-=((mod==3)?3:10); + break; + case 0x22: /*AND reg,8*/ + fetchea(); + temp=geteab(); + temp&=getr8(reg); + setznp8(temp); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + setr8(reg,temp); + tubecycles-=((mod==3)?3:10); + break; + case 0x23: /*AND reg,16*/ + fetchea(); + tempw=geteaw(); + tempw&=regs[reg].w; + setznp16(tempw); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + regs[reg].w=tempw; + tubecycles-=((mod==3)?3:10); + break; + case 0x24: /*AND AL,#8*/ + AL&=readmembl(cs+pc); pc++; + setznp8(AL); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + tubecycles-=4; + break; + case 0x25: /*AND AX,#16*/ + AX&=getword(); + setznp16(AX); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + tubecycles-=4; + break; + + case 0x26: /*ES:*/ + oldss=ss; + oldds=ds; + ds=ss=es; + ssegs=2; + tubecycles-=4; + goto opcodestart; +// break; + + case 0x27: /*DAA*/ + if ((flags&A_FLAG) || ((AL&0xF)>9)) + { + tempi=((uint16_t)AL)+6; + AL+=6; + flags|=A_FLAG; + if (tempi&0x100) flags|=C_FLAG; + } + if ((flags&C_FLAG) || (AL>0x9F)) + { + AL+=0x60; + flags|=C_FLAG; + } + setznp8(AL); + tubecycles-=4; + break; + + case 0x28: /*SUB 8,reg*/ + fetchea(); + temp=geteab(); + setsub8(temp,getr8(reg)); + temp-=getr8(reg); + seteab(temp); + tubecycles-=((mod==3)?3:10); + break; + case 0x29: /*SUB 16,reg*/ + fetchea(); + tempw=geteaw(); + setsub16(tempw,regs[reg].w); + tempw-=regs[reg].w; + seteaw(tempw); + tubecycles-=((mod==3)?3:10); + break; + case 0x2A: /*SUB reg,8*/ + fetchea(); + temp=geteab(); + setsub8(getr8(reg),temp); + setr8(reg,getr8(reg)-temp); + tubecycles-=((mod==3)?3:10); + break; + case 0x2B: /*SUB reg,16*/ + fetchea(); + tempw=geteaw(); + setsub16(regs[reg].w,tempw); + regs[reg].w-=tempw; + tubecycles-=((mod==3)?3:10); + break; + case 0x2C: /*SUB AL,#8*/ + temp=readmembl(cs+pc); pc++; + setsub8(AL,temp); + AL-=temp; + tubecycles-=4; + break; + case 0x2D: /*SUB AX,#16*/ + tempw=getword(); + setsub16(AX,tempw); + AX-=tempw; + tubecycles-=4; + break; + case 0x2E: /*CS:*/ + oldss=ss; + oldds=ds; + ds=ss=cs; + ssegs=2; + tubecycles-=4; + goto opcodestart; + case 0x2F: /*DAS*/ + if ((flags&A_FLAG)||((AL&0xF)>9)) + { + tempi=((uint16_t)AL)-6; + AL-=6; + flags|=A_FLAG; + if (tempi&0x100) flags|=C_FLAG; + } + if ((flags&C_FLAG)||(AL>0x9F)) + { + AL-=0x60; + flags|=C_FLAG; + } + setznp8(AL); + tubecycles-=4; + break; + case 0x30: /*XOR 8,reg*/ + fetchea(); + temp=geteab(); + temp^=getr8(reg); + setznp8(temp); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + seteab(temp); + tubecycles-=((mod==3)?3:10); + break; + case 0x31: /*XOR 16,reg*/ + fetchea(); + tempw=geteaw(); + tempw^=regs[reg].w; + setznp16(tempw); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + seteaw(tempw); + tubecycles-=((mod==3)?3:10); + break; + case 0x32: /*XOR reg,8*/ + fetchea(); + temp=geteab(); + temp^=getr8(reg); + setznp8(temp); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + setr8(reg,temp); + tubecycles-=((mod==3)?3:10); + break; + case 0x33: /*XOR reg,16*/ + fetchea(); + tempw=geteaw(); + tempw^=regs[reg].w; + setznp16(tempw); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + regs[reg].w=tempw; + tubecycles-=((mod==3)?3:10); + break; + case 0x34: /*XOR AL,#8*/ + AL^=readmembl(cs+pc); pc++; + setznp8(AL); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + tubecycles-=4; + break; + case 0x35: /*XOR AX,#16*/ + AX^=getword(); + setznp16(AX); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + tubecycles-=4; + break; + + case 0x36: /*SS:*/ + oldss=ss; + oldds=ds; + ds=ss=ss; + ssegs=2; + tubecycles-=4; + goto opcodestart; +// break; + + case 0x37: /*AAA*/ + if ((flags&A_FLAG)||((AL&0xF)>9)) + { + AL+=6; + AH++; + flags|=(A_FLAG|C_FLAG); + } + else + flags&=~(A_FLAG|C_FLAG); + AL&=0xF; + tubecycles-=8; + break; + + case 0x38: /*CMP 8,reg*/ + fetchea(); + temp=geteab(); + setsub8(temp,getr8(reg)); + tubecycles-=((mod==3)?3:10); + break; + case 0x39: /*CMP 16,reg*/ + fetchea(); + tempw=geteaw(); + setsub16(tempw,regs[reg].w); + tubecycles-=((mod==3)?3:10); + break; + case 0x3A: /*CMP reg,8*/ + fetchea(); + temp=geteab(); + setsub8(getr8(reg),temp); + tubecycles-=((mod==3)?3:10); + break; + case 0x3B: /*CMP reg,16*/ + fetchea(); + tempw=geteaw(); + setsub16(regs[reg].w,tempw); + tubecycles-=((mod==3)?3:10); + break; + case 0x3C: /*CMP AL,#8*/ + temp=readmembl(cs+pc); pc++; + setsub8(AL,temp); + tubecycles-=4; + break; + case 0x3D: /*CMP AX,#16*/ + tempw=getword(); + setsub16(AX,tempw); + tubecycles-=4; + break; + + case 0x3E: /*DS:*/ + oldss=ss; + oldds=ds; + ds=ss=ds; + ssegs=2; + tubecycles-=4; + goto opcodestart; +// break; + + case 0x3F: /*AAS*/ + if ((flags&A_FLAG)||((AL&0xF)>9)) + { + AL-=6; + AH--; + flags|=(A_FLAG|C_FLAG); + } + else + flags&=~(A_FLAG|C_FLAG); + AL&=0xF; + tubecycles-=7; + break; + + case 0x40: case 0x41: case 0x42: case 0x43: /*INC r16*/ + case 0x44: case 0x45: case 0x46: case 0x47: + setadd16nc(regs[opcode&7].w,1); + regs[opcode&7].w++; + tubecycles-=3; + break; + case 0x48: case 0x49: case 0x4A: case 0x4B: /*DEC r16*/ + case 0x4C: case 0x4D: case 0x4E: case 0x4F: + setsub16nc(regs[opcode&7].w,1); + regs[opcode&7].w--; + tubecycles-=3; + break; + + case 0x50: case 0x51: case 0x52: case 0x53: /*PUSH r16*/ + case 0x54: case 0x55: case 0x56: case 0x57: + if (ssegs) ss=oldss; + SP-=2; + writememwl(ss,SP,regs[opcode&7].w); + tubecycles-=10; + break; + case 0x58: case 0x59: case 0x5A: case 0x5B: /*POP r16*/ + case 0x5C: case 0x5D: case 0x5E: case 0x5F: + if (ssegs) ss=oldss; + SP+=2; + regs[opcode&7].w=readmemwl(ss,(SP-2)&0xFFFF); + tubecycles-=8; + break; + + case 0x60: /*PUSHA*/ + writememwl(ss,((SP-2)&0xFFFF),AX); + writememwl(ss,((SP-4)&0xFFFF),CX); + writememwl(ss,((SP-6)&0xFFFF),DX); + writememwl(ss,((SP-8)&0xFFFF),BX); + writememwl(ss,((SP-10)&0xFFFF),SP); + writememwl(ss,((SP-12)&0xFFFF),BP); + writememwl(ss,((SP-14)&0xFFFF),SI); + writememwl(ss,((SP-16)&0xFFFF),DI); + SP-=16; + tubecycles-=36; + break; + case 0x61: /*POPA*/ + DI=readmemwl(ss,((SP)&0xFFFF)); + SI=readmemwl(ss,((SP+2)&0xFFFF)); + BP=readmemwl(ss,((SP+4)&0xFFFF)); + BX=readmemwl(ss,((SP+8)&0xFFFF)); + DX=readmemwl(ss,((SP+10)&0xFFFF)); + CX=readmemwl(ss,((SP+12)&0xFFFF)); + AX=readmemwl(ss,((SP+14)&0xFFFF)); + SP+=16; + tubecycles-=51; + break; +// case 0x66: /*BIOS trap*/ +// callbios(); +// tubecycles-=16; +// break; +//#if 0 + case 0x68: /*PUSH #w*/ + tempw=getword(); + writememwl(ss,((SP-2)&0xFFFF),tempw); + SP-=2; + tubecycles-=9; + break; + case 0x69: /*IMUL r16*/ + fetchea(); + tempw=geteaw(); + tempw2=getword(); + templ=((int)(signed short)tempw)*((int)(signed short)tempw2); +// printf("%04X*%04X = %08X\n",tempw,tempw2,templ); + if ((templ>>16)!=0 && (templ>>16)!=0xFFFF) flags|=C_FLAG|V_FLAG; + else flags&=~(C_FLAG|V_FLAG); + regs[reg].w=templ&0xFFFF; +// seteaw(templ&0xFFFF); + tubecycles-=((mod==3)?40:34); + break; + case 0x6A: /*PUSH #eb*/ + tempw=readmembl(cs+pc); pc++; + if (tempw&0x80) tempw|=0xFF00; + writememwl(ss,((SP-2)&0xFFFF),tempw); + SP-=2; + tubecycles-=9; + break; +// #if 0 + case 0x6B: /*IMUL r8*/ + fetchea(); + tempw=geteaw(); + tempw2=readmembl(cs+pc); pc++; + if (tempw2&0x80) tempw2|=0xFF00; +// printf("%04X * %04X = ",tempw,tempw2); + templ=((int)(signed short)tempw)*((int)(signed short)tempw2); +// printf("%08X\n",templ); + if ((templ>>16)!=0 && (templ>>16)!=0xFFFF) flags|=C_FLAG|V_FLAG; + else flags&=~(C_FLAG|V_FLAG); + regs[reg].w=templ&0xFFFF; +// seteaw(templ&0xFFFF); + tubecycles-=((mod==3)?34:25); + break; +//#endif + case 0x6C: /*INSB*/ + temp=inb(DX); + writemembl(es+DI,temp); + if (flags&D_FLAG) DI--; + else DI++; + tubecycles-=14; + break; + case 0x6E: /*OUTSB*/ + temp=readmembl(ds+SI); + if (flags&D_FLAG) SI--; + else SI++; + outb(DX,temp); + tubecycles-=14; + break; +// #endif + + case 0x70: /*JO*/ + offset=(signed char)readmembl(cs+pc); pc++; + if (flags&V_FLAG) { pc+=offset; tubecycles-=9; } + tubecycles-=4; + break; + case 0x71: /*JNO*/ + offset=(signed char)readmembl(cs+pc); pc++; + if (!(flags&V_FLAG)) { pc+=offset; tubecycles-=9; } + tubecycles-=4; + break; + case 0x72: /*JB*/ + offset=(signed char)readmembl(cs+pc); pc++; + if (flags&C_FLAG) { pc+=offset; tubecycles-=9; } + tubecycles-=4; + break; + case 0x73: /*JNB*/ + offset=(signed char)readmembl(cs+pc); pc++; + if (!(flags&C_FLAG)) { pc+=offset; tubecycles-=9; } + tubecycles-=4; + break; + case 0x74: /*JZ*/ + offset=(signed char)readmembl(cs+pc); pc++; + if (flags&Z_FLAG) { pc+=offset; tubecycles-=9; } + tubecycles-=4; + break; + case 0x75: /*JNZ*/ + offset=(signed char)readmembl(cs+pc); pc++; + if (!(flags&Z_FLAG)) { pc+=offset; tubecycles-=9; } + tubecycles-=4; + break; + case 0x76: /*JBE*/ + offset=(signed char)readmembl(cs+pc); pc++; + if (flags&(C_FLAG|Z_FLAG)) { pc+=offset; tubecycles-=9; } + tubecycles-=4; + break; + case 0x77: /*JNBE*/ + offset=(signed char)readmembl(cs+pc); pc++; + if (!(flags&(C_FLAG|Z_FLAG))) { pc+=offset; tubecycles-=9; } + tubecycles-=4; + break; + case 0x78: /*JS*/ + offset=(signed char)readmembl(cs+pc); pc++; + if (flags&N_FLAG) { pc+=offset; tubecycles-=9; } + tubecycles-=4; + break; + case 0x79: /*JNS*/ + offset=(signed char)readmembl(cs+pc); pc++; + if (!(flags&N_FLAG)) { pc+=offset; tubecycles-=9; } + tubecycles-=4; + break; + case 0x7A: /*JP*/ + offset=(signed char)readmembl(cs+pc); pc++; + if (flags&P_FLAG) { pc+=offset; tubecycles-=9; } + tubecycles-=4; + break; + case 0x7B: /*JNP*/ + offset=(signed char)readmembl(cs+pc); pc++; + if (!(flags&P_FLAG)) { pc+=offset; tubecycles-=9; } + tubecycles-=4; + break; + case 0x7C: /*JL*/ + offset=(signed char)readmembl(cs+pc); pc++; + temp=(flags&N_FLAG)?1:0; + temp2=(flags&V_FLAG)?1:0; + if (temp!=temp2) { pc+=offset; tubecycles-=9; } + tubecycles-=4; + break; + case 0x7D: /*JNL*/ + offset=(signed char)readmembl(cs+pc); pc++; + temp=(flags&N_FLAG)?1:0; + temp2=(flags&V_FLAG)?1:0; + if (temp==temp2) { pc+=offset; tubecycles-=9; } + tubecycles-=4; + break; + case 0x7E: /*JLE*/ + offset=(signed char)readmembl(cs+pc); pc++; + temp=(flags&N_FLAG)?1:0; + temp2=(flags&V_FLAG)?1:0; + if ((flags&Z_FLAG) || (temp!=temp2)) { pc+=offset; tubecycles-=9; } + tubecycles-=4; + break; + case 0x7F: /*JNLE*/ + offset=(signed char)readmembl(cs+pc); pc++; + temp=(flags&N_FLAG)?1:0; + temp2=(flags&V_FLAG)?1:0; + if (!((flags&Z_FLAG) || (temp!=temp2))) { pc+=offset; tubecycles-=9; } + tubecycles-=4; + break; + + case 0x80: case 0x82: + fetchea(); + temp=geteab(); + temp2=readmembl(cs+pc); pc++; + switch (rmdat&0x38) + { + case 0x00: /*ADD b,#8*/ + setadd8(temp,temp2); + seteab(temp+temp2); + tubecycles-=((mod==3)?4:16); + break; + case 0x08: /*OR b,#8*/ + temp|=temp2; + setznp8(temp); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + seteab(temp); + tubecycles-=((mod==3)?4:16); + break; + case 0x10: /*ADC b,#8*/ +// temp2+=(flags&C_FLAG); + setadc8(temp,temp2); + seteab(temp+temp2+tempc); + tubecycles-=((mod==3)?4:16); + break; + case 0x18: /*SBB b,#8*/ +// temp2+=(flags&C_FLAG); + setsbc8(temp,temp2); + seteab(temp-(temp2+tempc)); + tubecycles-=((mod==3)?4:16); + break; + case 0x20: /*AND b,#8*/ + temp&=temp2; + setznp8(temp); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + seteab(temp); + tubecycles-=((mod==3)?4:16); + break; + case 0x28: /*SUB b,#8*/ + setsub8(temp,temp2); + seteab(temp-temp2); + tubecycles-=((mod==3)?4:16); + break; + case 0x30: /*XOR b,#8*/ + temp^=temp2; + setznp8(temp); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + seteab(temp); + tubecycles-=((mod==3)?4:16); + break; + case 0x38: /*CMP b,#8*/ + setsub8(temp,temp2); + tubecycles-=((mod==3)?4:10); + break; + + default: + printf("Bad 80 opcode %02X\n",rmdat&0x38); +// x86dumpregs(); +// exit(-1); + } + break; + + case 0x81: + fetchea(); + tempw=geteaw(); + tempw2=getword(); + switch (rmdat&0x38) + { + case 0x00: /*ADD w,#16*/ + setadd16(tempw,tempw2); + tempw+=tempw2; + seteaw(tempw); + tubecycles-=((mod==3)?4:16); + break; + case 0x08: /*OR w,#16*/ + tempw|=tempw2; + setznp16(tempw); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + seteaw(tempw); + tubecycles-=((mod==3)?4:16); + break; + case 0x10: /*ADC w,#16*/ +// tempw2+=(flags&C_FLAG); + x86setadc16(tempw,tempw2); + tempw+=tempw2+tempc; + seteaw(tempw); + tubecycles-=((mod==3)?4:16); + break; + case 0x20: /*AND w,#16*/ + tempw&=tempw2; + setznp16(tempw); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + seteaw(tempw); + tubecycles-=((mod==3)?4:16); + break; + case 0x18: /*SBB w,#16*/ +// tempw2+=(flags&C_FLAG); + x86setsbc16(tempw,tempw2); + seteaw(tempw-(tempw2+tempc)); + tubecycles-=((mod==3)?4:16); + break; + case 0x28: /*SUB w,#16*/ + setsub16(tempw,tempw2); + tempw-=tempw2; + seteaw(tempw); + tubecycles-=((mod==3)?4:16); + break; + case 0x30: /*XOR w,#16*/ + tempw^=tempw2; + setznp16(tempw); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + seteaw(tempw); + tubecycles-=((mod==3)?4:16); + break; + case 0x38: /*CMP w,#16*/ + setsub16(tempw,tempw2); + tubecycles-=((mod==3)?4:10); + break; + + default: + printf("Bad 81 opcode %02X\n",rmdat&0x38); +// x86dumpregs(); +// exit(-1); + } + break; + + case 0x83: + fetchea(); + tempw=geteaw(); + tempw2=readmembl(cs+pc); pc++; + if (tempw2&0x80) tempw2|=0xFF00; + switch (rmdat&0x38) + { + case 0x00: /*ADD w,#8*/ + setadd16(tempw,tempw2); + tempw+=tempw2; + seteaw(tempw); + tubecycles-=((mod==3)?4:16); + break; + case 0x08: /*OR w,#8*/ + tempw|=tempw2; + setznp16(tempw); + seteaw(tempw); + flags&=~(C_FLAG|A_FLAG|V_FLAG); + tubecycles-=((mod==3)?4:16); + break; + case 0x10: /*ADC w,#8*/ +// tempw2+=(flags&C_FLAG); + x86setadc16(tempw,tempw2); + tempw+=tempw2+tempc; + seteaw(tempw); + tubecycles-=((mod==3)?4:16); + break; + case 0x18: /*SBB w,#8*/ +// tempw2+=(flags&C_FLAG); + x86setsbc16(tempw,tempw2); + tempw-=(tempw2+tempc); + seteaw(tempw); + tubecycles-=((mod==3)?4:16); + break; + case 0x20: /*AND w,#8*/ + tempw&=tempw2; + setznp16(tempw); + seteaw(tempw); + tubecycles-=((mod==3)?4:16); + flags&=~(C_FLAG|A_FLAG|V_FLAG); + break; + case 0x28: /*SUB w,#8*/ + setsub16(tempw,tempw2); + tempw-=tempw2; + seteaw(tempw); + tubecycles-=((mod==3)?4:16); + break; + case 0x30: /*XOR w,#8*/ + tempw^=tempw2; + setznp16(tempw); + seteaw(tempw); + tubecycles-=((mod==3)?4:16); + flags&=~(C_FLAG|A_FLAG|V_FLAG); + break; + case 0x38: /*CMP w,#8*/ + setsub16(tempw,tempw2); + tubecycles-=((mod==3)?4:10); + break; + + default: + printf("Bad 83 opcode %02X\n",rmdat&0x38); +// x86dumpregs(); +// exit(-1); + } + break; + + case 0x84: /*TEST b,reg*/ + fetchea(); + temp=geteab(); + temp2=getr8(reg); + setznp8(temp&temp2); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + tubecycles-=((mod==3)?3:10); + break; + case 0x85: /*TEST w,reg*/ + fetchea(); + tempw=geteaw(); + tempw2=regs[reg].w; + setznp16(tempw&tempw2); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + tubecycles-=((mod==3)?3:10); + break; + case 0x86: /*XCHG b,reg*/ + fetchea(); + temp=geteab(); + seteab(getr8(reg)); + setr8(reg,temp); + tubecycles-=((mod==3)?4:17); + break; + case 0x87: /*XCHG w,reg*/ + fetchea(); + tempw=geteaw(); + seteaw(regs[reg].w); + regs[reg].w=tempw; + tubecycles-=((mod==3)?4:17); + break; + + case 0x88: /*MOV b,reg*/ + fetchea(); + seteab(getr8(reg)); + tubecycles-=((mod==3)?2:9); + break; + case 0x89: /*MOV w,reg*/ + fetchea(); + seteaw(regs[reg].w); + tubecycles-=((mod==3)?2:9); + break; + case 0x8A: /*MOV reg,b*/ + fetchea(); + temp=geteab(); + setr8(reg,temp); + tubecycles-=((mod==3)?2:12); + break; + case 0x8B: /*MOV reg,w*/ + fetchea(); + tempw=geteaw(); + regs[reg].w=tempw; + tubecycles-=((mod==3)?2:12); + break; + + case 0x8C: /*MOV w,sreg*/ + fetchea(); + switch (rmdat&0x38) + { + case 0x00: /*ES*/ + seteaw(ES); + break; + case 0x08: /*CS*/ + seteaw(CS); + break; + case 0x18: /*DS*/ + if (ssegs) ds=oldds; + seteaw(DS); + break; + case 0x10: /*SS*/ + if (ssegs) ss=oldss; + seteaw(SS); + break; + } + tubecycles-=((mod==3)?2:11); + break; + + case 0x8D: /*LEA*/ + fetchea(); + regs[reg].w=eaaddr; + tubecycles-=6; + break; + + case 0x8E: /*MOV sreg,w*/ +// if (x86output) printf("MOV %04X ",pc); + fetchea(); +// if (x86output) printf("%04X %02X\n",pc,rmdat); + switch (rmdat&0x38) + { + case 0x00: /*ES*/ + tempw=geteaw(); + loadseg(tempw,&_es); + break; + case 0x18: /*DS*/ + tempw=geteaw(); + loadseg(tempw,&_ds); + if (ssegs) oldds=ds; + break; + case 0x10: /*SS*/ + tempw=geteaw(); + loadseg(tempw,&_ss); + if (ssegs) oldss=ss; + skipnextprint=1; + noint=1; +// printf("LOAD SS %04X %04X\n",tempw,SS); +// printf("SS loaded with %04X %04X:%04X %04X %04X %04X\n",ss>>4,cs>>4,pc,CX,DX,es>>4); + break; + } + tubecycles-=((mod==3)?2:9); + break; + + case 0x8F: /*POPW*/ + fetchea(); + if (ssegs) ss=oldss; + tempw=readmemwl(ss,SP); + SP+=2; + //if (x86output) printf("POPW - %04X\n",tempw); + seteaw(tempw); + tubecycles-=((mod==3)?10:20); + break; + + case 0x90: /*NOP*/ + tubecycles-=3; + break; + + case 0x91: case 0x92: case 0x93: /*XCHG AX*/ + case 0x94: case 0x95: case 0x96: case 0x97: + tempw=AX; + AX=regs[opcode&7].w; + regs[opcode&7].w=tempw; + tubecycles-=3; + break; + + case 0x98: /*CBW*/ + AH=(AL&0x80)?0xFF:0; + tubecycles-=2; + break; + case 0x99: /*CWD*/ + DX=(AX&0x8000)?0xFFFF:0; + tubecycles-=4; + break; + case 0x9A: /*CALL FAR*/ + tempw=getword(); + tempw2=getword(); + tempw3=CS; + tempw4=pc; + if (ssegs) ss=oldss; + pc=tempw; + loadcs(tempw2); +/* if ((msw&1) && !(_cs.access&4) && ((CS&3)<(tempw3&3))) + { + printf("Call to non-confirming inner segment!\n"); + x86dumpregs(); + exit(-1); + }*/ + writememwl(ss,(SP-2)&0xFFFF,tempw3); + writememwl(ss,(SP-4)&0xFFFF,tempw4); + SP-=4; + tubecycles-=23; + break; + case 0x9B: /*WAIT*/ + tubecycles-=4; + break; + case 0x9C: /*PUSHF*/ +// printf("PUSHF %04X:%04X\n",CS,pc); + if (ssegs) ss=oldss; + writememwl(ss,((SP-2)&0xFFFF),flags|0xF000); + SP-=2; + tubecycles-=9; + break; + case 0x9D: /*POPF*/ +// printf("POPF %04X:%04X\n",CS,pc); +/* if (CS==0xFFFF) + { + x86dumpregs(); + exit(-1); + }*/ + if (ssegs) ss=oldss; + flags=readmemwl(ss,SP)&0xFFF; + SP+=2; + tubecycles-=8; + break; + case 0x9E: /*SAHF*/ + flags=(flags&0xFF00)|AH; + tubecycles-=3; + break; + case 0x9F: /*LAHF*/ + AH=flags&0xFF; + tubecycles-=2; + break; + + case 0xA0: /*MOV AL,(w)*/ + addr=getword(); + AL=readmembl(ds+addr); + tubecycles-=8; + break; + case 0xA1: /*MOV AX,(w)*/ + addr=getword(); +// printf("Reading AX from %05X %04X:%04X\n",ds+addr,ds>>4,addr); + AX=readmemwl(ds,addr); + tubecycles-=8; + break; + case 0xA2: /*MOV (w),AL*/ + addr=getword(); + writemembl(ds+addr,AL); + tubecycles-=9; + break; + case 0xA3: /*MOV (w),AX*/ + addr=getword(); +// if (!addr) printf("Write !addr %04X:%04X\n",cs>>4,pc); + writememwl(ds,addr,AX); + tubecycles-=9; + break; + + case 0xA4: /*MOVSB*/ + temp=readmembl(ds+SI); + writemembl(es+DI,temp); + if (flags&D_FLAG) { DI--; SI--; } + else { DI++; SI++; } + tubecycles-=9; + break; + case 0xA5: /*MOVSW*/ + tempw=readmemwl(ds,SI); + writememwl(es,DI,tempw); + if (flags&D_FLAG) { DI-=2; SI-=2; } + else { DI+=2; SI+=2; } + tubecycles-=9; + break; + case 0xA6: /*CMPSB*/ + temp =readmembl(ds+SI); + temp2=readmembl(es+DI); + setsub8(temp,temp2); + if (flags&D_FLAG) { DI--; SI--; } + else { DI++; SI++; } + tubecycles-=22; + break; + case 0xA7: /*CMPSW*/ + tempw =readmemwl(ds,SI); + tempw2=readmemwl(es,DI); + setsub16(tempw,tempw2); + if (flags&D_FLAG) { DI-=2; SI-=2; } + else { DI+=2; SI+=2; } + tubecycles-=22; + break; + case 0xA8: /*TEST AL,#8*/ + temp=readmembl(cs+pc); pc++; + setznp8(AL&temp); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + tubecycles-=4; + break; + case 0xA9: /*TEST AX,#16*/ + tempw=getword(); + setznp16(AX&tempw); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + tubecycles-=4; + break; + case 0xAA: /*STOSB*/ + writemembl(es+DI,AL); + if (flags&D_FLAG) DI--; + else DI++; + tubecycles-=10; + break; + case 0xAB: /*STOSW*/ + writememwl(es,DI,AX); + if (flags&D_FLAG) DI-=2; + else DI+=2; + tubecycles-=10; + break; + case 0xAC: /*LODSB*/ + AL=readmembl(ds+SI); +// printf("LODSB %04X:%04X %02X %04X:%04X\n",cs>>4,pc,AL,ds>>4,SI); + if (flags&D_FLAG) SI--; + else SI++; + tubecycles-=10; + break; + case 0xAD: /*LODSW*/ +// if (times) printf("LODSW %04X:%04X\n",cs>>4,pc); + AX=readmemwl(ds,SI); + if (flags&D_FLAG) SI-=2; + else SI+=2; + tubecycles-=10; + break; + case 0xAE: /*SCASB*/ + temp=readmembl(es+DI); + setsub8(AL,temp); + if (flags&D_FLAG) DI--; + else DI++; + tubecycles-=15; + break; + case 0xAF: /*SCASW*/ + tempw=readmemwl(es,DI); + setsub16(AX,tempw); + if (flags&D_FLAG) DI-=2; + else DI+=2; + tubecycles-=15; + break; + + case 0xB0: /*MOV AL,#8*/ + AL=readmembl(cs+pc),pc++; + tubecycles-=4; + break; + case 0xB1: /*MOV CL,#8*/ + CL=readmembl(cs+pc),pc++; + tubecycles-=4; + break; + case 0xB2: /*MOV DL,#8*/ + DL=readmembl(cs+pc),pc++; + tubecycles-=4; + break; + case 0xB3: /*MOV BL,#8*/ + BL=readmembl(cs+pc),pc++; + tubecycles-=4; + break; + case 0xB4: /*MOV AH,#8*/ + AH=readmembl(cs+pc),pc++; + tubecycles-=4; + break; + case 0xB5: /*MOV CH,#8*/ + CH=readmembl(cs+pc),pc++; + tubecycles-=4; + break; + case 0xB6: /*MOV DH,#8*/ + DH=readmembl(cs+pc),pc++; + tubecycles-=4; + break; + case 0xB7: /*MOV BH,#8*/ + BH=readmembl(cs+pc),pc++; + tubecycles-=4; + break; + case 0xB8: case 0xB9: case 0xBA: case 0xBB: /*MOV reg,#16*/ + case 0xBC: case 0xBD: case 0xBE: case 0xBF: + regs[opcode&7].w=getword(); + tubecycles-=4; + break; + + case 0xC0: + fetchea(); + c=readmembl(cs+pc); pc++; + temp=geteab(); + c&=31; + if (!c) break; + switch (rmdat&0x38) + { + case 0x00: /*ROL b,CL*/ + while (c>0) + { + temp2=(temp&0x80)?1:0; + temp=(temp<<1)|temp2; + c--; + tubecycles--; + } + if (temp2) flags|=C_FLAG; + else flags&=~C_FLAG; + seteab(temp); + if ((flags&C_FLAG)^(temp>>7)) flags|=V_FLAG; + else flags&=~V_FLAG; +// setznp8(temp); + tubecycles-=((mod==3)?5:17); + break; + case 0x08: /*ROR b,CL*/ + while (c>0) + { + temp2=temp&1; + temp>>=1; + if (temp2) temp|=0x80; + c--; + tubecycles--; + } + if (temp2) flags|=C_FLAG; + else flags&=~C_FLAG; + seteab(temp); + if ((temp^(temp>>1))&0x40) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?5:17); + break; + case 0x10: /*RCL b,CL*/ + while (c>0) + { + tempc=(flags&C_FLAG)?1:0; + if (temp&0x80) flags|=C_FLAG; + else flags&=~C_FLAG; + temp=(temp<<1)|tempc; + c--; + tubecycles--; + } + seteab(temp); + if ((flags&C_FLAG)^(temp>>7)) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?5:17); + break; + case 0x18: /*RCR b,CL*/ + while (c>0) + { + tempc=(flags&C_FLAG)?0x80:0; + if (temp&1) flags|=C_FLAG; + else flags&=~C_FLAG; + temp=(temp>>1)|tempc; + c--; + tubecycles--; + } + seteab(temp); + if ((temp^(temp>>1))&0x40) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?5:17); + break; + case 0x20: case 0x30: /*SHL b,CL*/ + if ((temp<<(c-1))&0x80) flags|=C_FLAG; + else flags&=~C_FLAG; + temp<<=c; + seteab(temp); + setznp8(temp); + tubecycles-=c; + tubecycles-=((mod==3)?5:17); + flags|=A_FLAG; + break; + case 0x28: /*SHR b,CL*/ + if ((temp>>(c-1))&1) flags|=C_FLAG; + else flags&=~C_FLAG; + temp>>=c; + seteab(temp); + setznp8(temp); + tubecycles-=c; + tubecycles-=((mod==3)?5:17); + flags|=A_FLAG; + break; + case 0x38: /*SAR b,CL*/ + if ((temp>>(c-1))&1) flags|=C_FLAG; + else flags&=~C_FLAG; + while (c>0) + { + temp>>=1; + if (temp&0x40) temp|=0x80; + c--; + tubecycles--; + } + seteab(temp); + setznp8(temp); + tubecycles-=((mod==3)?5:17); + flags|=A_FLAG; + break; + + default: + printf("Bad C0 opcode %02X\n",rmdat&0x38); +// x86dumpregs(); +// exit(-1); + } + break; + + case 0xC1: + fetchea(); + c=readmembl(cs+pc); pc++; + c&=31; + tempw=geteaw(); + if (!c) break; + switch (rmdat&0x38) + { + case 0x00: /*ROL w,CL*/ + while (c>0) + { + temp=(tempw&0x8000)?1:0; + tempw=(tempw<<1)|temp; + c--; + tubecycles--; + } + if (temp) flags|=C_FLAG; + else flags&=~C_FLAG; + seteaw(tempw); + if ((flags&C_FLAG)^(tempw>>15)) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?5:17); + break; + case 0x08: /*ROR w,CL*/ + while (c>0) + { + tempw2=(tempw&1)?0x8000:0; + tempw=(tempw>>1)|tempw2; + c--; + tubecycles--; + } + if (tempw2) flags|=C_FLAG; + else flags&=~C_FLAG; + seteaw(tempw); + if ((tempw^(tempw>>1))&0x4000) flags|=V_FLAG; + else flags&=~V_FLAG; +// setznp16(tempw); + tubecycles-=((mod==3)?5:17); + break; + case 0x10: /*RCL w,CL*/ + while (c>0) + { + tempc=(flags&C_FLAG)?1:0; + if (tempw&0x8000) flags|=C_FLAG; + else flags&=~C_FLAG; + tempw=(tempw<<1)|tempc; + c--; + tubecycles--; + } + seteaw(tempw); + if ((flags&C_FLAG)^(tempw>>15)) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?5:17); + break; + case 0x18: /*RCR w,CL*/ + while (c>0) + { + tempc=(flags&C_FLAG)?0x8000:0; + if (tempw&1) flags|=C_FLAG; + else flags&=~C_FLAG; + tempw=(tempw>>1)|tempc; + c--; + tubecycles--; + } + seteaw(tempw); + if ((tempw^(tempw>>1))&0x4000) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?5:17); + break; + + case 0x20: case 0x30: /*SHL w,CL*/ + if ((tempw<<(c-1))&0x8000) flags|=C_FLAG; + else flags&=~C_FLAG; + tempw<<=c; + seteaw(tempw); + setznp16(tempw); + tubecycles-=c; + tubecycles-=((mod==3)?5:17); + flags|=A_FLAG; + break; + + case 0x28: /*SHR w,CL*/ + if ((tempw>>(c-1))&1) flags|=C_FLAG; + else flags&=~C_FLAG; + tempw>>=c; + seteaw(tempw); + setznp16(tempw); + tubecycles-=c; + tubecycles-=((mod==3)?5:17); + flags|=A_FLAG; + break; + + case 0x38: /*SAR w,CL*/ + tempw2=tempw&0x8000; + if ((tempw>>(c-1))&1) flags|=C_FLAG; + else flags&=~C_FLAG; + while (c>0) + { + tempw=(tempw>>1)|tempw2; + c--; + tubecycles--; + } + seteaw(tempw); + setznp16(tempw); + tubecycles-=((mod==3)?5:17); + flags|=A_FLAG; + break; + + default: + printf("Bad C1 opcode %02X\n",rmdat&0x38); +// x86dumpregs(); +// exit(-1); + } + break; + + case 0xC2: /*RET*/ + tempw=getword(); + if (ssegs) ss=oldss; + pc=readmemwl(ss,SP); +// printf("RET to %04X\n",pc); + SP+=2+tempw; + tubecycles-=18; + break; + case 0xC3: /*RET*/ + if (ssegs) ss=oldss; + pc=readmemwl(ss,SP); +// if (x86output) printf("RET to %04X %05X\n",pc,ss+SP); + SP+=2; + tubecycles-=16; + break; + case 0xC4: /*LES*/ + fetchea(); + regs[reg].w=readmemwl(easeg,eaaddr); //geteaw(); + tempw=readmemwl(easeg,(eaaddr+2)&0xFFFF); //geteaw2(); + loadseg(tempw,&_es); + tubecycles-=18; + break; + case 0xC5: /*LDS*/ + fetchea(); + regs[reg].w=readmemwl(easeg,eaaddr); + tempw=readmemwl(easeg,(eaaddr+2)&0xFFFF); + loadseg(tempw,&_ds); + if (ssegs) oldds=ds; + tubecycles-=18; + break; + case 0xC6: /*MOV b,#8*/ + fetchea(); + temp=readmembl(cs+pc); pc++; + seteab(temp); + tubecycles-=((mod==3)?4:13); + break; + case 0xC7: /*MOV w,#16*/ + fetchea(); + tempw=getword(); + seteaw(tempw); + tubecycles-=((mod==3)?4:13); + break; + case 0xC8: /*ENTER*/ + tempw3=getword(); + tempi=readmembl(cs+pc); pc++; + writememwl(ss,((SP-2)&0xFFFF),BP); SP-=2; + tempw2=SP; + if (tempi>0) + { + while (--tempi) + { + BP-=2; + tempw=readmemwl(ss,BP); + writememwl(ss,((SP-2)&0xFFFF),tempw); SP-=2; + tubecycles-=16; + } + writememwl(ss,((SP-2)&0xFFFF),tempw2); SP-=2; + } + BP=tempw2; SP-=tempw3; + tubecycles-=15; + break; + case 0xC9: /*LEAVE*/ + SP=BP; + BP=readmemwl(ss,SP); + SP+=2; + tubecycles-=8; + break; + case 0xCA: /*RETF*/ + tempw=getword(); + if (ssegs) ss=oldss; + pc=readmemwl(ss,SP); + loadcs(readmemwl(ss,SP+2)); + SP+=4; + SP+=tempw; +// cs=CS<<4; + tubecycles-=25; + break; + case 0xCB: /*RETF*/ + if (ssegs) ss=oldss; + pc=readmemwl(ss,SP); + loadcs(readmemwl(ss,SP+2)); + SP+=4; +// cs=CS<<4; + tubecycles-=22; + break; + case 0xCC: /*INT 3*/ + if (ssegs) ss=oldss; + writememwl(ss,((SP-2)&0xFFFF),flags|0xF000); + writememwl(ss,((SP-4)&0xFFFF),CS); + writememwl(ss,((SP-6)&0xFFFF),pc); + SP-=6; + addr=3<<2; + flags&=~I_FLAG; + pc=readmemwl(0,addr); + loadcs(readmemwl(0,addr+2)); + tubecycles-=45; + break; + case 0xCD: /*INT*/ + lastpc=pc; + lastcs=CS; + temp=readmembl(cs+pc); pc++; + if (temp==0xE0 && CL==0x32) rpclog("XIOS call %02X %04X:%04X\n",readmembl(ds+DX),CS,pc); +/* if (temp==0x45) + { + printf("OSFILE %02X\n",AL); + } + if ((temp&~0xF)==0x40) + { + printf("BBC INT! %02X %02X\n",temp,AL); + }*/ +// if (temp==0x10 && !AH) printf("Entering mode %02X\n",AL); +// if (temp==0x18 || temp==0x19) { printf("INT %02X\n",temp); x86output=1; } +// printf("INT %02X %04X %04X %04X %04X\n",temp,AX,BX,CX,DX); +/* if (temp==0x21) printf("INT 21 %04X %04X %04X %04X %04X:%04X %06X %06X\n",AX,BX,CX,DX,cs>>4,pc,ds,ds+DX); + if (temp==0x21 && AH==9) + { + addr=0; + while (ram[ds+DX+addr]!='$') + { + printf("%c",ram[ds+DX+addr]); + addr++; + } + printf("\n"); + printf("Called from %04X\n",readmemwl(ss,SP)); + }*/ +// x86output=0; +// if (temp==0x13 && AH==3) printf("Write sector %04X:%04X %05X\n",es>>4,BX,es+BX); +/* if (temp==0x13 && (DL==0x80 || DL==0x81) && AH>0) + { + int13hdc(); + } + else if (temp==0x13 && AH==2 && DL<2 && FASTDISC) + { + int13read(); + } + else if (temp==0x13 && AH==3 && DL<2 && FASTDISC) + { + int13write(); + } + else if (temp==0x13 && AH==4 && DL<2 && FASTDISC) + { + AH=0; + flags&=~C_FLAG; + } + else + {*/ + if (ssegs) ss=oldss; + writememwl(ss,((SP-2)&0xFFFF),flags|0xF000); + writememwl(ss,((SP-4)&0xFFFF),CS); + writememwl(ss,((SP-6)&0xFFFF),pc); + SP-=6; + addr=temp<<2; +// flags&=~I_FLAG; + pc=readmemwl(0,addr); + loadcs(readmemwl(0,addr+2)); +/* if (!pc && !cs) + { + printf("Bad int %02X %04X:%04X\n",temp,oldcs,oldpc); + x86dumpregs(); + exit(-1); + }*/ +// } + tubecycles-=47; + break; + case 0xCF: /*IRET*/ +// if (inint) printf("IRET %04X %04X:%04X\n",flags,cs>>4,pc,SP); +/* if (x86output) + { + x86dumpregs(); + exit(-1); + }*/ +// if (!inint) x86output=0; + if (ssegs) ss=oldss; + tempw=CS; + tempw2=pc; +// inint=0; + pc=readmemwl(ss,SP); + loadcs(readmemwl(ss,((SP+2)&0xFFFF))); + flags=readmemwl(ss,((SP+4)&0xFFFF))&0xFFF; + SP+=6; + tubecycles-=28; +// printf("%04X %04X\n",flags,SP); + break; + case 0xD0: + fetchea(); + temp=geteab(); + switch (rmdat&0x38) + { + case 0x00: /*ROL b,1*/ + if (temp&0x80) flags|=C_FLAG; + else flags&=~C_FLAG; + temp<<=1; + if (flags&C_FLAG) temp|=1; + seteab(temp); + if ((flags&C_FLAG)^(temp>>7)) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?2:15); + break; + case 0x08: /*ROR b,1*/ + if (temp&1) flags|=C_FLAG; + else flags&=~C_FLAG; + temp>>=1; + if (flags&C_FLAG) temp|=0x80; + seteab(temp); +// setznp8(temp); + if ((temp^(temp>>1))&0x40) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?2:15); + break; + case 0x10: /*RCL b,1*/ + temp2=flags&C_FLAG; + if (temp&0x80) flags|=C_FLAG; + else flags&=~C_FLAG; + temp<<=1; + if (temp2) temp|=1; + seteab(temp); +// setznp8(temp); + if ((flags&C_FLAG)^(temp>>7)) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?2:15); + break; + case 0x18: /*RCR b,1*/ + temp2=flags&C_FLAG; + if (temp&1) flags|=C_FLAG; + else flags&=~C_FLAG; + temp>>=1; + if (temp2) temp|=0x80; + seteab(temp); +// setznp8(temp); + if ((temp^(temp>>1))&0x40) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?2:15); + break; + case 0x20: /*SHL b,1*/ + if (temp&0x80) flags|=C_FLAG; + else flags&=~C_FLAG; + if ((temp^(temp<<1))&0x80) flags|=V_FLAG; + else flags&=~V_FLAG; + temp<<=1; + seteab(temp); + setznp8(temp); + tubecycles-=((mod==3)?2:15); + flags|=A_FLAG; + break; + case 0x28: /*SHR b,1*/ + if (temp&1) flags|=C_FLAG; + else flags&=~C_FLAG; + if (temp&0x80) flags|=V_FLAG; + else flags&=~V_FLAG; + temp>>=1; + seteab(temp); + setznp8(temp); + tubecycles-=((mod==3)?2:15); + flags|=A_FLAG; + break; + case 0x38: /*SAR b,1*/ + if (temp&1) flags|=C_FLAG; + else flags&=~C_FLAG; + temp>>=1; + if (temp&0x40) temp|=0x80; + seteab(temp); + setznp8(temp); + tubecycles-=((mod==3)?2:15); + flags|=A_FLAG; + flags&=~V_FLAG; + break; + + default: + printf("Bad D0 opcode %02X\n",rmdat&0x38); +// x86dumpregs(); +// exit(-1); + } + break; + + case 0xD1: + fetchea(); + tempw=geteaw(); + switch (rmdat&0x38) + { + case 0x00: /*ROL w,1*/ + if (tempw&0x8000) flags|=C_FLAG; + else flags&=~C_FLAG; + tempw<<=1; + if (flags&C_FLAG) tempw|=1; + seteaw(tempw); +// setznp16(tempw); + if ((flags&C_FLAG)^(tempw>>15)) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?2:15); + break; + case 0x08: /*ROR w,1*/ + if (tempw&1) flags|=C_FLAG; + else flags&=~C_FLAG; + tempw>>=1; + if (flags&C_FLAG) tempw|=0x8000; + seteaw(tempw); +// setznp16(tempw); + if ((tempw^(tempw>>1))&0x4000) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?2:15); + break; + case 0x10: /*RCL w,1*/ + temp2=flags&C_FLAG; + if (tempw&0x8000) flags|=C_FLAG; + else flags&=~C_FLAG; + tempw<<=1; + if (temp2) tempw|=1; + seteaw(tempw); + if ((flags&C_FLAG)^(tempw>>15)) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?2:15); + break; + case 0x18: /*RCR w,1*/ + temp2=flags&C_FLAG; + if (tempw&1) flags|=C_FLAG; + else flags&=~C_FLAG; + tempw>>=1; + if (temp2) tempw|=0x8000; + seteaw(tempw); +// setznp16(tempw); + if ((tempw^(tempw>>1))&0x4000) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?2:15); + break; + case 0x20: /*SHL w,1*/ + if (tempw&0x8000) flags|=C_FLAG; + else flags&=~C_FLAG; + if ((tempw^(tempw<<1))&0x8000) flags|=V_FLAG; + else flags&=~V_FLAG; + tempw<<=1; + seteaw(tempw); + setznp16(tempw); + tubecycles-=((mod==3)?2:15); + flags|=A_FLAG; + break; + case 0x28: /*SHR w,1*/ + if (tempw&1) flags|=C_FLAG; + else flags&=~C_FLAG; + if (tempw&0x8000) flags|=V_FLAG; + else flags&=~V_FLAG; + tempw>>=1; + seteaw(tempw); + setznp16(tempw); + tubecycles-=((mod==3)?2:15); + flags|=A_FLAG; + break; + + case 0x38: /*SAR w,1*/ + if (tempw&1) flags|=C_FLAG; + else flags&=~C_FLAG; + tempw>>=1; + if (tempw&0x4000) tempw|=0x8000; + seteaw(tempw); + setznp16(tempw); + tubecycles-=((mod==3)?2:15); + flags|=A_FLAG; + flags&=~V_FLAG; + break; + + default: + printf("Bad D1 opcode %02X\n",rmdat&0x38); +// x86dumpregs(); +// exit(-1); + } + break; + + case 0xD2: + fetchea(); + temp=geteab(); + c=CL&31; +// tubecycles-=c; + if (!c) break; +// if (c>7) printf("Shiftb %i %02X\n",rmdat&0x38,c); + switch (rmdat&0x38) + { + case 0x00: /*ROL b,CL*/ + while (c>0) + { + temp2=(temp&0x80)?1:0; + temp=(temp<<1)|temp2; + c--; + tubecycles--; + } + if (temp2) flags|=C_FLAG; + else flags&=~C_FLAG; + seteab(temp); +// setznp8(temp); + if ((flags&C_FLAG)^(temp>>7)) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?5:17); + break; + case 0x08: /*ROR b,CL*/ + while (c>0) + { + temp2=temp&1; + temp>>=1; + if (temp2) temp|=0x80; + c--; + tubecycles--; + } + if (temp2) flags|=C_FLAG; + else flags&=~C_FLAG; + seteab(temp); + if ((temp^(temp>>1))&0x40) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?5:17); + break; + case 0x10: /*RCL b,CL*/ +// printf("RCL %i %02X %02X\n",c,CL,temp); + while (c>0) + { + templ=flags&C_FLAG; + temp2=temp&0x80; + temp<<=1; + if (temp2) flags|=C_FLAG; + else flags&=~C_FLAG; + if (templ) temp|=1; + c--; + tubecycles--; + } +// printf("Now %02X\n",temp); + seteab(temp); + if ((flags&C_FLAG)^(temp>>7)) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?5:17); + break; + case 0x18: /*RCR b,CL*/ + while (c>0) + { + templ=flags&C_FLAG; + temp2=temp&1; + temp>>=1; + if (temp2) flags|=C_FLAG; + else flags&=~C_FLAG; + if (templ) temp|=0x80; + c--; + tubecycles--; + } +// if (temp2) flags|=C_FLAG; +// else flags&=~C_FLAG; + seteab(temp); + if ((temp^(temp>>1))&0x40) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?5:17); + break; + case 0x20: case 0x30: /*SHL b,CL*/ + if ((temp<<(c-1))&0x80) flags|=C_FLAG; + else flags&=~C_FLAG; + temp<<=c; + seteab(temp); + setznp8(temp); + tubecycles-=c; + tubecycles-=((mod==3)?5:17); + flags|=A_FLAG; + break; + case 0x28: /*SHR b,CL*/ + if ((temp>>(c-1))&1) flags|=C_FLAG; + else flags&=~C_FLAG; + temp>>=c; + seteab(temp); + setznp8(temp); + tubecycles-=c; + tubecycles-=((mod==3)?5:17); + flags|=A_FLAG; + break; + case 0x38: /*SAR b,CL*/ + if ((temp>>(c-1))&1) flags|=C_FLAG; + else flags&=~C_FLAG; + while (c>0) + { + temp>>=1; + if (temp&0x40) temp|=0x80; + c--; + tubecycles--; + } + seteab(temp); + setznp8(temp); + tubecycles-=((mod==3)?5:17); + flags|=A_FLAG; + break; + + default: + printf("Bad D2 opcode %02X\n",rmdat&0x38); +// x86dumpregs(); +// exit(-1); + } + break; + + case 0xD3: + fetchea(); + tempw=geteaw(); + c=CL&31; +// tubecycles-=c; + if (!c) break; +// if (c>15) printf("Shiftw %i %02X\n",rmdat&0x38,c); + switch (rmdat&0x38) + { + case 0x00: /*ROL w,CL*/ + while (c>0) + { + temp=(tempw&0x8000)?1:0; + tempw=(tempw<<1)|temp; + c--; + tubecycles--; + } + if (temp) flags|=C_FLAG; + else flags&=~C_FLAG; + seteaw(tempw); + if ((flags&C_FLAG)^(tempw>>15)) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?5:17); + break; + case 0x08: /*ROR w,CL*/ + while (c>0) + { + tempw2=(tempw&1)?0x8000:0; + tempw=(tempw>>1)|tempw2; + c--; + tubecycles--; + } + if (tempw2) flags|=C_FLAG; + else flags&=~C_FLAG; + seteaw(tempw); + if ((tempw^(tempw>>1))&0x4000) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?5:17); + break; + case 0x10: /*RCL w,CL*/ + while (c>0) + { + templ=flags&C_FLAG; + if (tempw&0x8000) flags|=C_FLAG; + else flags&=~C_FLAG; + tempw=(tempw<<1)|templ; + c--; + tubecycles--; + } + if (temp) flags|=C_FLAG; + else flags&=~C_FLAG; + seteaw(tempw); + if ((flags&C_FLAG)^(tempw>>15)) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?5:17); + break; + case 0x18: /*RCR w,CL*/ + while (c>0) + { + templ=flags&C_FLAG; + tempw2=(templ&1)?0x8000:0; + if (tempw&1) flags|=C_FLAG; + else flags&=~C_FLAG; + tempw=(tempw>>1)|tempw2; + c--; + tubecycles--; + } + if (tempw2) flags|=C_FLAG; + else flags&=~C_FLAG; + seteaw(tempw); + if ((tempw^(tempw>>1))&0x4000) flags|=V_FLAG; + else flags&=~V_FLAG; + tubecycles-=((mod==3)?5:17); + break; + + case 0x20: case 0x30: /*SHL w,CL*/ + if (c>16) + { + tempw=0; + flags&=~C_FLAG; + } + else + { + if ((tempw<<(c-1))&0x8000) flags|=C_FLAG; + else flags&=~C_FLAG; + tempw<<=c; + } + seteaw(tempw); + setznp16(tempw); + tubecycles-=c; + tubecycles-=((mod==3)?5:17); + flags|=A_FLAG; + break; + + case 0x28: /*SHR w,CL*/ + if ((tempw>>(c-1))&1) flags|=C_FLAG; + else flags&=~C_FLAG; + tempw>>=c; + seteaw(tempw); + setznp16(tempw); + tubecycles-=c; + tubecycles-=((mod==3)?5:17); + flags|=A_FLAG; + break; + + case 0x38: /*SAR w,CL*/ + tempw2=tempw&0x8000; + if ((tempw>>(c-1))&1) flags|=C_FLAG; + else flags&=~C_FLAG; + while (c>0) + { + tempw=(tempw>>1)|tempw2; + c--; + tubecycles--; + } + seteaw(tempw); + setznp16(tempw); + tubecycles-=((mod==3)?5:17); + flags|=A_FLAG; + break; + + default: + printf("Bad D3 opcode %02X\n",rmdat&0x38); +// x86dumpregs(); +// exit(-1); + } + break; + + case 0xD4: /*AAM*/ + tempws=readmembl(cs+pc); pc++; + AH=AL/tempws; + AL%=tempws; + setznp168(AX); + tubecycles-=19; + break; + case 0xD5: /*AAD*/ + tempws=readmembl(cs+pc); pc++; + AL=(AH*tempws)+AL; + AH=0; + setznp168(AX); + tubecycles-=15; + break; + case 0xD7: /*XLAT*/ + addr=BX+AL; + AL=readmembl(ds+addr); + tubecycles-=11; + break; + case 0xD9: case 0xDA: case 0xDB: case 0xDD: /*ESCAPE*/ + case 0xDC: case 0xDE: case 0xDF: case 0xD8: + fetchea(); + geteab(); + tubecycles-=6; + break; + + case 0xE0: /*LOOPNE*/ + offset=(signed char)readmembl(cs+pc); pc++; + CX--; + if (CX && !(flags&Z_FLAG)) { pc+=offset; tubecycles-=11; } + tubecycles-=5; + break; + case 0xE1: /*LOOPE*/ + offset=(signed char)readmembl(cs+pc); pc++; + CX--; + if (CX && (flags&Z_FLAG)) { pc+=offset; tubecycles-=11; } + tubecycles-=5; + break; + case 0xE2: /*LOOP*/ + offset=(signed char)readmembl(cs+pc); pc++; + CX--; + if (CX) { pc+=offset; tubecycles-=10; } + tubecycles-=5; + break; + case 0xE3: /*JCXZ*/ + offset=(signed char)readmembl(cs+pc); pc++; + if (!CX) { pc+=offset; tubecycles-=11; } + tubecycles-=5; + break; + + case 0xE4: /*IN AL*/ + temp=readmembl(cs+pc); pc++; + AL=inb(temp); + tubecycles-=10; + break; + case 0xE5: /*IN AX*/ + temp=readmembl(cs+pc); pc++; + AL=inb(temp); + AH=inb(temp+1); + tubecycles-=10; + break; + case 0xE6: /*OUT AL*/ + temp=readmembl(cs+pc); pc++; + outb(temp,AL); + tubecycles-=9; + break; + case 0xE7: /*OUT AX*/ + temp=readmembl(cs+pc); pc++; + outb(temp,AL); + outb(temp+1,AH); + tubecycles-=9; + break; + + case 0xE8: /*CALL rel 16*/ + tempw=getword(); + if (ssegs) ss=oldss; + writememwl(ss,((SP-2)&0xFFFF),pc); + SP-=2; + pc+=tempw; + tubecycles-=14; + break; + case 0xE9: /*JMP rel 16*/ +// printf("PC was %04X\n",pc); + pc+=getword(); +// printf("PC now %04X\n",pc); + tubecycles-=13; + break; + case 0xEA: /*JMP far*/ + addr=getword(); + tempw=getword(); + pc=addr; + loadcs(tempw); +// cs=loadcs(CS); +// cs=CS<<4; + tubecycles-=13; + break; + case 0xEB: /*JMP rel*/ + offset=(signed char)readmembl(cs+pc); pc++; + pc+=offset; + tubecycles-=13; + break; + case 0xEC: /*IN AL,DX*/ + AL=inb(DX); + tubecycles-=8; + break; + case 0xED: /*IN AX,DX*/ + AL=inb(DX); + AH=inb(DX+1); + tubecycles-=8; + break; + case 0xEE: /*OUT DX,AL*/ + outb(DX,AL); + tubecycles-=7; + break; + case 0xEF: /*OUT DX,AX*/ + outb(DX,AL); + outb(DX+1,AH); + tubecycles-=7; + break; + + case 0xF0: /*LOCK*/ + tubecycles-=4; + break; + + case 0xF2: /*REPNE*/ + rep(0); + break; + case 0xF3: /*REPE*/ + rep(1); + break; + + case 0xF4: /*HLT*/ +// printf("IN HLT!!!! %04X:%04X %08X %08X %08X\n",oldcs,oldpc,old8,old82,old83); +// x86dumpregs(); +// exit(-1); + inhlt=1; + pc--; + tubecycles-=2; + break; + case 0xF5: /*CMC*/ + flags^=C_FLAG; + tubecycles-=2; + break; + + case 0xF6: + fetchea(); + temp=geteab(); + switch (rmdat&0x38) + { + case 0x00: /*TEST b,#8*/ + temp2=readmembl(cs+pc); pc++; + temp&=temp2; + setznp8(temp); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + tubecycles-=((mod==3)?4:10); + break; + case 0x10: /*NOT b*/ + temp=~temp; + seteab(temp); + tubecycles-=((mod==3)?3:13); + break; + case 0x18: /*NEG b*/ + setsub8(0,temp); + temp=0-temp; + seteab(temp); + tubecycles-=((mod==3)?3:13); + break; + case 0x20: /*MUL AL,b*/ + setznp8(AL); + AX=AL*temp; + if (AX) flags&=~Z_FLAG; + else flags|=Z_FLAG; + if (AH) flags|=(C_FLAG|V_FLAG); + else flags&=~(C_FLAG|V_FLAG); + tubecycles-=26; + break; + case 0x28: /*IMUL AL,b*/ + setznp8(AL); + tempws=(int)((signed char)AL)*(int)((signed char)temp); + AX=tempws&0xFFFF; + if (AX) flags&=~Z_FLAG; + else flags|=Z_FLAG; + if (AH) flags|=(C_FLAG|V_FLAG); + else flags&=~(C_FLAG|V_FLAG); + tubecycles-=25; + break; + case 0x30: /*DIV AL,b*/ + tempw=AX; + if (temp) + { + tempw2=tempw%temp; +/* if (!tempw) + { + writememwl((ss+SP)-2,flags|0xF000); + writememwl((ss+SP)-4,cs>>4); + writememwl((ss+SP)-6,pc); + SP-=6; + flags&=~I_FLAG; + pc=readmemwl(0); + cs=readmemwl(2)<<4; + printf("Div by zero %04X:%04X\n",cs>>4,pc); +// x86dumpregs(); +// exit(-1); + } + else + {*/ + AH=tempw2; + tempw/=temp; + AL=tempw&0xFF; +// } + } + else + { + printf("DIVb BY 0 %04X:%04X\n",cs>>4,pc); + writememwl(ss,(SP-2)&0xFFFF,flags|0xF000); + writememwl(ss,(SP-4)&0xFFFF,CS); + writememwl(ss,(SP-6)&0xFFFF,pc); + SP-=6; + flags&=~I_FLAG; + pc=readmemwl(0,0); + loadcs(readmemwl(0,2)); +// cs=loadcs(CS); +// cs=CS<<4; +// printf("Div by zero %04X:%04X %02X %02X\n",cs>>4,pc,0xf6,0x30); +// x86dumpregs(); +// exit(-1); + } + tubecycles-=29; + break; + case 0x38: /*IDIV AL,b*/ + tempws=(int)AX; + if (temp) + { + tempw2=tempws%(int)((signed char)temp); +/* if (!tempw) + { + writememwl((ss+SP)-2,flags|0xF000); + writememwl((ss+SP)-4,cs>>4); + writememwl((ss+SP)-6,pc); + SP-=6; + flags&=~I_FLAG; + pc=readmemwl(0); + cs=readmemwl(2)<<4; + printf("Div by zero %04X:%04X\n",cs>>4,pc); + } + else + {*/ + AH=tempw2&0xFF; + tempws/=(int)((signed char)temp); + AL=tempws&0xFF; +// } + } + else + { + printf("IDIVb BY 0 %04X:%04X\n",cs>>4,pc); + writememwl(ss,(SP-2)&0xFFFF,flags|0xF000); + writememwl(ss,(SP-4)&0xFFFF,CS); + writememwl(ss,(SP-6)&0xFFFF,pc); + SP-=6; + flags&=~I_FLAG; + pc=readmemwl(0,0); + loadcs(readmemwl(0,2)); +// cs=loadcs(CS); +// cs=CS<<4; +// printf("Div by zero %04X:%04X %02X %02X\n",cs>>4,pc,0xf6,0x38); + } + tubecycles-=44; + break; + + default: + printf("Bad F6 opcode %02X\n",rmdat&0x38); +// x86dumpregs(); +// exit(-1); + } + break; + + case 0xF7: + fetchea(); + tempw=geteaw(); + switch (rmdat&0x38) + { + case 0x00: /*TEST w*/ + tempw2=getword(); + setznp16(tempw&tempw2); + flags&=~(C_FLAG|V_FLAG|A_FLAG); + tubecycles-=((mod==3)?4:10); + break; + case 0x10: /*NOT w*/ + seteaw(~tempw); + tubecycles-=((mod==3)?3:13); + break; + case 0x18: /*NEG w*/ + setsub16(0,tempw); + tempw=0-tempw; + seteaw(tempw); + tubecycles-=((mod==3)?3:13); + break; + case 0x20: /*MUL AX,w*/ + setznp16(AX); + templ=AX*tempw; + AX=templ&0xFFFF; + DX=templ>>16; + if (AX|DX) flags&=~Z_FLAG; + else flags|=Z_FLAG; + if (DX) flags|=(C_FLAG|V_FLAG); + else flags&=~(C_FLAG|V_FLAG); + tubecycles-=35; + break; + case 0x28: /*IMUL AX,w*/ + setznp16(AX); +// printf("IMUL %i %i ",(int)((signed short)AX),(int)((signed short)tempw)); + tempws=(int)((signed short)AX)*(int)((signed short)tempw); + if ((tempws>>15) && ((tempws>>15)!=-1)) flags|=(C_FLAG|V_FLAG); + else flags&=~(C_FLAG|V_FLAG); +// printf("%i ",tempws); + AX=tempws&0xFFFF; + tempws=(uint16_t)(tempws>>16); + DX=tempws&0xFFFF; +// printf("%04X %04X\n",AX,DX); +// x86dumpregs(); +// exit(-1); + if (AX|DX) flags&=~Z_FLAG; + else flags|=Z_FLAG; + tubecycles-=34; + break; + case 0x30: /*DIV AX,w*/ + templ=(DX<<16)|AX; +// printf("DIV %08X/%04X\n",templ,tempw); + if (tempw) + { + tempw2=templ%tempw; + DX=tempw2; + templ/=tempw; + AX=templ&0xFFFF; + } + else + { +// printf("DIVw BY 0 %04X:%04X\n",cs>>4,pc); +// x86dumpregs(); +// exit(-1); +// printf("%04X:%04X\n",cs>>4,pc); + writememwl(ss,(SP-2)&0xFFFF,flags|0xF000); + writememwl(ss,(SP-4)&0xFFFF,CS); + writememwl(ss,(SP-6)&0xFFFF,pc); + SP-=6; + flags&=~I_FLAG; + pc=readmemwl(0,0); + loadcs(readmemwl(0,2)); +// cs=loadcs(CS); +// cs=CS<<4; +// printf("Div by zero %04X:%04X %02X %02X 1\n",cs>>4,pc,0xf7,0x30); + } + tubecycles-=38; + break; + case 0x38: /*IDIV AX,w*/ + tempws=(int)((DX<<16)|AX); +// printf("IDIV %i %i ",tempws,tempw); + if (tempw) + { + tempw2=tempws%(int)((signed short)tempw); +// printf("%04X ",tempw2); + DX=tempw2; + tempws/=(int)((signed short)tempw); + AX=tempws&0xFFFF; + } + else + { +// printf("IDIVw BY 0 %04X:%04X\n",cs>>4,pc); +// printf("%04X:%04X\n",cs>>4,pc); + writememwl(ss,(SP-2)&0xFFFF,flags|0xF000); + writememwl(ss,(SP-4)&0xFFFF,CS); + writememwl(ss,(SP-6)&0xFFFF,pc); + SP-=6; + flags&=~I_FLAG; + pc=readmemwl(0,0); + loadcs(readmemwl(0,2)); +// cs=loadcs(CS); +// cs=CS<<4; +// printf("Div by zero %04X:%04X %02X %02X 1\n",cs>>4,pc,0xf7,0x38); + } + tubecycles-=53; + break; + + default: + printf("Bad F7 opcode %02X\n",rmdat&0x38); +// x86dumpregs(); +// exit(-1); + } + break; + + case 0xF8: /*CLC*/ + flags&=~C_FLAG; + tubecycles-=2; + break; + case 0xF9: /*STC*/ +// printf("STC %04X\n",pc); + flags|=C_FLAG; + tubecycles-=2; + break; + case 0xFA: /*CLI*/ + flags&=~I_FLAG; +// printf("CLI at %04X:%04X\n",cs>>4,pc); + tubecycles-=3; + break; + case 0xFB: /*STI*/ + flags|=I_FLAG; +// printf("STI at %04X:%04X\n",cs>>4,pc); + tubecycles-=2; + break; + case 0xFC: /*CLD*/ + flags&=~D_FLAG; + tubecycles-=2; + break; + case 0xFD: /*STD*/ + flags|=D_FLAG; + tubecycles-=2; + break; + + case 0xFE: /*INC/DEC b*/ + fetchea(); + temp=geteab(); + flags&=~V_FLAG; + if (rmdat&0x38) + { + setsub8nc(temp,1); + temp2=temp-1; + if ((temp&0x80) && !(temp2&0x80)) flags|=V_FLAG; + } + else + { + setadd8nc(temp,1); + temp2=temp+1; + if ((temp2&0x80) && !(temp&0x80)) flags|=V_FLAG; + } + seteab(temp2); + tubecycles-=((mod==3)?3:15); + break; + + case 0xFF: + fetchea(); + switch (rmdat&0x38) + { + case 0x00: /*INC w*/ + tempw=geteaw(); + setadd16nc(tempw,1); +// setznp16(tempw+1); + seteaw(tempw+1); + tubecycles-=((mod==3)?3:15); + break; + case 0x08: /*DEC w*/ + tempw=geteaw(); + setsub16nc(tempw,1); + seteaw(tempw-1); + tubecycles-=((mod==3)?3:15); + break; + case 0x10: /*CALL*/ + tempw=geteaw(); + if (ssegs) ss=oldss; + writememwl(ss,(SP-2)&0xFFFF,pc); + SP-=2; + pc=tempw; + tubecycles-=((mod==3)?13:19); + break; + case 0x18: /*CALL far*/ +/* if (CS==0x6012 && pc==0x15EE) + { + rpclog("Mouse trap!\n"); + getmousepos(&AX,&CX,&DX); + }*/ + tempw=readmemwl(easeg,eaaddr); + tempw2=readmemwl(easeg,(eaaddr+2)&0xFFFF); //geteaw2(); +// printf("Call FAR %04X:%04X %04X:%04X\n",CS,pc,tempw2,tempw); + tempw3=CS; + tempw4=pc; + if (ssegs) ss=oldss; + pc=tempw; + loadcs(tempw2); + writememwl(ss,(SP-2)&0xFFFF,tempw3); + writememwl(ss,((SP-4)&0xFFFF),tempw4); + SP-=4; + tubecycles-=38; + break; + case 0x20: /*JMP*/ + pc=geteaw(); + tubecycles-=((mod==3)?17:11); + break; + case 0x28: /*JMP far*/ + pc=readmemwl(easeg,eaaddr); //geteaw(); + loadcs(readmemwl(easeg,(eaaddr+2)&0xFFFF)); //geteaw2(); +// cs=loadcs(CS); +// cs=CS<<4; + tubecycles-=26; + break; + case 0x30: /*PUSH w*/ + tempw=geteaw(); +// if (x86output) printf("PUSH %04X %i %02X %04X %04X %02X %02X\n",tempw,rm,rmdat,easeg,eaaddr,ram[0x22340+0x5638],ram[0x22340+0x5639]); + if (ssegs) ss=oldss; + writememwl(ss,((SP-2)&0xFFFF),tempw); + SP-=2; + tubecycles-=((mod==3)?10:16); + break; + + default: + break; +// printf("Bad FF opcode %02X\n",rmdat&0x38); +// x86dumpregs(); +// exit(-1); + } + break; + + default: + pc++; + tubecycles-=8; +/* if (!AT) + { + pc++; + tubecycles-=8; + } + else + {*/ +// printf("Bad opcode %02X at %04X:%04X from %04X:%04X %08X\n",opcode,cs>>4,pc,old8>>16,old8&0xFFFF,old82); +// x86dumpregs(); +// exit(-1); +// } + break; + + pc--; + tubecycles-=8; + break; + printf("Bad opcode %02X at %04X:%04X from %04X:%04X %08X\n",opcode,cs>>4,pc,old8>>16,old8&0xFFFF,old82); + x86dumpregs(); + exit(-1); + } + pc&=0xFFFF; +// if (CS==0x1490 && pc==0x3BBA) rpclog("Here from %04X:%04X %08X %02X\n",oldcs,oldpc,old8,opcode); + +// if (CS==0x6012 && pc==3) rpclog("XIOS direct call %02X %04X %04X %04X %04X\n",AL,CX,DX,BX,SI); + +/* if (!CS && !pc) + { + printf("At zero!\n"); + x86dumpregs(); + exit(-1); + }*/ + + if (tube_irq&2) + { + //tube_irq&=~2; +// printf("Let's do DMA! %i\n",tube_irq); + x86_dma(); + } +/* if (tube_irq&2 && !x86oldnmi && ram[4]) + { + if (inhlt) pc++; + if (AT) writememwl(ss,(SP-2)&0xFFFF,flags&~0xF000); + else writememwl(ss,(SP-2)&0xFFFF,flags|0xF000); + writememwl(ss,(SP-4)&0xFFFF,CS); + writememwl(ss,(SP-6)&0xFFFF,pc); + SP-=6; + temp=2; + addr=temp<<2; + flags&=~I_FLAG; + pc=readmemwl(0,addr); + loadcs(readmemwl(0,addr+2)); + } + x86oldnmi=tube_irq&2;*/ + + if (ssegs) + { + ds=oldds; + ss=oldss; + ssegs=0; + } + cycdiff-=tubecycles; + +x86ins++; +//if (x86ins==65300000) x86output=1; + if ((flags&I_FLAG) && !ssegs && (tube_irq&1)) + { + if (inhlt) pc++; + writememwl(ss,(SP-2)&0xFFFF,flags|0xF000); + writememwl(ss,(SP-4)&0xFFFF,CS); + writememwl(ss,(SP-6)&0xFFFF,pc); + SP-=6; + temp=12; + addr=temp<<2; + flags&=~I_FLAG; + pc=readmemwl(0,addr); + loadcs(readmemwl(0,addr+2)); +// inint=1; + } + +/* if (pc==0xCC32 && es>0x180000) + { + pc=0xCBEB; +// x86output=1; +// timetolive=500000; + }*/ + +// if (noint) noint=0; +// ins++; + } +} +//#endif diff --git a/src/x86.h b/src/x86.h index 0a345aca..7e8ffae8 100644 --- a/src/x86.h +++ b/src/x86.h @@ -1,107 +1,107 @@ -uint32_t oldpc; -int oldcpl; - -int lldt; - -#define setznp168 setznp16 - -#define getr8(r) ((r&4)?regs[r&3].b.h:regs[r&3].b.l) - -#define setr8(r,v) if (r&4) regs[r&3].b.h=v; \ - else regs[r&3].b.l=v; - -int use32; -int stack32; - -#define fetchea() { rmdat=readmembl(cs+pc); pc++; \ - reg=(rmdat>>3)&7; \ - mod=rmdat>>6; \ - rm=rmdat&7; \ - if (mod!=3) fetcheal(); } - - -int optype; -#define JMP 1 -#define CALL 2 -#define IRET 3 - -uint32_t oxpc; - -#define EAX regs[0].l -#define ECX regs[1].l -#define EDX regs[2].l -#define EBX regs[3].l -#define ESP regs[4].l -#define EBP regs[5].l -#define ESI regs[6].l -#define EDI regs[7].l -#define AX regs[0].w -#define CX regs[1].w -#define DX regs[2].w -#define BX regs[3].w -#define SP regs[4].w -#define BP regs[5].w -#define SI regs[6].w -#define DI regs[7].w -#define AL regs[0].b.l -#define AH regs[0].b.h -#define CL regs[1].b.l -#define CH regs[1].b.h -#define DL regs[2].b.l -#define DH regs[2].b.h -#define BL regs[3].b.l -#define BH regs[3].b.h - -typedef union -{ - uint32_t l; - uint16_t w; - struct - { - uint8_t l,h; - } b; -} x86reg; - -static x86reg regs[8]; -static uint16_t flags; -static uint32_t oldds,oldss,x86pc; - -typedef struct -{ - uint32_t base; - uint16_t limit; - uint8_t access; - uint16_t seg; -} x86seg; - -x86seg gdt,ldt,idt,tr; -x86seg _cs,_ds,_es,_ss,_fs,_gs; - -/*Segments - - _cs,_ds,_es,_ss are the segment structures - CS,DS,ES,SS is the 16-bit data - cs,ds,es,ss are defines to the bases*/ -//uint16_t CS,DS,ES,SS; -#define CS _cs.seg -#define DS _ds.seg -#define ES _es.seg -#define SS _ss.seg -#define FS _fs.seg -#define GS _gs.seg -#define cs _cs.base -#define ds _ds.base -#define es _es.base -#define ss _ss.base -#define fs _fs.base -#define gs _gs.base - -#define C_FLAG 0x0001 -#define P_FLAG 0x0004 -#define A_FLAG 0x0010 -#define Z_FLAG 0x0040 -#define N_FLAG 0x0080 -#define I_FLAG 0x0200 -#define D_FLAG 0x0400 -#define V_FLAG 0x0800 -#define NT_FLAG 0x4000 -#define VM_FLAG 0x0002 /*In EFLAGS*/ +uint32_t oldpc; +int oldcpl; + +int lldt; + +#define setznp168 setznp16 + +#define getr8(r) ((r&4)?regs[r&3].b.h:regs[r&3].b.l) + +#define setr8(r,v) if (r&4) regs[r&3].b.h=v; \ + else regs[r&3].b.l=v; + +int use32; +int stack32; + +#define fetchea() { rmdat=readmembl(cs+pc); pc++; \ + reg=(rmdat>>3)&7; \ + mod=rmdat>>6; \ + rm=rmdat&7; \ + if (mod!=3) fetcheal(); } + + +int optype; +#define JMP 1 +#define CALL 2 +#define IRET 3 + +uint32_t oxpc; + +#define EAX regs[0].l +#define ECX regs[1].l +#define EDX regs[2].l +#define EBX regs[3].l +#define ESP regs[4].l +#define EBP regs[5].l +#define ESI regs[6].l +#define EDI regs[7].l +#define AX regs[0].w +#define CX regs[1].w +#define DX regs[2].w +#define BX regs[3].w +#define SP regs[4].w +#define BP regs[5].w +#define SI regs[6].w +#define DI regs[7].w +#define AL regs[0].b.l +#define AH regs[0].b.h +#define CL regs[1].b.l +#define CH regs[1].b.h +#define DL regs[2].b.l +#define DH regs[2].b.h +#define BL regs[3].b.l +#define BH regs[3].b.h + +typedef union +{ + uint32_t l; + uint16_t w; + struct + { + uint8_t l,h; + } b; +} x86reg; + +static x86reg regs[8]; +static uint16_t flags; +static uint32_t oldds,oldss,x86pc; + +typedef struct +{ + uint32_t base; + uint16_t limit; + uint8_t access; + uint16_t seg; +} x86seg; + +x86seg gdt,ldt,idt,tr; +x86seg _cs,_ds,_es,_ss,_fs,_gs; + +/*Segments - + _cs,_ds,_es,_ss are the segment structures + CS,DS,ES,SS is the 16-bit data + cs,ds,es,ss are defines to the bases*/ +//uint16_t CS,DS,ES,SS; +#define CS _cs.seg +#define DS _ds.seg +#define ES _es.seg +#define SS _ss.seg +#define FS _fs.seg +#define GS _gs.seg +#define cs _cs.base +#define ds _ds.base +#define es _es.base +#define ss _ss.base +#define fs _fs.base +#define gs _gs.base + +#define C_FLAG 0x0001 +#define P_FLAG 0x0004 +#define A_FLAG 0x0010 +#define Z_FLAG 0x0040 +#define N_FLAG 0x0080 +#define I_FLAG 0x0200 +#define D_FLAG 0x0400 +#define V_FLAG 0x0800 +#define NT_FLAG 0x4000 +#define VM_FLAG 0x0002 /*In EFLAGS*/ diff --git a/src/x86_tube.h b/src/x86_tube.h index cab4b335..ddaaccd9 100644 --- a/src/x86_tube.h +++ b/src/x86_tube.h @@ -1,4 +1,4 @@ -void x86_init(); -void x86_reset(); -void x86_exec(); -void x86_close(); +void x86_init(); +void x86_reset(); +void x86_exec(); +void x86_close(); diff --git a/src/z80.h b/src/z80.h index 889d3343..85ba1af7 100644 --- a/src/z80.h +++ b/src/z80.h @@ -1,4 +1,4 @@ -void z80_init(); -void z80_reset(); -void z80_exec(); -void z80_close(); +void z80_init(); +void z80_reset(); +void z80_exec(); +void z80_close();