pax_global_header00006660000000000000000000000064151016201150014502gustar00rootroot0000000000000052 comment=86208f505e581a739f2dda724d495bfddd2a9c7d sidplayfp-2.15.2/000077500000000000000000000000001510162011500135645ustar00rootroot00000000000000sidplayfp-2.15.2/.github/000077500000000000000000000000001510162011500151245ustar00rootroot00000000000000sidplayfp-2.15.2/.github/workflows/000077500000000000000000000000001510162011500171615ustar00rootroot00000000000000sidplayfp-2.15.2/.github/workflows/build.yml000066400000000000000000000010271510162011500210030ustar00rootroot00000000000000name: CI on: push: branches: - master - sidplayfp-2.15 pull_request: branches: - master - sidplayfp-2.15 permissions: contents: read pull-requests: write jobs: build: runs-on: ubuntu-latest steps: - name: deps run: sudo apt-get install gettext libsidplayfp-dev libstilview-dev libmpg123-dev - uses: actions/checkout@v4 - name: bootstrap run: autoreconf -vfi - name: configure run: ./configure - name: make distcheck run: make distcheck sidplayfp-2.15.2/.github/workflows/codeql.yml000066400000000000000000000031551510162011500211570ustar00rootroot00000000000000# name: "CodeQL" on: push: branches: - master - sidplayfp-2.15 pull_request: branches: - master - sidplayfp-2.15 jobs: analyze: name: Analyze runs-on: ubuntu-latest permissions: actions: read contents: read security-events: write strategy: fail-fast: false matrix: language: [ 'cpp', 'actions' ] steps: - name: deps run: sudo apt-get install gettext libsidplayfp-dev libstilview-dev libmpg123-dev - name: Checkout repository uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild uses: github/codeql-action/autobuild@v3 # â„šī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun # If the Autobuild fails above, remove it and uncomment the following three lines. # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. # - run: | # echo "Run, Build Application using script" # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}" sidplayfp-2.15.2/.github/workflows/release.yml000066400000000000000000000014651510162011500213320ustar00rootroot00000000000000name: Release on: release: types: [published] permissions: contents: write jobs: build: runs-on: ubuntu-latest steps: - name: deps run: sudo apt-get install gettext libsidplayfp-dev libstilview-dev - uses: actions/checkout@v4 with: ref: ${{ github.ref }} - name: bootstrap run: autoreconf -vfi - name: configure run: ./configure - name: make dist id: package-generator run: | make dist RELEASE_TARBALL=$(ls sidplayfp-*.tar.gz) echo "filename=${RELEASE_TARBALL}" >> $GITHUB_OUTPUT - name: Upload to release uses: JasonEtco/upload-to-release@master with: args: ${{ steps.package-generator.outputs.filename }} application/gzip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} sidplayfp-2.15.2/.github/workflows/windows-binary.yml000066400000000000000000000051531510162011500226640ustar00rootroot00000000000000name: Build Windows Release on: release: types: [published] permissions: contents: write jobs: build: runs-on: windows-latest defaults: run: shell: msys2 {0} strategy: matrix: include: - { sys: MINGW32, env: i686, arch: i686, flag: --with-simd=mmx, name: 32bit-mmx } - { sys: MINGW64, env: x86_64, arch: x86-64, flag: --with-simd=sse4, name: 64bit-sse4 } - { sys: UCRT64, env: ucrt-x86_64, arch: x86-64, flag: --with-simd=avx2, name: 64bit-avx2 } steps: - uses: msys2/setup-msys2@v2 with: msystem: ${{matrix.sys}} update: true install: >- git zip upx base-devel mingw-w64-${{matrix.env}}-toolchain mingw-w64-${{matrix.env}}-autotools - uses: dsaltares/fetch-gh-release-asset@master with: repo: 'libsidplayfp/libsidplayfp' regex: true file: "libsidplayfp-.*\\.tar\\.gz" target: 'subdir/' - name: build-lib run: | cd subdir export LDFLAGS="-s -Wl,-no-undefined -Wl,-O1 -static" export CXXFLAGS="-O2 -march=${{matrix.arch}} -fomit-frame-pointer -pipe -DUNICODE" export PKG_CONFIG="pkg-config --static" tar -xf libsidplayfp*.tar.gz cd libsidplayfp*/. ./configure --disable-dependency-tracking --disable-shared --enable-static --without-gcrypt --enable-hardsid ${{matrix.flag}} make && make install - uses: actions/checkout@v4 with: ref: ${{ github.ref }} - name: Get the tag name id: get_tag_name run: echo "tagname=${GITHUB_REF#refs/tags/}" | sed 's/v//' >> $GITHUB_OUTPUT - name: build run: | export LDFLAGS="-s -Wl,-no-undefined -Wl,-O1 -static" export CXXFLAGS="-O2 -march=${{matrix.arch}} -fomit-frame-pointer -pipe -DUNICODE" export PKG_CONFIG="pkg-config --static" autoreconf -vfi ./configure --disable-dependency-tracking make mv src/*.exe . strip *.exe upx *.exe pod2text doc/en/sidplayfp.ini.pod > sidplayfp.ini.txt pod2text doc/en/sidplayfp.pod > sidplayfp.txt pod2text doc/en/stilview.pod > stilview.txt zip sidplayfp-${{ steps.get_tag_name.outputs.tagname }}-${{matrix.name}}.zip *.exe README AUTHORS *.txt - uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: sidplayfp-${{ steps.get_tag_name.outputs.tagname }}-${{matrix.name}}.zip tag: ${{ github.ref }} file_glob: true overwrite: true sidplayfp-2.15.2/.gitignore000066400000000000000000000004401510162011500155520ustar00rootroot00000000000000aclocal.m4 autom4te.cache build-aux/* !build-aux/config.rpath configure configure~ config.log config.status Makefile Makefile.in src/config.h.in .deps .dirstamp *.o *.la *.lo src/config.h src/config.h.in~ src/stamp-h1 doc/en/*.1 doc/en/*.5 sidplayfp-*.tar.gz src/sidplayfp* src/stilview* sidplayfp-2.15.2/AUTHORS000066400000000000000000000034341510162011500146400ustar00rootroot00000000000000sidplayfp is a console C64 music player which uses the libsidplayfp engine to provide the best SID listening experience. Copyright (c) 2000 Simon White Copyright (c) 2007-2010 Antti Lankila Copyright (c) 2010-2025 Leandro Nini This version of the freely available sidplayfp player source code contains the following contributed or derived work. In the order they first supplied contributions or code was derived from their work: Simon White - Majority of SIDPLAY2 code Michael Schwendt - Sid2Wav support, OSS/Free and SPARC audio drivers Rainer Sinsch - help with the DirectX drivers Jarno Paananen - 16 bit mixer code, Windows MMSYSTEM Drivers Antti Lankila - Pulse Audio driver Leandro Nini - build system changes, port to libsidplayfp minor improvements LaLa - stilview Stian Skjelstad - SID status display Michael Hartmann - filter curves Credit where credit is due, so if I missed anyone please let me know. ----------------------------------------------------------------------------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA sidplayfp-2.15.2/COPYING000066400000000000000000000432541510162011500146270ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. sidplayfp-2.15.2/Makefile.am000066400000000000000000000047211510162011500156240ustar00rootroot00000000000000 ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = foreign subdir-objects if MINGW32 W32_CPPFLAGS = -DWIN32_LEAN_AND_MEAN W32_LIBS = -lshlwapi endif if USE_LIBOUT123 OUT123_SOURCES = \ src/audio/out123/audiodrv.cpp \ src/audio/out123/audiodrv.h endif if USE_ICONV ICONV_SOURCES = \ src/codepages.h endif AM_CPPFLAGS = \ -I $(top_builddir)/src \ -I $(top_srcdir)/src \ -DPKGDATADIR="\"$(pkgdatadir)/\"" \ $(SIDPLAYFP_CFLAGS) \ $(STILVIEW_CFLAGS) \ $(ALSA_CFLAGS) \ $(PULSE_CFLAGS) \ $(OUT123_CFLAGS) \ ${W32_CPPFLAGS} \ @debug_flags@ bin_PROGRAMS = \ src/sidplayfp \ src/stilview #========================================================= # sidplayfp src_sidplayfp_SOURCES = \ src/IniConfig.cpp \ src/IniConfig.h \ src/args.cpp \ src/dataParser.h \ src/keyboard.cpp \ src/keyboard.h \ src/main.cpp \ src/menu.cpp \ src/mixer.cpp \ src/mixer.h \ src/player.cpp \ src/player.h \ src/setting.h \ src/sidcxx11.h \ src/sidlib_features.h \ src/utils.cpp \ src/utils.h \ src/codeConvert.cpp \ src/codeConvert.h \ $(ICONV_SOURCES) \ src/audio/AudioBase.h \ src/audio/AudioConfig.h \ src/audio/AudioDrv.cpp \ src/audio/AudioDrv.h \ src/audio/IAudio.h \ src/audio/alsa/audiodrv.cpp \ src/audio/alsa/audiodrv.h \ src/audio/au/auFile.cpp \ src/audio/au/auFile.h \ src/audio/directx/audiodrv.cpp \ src/audio/directx/audiodrv.h \ src/audio/mmsystem/audiodrv.cpp \ src/audio/mmsystem/audiodrv.h \ src/audio/null/null.cpp \ src/audio/null/null.h \ src/audio/oss/audiodrv.cpp \ src/audio/oss/audiodrv.h \ $(OUT123_SOURCES) \ src/audio/pulse/audiodrv.cpp \ src/audio/pulse/audiodrv.h \ src/audio/wav/WavFile.cpp \ src/audio/wav/WavFile.h \ src/ini/iniHandler.h \ src/ini/iniHandler.cpp \ src/ini/sidfstream.h \ src/ini/types.h src_sidplayfp_LDADD = \ $(LIBICONV) \ $(AUDIO_LDFLAGS) \ $(SIDPLAYFP_LIBS) \ $(BUILDERS_LDFLAGS) \ $(ALSA_LIBS) \ $(PULSE_LIBS) \ $(OUT123_LIBS) \ $(W32_LIBS) #========================================================= # stilview src_stilview_SOURCES = \ src/codeConvert.cpp \ src/codeConvert.h \ $(ICONV_SOURCES) \ src/stilview.cpp src_stilview_LDADD = \ $(LIBICONV) \ $(STILVIEW_LIBS) #========================================================= # docs EXTRA_DIST = \ doc/en/sidplayfp.pod \ doc/en/sidplayfp.ini.pod \ doc/en/stilview.pod dist_man_MANS = \ doc/en/sidplayfp.1 \ doc/en/sidplayfp.ini.5 \ doc/en/stilview.1 DISTCLEANFILES = $(dist_man_MANS) .pod.1: @mkdir -p $(@D) pod2man -c "User Programs" -s 1 $< > $@ .pod.5: @mkdir -p $(@D) pod2man -c "File formats" -s 5 $< > $@ sidplayfp-2.15.2/README000066400000000000000000000045151510162011500144510ustar00rootroot00000000000000sidplayfp ========= https://github.com/libsidplayfp/sidplayfp sidplayfp is a console C64 music player which uses the libsidplayfp engine to provide the best SID listening experience. Copyright (c) 2000 Simon White Copyright (c) 2007-2010 Antti Lankila Copyright (c) 2010-2025 Leandro Nini stilview ======== STILView is a command-line driven program to help you retrieve the entries stored in STIL fast and accurately. Copyright (c) 1998, 2002 by LaLa Copyright (c) 2013-2017 Leandro Nini ----------------------------------------------------------------------------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ----------------------------------------------------------------------------- Documentation ------------- https://github.com/libsidplayfp/sidplayfp/wiki ----------------------------------------------------------------------------- NOTE: ----- ROM dumps are not embedded but must be supplied by the user. The ROMs are optional and most tunes should work fine without but compatibility is not guaranteed. Check the sidplayfp.ini documentation for configuration details and default search paths. ----------------------------------------------------------------------------- * Build This package uses autotools so the usual ./configure && make is enough to build the libraries. If cloning the bare sources the package need to be bootstrapped in advance with the autoreconf -vfi command. In addition to the standard build options the following are available: --enable-debug compile with debugging messages disabled by default --with-out123 Build with out123 library providing support for additional audio interfaces enabled by default sidplayfp-2.15.2/TODO000066400000000000000000000002431510162011500142530ustar00rootroot00000000000000TODO: * drop audio drivers and use out123 * support unicode filenames on Windows (depends on libsidplayfp) * add playlist support (pls) * fix building on Cygwin sidplayfp-2.15.2/build-aux/000077500000000000000000000000001510162011500154565ustar00rootroot00000000000000sidplayfp-2.15.2/build-aux/config.rpath000066400000000000000000000003551510162011500177660ustar00rootroot00000000000000# Hello, this is a bogus file just to avoid automake complaining for a missing file. # It is not needed anyway. # The issue arises due to the use of AM_ICONV without AM_GNU_GETTEXT. # Ideally we should go with the Gnulib module 'iconv'. sidplayfp-2.15.2/configure.ac000066400000000000000000000101341510162011500160510ustar00rootroot00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT([sidplayfp], [2.15.2], [], [], [https://github.com/libsidplayfp/sidplayfp/]) AC_CONFIG_SRCDIR([src/main.cpp]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([src/config.h]) AM_INIT_AUTOMAKE AC_CANONICAL_HOST case "$host" in *mingw* ) MINGW32=yes ;; *darwin* ) MACOSX=yes ;; esac AM_CONDITIONAL([MINGW32], [test "x$MINGW32" = "xyes"]) AC_PROG_RANLIB dnl Checks for programs. AC_PROG_CXX dnl Use C++ for tests. AC_LANG([C++]) AX_CXX_COMPILE_STDCXX([20], [noext], [optional]) AS_IF([test $ax_cv_cxx_compile_cxx20__std_cpp20 != "yes"], [ AX_CXX_COMPILE_STDCXX([17], [noext], [optional]) AS_IF([test $ax_cv_cxx_compile_cxx17__std_cpp17 != "yes"], [ AX_CXX_COMPILE_STDCXX([14], [noext], [optional]) AS_IF([test $ax_cv_cxx_compile_cxx14__std_cpp14 != "yes"], [AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])] ) ]) ]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_BIGENDIAN AM_ICONV AM_CONDITIONAL([USE_ICONV], [test "x$am_cv_func_iconv" = "xyes"]) dnl Audio subsystem AUDIO_LDFLAGS="" PKG_CHECK_MODULES(ALSA, [alsa >= 1.0], [AC_DEFINE([HAVE_ALSA], 1, [Define to 1 if you have libasound (-lasound).])], [AC_MSG_WARN([$ALSA_PKG_ERRORS])] ) PKG_CHECK_MODULES(PULSE, [libpulse-simple >= 1.0], [AC_DEFINE([HAVE_PULSE], 1, [Define to 1 if you have libpulse-simple (-lpulse-simple).])], [AC_MSG_WARN([$PULSE_PKG_ERRORS])] ) dnl Checks what version of Unix we have and soundcard support AC_CHECK_HEADERS([sys/ioctl.h linux/soundcard.h machine/soundcard.h sys/soundcard.h soundcard.h]) AC_CHECK_HEADERS([dsound.h mmsystem.h], [], [], [#include ]) AS_IF([test "$ac_cv_header_dsound_h" = "yes"], [AUDIO_LDFLAGS="$AUDIO_LDFLAGS -ldsound -ldxguid"] ) AS_IF([test "$ac_cv_header_mmsystem_h" = "yes"], [AUDIO_LDFLAGS="$AUDIO_LDFLAGS -lwinmm"] ) # NetBSD/OpenBSD OSS audio emulation AS_IF([test "x$ac_cv_header_soundcard_h" = "xyes"], [AUDIO_LDFLAGS="$AUDIO_LDFLAGS -lossaudio"] ) AC_SUBST(AUDIO_LDFLAGS) PKG_CHECK_MODULES(SIDPLAYFP, [libsidplayfp >= 2.0]) PKG_CHECK_MODULES(STILVIEW, [libstilview >= 1.0]) USE_LIBOUT123=no AC_ARG_WITH([out123], AS_HELP_STRING([--with-out123], [Build with out123 library (default: enabled)])) AS_IF([test "x$with_out123" != "xno"], [PKG_CHECK_MODULES([OUT123], [libout123 >= 1.0], [USE_LIBOUT123=yes AC_DEFINE([HAVE_OUT123], [1], [Use libout123])], [USE_LIBOUT123=no] )] ) AM_CONDITIONAL([USE_LIBOUT123], [test "x$USE_LIBOUT123" = "xyes"]) # check for builders PKG_CHECK_VAR([SIDPLAYPF_INCLUDE], [libsidplayfp], [includedir]) AC_MSG_CHECKING([for $SIDPLAYPF_INCLUDE/sidplayfp/builders/residfp.h]) AS_IF([test -f $SIDPLAYPF_INCLUDE/sidplayfp/builders/residfp.h], [AC_DEFINE([HAVE_SIDPLAYFP_BUILDERS_RESIDFP_H], [1], [residfp builder]) AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])] ) AC_MSG_CHECKING([for $SIDPLAYPF_INCLUDE/sidplayfp/builders/resid.h]) AS_IF([test -f $SIDPLAYPF_INCLUDE/sidplayfp/builders/resid.h], [AC_DEFINE([HAVE_SIDPLAYFP_BUILDERS_RESID_H], [1], [resid builder]) AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])] ) AC_MSG_CHECKING([for $SIDPLAYPF_INCLUDE/sidplayfp/builders/hardsid.h]) AS_IF([test -f $SIDPLAYPF_INCLUDE/sidplayfp/builders/hardsid.h], [AC_DEFINE([HAVE_SIDPLAYFP_BUILDERS_HARDSID_H], [1], [hardsid builder]) AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])] ) AC_MSG_CHECKING([for $SIDPLAYPF_INCLUDE/sidplayfp/builders/exsid.h]) AS_IF([test -f $SIDPLAYPF_INCLUDE/sidplayfp/builders/exsid.h], [AC_DEFINE([HAVE_SIDPLAYFP_BUILDERS_EXSID_H], [1], [exsid builder]) AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])] ) AC_MSG_CHECKING([whether to build for debugging]) AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], [compile for debugging @<:@no/yes, default=no@:>@])], [], [enable_debug=no]) AS_IF([test "x$enable_debug" = "xno"], [AC_MSG_RESULT([no]); debug_flags=-DNDEBUG], [AC_MSG_RESULT([yes])], ) AC_SUBST([debug_flags]) AC_CONFIG_FILES([ Makefile ]) AC_OUTPUT sidplayfp-2.15.2/doc/000077500000000000000000000000001510162011500143315ustar00rootroot00000000000000sidplayfp-2.15.2/doc/en/000077500000000000000000000000001510162011500147335ustar00rootroot00000000000000sidplayfp-2.15.2/doc/en/USAGE.txt000066400000000000000000000602131510162011500163420ustar00rootroot00000000000000STILVIEW v2.17 USER'S MANUAL ============================ Copyright (C) 1998, 2002 by LaLa URL: http://lala.c64.org CONTENTS ======== [1] Overview [2] Glossary [3] Command-line options [4] Examples [1] OVERVIEW ------------ STILView is a command-line driven program to help you retrieve the entries stored in STIL fast and accurately. STILView uses the STIL C++ class heavily to do this, and in fact, the primary purpose of this command-line program is to test that class (which is, BTW, used in many GUI-based SID players, most notably in SIDPlay for Windows and XSIDPLAY for Unix systems). However, it is user-friendly enough to be used by non-programmers, too. To create the executable version of STILView, simply run "make" on your machine, and it should compile a runnable version of STILView. I am not sure about what other people do, but I use this command-line STILView primarily as a tool under Solaris 2.6 to print out the STIL information for a SID file I am listening to with the UNIX command-line version of SIDPlay... [2] GLOSSARY ------------ Some terms and STIL-related lingo in alphabetical order: --- BUG ENTRY - There exists a special file in HVSC (/DOCUMENTS/BUGlist.txt) that lists all known bugs in SID tunes in HVSC. See the top of that file for details about what's in it exactly. A BUG entry is like a STIL entry, but it is contained in this BUGlist.txt file. --- FIELD - The smallest piece of information in a STIL entry. Currently valid field names are NAME, TITLE, ARTIST and COMMENT. --- FILE-GLOBAL COMMENT - A special COMMENT field in a STIL entry for a multi-tune SID file that refers to the whole SID, not just one tune in it. These usually contain general information about the SID file itself. Example: /Hubbard_Rob/Gerry_the_Germ.sid COMMENT: In Rob's own demo of this music, the tunes are named after the levels in the original game. (#1) TITLE: Lungs (#2) TITLE: Kidney (#7) TITLE: End --- HVSC - High Voltage SID Collection. If you don't know what this is, you downloaded the wrong program. :) --- HVSC-RELATIVE PATHNAME - The pathname plus filename of a SID file that can be found in your HVSC, relative to the base directory of HVSC. It is always in UNIX-style format, eg.: /Hubbard_Rob/Commando.sid refers to Rob Hubbard's Commando.sid file within HVSC (which may actually be found as C:\Music\HVSC\Hubbard_Rob\Commando.sid on your Windows PC). --- MULTI-TUNE ENTRY - A STIL entry that is referring to a SID file that has many tunes in it. Each tune might have its own STIL block, which are separated by a so-called tune designation in the form of "(#x)", where x = the tune number. Consult the STIL.FAQ in HVSC for a detailed description. Example: /Hubbard_Rob/Gerry_the_Germ.sid COMMENT: In Rob's own demo of this music, the tunes are named after the levels in the original game. (#1) TITLE: Lungs (#2) TITLE: Kidney (#7) TITLE: End --- SECTION - A part of STIL that belongs to one composer (ie. every STIL entry referring to SID files that are in one subdirectory in HVSC). Sections in STIL are always separated by a line in the form of: "### Composer's name ########". --- SECTION-GLOBAL COMMENT - A special STIL entry that refers not to an individual SID file, but to a whole subdirectory. These usually contain info about the composer himself, or about all the SID file he/she ever composed, and are always indexed in the form of "/Subdir/" (note the trailing slash!). Example: /Hubbard_Rob/ COMMENT: All of these tunes have been confirmed by Hubbard to be his. People have often stolen Hubbard's routine causing some tunes to be falsely credited to him. Hubbard's own comments are denoted by (RH). --- SINGLE-TUNE ENTRY - A STIL entry that has no tune designation in it in the form of "(#x)", where x is a number. (Note, that a single-tune entry might still refer to a SID file which has many tunes in it, ie. when a single-tune entry has nothing but a COMMENT field in it!) Example: /Hubbard_Rob/Chain_Reaction.sid TITLE: Zoolook (remix) [from Zoolook] ARTIST: Jean Michel Jarre Another example (the SID this is refering to has many tunes in it!): /Barrett_Steve/Magic_Land_Dizzy.sid COMMENT: Also used in the game "Wacky Darts" (c) 1990 Codemasters. --- STIL - SID Tune Information List, essentially a text-file database that can be found in your HVSC in the /DOCUMENTS/ subdirectory. --- STIL ENTRY - All of the pieces of information in STIL relating to one SID file of the HVSC. They are always indexed by the HVSC-relative pathname. --- TUNE - One of the compositions in a SID. Most SID files have only one tune in them, but many have more than one (eg. one for the title score of the game, and one for the hi-score music). --- [3] COMMAND-LINE OPTIONS ------------------------ NOTE #1: Running STILView with no options defined at all on the command line will print out a brief help. NOTE #2: You can combine any or all of the options below on a single line. However, certain options conflict with each other - these are noted where appropriate. NOTE #3: The examples below assume that the HVSC_BASE environment variable is set to a valid HVSC directory. You might have to specify the -l option for the examples below to have them work on your machine. ---- -b : Do *not* print BUG entries Default value: Not specified (ie. do print BUG entries) Example: stilview -e=/Hubbard_Rob/Commando.sid -b When this option is specified, BUG entries will not be printed for the given SID tune. At a minimum, the -e option has to be specified for this option to work. --- -d : Debug mode on Default value: Not specified (ie. debug mode is off) Example: stilview -e=/Hubbard_Rob/Commando.sid -d Turns on debug mode in STILView. This will result in an extensive output, with the debugging messages going to STDERR. If you encounter any problem or strange behavior with STILView, run STILView with the exact same options as you did when you encountered the problem, with this -d option added to them. Capture the complete output of this run, and send it to me with a detailed explanation of the problem (see email address at the top of this file). --- -e= : STIL entry requested Default: NONE (you have to give an HVSC-relative pathname to this option) Example #1: stilview -e=/Hubbard_Rob/Commando.sid Example #2: stilview -e=/Hubbard_Rob/ This is where you specify the STIL entry you are looking for, given as an HVSC-relative pathname. If there exists no STIL entry for the given filename, STILView will print out nothing. Otherwise, you'll get the STIL entry (or parts of it, as you may have specified it by other options). HVSC-relative pathnames are case-insensitive, so /HUBBARD_ROB/Commando.sid is the same as /Hubbard_Rob/Commando.sid. Example #1 is the most frequent way of retrieving STIL entries, and it will return all of the STIL entry for Commando.sid, as well as the section-global comment for /Hubbard_Rob/. Example #2 is another valid thing to do: this will return only the section-global comment for /Hubbard_Rob/. --- -h : Help Default: NONE Example: stilview -h Prints a brief help screen listing the available options. All other options that are also specified on the command-line are ignored. --- -f= : STIL field requested Default: all Valid values for are: all, name, author, title, artist, comment Example #1: stilview -l -e=/Hubbard_Rob/Delta.sid -f=comment Example #2: stilview -l -e=/Hubbard_Rob/Delta.sid -t=1 -f=title Example #3: stilview -l -e=/Hubbard_Rob/Delta.sid -t=12 -f=all -s -b Asks for one particular field in a STIL entry. Combined with the -t option, these two options can retrieve any portion of a STIL entry, including a single field in a specific subtune's entry. Below is full and complete explanation of what the different possible combinations of the -t and -f options retrieve: -t=0 -f=all : All of the STIL entry is printed. -t=0 -f=comment : The file-global comment is printed. For single-tune entries that have nothing but a COMMENT field in them, this prints that COMMENT. For single-tune entries that have other fields in them, this prints nothing. (This is because single-tune entries with nothing but a COMMENT field are assumed to be file-global comments.) -t=0 -f= : Nothing is printed. This combination of these options is invalid. -t= -f=all : (Where x is anything but 0.) All fields from the portion of the STIL entry for the given tune number are printed. For single-tune entries, asking for -t=1 -f=all is equivalent to saying -t=0 -f=all, since by definition, the whole entry refers to only one tune. (However, specifying -t with any other number than 1 will print nothing!) Note that if there's a file-global comment in the STIL entry (which also means that if a single-tune entry has nothing but a COMMENT field in it), that is *not* printed with these combinations of options. -t= -f= : (Where x is anything but 0.) The specific field from the portion of the STIL entry for the given tune number is printed. For single-tune entries that have nothing but a COMMENT in them, this returns nothing. Of course, if the STIL entry or any portion of it asked with these options does not exist, STILView will print nothing. Also, unless otherwise specified with the -o, -s and -b options, the section-global comment and the BUG entry of the given SID file will also get printed (provided they exist). In example #1, the file-global comment for /Hubbard_Rob/Delta.sid is printed, since -t is not specified and is assumed to be 0. Also printed are the section- global comment and the BUG entry for the same SID file (if they exist). In example #2, the TITLE field of the STIL entry for tune #1 of /Hubbard_Rob/Delta.sid is printed along with the section-global comment and the BUG entry for the same SID file (if they exist). In example #3, all of the STIL entry for tune #12 of /Hubbard_Rob/Delta.sid is printed, but nothing else. --- -i : Interactive mode Default: NONE Example: stilview -i Starts STILView in interactive mode, ignoring all other options specified on the command-line, except -l, -d and -m. In interactive mode, you can look for STIL entries by typing them in. You will get prompted for the desired STIL entry (which has to be specified with an HVSC-relative pathname), for the tune number requested (which should be any non-negative number, but this is not enforced), and finally for the specific STIL field you want to retrieve. --- -l= : Location of the HVSC base directory Default: The value of the HVSC_BASE environment variable Example #1: stilview -l=C:\Music\HVSC\ -e=/Hubbard_Rob/Commando.sid Example #2: stilview -l=../HVSC/ =-e=/Hubbard_Rob/Commando.sid Example #3: stilview -l -e=/Hubbard_Rob/Commando.sid This is where you tell STILView where it can find the HVSC base directory (the path to the directory has to be specified in the form required by your operating system, eg. C:\Music\HVSC under Windows, /home/lala/HVSC under UNIX). STILView will then try to locate the STIL.txt file in the /DOCUMENTS/ subdirectory of that directory. If this option is not specified (or if -l is specified without a base directory), STILView will try to extract the path of the HVSC base directory from the HVSC_BASE environment variable. If that environment variable doesn't exist or is pointing to a location where there's no STIL.txt file in a DOCUMENTS directory, STILView fails. If the HVSC_BASE environment variable exists and is valid, and this option is specified, the directory specified with this option is used as the HVSC base directory instead of the environment variable. In example #1 the HVSC base directory is located in C:\Music\HVSC\ on the hard drive of a Windows PC, in example #2 it is located in the HVSC directory of the current directory's parent directory of a UNIX system. In example #3 the HVSC base directory is not specified with the option, so it is assumed that the HVSC_BASE environment variable contains the path to it. In reality, specifying the -l option in example #3 is redundant, and can be omitted. --- -m : Demo mode Default: NONE Example #1: stilview -m Example #2: stilview -e=/Hubbard_Rob/Commando.sid -m -i When specified, it prints out a whole bunch of things that a) test most of the functionality of STILView, and b) show what STILView is capable of retrieving from STIL. In example #1, the demo is printed with the STIL info coming from a default STIL entry, then STILView quits. In example #2, the demo is printed taking the STIL info from the specified STIL entry of /Hubbard_Rob/Commando.sid (instead of the default SID file), then interactive mode is entered. --- -o : Do *not* print STIL entries Default value: Not specified (ie. do print STIL entries) Example #1: stilview -e=/Hubbard_Rob/Delta.sid -o Example #2: stilview -e=/Hubbard_Rob/Delta.sid -o -s When this option is specified, STIL entries will not be printed for the given SID tune (but section-global entries and BUG entries will be printed, provided they exist and other options did not turn their output off). At a minimum, the -e option has to be specified for this option to work. Example #1 will print out the section-global comment and the BUG entry for /Hubbard_Rob/Delta.sid, example #2 will print out just the section-global comment for the same SID. --- -s : Do *not* print section-global comments Default value: Not specified (ie. do print section-global entries) Example: stilview -e=/Hubbard_Rob/Delta.sid -s When this option is specified, section-global entries will not be printed for the given SID tune. At a minimum, the -e option has to be specified for this option to work. --- -t= : Tune number requested Default value: 0 Example #1: stilview -e=/Hubbard_Rob/Commando.sid -t=0 Example #2: stilview -e=/Hubbard_Rob/Delta.sid -t=1 -f=title -s -b Example #3: stilview -e=/Hubbard_Rob/Delta.sid -t=12 Asks for the portion of a STIL entry referring to one particular tune. If tune number 0 is given, it retrieves all of the entry. Combined with the -f option, these two options can retrieve any portion of a STIL entry, including a single field in a specific subtune's entry. For further details about this option, see the explanation of the -f option. Example #1 retrieves all of the STIL entry for /Hubbard_Rob/Commando.sid, including the section-global comment and the BUG entry (if any), but since the default value for this option is 0, it might as well be omitted in this example. Example #2 retrieves only the TITLE field of the first subtune's entry for /Hubbard_Rob/Delta.sid (and not the section- global comment or the BUG entry), while example #3 retrieves all of the STIL entry for tune #12 of the same SID file (including the section-global comment and the BUG entry, if any). --- -v : Print version numbers Default value: Not specified (ie. do *not* print version numbers) Example #1: stilview -v Example #2: stilview -e=/Hubbard_Rob/Commando.sid -v When this option is specified, the version number of the STILView program and the version number of the STIL.txt file used by it is printed out. In example #1 this is the only piece of info that gets printed on the screen, in example #2 the version numbers are printed out, then the STIL entry for /Hubbard_Rob/Commando.sid is also printed out. --- [4] EXAMPLES ------------ All of the examples below assume that the HVSC_BASE environment is set to a valid HVSC base directory (where the $HVSC_BASE/DOCUMENTS/STIL.txt and $HVSC_BASE/DOCUMENTS/BUGlist.txt files exist), and the examples also assume the presence of the following entries in these files: --- In STIL.txt --- /Hubbard_Rob/ COMMENT: All of these tunes have been confirmed by Hubbard to be his. People have often stolen Hubbard's routine causing some tunes to be falsely credited to him. /Hubbard_Rob/Action_Biker.sid COMMENT: "Action B was a very early game and very conservative in it's approach - it was my idea of giving them what I thought they wanted, a simple cute tune....." (RH) /Hubbard_Rob/Commando.sid COMMENT: Tunes #1 and #3 have been converted from arcade version. /Hubbard_Rob/Delta.sid COMMENT: According to Hubbard, Kentilla and Delta were the most complicated one to compose, they took the longest time to do and they both drove him insane. (#1) TITLE: On the Run [from the Dark Side of the Moon] ARTIST: Pink Floyd COMMENT: It is more inspired by it than a remix of it. (#12) TITLE: Koyaanisqatsi [from the movie] ARTIST: Philip Glass COMMENT: "Inspired by Philip Glass and Pink Floyd." (RH) /Hubbard_Rob/International_Karate.sid TITLE: Merry Christmas, Mr. Lawrence [from the movie] (0:42-1:16) ARTIST: Ryuichi Sakamoto COMMENT: "[...] I started exploring pentatonic things in B flat minor over different bass notes, B flat, D flat, G flat and A flat. The middle section went into F (I think) at double tempo to liven things up. I was pleased with the tune......" (RH) /Hubbard_Rob/Rasputin.sid (#1) TITLE: Katjusha (0:07-0:36) ARTIST: Matvei Blanter, M. Isakovski TITLE: Katjusha (2:20) ARTIST: Matvei Blanter, M. Isakovski TITLE: Kaljinka (2:41-2:51) ARTIST: Traditional COMMENT: Russian folk song. TITLE: Kaljinka (3:12-3:22) ARTIST: Traditional COMMENT: Russian folk song. (#2) COMMENT: Russian folk song. --- In BUGlist.txt --- /Hubbard_Rob/Commando.sid BUG: This is just for demo. /Hubbard_Rob/Delta.sid (#12) BUG: Demo entry. --- Given these entries, following are the printouts you can expect from STILView. ($> denotes a command-line prompt given by your operating system.) Everything related to a SID file is printed: $> stilview -e=/Hubbard_Rob/Commando.sid ---- GLOBAL COMMENT ---- COMMENT: All of these tunes have been confirmed by Hubbard to be his. People have often stolen Hubbard's routine causing some tunes to be falsely credited to him. ------ STIL ENTRY ------ COMMENT: Tunes #1 and #3 have been converted from arcade version. ---------- BUG ---------- BUG: This is just for demo. $> Ask for just the section-global comment: $> stilview -e=/Hubbard_Rob/ /Hubbard_Rob/ COMMENT: All of these tunes have been confirmed by Hubbard to be his. People have often stolen Hubbard's routine causing some tunes to be falsely credited to him. $> Note that this can also be retrieved with: $> stilview -e=/Hubbard_Rob/Commando.sid -o -b COMMENT: All of these tunes have been confirmed by Hubbard to be his. People have often stolen Hubbard's routine causing some tunes to be falsely credited to him. $> This prints out nothing, as single-tune entries do not have file-global comments: $> stilview -e=/Hubbard_Rob/International_Karate.sid -t=0 -f=comment -s -b $> ...Except if the only field in them is a COMMENT (in which case that comment is assumed to be a file-global comment): $> stilview -e=/Hubbard_Rob/Action_Biker.sid -t=0 -f=comment -s -b COMMENT: "Action B was a very early game and very conservative in it's approach - it was my idea of giving them what I thought they wanted, a simple cute tune....." (RH) $> Also note that single-tune entries have only one tune, so asking for the STIL entry of tune #3 is pointless: $> stilview -e=/Hubbard_Rob/International_Karate.sid -t=3 -s -b $> Print out the file-global comment for the given SID file: $> stilview -e=/Hubbard_Rob/Delta.sid -t=0 -f=comment -s -b COMMENT: According to Hubbard, Kentilla and Delta were the most complicated one to compose, they took the longest time to do and they both drove him insane. $> Print out the ARTIST field of tune #12 of the given SID file, plus print out everything else related to the SID file: $> stilview -e=/Hubbard_Rob/Delta.sid -t=12 -f=artist ---- GLOBAL COMMENT ---- COMMENT: All of these tunes have been confirmed by Hubbard to be his. People have often stolen Hubbard's routine causing some tunes to be falsely credited to him. ------ STIL ENTRY ------ ARTIST: Philip Glass ---------- BUG ---------- BUG: Demo entry. $> Note that the current version of STILView is capable to retrieve only the first specified field of a tune that covers multiple songs! See below: $> stilview -e=/Hubbard_Rob/Rasputin.sid -t=1 -f=title -s TITLE: Katjusha (0:07-0:36) $> Section-global comments are printed out even if the STIL entry for the given SID file does not exist: $> stilview -e=/Hubbard_Rob/This_doesnt_exist.sid COMMENT: All of these tunes have been confirmed by Hubbard to be his. People have often stolen Hubbard's routine causing some tunes to be falsely credited to him. $> The following 4 steps depict how to have STILView print out everything related to a given SID file's given tune number one by one: 1) This prints out just the section-global comment: $> stilview -e=/Hubbard_Rob/Delta.sid -o -b COMMENT: All of these tunes have been confirmed by Hubbard to be his. People have often stolen Hubbard's routine causing some tunes to be falsely credited to him. $> 2) This prints out just the file-global comment: $> stilview -e=/Hubbard_Rob/Delta.sid -t=0 -f=comment -s -b COMMENT: According to Hubbard, Kentilla and Delta were the most complicated one to compose, they took the longest time to do and they both drove him insane. $> 3) This prints out all of the STIL entry for the given tune number: $> stilview -e=/Hubbard_Rob/Delta.sid -t=12 -f=all -s -b TITLE: Koyaanisqatsi [from the movie] ARTIST: Philip Glass COMMENT: "Inspired by Philip Glass and Pink Floyd." (RH) $> 4) And this prints out just the BUG entry for the same tune number: $> stilview -e=/Hubbard_Rob/Delta.sid -t=12 -s -o BUG: Demo entry. $> The following 3 steps depict how to have STILView print out everything related to a given SID file: 1) This prints out just the section-global comment: $> stilview -e=/Hubbard_Rob/Delta.sid -o -b COMMENT: All of these tunes have been confirmed by Hubbard to be his. People have often stolen Hubbard's routine causing some tunes to be falsely credited to him. $> 2) This prints out all of the STIL entry: $> stilview -e=/Hubbard_Rob/Delta.sid -s -b COMMENT: "[...] The Delta music loader and ingame music was Gary Liddon's idea. [...] He was the producer at Thalamus at the time. He told Rob Hubbard to make the ingame music like the 2nd track from Dark Side of the Moon by Pink Floyd." (Info from Matt Furniss.) "The small jingles are all small clips from Sanxion and Romeo/Juliet music. They were all supposed to be for short stingers such as end of level, extra life etc..." "Delta was based on this minimalist composition technique inspired by Glass and a bit of Pink Floyd. It was quite hard too do and required some custom code to the driver to do it. The music was tedious to debug. The other Delta stuff was more conventional - I quite liked the other tunes. Delta was spread over a 2 week period....." (RH) According to Hubbard, Kentilla and Delta were the most complicated one to compose, they took the longest time to do and they both drove him insane. (#1) TITLE: On the Run [from the Dark Side of the Moon] ARTIST: Pink Floyd COMMENT: It is more inspired by it than a remix of it. (#12) TITLE: Koyaanisqatsi [from the movie] ARTIST: Philip Glass COMMENT: "Inspired by Philip Glass and Pink Floyd." (RH) $> 3) And this prints out all of the BUG entry: $> stilview -e=/Hubbard_Rob/Delta.sid -s -o (#12) BUG: Demo entry. $> --- If you have any questions or if you encounter any problems with STILView, do not hesitate to contact me: LaLa URL: http://lala.c64.org sidplayfp-2.15.2/doc/en/sidplayfp.ini.pod000066400000000000000000000175561510162011500202260ustar00rootroot00000000000000īģŋ=encoding utf8 =head1 NAME sidplayfp.ini - Configuration file for L. =head1 DESCRIPTION This page describes the options available for the configuration file of Sidplayfp. It is composed by a number of sections, each one composed by a section name, enclosed by square brackets, followed by a list of = lines. B supports the following sections: B<[SIDPlayfp]> - Generic configuration B<[Console]> - Console appearance configuration B<[Audio]> - Audio output configuration B<[Emulation]> - Emulation engine parameters All options and values are described in detail below. For any of the following parameter, if it's specified more than one time the last entry encountered will be used. B: if any of these options is specified outside its section, it will be I. =head2 SIDPlayfp =over =item B=I<< >> Configuration version =item B=I<< >> Full path for the Songlength DB. By default the program will look for a file named F under the HVSC collection path, if the HVSC_BASE environment variable is defined. On *NIX systems, if this value is not set, L will try F<$PREFIX/share/sidplayfp/Songlengths.txt>. =item B=I Default play time if Songlength Database is not found. =item B=I Default recording time when writing wave files if Songlength Database is not found. =item B=I<< >> Full path for the Kernal Rom file. This is the most important ROM and should always be provided, although many tunes will still work without. By default the program will look for a file named F under the following locations: =over =item * $XDG_DATA_HOME/sidplayfp/ on *NIX systems where XDG_DATA_HOME is defined. =item * $HOME/.local/share/sidplayfp/ on *NIX systems where XDG_DATA_HOME is not defined. =item * $PREFIX/share/sidplayfp on *NIX systems when not found in the above directories. =item * %CSIDL_APPDATA%\\sidplayfp\\ on Windows systems where CSIDL_APPDATA is defined. =item * %USERPROFILE%\\Application Data\\sidplayfp\\ on Windows systems where CSIDL_APPDATA is not defined. =back =item B=I<< >> Full path for the Basic Rom file. This is mostly useful for playing BASIC tunes. By default the program will look for a file named F under the same locations as above. =item B=I<< >> Full path for the Character generator Rom file. Almost useless for playback of tunes, but included for completeness. By default the program will look for a file named F under the same locations as above. =item B=I<< >> Verbosity level, 0 = low, 1 = normal, >1 = high. Default is 0 =back =head2 Console =over =item B=I Use ANSI escape sequences to provide colored output. =item B=I<< >> Character for the top left corner. =item B=I<< >> Character for the top right corner. =item B=I<< >> Character for the bottom left corner. =item B=I<< >> Character for the bottom right corner. =item B=I<< >> Character for vertical lines. =item B=I<< >> Character for horizontal lines. =item B=I<< >> Character for left junctions. =item B=I<< >> Character for right junctions. =back =head2 Audio =over =item B=I<< >> Playback frequency expressed in Hertz. Default is 48000. =item B=I<< >> Number of channels, 1 for mono and 2 for stereo playback. Default is 1 for standard tunes and 2 for multi SID tunes. =item B=I<< <16|32> >> Number of bits ber sample, used only for wav/au output. Using values other than the ones specified will produce invalid output. =item B=I<< >> Length of the buffer in milliseconds, default is 250. Increase if you experience audio problems or reduce to improve latency. =back =head2 Emulation =over =item B=I<< >> Set the SID emulation engine. Default is RESIDFP. =item B=I<< >> Default C64 model to use if not specified by tune, PAL for european PAL-B model, NTSC for american/japanese NTSC-M models, OLD_NTSC for NTSC-M models with old video chip and DREAN for argentinian PAL-N model. Default is PAL. =item B=I Force the configured C64 model even if the tune specifies one. =item B=I<< >> Select CIA chip model, old MOS 6526 or newer MOS 8521. =item B=I<< >> Default SID chip model, old MOS 6581 or newer MOS 8580. =item B=I Force the configured SID chip model even if the tune specifies one. =item B=I Enable digiboost for 8580 model. =item B=I Enable/disable the emulation of the SID filter. =item B=I<< >> Controls the filter bias in the ReSID emulation. Ranges from 0.0 (dark) to 1.0 (light), the default value is 0.5. =item B=I<< >> Controls the filter curve for the 6581 model in the ReSIDfp emulation. Ranges from 0.0 (light) to 1.0 (dark), the default value is 0.5. =item B=I<< >> Controls the filter uCox parameter for the 6581 model in the ReSIDfp emulation. Ranges from 0.0 (dark) to 1.0 (bright), the default value is 0.5. =item B=I<< >> Controls the filter curve for the 8580 model in the ReSIDfp emulation. Ranges from 0.0 (light) to 1.0 (dark), the default value is 0.5. =item B=I<< >> Controls the combined waveforms strength in the ReSIDfp emulation. The default value is AVERAGE. =item B=I<< >> The C64 power on delay in number of CPU cycles. If greater than 8191 the delay will be random. =item B=I<< >> Set resampling mode: Interpolation (less expensive) or resampling (accurate). =item B=I<< >> Fast resampling, available only for reSID emulation. =back =head1 SEE ALSO L =head1 AUTHORS =over =item Leandro Nini Current maintainer. =item Simon White Wrote the original Sidplay2. =item Dag Lem Wrote the reSID emulation engine. =item Antti S. Lankila Wrote the reSIDfp emulation engine as a fork of reSID 0.16. =item The Vice team Large part of the emulation is based on the VICE's code. =item AndrÊ Fachat Wrote the original reloc65 utility. =item Michael Schwendt Wrote the original SidTune library and MD5 class (based on work by L. Peter Deutsch). =item Mikko Kilponen Wrote the original man page. =back =head1 RESOURCES =over =item Home page: L =item Sidplay2 homepage: L =item High Voltage Sid Collection (HVSC): L =back =head1 COPYING =over =item Copyright (C) 2000-2004 Simon White =item Copyright (C) 2007-2010 Antti Lankila =item Copyright (C) 2009-2015 VICE Project =item Copyright (C) 2010-2024 Leandro Nini =back This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You 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. sidplayfp-2.15.2/doc/en/sidplayfp.pod000066400000000000000000000214741510162011500174420ustar00rootroot00000000000000īģŋ=encoding utf8 =head1 NAME sidplayfp - a C64 and SID chip emulator for playing Commodore 64 music. =head1 SYNOPSIS B [I] I =head1 DESCRIPTION B is a music player that emulates various components from a Commodore 64 (C64) computer. The result is a program which can load and execute C64 machine code programs which produce music and sound. Sidplayfp has been designed for accuracy which results in a quite high CPU usage. Additional playback modes have, however, been provided to allow playback on low-spec machines at the cost of said accuracy. =head1 OPTIONS =over =item B<-h, --help> Display help. =item B<-h, --help-debug> Display additional options helpful for debugging. =item B<-fo>I<< >> Set fade-out time in seconds (default: 0). The fade-out starts at the song end so this adds the specified number of seconds to the tune length. =item B<-f>I<< >> Set audio output frequency in Hz (default: 48000). =item B<-nf> No filter emulation. This will reduce CPU overhead at the cost of reduced emulation quality. =item B<-s> Stereo playback. If the tune is identified as stereo then sid 1 and 2 become the left and right channels respectively. For three sid tunes the chips are mixed as left, center and right. =item B<-m> Mono playback. =item B<-v|q>[level] Verbose or quiet (no time display) console output while playing. Can include an optional level, defaults to 1. =item B<-b>I<< >> Set start time in [mins:]secs[.milli] format (compatible with sid2wav). =item B<-ds>I<< >> Force dual sid environment by adding a second chip at specified address. This forces emulation of 2 sid-chips for stereo playback even if datafile is identified as only being mono. This occurs in the case of the stereo prg format as currently there is no way to identify them. Stereo MUS and SID files are however automatically detected. The second sid may be installed in the 0xD420-0xD7FF or 0xDE00-0xDFFF address range. Address may be specified in exadecimal (e.g -ds0xd420) or decimal (e.g. -ds54304) format. =item B<-ts>I<< >> Add a third chip at specified address. The sid may be installed in the 0xD420-0xD7FF or 0xDE00-0xDFFF address range. Address may be specified in exadecimal (e.g -ts0xd440) or decimal (e.g. -ts54336) format. =item B<-u>I<< >> Mute a channel. May be used more than one time. Channel 1 to 3 are for the first SID chip while channels from 4 to 6 are for the second one and 7 to 9 for the third. =item B<-g>I<< >> Mute samples. May be used more than one time, 1 for the first SID, 2 for the second one and 3 for the third. =item B<-p>I<< >> Set bit precision for file saving. The default is 16 to create 16 bit signed samples, but can be set to 32 (32 bit float). Other values will cause invalid output. =item B<-o>I<< >> Select start track number (default: preset). =item B<-o>I<< [num] >> Option 'l' will select continuous track looping while 's' will play only the current track ignoring the others. The options can be combined and may include the track selection. The following variations are possible: -ol: will loop selected track allowing moving to another one; -os: will play selected track and then stop; -ols: will loop selected track; =item B<-t>I<< >> Set play length in [mins:]secs[.milli] format (0 is endless). =item B<-v>I<< [f] >> Set VIC clock speed. 'n' is NTSC (America, 60Hz) and 'p' is PAL (Europe, 50Hz). Providing an 'f' will prevent speed fixing that tries to compensate automatically for the speed difference. Removing speed fixing simulates what happens on a real C64. Options can be written as: -vnf or -vn -vf. =item B<-m>I<< [f] >> Set SID chip model. 'o' is the old 6581 and 'n' is the new 8580. Providing an 'f' will force the selected model overriding the one specified by the tune. =item B<--digiboost> Enable digiboost hack for 8580 model so the digi samples become audible. =item B<-r>I<< [f] >> Set resampling mode. 'i' is interpolation (less expensive) and 'r' resampling (accurate). Providing an 'f' will provide faster resampling sacrificing quality. Fast resampling is available only for reSID emulation. Options can be written as: -rif or -ri -rf. =item B<-w, --wav>I<< [name] >> Create WAV-file. The default output filename is [n].wav where [n] is the tune number should there be more than one in the sid. This allows batch conversion of sid tunes without them overwriting each other. By providing a name it is possible to override this default behavior. The output file will be with no tune number added and the extension .wav appended if no extension is given. =item B<--au>I<< [name] >> Create AU-file. The default output filename is [n].au. Same notes as the wav file applies. =item B<--resid> Use VICE's original reSID emulation engine. =item B<--residfp> Use reSIDfp emulation engine. =item B<--hardsid> Use HardSID device. =item B<--exsid> Use exSID device. =item B<--cpu-debug> Display CPU register and assembly dumps, available only for debug builds. =item B<--delay=>I<< [num] >> Simulate C64 power on delay as number of CPU cycles. If greater than 8191 the delay will be random. This is the default. =item B<--fcurve=>I<< |auto >> Controls the filter curve in the ReSIDfp emulation. Ranges from 0.0 (light) to 1.0 (dark), the default value is 0.5. If set to auto it will choose a predefined value for 6581 depending on the tune author. =item B<--frange=>I<< |auto >> If available controls the filter range for the 6581 in the ReSIDfp emulation. Ranges from 0.0 (light) to 1.0 (dark), the default value is 0.5. If set to auto it will choose a predefined value for 6581 depending on the tune author. =item B<-cw>I<< >> Set the strength (width) of combined waveforms. 'w' for weak (thin) waves, 'a' for average waves, and 's' for strong (wide) waves. =item B<--noaudio> Run without an audio output device. =item B<--nosid> Run without sid emulation. =item B<--none> Run with no audio output device and no sid emulation. =back =head1 Key bindings =over =item 1-9 Mute/unmute voice. =item q,w,e Mute/unmute samples. =item f Toggle filter. =item p Pause/unpause playback. =item Esc Quit player. =item Up/Down Arrows Increase/reset playback speed. =item Left/Right Arrows Move to previous/next subtune. =item Home/End Arrows Go to first/last subtune. =back =head1 ENVIRONMENT VARIABLES =over =item B The path to the HVSC base directory. If specified the songlength DB will be loaded from here and relative SID tune paths are accepted. =back =head1 FILES =over =item F The configuration file. See L for further details. =item F The C64 Kernal ROM dump file. =item F The C64 BASIC ROM dump file. =item F The C64 Character Generator ROM dump file. =back =head1 BUGS The upstream bug tracker can be found at L. =head1 SEE ALSO L =head1 NOTES ROM dumps are not embedded due to copyright issues and must be supplied by the user. Check the L documentation for configuration details and default search paths. =head1 AUTHORS =over =item Leandro Nini Current maintainer. =item Simon White Wrote the original Sidplay2. =item Dag Lem Wrote the reSID emulation engine. =item Antti S. Lankila Wrote the reSIDfp emulation engine as a fork of reSID 0.16. =item The Vice team Large part of the emulation is based on the VICE's code. =item AndrÊ Fachat Wrote the original reloc65 utility. =item Michael Schwendt Wrote the original SidTune library and MD5 class (based on work by L. Peter Deutsch). =item Mikko Kilponen Wrote the original man page. =back =head1 RESOURCES =over =item Home page: L =item Sidplay2 homepage: L =item High Voltage Sid Collection (HVSC): L =back =head1 COPYING =over =item Copyright (C) 2000-2004 Simon White =item Copyright (C) 2007-2010 Antti Lankila =item Copyright (C) 2009-2015 VICE Project =item Copyright (C) 2010-2024 Leandro Nini =back This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You 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. sidplayfp-2.15.2/doc/en/stilview.pod000066400000000000000000000606631510162011500173200ustar00rootroot00000000000000īģŋ=encoding utf8 =head1 NAME stilview - command-line program to help you retrieve the entries stored in STIL. =head1 SYNOPSIS B [-b] [-d] [-e entry] [-f field] [-i] [-l HVSC base dir] [-m] [-o] [-s] [-t tune number] B {[-h] | [-v]} =head1 DESCRIPTION B is a command-line driven program to help you retrieve the entries stored in STIL fast and accurately. STILView uses the STIL C++ class heavily to do this, and in fact, the primary purpose of this command-line program is to test that class (which is, BTW, used in many GUI-based SID players, most notably in SIDPlay for Windows and XSIDPLAY for Unix systems). However, it is user-friendly enough to be used by non-programmers, too. =head1 GLOSSARY Some terms and STIL-related lingo in alphabetical order: =over =item B There exists a special file in HVSC (F) that lists all known bugs in SID tunes in HVSC. See the top of that file for details about what's in it exactly. A BUG entry is like a STIL entry, but it is contained in this BUGlist.txt file. =item B The smallest piece of information in a STIL entry. Currently valid field names are NAME, TITLE, ARTIST and COMMENT. =item B A special COMMENT field in a STIL entry for a multi-tune SID file that refers to the whole SID, not just one tune in it. These usually contain general information about the SID file itself. Example: /Hubbard_Rob/Gerry_the_Germ.sid COMMENT: In Rob's own demo of this music, the tunes are named after the levels in the original game. (#1) TITLE: Lungs (#2) TITLE: Kidney (#7) TITLE: End =item B High Voltage SID Collection. If you don't know what this is, you downloaded the wrong program. :) =item B The pathname plus filename of a SID file that can be found in your HVSC, relative to the base directory of HVSC. It is always in UNIX-style format, eg.: /Hubbard_Rob/Commando.sid refers to Rob Hubbard's Commando.sid file within HVSC (which may actually be found as C:\Music\HVSC\Hubbard_Rob\Commando.sid on your Windows PC). =item B A STIL entry that is referring to a SID file that has many tunes in it. Each tune might have its own STIL block, which are separated by a so-called tune designation in the form of "(#x)", where x = the tune number. Consult the STIL.FAQ in HVSC for a detailed description. Example: /Hubbard_Rob/Gerry_the_Germ.sid COMMENT: In Rob's own demo of this music, the tunes are named after the levels in the original game. (#1) TITLE: Lungs (#2) TITLE: Kidney (#7) TITLE: End =item B
A part of STIL that belongs to one composer (ie. every STIL entry referring to SID files that are in one subdirectory in HVSC). Sections in STIL are always separated by a line in the form of: "### Composer's name ########". =item B A special STIL entry that refers not to an individual SID file, but to a whole subdirectory. These usually contain info about the composer himself, or about all the SID file he/she ever composed, and are always indexed in the form of "/Subdir/" (note the trailing slash!). Example: /Hubbard_Rob/ COMMENT: All of these tunes have been confirmed by Hubbard to be his. People have often stolen Hubbard's routine causing some tunes to be falsely credited to him. Hubbard's own comments are denoted by (RH). =item B A STIL entry that has no tune designation in it in the form of "(#x)", where x is a number. (Note, that a single-tune entry might still refer to a SID file which has many tunes in it, ie. when a single-tune entry has nothing but a COMMENT field in it!) Example: /Hubbard_Rob/Chain_Reaction.sid TITLE: Zoolook (remix) [from Zoolook] ARTIST: Jean Michel Jarre Another example (the SID this is refering to has many tunes in it!): /Barrett_Steve/Magic_Land_Dizzy.sid COMMENT: Also used in the game "Wacky Darts" (c) 1990 Codemasters. =item B SID Tune Information List, essentially a text-file database that can be found in your HVSC in the /DOCUMENTS/ subdirectory. =item B All of the pieces of information in STIL relating to one SID file of the HVSC. They are always indexed by the HVSC-relative pathname. =item B One of the compositions in a SID. Most SID files have only one tune in them, but many have more than one (eg. one for the title score of the game, and one for the hi-score music). =back =head1 OPTIONS =over =item B<-b> Do B print BUG entries Default value: Not specified (ie. do print BUG entries) Example: C When this option is specified, BUG entries will not be printed for the given SID tune. At a minimum, the -e option has to be specified for this option to work. =item B<-d> Default value: Not specified (ie. debug mode is off) Example: C Turns on debug mode in STILView. This will result in an extensive output, with the debugging messages going to STDERR. If you encounter any problem or strange behavior with STILView, run STILView with the exact same options as you did when you encountered the problem, with this -d option added to them. Capture the complete output of this run, and send it to me with a detailed explanation of the problem (see email address at the top of this file). =item B<-e>=I Default: NONE (you have to give an HVSC-relative pathname to this option) Example #1: C Example #2: C This is where you specify the STIL entry you are looking for, given as an HVSC-relative pathname. If there exists no STIL entry for the given filename, STILView will print out nothing. Otherwise, you'll get the STIL entry (or parts of it, as you may have specified it by other options). HVSC-relative pathnames are case-insensitive, so /HUBBARD_ROB/Commando.sid is the same as /Hubbard_Rob/Commando.sid. Example #1 is the most frequent way of retrieving STIL entries, and it will return all of the STIL entry for Commando.sid, as well as the section-global comment for /Hubbard_Rob/. Example #2 is another valid thing to do: this will return only the section-global comment for /Hubbard_Rob/. =item B<-h> Default: NONE Example: stilview -h Prints a brief help screen listing the available options. All other options that are also specified on the command-line are ignored. =item B<-f>=I Default: all Valid values for are: all, name, author, title, artist, comment Example #1: C Example #2: C Example #3: C Asks for one particular field in a STIL entry. Combined with the -t option, these two options can retrieve any portion of a STIL entry, including a single field in a specific subtune's entry. Below is full and complete explanation of what the different possible combinations of the -t and -f options retrieve: C<-t=0 -f=all> : All of the STIL entry is printed. C<-t=0 -f=comment> : The file-global comment is printed. For single-tune entries that have nothing but a COMMENT field in them, this prints that COMMENT. For single-tune entries that have other fields in them, this prints nothing. (This is because single-tune entries with nothing but a COMMENT field are assumed to be file-global comments.) C<< -t=0 -f= >> : Nothing is printed. This combination of these options is invalid. C<< -t= -f=all >> : (Where x is anything but 0.) All fields from the portion of the STIL entry for the given tune number are printed. For single-tune entries, asking for -t=1 -f=all is equivalent to saying -t=0 -f=all, since by definition, the whole entry refers to only one tune. (However, specifying -t with any other number than 1 will print nothing!) Note that if there's a file-global comment in the STIL entry (which also means that if a single-tune entry has nothing but a COMMENT field in it), that is B printed with these combinations of options. C<< -t= -f= >> : (Where x is anything but 0.) The specific field from the portion of the STIL entry for the given tune number is printed. For single-tune entries that have nothing but a COMMENT in them, this returns nothing. Of course, if the STIL entry or any portion of it asked with these options does not exist, STILView will print nothing. Also, unless otherwise specified with the -o, -s and -b options, the section-global comment and the BUG entry of the given SID file will also get printed (provided they exist). In example #1, the file-global comment for /Hubbard_Rob/Delta.sid is printed, since -t is not specified and is assumed to be 0. Also printed are the section- global comment and the BUG entry for the same SID file (if they exist). In example #2, the TITLE field of the STIL entry for tune #1 of /Hubbard_Rob/Delta.sid is printed along with the section-global comment and the BUG entry for the same SID file (if they exist). In example #3, all of the STIL entry for tune #12 of /Hubbard_Rob/Delta.sid is printed, but nothing else. =item B<-i> Default: NONE Example: C Starts STILView in interactive mode, ignoring all other options specified on the command-line, except -l, -d and -m. In interactive mode, you can look for STIL entries by typing them in. You will get prompted for the desired STIL entry (which has to be specified with an HVSC-relative pathname), for the tune number requested (which should be any non-negative number, but this is not enforced), and finally for the specific STIL field you want to retrieve. =item B<-l>=I Default: The value of the HVSC_BASE environment variable Example #1: C Example #2: C Example #3: C This is where you tell STILView where it can find the HVSC base directory (the path to the directory has to be specified in the form required by your operating system, eg. C:\Music\HVSC under Windows, /home/lala/HVSC under UNIX). STILView will then try to locate the STIL.txt file in the /DOCUMENTS/ subdirectory of that directory. If this option is not specified (or if -l is specified without a base directory), STILView will try to extract the path of the HVSC base directory from the HVSC_BASE environment variable. If that environment variable doesn't exist or is pointing to a location where there's no STIL.txt file in a DOCUMENTS directory, STILView fails. If the HVSC_BASE environment variable exists and is valid, and this option is specified, the directory specified with this option is used as the HVSC base directory instead of the environment variable. In example #1 the HVSC base directory is located in C:\Music\HVSC\ on the hard drive of a Windows PC, in example #2 it is located in the HVSC directory of the current directory's parent directory of a UNIX system. In example #3 the HVSC base directory is not specified with the option, so it is assumed that the HVSC_BASE environment variable contains the path to it. In reality, specifying the -l option in example #3 is redundant, and can be omitted. =item B<-m> Demo mode Default: NONE Example #1: C Example #2: C When specified, it prints out a whole bunch of things that a) test most of the functionality of STILView, and b) show what STILView is capable of retrieving from STIL. In example #1, the demo is printed with the STIL info coming from a default STIL entry, then STILView quits. In example #2, the demo is printed taking the STIL info from the specified STIL entry of /Hubbard_Rob/Commando.sid (instead of the default SID file), then interactive mode is entered. =item B<-o> Do B print STIL entries Default value: Not specified (ie. do print STIL entries) Example #1: C Example #2: C When this option is specified, STIL entries will not be printed for the given SID tune (but section-global entries and BUG entries will be printed, provided they exist and other options did not turn their output off). At a minimum, the -e option has to be specified for this option to work. Example #1 will print out the section-global comment and the BUG entry for /Hubbard_Rob/Delta.sid, example #2 will print out just the section-global comment for the same SID. =item B<-s> Do B print section-global comments Default value: Not specified (ie. do print section-global entries) Example: C When this option is specified, section-global entries will not be printed for the given SID tune. At a minimum, the -e option has to be specified for this option to work. =item B<-t>=I Default value: 0 Example #1: C Example #2: C Example #3: C Asks for the portion of a STIL entry referring to one particular tune. If tune number 0 is given, it retrieves all of the entry. Combined with the -f option, these two options can retrieve any portion of a STIL entry, including a single field in a specific subtune's entry. For further details about this option, see the explanation of the -f option. Example #1 retrieves all of the STIL entry for /Hubbard_Rob/Commando.sid, including the section-global comment and the BUG entry (if any), but since the default value for this option is 0, it might as well be omitted in this example. Example #2 retrieves only the TITLE field of the first subtune's entry for /Hubbard_Rob/Delta.sid (and not the section- global comment or the BUG entry), while example #3 retrieves all of the STIL entry for tune #12 of the same SID file (including the section-global comment and the BUG entry, if any). =item B<-v> Print version numbers Default value: Not specified (ie. do *not* print version numbers) Example #1: C Example #2: C When this option is specified, the version number of the STILView program and the version number of the STIL.txt file used by it is printed out. In example #1 this is the only piece of info that gets printed on the screen, in example #2 the version numbers are printed out, then the STIL entry for /Hubbard_Rob/Commando.sid is also printed out. =back =head1 ENVIRONMENT =over =item B Specifies the location of the HVSC base directory. =back =head1 EXAMPLES All of the examples below assume that the HVSC_BASE environment is set to a valid HVSC base directory (where the F<$HVSC_BASE/DOCUMENTS/STIL.txt> and F<$HVSC_BASE/DOCUMENTS/BUGlist.txt> files exist), and the examples also assume the presence of the following entries in these files: --- In STIL.txt --- /Hubbard_Rob/ COMMENT: All of these tunes have been confirmed by Hubbard to be his. People have often stolen Hubbard's routine causing some tunes to be falsely credited to him. /Hubbard_Rob/Action_Biker.sid COMMENT: "Action B was a very early game and very conservative in it's approach - it was my idea of giving them what I thought they wanted, a simple cute tune....." (RH) /Hubbard_Rob/Commando.sid COMMENT: Tunes #1 and #3 have been converted from arcade version. /Hubbard_Rob/Delta.sid COMMENT: According to Hubbard, Kentilla and Delta were the most complicated one to compose, they took the longest time to do and they both drove him insane. (#1) TITLE: On the Run [from the Dark Side of the Moon] ARTIST: Pink Floyd COMMENT: It is more inspired by it than a remix of it. (#12) TITLE: Koyaanisqatsi [from the movie] ARTIST: Philip Glass COMMENT: "Inspired by Philip Glass and Pink Floyd." (RH) /Hubbard_Rob/International_Karate.sid TITLE: Merry Christmas, Mr. Lawrence [from the movie] (0:42-1:16) ARTIST: Ryuichi Sakamoto COMMENT: "[...] I started exploring pentatonic things in B flat minor over different bass notes, B flat, D flat, G flat and A flat. The middle section went into F (I think) at double tempo to liven things up. I was pleased with the tune......" (RH) /Hubbard_Rob/Rasputin.sid (#1) TITLE: Katjusha (0:07-0:36) ARTIST: Matvei Blanter, M. Isakovski TITLE: Katjusha (2:20) ARTIST: Matvei Blanter, M. Isakovski TITLE: Kaljinka (2:41-2:51) ARTIST: Traditional COMMENT: Russian folk song. TITLE: Kaljinka (3:12-3:22) ARTIST: Traditional COMMENT: Russian folk song. (#2) COMMENT: Russian folk song. --- In BUGlist.txt --- /Hubbard_Rob/Commando.sid BUG: This is just for demo. /Hubbard_Rob/Delta.sid (#12) BUG: Demo entry. Given these entries, following are the printouts you can expect from STILView. ($> denotes a command-line prompt given by your operating system.) Everything related to a SID file is printed: $> stilview -e=/Hubbard_Rob/Commando.sid ---- GLOBAL COMMENT ---- COMMENT: All of these tunes have been confirmed by Hubbard to be his. People have often stolen Hubbard's routine causing some tunes to be falsely credited to him. ------ STIL ENTRY ------ COMMENT: Tunes #1 and #3 have been converted from arcade version. ---------- BUG ---------- BUG: This is just for demo. $> Ask for just the section-global comment: $> stilview -e=/Hubbard_Rob/ /Hubbard_Rob/ COMMENT: All of these tunes have been confirmed by Hubbard to be his. People have often stolen Hubbard's routine causing some tunes to be falsely credited to him. $> Note that this can also be retrieved with: $> stilview -e=/Hubbard_Rob/Commando.sid -o -b COMMENT: All of these tunes have been confirmed by Hubbard to be his. People have often stolen Hubbard's routine causing some tunes to be falsely credited to him. $> This prints out nothing, as single-tune entries do not have file-global comments: $> stilview -e=/Hubbard_Rob/International_Karate.sid -t=0 -f=comment -s -b $> ...Except if the only field in them is a COMMENT (in which case that comment is assumed to be a file-global comment): $> stilview -e=/Hubbard_Rob/Action_Biker.sid -t=0 -f=comment -s -b COMMENT: "Action B was a very early game and very conservative in it's approach - it was my idea of giving them what I thought they wanted, a simple cute tune....." (RH) $> Also note that single-tune entries have only one tune, so asking for the STIL entry of tune #3 is pointless: $> stilview -e=/Hubbard_Rob/International_Karate.sid -t=3 -s -b $> Print out the file-global comment for the given SID file: $> stilview -e=/Hubbard_Rob/Delta.sid -t=0 -f=comment -s -b COMMENT: According to Hubbard, Kentilla and Delta were the most complicated one to compose, they took the longest time to do and they both drove him insane. $> Print out the ARTIST field of tune #12 of the given SID file, plus print out everything else related to the SID file: $> stilview -e=/Hubbard_Rob/Delta.sid -t=12 -f=artist ---- GLOBAL COMMENT ---- COMMENT: All of these tunes have been confirmed by Hubbard to be his. People have often stolen Hubbard's routine causing some tunes to be falsely credited to him. ------ STIL ENTRY ------ ARTIST: Philip Glass ---------- BUG ---------- BUG: Demo entry. $> Note that the current version of STILView is capable to retrieve only the first specified field of a tune that covers multiple songs! See below: $> stilview -e=/Hubbard_Rob/Rasputin.sid -t=1 -f=title -s TITLE: Katjusha (0:07-0:36) $> Section-global comments are printed out even if the STIL entry for the given SID file does not exist: $> stilview -e=/Hubbard_Rob/This_doesnt_exist.sid COMMENT: All of these tunes have been confirmed by Hubbard to be his. People have often stolen Hubbard's routine causing some tunes to be falsely credited to him. $> The following 4 steps depict how to have STILView print out everything related to a given SID file's given tune number one by one: 1) This prints out just the section-global comment: $> stilview -e=/Hubbard_Rob/Delta.sid -o -b COMMENT: All of these tunes have been confirmed by Hubbard to be his. People have often stolen Hubbard's routine causing some tunes to be falsely credited to him. $> 2) This prints out just the file-global comment: $> stilview -e=/Hubbard_Rob/Delta.sid -t=0 -f=comment -s -b COMMENT: According to Hubbard, Kentilla and Delta were the most complicated one to compose, they took the longest time to do and they both drove him insane. $> 3) This prints out all of the STIL entry for the given tune number: $> stilview -e=/Hubbard_Rob/Delta.sid -t=12 -f=all -s -b TITLE: Koyaanisqatsi [from the movie] ARTIST: Philip Glass COMMENT: "Inspired by Philip Glass and Pink Floyd." (RH) $> 4) And this prints out just the BUG entry for the same tune number: $> stilview -e=/Hubbard_Rob/Delta.sid -t=12 -s -o BUG: Demo entry. $> The following 3 steps depict how to have STILView print out everything related to a given SID file: 1) This prints out just the section-global comment: $> stilview -e=/Hubbard_Rob/Delta.sid -o -b COMMENT: All of these tunes have been confirmed by Hubbard to be his. People have often stolen Hubbard's routine causing some tunes to be falsely credited to him. $> 2) This prints out all of the STIL entry: $> stilview -e=/Hubbard_Rob/Delta.sid -s -b COMMENT: "[...] The Delta music loader and ingame music was Gary Liddon's idea. [...] He was the producer at Thalamus at the time. He told Rob Hubbard to make the ingame music like the 2nd track from Dark Side of the Moon by Pink Floyd." (Info from Matt Furniss.) "The small jingles are all small clips from Sanxion and Romeo/Juliet music. They were all supposed to be for short stingers such as end of level, extra life etc..." "Delta was based on this minimalist composition technique inspired by Glass and a bit of Pink Floyd. It was quite hard too do and required some custom code to the driver to do it. The music was tedious to debug. The other Delta stuff was more conventional - I quite liked the other tunes. Delta was spread over a 2 week period....." (RH) According to Hubbard, Kentilla and Delta were the most complicated one to compose, they took the longest time to do and they both drove him insane. (#1) TITLE: On the Run [from the Dark Side of the Moon] ARTIST: Pink Floyd COMMENT: It is more inspired by it than a remix of it. (#12) TITLE: Koyaanisqatsi [from the movie] ARTIST: Philip Glass COMMENT: "Inspired by Philip Glass and Pink Floyd." (RH) $> 3) And this prints out all of the BUG entry: $> stilview -e=/Hubbard_Rob/Delta.sid -s -o (#12) BUG: Demo entry. $> =head1 AUTHORS =over =item B Original author. =item B Current maintainer. =back =head1 RESOURCES =over =item Home page: L =item High Voltage Sid Collection (HVSC): L =back =head1 COPYING =over =item Copyright (C) 1998, 2002 LaLa =item Copyright (C) 2012-2017 Leandro Nini =back This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You 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. sidplayfp-2.15.2/m4/000077500000000000000000000000001510162011500141045ustar00rootroot00000000000000sidplayfp-2.15.2/m4/ax_cxx_compile_stdcxx.m4000066400000000000000000000550251510162011500207540ustar00rootroot00000000000000# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html # =========================================================================== # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the specified # version of the C++ standard. If necessary, add switches to CXX and # CXXCPP to enable support. VERSION may be '11', '14', '17', '20', or # '23' for the respective C++ standard version. # # The second argument, if specified, indicates whether you insist on an # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. # -std=c++11). If neither is specified, you get whatever works, with # preference for no added switch, and then for an extended mode. # # The third argument, if specified 'mandatory' or if left unspecified, # indicates that baseline support for the specified C++ standard is # required and that the macro should error out if no mode with that # support is found. If specified 'optional', then configuration proceeds # regardless, after defining HAVE_CXX${VERSION} if and only if a # supporting mode is found. # # LICENSE # # Copyright (c) 2008 Benjamin Kosnik # Copyright (c) 2012 Zack Weinberg # Copyright (c) 2013 Roy Stogner # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov # Copyright (c) 2015 Paul Norman # Copyright (c) 2015 Moritz Klammler # Copyright (c) 2016, 2018 Krzesimir Nowak # Copyright (c) 2019 Enji Cooper # Copyright (c) 2020 Jason Merrill # Copyright (c) 2021, 2024 JÃļrn Heusipp # Copyright (c) 2015, 2022, 2023, 2024 Olly Betts # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 25 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl (serial version number 13). AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], [$1], [14], [ax_cxx_compile_alternatives="14 1y"], [$1], [17], [ax_cxx_compile_alternatives="17 1z"], [$1], [20], [ax_cxx_compile_alternatives="20"], [$1], [23], [ax_cxx_compile_alternatives="23"], [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl m4_if([$2], [], [], [$2], [ext], [], [$2], [noext], [], [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], [$3], [optional], [ax_cxx_compile_cxx$1_required=false], [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) AC_LANG_PUSH([C++])dnl ac_success=no m4_if([$2], [], [dnl AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, ax_cv_cxx_compile_cxx$1, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], [ax_cv_cxx_compile_cxx$1=yes], [ax_cv_cxx_compile_cxx$1=no])]) if test x$ax_cv_cxx_compile_cxx$1 = xyes; then ac_success=yes fi]) m4_if([$2], [noext], [], [dnl if test x$ac_success = xno; then for alternative in ${ax_cxx_compile_alternatives}; do switch="-std=gnu++${alternative}" cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, $cachevar, [ac_save_CXX="$CXX" CXX="$CXX $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], [eval $cachevar=yes], [eval $cachevar=no]) CXX="$ac_save_CXX"]) if eval test x\$$cachevar = xyes; then CXX="$CXX $switch" if test -n "$CXXCPP" ; then CXXCPP="$CXXCPP $switch" fi ac_success=yes break fi done fi]) m4_if([$2], [ext], [], [dnl if test x$ac_success = xno; then dnl HP's aCC needs +std=c++11 according to: dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf dnl Cray's crayCC needs "-h std=c++11" dnl MSVC needs -std:c++NN for C++17 and later (default is C++14) for alternative in ${ax_cxx_compile_alternatives}; do for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do if test x"$switch" = xMSVC; then dnl AS_TR_SH maps both `:` and `=` to `_` so -std:c++17 would collide dnl with -std=c++17. We suffix the cache variable name with _MSVC to dnl avoid this. switch=-std:c++${alternative} cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_${switch}_MSVC]) else cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) fi AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, $cachevar, [ac_save_CXX="$CXX" CXX="$CXX $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], [eval $cachevar=yes], [eval $cachevar=no]) CXX="$ac_save_CXX"]) if eval test x\$$cachevar = xyes; then CXX="$CXX $switch" if test -n "$CXXCPP" ; then CXXCPP="$CXXCPP $switch" fi ac_success=yes break fi done if test x$ac_success = xyes; then break fi done fi]) AC_LANG_POP([C++]) if test x$ax_cxx_compile_cxx$1_required = xtrue; then if test x$ac_success = xno; then AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) fi fi if test x$ac_success = xno; then HAVE_CXX$1=0 AC_MSG_NOTICE([No compiler with C++$1 support was found]) else HAVE_CXX$1=1 AC_DEFINE(HAVE_CXX$1,1, [define if the compiler supports basic C++$1 syntax]) fi AC_SUBST(HAVE_CXX$1) ]) dnl Test body for checking C++11 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], [_AX_CXX_COMPILE_STDCXX_testbody_new_in_11] ) dnl Test body for checking C++14 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], [_AX_CXX_COMPILE_STDCXX_testbody_new_in_11 _AX_CXX_COMPILE_STDCXX_testbody_new_in_14] ) dnl Test body for checking C++17 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], [_AX_CXX_COMPILE_STDCXX_testbody_new_in_11 _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 _AX_CXX_COMPILE_STDCXX_testbody_new_in_17] ) dnl Test body for checking C++20 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_20], [_AX_CXX_COMPILE_STDCXX_testbody_new_in_11 _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 _AX_CXX_COMPILE_STDCXX_testbody_new_in_20] ) dnl Test body for checking C++23 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_23], [_AX_CXX_COMPILE_STDCXX_testbody_new_in_11 _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 _AX_CXX_COMPILE_STDCXX_testbody_new_in_23] ) dnl Tests for new features in C++11 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" // MSVC always sets __cplusplus to 199711L in older versions; newer versions // only set it correctly if /Zc:__cplusplus is specified as well as a // /std:c++NN switch: // // https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ // // The value __cplusplus ought to have is available in _MSVC_LANG since // Visual Studio 2015 Update 3: // // https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros // // This was also the first MSVC version to support C++14 so we can't use the // value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having // C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. #elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { virtual ~Derived() override {} virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L ]]) dnl Tests for new features in C++14 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ // If the compiler admits that it is not ready for C++14, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201402L && !defined _MSC_VER #error "This is not a C++14 compiler" #else namespace cxx14 { namespace test_polymorphic_lambdas { int test() { const auto lambda = [](auto&&... args){ const auto istiny = [](auto x){ return (sizeof(x) == 1UL) ? 1 : 0; }; const int aretiny[] = { istiny(args)... }; return aretiny[0]; }; return lambda(1, 1L, 1.0f, '1'); } } namespace test_binary_literals { constexpr auto ivii = 0b0000000000101010; static_assert(ivii == 42, "wrong value"); } namespace test_generalized_constexpr { template < typename CharT > constexpr unsigned long strlen_c(const CharT *const s) noexcept { auto length = 0UL; for (auto p = s; *p; ++p) ++length; return length; } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("x") == 1UL, ""); static_assert(strlen_c("test") == 4UL, ""); static_assert(strlen_c("another\0test") == 7UL, ""); } namespace test_lambda_init_capture { int test() { auto x = 0; const auto lambda1 = [a = x](int b){ return a + b; }; const auto lambda2 = [a = lambda1(x)](){ return a; }; return lambda2(); } } namespace test_digit_separators { constexpr auto ten_million = 100'000'000; static_assert(ten_million == 100000000, ""); } namespace test_return_type_deduction { auto f(int& x) { return x; } decltype(auto) g(int& x) { return x; } template < typename T1, typename T2 > struct is_same { static constexpr auto value = false; }; template < typename T > struct is_same { static constexpr auto value = true; }; int test() { auto x = 0; static_assert(is_same::value, ""); static_assert(is_same::value, ""); return x; } } } // namespace cxx14 #endif // __cplusplus >= 201402L ]]) dnl Tests for new features in C++17 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ // If the compiler admits that it is not ready for C++17, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L #error "This is not a C++17 compiler" #else #include #include #include namespace cxx17 { namespace test_constexpr_lambdas { constexpr int foo = [](){return 42;}(); } namespace test::nested_namespace::definitions { } namespace test_fold_expression { template int multiply(Args... args) { return (args * ... * 1); } template bool all(Args... args) { return (args && ...); } } namespace test_extended_static_assert { static_assert (true); } namespace test_auto_brace_init_list { auto foo = {5}; auto bar {5}; static_assert(std::is_same, decltype(foo)>::value); static_assert(std::is_same::value); } namespace test_typename_in_template_template_parameter { template typename X> struct D; } namespace test_fallthrough_nodiscard_maybe_unused_attributes { int f1() { return 42; } [[nodiscard]] int f2() { [[maybe_unused]] auto unused = f1(); switch (f1()) { case 17: f1(); [[fallthrough]]; case 42: f1(); } return f1(); } } namespace test_extended_aggregate_initialization { struct base1 { int b1, b2 = 42; }; struct base2 { base2() { b3 = 42; } int b3; }; struct derived : base1, base2 { int d; }; derived d1 {{1, 2}, {}, 4}; // full initialization derived d2 {{}, {}, 4}; // value-initialized bases } namespace test_general_range_based_for_loop { struct iter { int i; int& operator* () { return i; } const int& operator* () const { return i; } iter& operator++() { ++i; return *this; } }; struct sentinel { int i; }; bool operator== (const iter& i, const sentinel& s) { return i.i == s.i; } bool operator!= (const iter& i, const sentinel& s) { return !(i == s); } struct range { iter begin() const { return {0}; } sentinel end() const { return {5}; } }; void f() { range r {}; for (auto i : r) { [[maybe_unused]] auto v = i; } } } namespace test_lambda_capture_asterisk_this_by_value { struct t { int i; int foo() { return [*this]() { return i; }(); } }; } namespace test_enum_class_construction { enum class byte : unsigned char {}; byte foo {42}; } namespace test_constexpr_if { template int f () { if constexpr(cond) { return 13; } else { return 42; } } } namespace test_selection_statement_with_initializer { int f() { return 13; } int f2() { if (auto i = f(); i > 0) { return 3; } switch (auto i = f(); i + 4) { case 17: return 2; default: return 1; } } } namespace test_template_argument_deduction_for_class_templates { template struct pair { pair (T1 p1, T2 p2) : m1 {p1}, m2 {p2} {} T1 m1; T2 m2; }; void f() { [[maybe_unused]] auto p = pair{13, 42u}; } } namespace test_non_type_auto_template_parameters { template struct B {}; B<5> b1; B<'a'> b2; } namespace test_structured_bindings { int arr[2] = { 1, 2 }; std::pair pr = { 1, 2 }; auto f1() -> int(&)[2] { return arr; } auto f2() -> std::pair& { return pr; } struct S { int x1 : 2; volatile double y1; }; S f3() { return {}; } auto [ x1, y1 ] = f1(); auto& [ xr1, yr1 ] = f1(); auto [ x2, y2 ] = f2(); auto& [ xr2, yr2 ] = f2(); const auto [ x3, y3 ] = f3(); } namespace test_exception_spec_type_system { struct Good {}; struct Bad {}; void g1() noexcept; void g2(); template Bad f(T*, T*); template Good f(T1*, T2*); static_assert (std::is_same_v); } namespace test_inline_variables { template void f(T) {} template inline T g(T) { return T{}; } template<> inline void f<>(int) {} template<> int g<>(int) { return 5; } } } // namespace cxx17 #endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L ]]) dnl Tests for new features in C++20 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[ #ifndef __cplusplus #error "This is not a C++ compiler" #elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L #error "This is not a C++20 compiler" #else #include namespace cxx20 { // As C++20 supports feature test macros in the standard, there is no // immediate need to actually test for feature availability on the // Autoconf side. } // namespace cxx20 #endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L ]]) dnl Tests for new features in C++23 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_23], [[ #ifndef __cplusplus #error "This is not a C++ compiler" #elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L #error "This is not a C++23 compiler" #else #include namespace cxx23 { // As C++23 supports feature test macros in the standard, there is no // immediate need to actually test for feature availability on the // Autoconf side. } // namespace cxx23 #endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L ]]) sidplayfp-2.15.2/m4/host-cpu-c-abi.m4000066400000000000000000000415751510162011500170750ustar00rootroot00000000000000# host-cpu-c-abi.m4 # serial 20 dnl Copyright (C) 2002-2025 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Bruno Haible and Sam Steingold. dnl Sets the HOST_CPU variable to the canonical name of the CPU. dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its dnl C language ABI (application binary interface). dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in dnl config.h. dnl dnl This canonical name can be used to select a particular assembly language dnl source file that will interoperate with C code on the given host. dnl dnl For example: dnl * 'i386' and 'sparc' are different canonical names, because code for i386 dnl will not run on SPARC CPUs and vice versa. They have different dnl instruction sets. dnl * 'sparc' and 'sparc64' are different canonical names, because code for dnl 'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code dnl contains 32-bit instructions, whereas 'sparc64' code contains 64-bit dnl instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit dnl mode, but not both. dnl * 'mips' and 'mipsn32' are different canonical names, because they use dnl different argument passing and return conventions for C functions, and dnl although the instruction set of 'mips' is a large subset of the dnl instruction set of 'mipsn32'. dnl * 'mipsn32' and 'mips64' are different canonical names, because they use dnl different sizes for the C types like 'int' and 'void *', and although dnl the instruction sets of 'mipsn32' and 'mips64' are the same. dnl * The same canonical name is used for different endiannesses. You can dnl determine the endianness through preprocessor symbols: dnl - 'arm': test __ARMEL__. dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL. dnl - 'powerpc64': test __BIG_ENDIAN__ vs. __LITTLE_ENDIAN__. dnl * The same name 'i386' is used for CPUs of type i386, i486, i586 dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because dnl - Instructions that do not exist on all of these CPUs (cmpxchg, dnl MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your dnl assembly language source files use such instructions, you will dnl need to make the distinction. dnl - Speed of execution of the common instruction set is reasonable across dnl the entire family of CPUs. If you have assembly language source files dnl that are optimized for particular CPU types (like GNU gmp has), you dnl will need to make the distinction. dnl See . AC_DEFUN([gl_HOST_CPU_C_ABI], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_C_ASM]) AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi], [case "$host_cpu" in changequote(,)dnl i[34567]86 ) changequote([,])dnl gl_cv_host_cpu_c_abi=i386 ;; x86_64 ) # On x86_64 systems, the C compiler may be generating code in one of # these ABIs: # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64 # with native Windows (mingw, MSVC). # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32. # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if (defined __x86_64__ || defined __amd64__ \ || defined _M_X64 || defined _M_AMD64) int ok; #else error fail #endif ]])], [AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __ILP32__ || defined _ILP32 int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=x86_64-x32], [gl_cv_host_cpu_c_abi=x86_64])], [gl_cv_host_cpu_c_abi=i386]) ;; changequote(,)dnl alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] ) changequote([,])dnl gl_cv_host_cpu_c_abi=alpha ;; arm* | aarch64 ) # Assume arm with EABI. # On arm64 systems, the C compiler may be generating code in one of # these ABIs: # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#ifdef __aarch64__ int ok; #else error fail #endif ]])], [AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __ILP32__ || defined _ILP32 int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=arm64-ilp32], [gl_cv_host_cpu_c_abi=arm64])], [# Don't distinguish little-endian and big-endian arm, since they # don't require different machine code for simple operations and # since the user can distinguish them through the preprocessor # defines __ARMEL__ vs. __ARMEB__. # But distinguish arm which passes floating-point arguments and # return values in integer registers (r0, r1, ...) - this is # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which # passes them in float registers (s0, s1, ...) and double registers # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer # sets the preprocessor defines __ARM_PCS (for the first case) and # __ARM_PCS_VFP (for the second case), but older GCC does not. echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c # Look for a reference to the register d0 in the .s file. AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1 if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then gl_cv_host_cpu_c_abi=armhf else gl_cv_host_cpu_c_abi=arm fi rm -fr conftest* ]) ;; hppa1.0 | hppa1.1 | hppa2.0* | hppa64 ) # On hppa, the C compiler may be generating 32-bit code or 64-bit # code. In the latter case, it defines _LP64 and __LP64__. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#ifdef __LP64__ int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=hppa64], [gl_cv_host_cpu_c_abi=hppa]) ;; ia64* ) # On ia64 on HP-UX, the C compiler may be generating 64-bit code or # 32-bit code. In the latter case, it defines _ILP32. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#ifdef _ILP32 int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=ia64-ilp32], [gl_cv_host_cpu_c_abi=ia64]) ;; mips* ) # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this # at 32. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64) int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=mips64], [# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but # may later get defined by ), and _MIPS_SIM == _ABIN32. # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but # may later get defined by ), and _MIPS_SIM == _ABIO32. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if (_MIPS_SIM == _ABIN32) int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=mipsn32], [gl_cv_host_cpu_c_abi=mips])]) ;; powerpc* ) # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD. # No need to distinguish them here; the caller may distinguish # them based on the OS. # On powerpc64 systems, the C compiler may still be generating # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may # be generating 64-bit code. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __powerpc64__ || defined __LP64__ int ok; #else error fail #endif ]])], [# On powerpc64, there are two ABIs on Linux: The AIX compatible # one and the ELFv2 one. The latter defines _CALL_ELF=2. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined _CALL_ELF && _CALL_ELF == 2 int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=powerpc64-elfv2], [gl_cv_host_cpu_c_abi=powerpc64]) ], [gl_cv_host_cpu_c_abi=powerpc]) ;; rs6000 ) gl_cv_host_cpu_c_abi=powerpc ;; riscv32 | riscv64 ) # There are 2 architectures (with variants): rv32* and rv64*. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if __riscv_xlen == 64 int ok; #else error fail #endif ]])], [cpu=riscv64], [cpu=riscv32]) # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d. # Size of 'long' and 'void *': AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __LP64__ int ok; #else error fail #endif ]])], [main_abi=lp64], [main_abi=ilp32]) # Float ABIs: # __riscv_float_abi_double: # 'float' and 'double' are passed in floating-point registers. # __riscv_float_abi_single: # 'float' are passed in floating-point registers. # __riscv_float_abi_soft: # No values are passed in floating-point registers. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __riscv_float_abi_double int ok; #else error fail #endif ]])], [float_abi=d], [AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __riscv_float_abi_single int ok; #else error fail #endif ]])], [float_abi=f], [float_abi='']) ]) gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}" ;; s390* ) # On s390x, the C compiler may be generating 64-bit (= s390x) code # or 31-bit (= s390) code. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __LP64__ || defined __s390x__ int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=s390x], [gl_cv_host_cpu_c_abi=s390]) ;; sparc | sparc64 ) # UltraSPARCs running Linux have `uname -m` = "sparc64", but the # C compiler still generates 32-bit code. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __sparcv9 || defined __arch64__ int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=sparc64], [gl_cv_host_cpu_c_abi=sparc]) ;; *) gl_cv_host_cpu_c_abi="$host_cpu" ;; esac ]) dnl In most cases, $HOST_CPU and $HOST_CPU_C_ABI are the same. HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'` HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi" AC_SUBST([HOST_CPU]) AC_SUBST([HOST_CPU_C_ABI]) # This was # AC_DEFINE_UNQUOTED([__${HOST_CPU}__]) # AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__]) # earlier, but KAI C++ 3.2d doesn't like this. sed -e 's/-/_/g' >> confdefs.h <. dnl Don't make changes that are incompatible with that documentation! AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. gl_saved_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then gl_saved_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$gl_saved_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, dnl Solaris 10, macOS 14.4. gl_saved_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi am_cv_func_iconv_works=no for ac_iconv_const in '' 'const'; do AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[ #include #include #ifndef ICONV_CONST # define ICONV_CONST $ac_iconv_const #endif ]], [[int result = 0; /* Test against AIX 5.1...7.2 bug: Failures are not distinguishable from successful returns. This is even documented in */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against macOS 14.4 bug: Failures are not distinguishable from successful returns. POSIX:2018 says: "The iconv() function shall ... return the number of non-identical conversions performed." But here, the conversion always does transliteration (the suffixes "//TRANSLIT" and "//IGNORE" have no effect, nor does iconvctl()) and does not report when it does a non-identical conversion. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO-8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\305\202"; /* LATIN SMALL LETTER L WITH STROKE */ char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); /* Here: With glibc, GNU libiconv (including macOS up to 13): res == (size_t)-1, errno == EILSEQ. With musl libc, NetBSD 10, Solaris 11: res == 1. With macOS 14.4: res == 0, output is "l". */ if (res == 0) result |= 2; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\263"; char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 4; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 8; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 16; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ { /* Try standardized names. */ iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP"); /* Try IRIX, OSF/1 names. */ iconv_t cd2 = iconv_open ("UTF-8", "eucJP"); /* Try AIX names. */ iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP"); /* Try HP-UX names. */ iconv_t cd4 = iconv_open ("utf8", "eucJP"); if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1) && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1)) result |= 32; if (cd1 != (iconv_t)(-1)) iconv_close (cd1); if (cd2 != (iconv_t)(-1)) iconv_close (cd2); if (cd3 != (iconv_t)(-1)) iconv_close (cd3); if (cd4 != (iconv_t)(-1)) iconv_close (cd4); } return result; ]])], [am_cv_func_iconv_works=yes], , [case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac]) test "$am_cv_func_iconv_works" = no || break done LIBS="$gl_saved_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$gl_saved_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST([LIBICONV]) AC_SUBST([LTLIBICONV]) ]) dnl Define AM_ICONV using AC_DEFUN_ONCE, in order to avoid warnings like dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". AC_DEFUN_ONCE([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([whether iconv is compatible with its POSIX signature], [gl_cv_iconv_nonconst], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include extern #ifdef __cplusplus "C" #endif size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); ]], [[]])], [gl_cv_iconv_nonconst=yes], [gl_cv_iconv_nonconst=no]) ]) else dnl When compiling GNU libiconv on a system that does not have iconv yet, dnl pick the POSIX compliant declaration without 'const'. gl_cv_iconv_nonconst=yes fi if test $gl_cv_iconv_nonconst = yes; then iconv_arg1="" else iconv_arg1="const" fi AC_DEFINE_UNQUOTED([ICONV_CONST], [$iconv_arg1], [Define as const if the declaration of iconv() needs const.]) dnl Also substitute ICONV_CONST in the gnulib generated . m4_ifdef([gl_ICONV_H_DEFAULTS], [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) if test $gl_cv_iconv_nonconst != yes; then ICONV_CONST="const" fi ]) dnl A summary result, for those packages which want to print a summary at the dnl end of the configuration. if test "$am_func_iconv" = yes; then if test -n "$LIBICONV"; then am_cv_func_iconv_summary='yes, in libiconv' else am_cv_func_iconv_summary='yes, in libc' fi else if test "$am_cv_func_iconv" = yes; then am_cv_func_iconv_summary='not working, consider installing GNU libiconv' else am_cv_func_iconv_summary='no, consider installing GNU libiconv' fi fi ]) sidplayfp-2.15.2/m4/lib-ld.m4000066400000000000000000000125001510162011500155070ustar00rootroot00000000000000# lib-ld.m4 # serial 13 dnl Copyright (C) 1996-2003, 2009-2025 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Subroutines of libtool.m4, dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid dnl collision with libtool.m4. dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 /dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi if test -n "$LD"; then AC_MSG_CHECKING([for ld]) elif test "$GCC" = yes; then AC_MSG_CHECKING([for ld used by $CC]) elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi if test -n "$LD"; then # Let the user override the test with a path. : else AC_CACHE_VAL([acl_cv_path_LD], [ acl_cv_path_LD= # Final result of this test ac_prog=ld # Program to search in $PATH if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. case $host in *-*-mingw* | windows*) # gcc leaves a trailing carriage return which upsets mingw acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) acl_output=`($CC -print-prog-name=ld) 2>&5` ;; esac case $acl_output in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` done # Got the pathname. No search in PATH is needed. acl_cv_path_LD="$acl_output" ac_prog= ;; "") # If it fails, then pretend we aren't using GCC. ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac fi if test -n "$ac_prog"; then # Search for $ac_prog in $PATH. acl_saved_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_saved_IFS" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_FROMPACKAGE(name, package) dnl declares that libname comes from the given package. The configure file dnl will then not have a --with-libname-prefix option but a dnl --with-package-prefix option. Several libraries can come from the same dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_libsinpackage_]PACKUP, m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[[, ]]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" ]) AC_ARG_WITH(PACK[-prefix], [[ --with-]]PACK[[-prefix[=DIR] search for ]]PACKLIBS[[ in DIR/include and DIR/lib --without-]]PACK[[-prefix don't search for ]]PACKLIBS[[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" additional_libdir2="$withval/$acl_libdirstem2" additional_libdir3="$withval/$acl_libdirstem3" fi fi ]) if test "X$additional_libdir2" = "X$additional_libdir"; then additional_libdir2= fi if test "X$additional_libdir3" = "X$additional_libdir"; then additional_libdir3= fi dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Use breadth-first search. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been dnl computed. So it has to be reset here. HAVE_LIB[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do if test "X$found_dir" = "X"; then eval dir=\$$additional_libdir_variable if test -n "$dir"; then dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi fi done fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2" \ || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem3 | */$acl_libdirstem3/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. saved_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$saved_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $dependency_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then haveit= if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$dependency_libdir"; then dnl Really add $dependency_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$dependency_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$dependency_libdir"; then dnl Really add $dependency_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$dependency_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. dnl But on GNU systems, ignore -lc options, because dnl - linking with libc is the default anyway, dnl - linking with libc.a may produce an error dnl "/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie" dnl or may produce an executable that always crashes, see dnl . dep=`echo "X$dep" | sed -e 's/^X-l//'` if test "X$dep" != Xc \ || case $host_os in linux* | gnu* | k*bsd*-gnu) false ;; *) true ;; esac; then names_next_round="$names_next_round $dep" fi ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_saved_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_saved_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_saved_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_saved_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi popdef([PACKLIBS]) popdef([PACKUP]) popdef([PACK]) popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2" \ && test "X$dir" != "X/usr/$acl_libdirstem3"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2" \ && test "X$dir" != "X/usr/$acl_libdirstem3"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_saved_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_saved_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_saved_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_saved_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) sidplayfp-2.15.2/m4/lib-prefix.m4000066400000000000000000000304461510162011500164160ustar00rootroot00000000000000# lib-prefix.m4 # serial 23 dnl Copyright (C) 2001-2005, 2008-2025 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Bruno Haible. dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH([lib-prefix], [[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_saved_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_saved_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_saved_prefix="$prefix" prefix="$acl_final_prefix" acl_saved_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_saved_exec_prefix" prefix="$acl_saved_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates dnl - a function acl_is_expected_elfclass, that tests whether standard input dn; has a 32-bit or 64-bit ELF header, depending on the host CPU ABI, dnl - 3 variables acl_libdirstem, acl_libdirstem2, acl_libdirstem3, containing dnl the basename of the libdir to try in turn, either "lib" or "lib64" or dnl "lib/64" or "lib32" or "lib/sparcv9" or "lib/amd64" or similar. AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib, lib32, and lib64. dnl On most glibc systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. However, on dnl Arch Linux based distributions, it's the opposite: 32-bit libraries go dnl under $prefix/lib32 and 64-bit libraries go under $prefix/lib. dnl We determine the compiler's default mode by looking at the compiler's dnl library search path. If at least one of its elements ends in /lib64 or dnl points to a directory whose absolute pathname ends in /lib64, we use that dnl for 64-bit ABIs. Similarly for 32-bit ABIs. Otherwise we use the default, dnl namely "lib". dnl On Solaris systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT]) AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf], [AC_EGREP_CPP([Extensible Linking Format], [#if defined __ELF__ || (defined __linux__ && (defined __EDG__ || defined __SUNPRO_C)) Extensible Linking Format #endif ], [gl_cv_elf=yes], [gl_cv_elf=no]) ]) if test $gl_cv_elf = yes; then # Extract the ELF class of a file (5th byte) in decimal. # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header if od -A x < /dev/null >/dev/null 2>/dev/null; then # Use POSIX od. func_elfclass () { od -A n -t d1 -j 4 -N 1 } else # Use BSD hexdump. func_elfclass () { dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "' echo } fi # Use 'expr', not 'test', to compare the values of func_elfclass, because on # Solaris 11 OpenIndiana and Solaris 11 OmniOS, the result is 001 or 002, # not 1 or 2. changequote(,)dnl case $HOST_CPU_C_ABI_32BIT in yes) # 32-bit ABI. acl_is_expected_elfclass () { expr "`func_elfclass | sed -e 's/[ ]//g'`" = 1 > /dev/null } ;; no) # 64-bit ABI. acl_is_expected_elfclass () { expr "`func_elfclass | sed -e 's/[ ]//g'`" = 2 > /dev/null } ;; *) # Unknown. acl_is_expected_elfclass () { : } ;; esac changequote([,])dnl else acl_is_expected_elfclass () { : } fi dnl Allow the user to override the result by setting acl_cv_libdirstems. AC_CACHE_CHECK([for the common suffixes of directories in the library search path], [acl_cv_libdirstems], [dnl Try 'lib' first, because that's the default for libdir in GNU, see dnl . acl_libdirstem=lib acl_libdirstem2= acl_libdirstem3= case "$host_os" in solaris*) dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment dnl . dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the dnl symlink is missing, so we set acl_libdirstem2 too. if test $HOST_CPU_C_ABI_32BIT = no; then acl_libdirstem2=lib/64 case "$host_cpu" in sparc*) acl_libdirstem3=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem3=lib/amd64 ;; esac fi ;; netbsd*) dnl On NetBSD/sparc64, there is a 'sparc' subdirectory that contains dnl 32-bit libraries. if test $HOST_CPU_C_ABI_32BIT != no; then case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparc ;; esac fi ;; *) dnl If $CC generates code for a 32-bit ABI, the libraries are dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64. dnl Similarly, if $CC generates code for a 64-bit ABI, the libraries dnl are surely under $prefix/lib or $prefix/lib64, not $prefix/lib32. dnl Find the compiler's search path. However, non-system compilers dnl sometimes have odd library search paths. But we can't simply invoke dnl '/usr/bin/gcc -print-search-dirs' because that would not take into dnl account the -m32/-m31 or -m64 options from the $CC or $CFLAGS. searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \ | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test $HOST_CPU_C_ABI_32BIT != no; then # 32-bit or unknown ABI. if test -d /usr/lib32; then acl_libdirstem2=lib32 fi fi if test $HOST_CPU_C_ABI_32BIT != yes; then # 64-bit or unknown ABI. if test -d /usr/lib64; then acl_libdirstem3=lib64 fi fi if test -n "$searchpath"; then acl_saved_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;; */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib32 ) acl_libdirstem2=lib32 ;; */lib64 ) acl_libdirstem3=lib64 ;; esac ;; esac fi done IFS="$acl_saved_IFS" if test $HOST_CPU_C_ABI_32BIT = yes; then # 32-bit ABI. acl_libdirstem3= fi if test $HOST_CPU_C_ABI_32BIT = no; then # 64-bit ABI. acl_libdirstem2= fi fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem" acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3" ]) dnl Decompose acl_cv_libdirstems into acl_libdirstem, acl_libdirstem2, and dnl acl_libdirstem3. changequote(,)dnl acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'` acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'` changequote([,])dnl ]) sidplayfp-2.15.2/src/000077500000000000000000000000001510162011500143535ustar00rootroot00000000000000sidplayfp-2.15.2/src/IniConfig.cpp000066400000000000000000000366451510162011500167420ustar00rootroot00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2011-2024 Leandro Nini * Copyright 2000-2001 Simon White * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "IniConfig.h" #include #include #include #include #include #ifndef _WIN32 # include # include /* mkdir */ # include /* opendir */ #else # include #endif #ifdef HAVE_UNISTD_H # include #endif #include "utils.h" #include "dataParser.h" #include "sidcxx11.h" inline void debug(MAYBE_UNUSED const TCHAR *msg, MAYBE_UNUSED const TCHAR *val) { #ifndef NDEBUG SID_COUT << msg << val << std::endl; #endif } inline void error(const TCHAR *msg) { SID_CERR << msg << std::endl; } inline void error(const TCHAR *msg, const TCHAR *val) { SID_CERR << msg << val << std::endl; } const TCHAR *DIR_NAME = TEXT("sidplayfp"); const TCHAR *FILE_NAME = TEXT("sidplayfp.ini"); IniConfig::IniConfig() { // Initialise everything else clear(); } IniConfig::~IniConfig() { clear(); } void IniConfig::clear() { sidplay2_s.version = 1; // INI File Version sidplay2_s.database.clear(); sidplay2_s.playLength = 0; // INFINITE sidplay2_s.recordLength = (3 * 60 + 30) * 1000; // 3.5 minutes sidplay2_s.kernalRom.clear(); sidplay2_s.basicRom.clear(); sidplay2_s.chargenRom.clear(); sidplay2_s.verboseLevel = 0; console_s.ansi = false; console_s.topLeft = '+'; console_s.topRight = '+'; console_s.bottomLeft = '+'; console_s.bottomRight = '+'; console_s.vertical = '|'; console_s.horizontal = '-'; console_s.junctionLeft = '+'; console_s.junctionRight = '+'; audio_s.frequency = SidConfig::DEFAULT_SAMPLING_FREQ; audio_s.channels = 0; audio_s.precision = 16; audio_s.bufLength = 250; emulation_s.modelDefault = SidConfig::PAL; emulation_s.modelForced = false; emulation_s.sidModel = SidConfig::MOS6581; emulation_s.forceModel = false; emulation_s.ciaModel = SidConfig::MOS6526; emulation_s.filter = true; emulation_s.engine.clear(); emulation_s.bias = 0.5; emulation_s.filterCurve6581 = 0.5; #ifdef FEAT_FILTER_RANGE emulation_s.filterRange6581 = 0.5; #endif emulation_s.filterCurve8580 = 0.5; #ifdef FEAT_CW_STRENGTH emulation_s.combinedWaveformsStrength = SidConfig::AVERAGE; #endif emulation_s.powerOnDelay = -1; emulation_s.samplingMethod = SidConfig::RESAMPLE_INTERPOLATE; emulation_s.fastSampling = false; } // static helpers const TCHAR* readKey(iniHandler &ini, const TCHAR *key) { const TCHAR* value = ini.getValue(key); if (value == nullptr) { // Doesn't exist, add it ini.addValue(key, TEXT("")); debug(TEXT("Key doesn't exist: "), key); } else if (!value[0]) { // Ignore empty values return nullptr; } return value; } void readDouble(iniHandler &ini, const TCHAR *key, double &result) { const TCHAR* value = readKey(ini, key); if (value == nullptr) return; try { result = dataParser::parseDouble(value); } catch (dataParser::parseError const &e) { error(TEXT("Error parsing double at "), key); } } void readInt(iniHandler &ini, const TCHAR *key, int &result) { const TCHAR* value = readKey(ini, key); if (value == nullptr) return; try { result = dataParser::parseInt(value); } catch (dataParser::parseError const &e) { error(TEXT("Error parsing int at "), key); } } void readBool(iniHandler &ini, const TCHAR *key, bool &result) { const TCHAR* value = readKey(ini, key); if (value == nullptr) return; try { result = dataParser::parseBool(value); } catch (dataParser::parseError const &e) { error(TEXT("Error parsing bool at "), key); } } SID_STRING readString(iniHandler &ini, const TCHAR *key) { const TCHAR* value = ini.getValue(key); if (value == nullptr) { // Doesn't exist, add it ini.addValue(key, TEXT("")); debug(TEXT("Key doesn't exist: "), key); return SID_STRING(); } return SID_STRING(value); } void readChar(iniHandler &ini, const TCHAR *key, char &ch) { SID_STRING str = readString(ini, key); if (str.empty()) return; TCHAR c = 0; // Check if we have an actual chanracter if (str[0] == '\'') { if (str[2] != '\'') return; else c = str[1]; } // Nope is number else { try { c = dataParser::parseInt(str.c_str()); } catch (dataParser::parseError const &e) { error(TEXT("Error parsing int at "), key); } } // Clip off special characters if ((unsigned) c >= 32) ch = c; } bool readTime(iniHandler &ini, const TCHAR *key, int &value) { SID_STRING str = readString(ini, key); if (str.empty()) return false; int time; int milliseconds = 0; const size_t sep = str.find_first_of(':'); const size_t dot = str.find_first_of('.'); try { if (sep == SID_STRING::npos) { // User gave seconds time = dataParser::parseInt(str.c_str()); } else { // Read in MM:SS.mmm format const int min = dataParser::parseInt(str.substr(0, sep).c_str()); if (min < 0 || min > 99) goto IniCofig_readTime_error; time = min * 60; int sec; if (dot == SID_STRING::npos) { sec = dataParser::parseInt(str.substr(sep + 1).c_str()); } else { sec = dataParser::parseInt(str.substr(sep + 1, dot - sep).c_str()); SID_STRING msec = str.substr(dot + 1); milliseconds = dataParser::parseInt(msec.c_str()); switch (msec.length()) { case 1: milliseconds *= 100; break; case 2: milliseconds *= 10; break; case 3: break; default: goto IniCofig_readTime_error; } } if (sec < 0 || sec > 59) goto IniCofig_readTime_error; time += sec; } } catch (dataParser::parseError const &e) { error(TEXT("Error parsing time at "), key); return false; } value = time * 1000 + milliseconds; return true; IniCofig_readTime_error: error(TEXT("Invalid time at "), key); return false; } void IniConfig::readSidplay2(iniHandler &ini) { if (!ini.setSection(TEXT("SIDPlayfp"))) ini.addSection(TEXT("SIDPlayfp")); int version = sidplay2_s.version; readInt(ini, TEXT("Version"), version); if (version > 0) sidplay2_s.version = version; sidplay2_s.database = readString(ini, TEXT("Songlength Database")); #if !defined _WIN32 if (sidplay2_s.database.empty()) { SID_STRING buffer(utils::getDataPath()); buffer.append(SEPARATOR).append(DIR_NAME).append(SEPARATOR).append("Songlengths.txt"); if (::access(buffer.c_str(), R_OK) == 0) sidplay2_s.database.assign(buffer); } #endif int time; if (readTime(ini, TEXT("Default Play Length"), time)) sidplay2_s.playLength = time; if (readTime(ini, TEXT("Default Record Length"), time)) sidplay2_s.recordLength = time; sidplay2_s.kernalRom = readString(ini, TEXT("Kernal Rom")); sidplay2_s.basicRom = readString(ini, TEXT("Basic Rom")); sidplay2_s.chargenRom = readString(ini, TEXT("Chargen Rom")); readInt(ini, TEXT("VerboseLevel"), sidplay2_s.verboseLevel); } void IniConfig::readConsole(iniHandler &ini) { if (!ini.setSection (TEXT("Console"))) ini.addSection(TEXT("Console")); readBool(ini, TEXT("Ansi"), console_s.ansi); readChar(ini, TEXT("Char Top Left"), console_s.topLeft); readChar(ini, TEXT("Char Top Right"), console_s.topRight); readChar(ini, TEXT("Char Bottom Left"), console_s.bottomLeft); readChar(ini, TEXT("Char Bottom Right"), console_s.bottomRight); readChar(ini, TEXT("Char Vertical"), console_s.vertical); readChar(ini, TEXT("Char Horizontal"), console_s.horizontal); readChar(ini, TEXT("Char Junction Left"), console_s.junctionLeft); readChar(ini, TEXT("Char Junction Right"), console_s.junctionRight); } void IniConfig::readAudio(iniHandler &ini) { if (!ini.setSection (TEXT("Audio"))) ini.addSection(TEXT("Audio")); readInt(ini, TEXT("Frequency"), audio_s.frequency); readInt(ini, TEXT("Channels"), audio_s.channels); readInt(ini, TEXT("BitsPerSample"), audio_s.precision); readInt(ini, TEXT("BufferLength"), audio_s.bufLength); } void IniConfig::readEmulation(iniHandler &ini) { if (!ini.setSection (TEXT("Emulation"))) ini.addSection(TEXT("Emulation")); emulation_s.engine = readString (ini, TEXT("Engine")); { SID_STRING str = readString (ini, TEXT("C64Model")); if (!str.empty()) { if (str.compare(TEXT("PAL")) == 0) emulation_s.modelDefault = SidConfig::PAL; else if (str.compare(TEXT("NTSC")) == 0) emulation_s.modelDefault = SidConfig::NTSC; else if (str.compare(TEXT("OLD_NTSC")) == 0) emulation_s.modelDefault = SidConfig::OLD_NTSC; else if (str.compare(TEXT("DREAN")) == 0) emulation_s.modelDefault = SidConfig::DREAN; } } readBool(ini, TEXT("ForceC64Model"), emulation_s.modelForced); readBool(ini, TEXT("DigiBoost"), emulation_s.digiboost); { SID_STRING str = readString(ini, TEXT("CiaModel")); if (!str.empty()) { if (str.compare(TEXT("MOS6526")) == 0) emulation_s.ciaModel = SidConfig::MOS6526; else if (str.compare(TEXT("MOS8521")) == 0) emulation_s.ciaModel = SidConfig::MOS8521; } } { SID_STRING str = readString(ini, TEXT("SidModel")); if (!str.empty()) { if (str.compare(TEXT("MOS6581")) == 0) emulation_s.sidModel = SidConfig::MOS6581; else if (str.compare(TEXT("MOS8580")) == 0) emulation_s.sidModel = SidConfig::MOS8580; } } readBool(ini, TEXT("ForceSidModel"), emulation_s.forceModel); readBool(ini, TEXT("UseFilter"), emulation_s.filter); readDouble(ini, TEXT("FilterBias"), emulation_s.bias); readDouble(ini, TEXT("FilterCurve6581"), emulation_s.filterCurve6581); #ifdef FEAT_FILTER_RANGE { // For backward compatibility, remove for 3.0 const TCHAR *key = TEXT("filterRange6581"); const TCHAR* value = ini.getValue(key); if (value && value[0]) { ini.addValue(TEXT("FilterRange6581"), value); ini.removeValue(key); } } readDouble(ini, TEXT("FilterRange6581"), emulation_s.filterRange6581); #endif readDouble(ini, TEXT("FilterCurve8580"), emulation_s.filterCurve8580); #ifdef FEAT_CW_STRENGTH { SID_STRING str = readString(ini, TEXT("CombinedWaveforms")); if (!str.empty()) { if (str.compare(TEXT("AVERAGE")) == 0) emulation_s.combinedWaveformsStrength = SidConfig::AVERAGE; else if (str.compare(TEXT("WEAK")) == 0) emulation_s.combinedWaveformsStrength = SidConfig::WEAK; else if (str.compare(TEXT("STRONG")) == 0) emulation_s.combinedWaveformsStrength = SidConfig::STRONG; } } #endif readInt(ini, TEXT("PowerOnDelay"), emulation_s.powerOnDelay); { SID_STRING str = readString(ini, TEXT("Sampling")); if (!str.empty()) { if (str.compare(TEXT("INTERPOLATE")) == 0) emulation_s.samplingMethod = SidConfig::INTERPOLATE; else if (str.compare(TEXT("RESAMPLE")) == 0) emulation_s.samplingMethod = SidConfig::RESAMPLE_INTERPOLATE; } } readBool(ini, TEXT("ResidFastSampling"), emulation_s.fastSampling); } class iniError { private: const SID_STRING msg; public: iniError(const TCHAR* msg) : msg(msg) {} const SID_STRING message() const { return msg; } }; void createDir(const SID_STRING& path) { #ifndef _WIN32 DIR *dir = opendir(path.c_str()); if (dir) { closedir(dir); } else if (errno == ENOENT) { if (mkdir(path.c_str(), 0755) < 0) { throw iniError(strerror(errno)); } } else { throw iniError(strerror(errno)); } #else if (GetFileAttributes(path.c_str()) == INVALID_FILE_ATTRIBUTES) { if (CreateDirectory(path.c_str(), NULL) == 0) { LPTSTR pBuffer; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&pBuffer, 0, NULL); iniError err(pBuffer); LocalFree(pBuffer); throw err; } } #endif } SID_STRING getConfigPath() { SID_STRING configPath; try { configPath = utils::getConfigPath(); } catch (utils::error const &e) { throw iniError(TEXT("Cannot get config path!")); } debug(TEXT("Config path: "), configPath.c_str()); // Make sure the config path exists createDir(configPath); configPath.append(SEPARATOR).append(DIR_NAME); // Make sure the app config path exists createDir(configPath); configPath.append(SEPARATOR).append(FILE_NAME); debug(TEXT("Config file: "), configPath.c_str()); return configPath; } bool tryOpen(MAYBE_UNUSED iniHandler &ini) { #ifdef _WIN32 { // Try exec dir first SID_STRING execPath(utils::getExecPath()); execPath.append(SEPARATOR).append(FILE_NAME); if (ini.tryOpen(execPath.c_str())) return true; } #endif return false; } void IniConfig::read() { clear(); iniHandler ini; if (!tryOpen(ini)) { try { SID_STRING configPath = getConfigPath(); // Opens an existing file or creates a new one if (!ini.open(configPath.c_str())) { error(TEXT("Error reading config file!")); return; } } catch (iniError const &e) { error(e.message().c_str()); return; } } readSidplay2 (ini); readConsole (ini); readAudio (ini); readEmulation (ini); m_fileName = ini.getFilename(); ini.close(); } sidplayfp-2.15.2/src/IniConfig.h000066400000000000000000000071241510162011500163750ustar00rootroot00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2011-2021 Leandro Nini * Copyright 2000 Simon White * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef INICONFIG_H #define INICONFIG_H #include "ini/types.h" #include "ini/iniHandler.h" #include "sidlib_features.h" #include #include /* * Sidplayfp config file reader. */ class IniConfig { public: struct sidplay2_section { int version; SID_STRING database; uint_least32_t playLength; uint_least32_t recordLength; SID_STRING kernalRom; SID_STRING basicRom; SID_STRING chargenRom; int verboseLevel; }; struct console_section { // INI Section - [Console] bool ansi; char topLeft; char topRight; char bottomLeft; char bottomRight; char vertical; char horizontal; char junctionLeft; char junctionRight; }; struct audio_section { // INI Section - [Audio] int frequency; // sample rate int channels; // number of channels int precision; // sample precision in bits int bufLength; // buffer length in milliseconds int getBufSize() const { return (bufLength * frequency) / 1000; } }; struct emulation_section { // INI Section - [Emulation] SID_STRING engine; SidConfig::c64_model_t modelDefault; bool modelForced; SidConfig::sid_model_t sidModel; bool forceModel; SidConfig::cia_model_t ciaModel; bool digiboost; bool filter; double bias; double filterCurve6581; #ifdef FEAT_FILTER_RANGE double filterRange6581; #endif double filterCurve8580; #ifdef FEAT_CW_STRENGTH SidConfig::sid_cw_t combinedWaveformsStrength; #endif int powerOnDelay; SidConfig::sampling_method_t samplingMethod; bool fastSampling; }; protected: struct sidplay2_section sidplay2_s; struct console_section console_s; struct audio_section audio_s; struct emulation_section emulation_s; protected: void clear (); void readSidplay2 (iniHandler &ini); void readConsole (iniHandler &ini); void readAudio (iniHandler &ini); void readEmulation (iniHandler &ini); private: SID_STRING m_fileName; public: IniConfig (); ~IniConfig (); SID_STRING getFilename() const { return m_fileName; } void read (); // Sidplayfp Specific Section const sidplay2_section& sidplay2 () { return sidplay2_s; } const console_section& console () { return console_s; } const audio_section& audio () { return audio_s; } const emulation_section& emulation () { return emulation_s; } }; #endif // INICONFIG_H sidplayfp-2.15.2/src/args.cpp000066400000000000000000000556101510162011500160220ustar00rootroot00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2011-2025 Leandro Nini * Copyright 2000-2001 Simon White * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "player.h" #include #include #include #include #include "ini/types.h" #include "sidlib_features.h" #include "sidcxx11.h" using std::cout; using std::cerr; using std::endl; #ifdef HAVE_SIDPLAYFP_BUILDERS_HARDSID_H # include #endif #ifdef HAVE_SIDPLAYFP_BUILDERS_EXSID_H # include #endif // Wide-chars are not yet supported here #undef SEPARATOR #define SEPARATOR "/" /** * Try load SID tune from HVSC_BASE */ bool ConsolePlayer::tryOpenTune(const char *hvscBase) { std::string newFileName(hvscBase); newFileName.append(SEPARATOR).append(m_filename); m_tune.load(newFileName.c_str()); if (!m_tune.getStatus()) { return false; } m_filename.assign(newFileName); return true; } /** * Try load songlength DB from HVSC_BASE */ bool ConsolePlayer::tryOpenDatabase(const char *hvscBase, const char *suffix) { std::string newFileName(hvscBase); newFileName.append(SEPARATOR).append("DOCUMENTS").append(SEPARATOR).append("Songlengths.").append(suffix); return m_database.open(newFileName.c_str()); } // Convert time from integer bool parseTime(const char *str, uint_least32_t &time) { // Check for empty string if (*str == '\0') return false; uint_least32_t _time; uint_least32_t milliseconds = 0; char *sep = (char *) strstr (str, ":"); if (!sep) { // User gave seconds _time = atoi (str); } else { // Read in MM:SS[.mmm] format int val; *sep = '\0'; val = atoi (str); if (val < 0 || val > 99) return false; _time = (uint_least32_t) val * 60; // parse milliseconds char *milli = (char *) strstr (sep+1, "."); if (milli) { char *start = milli + 1; char *end; milliseconds = strtol(start, &end, 10); switch (end - start) { case 1: milliseconds *= 100; break; case 2: milliseconds *= 10; break; case 3: break; default: return false; } if (milliseconds > 999) return false; *milli = '\0'; } val = atoi (sep + 1); if (val < 0 || val > 59) return false; _time += (uint_least32_t) val; } time = _time * 1000 + milliseconds; return true; } bool parseAddress(const char *str, uint_least16_t &address) { if (*str == '\0') return false; long x = strtol(str, nullptr, 0); address = x; return true; } void displayDebugArgs() { std::ostream &out = cout; out << "Debug Options:" << endl << " --cpu-debug display cpu register and assembly dumps" << endl << " --delay= simulate c64 power on delay (default: random)" << endl << " --noaudio no audio output device" << endl << " --nosid no sid emulation" << endl << " --none no audio output device and no sid emulation" << endl; } // Parse command line arguments int ConsolePlayer::args(int argc, const char *argv[]) { if (argc == 0) // at least one argument required { displayArgs (); return -1; } // default arg options m_driver.output = output_t::SOUNDCARD; m_driver.file = false; m_driver.info = false; m_mute_channel.reset(); int infile = 0; int i = 0; bool err = false; // parse command line arguments while ((i < argc) && (argv[i] != nullptr)) { if ((argv[i][0] == '-') && (argv[i][1] != '\0')) { // help options if ((argv[i][1] == 'h') || !std::strcmp(&argv[i][1], "-help")) { displayArgs (); return 0; } else if (!std::strcmp(&argv[i][1], "-help-debug")) { displayDebugArgs (); return 0; } else if (argv[i][1] == 'b') { if (!parseTime (&argv[i][2], m_timer.start)) err = true; } else if (strncmp (&argv[i][1], "ds", 2) == 0) { // Override sidTune and enable the second sid if (!parseAddress (&argv[i][3], m_engCfg.secondSidAddress)) err = true; } else if (strncmp (&argv[i][1], "ts", 2) == 0) { // Override sidTune and enable the third sid if (!parseAddress (&argv[i][3], m_engCfg.thirdSidAddress)) err = true; } #ifdef FEAT_NEW_PLAY_API else if (strncmp (&argv[i][1], "fo", 2) == 0) { if (argv[i][3] == '\0') err = true; m_fadeoutTime = (uint_least32_t) atoi (&argv[i][3]); } #endif else if (argv[i][1] == 'f') { if (argv[i][2] == '\0') err = true; m_engCfg.frequency = (uint_least32_t) atoi (argv[i]+2); } // No filter options else if (strncmp (&argv[i][1], "nf", 2) == 0) { if (argv[i][3] == '\0') m_filter.enabled = false; } // Track options else if (strncmp (&argv[i][1], "ols", 3) == 0) { m_track.loop = true; m_track.single = true; m_track.first = atoi(&argv[i][4]); } else if (strncmp (&argv[i][1], "ol", 2) == 0) { m_track.loop = true; m_track.first = atoi(&argv[i][3]); } else if (strncmp (&argv[i][1], "os", 2) == 0) { m_track.single = true; m_track.first = atoi(&argv[i][3]); } else if (argv[i][1] == 'o') { // User forgot track number ? if (argv[i][2] == '\0') err = true; m_track.first = atoi(&argv[i][2]); } // Channel muting else if (argv[i][1] == 'u') { if (argv[i][2] == '\0') err = true; else { const unsigned int voice = atoi(&argv[i][2]); if (voice > 0 && voice <= m_mute_channel.size()) m_mute_channel[voice-1] = true; } } #ifdef FEAT_SAMPLE_MUTE // Sample muting else if (argv[i][1] == 'g') { if (argv[i][2] == '\0') err = true; else { const unsigned int chip = atoi(&argv[i][2]); if (chip > 0 && chip <= m_mute_samples.size()) m_mute_samples[chip-1] = true; } } #endif else if (argv[i][1] == 'p') { // User forgot precision if (argv[i][2] == '\0') err = true; { uint_least8_t precision = atoi(&argv[i][2]); if (precision <= 16) m_precision = 16; else m_precision = 32; } } else if (argv[i][1] == 'q') { if (argv[i][2] == '\0') m_quietLevel = 1; else m_quietLevel = atoi(&argv[i][2]); } else if (argv[i][1] == 't') { if (!parseTime (&argv[i][2], m_timer.length)) err = true; m_timer.valid = true; } // Resampling Options ---------- else if (std::strcmp (&argv[i][1], "rif") == 0) { m_engCfg.samplingMethod = SidConfig::INTERPOLATE; m_engCfg.fastSampling = true; } else if (std::strcmp (&argv[i][1], "rrf") == 0) { m_engCfg.samplingMethod = SidConfig::RESAMPLE_INTERPOLATE; m_engCfg.fastSampling = true; } else if (std::strcmp (&argv[i][1], "ri") == 0) { m_engCfg.samplingMethod = SidConfig::INTERPOLATE; } else if (std::strcmp (&argv[i][1], "rr") == 0) { m_engCfg.samplingMethod = SidConfig::RESAMPLE_INTERPOLATE; } // SID model options else if (std::strcmp (&argv[i][1], "mof") == 0) { m_engCfg.defaultSidModel = SidConfig::MOS6581; m_engCfg.forceSidModel = true; } else if (std::strcmp (&argv[i][1], "mnf") == 0) { m_engCfg.defaultSidModel = SidConfig::MOS8580; m_engCfg.forceSidModel = true; } else if (std::strcmp (&argv[i][1], "mo") == 0) { m_engCfg.defaultSidModel = SidConfig::MOS6581; } else if (std::strcmp (&argv[i][1], "mn") == 0) { m_engCfg.defaultSidModel = SidConfig::MOS8580; } else if (argv[i][1] == 's') { // Stereo Playback m_channels = 2; } else if (argv[i][1] == 'm') { // Mono Playback m_channels = 1; } else if (std::strcmp (&argv[i][1], "-digiboost") == 0) { m_engCfg.digiBoost = true; } // Video/Verbose Options else if (std::strcmp (&argv[i][1], "vnf") == 0) { m_engCfg.forceC64Model = true; m_engCfg.defaultC64Model = SidConfig::NTSC; } else if (std::strcmp (&argv[i][1], "vpf") == 0) { m_engCfg.forceC64Model = true; m_engCfg.defaultC64Model = SidConfig::PAL; } else if (std::strcmp (&argv[i][1], "vf") == 0) { m_engCfg.forceC64Model = true; } else if (std::strcmp (&argv[i][1], "vn") == 0) { m_engCfg.defaultC64Model = SidConfig::NTSC; } else if (std::strcmp (&argv[i][1], "vp") == 0) { m_engCfg.defaultC64Model = SidConfig::PAL; } else if (argv[i][1] == 'v') { if (argv[i][2] == '\0') m_verboseLevel = 1; else m_verboseLevel = atoi(&argv[i][2]); } else if (strncmp (&argv[i][1], "-delay=", 7) == 0) { m_engCfg.powerOnDelay = (uint_least16_t) atoi(&argv[i][8]); } else if (strncmp (&argv[i][1], "-fcurve=", 8) == 0) { if (strncmp (&argv[i][9], "auto", 4) == 0) { m_autofilter = true; } else { m_fcurve = atof(&argv[i][9]); } } #ifdef FEAT_FILTER_RANGE else if (strncmp (&argv[i][1], "-frange=", 8) == 0) { if (strncmp (&argv[i][9], "auto", 4) == 0) { m_autofilter = true; } else { m_frange = atof(&argv[i][9]); } } #endif #ifdef FEAT_CW_STRENGTH else if (std::strcmp (&argv[i][1], "cww") == 0) { m_combinedWaveformsStrength = SidConfig::WEAK; } else if (std::strcmp (&argv[i][1], "cwa") == 0) { m_combinedWaveformsStrength = SidConfig::AVERAGE; } else if (std::strcmp (&argv[i][1], "cws") == 0) { m_combinedWaveformsStrength = SidConfig::STRONG; } #endif // File format conversions else if (argv[i][1] == 'w') { m_driver.output = output_t::WAV; m_driver.file = true; if (argv[i][2] != '\0') m_outfile = &argv[i][2]; } else if (strncmp (&argv[i][1], "-wav", 4) == 0) { m_driver.output = output_t::WAV; m_driver.file = true; if (argv[i][5] != '\0') m_outfile = &argv[i][5]; } else if (strncmp (&argv[i][1], "-au", 3) == 0) { m_driver.output = output_t::AU; m_driver.file = true; if (argv[i][4] != '\0') m_outfile = &argv[i][4]; } else if (strncmp (&argv[i][1], "-info", 5) == 0) { m_driver.info = true; } #ifdef HAVE_SIDPLAYFP_BUILDERS_RESIDFP_H else if (std::strcmp (&argv[i][1], "-residfp") == 0) { m_driver.sid = EMU_RESIDFP; } #endif // HAVE_SIDPLAYFP_BUILDERS_RESIDFP_H #ifdef HAVE_SIDPLAYFP_BUILDERS_RESID_H else if (std::strcmp (&argv[i][1], "-resid") == 0) { m_driver.sid = EMU_RESID; } #endif // HAVE_SIDPLAYFP_BUILDERS_RESID_H // Hardware selection #ifdef HAVE_SIDPLAYFP_BUILDERS_HARDSID_H else if (std::strcmp (&argv[i][1], "-hardsid") == 0) { m_driver.sid = EMU_HARDSID; m_driver.output = output_t::NONE; } #endif // HAVE_SIDPLAYFP_BUILDERS_HARDSID_H #ifdef HAVE_SIDPLAYFP_BUILDERS_EXSID_H else if (std::strcmp (&argv[i][1], "-exsid") == 0) { m_driver.sid = EMU_EXSID; m_driver.output = output_t::NONE; } #endif // HAVE_SIDPLAYFP_BUILDERS_EXSID_H // These are for debug else if (std::strcmp (&argv[i][1], "-none") == 0) { m_driver.sid = EMU_NONE; m_driver.output = output_t::NONE; } else if (std::strcmp (&argv[i][1], "-nosid") == 0) { m_driver.sid = EMU_NONE; } else if (std::strcmp (&argv[i][1], "-noaudio") == 0) { m_driver.output = output_t::NONE; } else if (std::strcmp (&argv[i][1], "-cpu-debug") == 0) { m_cpudebug = true; } else { err = true; } } else { // Reading file name if (infile == 0) infile = i; else err = true; } if (err) { displayArgs (argv[i]); return -1; } i++; // next index } #ifdef FEAT_NEW_PLAY_API // convert to milliseconds m_fadeoutTime *= 1000; #endif const char* hvscBase = getenv("HVSC_BASE"); // Load the tune m_filename = argv[infile]; m_tune.load(m_filename.c_str()); if (!m_tune.getStatus()) { std::string errorString(m_tune.statusString()); // Try prepending HVSC_BASE if (!hvscBase || !tryOpenTune(hvscBase)) { displayError(errorString.c_str()); return -1; } } // If filename specified we can only convert one song if (m_outfile != nullptr) m_track.single = true; // Can only loop if not creating audio files if (m_driver.output > output_t::SOUNDCARD) m_track.loop = false; // Check to see if we are trying to generate an audio file // whilst using a hardware emulation if (m_driver.file && (m_driver.sid >= EMU_HARDSID)) { displayError ("ERROR: Cannot generate audio files using hardware emulations"); return -1; } if (m_driver.info && m_driver.file) { displayError ("WARNING: metadata can be added only to wav files"); } // Select the desired track m_track.first = m_tune.selectSong (m_track.first); m_track.selected = m_track.first; if (m_track.single) m_track.songs = 1; // If user provided no time then load songlength database // and set default lengths in case it's not found in there. { if (m_driver.file && m_timer.valid && !m_timer.length) { // Time of 0 provided for wav generation displayError ("ERROR: -t0 invalid in record mode"); return -1; } if (!m_timer.valid) { m_timer.length = m_driver.file ? (m_iniCfg.sidplay2()).recordLength : (m_iniCfg.sidplay2()).playLength; songlengthDB = sldb_t::NONE; bool dbOpened = false; if (hvscBase) { if (tryOpenDatabase(hvscBase, "md5")) { dbOpened = true; songlengthDB = sldb_t::MD5; } else if (tryOpenDatabase(hvscBase, "txt")) { dbOpened = true; songlengthDB = sldb_t::TXT; } } if (!dbOpened) { // Try load user configured songlength DB if ((m_iniCfg.sidplay2()).database.length() != 0) { // Try loading the database specificed by the user #if defined(_WIN32) && defined(UNICODE) # ifdef FEAT_DB_WCHAR_OPEN const wchar_t *database = (m_iniCfg.sidplay2()).database.c_str(); # else char database[MAX_PATH]; const int ret = wcstombs(database, (m_iniCfg.sidplay2()).database.c_str(), sizeof(database)); if (ret >= MAX_PATH) database[0] = '\0'; # endif #else const char *database = (m_iniCfg.sidplay2()).database.c_str(); #endif if (!m_database.open(database)) { displayError (m_database.error ()); return -1; } if ((m_iniCfg.sidplay2()).database.find(TEXT(".md5")) != SID_STRING::npos) songlengthDB = sldb_t::MD5; else songlengthDB = sldb_t::TXT; } } } } #if HAVE_TSID == 1 // Set TSIDs base directory if (!m_tsid.setBaseDir(true)) { displayError (m_tsid.getError ()); return -1; } #endif // Configure engine with settings if (!m_engine.config (m_engCfg)) { // Config failed displayError (m_engine.error ()); return -1; } return 1; } void ConsolePlayer::displayArgs (const char *arg) { std::ostream &out = arg ? cerr : cout; if (arg) out << "Option Error: " << arg << endl; else out << "Syntax: " << m_name << " [-