sidplayfp-1.4.0/0000755000076400007640000000000012547546746010544 500000000000000sidplayfp-1.4.0/AUTHORS0000644000076400007640000000320612544211671011514 00000000000000sidplayfp is a C64 music player forked from SIDPLAY2. Copyright (c) 2000 Simon White Copyright (c) 2007-2010 Antti Lankila Copyright (c) 2010-2014 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 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-1.4.0/doc/0000755000076400007640000000000012547546746011311 500000000000000sidplayfp-1.4.0/doc/en/0000755000076400007640000000000012547546746011713 500000000000000sidplayfp-1.4.0/doc/en/sidplayfp.ini.pod0000644000076400007640000001524312544211671015074 00000000000000=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<< >> Path for the Songlength DB. Should point to the F file under the HVSC collection path. 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 F file 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 F file 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 F file under the same locations as above. =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. =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<< >> 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/disable the emulation of the SID filter. =item B=I<< >> Controls the filter bias in the ReSID emulation. The bias is given in millivolts, and a maximum reasonable control range is approximately -500 to 500, the default value is 0. =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 curve for the 8580 model in the ReSIDfp emulation. Value is expressed in Hertz and the default is 12500. =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 originla man page. =back =head1 RESOURCES =over =item SourceForge project: 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-2014 VICE Project =item Copyright (C) 2010-2014 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-1.4.0/doc/en/stilview.pod0000644000076400007640000006071512544211671014175 00000000000000=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 SourceForge project: L =item High Voltage Sid Collection (HVSC): L =back =head1 COPYING =over =item Copyright (C) 1998, 2002 LaLa =item Copyright (C) 2012-2014 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-1.4.0/doc/en/sidplayfp.pod0000644000076400007640000001501712544211671014315 00000000000000=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<-f>I<< >> Set frequency in Hz (default: 48000). =item B<-nf> No filter emulation. This will reduce CPU overhead at the cost of reduced sound 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. =item B<-v>I<[num]> Verbose output while playing. =item B<-b>I<< >> Set start time in [mins:]secs 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 on stereo tunes. =item B<-p>I<< >> Set bit precision for wav saving. The default is 32 (32 bit float), but can be set to 16 to create 16 bit little endian wavs. Other values 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<-q> Quiet output while playing (opposite of verbose). =item B<-s>I<< >> Playback the left or right stereo channel only. =item B<-t>I<< >> Set play length in [mins:]secs 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 from the tune. =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 you override this default behavior. The output file will be with no tune number is added and IS NOT checked for or appended with a legal wav file extension. =item B<--resid> Use Dag Lem's reSID emulation engine. =item B<--residfp> Use Antti Lankila's reSIDfp emulation engine. =item B<--hardsid> Use HardSID device. =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 per-user 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 no longer embedded but 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 SourceForge project: 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-2014 VICE Project =item Copyright (C) 2010-2015 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-1.4.0/doc/en/sidplayfp.10000644000076400007640000003005612544212064013670 00000000000000.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "SIDPLAYFP 1" .TH SIDPLAYFP 1 "2015-06-29" "perl v5.18.4" "User Programs" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" sidplayfp \- a C64 and SID chip emulator for playing Commodore 64 music. .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBsidplayfp\fR [\fI\s-1OPTIONS\s0\fR] \fIdatafile\fR .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBSidplayfp\fR 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. .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-h, \-\-help\fR" 4 .IX Item "-h, --help" Display help. .IP "\fB\-f\fR\fI\fR" 4 .IX Item "-f" Set frequency in Hz (default: 48000). .IP "\fB\-nf\fR" 4 .IX Item "-nf" No filter emulation. This will reduce \s-1CPU\s0 overhead at the cost of reduced sound quality. .IP "\fB\-o\fR\fI\fR Select track number (default: preset)." 4 .IX Item "-o Select track number (default: preset)." .PD 0 .IP "\fB\-s\fR" 4 .IX Item "-s" .PD Stereo playback. If the tune is identified as stereo then sid 1 and 2 become the left and right channels respectively. .IP "\fB\-v\fR\fI[num]\fR" 4 .IX Item "-v[num]" Verbose output while playing. .IP "\fB\-b\fR\fI\fR" 4 .IX Item "-b" Set start time in [mins:]secs format (compatible with sid2wav). .IP "\fB\-ds\fR\fI\fR" 4 .IX Item "-ds" 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 \s-1MUS\s0 and \s-1SID\s0 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. .IP "\fB\-ts\fR\fI\fR" 4 .IX Item "-ts" 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. .IP "\fB\-u\fR\fI\fR" 4 .IX Item "-u" Mute a channel. May be used more than one time. Channel 1 to 3 are for the first \s-1SID\s0 chip while channels from 4 to 6 are for the second one on stereo tunes. .IP "\fB\-p\fR\fI\fR" 4 .IX Item "-p" Set bit precision for wav saving. The default is 32 (32 bit float), but can be set to 16 to create 16 bit little endian wavs. Other values cause invalid output. .IP "\fB\-o\fR\fI\fR" 4 .IX Item "-o" 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. .IP "\fB\-q\fR" 4 .IX Item "-q" Quiet output while playing (opposite of verbose). .IP "\fB\-s\fR\fI\fR" 4 .IX Item "-s" Playback the left or right stereo channel only. .IP "\fB\-t\fR\fI\fR" 4 .IX Item "-t" Set play length in [mins:]secs format (0 is endless). .IP "\fB\-v\fR\fI[f]\fR" 4 .IX Item "-v[f]" Set \s-1VIC\s0 clock speed. 'n' is \s-1NTSC \s0(America, 60Hz) and 'p' is \s-1PAL \&\s0(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. .IP "\fB\-m\fR\fI[f]\fR" 4 .IX Item "-m[f]" Set \s-1SID\s0 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 from the tune. .IP "\fB\-r\fR\fI[f]\fR" 4 .IX Item "-r[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. .IP "\fB\-w, \-\-wav\fR\fI[name]\fR" 4 .IX Item "-w, --wav[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 you override this default behavior. The output file will be with no tune number is added and \s-1IS NOT\s0 checked for or appended with a legal wav file extension. .IP "\fB\-\-resid\fR" 4 .IX Item "--resid" Use Dag Lem's reSID emulation engine. .IP "\fB\-\-residfp\fR" 4 .IX Item "--residfp" Use Antti Lankila's reSIDfp emulation engine. .IP "\fB\-\-hardsid\fR" 4 .IX Item "--hardsid" Use HardSID device. .SH "ENVIRONMENT VARIABLES" .IX Header "ENVIRONMENT VARIABLES" .IP "\fB\s-1HVSC_BASE\s0\fR" 4 .IX Item "HVSC_BASE" The path to the \s-1HVSC\s0 base directory. If specified the songlength \s-1DB\s0 will be loaded from here and relative \s-1SID\s0 tune paths are accepted. .SH "FILES" .IX Header "FILES" .IP "\fIsidplayfp.ini\fR" 4 .IX Item "sidplayfp.ini" The per-user configuration file. See \fIsidplayfp.ini\fR\|(5) for further details. .IP "\fIkernal\fR" 4 .IX Item "kernal" The c64 kernal rom dump file. .IP "\fIbasic\fR" 4 .IX Item "basic" The c64 basic rom dump file. .IP "\fIchargen\fR" 4 .IX Item "chargen" The c64 character generator rom dump file. .SH "BUGS" .IX Header "BUGS" The upstream bug tracker can be found at . .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIsidplayfp.ini\fR\|(5) .SH "NOTES" .IX Header "NOTES" \&\s-1ROM\s0 dumps are no longer embedded but must be supplied by the user. Check the \fIsidplayfp.ini\fR\|(5) documentation for configuration details and default search paths. .SH "AUTHORS" .IX Header "AUTHORS" .IP "Leandro Nini" 4 .IX Item "Leandro Nini" Current maintainer. .IP "Simon White" 4 .IX Item "Simon White" Wrote the original Sidplay2. .IP "Dag Lem" 4 .IX Item "Dag Lem" Wrote the reSID emulation engine. .IP "Antti S. Lankila" 4 .IX Item "Antti S. Lankila" Wrote the reSIDfp emulation engine as a fork of reSID 0.16. .IP "The Vice team" 4 .IX Item "The Vice team" Large part of the emulation is based on the \s-1VICE\s0's code. .IP "Andre\*' Fachat" 4 .IX Item "Andre' Fachat" Wrote the original reloc65 utility. .IP "Michael Schwendt" 4 .IX Item "Michael Schwendt" Wrote the original SidTune library and \s-1MD5\s0 class (based on work by L. Peter Deutsch). .IP "Mikko Kilponen" 4 .IX Item "Mikko Kilponen" Wrote the original man page. .SH "RESOURCES" .IX Header "RESOURCES" .IP "SourceForge project: " 4 .IX Item "SourceForge project: " .PD 0 .IP "Sidplay2 homepage: " 4 .IX Item "Sidplay2 homepage: " .IP "High Voltage Sid Collection (\s-1HVSC\s0): " 4 .IX Item "High Voltage Sid Collection (HVSC): " .PD .SH "COPYING" .IX Header "COPYING" .IP "Copyright (C) 2000\-2004 Simon White" 4 .IX Item "Copyright (C) 2000-2004 Simon White" .PD 0 .IP "Copyright (C) 2007\-2010 Antti Lankila" 4 .IX Item "Copyright (C) 2007-2010 Antti Lankila" .IP "Copyright (C) 2009\-2014 \s-1VICE\s0 Project" 4 .IX Item "Copyright (C) 2009-2014 VICE Project" .IP "Copyright (C) 2010\-2015 Leandro Nini" 4 .IX Item "Copyright (C) 2010-2015 Leandro Nini" .PD .PP This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP This program is distributed in the hope that it will be useful, but \s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \&\s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE. \s0 See the \&\s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, \s-1MA 02110\-1301, USA.\s0 sidplayfp-1.4.0/doc/en/sidplayfp.ini.50000644000076400007640000003130312544212064014446 00000000000000.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "SIDPLAYFP.INI 5" .TH SIDPLAYFP.INI 5 "2015-06-29" "perl v5.18.4" "File formats" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" sidplayfp.ini \- Configuration file for sidplayfp(1). .SH "DESCRIPTION" .IX Header "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. .PP \&\fBsidplayfp.ini\fR supports the following sections: .PP \&\fB[SIDPlayfp]\fR \- Generic configuration .PP \&\fB[Console]\fR \- Console appearance configuration .PP \&\fB[Audio]\fR \- Audio output configuration .PP \&\fB[Emulation]\fR \- Emulation engine parameters .PP All options and values are described in detail below. .PP For any of the following parameter, if it's specified more than one time the last entry encountered will be used. .PP \&\fB\s-1NOTE\s0\fR: if any of these options is specified outside its section, it will be \fIignored\fR. .SS "SIDPlayfp" .IX Subsection "SIDPlayfp" .IP "\fBVersion\fR=\fI\fR" 4 .IX Item "Version=" Configuration version .IP "\fBSonglength Database\fR=\fI\fR" 4 .IX Item "Songlength Database=" Path for the Songlength \s-1DB. \s0 Should point to the \fIDOCUMENTS/Songlengths.txt\fR file under the \s-1HVSC\s0 collection path. On *NIX systems if this value is not set, \fIsidplayfp\fR\|(1) will try \&\fI\f(CI$PREFIX\fI/share/sidplayfp/Songlengths.txt\fR. .IP "\fBDefault Play Length\fR=\fImm:ss\fR" 4 .IX Item "Default Play Length=mm:ss" Default play time if Songlength Database is not found. .IP "\fBDefault Record Length\fR=\fImm:ss\fR" 4 .IX Item "Default Record Length=mm:ss" Default recording time when writing wave files if Songlength Database is not found. .IP "\fBKernal Rom\fR=\fI\fR" 4 .IX Item "Kernal Rom=" 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 \fIkernal\fR file under the following locations: .RS 4 .IP "\(bu" 4 \&\f(CW$XDG_DATA_HOME\fR/sidplayfp/ .Sp on *NIX systems where \s-1XDG_DATA_HOME\s0 is defined. .IP "\(bu" 4 \&\f(CW$HOME\fR/.local/share/sidplayfp/ .Sp on *NIX systems where \s-1XDG_DATA_HOME\s0 is not defined. .IP "\(bu" 4 \&\f(CW$PREFIX\fR/share/sidplayfp .Sp on *NIX systems when not found in the above directories. .IP "\(bu" 4 \&\f(CW%CSIDL_APPDATA\fR%\e\esidplayfp\e\e .Sp on Windows systems where \s-1CSIDL_APPDATA\s0 is defined. .IP "\(bu" 4 \&\f(CW%USERPROFILE\fR%\e\eApplication Data\e\esidplayfp\e\e .Sp on Windows systems where \s-1CSIDL_APPDATA\s0 is not defined. .RE .RS 4 .RE .IP "\fBBasic Rom\fR=\fI\fR" 4 .IX Item "Basic Rom=" Full path for the Basic Rom file. This is mostly useful for playing \s-1BASIC\s0 tunes. By default the program will look for a \fIbasic\fR file under the same locations as above. .IP "\fBChargen Rom\fR=\fI\fR" 4 .IX Item "Chargen Rom=" 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 \fIchargen\fR file under the same locations as above. .SS "Console" .IX Subsection "Console" .IP "\fBAnsi\fR=\fItrue|false\fR" 4 .IX Item "Ansi=true|false" Use \s-1ANSI\s0 escape sequences to provide colored output. .IP "\fBChar Top Left\fR=\fI\fR" 4 .IX Item "Char Top Left=" Character for the top left corner. .IP "\fBChar Top Right\fR=\fI\fR" 4 .IX Item "Char Top Right=" Character for the top right corner. .IP "\fBChar Bottom Left\fR=\fI\fR" 4 .IX Item "Char Bottom Left=" Character for the bottom left corner. .IP "\fBChar Bottom Right\fR=\fI\fR" 4 .IX Item "Char Bottom Right=" Character for the bottom right corner. .IP "\fBChar Vertical\fR=\fI\fR" 4 .IX Item "Char Vertical=" Character for vertical lines. .IP "\fBChar Horizontal\fR=\fI\fR" 4 .IX Item "Char Horizontal=" Character for horizontal lines. .IP "\fBChar Junction Left\fR=\fI\fR" 4 .IX Item "Char Junction Left=" Character for left junctions. .IP "\fBChar Junction Right\fR=\fI\fR" 4 .IX Item "Char Junction Right=" Character for right junctions. .SS "Audio" .IX Subsection "Audio" .IP "\fBFrequency\fR=\fI\fR" 4 .IX Item "Frequency=" Playback frequency expressed in Hertz. Default is 48000. .IP "\fBChannels\fR=\fI\fR" 4 .IX Item "Channels=" Number of channels, 1 for mono and 2 for stereo playback Default is 1. .IP "\fBBitsPerSample\fR=\fI<16|32>\fR" 4 .IX Item "BitsPerSample=<16|32>" Number of bits ber sample, used only for wav output. Using values other than the ones specified will produce invalid output. .SS "Emulation" .IX Subsection "Emulation" .IP "\fBEngine\fR=\fI\fR" 4 .IX Item "Engine=" Set the \s-1SID\s0 emulation engine. Default is \s-1RESIDFP.\s0 .IP "\fBC64Model\fR=\fI\fR" 4 .IX Item "C64Model=" Default c64 model to use if not specified by tune, \s-1PAL\s0 for european PAL-B model, \s-1NTSC\s0 for american/japanese NTSC-M models, \&\s-1OLD_NTSC\s0 for NTSC-M models with old video chip and \s-1DREAN\s0 for argentinian PAL-N model. Default is \s-1PAL.\s0 .IP "\fBForceC64Model\fR=\fItrue|false\fR" 4 .IX Item "ForceC64Model=true|false" Force the configured c64 model even if the tune specifies one. .IP "\fBSidModel\fR=\fI\fR" 4 .IX Item "SidModel=" Default \s-1SID\s0 chip model, old \s-1MOS 6581\s0 or newer \s-1MOS 8580.\s0 .IP "\fBForceSidModel\fR=\fItrue|false\fR" 4 .IX Item "ForceSidModel=true|false" Force the configured \s-1SID\s0 chip model even if the tune specifies one. .IP "\fBUseFilter\fR=\fItrue|false\fR" 4 .IX Item "UseFilter=true|false" Enable/disable the emulation of the \s-1SID\s0 filter. .IP "\fBFilterBias\fR=\fI\fR" 4 .IX Item "FilterBias=" Controls the filter bias in the ReSID emulation. The bias is given in millivolts, and a maximum reasonable control range is approximately \-500 to 500, the default value is 0. .IP "\fBFilterCurve6581\fR=\fI\fR" 4 .IX Item "FilterCurve6581=" 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. .IP "\fBFilterCurve8580\fR=\fI\fR" 4 .IX Item "FilterCurve8580=" Controls the filter curve for the 8580 model in the ReSIDfp emulation. Value is expressed in Hertz and the default is 12500. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIsidplayfp\fR\|(1) .SH "AUTHORS" .IX Header "AUTHORS" .IP "Leandro Nini" 4 .IX Item "Leandro Nini" Current maintainer. .IP "Simon White" 4 .IX Item "Simon White" Wrote the original Sidplay2. .IP "Dag Lem" 4 .IX Item "Dag Lem" Wrote the reSID emulation engine. .IP "Antti S. Lankila" 4 .IX Item "Antti S. Lankila" Wrote the reSIDfp emulation engine as a fork of reSID 0.16. .IP "The Vice team" 4 .IX Item "The Vice team" Large part of the emulation is based on the \s-1VICE\s0's code. .IP "Andre\*' Fachat" 4 .IX Item "Andre' Fachat" Wrote the original reloc65 utility. .IP "Michael Schwendt" 4 .IX Item "Michael Schwendt" Wrote the original SidTune library and \s-1MD5\s0 class (based on work by L. Peter Deutsch). .IP "Mikko Kilponen" 4 .IX Item "Mikko Kilponen" Wrote the originla man page. .SH "RESOURCES" .IX Header "RESOURCES" .IP "SourceForge project: " 4 .IX Item "SourceForge project: " .PD 0 .IP "Sidplay2 homepage: " 4 .IX Item "Sidplay2 homepage: " .IP "High Voltage Sid Collection (\s-1HVSC\s0): " 4 .IX Item "High Voltage Sid Collection (HVSC): " .PD .SH "COPYING" .IX Header "COPYING" .IP "Copyright (C) 2000\-2004 Simon White" 4 .IX Item "Copyright (C) 2000-2004 Simon White" .PD 0 .IP "Copyright (C) 2007\-2010 Antti Lankila" 4 .IX Item "Copyright (C) 2007-2010 Antti Lankila" .IP "Copyright (C) 2009\-2014 \s-1VICE\s0 Project" 4 .IX Item "Copyright (C) 2009-2014 VICE Project" .IP "Copyright (C) 2010\-2014 Leandro Nini" 4 .IX Item "Copyright (C) 2010-2014 Leandro Nini" .PD .PP This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP This program is distributed in the hope that it will be useful, but \s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \&\s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE. \s0 See the \&\s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, \s-1MA 02110\-1301, USA.\s0 sidplayfp-1.4.0/doc/en/stilview.10000644000076400007640000010031512544212064013537 00000000000000.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "STILVIEW 1" .TH STILVIEW 1 "2015-06-29" "perl v5.18.4" "User Programs" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" stilview \- command\-line program to help you retrieve the entries stored in STIL. .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBstilview\fR [\-b] [\-d] [\-e entry] [\-f field] [\-i] [\-l \s-1HVSC\s0 base dir] [\-m] [\-o] [\-s] [\-t tune number] .PP \&\fBstilview\fR {[\-h] | [\-v]} .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBSTILView\fR is a command-line driven program to help you retrieve the entries stored in \s-1STIL\s0 fast and accurately. STILView uses the \s-1STIL \*(C+\s0 class heavily to do this, and in fact, the primary purpose of this command-line program is to test that class (which is, \s-1BTW,\s0 used in many GUI-based \s-1SID\s0 players, most notably in SIDPlay for Windows and \s-1XSIDPLAY\s0 for Unix systems). However, it is user-friendly enough to be used by non-programmers, too. .SH "GLOSSARY" .IX Header "GLOSSARY" Some terms and STIL-related lingo in alphabetical order: .IP "\fB\s-1BUG ENTRY\s0\fR" 4 .IX Item "BUG ENTRY" There exists a special file in \s-1HVSC \s0(\fI/DOCUMENTS/BUGlist.txt\fR) that lists all known bugs in \s-1SID\s0 tunes in \s-1HVSC. \s0 See the top of that file for details about what's in it exactly. A \s-1BUG\s0 entry is like a \&\s-1STIL\s0 entry, but it is contained in this BUGlist.txt file. .IP "\fB\s-1FIELD\s0\fR" 4 .IX Item "FIELD" The smallest piece of information in a \s-1STIL\s0 entry. Currently valid field names are \s-1NAME, TITLE, ARTIST\s0 and \s-1COMMENT.\s0 .IP "\fBFILE-GLOBAL \s-1COMMENT\s0\fR" 4 .IX Item "FILE-GLOBAL COMMENT" A special \s-1COMMENT\s0 field in a \s-1STIL\s0 entry for a multi-tune \s-1SID\s0 file that refers to the whole \s-1SID,\s0 not just one tune in it. These usually contain general information about the \s-1SID\s0 file itself. .Sp Example: .Sp .Vb 9 \& /Hubbard_Rob/Gerry_the_Germ.sid \& COMMENT: In Rob\*(Aqs 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 .Ve .IP "\fB\s-1HVSC\s0\fR" 4 .IX Item "HVSC" High Voltage \s-1SID\s0 Collection. If you don't know what this is, you downloaded the wrong program. :) .IP "\fBHVSC-RELATIVE \s-1PATHNAME\s0\fR" 4 .IX Item "HVSC-RELATIVE PATHNAME" The pathname plus filename of a \s-1SID\s0 file that can be found in your \&\s-1HVSC,\s0 relative to the base directory of \s-1HVSC.\s0 It is always in UNIX-style format, eg.: /Hubbard_Rob/Commando.sid refers to Rob Hubbard's Commando.sid file within \s-1HVSC \s0(which may actually be found as C:\eMusic\eHVSC\eHubbard_Rob\eCommando.sid on your Windows \s-1PC\s0). .IP "\fBMULTI-TUNE \s-1ENTRY\s0\fR" 4 .IX Item "MULTI-TUNE ENTRY" A \s-1STIL\s0 entry that is referring to a \s-1SID\s0 file that has many tunes in it. Each tune might have its own \s-1STIL\s0 block, which are separated by a so-called tune designation in the form of \*(L"(#x)\*(R", where x = the tune number. Consult the \s-1STIL.FAQ\s0 in \s-1HVSC\s0 for a detailed description. .Sp Example: .Sp .Vb 9 \& /Hubbard_Rob/Gerry_the_Germ.sid \& COMMENT: In Rob\*(Aqs 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 .Ve .IP "\fB\s-1SECTION\s0\fR" 4 .IX Item "SECTION" A part of \s-1STIL\s0 that belongs to one composer (ie. every \s-1STIL\s0 entry referring to \s-1SID\s0 files that are in one subdirectory in \s-1HVSC\s0). Sections in \s-1STIL\s0 are always separated by a line in the form of: \*(L"### Composer's name ########\*(R". .IP "\fBSECTION-GLOBAL \s-1COMMENT\s0\fR" 4 .IX Item "SECTION-GLOBAL COMMENT" A special \s-1STIL\s0 entry that refers not to an individual \s-1SID\s0 file, but to a whole subdirectory. These usually contain info about the composer himself, or about all the \s-1SID\s0 file he/she ever composed, and are always indexed in the form of \*(L"/Subdir/\*(R" (note the trailing slash!). .Sp Example: .Sp .Vb 5 \& /Hubbard_Rob/ \& COMMENT: All of these tunes have been confirmed by Hubbard to be his. People \& have often stolen Hubbard\*(Aqs routine causing some tunes to be falsely \& credited to him. \& Hubbard\*(Aqs own comments are denoted by (RH). .Ve .IP "\fBSINGLE-TUNE \s-1ENTRY\s0\fR" 4 .IX Item "SINGLE-TUNE ENTRY" A \s-1STIL\s0 entry that has no tune designation in it in the form of \*(L"(#x)\*(R", where x is a number. (Note, that a single-tune entry might still refer to a \s-1SID\s0 file which has many tunes in it, ie. when a single-tune entry has nothing but a \s-1COMMENT\s0 field in it!) .Sp Example: .Sp .Vb 3 \& /Hubbard_Rob/Chain_Reaction.sid \& TITLE: Zoolook (remix) [from Zoolook] \& ARTIST: Jean Michel Jarre .Ve .Sp Another example (the \s-1SID\s0 this is refering to has many tunes in it!): .Sp .Vb 2 \& /Barrett_Steve/Magic_Land_Dizzy.sid \& COMMENT: Also used in the game "Wacky Darts" (c) 1990 Codemasters. .Ve .IP "\fB\s-1STIL\s0\fR" 4 .IX Item "STIL" \&\s-1SID\s0 Tune Information List, essentially a text-file database that can be found in your \s-1HVSC\s0 in the /DOCUMENTS/ subdirectory. .IP "\fB\s-1STIL ENTRY\s0\fR" 4 .IX Item "STIL ENTRY" All of the pieces of information in \s-1STIL\s0 relating to one \s-1SID\s0 file of the \s-1HVSC.\s0 They are always indexed by the HVSC-relative pathname. .IP "\fB\s-1TUNE\s0\fR" 4 .IX Item "TUNE" One of the compositions in a \s-1SID.\s0 Most \s-1SID\s0 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). .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-b\fR" 4 .IX Item "-b" Do \fBnot\fR print \s-1BUG\s0 entries Default value: Not specified (ie. do print \s-1BUG\s0 entries) .Sp Example: \f(CW\*(C`stilview \-e=/Hubbard_Rob/Commando.sid \-b\*(C'\fR .Sp When this option is specified, \s-1BUG\s0 entries will not be printed for the given \s-1SID\s0 tune. At a minimum, the \-e option has to be specified for this option to work. .IP "\fB\-d\fR" 4 .IX Item "-d" Default value: Not specified (ie. debug mode is off) .Sp Example: \f(CW\*(C`stilview \-e=/Hubbard_Rob/Commando.sid \-d\*(C'\fR .Sp Turns on debug mode in STILView. This will result in an extensive output, with the debugging messages going to \s-1STDERR.\s0 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). .IP "\fB\-e\fR=\fIentry\fR" 4 .IX Item "-e=entry" Default: \s-1NONE \s0(you have to give an HVSC-relative pathname to this option) .Sp Example #1: \f(CW\*(C`stilview \-e=/Hubbard_Rob/Commando.sid\*(C'\fR .Sp Example #2: \f(CW\*(C`stilview \-e=/Hubbard_Rob/\*(C'\fR .Sp This is where you specify the \s-1STIL\s0 entry you are looking for, given as an HVSC-relative pathname. If there exists no \s-1STIL\s0 entry for the given filename, STILView will print out nothing. Otherwise, you'll get the \s-1STIL\s0 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. .Sp Example #1 is the most frequent way of retrieving \s-1STIL\s0 entries, and it will return all of the \s-1STIL\s0 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/. .IP "\fB\-h\fR" 4 .IX Item "-h" Default: \s-1NONE\s0 Example: stilview \-h .Sp Prints a brief help screen listing the available options. All other options that are also specified on the command-line are ignored. .IP "\fB\-f\fR=\fIfield\fR" 4 .IX Item "-f=field" Default: all .Sp Valid values for are: all, name, author, title, artist, comment .Sp Example #1: \f(CW\*(C`stilview \-l \-e=/Hubbard_Rob/Delta.sid \-f=comment\*(C'\fR .Sp Example #2: \f(CW\*(C`stilview \-l \-e=/Hubbard_Rob/Delta.sid \-t=1 \-f=title\*(C'\fR .Sp Example #3: \f(CW\*(C`stilview \-l \-e=/Hubbard_Rob/Delta.sid \-t=12 \-f=all \-s \-b\*(C'\fR .Sp Asks for one particular field in a \s-1STIL\s0 entry. Combined with the \-t option, these two options can retrieve any portion of a \s-1STIL\s0 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: .Sp \&\f(CW\*(C`\-t=0 \-f=all\*(C'\fR : All of the \s-1STIL\s0 entry is printed. .Sp \&\f(CW\*(C`\-t=0 \-f=comment\*(C'\fR : The file-global comment is printed. For single-tune entries that have nothing but a \s-1COMMENT\s0 field in them, this prints that \s-1COMMENT.\s0 For single-tune entries that have other fields in them, this prints nothing. (This is because single-tune entries with nothing but a \s-1COMMENT\s0 field are assumed to be file-global comments.) .Sp \&\f(CW\*(C`\-t=0 \-f=\*(C'\fR : Nothing is printed. This combination of these options is invalid. .Sp \&\f(CW\*(C`\-t= \-f=all\*(C'\fR : (Where x is anything but 0.) All fields from the portion of the \s-1STIL\s0 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 \s-1STIL\s0 entry (which also means that if a single-tune entry has nothing but a \s-1COMMENT\s0 field in it), that is \&\fBnot\fR printed with these combinations of options. .Sp \&\f(CW\*(C`\-t= \-f=\*(C'\fR : (Where x is anything but 0.) The specific field from the portion of the \s-1STIL\s0 entry for the given tune number is printed. For single-tune entries that have nothing but a \s-1COMMENT\s0 in them, this returns nothing. .Sp Of course, if the \s-1STIL\s0 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 \s-1BUG\s0 entry of the given \s-1SID\s0 file will also get printed (provided they exist). .Sp 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 \s-1BUG\s0 entry for the same \s-1SID\s0 file (if they exist). In example #2, the \s-1TITLE\s0 field of the \s-1STIL\s0 entry for tune #1 of /Hubbard_Rob/Delta.sid is printed along with the section-global comment and the \s-1BUG\s0 entry for the same \s-1SID\s0 file (if they exist). In example #3, all of the \s-1STIL\s0 entry for tune #12 of /Hubbard_Rob/Delta.sid is printed, but nothing else. .IP "\fB\-i\fR" 4 .IX Item "-i" Default: \s-1NONE\s0 .Sp Example: \f(CW\*(C`stilview \-i\*(C'\fR .Sp 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 \s-1STIL\s0 entries by typing them in. You will get prompted for the desired \s-1STIL\s0 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 \s-1STIL\s0 field you want to retrieve. .IP "\fB\-l\fR=\fI\s-1HVSC\s0 base dir\fR" 4 .IX Item "-l=HVSC base dir" Default: The value of the \s-1HVSC_BASE\s0 environment variable .Sp Example #1: \f(CW\*(C`stilview \-l=C:\eMusic\eHVSC\e \-e=/Hubbard_Rob/Commando.sid\*(C'\fR .Sp Example #2: \f(CW\*(C`stilview \-l=../HVSC/ =\-e=/Hubbard_Rob/Commando.sid\*(C'\fR .Sp Example #3: \f(CW\*(C`stilview \-l \-e=/Hubbard_Rob/Commando.sid\*(C'\fR .Sp This is where you tell STILView where it can find the \s-1HVSC\s0 base directory (the path to the directory has to be specified in the form required by your operating system, eg. C:\eMusic\eHVSC under Windows, /home/lala/HVSC under \s-1UNIX\s0). STILView will then try to locate the \s-1STIL\s0.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 \s-1HVSC\s0 base directory from the \s-1HVSC_BASE\s0 environment variable. If that environment variable doesn't exist or is pointing to a location where there's no \s-1STIL\s0.txt file in a \s-1DOCUMENTS\s0 directory, STILView fails. If the \s-1HVSC_BASE\s0 environment variable exists and is valid, and this option is specified, the directory specified with this option is used as the \s-1HVSC\s0 base directory instead of the environment variable. .Sp In example #1 the \s-1HVSC\s0 base directory is located in C:\eMusic\eHVSC\e on the hard drive of a Windows \s-1PC,\s0 in example #2 it is located in the \s-1HVSC\s0 directory of the current directory's parent directory of a \&\s-1UNIX\s0 system. In example #3 the \s-1HVSC\s0 base directory is not specified with the option, so it is assumed that the \s-1HVSC_BASE\s0 environment variable contains the path to it. In reality, specifying the \-l option in example #3 is redundant, and can be omitted. .IP "\fB\-m\fR" 4 .IX Item "-m" Demo mode .Sp Default: \s-1NONE\s0 .Sp Example #1: \f(CW\*(C`stilview \-m\*(C'\fR .Sp Example #2: \f(CW\*(C`stilview \-e=/Hubbard_Rob/Commando.sid \-m \-i\*(C'\fR .Sp 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 \s-1STIL.\s0 In example #1, the demo is printed with the \s-1STIL\s0 info coming from a default \s-1STIL\s0 entry, then STILView quits. In example #2, the demo is printed taking the \s-1STIL\s0 info from the specified \s-1STIL\s0 entry of /Hubbard_Rob/Commando.sid (instead of the default \s-1SID\s0 file), then interactive mode is entered. .IP "\fB\-o\fR" 4 .IX Item "-o" Do \fBnot\fR print \s-1STIL\s0 entries .Sp Default value: Not specified (ie. do print \s-1STIL\s0 entries) .Sp Example #1: \f(CW\*(C`stilview \-e=/Hubbard_Rob/Delta.sid \-o\*(C'\fR .Sp Example #2: \f(CW\*(C`stilview \-e=/Hubbard_Rob/Delta.sid \-o \-s\*(C'\fR .Sp When this option is specified, \s-1STIL\s0 entries will not be printed for the given \s-1SID\s0 tune (but section-global entries and \s-1BUG\s0 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 \s-1BUG\s0 entry for /Hubbard_Rob/Delta.sid, example #2 will print out just the section-global comment for the same \s-1SID.\s0 .IP "\fB\-s\fR" 4 .IX Item "-s" Do \fBnot\fR print section-global comments .Sp Default value: Not specified (ie. do print section-global entries) .Sp Example: \f(CW\*(C`stilview \-e=/Hubbard_Rob/Delta.sid \-s\*(C'\fR .Sp When this option is specified, section-global entries will not be printed for the given \s-1SID\s0 tune. At a minimum, the \-e option has to be specified for this option to work. .IP "\fB\-t\fR=\fItune number\fR" 4 .IX Item "-t=tune number" Default value: 0 .Sp Example #1: \f(CW\*(C`stilview \-e=/Hubbard_Rob/Commando.sid \-t=0\*(C'\fR .Sp Example #2: \f(CW\*(C`stilview \-e=/Hubbard_Rob/Delta.sid \-t=1 \-f=title \-s \-b\*(C'\fR .Sp Example #3: \f(CW\*(C`stilview \-e=/Hubbard_Rob/Delta.sid \-t=12\*(C'\fR .Sp Asks for the portion of a \s-1STIL\s0 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 \s-1STIL\s0 entry, including a single field in a specific subtune's entry. .Sp For further details about this option, see the explanation of the \&\-f option. .Sp Example #1 retrieves all of the \s-1STIL\s0 entry for /Hubbard_Rob/Commando.sid, including the section-global comment and the \s-1BUG\s0 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 \s-1TITLE\s0 field of the first subtune's entry for /Hubbard_Rob/Delta.sid (and not the section\- global comment or the \&\s-1BUG\s0 entry), while example #3 retrieves all of the \s-1STIL\s0 entry for tune #12 of the same \s-1SID\s0 file (including the section-global comment and the \s-1BUG\s0 entry, if any). .IP "\fB\-v\fR" 4 .IX Item "-v" Print version numbers .Sp Default value: Not specified (ie. do *not* print version numbers) .Sp Example #1: \f(CW\*(C`stilview \-v\*(C'\fR .Sp Example #2: \f(CW\*(C`stilview \-e=/Hubbard_Rob/Commando.sid \-v\*(C'\fR .Sp When this option is specified, the version number of the STILView program and the version number of the \s-1STIL\s0.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 \s-1STIL\s0 entry for /Hubbard_Rob/Commando.sid is also printed out. .SH "ENVIRONMENT" .IX Header "ENVIRONMENT" .IP "\fB\s-1HVSC_BASE\s0\fR" 4 .IX Item "HVSC_BASE" Specifies the location of the \s-1HVSC\s0 base directory. .SH "EXAMPLES" .IX Header "EXAMPLES" All of the examples below assume that the \s-1HVSC_BASE\s0 environment is set to a valid \s-1HVSC\s0 base directory (where the \fI\f(CI$HVSC_BASE\fI/DOCUMENTS/STIL.txt\fR and \fI\f(CI$HVSC_BASE\fI/DOCUMENTS/BUGlist.txt\fR files exist), and the examples also assume the presence of the following entries in these files: .PP .Vb 1 \& \-\-\- In STIL.txt \-\-\- \& \& /Hubbard_Rob/ \& COMMENT: All of these tunes have been confirmed by Hubbard to be his. People \& have often stolen Hubbard\*(Aqs 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\*(Aqs 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. .Ve .PP Given these entries, following are the printouts you can expect from STILView. ($> denotes a command-line prompt given by your operating system.) .PP Everything related to a \s-1SID\s0 file is printed: .PP .Vb 10 \& $> 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\*(Aqs 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. \& $> .Ve .PP Ask for just the section-global comment: .PP .Vb 6 \& $> stilview \-e=/Hubbard_Rob/ \& /Hubbard_Rob/ \& COMMENT: All of these tunes have been confirmed by Hubbard to be his. People \& have often stolen Hubbard\*(Aqs routine causing some tunes to be falsely \& credited to him. \& $> .Ve .PP Note that this can also be retrieved with: .PP .Vb 5 \& $> 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\*(Aqs routine causing some tunes to be falsely \& credited to him. \& $> .Ve .PP This prints out nothing, as single-tune entries do not have file-global comments: .PP .Vb 2 \& $> stilview \-e=/Hubbard_Rob/International_Karate.sid \-t=0 \-f=comment \-s \-b \& $> .Ve .PP \&...Except if the only field in them is a \s-1COMMENT \s0(in which case that comment is assumed to be a file-global comment): .PP .Vb 5 \& $> 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\*(Aqs approach \& \- it was my idea of giving them what I thought they wanted, a simple \& cute tune....." (RH) \& $> .Ve .PP Also note that single-tune entries have only one tune, so asking for the \s-1STIL\s0 entry of tune #3 is pointless: .PP .Vb 2 \& $> stilview \-e=/Hubbard_Rob/International_Karate.sid \-t=3 \-s \-b \& $> .Ve .PP Print out the file-global comment for the given \s-1SID\s0 file: .PP .Vb 5 \& $> 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. \& $> .Ve .PP Print out the \s-1ARTIST\s0 field of tune #12 of the given \s-1SID\s0 file, plus print out everything else related to the \s-1SID\s0 file: .PP .Vb 10 \& $> 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\*(Aqs routine causing some tunes to be falsely \& credited to him. \& \-\-\-\-\-\- STIL ENTRY \-\-\-\-\-\- \& ARTIST: Philip Glass \& \-\-\-\-\-\-\-\-\-\- BUG \-\-\-\-\-\-\-\-\-\- \& BUG: Demo entry. \& $> .Ve .PP 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: .PP .Vb 3 \& $> stilview \-e=/Hubbard_Rob/Rasputin.sid \-t=1 \-f=title \-s \& TITLE: Katjusha (0:07\-0:36) \& $> .Ve .PP Section-global comments are printed out even if the \s-1STIL\s0 entry for the given \s-1SID\s0 file does not exist: .PP .Vb 5 \& $> 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\*(Aqs routine causing some tunes to be falsely \& credited to him. \& $> .Ve .PP The following 4 steps depict how to have STILView print out everything related to a given \s-1SID\s0 file's given tune number one by one: .PP 1) This prints out just the section-global comment: .PP .Vb 5 \& $> 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\*(Aqs routine causing some tunes to be falsely \& credited to him. \& $> .Ve .PP 2) This prints out just the file-global comment: .PP .Vb 5 \& $> 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. \& $> .Ve .PP 3) This prints out all of the \s-1STIL\s0 entry for the given tune number: .PP .Vb 5 \& $> 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) \& $> .Ve .PP 4) And this prints out just the \s-1BUG\s0 entry for the same tune number: .PP .Vb 3 \& $> stilview \-e=/Hubbard_Rob/Delta.sid \-t=12 \-s \-o \& BUG: Demo entry. \& $> .Ve .PP The following 3 steps depict how to have STILView print out everything related to a given \s-1SID\s0 file: .PP 1) This prints out just the section-global comment: .PP .Vb 5 \& $> 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\*(Aqs routine causing some tunes to be falsely \& credited to him. \& $> .Ve .PP 2) This prints out all of the \s-1STIL\s0 entry: .PP .Vb 10 \& $> stilview \-e=/Hubbard_Rob/Delta.sid \-s \-b \& COMMENT: "[...] The Delta music loader and ingame music was Gary Liddon\*(Aqs 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) \& $> .Ve .PP 3) And this prints out all of the \s-1BUG\s0 entry: .PP .Vb 4 \& $> stilview \-e=/Hubbard_Rob/Delta.sid \-s \-o \& (#12) \& BUG: Demo entry. \& $> .Ve .SH "AUTHORS" .IX Header "AUTHORS" .IP "\fBLaLa\fR " 4 .IX Item "LaLa " Original author. .IP "\fBLeandro Nini\fR " 4 .IX Item "Leandro Nini " Current maintainer. .SH "RESOURCES" .IX Header "RESOURCES" .IP "SourceForge project: " 4 .IX Item "SourceForge project: " .PD 0 .IP "High Voltage Sid Collection (\s-1HVSC\s0): " 4 .IX Item "High Voltage Sid Collection (HVSC): " .PD .SH "COPYING" .IX Header "COPYING" .IP "Copyright (C) 1998, 2002 LaLa" 4 .IX Item "Copyright (C) 1998, 2002 LaLa" .PD 0 .IP "Copyright (C) 2012\-2014 Leandro Nini" 4 .IX Item "Copyright (C) 2012-2014 Leandro Nini" .PD .PP This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP This program is distributed in the hope that it will be useful, but \s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \&\s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE. \s0 See the \&\s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, \s-1MA 02110\-1301, USA.\s0 sidplayfp-1.4.0/configure.ac0000644000076400007640000000416712544212566012745 00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT([sidplayfp], [1.4.0], [], [], [http://sourceforge.net/projects/sidplay-residfp/]) AC_CONFIG_SRCDIR([src/main.cpp]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE AC_CANONICAL_HOST AC_PROG_RANLIB dnl Checks for programs. AC_PROG_CXX dnl Use C++ for tests. AC_LANG([C++]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_BIGENDIAN 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) AC_CHECK_FUNCS([strncasecmp strcasecmp]) PKG_CHECK_MODULES(SIDPLAYFP, [libsidplayfp >= 1.0]) PKG_CHECK_MODULES(STILVIEW, [libstilview >= 1.0]) # hack? saveCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $SIDPLAYFP_CFLAGS" AC_CHECK_HEADERS([sidplayfp/builders/residfp.h sidplayfp/builders/resid.h sidplayfp/builders/hardsid.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_CONFIG_FILES([ Makefile ]) AC_OUTPUT sidplayfp-1.4.0/README0000644000076400007640000000340712544211672011330 00000000000000sidplayfp ========= http://sourceforge.net/projects/sidplay-residfp/ sidplayfp is a fork of SIDPLAY2, a C64 music player which integrates the reSID SID chip emulation into a cycle-based emulator environment, started with primary purpose to improve emulation of the C64 system and the SID chips. Copyright (c) 2000 Simon White Copyright (c) 2007-2010 Antti Lankila Copyright (c) 2010-2014 Leandro Nini NOTE: ----- ROM dumps are no longer embedded but must be supplied by the user. The ROMs are optional and most tune should work fine without but compatibility is not guaranteed. Check the sidplayfp.ini documentation for configuration details and default search paths. 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 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 ----------------------------------------------------------------------------- sidplayfp-1.4.0/build-aux/0000755000076400007640000000000012547546746012436 500000000000000sidplayfp-1.4.0/build-aux/depcomp0000755000076400007640000005601612544211767013730 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: sidplayfp-1.4.0/build-aux/missing0000755000076400007640000001533012544211767013744 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: sidplayfp-1.4.0/build-aux/config.sub0000755000076400007640000010622312544211767014332 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-12-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: sidplayfp-1.4.0/build-aux/config.guess0000755000076400007640000012367212544211767014676 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-11-04' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: sidplayfp-1.4.0/build-aux/install-sh0000755000076400007640000003452312544211767014356 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2013-12-25.23; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: sidplayfp-1.4.0/Makefile.am0000644000076400007640000000341012544212520012467 00000000000000 AUTOMAKE_OPTIONS = foreign subdir-objects AM_CPPFLAGS = \ -I $(top_builddir) \ -DPKGDATADIR="\"$(pkgdatadir)/\"" \ $(SIDPLAYFP_CFLAGS) \ $(STILVIEW_CFLAGS) \ $(ALSA_CFLAGS) \ $(PULSE_CFLAGS) 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/utils.cpp \ src/utils.h \ 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/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 \ 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 = \ $(AUDIO_LDFLAGS) \ $(SIDPLAYFP_LIBS) \ $(BUILDERS_LDFLAGS) \ $(ALSA_LIBS) \ $(PULSE_LIBS) #========================================================= # stilview src_stilview_SOURCES = \ src/stilview.cpp src_stilview_LDADD = \ $(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: pod2man -c "User Programs" -s 1 $< > $@ .pod.5: pod2man -c "File formats" -s 5 $< > $@ sidplayfp-1.4.0/src/0000755000076400007640000000000012547546746011333 500000000000000sidplayfp-1.4.0/src/stilview.cpp0000644000076400007640000005152412544211672013614 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2012 Leandro Nini * Copyright 1998, 2002 LaLa * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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. */ // // STILView - command line version // #include #include #include #include #include #include STIL myStil; char *hvscLoc = NULL; char *entryStr = NULL; int tuneNo = 0; STIL::STILField field = STIL::all; bool showBug = true; bool showEntry = true; bool showSection = true; bool showVersion = false; bool interactive = false; bool demo = false; char STIL_DEMO_ENTRY[]="/Galway_Martin/Green_Beret.sid"; // This is used for testing setBaseDir() when switching between different // HVSC base directories. Ideally, it should point to a valid HVSC dir. char OTHER_HVSC_BASE_DIR[]="E:\\MUSIC\\SID\\C64music\\"; #define STIL_MAX_PATH_SIZE 1024 using namespace std; char toLowerAscii(char c) { return (c < 'A' || c > 'Z') ? c : c + ('a' - 'A'); } bool strEquals(const char* s1, const char* s2) { while (*s1 && *s2) { if (toLowerAscii(*s1) != toLowerAscii(*s2)) return false; s1++; s2++; } return !(*s1 || *s2); } void printUsageStr(void) { cout << endl; cout << myStil.getVersion(); cout << "USAGE: STILView [-e=] [-l=] [-t=] [-f=]" << endl; cout << " [-d] [-i] [-s] [-b] [-o] [-v] [-h] [-m]" << endl; } void printUsage(void) { printUsageStr(); exit(1); } void printHelp(void) { printUsageStr(); cout << "Arguments can be specified in any order." << endl; cout << endl; cout << "-e= - Specifies the desired STIL entry with an HVSC-relative path." << endl; cout << "-l= - Specifies the location of the HVSC base directory. If not" << endl; cout << " specified, the value of the HVSC_BASE env. variable will be" << endl; cout << " used. Specifying this option will override HVSC_BASE." << endl; cout << "-t= - If specified, only the STIL entry for the given tune number is" << endl; cout << " printed. (Default: 0)" << endl; cout << "-f= - If specified, only the STIL entry for the given field is" << endl; cout << " printed. (Default: all)" << endl; cout << " Valid values for are:" << endl; cout << " all, name, author, title, artist, comment" << endl; cout << "-d - Turns on debug mode for STILView." << endl; cout << "-i - Enter interactive mode." << endl; cout << "-m - Demo mode (tests STILView and shows its capabilities)." << endl; cout << "-s - If specified, section-global (per dir/per composer) comments" << endl; cout << " will NOT be printed." << endl; cout << "-b - If specified, BUG entries will NOT be printed." << endl; cout << "-o - If specified, STIL entries will NOT be printed." << endl; cout << "-v - Print STILView's and STIL's version number." << endl; cout << "-h - Print this help screen (all other options are ignored)." << endl; cout << endl; cout << "See user manual for further details and for examples." << endl; cout << endl; exit(0); } char *getArgValue(char *argStr) { char *temp = (char *)strchr(argStr, '='); if (temp == NULL) { return NULL; } if (*(temp+1) == '\0') { return NULL; } return (temp+1); } void processArguments(int argc, char **argv) { for (int i=1; i are:" << endl; cerr << "all, name, author, title, artist, comment." << endl; printUsage(); } } break; case 'h': case 'H': printHelp(); break; default: cerr << "ERROR: Unknown argument: '" << argv[i] << "' !" << endl; printUsage(); break; } } else { cerr << "ERROR: Unknown argument: '" << argv[i] << "' !" << endl; printUsage(); } } } void checkArguments(void) { if (hvscLoc == NULL) { if (interactive || demo) { hvscLoc = new char[STIL_MAX_PATH_SIZE]; cout << "Enter HVSC base directory: "; cin >> hvscLoc; } else { if (showVersion) { showBug = false; showEntry = false; showSection = false; } else { cerr << "ERROR: HVSC base dir was not specified and HVSC_BASE is not set, either!" << endl; printUsage(); } } } if (entryStr == NULL) { if ((!interactive) && (!demo)) { if (showVersion) { showBug = false; showEntry = false; showSection = false; } else { cerr << "ERROR: STIL entry was not specified!" << endl; printUsage(); } } else { entryStr = STIL_DEMO_ENTRY; } } } int main(int argc, char **argv) { char temp[STIL_MAX_PATH_SIZE]; const char *tmpptr, *sectionPtr, *entryPtr, *bugPtr; const char *versionPtr; float tempval; if (argc < 2) { printHelp(); } hvscLoc = getenv("HVSC_BASE"); processArguments(argc, argv); checkArguments(); if (interactive || demo) { cout << "Reading STIL..." << endl; } else { if (showVersion && (hvscLoc == NULL)) { versionPtr = myStil.getVersion(); if (versionPtr == NULL) { cerr << "ERROR: No STIL version string was found!" << endl; } else { cout << versionPtr; } exit(0); } } if (myStil.setBaseDir(hvscLoc) != true) { cerr << "STIL error #" << myStil.getError() << ": " << myStil.getErrorStr() << endl; exit(1); } if ((!interactive) && (!demo)) { // Pure command-line version. if (showVersion) { versionPtr = myStil.getVersion(); } else { versionPtr = NULL; } if (showSection) { sectionPtr = myStil.getGlobalComment(entryStr); } else { sectionPtr = NULL; } if (showEntry) { entryPtr = myStil.getEntry(entryStr, tuneNo, field); } else { entryPtr = NULL; } if (showBug) { bugPtr = myStil.getBug(entryStr, tuneNo); } else { bugPtr = NULL; } if (versionPtr != NULL) { if ((sectionPtr != NULL) || (entryPtr != NULL) || (bugPtr != NULL)) { cout << "--- STILView VERSION ---" << endl; } cout << versionPtr; } if (sectionPtr != NULL) { if ((versionPtr != NULL) || (entryPtr != NULL) || (bugPtr != NULL)) { cout << "---- GLOBAL COMMENT ----" << endl; } cout << sectionPtr; } if (entryPtr != NULL) { if ((versionPtr != NULL) || (sectionPtr != NULL) || (bugPtr != NULL)) { cout << "------ STIL ENTRY ------" << endl; } cout << entryPtr; } if (bugPtr != NULL) { if ((versionPtr != NULL) || (sectionPtr != NULL) || (entryPtr != NULL)) { cout << "---------- BUG ----------" << endl; } cout << bugPtr; } } else { // We are either in interactive or demo mode here. if (demo) { cout << "==== STILVIEW DEMO MODE ====" << endl; cout << endl << "---- STIL VERSION ----" << endl; cout << "---- ONE STRING ----" << endl; } // This gets printed regardless. versionPtr = myStil.getVersion(); if (versionPtr == NULL) { cerr << "ERROR: No STIL version string was found!" << endl; } else { cout << versionPtr; } if (demo) { // Demo mode. cout << "---- STIL CLASS VERSION # ----" << endl; tempval = myStil.getVersionNo(); if (tempval == 0) { cerr << "ERROR: STILView version number was not found!" << endl; } else { cout << "STILView v" << tempval << endl; } cout << "---- STIL.txt VERSION # ----" << endl; tempval = myStil.getSTILVersionNo(); if (tempval == 0) { cerr << "ERROR: STIL version number was not found!" << endl; } else { cout << "STIL v" << tempval << endl; } // For testing setBaseDir(). if (myStil.STIL_DEBUG == true) { if (myStil.setBaseDir(OTHER_HVSC_BASE_DIR) != true) { cerr << "STIL error #" << myStil.getError() << ": " << myStil.getErrorStr() << endl; cerr << "Couldn't switch to new dir: '" << OTHER_HVSC_BASE_DIR << "'" << endl; cerr << "Reverting back to '" << hvscLoc << "'" << endl; } else { hvscLoc = OTHER_HVSC_BASE_DIR; cout << "Switch to new dir '" << hvscLoc << "' was successful!" << endl; cout << "---- ONE STRING ----" << endl; versionPtr = myStil.getVersion(); if (versionPtr == NULL) { cerr << "ERROR: No STIL version string was found!" << endl; } else { cout << versionPtr; } cout << "---- STIL CLASS VERSION # ----" << endl; tempval = myStil.getVersionNo(); if (tempval == 0) { cerr << "ERROR: STILView version number was not found!" << endl; } else { cout << "STILView v" << tempval << endl; } cout << "---- STIL.txt VERSION # ----" << endl; tempval = myStil.getSTILVersionNo(); if (tempval == 0) { cerr << "ERROR: STIL version number was not found!" << endl; } else { cout << "STIL v" << tempval << endl; } } } cout << endl << "==== STIL ABSOLUTE PATH TO " << entryStr << ", Tune #" << tuneNo << " ====" << endl << endl; strcpy(temp, hvscLoc); // Chop the trailing slash char *tmp = temp+strlen(temp)-1; if (*tmp == SLASH) { *tmp = '\0'; } strcat(temp, entryStr); cout << "---- GLOBAL COMMENT ----" << endl; tmpptr = myStil.getAbsGlobalComment(temp); if (tmpptr == NULL) { cerr << "STIL error #" << myStil.getError() << ": " << myStil.getErrorStr() << endl; } else { cout << tmpptr; } cout << "-- TUNE GLOBAL COMMENT --" << endl; tmpptr = myStil.getAbsEntry(temp, 0, STIL::comment); if (tmpptr == NULL) { cerr << "STIL error #" << myStil.getError() << ": " << myStil.getErrorStr() << endl; } else { cout << tmpptr; } cout << "------ STIL ENTRY ------" << endl; cout << "(For tune #1)" << endl; tmpptr = myStil.getAbsEntry(temp, 1, STIL::all); if (tmpptr == NULL) { cerr << "STIL error #" << myStil.getError() << ": " << myStil.getErrorStr() << endl; } else { cout << tmpptr; } cout << "---------- BUG ----------" << endl; tmpptr = myStil.getAbsBug(temp, tuneNo); if (tmpptr == NULL) { cerr << "STIL error #" << myStil.getError() << ": " << myStil.getErrorStr() << endl; } else { cout << tmpptr; } cout << "==== END OF ENTRY ====" << endl; cout << endl << "Trying to do setBaseDir() to wrong location..." << endl; if (myStil.setBaseDir("This_should_not_work") != true) { cout << "setBaseDir() failed!" << endl; cout << "But it should't have an impact on private data!" << endl; cout << "You should see the same entry below:" << endl; cout << endl << "------ STIL ENTRY ------" << endl; tmpptr = myStil.getAbsEntry(temp, tuneNo, STIL::all); if (tmpptr == NULL) { cerr << "STIL error #" << myStil.getError() << ": " << myStil.getErrorStr() << endl; } else { cout << tmpptr; } } else { cout << "Oops, it should've failed!" << endl; } } if (interactive) { // Interactive mode. cout << endl << "==== ENTERING INTERACTIVE MODE ====" << endl << endl; do { cout << "Enter desired entry (relative path) or 'q' to exit." << endl; cout << "Entry: "; cin >> temp; if (*temp == '/') { cout << "Enter tune number (can enter 0, too): "; cin >> tuneNo; cout << "Field [(A)ll, (N)ame, A(U)thor (T)itle, A(R)tist,(C)omment]: "; char fieldchar; cin >> fieldchar; switch (fieldchar) { case 'a': case 'A': field = STIL::all; break; case 'n': case 'N': field = STIL::name; break; case 'u': case 'U': field = STIL::author; break; case 't': case 'T': field = STIL::title; break; case 'r': case 'R': field = STIL::artist; break; case 'c': case 'C': field = STIL::comment; break; default: cout << "Wrong field. Assuming (A)ll." << endl; field = STIL::all; break; } cout << endl << "==== " << temp << ", Tune #" << tuneNo << " ====" << endl << endl; cout << "---- GLOBAL COMMENT ----" << endl; tmpptr = myStil.getGlobalComment(temp); if (tmpptr) { cout << tmpptr; } else { cout << "NONE!" << endl; } cout << "------ STIL ENTRY ------" << endl; tmpptr = myStil.getEntry(temp, tuneNo, field); if (tmpptr) { cout << tmpptr; } else { cout << "NONE!" << endl; } cout << "---------- BUG ----------" << endl; tmpptr = myStil.getBug(temp, tuneNo); if (tmpptr) { cout << tmpptr; } else { cout << "NONE!" << endl; } cout << "==== END OF ENTRY ====" << endl << endl; } } while (*temp == '/'); cout << "BYE!" << endl; } } return 0; } sidplayfp-1.4.0/src/main.cpp0000644000076400007640000000635612544211672012675 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2012 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. */ #include "player.h" #include #include #include using std::cerr; using std::endl; #include "keyboard.h" // Function prototypes static void sighandler (int signum); static ConsolePlayer *g_player; int main(int argc, char *argv[]) { ConsolePlayer player(argv[0]); g_player = &player; {// Decode the command line args const int ret = player.args (argc - 1, const_cast(argv + 1)); if (ret < 0) goto main_error; else if (!ret) goto main_exit; } main_restart: if (!player.open ()) goto main_error; // Install signal error handlers if ((signal (SIGINT, &sighandler) == SIG_ERR) || (signal (SIGABRT, &sighandler) == SIG_ERR) || (signal (SIGTERM, &sighandler) == SIG_ERR)) { displayError(argv[0], ERR_SIGHANDLER); goto main_error; } #ifndef _WIN32 // Configure terminal to allow direct access to key events keyboard_enable_raw (); #endif // Play loop for (;;) { if (!player.play ()) break; } #ifndef _WIN32 keyboard_disable_raw (); #endif // Restore default signal error handlers if ((signal (SIGINT, SIG_DFL) == SIG_ERR) || (signal (SIGABRT, SIG_DFL) == SIG_ERR) || (signal (SIGTERM, SIG_DFL) == SIG_ERR)) { displayError(argv[0], ERR_SIGHANDLER); goto main_error; } if ((player.state() & ~playerFast) == playerRestart) goto main_restart; main_exit: player.close (); return EXIT_SUCCESS; main_error: player.close (); return EXIT_FAILURE; } void sighandler (int signum) { switch (signum) { case SIGINT: case SIGABRT: case SIGTERM: // Exit now! g_player->stop (); break; default: break; } } void displayError (const char *arg0, unsigned int num) { cerr << arg0 << ": "; switch (num) { case ERR_SYNTAX: cerr << "command line syntax error" << endl << "Try `" << arg0 << " --help' for more information." << endl; break; case ERR_NOT_ENOUGH_MEMORY: cerr << "ERROR: Not enough memory." << endl; break; case ERR_SIGHANDLER: cerr << "ERROR: Could not install signal handler." << endl; break; case ERR_FILE_OPEN: cerr << "ERROR: Could not open file for binary input." << endl; break; default: break; } } sidplayfp-1.4.0/src/utils.h0000644000076400007640000000222612544211672012546 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2013 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef UTILS_H #define UTILS_H #include #include "ini/types.h" class utils { public: class error {}; private: #ifdef _WIN32 static SID_STRING getPath(); #else static SID_STRING getPath(const char* id, const char* def); #endif public: static SID_STRING getDataPath(); static SID_STRING getConfigPath(); }; #endif sidplayfp-1.4.0/src/ini/0000755000076400007640000000000012547546746012112 500000000000000sidplayfp-1.4.0/src/ini/iniHandler.h0000644000076400007640000000366212544211672014247 00000000000000/* * Copyright (C) 2010-2014 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef INIHANDLER_H #define INIHANDLER_H #include #include #include "types.h" class iniHandler { private: typedef std::pair stringPair_t; typedef std::vector keys_t; typedef std::pair keyPair_t; typedef std::vector sections_t; class parseError {}; private: template class compare { private: SID_STRING s; public: compare(const TCHAR *str) : s(str) {} bool operator () (T const &p) { return s.compare(p.first) == 0; } }; private: sections_t sections; sections_t::iterator curSection; SID_STRING fileName; bool changed; private: SID_STRING parseSection(const SID_STRING &buffer); stringPair_t parseKey(const SID_STRING &buffer); public: iniHandler(); ~iniHandler(); bool open(const TCHAR *fName); bool write(const TCHAR *fName); void close(); bool setSection(const TCHAR *section); const TCHAR *getValue(const TCHAR *key) const; void addSection(const TCHAR *section); void addValue(const TCHAR *key, const TCHAR *value); }; #endif // INIHANDLER_H sidplayfp-1.4.0/src/ini/sidfstream.h0000644000076400007640000000637212544211672014334 00000000000000/* * Copyright (C) 2014 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef SID_FSTREAM_H #define SID_FSTREAM_H #include #if defined(_WIN32) && defined (UNICODE) # include # include # include # ifdef __GLIBCXX__ # include static int getOflag(std::ios_base::openmode mode) { int flags = (mode & std::ios_base::binary) ? _O_BINARY : 0; if ((mode & std::ios_base::in) && (mode & std::ios_base::out)) flags |= _O_CREAT | _O_TRUNC | _O_RDWR; else if (mode & std::ios_base::in) flags |= _O_RDONLY; else if (mode & std::ios_base::out) flags |= _O_CREAT | _O_TRUNC | _O_WRONLY; return flags; } template class sid_stream_base { protected: __gnu_cxx::stdio_filebuf filebuf; sid_stream_base(int fd, std::ios_base::openmode mode) : filebuf(fd, mode) {} public: bool is_open() { return filebuf.is_open(); } void close() { filebuf.close(); } }; class sid_ifstream : public sid_stream_base, public std::istream { public: sid_ifstream(const TCHAR* filename, ios_base::openmode mode = ios_base::in) : sid_stream_base(_wopen(filename, getOflag(mode|ios_base::in)), mode|ios_base::in), std::istream(&filebuf) {} }; class sid_ofstream : public sid_stream_base, public std::ostream { public: sid_ofstream(const TCHAR* filename, ios_base::openmode mode = ios_base::out) : sid_stream_base(_wopen(filename, getOflag(mode|ios_base::out)), mode|ios_base::out), std::ostream(&filebuf) {} }; class sid_wifstream : public sid_stream_base, public std::wistream { public: sid_wifstream(const TCHAR* filename, ios_base::openmode mode = ios_base::in) : sid_stream_base(_wopen(filename, getOflag(mode|ios_base::in)), mode|ios_base::in), std::wistream(&filebuf) {} }; class sid_wofstream : public sid_stream_base, public std::wostream { public: sid_wofstream(const TCHAR* filename, ios_base::openmode mode = ios_base::out) : sid_stream_base(_wopen(filename, getOflag(mode|ios_base::out)), mode|ios_base::out), std::wostream(&filebuf) {} }; # else // _MSC_VER # define sid_wifstream std::wifstream # define sid_wofstream std::wofstream # define sid_ifstream std::ifstream # define sid_ofstream std::ofstream # endif // __GLIBCXX__ #else # define sid_wifstream std::ifstream # define sid_wofstream std::ofstream # define sid_ifstream std::ifstream # define sid_ofstream std::ofstream #endif // _WIN32 #endif // SID_FSTREAM_H sidplayfp-1.4.0/src/ini/iniHandler.cpp0000644000076400007640000001211612544211672014574 00000000000000/* * Copyright (C) 2010-2014 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "iniHandler.h" #include #include #include #include #ifdef _WIN32 # include #endif iniHandler::iniHandler() : changed(false) {} iniHandler::~iniHandler() { close(); } SID_STRING iniHandler::parseSection(const SID_STRING &buffer) { const size_t pos = buffer.find(']'); if (pos == SID_STRING::npos) { throw parseError(); } return buffer.substr(1, pos-1); } iniHandler::stringPair_t iniHandler::parseKey(const SID_STRING &buffer) { const size_t pos = buffer.find('='); if (pos == SID_STRING::npos) { throw parseError(); } const SID_STRING key = buffer.substr(0, buffer.find_last_not_of(' ', pos-1) + 1); const size_t vpos = buffer.find_first_not_of(' ', pos+1); const SID_STRING value = (vpos == SID_STRING::npos) ? TEXT("") : buffer.substr(vpos); return make_pair(key, value); } bool iniHandler::open(const TCHAR *fName) { fileName.assign(fName); SID_WIFSTREAM iniFile(fName); if (!iniFile.is_open()) { // Try creating new file #ifdef _WIN32 const HANDLE h = CreateFile(fName, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); if (h != INVALID_HANDLE_VALUE) { CloseHandle(h); return true; } #else SID_WOFSTREAM newIniFile(fName); return newIniFile.is_open(); #endif return false; } SID_STRING buffer; while (getline(iniFile, buffer)) { if (buffer.empty()) continue; switch (buffer.at(0)) { case ';': case '#': // Comments if (!sections.empty()) { sections_t::reference lastSect(sections.back()); lastSect.second.push_back(make_pair(SID_STRING(), buffer)); } break; case '[': try { const SID_STRING section = parseSection(buffer); const keys_t keys; sections.push_back(make_pair(section, keys)); } catch (parseError const &e) {} break; default: try { if (!sections.empty()) //FIXME add a default section? { sections_t::reference lastSect(sections.back()); lastSect.second.push_back(parseKey(buffer)); } } catch (parseError const &e) {} break; } } return !iniFile.bad(); } void iniHandler::close() { if (changed) { write(fileName.c_str()); } sections.clear(); changed = false; } bool iniHandler::setSection(const TCHAR *section) { curSection = std::find_if(sections.begin(), sections.end(), compare(section)); return (curSection != sections.end()); } const TCHAR *iniHandler::getValue(const TCHAR *key) const { keys_t::const_iterator keyIt = std::find_if((*curSection).second.begin(), (*curSection).second.end(), compare(key)); return (keyIt != (*curSection).second.end()) ? keyIt->second.c_str() : 0; } void iniHandler::addSection(const TCHAR *section) { const keys_t keys; curSection = sections.insert(curSection, make_pair(section, keys)); changed = true; } void iniHandler::addValue(const TCHAR *key, const TCHAR *value) { (*curSection).second.push_back(make_pair(SID_STRING(key), SID_STRING(value))); changed = true; } bool iniHandler::write(const TCHAR *fName) { SID_WOFSTREAM iniFile(fName); #ifdef _WIN32 // On Windows XP it seems that opening an ofstream sets the read-only attribute SetFileAttributes(fName, GetFileAttributes(fName) & ~FILE_ATTRIBUTE_READONLY); #endif if (!iniFile.is_open()) { return false; } for (sections_t::iterator section = sections.begin(); section != sections.end(); ++section) { iniFile << "[" << (*section).first << "]" << std::endl; for (keys_t::iterator entry = (*section).second.begin(); entry != (*section).second.end(); ++entry) { const SID_STRING key = (*entry).first; if (!key.empty()) iniFile << key << " = "; iniFile << (*entry).second << std::endl; } iniFile << std::endl; } return true; } sidplayfp-1.4.0/src/ini/types.h0000644000076400007640000000266612544211672013341 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2014 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef TYPES_H #define TYPES_H #include "sidfstream.h" # define SID_WIFSTREAM sid_wifstream # define SID_WOFSTREAM sid_wofstream # define SID_IFSTREAM sid_ifstream # define SID_OFSTREAM sid_ofstream #if defined(_WIN32) && defined(UNICODE) # define SID_STRING std::wstring # define SID_STRINGTREAM std::wstringstream # define SID_COUT std::wcout #else # define SID_STRING std::string # define SID_STRINGTREAM std::stringstream # define SID_COUT std::cout #endif #ifndef _WIN32 # define TCHAR char # define TEXT(x) x # define SEPARATOR "/" #else # include # define SEPARATOR TEXT("\\") #endif #endif sidplayfp-1.4.0/src/ini/dataParser.h0000644000076400007640000000273712544211672014262 00000000000000/* * Copyright (C) 2014 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef DATAPARSER_H #define DATAPARSER_H #include #include #include "types.h" class dataParser { public: class parseError {}; private: template static T convertString(const TCHAR* data) { T value; SID_STRINGTREAM stream(data); stream >> std::boolalpha >> value; if (stream.fail()) { throw parseError(); } return value; } public: static double parseDouble(const TCHAR* data) { return convertString(data); } static int parseInt(const TCHAR* data) { return convertString(data); } static bool parseBool(const TCHAR* data) { return convertString(data); } }; #endif // DATAPARSER_H sidplayfp-1.4.0/src/audio/0000755000076400007640000000000012547546746012434 500000000000000sidplayfp-1.4.0/src/audio/AudioDrv.h0000644000076400007640000000265212544211672014227 00000000000000/* * This file is part of sidplayfp, a console SID player. * * 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 AUDIODRV_H #define AUDIODRV_H #include "IAudio.h" #include #include "AudioBase.h" class audioDrv : public IAudio { private: std::auto_ptr audio; public: virtual ~audioDrv() {} bool open(AudioConfig &cfg); void reset() { audio->reset(); } bool write() { return audio->write(); } void close() { audio->close(); } void pause() { audio->pause(); } short *buffer() const { return audio->buffer(); } void getConfig(AudioConfig &cfg) const { audio->getConfig(cfg); } const char *getErrorString() const { return audio->getErrorString(); } }; #endif // AUDIODRV_H sidplayfp-1.4.0/src/audio/null/0000755000076400007640000000000012547546746013406 500000000000000sidplayfp-1.4.0/src/audio/null/null.h0000644000076400007640000000273612544211672014441 00000000000000/* * This file is part of sidplayfp, a console SID player. * * 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. */ #ifndef AUDIO_NULL_H #define AUDIO_NULL_H #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_HARDSID # ifndef AudioDriver # define AudioDriver Audio_Null # endif #endif #include "../AudioBase.h" /* * Null audio driver used for hardsid * and songlength detection */ class Audio_Null: public AudioBase { private: // ------------------------------------------------------- private bool isOpen; public: // --------------------------------------------------------- public Audio_Null(); ~Audio_Null(); bool open (AudioConfig &cfg); void close (); void reset () {} bool write (); void pause () {} }; #endif // AUDIO_NULL_H sidplayfp-1.4.0/src/audio/null/null.cpp0000644000076400007640000000256112544211672014770 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2000-2002 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 "null.h" Audio_Null::Audio_Null() : AudioBase("NULL"), isOpen(false) {} Audio_Null::~Audio_Null() { close(); } bool Audio_Null::open(AudioConfig &cfg) { if (isOpen) { setError("Audio device already open."); return false; } isOpen = true; _settings = cfg; return true; } bool Audio_Null::write() { if (!isOpen) { setError("Audio device not open."); return false; } return true; } void Audio_Null::close(void) { if (!isOpen) return; isOpen = false; } sidplayfp-1.4.0/src/audio/pulse/0000755000076400007640000000000012547546746013564 500000000000000sidplayfp-1.4.0/src/audio/pulse/audiodrv.h0000644000076400007640000000273712544211672015463 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2008 Antti Lankila * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 AUDIO_PULSE_H #define AUDIO_PULSE_H #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_PULSE #ifndef AudioDriver # define AudioDriver Audio_Pulse #endif #include #include "../AudioBase.h" class Audio_Pulse: public AudioBase { private: // ------------------------------------------------------- private pa_simple *_audioHandle; void outOfOrder (); public: // --------------------------------------------------------- public Audio_Pulse(); ~Audio_Pulse(); bool open (AudioConfig &cfg); void close (); void reset () {} bool write (); void pause () {} }; #endif // HAVE_PULSE #endif // AUDIO_PULSE_H sidplayfp-1.4.0/src/audio/pulse/audiodrv.cpp0000644000076400007640000000552012544211672016007 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2013 Leandro Nini * Copyright 2008 Antti Lankila * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "audiodrv.h" #ifdef HAVE_PULSE #include #include Audio_Pulse::Audio_Pulse() : AudioBase("PULSE") { outOfOrder(); } Audio_Pulse::~Audio_Pulse() { close (); } void Audio_Pulse::outOfOrder() { _sampleBuffer = NULL; clearError(); } bool Audio_Pulse::open(AudioConfig &cfg) { pa_sample_spec pacfg = {}; pacfg.channels = cfg.channels; pacfg.rate = cfg.frequency; pacfg.format = PA_SAMPLE_S16NE; // Set sample precision and type of encoding. int err; _audioHandle = pa_simple_new( NULL, "sidplayfp", PA_STREAM_PLAYBACK, NULL, "sidplayfp", &pacfg, NULL, NULL, &err ); try { if (! _audioHandle) { throw error(pa_strerror(err)); } cfg.bufSize = 4096; try { _sampleBuffer = new short[cfg.bufSize]; } catch (std::bad_alloc const &ba) { throw error("Unable to allocate memory for sample buffers."); } _settings = cfg; return true; } catch(error const &e) { setError(e.message()); if (_audioHandle) pa_simple_free(_audioHandle); _audioHandle = NULL; return false; } } // Close an opened audio device, free any allocated buffers and // reset any variables that reflect the current state. void Audio_Pulse::close() { if (_audioHandle != NULL) { pa_simple_free(_audioHandle); _audioHandle = NULL; } if (_sampleBuffer != NULL) { delete [] _sampleBuffer; outOfOrder (); } } bool Audio_Pulse::write() { if (_audioHandle == NULL) { setError("Device not open."); return false; } int err; if (pa_simple_write(_audioHandle, _sampleBuffer, _settings.bufSize * 2, &err) < 0) { setError(pa_strerror(err)); // FIXME should we return false here? } return true; } #endif // HAVE_PULSE sidplayfp-1.4.0/src/audio/IAudio.h0000644000076400007640000000241212544211672013656 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2013 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 IAUDIO_H #define IAUDIO_H class AudioConfig; class IAudio { public: virtual ~IAudio() {} virtual bool open(AudioConfig &cfg) = 0; virtual void reset() = 0; virtual bool write() = 0; virtual void close() = 0; virtual void pause() = 0; virtual short *buffer() const = 0; virtual void getConfig(AudioConfig &cfg) const = 0; virtual const char *getErrorString() const = 0; }; #endif // IAUDIO_H sidplayfp-1.4.0/src/audio/alsa/0000755000076400007640000000000012547546746013354 500000000000000sidplayfp-1.4.0/src/audio/alsa/audiodrv.h0000644000076400007640000000305312544211672015243 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2000-2005 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 AUDIO_ALSA_H #define AUDIO_ALSA_H #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_ALSA #ifndef AudioDriver # define AudioDriver Audio_ALSA #endif #include #include "../AudioBase.h" class Audio_ALSA: public AudioBase { private: // ------------------------------------------------------- private snd_pcm_t *_audioHandle; int _alsa_to_frames_divisor; private: void outOfOrder(); static void checkResult(int err); public: // --------------------------------------------------------- public Audio_ALSA(); ~Audio_ALSA(); bool open (AudioConfig &cfg); void close (); void reset () {} bool write (); void pause () {} }; #endif // HAVE_ALSA #endif // AUDIO_ALSA_H sidplayfp-1.4.0/src/audio/alsa/audiodrv.cpp0000644000076400007640000000776212544211672015611 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2013 Leandro Nini * Copyright 2000-2006 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 "audiodrv.h" #ifdef HAVE_ALSA #include Audio_ALSA::Audio_ALSA() : AudioBase("ALSA") { // Reset everything. outOfOrder(); } Audio_ALSA::~Audio_ALSA() { close (); } void Audio_ALSA::outOfOrder() { // Reset everything. clearError(); _audioHandle = NULL; } void Audio_ALSA::checkResult(int err) { if (err < 0) { throw error(snd_strerror(err)); } } bool Audio_ALSA::open(AudioConfig &cfg) { snd_pcm_hw_params_t *hw_params = 0; try { if (_audioHandle != NULL) { throw error("Device already in use"); } checkResult(snd_pcm_open(&_audioHandle, "default", SND_PCM_STREAM_PLAYBACK, 0)); // May later be replaced with driver defaults. AudioConfig tmpCfg = cfg; checkResult(snd_pcm_hw_params_malloc(&hw_params)); checkResult(snd_pcm_hw_params_any(_audioHandle, hw_params)); checkResult(snd_pcm_hw_params_set_access(_audioHandle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED)); checkResult(snd_pcm_hw_params_set_format(_audioHandle, hw_params, SND_PCM_FORMAT_S16_LE)); checkResult(snd_pcm_hw_params_set_channels(_audioHandle, hw_params, tmpCfg.channels)); { // Gentoo bug #98769, comment 4 unsigned int rate = tmpCfg.frequency; checkResult(snd_pcm_hw_params_set_rate_near(_audioHandle, hw_params, &rate, 0)); } _alsa_to_frames_divisor = tmpCfg.channels; snd_pcm_uframes_t buffer_frames = 4096; checkResult(snd_pcm_hw_params_set_period_size_near(_audioHandle, hw_params, &buffer_frames, 0)); checkResult(snd_pcm_hw_params(_audioHandle, hw_params)); snd_pcm_hw_params_free(hw_params); hw_params = 0; checkResult(snd_pcm_prepare(_audioHandle)); tmpCfg.bufSize = buffer_frames * _alsa_to_frames_divisor; try { _sampleBuffer = new short[tmpCfg.bufSize]; } catch (std::bad_alloc const &ba) { throw error("Unable to allocate memory for sample buffers."); } // Setup internal Config _settings = tmpCfg; // Update the users settings getConfig (cfg); return true; } catch(error const &e) { setError(e.message()); if (hw_params) snd_pcm_hw_params_free(hw_params); if (_audioHandle != NULL) close(); return false; } } // Close an opened audio device, free any allocated buffers and // reset any variables that reflect the current state. void Audio_ALSA::close() { if (_audioHandle != NULL) { snd_pcm_close(_audioHandle); delete[] _sampleBuffer; outOfOrder (); } } bool Audio_ALSA::write() { if (_audioHandle == NULL) { setError("Device not open."); return false; } int err = snd_pcm_writei(_audioHandle, _sampleBuffer, _settings.bufSize / _alsa_to_frames_divisor); if (err < 0) { err = snd_pcm_recover(_audioHandle, err, 0); if (err < 0) { setError(snd_strerror(err)); return false; } } return true; } #endif // HAVE_ALSA sidplayfp-1.4.0/src/audio/AudioDrv.cpp0000644000076400007640000000360512544211672014561 00000000000000/* * This file is part of sidplayfp, a console SID player. * * 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. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "AudioDrv.h" // Unix Sound Drivers #include "pulse/audiodrv.h" #include "alsa/audiodrv.h" #include "oss/audiodrv.h" // Windows Sound Drivers #include "directx/audiodrv.h" #include "mmsystem/audiodrv.h" // Make sure that a sound driver was used #ifndef AudioDriver # warning Audio hardware not recognised, please check configuration files. #endif bool audioDrv::open(AudioConfig &cfg) { bool res = false; #ifdef HAVE_PULSE if(!res) { audio.reset(new Audio_Pulse()); res = audio->open(cfg); } #endif #ifdef HAVE_ALSA if(!res) { audio.reset(new Audio_ALSA()); res = audio->open(cfg); } #endif #ifdef HAVE_OSS if(!res) { audio.reset(new Audio_OSS()); res = audio->open(cfg); } #endif #ifdef HAVE_DIRECTX if(!res) { audio.reset(new Audio_DirectX()); res = audio->open(cfg); } #endif #ifdef HAVE_MMSYSTEM if(!res) { audio.reset(new Audio_MMSystem()); res = audio->open(cfg); } #endif return res; } sidplayfp-1.4.0/src/audio/wav/0000755000076400007640000000000012547546746013231 500000000000000sidplayfp-1.4.0/src/audio/wav/WavFile.cpp0000644000076400007640000001242112544211672015172 00000000000000/* * This file is part of sidplayfp, a SID player. * * Copyright 2011-2013 Leandro Nini * Copyright 2007-2010 Antti Lankila * Copyright 2000-2004 Simon White * Copyright 2000 Michael Schwendt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "WavFile.h" #include #include #include #include // Get the lo byte (8 bit) in a dword (32 bit) inline uint8_t endian_32lo8 (uint_least32_t dword) { return (uint8_t) dword; } // Get the hi byte (8 bit) in a dword (32 bit) inline uint8_t endian_32hi8 (uint_least32_t dword) { return (uint8_t) (dword >> 8); } // Get the hi word (16bit) in a dword (32 bit) inline uint_least16_t endian_32hi16 (uint_least32_t dword) { return (uint_least16_t) (dword >> 16); } // Get the lo byte (8 bit) in a word (16 bit) inline uint8_t endian_16lo8 (uint_least16_t word) { return (uint8_t) word; } // Set the hi byte (8 bit) in a word (16 bit) inline uint8_t endian_16hi8 (uint_least16_t word) { return (uint8_t) (word >> 8); } // Write a little-endian 16-bit word to two bytes in memory. inline void endian_little16 (uint8_t ptr[2], uint_least16_t word) { ptr[0] = endian_16lo8 (word); ptr[1] = endian_16hi8 (word); } // Write a little-endian 32-bit word to four bytes in memory. inline void endian_little32 (uint8_t ptr[4], uint_least32_t dword) { uint_least16_t word = 0; ptr[0] = endian_32lo8 (dword); ptr[1] = endian_32hi8 (dword); word = endian_32hi16 (dword); ptr[2] = endian_16lo8 (word); ptr[3] = endian_16hi8 (word); } const wavHeader WavFile::defaultWavHdr = { // ASCII keywords are hex-ified. {0x52,0x49,0x46,0x46}, {0,0,0,0}, {0x57,0x41,0x56,0x45}, {0x66,0x6d,0x74,0x20}, {16,0,0,0}, {1,0}, {0,0}, {0,0,0,0}, {0,0,0,0}, {0,0}, {0,0}, {0x64,0x61,0x74,0x61}, {0,0,0,0} }; WavFile::WavFile(const char *name) : AudioBase("WAVFILE"), name(name), wavHdr(defaultWavHdr), file(0), headerWritten(false), precision(32) {} bool WavFile::open(AudioConfig &cfg) { precision = cfg.precision; unsigned short bits = precision; unsigned short format = (precision == 16 ) ? 1 : 3; unsigned short channels = cfg.channels; unsigned long freq = cfg.frequency; unsigned short blockAlign = (bits>>3)*channels; unsigned long bufSize = freq * blockAlign; cfg.bufSize = bufSize; if (name.empty()) return false; if (file && !file->fail()) close(); byteCount = 0; // We need to make a buffer for the user try { _sampleBuffer = new short[bufSize]; } catch (std::bad_alloc const &ba) { setError("Unable to allocate memory for sample buffers."); return false; } // Fill in header with parameters and expected file size. endian_little32(wavHdr.length, sizeof(wavHeader)-8); endian_little16(wavHdr.channels, channels); endian_little16(wavHdr.format, format); endian_little32(wavHdr.sampleFreq, freq); endian_little32(wavHdr.bytesPerSec, freq*blockAlign); endian_little16(wavHdr.blockAlign, blockAlign); endian_little16(wavHdr.bitsPerSample, bits); endian_little32(wavHdr.dataChunkLen, 0); if (name.compare("-") == 0) { file = &std::cout; } else { file = new std::ofstream(name.c_str(), std::ios::out|std::ios::binary|std::ios::trunc); } _settings = cfg; return true; } bool WavFile::write() { if (file && !file->fail()) { unsigned long int bytes = _settings.bufSize; if (!headerWritten) { file->write((char*)&wavHdr,sizeof(wavHeader)); headerWritten = true; } /* XXX endianness... */ if (precision == 16) { bytes *= 2; file->write((char*)_sampleBuffer, bytes); } else { std::vector buffer(_settings.bufSize); bytes *= 4; for (unsigned long i=0;i<_settings.bufSize;i++) { buffer[i] = ((float)_sampleBuffer[i])/32768.f; } file->write((char*)&buffer.front(), bytes); } byteCount += bytes; } return true; } void WavFile::close() { if (file && !file->fail()) { endian_little32(wavHdr.length, byteCount+sizeof(wavHeader)-8); endian_little32(wavHdr.dataChunkLen, byteCount); if (file != &std::cout) { file->seekp(0, std::ios::beg); file->write((char*)&wavHdr, sizeof(wavHeader)); delete file; } file = 0; delete[] _sampleBuffer; } } sidplayfp-1.4.0/src/audio/wav/WavFile.h0000644000076400007640000000603212544211672014640 00000000000000/* * This file is part of sidplayfp, a SID player. * * Copyright 2011-2013 Leandro Nini * Copyright 2007-2010 Antti Lankila * Copyright 2000-2004 Simon White * Copyright 2000 Michael Schwendt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 WAV_FILE_H #define WAV_FILE_H #include #include #include "../AudioBase.h" struct wavHeader // little endian format { char mainChunkID[4]; // 'RIFF' (ASCII) unsigned char length[4]; // file length char chunkID[4]; // 'WAVE' (ASCII) char subChunkID[4]; // 'fmt ' (ASCII) char subChunkLen[4]; // length of subChunk, always 16 bytes unsigned char format[2]; // currently always = 1 = PCM-Code unsigned char channels[2]; // 1 = mono, 2 = stereo unsigned char sampleFreq[4]; // sample-frequency unsigned char bytesPerSec[4]; // sampleFreq * blockAlign unsigned char blockAlign[2]; // bytes per sample * channels unsigned char bitsPerSample[2]; char dataChunkID[4]; // keyword, begin of data chunk; = 'data' (ASCII) unsigned char dataChunkLen[4]; // length of data }; /* * A basic WAV output file type * Initial implementation by Michael Schwendt */ class WavFile: public AudioBase { private: std::string name; unsigned long int byteCount; static const wavHeader defaultWavHdr; wavHeader wavHdr; std::ostream *file; bool headerWritten; // whether final header has been written int precision; public: WavFile(const char *name); ~WavFile() { close(); } static const char *extension () { return ".wav"; } // Only signed 16-bit and 32bit float samples are supported. // Endian-ess is adjusted if necessary. // // If number of sample bytes is given, this can speed up the // process of closing a huge file on slow storage media. bool open(AudioConfig &cfg); // After write call old buffer is invalid and you should // use the new buffer provided instead. bool write(); void close(); void pause() {} void reset() {} // Stream state. bool fail() const { return (file->fail() != 0); } bool bad() const { return (file->bad() != 0); } }; #endif /* WAV_FILE_H */ sidplayfp-1.4.0/src/audio/directx/0000755000076400007640000000000012547546746014076 500000000000000sidplayfp-1.4.0/src/audio/directx/audiodrv.h0000644000076400007640000000413412544211672015766 00000000000000/* * This file is part of sidplayfp, a console SID player. * * 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. */ #ifndef AUDIO_DIRECTX_H #define AUDIO_DIRECTX_H #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_DIRECTX_H #define HAVE_DIRECTX #ifndef AudioDriver # define AudioDriver Audio_DirectX #endif #if DIRECTSOUND_VERSION < 0x0500 # undef DIRECTSOUND_VERSION # define DIRECTSOUND_VERSION 0x0500 /* version 5.0 */ #endif #include #include #include "../AudioBase.h" #define AUDIO_DIRECTX_BUFFERS 2 class Audio_DirectX: public AudioBase { private: // ------------------------------------------------------- private HWND hwnd; // DirectSound Support LPDIRECTSOUND lpds; LPDIRECTSOUNDBUFFER lpDsb; LPDIRECTSOUNDNOTIFY lpdsNotify; void *lpvData; // DirectSound Notify HANDLE rghEvent[AUDIO_DIRECTX_BUFFERS]; DWORD bufSize; bool isOpen; bool isPlaying; private: HWND GetConsoleHwnd (); public: // --------------------------------------------------------- public Audio_DirectX(); ~Audio_DirectX(); // This first one assumes progrm is built as a // console application bool open (AudioConfig &cfg); bool open (AudioConfig &cfg, HWND hwnd); void close (); void reset (); bool write (); void pause (); }; #endif // HAVE_DIRECTX_H #endif // AUDIO_DIRECTX_H sidplayfp-1.4.0/src/audio/directx/audiodrv.cpp0000644000076400007640000002121112544211672016314 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2013 Leandro Nini * Copyright 2000-2002 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 "audiodrv.h" #ifdef HAVE_DIRECTX #include #define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } } Audio_DirectX::Audio_DirectX() : AudioBase("DIRECTX"), lpds(0), lpDsb(0), lpdsNotify(0), isOpen(false) {} Audio_DirectX::~Audio_DirectX() { close(); } // Need this to setup DirectX HWND Audio_DirectX::GetConsoleHwnd () { // Taken from Microsoft Knowledge Base // Article ID: Q124103 #define MY_bufSize 1024 // buffer size for console window totles TCHAR pszNewWindowTitle[MY_bufSize]; // contains fabricated WindowTitle TCHAR pszOldWindowTitle[MY_bufSize]; // contains original WindowTitle // fetch curent window title GetConsoleTitle (pszOldWindowTitle, MY_bufSize); // format a "unique" NewWindowTitle wsprintf (pszNewWindowTitle, TEXT("%d/%d"), GetTickCount (), GetCurrentProcessId ()); // change the window title SetConsoleTitle (pszNewWindowTitle); // ensure window title has been updated Sleep (40); // look for NewWindowTitle HWND hwndFound = FindWindow (NULL, pszNewWindowTitle); // restore original window title SetConsoleTitle (pszOldWindowTitle); return hwndFound; } bool Audio_DirectX::open (AudioConfig &cfg) { // Assume we have a console. Use other other // if we have a non console Window HWND hwnd = GetConsoleHwnd (); return open (cfg, hwnd); } bool Audio_DirectX::open (AudioConfig &cfg, HWND hwnd) { LPDIRECTSOUNDBUFFER lpDsbPrimary = 0; try { if (isOpen) { throw error("Audio device already open."); } lpvData = 0; isOpen = true; for (int i = 0; i < AUDIO_DIRECTX_BUFFERS; i++) rghEvent[i] = CreateEvent(NULL, FALSE, FALSE, NULL); if (FAILED (DirectSoundCreate (NULL, &lpds, NULL))) { throw error("Could not open audio device."); } if (FAILED (lpds->SetCooperativeLevel (hwnd, DSSCL_PRIORITY))) { throw error("Could not set cooperative level."); } // Primary Buffer Setup DSBUFFERDESC dsbdesc; memset (&dsbdesc, 0, sizeof(DSBUFFERDESC)); dsbdesc.dwSize = sizeof(DSBUFFERDESC); dsbdesc.dwFlags = DSBCAPS_PRIMARYBUFFER; dsbdesc.dwBufferBytes = 0; dsbdesc.lpwfxFormat = NULL; // Format WAVEFORMATEX wfm; memset (&wfm, 0, sizeof(WAVEFORMATEX)); wfm.wFormatTag = WAVE_FORMAT_PCM; wfm.nChannels = cfg.channels; wfm.nSamplesPerSec = cfg.frequency; wfm.wBitsPerSample = 16; wfm.nBlockAlign = wfm.wBitsPerSample / 8 * wfm.nChannels; wfm.nAvgBytesPerSec = wfm.nSamplesPerSec * wfm.nBlockAlign; if (FAILED (lpds->CreateSoundBuffer(&dsbdesc, &lpDsbPrimary, NULL))) { throw error("Unable to create sound buffer."); } if (FAILED (lpDsbPrimary->SetFormat(&wfm))) { throw error("Unable to setup required sampling format."); } lpDsbPrimary->Release (); // Buffer size reduced to 2 blocks of 500ms bufSize = wfm.nSamplesPerSec / 2 * wfm.nBlockAlign; // Allocate secondary buffers memset (&dsbdesc, 0, sizeof(DSBUFFERDESC)); dsbdesc.dwSize = sizeof(DSBUFFERDESC); dsbdesc.dwFlags = DSBCAPS_CTRLPOSITIONNOTIFY | DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_GLOBALFOCUS | DSBCAPS_CTRLPAN; dsbdesc.dwBufferBytes = bufSize * AUDIO_DIRECTX_BUFFERS; dsbdesc.lpwfxFormat = &wfm; if (FAILED (lpds->CreateSoundBuffer(&dsbdesc, &lpDsb, NULL))) { throw error("Could not create sound buffer."); } lpDsb->Stop(); // Apparently this is used for timing ------------------------ DSBPOSITIONNOTIFY rgdscbpn[AUDIO_DIRECTX_BUFFERS]; // Buffer Start Notification // Rev 2.0.4 (saw) - On starting to play a buffer for (int i = 0; i < AUDIO_DIRECTX_BUFFERS; i++) { // Track one buffer ahead rgdscbpn[i].dwOffset = bufSize * ((i + 1) % AUDIO_DIRECTX_BUFFERS); rgdscbpn[i].hEventNotify = rghEvent[i]; } if (FAILED (lpDsb->QueryInterface (IID_IDirectSoundNotify, (VOID **) &lpdsNotify))) { throw error("Sound interface query failed."); } if (FAILED (lpdsNotify->SetNotificationPositions(AUDIO_DIRECTX_BUFFERS, rgdscbpn))) { throw error("Unable to set up sound notification positions."); } // ----------------------------------------------------------- lpDsb->Stop (); DWORD dwBytes; if (FAILED (lpDsb->Lock (0, bufSize, &lpvData, &dwBytes, NULL, NULL, 0))) { throw error("Unable to lock sound buffer."); } // Rev 1.7 (saw) - Set the play position back to the begining if (FAILED (lpDsb->SetCurrentPosition(0))) { throw error("Unable to set play position to start of buffer."); } // Update the users settings cfg.bufSize = bufSize / 2; _settings = cfg; isPlaying = false; _sampleBuffer = (short*)lpvData; return true; } catch(error const &e) { setError(e.message()); SAFE_RELEASE (lpDsbPrimary); close (); return false; } } bool Audio_DirectX::write () { if (!isOpen) { setError("Device not open."); return false; } // Unlock the current buffer for playing lpDsb->Unlock (lpvData, bufSize, NULL, 0); // Check to see of the buffer is playing // and if not start it off if (!isPlaying) { isPlaying = true; if (FAILED (lpDsb->Play (0,0,DSBPLAY_LOOPING))) { setError("Unable to start playback."); return false; } } // Check the incoming event to make sure it's one of our event messages and // not something else DWORD dwEvt; do { dwEvt = MsgWaitForMultipleObjects (AUDIO_DIRECTX_BUFFERS, rghEvent, FALSE, INFINITE, QS_ALLINPUT); dwEvt -= WAIT_OBJECT_0; } while (dwEvt >= AUDIO_DIRECTX_BUFFERS); // printf ("Event - %lu\n", dwEvt); // Lock the next buffer for filling DWORD dwBytes; if (FAILED (lpDsb->Lock (bufSize * dwEvt, bufSize, &lpvData, &dwBytes, NULL, NULL, 0))) { setError("Unable to lock sound buffer."); return false; } _sampleBuffer = (short*)lpvData; return true; } void Audio_DirectX::reset (void) { DWORD dwBytes; if (!isOpen) return; // Stop play and kill the current music. // Start new music data being added at the begining of // the first buffer lpDsb->Stop (); // Rev 1.7 (saw) - Prevents output going silent after reset isPlaying = false; lpDsb->Unlock (lpvData, bufSize, NULL, 0); // Rev 1.4 (saw) - Added as lock can fail. if (FAILED (lpDsb->Lock (0, bufSize, &lpvData, &dwBytes, NULL, NULL, 0))) { setError("Unable to lock sound buffer."); return; } _sampleBuffer = (short*)lpvData; } // Rev 1.8 (saw) - Alias fix void Audio_DirectX::close (void) { if (!isOpen) return; isOpen = false; _sampleBuffer = NULL; if (lpDsb) { lpDsb->Stop(); isPlaying = false; if (lpvData) { // Rev 1.4 (iv) - Unlock before we release buffer. lpDsb->Unlock (lpvData, bufSize, NULL, 0); } } SAFE_RELEASE (lpdsNotify); SAFE_RELEASE (lpDsb); SAFE_RELEASE (lpds); // Rev 1.3 (Ingve Vormestrand) - Changed "<=" to "<" // as closing invalid handle. for (int i=0;i < AUDIO_DIRECTX_BUFFERS; i++) CloseHandle (rghEvent[i]); } void Audio_DirectX::pause (void) { lpDsb->Stop (); isPlaying = false; } #endif // HAVE_DIRECTX sidplayfp-1.4.0/src/audio/oss/0000755000076400007640000000000012547546746013240 500000000000000sidplayfp-1.4.0/src/audio/oss/audiodrv.h0000644000076400007640000000377612544211672015143 00000000000000/* * This file is part of sidplayfp, a console SID player. * * 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. */ #ifndef AUDIO_OSS_H #define AUDIO_OSS_H #ifdef HAVE_CONFIG_H # include "config.h" #endif #if defined(HAVE_SYS_SOUNDCARD_H) \ || defined(HAVE_LINUX_SOUNDCARD_H) \ || defined(HAVE_MACHINE_SOUNDCARD_H) \ || defined(HAVE_SOUNDCARD_H) \ #define HAVE_OSS #ifndef AudioDriver # define AudioDriver Audio_OSS #endif #if defined(HAVE_SYS_SOUNDCARD_H) # include #elif defined(HAVE_LINUX_SOUNDCARD_H) # include #elif defined(HAVE_MACHINE_SOUNDCARD_H) # include #elif defined(HAVE_SOUNDCARD_H) # include #else # error Audio driver not supported. #endif #include "../AudioBase.h" /* * Open Sound System (OSS) specific audio driver interface. */ class Audio_OSS: public AudioBase { private: // ------------------------------------------------------- private static const char AUDIODEVICE[]; volatile int _audiofd; void outOfOrder (); public: // --------------------------------------------------------- public Audio_OSS(); ~Audio_OSS(); bool open (AudioConfig &cfg); void close (); void reset (); bool write (); void pause () {} }; #endif // HAVE_*_SOUNDCARD_H #endif // AUDIO_OSS_H sidplayfp-1.4.0/src/audio/oss/audiodrv.cpp0000644000076400007640000000735112544211672015467 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2000-2002 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 "audiodrv.h" #ifdef HAVE_OSS #include #include #include #include #include #if defined(HAVE_NETBSD) const char Audio_OSS::AUDIODEVICE[] = "/dev/audio"; #else const char Audio_OSS::AUDIODEVICE[] = "/dev/dsp"; #endif Audio_OSS::Audio_OSS() : AudioBase("OSS") { // Reset everything. outOfOrder(); } Audio_OSS::~Audio_OSS () { close (); } void Audio_OSS::outOfOrder () { // Reset everything. clearError(); _audiofd = -1; } bool Audio_OSS::open (AudioConfig &cfg) { if (_audiofd != -1) { setError("Device already in use"); return false; } try { if (access (AUDIODEVICE, W_OK) == -1) { throw error("Could not locate an audio device."); } if ((_audiofd = ::open (AUDIODEVICE, O_WRONLY, 0)) == (-1)) { throw error("Could not open audio device."); } int format = AFMT_S16_LE; if (ioctl (_audiofd, SNDCTL_DSP_SETFMT, &format) == (-1)) { throw error("Could not set sample format."); } // Set mono/stereo. if (ioctl (_audiofd, SNDCTL_DSP_CHANNELS, &cfg.channels) == (-1)) { throw error("Could not set mono/stereo."); } // Verify and accept the number of channels the driver accepted. switch (cfg.channels) { case 1: case 2: break; default: throw error("Could not set mono/stereo."); break; } // Set frequency. if (ioctl (_audiofd, SNDCTL_DSP_SPEED, &cfg.frequency) == (-1)) { throw error("Could not set frequency."); } int temp = 0; ioctl (_audiofd, SNDCTL_DSP_GETBLKSIZE, &temp); cfg.bufSize = (uint_least32_t) temp; try { _sampleBuffer = new short[cfg.bufSize]; } catch (std::bad_alloc const &ba) { throw error("Unable to allocate memory for sample buffers."); } // Setup internal Config _settings = cfg; return true; } catch(error const &e) { setError(e.message()); if (_audiofd != -1) { close (); _audiofd = -1; } perror (AUDIODEVICE); return false; } } // Close an opened audio device, free any allocated buffers and // reset any variables that reflect the current state. void Audio_OSS::close () { if (_audiofd != -1) { ::close (_audiofd); delete [] _sampleBuffer; outOfOrder (); } } void Audio_OSS::reset () { if (_audiofd != -1) { ioctl (_audiofd, SNDCTL_DSP_RESET, 0); } } bool Audio_OSS::write () { if (_audiofd == -1) { setError("Device not open."); return false; } ::write (_audiofd, _sampleBuffer, 2 * _settings.bufSize); return true; } #endif // HAVE_OSS sidplayfp-1.4.0/src/audio/AudioBase.h0000644000076400007640000000355612544211672014352 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2013 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 AUDIOBASE_H #define AUDIOBASE_H #include #include "IAudio.h" #include "AudioConfig.h" class AudioBase : public IAudio { protected: class error { private: const char* m_msg; public: error(const char* msg) : m_msg(msg) {} const char* message() const { return m_msg; } }; private: const char *_backendName; std::string _errorString; protected: AudioConfig _settings; short *_sampleBuffer; protected: void setError(const char* msg) { _errorString.assign(_backendName).append(" ERROR: ").append(msg); } void clearError() { _errorString.clear(); } public: AudioBase(const char* name) : _backendName(name), _sampleBuffer(NULL) {} virtual ~AudioBase() {} short *buffer() const { return _sampleBuffer; } void getConfig(AudioConfig &cfg) const { cfg = _settings; } const char *getErrorString() const { return _errorString.c_str(); } }; #endif // AUDIOBASE_H sidplayfp-1.4.0/src/audio/mmsystem/0000755000076400007640000000000012547546746014312 500000000000000sidplayfp-1.4.0/src/audio/mmsystem/audiodrv.h0000644000076400007640000000371012544211672016201 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2000 Jarno Paananen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 AUDIO_MMSYSTEM_H #define AUDIO_MMSYSTEM_H #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_MMSYSTEM_H #define HAVE_MMSYSTEM #ifndef AudioDriver # define AudioDriver Audio_MMSystem #endif #include #include #include "../AudioBase.h" class Audio_MMSystem: public AudioBase { private: // ------------------------------------------------------- private HWAVEOUT waveHandle; // Rev 1.3 (saw) - Buffer sizes adjusted to get a // correct playtimes #define MAXBUFBLOCKS 3 short *blocks[MAXBUFBLOCKS]; HGLOBAL blockHandles[MAXBUFBLOCKS]; WAVEHDR *blockHeaders[MAXBUFBLOCKS]; HGLOBAL blockHeaderHandles[MAXBUFBLOCKS]; int blockNum; int bufSize; bool isOpen; private: static const char* getErrorMessage(MMRESULT err); static void checkResult(MMRESULT err); public: // --------------------------------------------------------- public Audio_MMSystem(); ~Audio_MMSystem(); bool open (AudioConfig &cfg); void close (); void reset (); bool write (); void pause () {} }; #endif // HAVE_MMSYSTEM_H #endif // AUDIO_MMSYSTEM_H sidplayfp-1.4.0/src/audio/mmsystem/audiodrv.cpp0000644000076400007640000002054712544211672016543 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2013 Leandro Nini * Copyright 2001-2002 Simon White * Copyright 2000 Jarno Paananen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 "audiodrv.h" #ifdef HAVE_MMSYSTEM #include #include Audio_MMSystem::Audio_MMSystem() : AudioBase("MMSYSTEM"), waveHandle(0), isOpen(false) { for ( int i = 0; i < MAXBUFBLOCKS; i++ ) { blockHeaderHandles[i] = 0; blockHandles[i] = 0; blockHeaders[i] = NULL; blocks[i] = NULL; } } Audio_MMSystem::~Audio_MMSystem() { close(); } const char* Audio_MMSystem::getErrorMessage(MMRESULT err) { switch (err) { default: case MMSYSERR_ERROR: return "Unspecified error"; case MMSYSERR_BADDEVICEID: return "Device ID out of range"; case MMSYSERR_NOTENABLED: return "Driver failed enable"; case MMSYSERR_ALLOCATED: return "Device already allocated"; case MMSYSERR_INVALHANDLE: return "Device handle is invalid"; case MMSYSERR_NODRIVER: return "No device driver present"; case MMSYSERR_NOMEM: return "Memory allocation error"; case MMSYSERR_NOTSUPPORTED: return "Function isn't supported"; case MMSYSERR_BADERRNUM: return "Error value out of range"; case MMSYSERR_INVALFLAG: return "Invalid flag passed"; case MMSYSERR_INVALPARAM: return "Invalid parameter passed"; case MMSYSERR_HANDLEBUSY: return "Handle being used simultaneously on another thread (eg callback)"; case MMSYSERR_INVALIDALIAS: return "Specified alias not found"; case MMSYSERR_BADDB: return "Bad registry database"; case MMSYSERR_KEYNOTFOUND: return "Registry key not found"; case MMSYSERR_READERROR: return "Registry read error"; case MMSYSERR_WRITEERROR: return "Registry write error"; case MMSYSERR_DELETEERROR: return "Registry delete error"; case MMSYSERR_VALNOTFOUND: return "Registry value not found"; case MMSYSERR_NODRIVERCB: return "Driver does not call DriverCallback"; } /* TCHAR buffer[MAXERRORLENGTH]; waveOutGetErrorText(err, buffer, MAXERRORLENGTH); */ } void Audio_MMSystem::checkResult(MMRESULT err) { if (err != MMSYSERR_NOERROR) { throw error(getErrorMessage(err)); } } bool Audio_MMSystem::open(AudioConfig &cfg) { WAVEFORMATEX wfm; if (isOpen) { setError("Audio device already open."); return false; } isOpen = true; /* Initialise blocks */ memset (blockHandles, 0, sizeof (blockHandles)); memset (blockHeaders, 0, sizeof (blockHeaders)); memset (blockHeaderHandles, 0, sizeof (blockHeaderHandles)); // Format memset (&wfm, 0, sizeof(WAVEFORMATEX)); wfm.wFormatTag = WAVE_FORMAT_PCM; wfm.nChannels = cfg.channels; wfm.nSamplesPerSec = cfg.frequency; wfm.wBitsPerSample = 16; wfm.nBlockAlign = wfm.wBitsPerSample / 8 * wfm.nChannels; wfm.nAvgBytesPerSec = wfm.nSamplesPerSec * wfm.nBlockAlign; wfm.cbSize = 0; // Rev 1.3 (saw) - Calculate buffer to hold 250ms of data bufSize = wfm.nSamplesPerSec / 4 * wfm.nBlockAlign; try { cfg.bufSize = bufSize / 2; checkResult(waveOutOpen(&waveHandle, WAVE_MAPPER, &wfm, 0, 0, 0)); _settings = cfg; /* Allocate and lock memory for all mixing blocks: */ for (int i = 0; i < MAXBUFBLOCKS; i++ ) { /* Allocate global memory for mixing block: */ if ( (blockHandles[i] = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, bufSize)) == NULL ) { throw error("Can't allocate global memory."); } /* Lock mixing block memory: */ if ( (blocks[i] = (short *)GlobalLock(blockHandles[i])) == NULL ) { throw error("Can't lock global memory."); } /* Allocate global memory for mixing block header: */ if ( (blockHeaderHandles[i] = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, sizeof(WAVEHDR))) == NULL ) { throw error("Can't allocate global memory."); } /* Lock mixing block header memory: */ WAVEHDR *header; if ( (header = blockHeaders[i] = (WAVEHDR*)GlobalLock(blockHeaderHandles[i])) == NULL ) { throw error("Can't lock global memory."); } /* Reset wave header fields: */ memset (header, 0, sizeof (WAVEHDR)); header->lpData = (char*)blocks[i]; header->dwBufferLength = bufSize; header->dwFlags = WHDR_DONE; /* mark the block is done */ } blockNum = 0; _sampleBuffer = blocks[blockNum]; return true; } catch(error const &e) { setError(e.message()); close (); return false; } } bool Audio_MMSystem::write() { if (!isOpen) { setError("Device not open."); return false; } /* Reset wave header fields: */ blockHeaders[blockNum]->dwFlags = 0; /* Prepare block header: */ checkResult(waveOutPrepareHeader(waveHandle, blockHeaders[blockNum], sizeof(WAVEHDR))); checkResult(waveOutWrite(waveHandle, blockHeaders[blockNum], sizeof(WAVEHDR))); /* Next block, circular buffer style, and I don't like modulo. */ blockNum++; blockNum %= MAXBUFBLOCKS; /* Wait for the next block to become free */ while ( !(blockHeaders[blockNum]->dwFlags & WHDR_DONE) ) Sleep(20); checkResult(waveOutUnprepareHeader(waveHandle, blockHeaders[blockNum], sizeof(WAVEHDR))); _sampleBuffer = blocks[blockNum]; return true; } // Rev 1.2 (saw) - Changed, see AudioBase.h void Audio_MMSystem::reset() { if (!isOpen) return; // Stop play and kill the current music. // Start new music data being added at the begining of // the first buffer checkResult(waveOutReset(waveHandle)); blockNum = 0; _sampleBuffer = blocks[blockNum]; } void Audio_MMSystem::close() { if ( !isOpen ) return; isOpen = false; _sampleBuffer = NULL; /* Reset wave output device, stop playback, and mark all blocks done: */ if ( waveHandle ) { waveOutReset(waveHandle); /* Make sure all blocks are indeed done: */ int doneTimeout = 500; for (;;) { bool allDone = true; for ( int i = 0; i < MAXBUFBLOCKS; i++ ) { if ( blockHeaders[i] && (blockHeaders[i]->dwFlags & WHDR_DONE) == 0 ) allDone = false; } if ( allDone || (doneTimeout == 0) ) break; doneTimeout--; Sleep(20); } /* Unprepare all mixing blocks, unlock and deallocate all mixing blocks and mixing block headers: */ for ( int i = 0; i < MAXBUFBLOCKS; i++ ) { if ( blockHeaders[i] ) waveOutUnprepareHeader(waveHandle, blockHeaders[i], sizeof(WAVEHDR)); if ( blockHeaderHandles[i] ) { GlobalUnlock(blockHeaderHandles[i]); GlobalFree(blockHeaderHandles[i]); } if ( blockHandles[i] ) { GlobalUnlock(blockHandles[i]); GlobalFree(blockHandles[i]); } } /* Close wave output device: */ waveOutClose(waveHandle); } } #endif // HAVE_MMSYSTEM sidplayfp-1.4.0/src/audio/AudioConfig.h0000644000076400007640000000226112544211672014675 00000000000000/* * This file is part of sidplayfp, a console SID player. * * 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 AUDIOCONFIG_H #define AUDIOCONFIG_H #include class AudioConfig { public: uint_least32_t frequency; int precision; int channels; uint_least32_t bufSize; // sample buffer size AudioConfig() : frequency(48000), precision(16), channels(1), bufSize(0) {} }; #endif // AUDIOCONFIG_H sidplayfp-1.4.0/src/player.cpp0000644000076400007640000005242512544211672013243 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2011-2015 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 #include #include using std::cout; using std::cerr; using std::endl; #include #ifdef HAVE_UNISTD_H # include #endif #include "utils.h" #include "keyboard.h" #include "audio/AudioDrv.h" #include "audio/wav/WavFile.h" #include "ini/types.h" #include #include #include // Previous song select timeout (3 secs) #define SID2_PREV_SONG_TIMEOUT 4 #ifdef HAVE_SIDPLAYFP_BUILDERS_RESIDFP_H # include const char ConsolePlayer::RESIDFP_ID[] = "ReSIDfp"; #endif #ifdef HAVE_SIDPLAYFP_BUILDERS_RESID_H # include const char ConsolePlayer::RESID_ID[] = "ReSID"; #endif #ifdef HAVE_SIDPLAYFP_BUILDERS_HARDSID_H # include const char ConsolePlayer::HARDSID_ID[] = "HardSID"; #endif uint8_t* loadRom(const SID_STRING &romPath, const int size) { SID_IFSTREAM is(romPath.c_str(), std::ios::binary); if (is.is_open()) { try { uint8_t *buffer = new uint8_t[size]; is.read((char*)buffer, size); if (!is.fail()) { is.close(); return buffer; } delete [] buffer; } catch (std::bad_alloc const &ba) {} } return 0; } uint8_t* loadRom(const SID_STRING &romPath, const int size, const TCHAR defaultRom[]) { // Try to load given rom if (!romPath.empty()) { uint8_t* buffer = loadRom(romPath, size); if (buffer) return buffer; } // Fallback to default rom path try { SID_STRING dataPath(utils::getDataPath()); dataPath.append(SEPARATOR).append(TEXT("sidplayfp")).append(SEPARATOR).append(defaultRom); #if !defined _WIN32 && defined HAVE_UNISTD_H if (::access(dataPath.c_str(), R_OK) != 0) { dataPath = PKGDATADIR; dataPath.append(defaultRom); } #endif return loadRom(dataPath, size); } catch (utils::error const &e) { return 0; } } ConsolePlayer::ConsolePlayer (const char * const name) : m_name(name), m_tune(0), m_state(playerStopped), m_outfile(NULL), m_filename(""), m_quietLevel(0), m_verboseLevel(0), m_cpudebug(false) { // Other defaults m_filter.enabled = true; m_driver.device = NULL; m_driver.sid = EMU_RESIDFP; m_timer.start = 0; m_timer.length = 0; // FOREVER m_timer.valid = false; m_track.first = 0; m_track.selected = 0; m_track.loop = false; m_track.single = false; m_speed.current = 1; m_speed.max = 32; // Read default configuration m_iniCfg.read (); m_engCfg = m_engine.config (); { // Load ini settings IniConfig::audio_section audio = m_iniCfg.audio(); IniConfig::emulation_section emulation = m_iniCfg.emulation(); // INI Configuration Settings m_engCfg.forceC64Model = emulation.modelForced; m_engCfg.defaultC64Model = emulation.modelDefault; m_engCfg.defaultSidModel = emulation.sidModel; m_engCfg.forceSidModel = emulation.forceModel; m_engCfg.frequency = audio.frequency; m_engCfg.playback = audio.playback; m_precision = audio.precision; m_filter.enabled = emulation.filter; m_filter.bias = emulation.bias; m_filter.filterCurve6581 = emulation.filterCurve6581; m_filter.filterCurve8580 = emulation.filterCurve8580; if (!emulation.engine.empty()) { if (emulation.engine.compare(TEXT("RESIDFP")) == 0) { m_driver.sid = EMU_RESIDFP; } else if (emulation.engine.compare(TEXT("RESID")) == 0) { m_driver.sid = EMU_RESID; } #ifdef HAVE_SIDPLAYFP_BUILDERS_HARDSID_H else if (emulation.engine.compare(TEXT("HARDSID")) == 0) { m_driver.sid = EMU_HARDSID; m_driver.output = OUT_NULL; } #endif else if (emulation.engine.compare(TEXT("NONE")) == 0) { m_driver.sid = EMU_NONE; } } } createOutput (OUT_NULL, NULL); createSidEmu (EMU_NONE); uint8_t *kernalRom = loadRom((m_iniCfg.sidplay2()).kernalRom, 8192, TEXT("kernal")); uint8_t *basicRom = loadRom((m_iniCfg.sidplay2()).basicRom, 8192, TEXT("basic")); uint8_t *chargenRom = loadRom((m_iniCfg.sidplay2()).chargenRom, 4096, TEXT("chargen")); m_engine.setRoms(kernalRom, basicRom, chargenRom); delete [] kernalRom; delete [] basicRom; delete [] chargenRom; } IAudio* ConsolePlayer::getWavFile(const SidTuneInfo *tuneInfo) { const char *title = m_outfile; // Generate a name for the wav file if (title == NULL) { title = tuneInfo->dataFileName(); const size_t length = strlen(title); size_t i = length; while (i > 0) { if (title[--i] == '.') break; } if (!i) i = length; std::string name(title, i); // Change name based on subtune if (tuneInfo->songs() > 1) { std::ostringstream sstream; sstream << "[" << tuneInfo->currentSong() << "]"; name.append(sstream.str()); } name.append(WavFile::extension()); title = name.c_str(); } return new WavFile(title); } // Create the output object to process sound buffer bool ConsolePlayer::createOutput (OUTPUTS driver, const SidTuneInfo *tuneInfo) { // Remove old audio driver m_driver.null.close (); m_driver.selected = &m_driver.null; if (m_driver.device != NULL) { if (m_driver.device != &m_driver.null) delete m_driver.device; m_driver.device = NULL; } // Create audio driver switch (driver) { case OUT_NULL: m_driver.device = &m_driver.null; break; case OUT_SOUNDCARD: try { m_driver.device = new audioDrv(); } catch (std::bad_alloc const &ba) { m_driver.device = 0; } break; case OUT_WAV: try { m_driver.device = getWavFile(tuneInfo); } catch (std::bad_alloc const &ba) { m_driver.device = 0; } break; default: break; } // Audio driver failed if (!m_driver.device) { m_driver.device = &m_driver.null; displayError (ERR_NOT_ENOUGH_MEMORY); return false; } // Configure with user settings m_driver.cfg.frequency = m_engCfg.frequency; m_driver.cfg.precision = m_precision; m_driver.cfg.channels = 1; // Mono m_driver.cfg.bufSize = 0; // Recalculate if (m_engCfg.playback == SidConfig::STEREO) m_driver.cfg.channels = 2; { // Open the hardware bool err = false; if (!m_driver.device->open (m_driver.cfg)) err = true; // Can't open the same driver twice if (driver != OUT_NULL) { if (!m_driver.null.open (m_driver.cfg)) err = true; } if (err) { displayError(m_driver.device->getErrorString()); return false; } } // See what we got m_engCfg.frequency = m_driver.cfg.frequency; m_precision = m_driver.cfg.precision; switch (m_driver.cfg.channels) { case 1: if (m_engCfg.playback == SidConfig::STEREO) m_engCfg.playback = SidConfig::MONO; break; case 2: if (m_engCfg.playback != SidConfig::STEREO) m_engCfg.playback = SidConfig::STEREO; break; default: cerr << m_name << ": " << "ERROR: " << m_driver.cfg.channels << " audio channels not supported" << endl; return false; } return true; } // Create the sid emulation bool ConsolePlayer::createSidEmu (SIDEMUS emu) { // Remove old driver and emulation if (m_engCfg.sidEmulation) { sidbuilder *builder = m_engCfg.sidEmulation; m_engCfg.sidEmulation = NULL; m_engine.config (m_engCfg); delete builder; } // Now setup the sid emulation switch (emu) { #ifdef HAVE_SIDPLAYFP_BUILDERS_RESIDFP_H case EMU_RESIDFP: { try { ReSIDfpBuilder *rs = new ReSIDfpBuilder( RESIDFP_ID ); m_engCfg.sidEmulation = rs; if (!rs->getStatus()) goto createSidEmu_error; rs->create ((m_engine.info ()).maxsids()); if (!rs->getStatus()) goto createSidEmu_error; if (m_filter.filterCurve6581) rs->filter6581Curve(m_filter.filterCurve6581); if (m_filter.filterCurve8580) rs->filter8580Curve((double)m_filter.filterCurve8580); } catch (std::bad_alloc const &ba) {} break; } #endif // HAVE_SIDPLAYFP_BUILDERS_RESIDFP_H #ifdef HAVE_SIDPLAYFP_BUILDERS_RESID_H case EMU_RESID: { try { ReSIDBuilder *rs = new ReSIDBuilder( RESID_ID ); m_engCfg.sidEmulation = rs; if (!rs->getStatus()) goto createSidEmu_error; rs->create ((m_engine.info ()).maxsids()); if (!rs->getStatus()) goto createSidEmu_error; rs->bias(m_filter.bias); } catch (std::bad_alloc const &ba) {} break; } #endif // HAVE_SIDPLAYFP_BUILDERS_RESID_H #ifdef HAVE_SIDPLAYFP_BUILDERS_HARDSID_H case EMU_HARDSID: { try { HardSIDBuilder *hs = new HardSIDBuilder( HARDSID_ID ); m_engCfg.sidEmulation = hs; if (!hs->getStatus()) goto createSidEmu_error; hs->create ((m_engine.info ()).maxsids()); if (!hs->getStatus()) goto createSidEmu_error; } catch (std::bad_alloc const &ba) {} break; } #endif // HAVE_SIDPLAYFP_BUILDERS_HARDSID_H default: // Emulation Not yet handled // This default case results in the default // emulation break; } if (!m_engCfg.sidEmulation) { if (emu > EMU_DEFAULT) { // No sid emulation? displayError (ERR_NOT_ENOUGH_MEMORY); return false; } } if (m_engCfg.sidEmulation) { /* set up SID filter. HardSID just ignores call with def. */ m_engCfg.sidEmulation->filter(m_filter.enabled); } return true; createSidEmu_error: displayError (m_engCfg.sidEmulation->error ()); delete m_engCfg.sidEmulation; m_engCfg.sidEmulation = NULL; return false; } bool ConsolePlayer::open (void) { if ((m_state & ~playerFast) == playerRestart) { if (m_quietLevel < 2) cerr << endl; if (m_state & playerFast) m_driver.selected->reset (); m_state = playerStopped; } // Select the required song m_track.selected = m_tune.selectSong (m_track.selected); if (m_engine.load (&m_tune) < 0) { displayError (m_engine.error ()); return false; } // Get tune details const SidTuneInfo *tuneInfo = m_tune.getInfo (); if (!m_track.single) m_track.songs = tuneInfo->songs(); if (!createOutput (m_driver.output, tuneInfo)) return false; if (!createSidEmu (m_driver.sid)) return false; // Configure engine with settings if (!m_engine.config (m_engCfg)) { // Config failed displayError (m_engine.error ()); return false; } // Start the player. Do this by fast // forwarding to the start position m_driver.selected = &m_driver.null; m_speed.current = m_speed.max; m_engine.fastForward (100 * m_speed.current); m_engine.mute(0, 0, vMute[0]); m_engine.mute(0, 1, vMute[1]); m_engine.mute(0, 2, vMute[2]); m_engine.mute(1, 0, vMute[3]); m_engine.mute(1, 1, vMute[4]); m_engine.mute(1, 2, vMute[5]); m_engine.mute(2, 0, vMute[6]); m_engine.mute(2, 1, vMute[7]); m_engine.mute(2, 2, vMute[8]); // As yet we don't have a required songlength // so try the songlength database if (!m_timer.valid) { const int_least32_t length = m_database.length (m_tune); if (length > 0) m_timer.length = length; } // Set up the play timer m_timer.stop = 0; m_timer.stop += m_timer.length; if (m_timer.valid) { // Length relative to start m_timer.stop += m_timer.start; } else { // Check to make start time dosen't exceed end if (m_timer.stop & (m_timer.start >= m_timer.stop)) { displayError ("ERROR: Start time exceeds song length!"); return false; } } m_timer.current = ~0; m_state = playerRunning; // Update display menu(); updateDisplay(); return true; } void ConsolePlayer::close () { m_engine.stop(); if (m_state == playerExit) { // Natural finish emuflush (); if (m_driver.file) cerr << (char) 7; // Bell } else // Destroy buffers m_driver.selected->reset (); // Shutdown drivers, etc createOutput (OUT_NULL, NULL); createSidEmu (EMU_NONE); m_engine.load (NULL); m_engine.config (m_engCfg); if (m_quietLevel < 2) { // Correctly leave ansi mode and get prompt to // end up in a suitable location if ((m_iniCfg.console ()).ansi) cerr << '\x1b' << "[0m"; #ifndef _WIN32 cerr << endl; #endif } } // Flush any hardware sid fifos so all music is played void ConsolePlayer::emuflush () { switch (m_driver.sid) { #ifdef HAVE_SIDPLAYFP_BUILDERS_HARDSID_H case EMU_HARDSID: ((HardSIDBuilder *)m_engCfg.sidEmulation)->flush (); break; #endif // HAVE_LIBHARDSID_BUILDER default: break; } } // Out play loop to be externally called bool ConsolePlayer::play () { if (m_state == playerRunning) { updateDisplay(); // Fill buffer short *buffer = m_driver.selected->buffer (); const uint_least32_t length = m_driver.cfg.bufSize; const uint_least32_t ret = m_engine.play (buffer, length); if (ret < length) { if (m_engine.isPlaying ()) { m_state = playerError; } return false; } } switch (m_state) { case playerRunning: m_driver.selected->write (); // Deliberate run on case playerPaused: // Check for a keypress (approx 250ms rate, but really depends // on music buffer sizes). Don't do this for high quiet levels // as chances are we are under remote control. if ((m_quietLevel < 2) && _kbhit ()) decodeKeys (); return true; default: if (m_quietLevel < 2) cerr << endl; m_engine.stop (); #if HAVE_TSID == 1 if (m_tsid) { m_tsid.addTime ((int) m_timer.current, m_track.selected, m_filename); } #elif HAVE_TSID == 2 if (m_tsid) { char md5[SidTune::MD5_LENGTH + 1]; m_tune.createMD5 (md5); int_least32_t length = m_database.length (md5, m_track.selected); // ignore errors if (length < 0) length = 0; m_tsid.addTime (md5, m_filename, (uint) m_timer.current, m_track.selected, (uint) length); } #endif break; } return false; } void ConsolePlayer::stop () { m_state = playerStopped; m_engine.stop (); } // External Timer Event void ConsolePlayer::updateDisplay() { const uint_least32_t seconds = m_engine.time(); if (seconds == m_timer.current) return; if (!m_quietLevel) { cerr << "\b\b\b\b\b" << std::setw(2) << std::setfill('0') << ((seconds / 60) % 100) << ':' << std::setw(2) << std::setfill('0') << (seconds % 60) << std::flush; } m_timer.current = seconds; if (seconds == m_timer.start) { // Switch audio drivers. m_driver.selected = m_driver.device; memset(m_driver.selected->buffer (), 0, m_driver.cfg.bufSize); m_speed.current = 1; m_engine.fastForward(100); if (m_cpudebug) m_engine.debug (true, NULL); } else if (m_timer.stop && (seconds >= m_timer.stop)) { m_state = playerExit; for (;;) { if (m_track.single) return; // Move to next track m_track.selected++; if (m_track.selected > m_track.songs) m_track.selected = 1; if (m_track.selected == m_track.first) return; m_state = playerRestart; break; } if (m_track.loop) m_state = playerRestart; } } void ConsolePlayer::displayError (const char *error) { cerr << m_name << ": " << error << endl; } // Keyboard handling void ConsolePlayer::decodeKeys () { do { const int action = keyboard_decode (); if (action == A_INVALID) continue; switch (action) { case A_RIGHT_ARROW: m_state = playerFastRestart; if (!m_track.single) { m_track.selected++; if (m_track.selected > m_track.songs) m_track.selected = 1; } break; case A_LEFT_ARROW: m_state = playerFastRestart; if (!m_track.single) { // Only select previous song if less than timeout // else restart current song if ((m_engine.time()) < SID2_PREV_SONG_TIMEOUT) { m_track.selected--; if (m_track.selected < 1) m_track.selected = m_track.songs; } } break; case A_UP_ARROW: m_speed.current *= 2; if (m_speed.current > m_speed.max) m_speed.current = m_speed.max; m_engine.fastForward (100 * m_speed.current); break; case A_DOWN_ARROW: m_speed.current = 1; m_engine.fastForward (100); break; case A_HOME: m_state = playerFastRestart; m_track.selected = 1; break; case A_END: m_state = playerFastRestart; m_track.selected = m_track.songs; break; case A_PAUSED: if (m_state == playerPaused) { cerr << "\b\b\b\b\b\b\b\b\b"; // Just to make sure PAUSED is removed from screen cerr << " "; cerr << "\b\b\b\b\b\b\b\b\b"; m_state = playerRunning; } else { cerr << " [PAUSED]"; m_state = playerPaused; m_driver.selected->pause (); } break; case A_TOGGLE_VOICE1: vMute[0] = !vMute[0]; m_engine.mute(0, 0, vMute[0]); break; case A_TOGGLE_VOICE2: vMute[1] = !vMute[1]; m_engine.mute(0, 1, vMute[1]); break; case A_TOGGLE_VOICE3: vMute[2] = !vMute[2]; m_engine.mute(0, 2, vMute[2]); break; case A_TOGGLE_VOICE4: vMute[3] = !vMute[3]; m_engine.mute(1, 0, vMute[3]); break; case A_TOGGLE_VOICE5: vMute[4] = !vMute[4]; m_engine.mute(1, 1, vMute[4]); break; case A_TOGGLE_VOICE6: vMute[5] = !vMute[5]; m_engine.mute(1, 2, vMute[5]); break; case A_TOGGLE_VOICE7: vMute[6] = !vMute[6]; m_engine.mute(2, 0, vMute[6]); break; case A_TOGGLE_VOICE8: vMute[7] = !vMute[7]; m_engine.mute(2, 1, vMute[7]); break; case A_TOGGLE_VOICE9: vMute[8] = !vMute[8]; m_engine.mute(2, 2, vMute[8]); break; case A_TOGGLE_FILTER: m_filter.enabled = !m_filter.enabled; m_engCfg.sidEmulation->filter(m_filter.enabled); break; case A_QUIT: m_state = playerFastExit; return; break; } } while (_kbhit ()); } sidplayfp-1.4.0/src/args.cpp0000644000076400007640000004303212544211672012675 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2011-2015 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" using std::cout; using std::cerr; using std::endl; #ifdef HAVE_SIDPLAYFP_BUILDERS_HARDSID_H # include #endif /** * 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) { std::string newFileName(hvscBase); newFileName.append(SEPARATOR).append("DOCUMENTS").append(SEPARATOR).append("Songlengths.txt"); return m_database.open(newFileName.c_str()); } // Convert time from integer bool ConsolePlayer::parseTime (const char *str, uint_least32_t &time) { // Check for empty string if (*str == '\0') return false; uint_least32_t _time; char *sep = (char *) strstr (str, ":"); if (!sep) { // User gave seconds _time = atoi (str); } else { // Read in MM:SS format int val; *sep = '\0'; val = atoi (str); if (val < 0 || val > 99) return false; _time = (uint_least32_t) val * 60; val = atoi (sep + 1); if (val < 0 || val > 59) return false; _time += (uint_least32_t) val; } time = _time; return true; } bool ConsolePlayer::parseAddress (const char *str, uint_least16_t &address) { if (*str == '\0') return false; long x = strtol(str, 0, 0); address = x; return true; } // 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; 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] != NULL)) { 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; } #if LIBSIDPLAYFP_VERSION_MAJ > 1 || LIBSIDPLAYFP_VERSION_MIN >= 8 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] == 's') { // Stereo Playback m_engCfg.playback = SidConfig::STEREO; } 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; } // 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]); } // 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]; } #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 // 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 != NULL) 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; } // 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 incase 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_iniCfg.sidplay2()).playLength; if (m_driver.file) m_timer.length = (m_iniCfg.sidplay2()).recordLength; if (!hvscBase || !tryOpenDatabase(hvscBase)) { // Try load user configured songlength DB #if defined(WIN32) && defined(UNICODE) // FIXME char database[MAX_PATH]; const int ret = wcstombs(database, (m_iniCfg.sidplay2()).database.c_str(), sizeof(database)); if (ret >= MAX_PATH) database[0] = '\0'; #else const char *database = (m_iniCfg.sidplay2()).database.c_str(); #endif if (strlen(database) != 0) { // Try loading the database specificed by the user if (!m_database.open(database)) { displayError (m_database.error ()); return -1; } } } } } #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 << " [-