pax_global_header00006660000000000000000000000064146313327230014516gustar00rootroot0000000000000052 comment=d368652b7f1cad01c2fcd4b8d931fcc537df5793 sidplayfp-2.8.0/000077500000000000000000000000001463133272300135205ustar00rootroot00000000000000sidplayfp-2.8.0/.github/000077500000000000000000000000001463133272300150605ustar00rootroot00000000000000sidplayfp-2.8.0/.github/workflows/000077500000000000000000000000001463133272300171155ustar00rootroot00000000000000sidplayfp-2.8.0/.github/workflows/build.yml000066400000000000000000000006531463133272300207430ustar00rootroot00000000000000name: CI on: push: branches: [ master ] pull_request: branches: [ master ] jobs: build: runs-on: ubuntu-latest steps: - name: deps run: sudo apt-get install gettext libsidplayfp-dev libstilview-dev libmpg123-dev - uses: actions/checkout@v3 - name: bootstrap run: autoreconf -vfi - name: configure run: ./configure - name: make distcheck run: make distcheck sidplayfp-2.8.0/.github/workflows/codeql.yml000066400000000000000000000031601463133272300211070ustar00rootroot00000000000000# name: "CodeQL" on: push: branches: [ "master" ] pull_request: # The branches below must be a subset of the branches above branches: [ "master" ] jobs: analyze: name: Analyze runs-on: ubuntu-latest permissions: actions: read contents: read security-events: write strategy: fail-fast: false matrix: language: [ 'cpp' ] steps: - name: deps run: sudo apt-get install gettext libsidplayfp-dev libstilview-dev libmpg123-dev - name: Checkout repository uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 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@v2 # â„šī¸ 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@v2 with: category: "/language:${{matrix.language}}" sidplayfp-2.8.0/.github/workflows/release.yml000066400000000000000000000014651463133272300212660ustar00rootroot00000000000000name: 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@v3 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.8.0/.gitignore000066400000000000000000000004401463133272300155060ustar00rootroot00000000000000aclocal.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.8.0/AUTHORS000066400000000000000000000033611463133272300145730ustar00rootroot00000000000000sidplayfp 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-2024 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 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.8.0/COPYING000066400000000000000000000432541463133272300145630ustar00rootroot00000000000000 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.8.0/Makefile.am000066400000000000000000000046161463133272300155630ustar00rootroot00000000000000 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/keyboard.cpp \ src/keyboard.h \ src/main.cpp \ src/menu.cpp \ src/player.cpp \ src/player.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/dataParser.h \ 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.8.0/README000066400000000000000000000045131463133272300144030ustar00rootroot00000000000000sidplayfp ========= 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-2024 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 -i 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.8.0/TODO000066400000000000000000000002431463133272300142070ustar00rootroot00000000000000TODO: * drop audio drivers and use out123 * support unicode filenames on Windows (depends on libsidplayfp) * add playlist support (pls) * fix building on Cygwin sidplayfp-2.8.0/build-aux/000077500000000000000000000000001463133272300154125ustar00rootroot00000000000000sidplayfp-2.8.0/build-aux/config.rpath000066400000000000000000000003551463133272300177220ustar00rootroot00000000000000# 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.8.0/configure.ac000066400000000000000000000060571463133272300160160ustar00rootroot00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT([sidplayfp], [2.8.0], [], [], [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_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 >= 1.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"]) # hack? saveCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $SIDPLAYFP_CFLAGS" AC_CHECK_HEADERS([sidplayfp/builders/residfp.h \ sidplayfp/builders/resid.h \ sidplayfp/builders/hardsid.h \ sidplayfp/builders/exsid.h]) CPPFLAGS=$saveCPPFLAGS AC_MSG_CHECKING([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([Build without debugging messages]); debug_flags=-DNDEBUG] ) AC_SUBST([debug_flags]) AC_CONFIG_FILES([ Makefile ]) AC_OUTPUT sidplayfp-2.8.0/doc/000077500000000000000000000000001463133272300142655ustar00rootroot00000000000000sidplayfp-2.8.0/doc/en/000077500000000000000000000000001463133272300146675ustar00rootroot00000000000000sidplayfp-2.8.0/doc/en/USAGE.txt000066400000000000000000000602131463133272300162760ustar00rootroot00000000000000STILVIEW 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.8.0/doc/en/sidplayfp.ini.pod000066400000000000000000000173061463133272300201530ustar00rootroot00000000000000īģŋ=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 output. Using values other than the ones specified will produce invalid output. =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 as 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.8.0/doc/en/sidplayfp.pod000066400000000000000000000175531463133272300174010ustar00rootroot00000000000000īģŋ=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 specification machines at the cost of accuracy. =head1 OPTIONS =over =item B<-h, --help> Display help. =item B<-h, --help-debug> Display additional options helpful for debugging. =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<-o>I<< >> Select track number (default: preset). =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<-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<< >> Option 'l' will select continuous track looping while 's' will select the current track instead of all. This option can be combined with the track selection to form -ols. =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 mulation. 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<--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 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.8.0/doc/en/stilview.pod000066400000000000000000000606631463133272300172540ustar00rootroot00000000000000īģŋ=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.8.0/m4/000077500000000000000000000000001463133272300140405ustar00rootroot00000000000000sidplayfp-2.8.0/m4/ax_cxx_compile_stdcxx.m4000066400000000000000000000520731463133272300207100ustar00rootroot00000000000000# =========================================================================== # 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', or '20' 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 JÃļrn Heusipp # # 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 18 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"], [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 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/ #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 __cplusplus < 201703L && !defined _MSC_VER #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 // __cplusplus < 201703L && !defined _MSC_VER ]]) 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 __cplusplus < 202002L && !defined _MSC_VER #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 // __cplusplus < 202002L && !defined _MSC_VER ]]) sidplayfp-2.8.0/m4/ax_cxx_compile_stdcxx_11.m4000066400000000000000000000032151463133272300212030ustar00rootroot00000000000000# ============================================================================= # https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html # ============================================================================= # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the C++11 # standard; if necessary, add switches to CXX and CXXCPP to enable # support. # # This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX # macro with the version set to C++11. The two optional arguments are # forwarded literally as the second and third argument respectively. # Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for # more information. If you want to use this macro, you also need to # download the ax_cxx_compile_stdcxx.m4 file. # # 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 # # 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 18 AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])]) sidplayfp-2.8.0/m4/ax_cxx_compile_stdcxx_14.m4000066400000000000000000000025131463133272300212060ustar00rootroot00000000000000# ============================================================================= # https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_14.html # ============================================================================= # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX_14([ext|noext], [mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the C++14 # standard; if necessary, add switches to CXX and CXXCPP to enable # support. # # This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX # macro with the version set to C++14. The two optional arguments are # forwarded literally as the second and third argument respectively. # Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for # more information. If you want to use this macro, you also need to # download the ax_cxx_compile_stdcxx.m4 file. # # LICENSE # # Copyright (c) 2015 Moritz Klammler # # 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 5 AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) AC_DEFUN([AX_CXX_COMPILE_STDCXX_14], [AX_CXX_COMPILE_STDCXX([14], [$1], [$2])]) sidplayfp-2.8.0/m4/ax_cxx_compile_stdcxx_17.m4000066400000000000000000000026051463133272300212130ustar00rootroot00000000000000# ============================================================================= # https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_17.html # ============================================================================= # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX_17([ext|noext], [mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the C++17 # standard; if necessary, add switches to CXX and CXXCPP to enable # support. # # This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX # macro with the version set to C++17. The two optional arguments are # forwarded literally as the second and third argument respectively. # Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for # more information. If you want to use this macro, you also need to # download the ax_cxx_compile_stdcxx.m4 file. # # LICENSE # # Copyright (c) 2015 Moritz Klammler # Copyright (c) 2016 Krzesimir Nowak # # 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 2 AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) AC_DEFUN([AX_CXX_COMPILE_STDCXX_17], [AX_CXX_COMPILE_STDCXX([17], [$1], [$2])]) sidplayfp-2.8.0/src/000077500000000000000000000000001463133272300143075ustar00rootroot00000000000000sidplayfp-2.8.0/src/IniConfig.cpp000066400000000000000000000361401463133272300166640ustar00rootroot00000000000000/* * 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 "ini/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; emulation_s.modelDefault = SidConfig::PAL; emulation_s.modelForced = false; emulation_s.sidModel = SidConfig::MOS6581; emulation_s.forceModel = false; #ifdef FEAT_CONFIG_CIAMODEL emulation_s.ciaModel = SidConfig::MOS6526; #endif 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); } 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); #ifdef FEAT_CONFIG_CIAMODEL { 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; } } #endif { 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 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.8.0/src/IniConfig.h000066400000000000000000000066631463133272300163400ustar00rootroot00000000000000/* * 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; int channels; int precision; }; struct emulation_section { // INI Section - [Emulation] SID_STRING engine; SidConfig::c64_model_t modelDefault; bool modelForced; SidConfig::sid_model_t sidModel; bool forceModel; #ifdef FEAT_CONFIG_CIAMODEL SidConfig::cia_model_t ciaModel; #endif 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.8.0/src/args.cpp000066400000000000000000000513341463133272300157550ustar00rootroot00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2011-2023 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 = OUT_SOUNDCARD; m_driver.file = false; m_driver.info = false; for (int i=0; i<9; i++) { vMute[i] = false; } 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') || !strcmp(&argv[i][1], "-help")) { displayArgs (); return 0; } else if (!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; } #ifdef FEAT_THIRD_SID 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; } #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 int voice = atoi(&argv[i][2]); if (voice > 0 && voice <= 9) vMute[voice-1] = true; } } 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 (strcmp (&argv[i][1], "rif") == 0) { m_engCfg.samplingMethod = SidConfig::INTERPOLATE; m_engCfg.fastSampling = true; } else if (strcmp (&argv[i][1], "rrf") == 0) { m_engCfg.samplingMethod = SidConfig::RESAMPLE_INTERPOLATE; m_engCfg.fastSampling = true; } else if (strcmp (&argv[i][1], "ri") == 0) { m_engCfg.samplingMethod = SidConfig::INTERPOLATE; } else if (strcmp (&argv[i][1], "rr") == 0) { m_engCfg.samplingMethod = SidConfig::RESAMPLE_INTERPOLATE; } // SID model options else if (strcmp (&argv[i][1], "mof") == 0) { m_engCfg.defaultSidModel = SidConfig::MOS6581; m_engCfg.forceSidModel = true; } else if (strcmp (&argv[i][1], "mnf") == 0) { m_engCfg.defaultSidModel = SidConfig::MOS8580; m_engCfg.forceSidModel = true; } else if (strcmp (&argv[i][1], "mo") == 0) { m_engCfg.defaultSidModel = SidConfig::MOS6581; } else if (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; } #ifdef FEAT_DIGIBOOST else if (strcmp (&argv[i][1], "-digiboost") == 0) { m_engCfg.digiBoost = true; } #endif // Video/Verbose Options else if (strcmp (&argv[i][1], "vnf") == 0) { m_engCfg.forceC64Model = true; m_engCfg.defaultC64Model = SidConfig::NTSC; } else if (strcmp (&argv[i][1], "vpf") == 0) { m_engCfg.forceC64Model = true; m_engCfg.defaultC64Model = SidConfig::PAL; } else if (strcmp (&argv[i][1], "vf") == 0) { m_engCfg.forceC64Model = true; } else if (strcmp (&argv[i][1], "vn") == 0) { m_engCfg.defaultC64Model = SidConfig::NTSC; } else if (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]); } } // File format conversions else if (argv[i][1] == 'w') { m_driver.output = OUT_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 = OUT_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 = OUT_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 (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 (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 (strcmp (&argv[i][1], "-hardsid") == 0) { m_driver.sid = EMU_HARDSID; m_driver.output = OUT_NULL; } #endif // HAVE_SIDPLAYFP_BUILDERS_HARDSID_H #ifdef HAVE_SIDPLAYFP_BUILDERS_EXSID_H else if (strcmp (&argv[i][1], "-exsid") == 0) { m_driver.sid = EMU_EXSID; m_driver.output = OUT_NULL; } #endif // HAVE_SIDPLAYFP_BUILDERS_EXSID_H // These are for debug else if (strcmp (&argv[i][1], "-none") == 0) { m_driver.sid = EMU_NONE; m_driver.output = OUT_NULL; } else if (strcmp (&argv[i][1], "-nosid") == 0) { m_driver.sid = EMU_NONE; } else if (strcmp (&argv[i][1], "-noaudio") == 0) { m_driver.output = OUT_NULL; } else if (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 } 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 > OUT_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_NONE; bool dbOpened = false; if (hvscBase) { if (tryOpenDatabase(hvscBase, "md5")) { dbOpened = true; songlengthDB = SLDB_MD5; } else if (tryOpenDatabase(hvscBase, "txt")) { dbOpened = true; songlengthDB = SLDB_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_MD5; else songlengthDB = SLDB_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 << " [-