sidplayfp-1.1.0.1/0000755000076400007640000000000012223740346010657 500000000000000sidplayfp-1.1.0.1/AUTHORS0000644000076400007640000000320612215661707011654 00000000000000sidplayfp is a C64 music player forked from SIDPLAY2. Copyright (c) 2000 Simon White Copyright (c) 2007-2010 Antti Lankila Copyright (c) 2010-2013 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.1.0.1/doc/0000755000076400007640000000000012223740346011424 500000000000000sidplayfp-1.1.0.1/doc/Makefile.am0000644000076400007640000000002012215661707013374 00000000000000 SUBDIRS = en sidplayfp-1.1.0.1/doc/en/0000755000076400007640000000000012223740347012027 500000000000000sidplayfp-1.1.0.1/doc/en/Makefile.am0000644000076400007640000000011612215661707014004 00000000000000 man_MANS = sidplayfp.1 sidplayfp.ini.5 stilview.1 EXTRA_DIST = $(man_MANS) sidplayfp-1.1.0.1/doc/en/sidplayfp.10000644000076400007640000001132512215661707014031 00000000000000.\" Copyright 2000 Simon White (s_a_white@email.com) .\" Copyright 2000 Mikko Kilponen (mikil@uni.kaapeli.net) .\" Copyright 2012 Leandro Nini (drfiemost@users.sourceforge.net) .TH SIDPLAYFP 1 "18 March 2012" "SID Player Application" .SH NAME SIDPLAYFP \- Sidplayfp is a SID-chip emulator for playing Commodore 64 music. .SH SYNOPSIS .B sidplayfp .I [ OPTIONS... ] .B .SH DESCRIPTION Sidplayfp 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 much higher cpu usage. Additional playback modes have however been provided to allow playback on low specification machines at the cost of accuracy, but it still has a higher cpu demand than Sidplay. .SH SIDPLAYFP OPTIONS .TP \fB\--help|-h\fR Display help. .TP \fB\-f\fR Set frequency in Hz (default: 44100). .TP \fB\-nf\fR No filter emulation. This will reduce CPU overhead at the cost of reduced sound quality. .TP \fB\-o\fR Select track number (default: preset). .TP \fB\-s\fR Stereo playback. If the tune is identified as stereo then sid 1 and 2 become the left and right channels respectively. .TP \fB\-v[num]\fR Verbose output while playing. .TP \fB\-b\fR Set start time in [mins:]secs format (compatible with sid2wav). .TP \fB\-ds\fR 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. .TP \fB\-u\fR 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. .TP \fB\-p\fR 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. .TP \fB\-o\fR 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. .TP \fB\-q\fR Quiet output while playing (opposite of verbose). .TP \fB\-s\fR Playback the left or right stereo channel only. .TP \fB\-t\fR Set play length in [mins:]secs format (0 is endless). .TP \fB\-v[f]\fR 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. .TP \fB\-m[f]\fR 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. .TP \fB\-r[f]\fR 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. .TP \fB\-w[name]|--wav[name]\fR 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. .TP \fB\--resid\fR Use Dag Lem's reSID emulation engine. .TP \fB\--residfp\fR Use Antti Lankila's reSIDfp emulation engine. .TP \fB\--hardsid\fR Use HardSID device. .SH "SEE ALSO" sidplayfp.ini(5) .RS .SH NOTES ROM dumps are no longer embedded but must be supplied by the user. The ROM are optional and most tune should work fine without. Check the sidplayfp.ini(5) documentation for configuration details and default search paths. .SH OTHER INFORMATION Sidplayfp Homepage: http://sourceforge.net/projects/sidplay-residfp/ .br Sidplay2 homepage: http://sidplay2.sourceforge.net/ .br High Voltage Sid Collection (HVSC): http://hvsc.c64.org/ .SH AUTHORS sidplay2 - Simon White .br sidplay - Michael Schwendt .br reSID engine - Dag Lem .br reSIDfp engine - Antti Lankila .br man-page - Mikko Kilponen sidplayfp-1.1.0.1/doc/en/sidplayfp.ini.50000644000076400007640000001310612215661707014612 00000000000000.\" Copyright 2012 Leandro Nini (drfiemost@users.sourceforge.net) .TH SIDPLAYFP.INI 5 "18 March 2012" "SID Player Application" .SH NAME \fBsindplayfp.ini\fR \- Configuration file for \fBsidplayfp\fR(1). .SH 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, folowed by a list of \fI\fR=\fI\fR lines. .TP \fBsidplayfp.ini\fR supports the following sections: .TP \fB[SIDPlayfp]\fR \- Generic configuration .TP \fB[Console]\fR \- Console appearance configuration .TP \fB[Audio]\fR \- Audio output configuration .TP \fB[Emulation]\fR \- Emulation engine parameters .LP All options and values (except for file names and paths) are case insensitive, and are described in detail below. .LP For any of the following parameter, if it's specified more than one time the last entry encountered will be used. .LP \fBNOTE\fR: if any of these options is specified outside its section, it will be \fIignored\fR. .SH SIDPlay2 .br .TP \fBVersion\fR=\fI\fR Configuration version .br .TP \fBSonglength Database\fR=\fI\fR Full path for the Songlength DB. Should point to the DOCUMENTS/Songlengths.txt file under the HVSC collection path. .P .RS On *NIX systems if this value is not set, sidplayfp will try $PREFIX/share/sidplayfp/Songlengths.txt . .RE .br .TP \fBDefault Play Length\fR=\fImm:ss\fR Default play time if Songlength Database is not found. .br .TP \fBDefault Record Length\fR=\fImm:ss\fR Default recording time when writing wave files if Songlength Database is not found. .br .TP \fBKernal Rom\fR=\fI\fR 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: .IP \[bu] $XDG_DATA_HOME/sidplayfp/ on *NIX systems where XDG_DATA_HOME is defined. .IP \[bu] $HOME/.local/share/sidplayfp/ on *NIX systems where XDG_DATA_HOME is not defined. .IP \[bu] $PREFIX/share/sidplayfp on *NIX systems when not found in the above directories. .IP \[bu] %CSIDL_APPDATA%\\sidplayfp\\ on Windows systems where CSIDL_APPDATA is defined. .IP \[bu] %USERPROFILE%\\Application Data\\sidplayfp\\ on Windows systems where CSIDL_APPDATA is not defined. .br .TP \fBBasic Rom\fR=\fI\fR Full path for the Basic Rom file. This is moslty useful for playing BASIC tunes. By default the program will look for a \fIbasic\fR file under the same locations as above. .br .TP \fBChargen Rom\fR=\fI\fR 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. .br .SH Console .TP \fBAnsi\fR=\fItrue|false\fR Use ANSI escape sequences to provide colored output if supported by the terminal. .br .TP \fBChar Top Left\fR=\fI\fR Character for the top left corner. .br .TP \fBChar Top Right\fR=\fI\fR Character for the top right corner. .br .TP \fBChar Bottom Left\fR=\fI\fR Character for the bottom left corner. .br .TP \fBChar Bottom Right\fR=\fI\fR Character for the bottom right corner. .br .TP \fBChar Vertical\fR=\fI\fR Character for vertical lines. .br .TP \fBChar Horizontal\fR=\fI\fR Character for horizontal lines. .br .TP \fBChar Junction Left\fR=\fI\fR Character for left junctions. .br .TP \fBChar Junction Right\fR=\fI\fR Character for right junctions. .br .SH Audio .TP \fBFrequency\fR=\fI\fR Playback frequency expressed in Hertz. .br .TP \fBChannels\fR=\fI\fR Number of channels, 1 for mono and 2 for stereo playback. .br .TP \fBBitsPerSample\fR=\fI<16|32>\fR Number of bits ber sample, used only for wav output. Using values other than the ones specified will produce invalid output. .br .SH Emulation .TP \fBC64Model\fR=\fI\fR Default c64 model, 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. .br .TP \fBForceC64Model\fR=\fItrue|false\fR Force the selected c64 model wven if the tune states otherwise. .br .TP \fBSidModel\fR=\fI\fR Default SID chip model, old MOS 6581 or newer MOS 8580 .br .TP \fBForceSidModel\fR=\fItrue|false\fR Force the selected SID chip model wven if the tune states otherwise. .br .TP \fBUseFilter\fR=\fItrue|false\fR Enable/disable the emulation of the SID filter. .br .TP \fBFilterBias\fR=\fI\fR 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 .br .TP \fBFilterCurve6581\fR=\fI\fR 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 .br .TP \fBFilterCurve8580\fR=\fI\fR Controls the filter curve for the 8580 model in the ReSIDfp emulation. Value is expressed in Hertz and the default is 12500 .br .SH "SEE ALSO" sidplayfp(1) .RS .SH OTHER INFORMATION Sidplayfp Homepage: http://sourceforge.net/projects/sidplay-residfp/ .br Sidplay2 homepage: http://sidplay2.sourceforge.net/ .br High Voltage Sid Collection (HVSC): http://hvsc.c64.org/ .SH AUTHORS sidplay2 - Simon White .br sidplay - Michael Schwendt .br reSID engine - Dag Lem .br reSIDfp engine - Antti Lankila .br man-page - Mikko Kilponen sidplayfp-1.1.0.1/doc/en/Makefile.in0000644000076400007640000003772412223740332014023 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/en DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" man5dir = $(mandir)/man5 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUDIO_DRV = @AUDIO_DRV@ AUDIO_LDFLAGS = @AUDIO_LDFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PULSE_CFLAGS = @PULSE_CFLAGS@ PULSE_LIBS = @PULSE_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIDPLAYFP_CFLAGS = @SIDPLAYFP_CFLAGS@ SIDPLAYFP_LIBS = @SIDPLAYFP_LIBS@ STILVIEW_CFLAGS = @STILVIEW_CFLAGS@ STILVIEW_LIBS = @STILVIEW_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ man_MANS = sidplayfp.1 sidplayfp.ini.5 stilview.1 EXTRA_DIST = $(man_MANS) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/en/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/en/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-man5: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man5dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.5[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-man5 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 uninstall-man5 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man1 install-man5 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-man uninstall-man1 uninstall-man5 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: sidplayfp-1.1.0.1/doc/en/stilview.10000644000076400007640000006530512215661707013713 00000000000000'\" t .\" Title: stilview .\" Author: .\" Generator: DocBook XSL Stylesheets v1.77.1 .\" Date: September 2012 .\" Manual: Reference .\" Source: stilview .\" Language: English .\" .TH "STILVIEW" "1" "September 2012" "stilview" "Reference" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" stilview \- command\-line program to help you retrieve the entries stored in STIL .SH "SYNOPSIS" .HP \w'\fBstilview\fR\ 'u \fBstilview\fR [\fB\-b\fR] [\fB\-d\fR] [\fB\-e\fR\ \fIentry\fR] [\fB\-f\fR\ \fIfield\fR] [\fB\-i\fR] [\fB\-l\fR\ \fIHVSC\ base\ dir\fR] [\fB\-m\fR] [\fB\-o\fR] [\fB\-s\fR] [\fB\-t\fR\ \fItune\ number\fR] .HP \w'\fBstilview\fR\ 'u \fBstilview\fR {[\-h] | [\-v]} .SH "DESCRIPTION" .PP STILView is a command\-line driven program to help you retrieve the entries stored in STIL fast and accurately\&. STILView uses the STIL C++ class heavily to do this, and in fact, the primary purpose of this command\-line program is to test that class (which is, BTW, used in many GUI\-based SID players, most notably in SIDPlay for Windows and XSIDPLAY for Unix systems)\&. However, it is user\-friendly enough to be used by non\-programmers, too\&. .PP I am not sure about what other people do, but I use this command\-line STILView primarily as a tool under Solaris 2\&.6 to print out the STIL information for a SID file I am listening to with the UNIX command\-line version of SIDPlay\&.\&.\&. .SH "GLOSSARY" .PP Some terms and STIL\-related lingo in alphabetical order: .PP BUG ENTRY \- There exists a special file in HVSC (/DOCUMENTS/BUGlist\&.txt) that lists all known bugs in SID tunes in HVSC\&. See the top of that file for details about what\*(Aqs in it exactly\&. A BUG entry is like a STIL entry, but it is contained in this BUGlist\&.txt file\&. .PP FIELD \- The smallest piece of information in a STIL entry\&. Currently valid field names are NAME, TITLE, ARTIST and COMMENT\&. .PP FILE\-GLOBAL COMMENT \- A special COMMENT field in a STIL entry for a multi\-tune SID file that refers to the whole SID, not just one tune in it\&. These usually contain general information about the SID file itself\&. .PP Example: .sp .if n \{\ .RS 4 .\} .nf /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 .fi .if n \{\ .RE .\} .PP HVSC \- High Voltage SID Collection\&. If you don\*(Aqt know what this is, you downloaded the wrong program\&. :) .PP HVSC\-RELATIVE PATHNAME \- The pathname plus filename of a SID file that can be found in your HVSC, relative to the base directory of HVSC\&. It is always in UNIX\-style format, eg\&.: /Hubbard_Rob/Commando\&.sid refers to Rob Hubbard\*(Aqs Commando\&.sid file within HVSC (which may actually be found as C:\eMusic\eHVSC\eHubbard_Rob\eCommando\&.sid on your Windows PC)\&. .PP MULTI\-TUNE ENTRY \- A STIL entry that is referring to a SID file that has many tunes in it\&. Each tune might have its own STIL block, which are separated by a so\-called tune designation in the form of "(#x)", where x = the tune number\&. Consult the STIL\&.FAQ in HVSC for a detailed description\&. .PP Example: .sp .if n \{\ .RS 4 .\} .nf /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 .fi .if n \{\ .RE .\} .PP SECTION \- A part of STIL that belongs to one composer (ie\&. every STIL entry referring to SID files that are in one subdirectory in HVSC)\&. Sections in STIL are always separated by a line in the form of: "### Composer\*(Aqs name ########"\&. .PP SECTION\-GLOBAL COMMENT \- A special STIL entry that refers not to an individual SID file, but to a whole subdirectory\&. These usually contain info about the composer himself, or about all the SID file he/she ever composed, and are always indexed in the form of "/Subdir/" (note the trailing slash!)\&. .PP Example: .sp .if n \{\ .RS 4 .\} .nf /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)\&. .fi .if n \{\ .RE .\} .PP SINGLE\-TUNE ENTRY \- A STIL entry that has no tune designation in it in the form of "(#x)", where x is a number\&. (Note, that a single\-tune entry might still refer to a SID file which has many tunes in it, ie\&. when a single\-tune entry has nothing but a COMMENT field in it!) .PP Example: .sp .if n \{\ .RS 4 .\} .nf /Hubbard_Rob/Chain_Reaction\&.sid TITLE: Zoolook (remix) [from Zoolook] ARTIST: Jean Michel Jarre .fi .if n \{\ .RE .\} .PP Another example (the SID this is refering to has many tunes in it!): .sp .if n \{\ .RS 4 .\} .nf /Barrett_Steve/Magic_Land_Dizzy\&.sid COMMENT: Also used in the game "Wacky Darts" (c) 1990 Codemasters\&. .fi .if n \{\ .RE .\} .PP STIL \- SID Tune Information List, essentially a text\-file database that can be found in your HVSC in the /DOCUMENTS/ subdirectory\&. .PP STIL ENTRY \- All of the pieces of information in STIL relating to one SID file of the HVSC\&. They are always indexed by the HVSC\-relative pathname\&. .PP TUNE \- One of the compositions in a SID\&. Most SID files have only one tune in them, but many have more than one (eg\&. one for the title score of the game, and one for the hi\-score music)\&. .SH "OPTIONS" .PP \fB\-b\fR .RS 4 Do *not* print BUG entries .sp Default value: Not specified (ie\&. do print BUG entries) Example: stilview \-e=/Hubbard_Rob/Commando\&.sid \-b .sp 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\&. .RE .PP \fB\-d\fR .RS 4 Default value: Not specified (ie\&. debug mode is off) .sp Example: stilview \-e=/Hubbard_Rob/Commando\&.sid \-d .sp 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)\&. .RE .PP \fB\-e\fR=\fIentry\fR .RS 4 Default: NONE (you have to give an HVSC\-relative pathname to this option) .sp Example #1: stilview \-e=/Hubbard_Rob/Commando\&.sid Example #2: stilview \-e=/Hubbard_Rob/ .sp 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\*(Aqll 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\&. .sp 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/\&. .RE .PP \fB\-h\fR .RS 4 Default: NONE 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\&. .RE .PP \fB\-f\fR=\fIfield\fR .RS 4 Default: all .sp Valid values for are: all, name, author, title, artist, comment .sp Example #1: stilview \-l \-e=/Hubbard_Rob/Delta\&.sid \-f=comment .sp Example #2: stilview \-l \-e=/Hubbard_Rob/Delta\&.sid \-t=1 \-f=title .sp Example #3: stilview \-l \-e=/Hubbard_Rob/Delta\&.sid \-t=12 \-f=all \-s \-b .sp 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\*(Aqs entry\&. Below is full and complete explanation of what the different possible combinations of the \-t and \-f options retrieve: .sp \-t=0 \-f=all : All of the STIL entry is printed\&. .sp \-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\&.) .sp \-t=0 \-f= : Nothing is printed\&. This combination of these options is invalid\&. .sp \-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\*(Aqs a file\-global comment in the STIL entry (which also means that if a single\-tune entry has nothing but a COMMENT field in it), that is *not* printed with these combinations of options\&. .sp \-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\&. .sp 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)\&. .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 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\&. .RE .PP \fB\-i\fR .RS 4 Default: NONE .sp Example: stilview \-i .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 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\&. .RE .PP \fB\-l\fR=\fIHVSC base dir\fR .RS 4 Default: The value of the HVSC_BASE environment variable .sp Example #1: stilview \-l=C:\eMusic\eHVSC\e \-e=/Hubbard_Rob/Commando\&.sid .sp Example #2: stilview \-l=\&.\&./HVSC/ =\-e=/Hubbard_Rob/Commando\&.sid .sp Example #3: stilview \-l \-e=/Hubbard_Rob/Commando\&.sid .sp 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:\eMusic\eHVSC 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\*(Aqt exist or is pointing to a location where there\*(Aqs 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\&. .sp In example #1 the HVSC base directory is located in C:\eMusic\eHVSC\e on the hard drive of a Windows PC, in example #2 it is located in the HVSC directory of the current directory\*(Aqs 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\&. .RE .PP \fB\-m\fR .RS 4 Demo mode .sp Default: NONE .sp Example #1: stilview \-m .sp Example #2: stilview \-e=/Hubbard_Rob/Commando\&.sid \-m \-i .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 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\&. .RE .PP \fB\-o\fR .RS 4 Do *not* print STIL entries .sp Default value: Not specified (ie\&. do print STIL entries) .sp Example #1: stilview \-e=/Hubbard_Rob/Delta\&.sid \-o .sp Example #2: stilview \-e=/Hubbard_Rob/Delta\&.sid \-o \-s .sp 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\&. .RE .PP \fB\-s\fR .RS 4 Do *not* print section\-global comments .sp Default value: Not specified (ie\&. do print section\-global entries) .sp Example: stilview \-e=/Hubbard_Rob/Delta\&.sid \-s .sp 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\&. .RE .PP \fB\-t\fR=\fItune number\fR .RS 4 Default value: 0 .sp Example #1: stilview \-e=/Hubbard_Rob/Commando\&.sid \-t=0 .sp Example #2: stilview \-e=/Hubbard_Rob/Delta\&.sid \-t=1 \-f=title \-s \-b .sp Example #3: stilview \-e=/Hubbard_Rob/Delta\&.sid \-t=12 .sp 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\*(Aqs entry\&. .sp For further details about this option, see the explanation of the \-f option\&. .sp 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\*(Aqs 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)\&. .RE .PP \fB\-v\fR .RS 4 Print version numbers .sp Default value: Not specified (ie\&. do *not* print version numbers) .sp Example #1: stilview \-v .sp Example #2: stilview \-e=/Hubbard_Rob/Commando\&.sid \-v .sp 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\&. .RE .SH "ENVIRONMENT" .PP \fBHVSC_BASE\fR .RS 4 Specifies the location of the HVSC base directory\&. .RE .SH "EXAMPLES" .PP All of the examples below assume that the HVSC_BASE environment is set to a valid HVSC base directory (where the $HVSC_BASE/DOCUMENTS/STIL\&.txt and $HVSC_BASE/DOCUMENTS/BUGlist\&.txt files exist), and the examples also assume the presence of the following entries in these files: .PP \-\-\- In STIL\&.txt \-\-\- .sp .if n \{\ .RS 4 .\} .nf /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\&. .fi .if n \{\ .RE .\} .PP \-\-\- In BUGlist\&.txt \-\-\- .sp .if n \{\ .RS 4 .\} .nf /Hubbard_Rob/Commando\&.sid BUG: This is just for demo\&. /Hubbard_Rob/Delta\&.sid (#12) BUG: Demo entry\&. .fi .if n \{\ .RE .\} .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 SID file is printed: .sp .if n \{\ .RS 4 .\} .nf $> 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\&. $> .fi .if n \{\ .RE .\} .PP Ask for just the section\-global comment: .sp .if n \{\ .RS 4 .\} .nf $> 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\&. $> .fi .if n \{\ .RE .\} .PP Note that this can also be retrieved with: .sp .if n \{\ .RS 4 .\} .nf $> 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\&. $> .fi .if n \{\ .RE .\} .PP This prints out nothing, as single\-tune entries do not have file\-global comments: .sp .if n \{\ .RS 4 .\} .nf $> stilview \-e=/Hubbard_Rob/International_Karate\&.sid \-t=0 \-f=comment \-s \-b $> .fi .if n \{\ .RE .\} .PP \&.\&.\&.Except if the only field in them is a COMMENT (in which case that comment is assumed to be a file\-global comment): .sp .if n \{\ .RS 4 .\} .nf $> 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) $> .fi .if n \{\ .RE .\} .PP Also note that single\-tune entries have only one tune, so asking for the STIL entry of tune #3 is pointless: .sp .if n \{\ .RS 4 .\} .nf $> stilview \-e=/Hubbard_Rob/International_Karate\&.sid \-t=3 \-s \-b $> .fi .if n \{\ .RE .\} .PP Print out the file\-global comment for the given SID file: .sp .if n \{\ .RS 4 .\} .nf $> 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\&. $> .fi .if n \{\ .RE .\} .PP Print out the ARTIST field of tune #12 of the given SID file, plus print out everything else related to the SID file: .sp .if n \{\ .RS 4 .\} .nf $> 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\&. $> .fi .if n \{\ .RE .\} .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: .sp .if n \{\ .RS 4 .\} .nf $> stilview \-e=/Hubbard_Rob/Rasputin\&.sid \-t=1 \-f=title \-s TITLE: Katjusha (0:07\-0:36) $> .fi .if n \{\ .RE .\} .PP Section\-global comments are printed out even if the STIL entry for the given SID file does not exist: .sp .if n \{\ .RS 4 .\} .nf $> 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\&. $> .fi .if n \{\ .RE .\} .PP The following 4 steps depict how to have STILView print out everything related to a given SID file\*(Aqs given tune number one by one: .PP 1) This prints out just the section\-global comment: .sp .if n \{\ .RS 4 .\} .nf $> 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\&. $> .fi .if n \{\ .RE .\} .PP 2) This prints out just the file\-global comment: .sp .if n \{\ .RS 4 .\} .nf $> 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\&. $> .fi .if n \{\ .RE .\} .PP 3) This prints out all of the STIL entry for the given tune number: .sp .if n \{\ .RS 4 .\} .nf $> 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) $> .fi .if n \{\ .RE .\} .PP 4) And this prints out just the BUG entry for the same tune number: .sp .if n \{\ .RS 4 .\} .nf $> stilview \-e=/Hubbard_Rob/Delta\&.sid \-t=12 \-s \-o BUG: Demo entry\&. $> .fi .if n \{\ .RE .\} .PP The following 3 steps depict how to have STILView print out everything related to a given SID file: .PP 1) This prints out just the section\-global comment: .sp .if n \{\ .RS 4 .\} .nf $> 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\&. $> .fi .if n \{\ .RE .\} .PP 2) This prints out all of the STIL entry: .sp .if n \{\ .RS 4 .\} .nf $> 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) $> .fi .if n \{\ .RE .\} .PP 3) And this prints out all of the BUG entry: .sp .if n \{\ .RS 4 .\} .nf $> \fBstilview\fR \-e=/Hubbard_Rob/Delta\&.sid \-s \-o (#12) BUG: Demo entry\&. $> .fi .if n \{\ .RE .\} .SH AUTHORS \fBLaLa\fR <\&LaLa@C64.org\&> .br Leandro Nini <\&drfiemost@users.sourceforge.net\&> sidplayfp-1.1.0.1/doc/Makefile.in0000644000076400007640000004261712223740332013416 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUDIO_DRV = @AUDIO_DRV@ AUDIO_LDFLAGS = @AUDIO_LDFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PULSE_CFLAGS = @PULSE_CFLAGS@ PULSE_LIBS = @PULSE_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIDPLAYFP_CFLAGS = @SIDPLAYFP_CFLAGS@ SIDPLAYFP_LIBS = @SIDPLAYFP_LIBS@ STILVIEW_CFLAGS = @STILVIEW_CFLAGS@ STILVIEW_LIBS = @STILVIEW_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = en all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic cscopelist-am ctags ctags-am \ distclean distclean-generic distclean-tags distdir dvi dvi-am \ html html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: sidplayfp-1.1.0.1/configure.ac0000644000076400007640000000524712223740314013070 00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT([sidplayfp], [1.1.0.1], [], [], [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 audiodrv_libadd="" AUDIO_LDFLAGS="" PKG_CHECK_MODULES(ALSA, [alsa >= 1.0], [AC_DEFINE([HAVE_ALSA], 1, [Define to 1 if you have libasound (-lasound).]) audiodrv_libadd="$audiodrv_libadd ./audio/alsa/libalsa.a"], [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).]) audiodrv_libadd="$audiodrv_libadd ./audio/pulse/libpulse.a"], [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"], [audiodrv_libadd="$audiodrv_libadd ./audio/directx/libdirectx.a" AUDIO_LDFLAGS="$AUDIO_LDFLAGS -ldsound -ldxguid"] ) AS_IF([test "$ac_cv_header_mmsystem_h" = "yes"], [audiodrv_libadd="$audiodrv_libadd ./audio/mmsystem/libmmsystem.a" AUDIO_LDFLAGS="$AUDIO_LDFLAGS -lwinmm"] ) # NetBSD/OpenBSD OSS audio emulation AS_IF([test "x$ac_cv_header_soundcard_h" = "xyes"], [audiodrv_libadd="$audiodrv_libadd ./audio/oss/liboss.a" AUDIO_LDFLAGS="$AUDIO_LDFLAGS -lossaudio"] ) AS_IF([test "x$ac_cv_header_machine_soundcard_h" = "xyes" -o "x$ac_cv_header_linux_soundcard_h" = "xyes" -o "x$ac_cv_header_sys_soundcard_h" = "xyes"], [audiodrv_libadd="$audiodrv_libadd ./audio/oss/liboss.a"] ) AC_SUBST(AUDIO_LDFLAGS) AUDIO_DRV="$audiodrv_libadd" AC_SUBST(AUDIO_DRV) 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_CONFIG_FILES([ Makefile doc/Makefile doc/en/Makefile src/Makefile src/audio/Makefile src/audio/alsa/Makefile src/audio/directx/Makefile src/audio/mmsystem/Makefile src/audio/null/Makefile src/audio/oss/Makefile src/audio/pulse/Makefile src/audio/wav/Makefile ]) AC_OUTPUT sidplayfp-1.1.0.1/README0000644000076400007640000000340712215661710011461 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-2013 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.1.0.1/build-aux/0000755000076400007640000000000012223740346012551 500000000000000sidplayfp-1.1.0.1/build-aux/depcomp0000755000076400007640000005601612221273050014045 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 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.1.0.1/build-aux/missing0000755000076400007640000001533112221273047014070 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2012-06-26.16; # UTC # Copyright (C) 1996-2013 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 'automa4te' 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.1.0.1/build-aux/config.sub0000755000076400007640000010530112221273047014451 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-04-24' # 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 with a ChangeLog entry to config-patches@gnu.org. # # 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-2013 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 | 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 \ | 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 \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | 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 \ | 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 ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | 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-* \ | 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-* \ | 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-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | 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-* \ | 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 ;; 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=i386-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 ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-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* \ | -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*) # 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 ;; 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 ;; or1k-*) 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.1.0.1/build-aux/config.guess0000755000076400007640000013036112221273047015012 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-06-10' # 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. # # 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 with a ChangeLog entry to config-patches@gnu.org. 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-2013 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'` ;; 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/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` 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 ;; i*: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; } ;; or1k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; or32: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 [ "$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 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 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: sidplayfp-1.1.0.1/build-aux/install-sh0000755000076400007640000003325512221273047014502 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # 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. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # 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 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 -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-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 eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test 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` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: sidplayfp-1.1.0.1/Makefile.am0000644000076400007640000000045512215661710012635 00000000000000 AUTOMAKE_OPTIONS = foreign SUBDIRS = doc src EXTRA_DIST = \ src/ini/AUTHORS \ src/ini/COPYING \ src/ini/README AM_CPPFLAGS = -I $(top_builddir) # Remove svn directories from any subdirs that get # included completely (e.g. win, directx,...). dist-hook: @rm -rf `find $(distdir) -path \*/.svn`; sidplayfp-1.1.0.1/src/0000755000076400007640000000000012223740347011447 500000000000000sidplayfp-1.1.0.1/src/stilview.cpp0000644000076400007640000005152412215661710013745 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.1.0.1/src/main.cpp0000644000076400007640000000635612215661710013026 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.1.0.1/src/utils.h0000644000076400007640000000220212215661710012671 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 class utils { public: class error {}; private: #ifdef _WIN32 static std::string getPath(); #else static std::string getPath(const char* id, const char* def); #endif public: static std::string getDataPath(); static std::string getConfigPath(); }; #endif sidplayfp-1.1.0.1/src/ini/0000755000076400007640000000000012223740347012226 500000000000000sidplayfp-1.1.0.1/src/ini/AUTHORS0000644000076400007640000000001412215661707013214 00000000000000Simon White sidplayfp-1.1.0.1/src/ini/list.i0000644000076400007640000002772412215661707013312 00000000000000/*************************************************************************** list.i - Adds list support to ini files ------------------- begin : Fri Apr 21 2000 copyright : (C) 2000 by Simon White email : s_a_white@email.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include #include #include "list.h" #ifdef INI_ADD_LIST_SUPPORT /******************************************************************************************************************** * Function : ini_listEval * Parameters : ini - pointer to ini file database. * Returns : -1 for Error or the numbers of list items found * Globals Used : * Globals Modified : * Description : Uses the currently specified delimiters to calculate the number of eliments in a list ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int __ini_listEval (ini_t *ini) { int length, count, i, ret; int ldelim; char ch; // Remove old list if (ini->list) { free (ini->list); ini->list = NULL; } // Re-evaluate with new settings length = ini->selected->selected->length; if (length < 0) return -1; if (!length) { ini->listIndex = 0; ini->listLength = 0; if (ini->selected->selected == &ini->tmpKey) return -1; // Can't read tmpKey return 0; } // See if there are any chars which can be used to split the string into sub ones if (!ini->listDelims) return -1; ldelim = (int) strlen (ini->listDelims); // Buffer string for faster access ini->list = (char *) malloc (length + 1); if (!ini->list) return -1; { // Backup up delims to avoid causing problems with readString char *delims = ini->listDelims; ini->listDelims = NULL; ret = ini_readString ((ini_fd_t) ini, ini->list, length + 1); ini->listDelims = delims; if (ret < 0) return -1; } // Process buffer string to find number of sub strings { char lastch = '\0'; count = 1; while (length) { length--; ch = ini->list[length]; for (i = 0; i < ldelim; i++) { if ((char) ch == ini->listDelims[i]) { // Prevent lots of NULL strings on multiple // whitespace if (lastch == '\0') { if (isspace (ch)) { ch = '\0'; break; } } // Seperate strings ini->list[length] = (ch = '\0'); count++; break; } } lastch = ch; } } ini->listLength = count; ini->listIndexPtr = ini->list; ini->listIndex = 0; return count; } /******************************************************************************************************************** * Function : __ini_listRead * Parameters : ini - pointer to ini file database. * Returns : NULL for error, string point otherwise * Globals Used : * Globals Modified : * Description : Reads the indexed parameter from the list and auto * : increments ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ const char *__ini_listRead (ini_t *ini) { const char *p; // we must read an element from the list // Rev 1.2 Changed order of these two ifs as test was performed // sometimes before anything was read if (!ini->list) { if (__ini_listEval (ini) < 0) return NULL; // Handle an empty list if (!ini->listLength) return ""; } // Check to see if we are trying to get a value beyond the end of the list if (ini->listIndex >= ini->listLength) return NULL; p = ini->listIndexPtr; // Auto increment pointers to next index ini->listIndexPtr += (strlen (ini->listIndexPtr) + 1); ini->listIndex++; return p; } /******************************************************************************************************************** * Function : ini_listLength * Parameters : ini - pointer to ini file database. heading - heading name. key - key name. * Returns : -1 for Error or the numbers of list items found * Globals Used : * Globals Modified : * Description : Uses the currently specified delimiters to calculate the number of eliments in a list ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int INI_LINKAGE ini_listLength (ini_fd_t fd) { ini_t *ini = (ini_t *) fd; // Check to make sure a section/key has // been asked for by the user if (!ini->selected) return -1; if (!ini->selected->selected) return -1; // Check to see if we have moved to a new key if (!ini->list) return __ini_listEval (ini); return ini->listLength; } /******************************************************************************************************************** * Function : __ini_listDelims * Parameters : ini - pointer to ini file database. delims - string of delimitor chars * Returns : -1 for Error or 0 for success * Globals Used : * Globals Modified : * Description : Sets the delimiters used for list accessing, (default delim is NULL) ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int __ini_listDelims (struct ini_t *ini, const char *delims) { if (ini->listDelims) free (ini->listDelims); ini->listDelims = NULL; // Make sure we have something to copy if (delims) { if (*delims) { // Store delims for later use ini->listDelims = strdup (delims); if (!ini->listDelims) return -1; } } // List will need recalculating at some point if (ini->list) { free (ini->list); ini->list = NULL; } return 0; } /******************************************************************************************************************** * Function : ini_listDelims * Parameters : fd - pointer to ini file database. delims - string of delimitor chars * Returns : -1 for Error or 0 for success * Globals Used : * Globals Modified : * Description : Sets the delimiters used for list accessing, (default delim is NULL) ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int INI_LINKAGE ini_listDelims (ini_fd_t fd, const char *delims) { return __ini_listDelims ((ini_t *) fd, delims); } /******************************************************************************************************************** * Function : ini_listIndex * Parameters : ini - pointer to ini file database. delims - string of delimitor chars * Returns : * Globals Used : * Globals Modified : * Description : Sets the index that the next call to any of the read function will obtain (default 0) ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int INI_LINKAGE ini_listIndex (ini_fd_t fd, unsigned long index) { ini_t *ini = (ini_t *) fd; unsigned int count; char *p; // Check to make sure a section/key has // been asked for by the user if (!ini->selected) return -1; if (!ini->selected->selected) return -1; // Pull in new list if (!ini->list) { if (__ini_listEval (ini) < 0) return -1; } // Now scroll through to required index if (!ini->listLength) return -1; if (index == ini->listIndex) return 0; if (index > ini->listIndex) { // Continue search from the from current position count = ini->listIndex; p = ini->listIndexPtr; } else { // Reset list and search from beginning count = 0; p = ini->list; } while (count != index) { count++; if (count >= ini->listLength) return -1; // Jump to next sub string p += (strlen (p) + 1); } ini->listIndex = count; ini->listIndexPtr = p; return 0; } /******************************************************************************************************************** * Function : __ini_listIndexLength * Parameters : ini - pointer to ini file database * Returns : * Globals Used : * Globals Modified : * Description : Returns the length the indexed sub string ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int __ini_listIndexLength (ini_t *ini) { if (!ini->list) { // No list yet. So try to get one if (__ini_listEval (ini) < 0) return -1; if (!ini->listLength) return 0; } // Now return length return strlen (ini->listIndexPtr); } #endif // INI_ADD_LIST_SUPPORT sidplayfp-1.1.0.1/src/ini/libini.h0000644000076400007640000001603712215661707013577 00000000000000/*************************************************************************** libini.h - Header file of functions to manipulate an ini file. ------------------- begin : Fri Apr 21 2000 copyright : (C) 2000 by Simon White email : s_a_white@email.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef _libini_h_ #define _libini_h_ #ifdef __cplusplus extern "C" { #endif #include #define INI_ADD_EXTRAS #define INI_ADD_LIST_SUPPORT #ifdef SWIG %ignore ini_readString; %include typemaps.i %apply int *INOUT { int *value }; %apply long *INOUT { long *value }; %apply double *INOUT { double *value }; %rename (ini_readString) ini_readFileToBuffer; #define INI_EXTERN #define INI_STATIC #endif /* SWIG */ #ifdef _WINDOWS # define INI_LINKAGE __stdcall #else # define INI_LINKAGE #endif /* DLL building support on win32 hosts */ #ifndef INI_EXTERN # ifdef DLL_EXPORT /* defined by libtool (if required) */ # define INI_EXTERN __declspec(dllexport) # endif # ifdef LIBINI_DLL_IMPORT /* define if linking with this dll */ # define INI_EXTERN extern __declspec(dllimport) # endif # ifndef INI_EXTERN /* static linking or !_WIN32 */ # define INI_EXTERN extern # endif #endif #ifndef INI_ADD_EXTRAS #undef INI_ADD_LIST_SUPPORT #endif /* Compatibility with future C++ code */ #ifndef ini_fd_t #define ini_fd_t ini_fd_t typedef void* ini_fd_t; #endif /* Rev 1.2 Added new fuction */ INI_EXTERN ini_fd_t INI_LINKAGE ini_open (const char *name, const char *mode, const char *comment); INI_EXTERN int INI_LINKAGE ini_close (ini_fd_t fd); INI_EXTERN int INI_LINKAGE ini_flush (ini_fd_t fd); INI_EXTERN int INI_LINKAGE ini_delete (ini_fd_t fd); /* Rev 1.2 Added these functions to make life a bit easier, can still be implemented * through ini_writeString though. */ INI_EXTERN int INI_LINKAGE ini_locateKey (ini_fd_t fd, const char *key); INI_EXTERN int INI_LINKAGE ini_locateHeading (ini_fd_t fd, const char *heading); INI_EXTERN int INI_LINKAGE ini_deleteKey (ini_fd_t fd); INI_EXTERN int INI_LINKAGE ini_deleteHeading (ini_fd_t fd); INI_EXTERN const char * INI_LINKAGE ini_currentKey (ini_fd_t fd); INI_EXTERN const char * INI_LINKAGE ini_currentHeading (ini_fd_t fd); /* Returns the number of bytes required to be able to read the key as a * string from the file. (1 should be added to this length to account * for a NULL character). If delimiters are used, returns the length * of the next data element in the key to be read */ INI_EXTERN int INI_LINKAGE ini_dataLength (ini_fd_t fd); /* Default Data Type Operations * Arrays implemented to help with reading, for writing you should format the * complete array as a string and perform an ini_writeString. */ INI_EXTERN int INI_LINKAGE ini_readString (ini_fd_t fd, char *str, size_t size); INI_EXTERN int INI_LINKAGE ini_writeString (ini_fd_t fd, const char *str); INI_EXTERN int INI_LINKAGE ini_readInt (ini_fd_t fd, int *value); #ifdef INI_ADD_EXTRAS /* Read Operations */ INI_EXTERN int INI_LINKAGE ini_readLong (ini_fd_t fd, long *value); INI_EXTERN int INI_LINKAGE ini_readDouble (ini_fd_t fd, double *value); INI_EXTERN int INI_LINKAGE ini_readBool (ini_fd_t fd, int *value); /* Write Operations */ INI_EXTERN int INI_LINKAGE ini_writeInt (ini_fd_t fd, int value); INI_EXTERN int INI_LINKAGE ini_writeLong (ini_fd_t fd, long value); INI_EXTERN int INI_LINKAGE ini_writeDouble (ini_fd_t fd, double value); INI_EXTERN int INI_LINKAGE ini_writeBool (ini_fd_t fd, int value); /* Extra Functions */ INI_EXTERN int INI_LINKAGE ini_append (ini_fd_t fddst, ini_fd_t fdsrc); #endif /* INI_ADD_EXTRAS */ #ifdef INI_ADD_LIST_SUPPORT /* Rev 1.1 Added - List Operations (Used for read operations only) * Be warned, once delimiters are set, every key that is read will be checked for the * presence of sub strings. This will incure a speed hit and therefore once a line * has been read and list/array functionality is not required, set delimiters * back to NULL. */ /* Returns the number of elements in an list being seperated by the provided delimiters */ INI_EXTERN int INI_LINKAGE ini_listLength (ini_fd_t fd); /* Change delimiters, default "" */ INI_EXTERN int INI_LINKAGE ini_listDelims (ini_fd_t fd, const char *delims); /* Set index to access in a list. When read the index will automatically increment */ INI_EXTERN int INI_LINKAGE ini_listIndex (ini_fd_t fd, unsigned long index); #endif /* INI_ADD_LIST_SUPPORT */ #ifdef SWIG %{ #include #include #define INI_STATIC static typedef struct { char *buffer; size_t size; } ini_buffer_t; %} %inline %{ /************************************************************* * SWIG helper functions to create C compatible string buffers *************************************************************/ INI_STATIC ini_buffer_t *ini_createBuffer (unsigned int size) { ini_buffer_t *b; /* Allocate memory to structure */ if (size == ( ((unsigned) -1 << 1) >> 1 )) return 0; /* Size is too big */ b = malloc (sizeof (ini_buffer_t)); if (!b) return 0; /* Allocate memory to buffer */ b->buffer = malloc (sizeof (char) * (size + 1)); if (!b->buffer) { free (b); return 0; } b->size = size; b->buffer[0] = '\0'; /* Returns address to tcl */ return b; } INI_STATIC void ini_deleteBuffer (ini_buffer_t *buffer) { if (!buffer) return; free (buffer->buffer); free (buffer); } INI_STATIC int ini_readFileToBuffer (ini_fd_t fd, ini_buffer_t *buffer) { if (!buffer) return -1; return ini_readString (fd, buffer->buffer, buffer->size + 1); } INI_STATIC char *ini_getBuffer (ini_buffer_t *buffer) { if (!buffer) return ""; return buffer->buffer; } INI_STATIC int ini_setBuffer (ini_buffer_t *buffer, const char *str) { size_t len; if (!buffer) return -1; len = strlen (str); if (len > buffer->size) len = buffer->size; memcpy (buffer->buffer, str, len); buffer->buffer[len] = '\0'; return len; } %} #endif /* SWIG */ #ifdef __cplusplus } #endif #endif /* _libini_h_ */ sidplayfp-1.1.0.1/src/ini/README0000644000076400007640000000166112215661707013035 00000000000000This INI file reader has been designed to handle large configuration files on Windows and non Windows platforms. All standard Mircosoft functionality is provided. Additional support includes: Non standard comments e.g. '#' and comments appearing at the end of a key. Anonymous sections e.g.: ; This key has no section header key1 = data [section1] key1 = data ; comment Auto parsing of data lists: key1 = data, data2, data3 Features: Comments at the end of keeps will not be recognised unless there is atleast one character of whitespace preceeding the start of the comment. All comments in the same INI file must be of the same type, and you are required to define the type of comment you expect. Additional data types. Bugs: Due to the caching feature, only usable data is read from the INI file. Should you make a change to this data, only the usable data is written back to the file. This means all comments will be lost! sidplayfp-1.1.0.1/src/ini/list.h0000644000076400007640000000261512215661707013301 00000000000000/*************************************************************************** list.h - Adds list support to ini files ------------------- begin : Fri Apr 21 2000 copyright : (C) 2000 by Simon White email : s_a_white@email.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef _list_h_ #define _list_h_ #include "ini.h" #ifdef INI_ADD_LIST_SUPPORT struct ini_t; static int __ini_listEval (struct ini_t *ini); static const char *__ini_listRead (struct ini_t *ini); static int __ini_listIndexLength (struct ini_t *ini); static int __ini_listDelims (struct ini_t *ini, const char *delims); #endif // INI_ADD_LIST_SUPPORT #endif // _list_h_ sidplayfp-1.1.0.1/src/ini/ini.cpp0000644000076400007640000012277412215661707013451 00000000000000/*************************************************************************** ini.cpp - Reads and writes keys to a ini file. ------------------- begin : Fri Apr 21 2000 copyright : (C) 2000 by Simon White email : s_a_white@email.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ /*************************************************************************** * $Log: ini.cpp,v $ * Revision 1.35 2004/11/26 23:18:22 s_a_white * Add Karel Vanroye patch (whitespace). * * Revision 1.34 2004/11/17 23:07:10 s_a_white * Prevent modification of read only files * * Revision 1.33 2004/11/05 17:52:03 s_a_white * malloc is in stdlib.h (malloc.h does not exist on ansi c compilers). * * Revision 1.32 2004/10/08 18:00:14 s_a_white * Fixed crc generation when used with new case flag. * * Revision 1.31 2004/10/07 23:20:49 s_a_white * Allow support for additional flags to indicate case sensitivity and if backup * files should be kept. * * Revision 1.30 2004/06/12 09:25:11 s_a_white * Protect ini_close/flush calls from 0 file descriptors. * * Revision 1.29 2004/02/06 08:02:42 s_a_white * Strcpy is unsafe when src and dst locations overlap, use memmove instead. * * Revision 1.28 2003/10/04 13:46:06 s_a_white * Fix reported memory leak that list delims were not freed. * * Revision 1.27 2003/06/17 19:44:21 s_a_white * Prevent comment being extracted as part of the keys data. * * Revision 1.26 2003/04/26 08:45:36 s_a_white * parser.first can be 0 for anonymous sections (should be checking against * -1 anyway). * * Revision 1.25 2003/02/04 22:54:02 s_a_white * Treat NULL comment string as no comment (same as 0 length comment string). * * Revision 1.24 2002/09/24 19:04:22 s_a_white * Fixed unchecked pointers in ini_append and __ini_store. * * Revision 1.23 2002/09/10 08:07:30 s_a_white * Cleanup after new file creation check to prevent use of a closed file. * * Revision 1.22 2002/06/15 22:51:36 s_a_white * Re-added INI_ALLOW_COMMENT to allow comments without first having * seen a space. * * Revision 1.21 2002/06/14 13:22:03 s_a_white * Bug fix to prevent sometimes accessing a NULL pointer. * * Revision 1.20 2002/06/11 16:23:29 s_a_white * __ini_process nolonger returns with section/key selected * undefined. * * Revision 1.19 2002/06/11 14:11:19 s_a_white * Prevent key=key2=data being processed as two comments. * Made comments only legal before or after a key. * * Revision 1.18 2002/06/10 16:59:08 s_a_white * Improved handling of keynames with [] and * section headings with = characters. * * Revision 1.17 2002/06/06 16:32:51 s_a_white * Multi character comments now supported. * * Revision 1.16 2002/02/18 19:56:35 s_a_white * Faster CRC alogarithm for hash key generation. * * Revision 1.15 2002/01/15 21:08:43 s_a_white * crc fix. * * Revision 1.14 2001/11/15 21:19:34 s_a_white * Appended __ini_ to global variables and INI_ to #defines. * * Revision 1.13 2001/11/15 21:13:13 s_a_white * Appended __ini_ to strtrim and createCrc32. * * Revision 1.12 2001/09/30 15:15:30 s_a_white * Fixed backup file removal. * * Revision 1.11 2001/09/22 08:56:06 s_a_white * Added mode support. This is used to determine how the INI file should be * accessed. * * Revision 1.10 2001/08/23 19:59:18 s_a_white * ini_append fix so not freeing wrong buffer. * * Revision 1.9 2001/08/17 19:23:16 s_a_white * Added ini_append. * * Revision 1.8 2001/08/14 22:21:21 s_a_white * Hash table and list removal fixes. * * Revision 1.7 2001/07/27 11:10:15 s_a_white * Simplified __ini_deleteAll. * * Revision 1.6 2001/07/21 09:47:12 s_a_white * Bug Fixes (thanks Andy): * *) After a flush the key and heading are now remembered. * *) ini_deleteAll then ini_close now correctly deletes the ini file. * *) ini_flush with no changes no longer destroys the ini object. * ***************************************************************************/ //******************************************************************************************************************* // Include Files //******************************************************************************************************************* #include #include #include #include #include #include "config.h" #include "ini.h" #define INI_BUFFER_SIZE (1024 * 5) enum { INI_NEW_LINE = 1, INI_SKIP_LINE = 2, INI_IN_SECTION = 3, INI_END_OF_FILE = 4, INI_CHECK_COMMENT = 5, INI_ALLOW_COMMENT = 8 }; typedef struct { long pos; long first; long last; struct key_tag *key; int state; const char *comment; int commentpos; } ini_parser_t; //******************************************************************************************************************* // Function Prototypes //******************************************************************************************************************* static ini_t *__ini_open (const char *name, ini_mode_t mode, const char *comment, int flags); static int __ini_close (ini_t *ini, bool flush); static void __ini_delete (ini_t *ini); static bool __ini_extractField (ini_t *ini, FILE *file, ini_parser_t &parser, char ch); static int __ini_process (ini_t *ini, FILE *file, const char *comment); inline bool __ini_processComment (ini_t *ini, FILE *file, ini_parser_t &parser); static int __ini_store (ini_t *ini, FILE *file); #ifdef INI_USE_HASH_TABLE static const unsigned long __ini_crc32Table[0x100] = { 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D }; /******************************************************************************************************************** * Function : __ini_createCrc32 * Parameters : str - string, strcase - case sensitive * : length - length in bytes of data * Returns : * Globals Used : * Globals Modified : * Description : Creates a 32 bit CRC based on the input data ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ unsigned long __ini_createCrc32 (const char *str, bool strcase) { unsigned long crc = 0xffffffff; size_t length = strlen (str); for (size_t i = 0; i < length; i++) { unsigned long d = strcase ? *str++ : tolower (*str++); crc = (crc >> 8) ^ __ini_crc32Table[(crc & 0xFF) ^ d]; } return (crc ^ 0xffffffff); } #endif // INI_USE_HASH_TABLE /******************************************************************************************************************** * Function : __ini_strtrim * Parameters : str - string to be trimmed * Returns : * Globals Used : * Globals Modified : * Description : Removes all char deemed to be spaces from start and end of string. ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ void __ini_strtrim (char *str) { long first, last, len; first = 0; last = strlen (str); if (!last--) return; // Clip end first while (isspace (str[last]) && last > 0) last--; // Clip beginning while (isspace (str[first]) && (first < last)) first++; len = last + 1 - first; memmove (str, str + first, len); str[len] = '\0'; } /******************************************************************************************************************** * Function : __ini_open * Parameters : name - ini file to parse, mode - access permission, * : comment - file comment character(s), flags - various operational flags (backup/case/etc) * Returns : Pointer to ini database. * Globals Used : * Globals Modified : * Description : Opens an ini data file and reads it's contents into a database ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ ini_t *__ini_open (const char *name, ini_mode_t mode, const char *comment, int flags) { ini_t *ini; FILE *file = NULL; unsigned long length; if (!name) return 0; length = strlen(name); if (!length) return 0; // Create ini database stub ini = (ini_t *) malloc (sizeof (ini_t)); if (!ini) goto ini_openError; memset (ini, 0, sizeof (ini_t)); // Store ini filename ini->filename = strdup (name); if (!ini->filename) goto ini_openError; // Open input file ini->mode = mode; ini->flags = flags; file = fopen (ini->filename, "rb"); if (!file) { // File doesn't exist so check if allowed // to create new one if (mode != INI_NEW) goto ini_openError; // Seems we can make a new one, check and // make sure file = fopen (ini->filename, "wb"); if (!file) goto ini_openError; ini->flags |= INI_NEWFILE; fclose (file); file = NULL; } // Open backup file if (ini->mode == INI_READ) ini->ftmp = tmpfile (); else { ini->filename[length - 1] = '~'; ini->ftmp = fopen (ini->filename, "wb+"); ini->filename[length - 1] = name[length - 1]; } if (!ini->ftmp) goto ini_openError; if (file) { // Process existing ini file if (__ini_process (ini, file, comment) < 0) goto ini_openError; fclose (file); } return ini; ini_openError: if (ini) { if (ini->ftmp) { // Close and remove backup file fclose (ini->ftmp); if (ini->mode != INI_READ) { ini->filename[strlen (ini->filename) - 1] = '~'; remove (ini->filename); } } if (ini->filename) free (ini->filename); free (ini); } if (file) fclose (file); return 0; } /******************************************************************************************************************** * Function : __ini_close * Parameters : ini - pointer to ini file database. force - if true, the database will be removed from * : memory even if an error occured in saving the new ini file. * Returns : -1 on error, 0 on success * Globals Used : * Globals Modified : * Description : Save any changes back to the new ini file. * : The backup file contains all the orignal data + any modifcations appended at the bottom ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int __ini_close (ini_t *ini, bool flush) { FILE *file; int ret = 0; // Open output file if (ini->flags & INI_MODIFIED) { if (!ini->first) remove(ini->filename); else { #ifdef INI_ADD_LIST_SUPPORT char *delims; // Rev 1.1 Added - Must remove delims before saving delims = ini->listDelims; ini->listDelims = NULL; #endif // INI_ADD_LIST_SUPPORT // Not point writing an unchanged file file = fopen (ini->filename, "w"); if (file) { // Output all new headers and keys ret = __ini_store (ini, file); fflush (file); fclose (file); } #ifdef INI_ADD_LIST_SUPPORT // Rev 1.1 Added - This was only a flush, so lets restore // the old delims ini->listDelims = delims; #endif // INI_ADD_LIST_SUPPORT if (!file) return -1; } } // Check if the user dosent want the file closed. if (!flush) return ret; // Cleanup fclose (ini->ftmp); if (ini->mode != INI_READ) { // If no mods were made, delete tmp file if ((ini->flags & (INI_MODIFIED | INI_NEWFILE | INI_BACKUP)) ^ (INI_MODIFIED | INI_BACKUP)) { ini->filename[strlen (ini->filename) - 1] = '~'; remove (ini->filename); } } __ini_delete (ini); free (ini->filename); if (ini->tmpSection.heading) free (ini->tmpSection.heading); if (ini->tmpKey.key) free (ini->tmpKey.key); #ifdef INI_ADD_LIST_SUPPORT // Rev 1.1 - Remove buffered list __ini_listDelims (ini, NULL); #endif // INI_ADD_LIST_SUPPORT free (ini); return ret; } /******************************************************************************************************************** * Function : __ini_delete * Parameters : ini - pointer to ini file database. * Returns : * Globals Used : * Globals Modified : * Description : Deletes the whole ini database from memory, but leaves the ini stub so the ini_close can be * : called. ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ void __ini_delete (ini_t *ini) { // If already deleted, don't delete it again if (!ini->first) return; // Go through all sections deleting them while (ini->first) { ini->selected = ini->first; __ini_deleteHeading (ini); } #ifdef INI_ADD_LIST_SUPPORT // Rev 1.1 - Remove buffered list if (ini->list) { free (ini->list); ini->list = NULL; } #endif // INI_ADD_LIST_SUPPORT if (ini->mode != INI_READ) ini->flags |= INI_MODIFIED; } /******************************************************************************************************************** * Function : __ini_extractField * Parameters : ini - pointer to ini file database, file - ini file to read heading from * : parser - current parser decoding state, ch - character to process * Returns : false on error and true on success * Globals Used : * Globals Modified : * Description : Process next character and extract fields as necessary ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ bool __ini_extractField (ini_t *ini, FILE *file, ini_parser_t &parser, char ch) { switch (ch) { // Check for key value case '=': if (parser.state != INI_IN_SECTION) { // Make sure the key has a string content parser.last = parser.pos; if (parser.first >= 0) { if (!ini->selected) // Handle keys which are not in a section { if (!__ini_faddHeading (ini, file, 0, 0)) return false; } parser.key = __ini_faddKey (ini, file, parser.first, parser.last - parser.first); if (!parser.key) return false; } parser.state = INI_CHECK_COMMENT | INI_ALLOW_COMMENT; } break; // Check for header (must start far left) case '[': if (parser.state == INI_NEW_LINE) { parser.first = parser.pos + 1; parser.state = INI_IN_SECTION; } break; // Check for header termination case ']': if (parser.state == INI_IN_SECTION) { parser.last = parser.pos; if (parser.first <= parser.last) // Handle [] { if (!__ini_faddHeading (ini, file, parser.first, parser.last - parser.first)) { return false; } } parser.state = INI_SKIP_LINE; } break; default: if (parser.state == INI_NEW_LINE) { parser.first = parser.pos; parser.state = INI_NONE; } break; } return true; } /******************************************************************************************************************** * Function : __ini_processComment * Parameters : ini - pointer to ini file database, file - ini file to read heading from * : parser - current parser decoding state * Returns : false on error and true on success * Globals Used : * Globals Modified : * Description : Comment strings are not passed to ini_extractField. Since multi char comments are now * : supported we need re-process it should it eventually turn out not to be a comment. ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ bool __ini_processComment (ini_t *ini, FILE *file, ini_parser_t &parser) { const char *p = parser.comment; for (; parser.commentpos > 0; parser.commentpos--) { if (!__ini_extractField (ini, file, parser, *p++)) return false; parser.pos++; } return true; } /******************************************************************************************************************** * Function : __ini_process * Parameters : ini - pointer to ini file database, file - ini file to read heading from * Returns : -1 on error and 0 on success * Globals Used : * Globals Modified : * Description : Read the ini file to determine all valid sections and keys. Also stores the location of * : the keys data for faster accessing. ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int __ini_process (ini_t *ini, FILE *file, const char *comment) { char *current, ch; size_t count; char *buffer; ini_parser_t parser; int pos = 0; if (!ini) return -1; if (!file) return -1; // Get a read buffer buffer = (char *) malloc (INI_BUFFER_SIZE * sizeof(char)); if (buffer == NULL) return -1; // Clear out an existing ini structure __ini_delete (ini); pos = 0; parser.pos = pos; parser.first = -1; parser.last = -1; parser.state = INI_NEW_LINE | INI_ALLOW_COMMENT; parser.key = NULL; parser.comment = comment; parser.commentpos = 0; do { fseek (file, pos, SEEK_SET); current = buffer; count = fread (buffer, sizeof(char), INI_BUFFER_SIZE, file); if (count <= 0) { if (feof (file)) { count = 1; *buffer = '\x1A'; } } while (count--) { ch = *current++; switch (ch) { // Check for end of file case '\x1A': parser.state = INI_END_OF_FILE; count = 0; goto __ini_processLineEnd; // Check for newline case '\n': case '\r': case '\f': parser.state = INI_NEW_LINE | INI_ALLOW_COMMENT; parser.first = -1; parser.last = -1; __ini_processLineEnd: if (!__ini_processComment (ini, file, parser)) goto __ini_processError; parser.pos = pos; __ini_processDataEnd: // Now know keys data length if (parser.key) { parser.key->length = (size_t) (parser.pos - parser.key->pos); parser.key = NULL; } break; case '\0': // If we get this we are processing a binary or corrupt file. // Drop out here, else we may do something nasty goto __ini_processError; default: switch (parser.state & ~INI_ALLOW_COMMENT) { case INI_SKIP_LINE: break; //case INI_NONE: //case INI_IN_SECTION: case INI_NEW_LINE: case INI_CHECK_COMMENT: // Check to see if comments are allowed if (isspace (ch)) { parser.commentpos = 0; parser.state |= INI_ALLOW_COMMENT; parser.pos = pos; break; } // Deliberate run on default: // Check for a comment if (parser.state & INI_ALLOW_COMMENT) { if (ch == parser.comment[parser.commentpos]) { parser.commentpos++; if (parser.comment[parser.commentpos] == '\0') { parser.commentpos = 0; parser.state = INI_SKIP_LINE; goto __ini_processDataEnd; } break; } parser.state &= ~INI_ALLOW_COMMENT; if (!__ini_processComment (ini, file, parser)) goto __ini_processError; } if (parser.state != INI_CHECK_COMMENT) { parser.pos = pos; if (!__ini_extractField (ini, file, parser, ch)) goto __ini_processError; } } break; } // Rev 1.1 Added - Exit if EOF if (parser.state == INI_END_OF_FILE) break; fputc (ch, ini->ftmp); pos++; if (!pos) { printf ("INI file is too large\n"); __ini_delete (ini); return -1; } } } while (parser.state != INI_END_OF_FILE); // Don't leave a random key located. This // also forces user to call ini_locate* ini->selected = NULL; free (buffer); return 0; __ini_processError: free (buffer); __ini_delete (ini); return -1; } /******************************************************************************************************************** * Function : __ini_store * Parameters : ini - pointer to ini file database, file - ini file to read heading from * Returns : -1 on error and 0 on success * Globals Used : * Globals Modified : * Description : Writes a new ini file containing all the necessary changes ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int __ini_store (ini_t *ini, FILE *file) { struct section_tag *current_h, *selected_h; struct key_tag *current_k, *selected_k = NULL; char *str = NULL; size_t length = 0, equal_pos = 0; int ret = -1; if (!ini) return -1; if (!file) return -1; // Backup selected heading and key selected_h = ini->selected; // Be carefull if nothing was previously selected if (selected_h != NULL) selected_k = selected_h->selected; current_h = ini->first; while (current_h) { // Output section heading if (*current_h->heading) { if (fprintf (file, "[%s]\n", current_h->heading) < 0) goto __ini_storeError; } // Output the sections keys equal_pos = __ini_averageLengthKey (current_h); current_k = current_h->first; while (current_k) { if (((current_k->length + 1) > length) || !str) { // Need more space if (str) free (str); length = current_k->length + 1; str = (char *) malloc (sizeof(char) * length); if (!str) goto __ini_storeError; } { // Output key char format[10]; // Rev 1.1 Added - to support lining up of equals characters sprintf (format, "%%-%lus=", (unsigned long) equal_pos); if (fprintf (file, format, current_k->key) < 0) goto __ini_storeError; } // Output keys data (point to correct keys data) ini->selected = current_h; current_h->selected = current_k; if (ini_readString ((ini_fd_t) ini, str, length) < 0) goto __ini_storeError; if (fprintf (file, "%s\n", str) < 0) goto __ini_storeError; current_k = current_k->pNext; } current_h = current_h->pNext; if (fprintf (file, "\n") < 0) goto __ini_storeError; } ret = 0; __ini_storeError: if (str) free (str); // Restore selected heading and key ini->selected = selected_h; if (selected_h != NULL) selected_h->selected = selected_k; return ret; } //******************************************************************************************************************** //******************************************************************************************************************** // User INI File Manipulation Functions //******************************************************************************************************************** //******************************************************************************************************************** /******************************************************************************************************************** * Function : ini_open * Parameters : name - ini file to create * Returns : Pointer to ini database. * Globals Used : * Globals Modified : * Description : Opens an ini data file and reads it's contents into a database ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ ini_fd_t INI_LINKAGE ini_open (const char *name, const char *mode, const char *comment) { ini_mode_t _mode; int flags = INI_NONE; if (!mode) return NULL; // Convert mode switch (*mode) { case 'r': _mode = INI_READ; break; case 'w': _mode = INI_NEW; break; case 'a': _mode = INI_EXIST; break; default: return NULL; } // Check for optional flags (any order but only once) while (*++mode != '\0') { int f = INI_NONE; switch (*mode) { case 'b': f = INI_BACKUP; break; case 'i': f = INI_CASE; break; default: return NULL; } if (flags & f) return NULL; flags |= f; } // NULL can also be used to disable comments if (comment == NULL) comment = ""; return (ini_fd_t) __ini_open (name, _mode, comment, flags); } /******************************************************************************************************************** * Function : ini_close * Parameters : ini - pointer to ini file database. * Returns : -1 on error, 0 on success * Globals Used : * Globals Modified : * Description : Call close, but make sure ini object IS deleted ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int INI_LINKAGE ini_close (ini_fd_t fd) { if (fd) return __ini_close ((ini_t *) fd, true); return -1; } /******************************************************************************************************************** * Function : ini_flush * Parameters : ini - pointer to ini file database. * Returns : -1 on error, 0 on success * Globals Used : * Globals Modified : * Description : Call close, but make sure ini object IS NOT deleted ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int INI_LINKAGE ini_flush (ini_fd_t fd) { if (fd) return __ini_close ((ini_t *) fd, false); return -1; } /******************************************************************************************************************** * Function : ini_dataLength * Parameters : ini - pointer to ini file database. heading - heading name. key - key name * Returns : Number of bytes to read the keys data in as a string. 1 must be added to this length * : to cater for a NULL character. * Globals Used : * Globals Modified : * Description : Number of bytes to read the keys data in as a string ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int INI_LINKAGE ini_dataLength (ini_fd_t fd) { ini_t *ini = (ini_t *) fd; struct key_tag *_key; if (!ini) return -1; // Check to make sure a section/key has // been asked for by the user if (!ini->selected) return -1; _key = ini->selected->selected; if (!_key) return -1; #ifdef INI_ADD_LIST_SUPPORT if (ini->listDelims) return __ini_listIndexLength (ini); #endif return (int) _key->length; } /******************************************************************************************************************** * Function : ini_delete * Parameters : ini - pointer to ini file database. * Returns : * Globals Used : * Globals Modified : * Description : Deletes the whole ini database from memory, but leaves the ini stub so the ini_close can be * : called. ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ extern "C" int INI_LINKAGE ini_delete (ini_fd_t fd) { ini_t *ini = (ini_t *) fd; if (!ini) return -1; // Is file read only? if (ini->mode == INI_READ) return -1; __ini_delete (ini); return 0; } #ifdef INI_ADD_EXTRAS /******************************************************************************************************************** * Function : ini_append * Parameters : fdsrc - pointer to src ini file database to copy from. * : fddst - pointer to dst ini file database to copy to. * Returns : * Globals Used : * Globals Modified : * Description : Copies the contents of the src ini to the dst ini. The resulting ini contains both * : headings and keys from each. Src keys will overwrite dst keys or similar names. ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ extern "C" int INI_LINKAGE ini_append (ini_fd_t fddst, ini_fd_t fdsrc) { struct section_tag *current_h; struct key_tag *current_k; struct section_tag *src_h, *dst_h; struct key_tag *src_k = NULL, *dst_k = NULL; char *data = NULL; int length = 0, ret = -1; #ifdef INI_ADD_LIST_SUPPORT char *delims; #endif ini_t *src = (ini_t *) fdsrc; ini_t *dst = (ini_t *) fddst; if (!(src && dst)) return -1; // Is file read only? if (dst->mode == INI_READ) return -1; // Backup selected heading and key src_h = src->selected; dst_h = dst->selected; // Be carefull if nothing was previously selected if (src_h != NULL) src_k = src_h->selected; if (dst_k != NULL) dst_k = dst_h->selected; #ifdef INI_ADD_LIST_SUPPORT // Remove delims for proper reads delims = src->listDelims; src->listDelims = NULL; #endif // Go through the src ini headings current_h = src->first; while (current_h) { // Locate heading in the dst ini_locateHeading (dst, current_h->heading); // Go through the src keys under the heading src->selected = current_h; current_k = current_h->first; while (current_k) { // Check if data buffer can hold the key int i = current_k->length; current_h->selected = current_k; if (i > length) { // Make data buffer bigger, with some spare length = i + 10; if (data != NULL) free (data); data = (char *) malloc (sizeof (char) * length); if (data == NULL) goto ini_appendError; } // Locate key in dst ini file ini_locateKey (dst, current_k->key); // Copy the key from src to dst ini file if (ini_readString (src, data, length) != i) goto ini_appendError; if (ini_writeString (dst, data) < 0) goto ini_appendError; // Move to next key current_k = current_k->pNext; } // Move to next heading current_h = current_h->pNext; } ret = 0; ini_appendError: if (data != NULL) free (data); #ifdef INI_ADD_LIST_SUPPORT // Restore delims src->listDelims = delims; #endif // Restore selected headings and keys src->selected = src_h; dst->selected = dst_h; if (src_h != NULL) src_h->selected = src_k; if (dst_h != NULL) dst_h->selected = dst_k; return ret; } #endif // INI_ADD_EXTRAS // Add Code Modules // Add Header Manipulation Functions #include "headings.i" // Add Key Manipulation Functions #include "keys.i" // Add Supported Datatypes #include "types.i" // Add List Support #ifdef INI_ADD_LIST_SUPPORT # include "list.i" #endif // INI_ADD_LIST_SUPPORT sidplayfp-1.1.0.1/src/ini/keys.h0000644000076400007640000000425212215661707013300 00000000000000/*************************************************************************** keys.h - Key Manipulation Functions ------------------- begin : Fri Apr 21 2000 copyright : (C) 2000 by Simon White email : s_a_white@email.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef _keys_h_ #define _keys_h_ #include #include "ini.h" //******************************************************************************************************************* // Data structure definitions //******************************************************************************************************************* struct ini_t; struct section_tag; // Linked list structure for holding key information. struct key_tag { char *key; long pos; size_t length; struct key_tag *pNext; struct key_tag *pPrev; #ifdef INI_USE_HASH_TABLE unsigned long crc; struct key_tag *pNext_Acc; struct key_tag *pPrev_Acc; #endif // INI_USE_HASH_TABLE }; static struct key_tag *__ini_addKey (struct ini_t *ini, char *key); static struct key_tag *__ini_faddKey (struct ini_t *ini, FILE *file, long pos, size_t length); static struct key_tag *__ini_createKey (struct ini_t *ini, char *key); static void __ini_deleteKey (struct ini_t *ini); static struct key_tag *__ini_locateKey (struct ini_t *ini, const char *key); static size_t __ini_averageLengthKey (struct section_tag *current_h); #endif // _keys_h_ sidplayfp-1.1.0.1/src/ini/headings.h0000644000076400007640000000447412215661707014115 00000000000000/*************************************************************************** headings.h - Section Heading Manipulation Functions ------------------- begin : Fri Apr 21 2000 copyright : (C) 2000 by Simon White email : s_a_white@email.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef _headings_h_ #define _headings_h_ #include #include "ini.h" //******************************************************************************************************************* // Data structure definitions //******************************************************************************************************************* struct keys_tag; struct ini_t; // Linked list structure for holding section/heading information. struct section_tag { char *heading; struct key_tag *first; struct key_tag *last; struct key_tag *selected; struct section_tag *pNext; struct section_tag *pPrev; #ifdef INI_USE_HASH_TABLE unsigned long crc; struct key_tag *keys[256]; struct section_tag *pNext_Acc; struct section_tag *pPrev_Acc; #endif // INI_USE_HASH_TABLE }; static struct section_tag *__ini_addHeading (struct ini_t *ini, char *heading); static struct section_tag *__ini_faddHeading (struct ini_t *ini, FILE *file, long pos, size_t length); static struct section_tag *__ini_createHeading (struct ini_t *ini, char *heading); static void __ini_deleteHeading (struct ini_t *ini); static struct section_tag *__ini_locateHeading (struct ini_t *ini, const char *heading); #endif // _headings_h_ sidplayfp-1.1.0.1/src/ini/COPYING0000644000076400007640000004310012215661707013202 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. sidplayfp-1.1.0.1/src/ini/ini.h0000644000076400007640000000500112215661707013075 00000000000000/*************************************************************************** ini.h - Ini database definition ------------------- begin : Fri Apr 21 2000 copyright : (C) 2000 by Simon White email : s_a_white@email.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef _ini_h_ #define _ini_h_ #define INI_USE_HASH_TABLE #include "libini.h" #include "keys.h" #include "headings.h" #ifdef INI_ADD_LIST_SUPPORT # include "list.h" #endif typedef enum {INI_NEW, INI_EXIST, INI_READ} ini_mode_t; enum { INI_NONE = 0, INI_MODIFIED = 1 << 0, INI_NEWFILE = 1 << 1, INI_BACKUP = 1 << 2, // Create backup file INI_CASE = 1 << 3 // Case sensitive }; // Database containing all information about an ini file. typedef struct ini_t { char *filename; FILE *ftmp; // Temporary work file ini_mode_t mode; // Access mode int flags; struct section_tag *first; struct section_tag *last; struct section_tag *selected; char *heading; // Last written section in tmp file. struct section_tag tmpSection; struct key_tag tmpKey; #ifdef INI_USE_HASH_TABLE struct section_tag *sections[256]; #endif #ifdef INI_ADD_LIST_SUPPORT // Rev 1.1 Added - New for list accessing char *list; // Accelerator for accessing same list (When all list read, will be freed) char *listDelims; // list sperators char *listIndexPtr; // current element we wish to access (will auto increment) unsigned int listLength; unsigned int listIndex; #endif // INI_ADD_LIST_SUPPORT } ini_t; static void __ini_strtrim (char *str); #ifdef INI_USE_HASH_TABLE static unsigned long __ini_createCrc32 (const char *str, bool strcase); #endif #endif // _ini_h_ sidplayfp-1.1.0.1/src/ini/keys.i0000644000076400007640000003627112215661707013307 00000000000000/*************************************************************************** keys.i - Key Manipulation Functions ------------------- begin : Fri Apr 21 2000 copyright : (C) 2000 by Simon White email : s_a_white@email.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include #include #include #include "keys.h" #define INI_EQUALS_ALIGN 10 #if defined(HAVE_STRINGS_H) # include #endif #ifndef HAVE_STRCASECMP # define strcasecmp stricmp #endif /******************************************************************************************************************** * Function : __ini_addKey * Parameters : ini - pointer to ini file database. key - key name * Returns : Pointer to key. * Globals Used : * Globals Modified : * Description : Adds a new key to the ini file database and updates the temporary workfile. * : A heading operation must be called before this function. ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ struct key_tag *__ini_addKey (ini_t *ini, char *key) { struct key_tag *_key; size_t length; long pos; // Format heading for storing __ini_strtrim (key); if (!*key) return NULL; // Add new key to work file and read it in // using file add fseek (ini->ftmp, 0, SEEK_END); pos = ftell (ini->ftmp); fputs (key, ini->ftmp); length = (size_t) (ftell (ini->ftmp) - pos); _key = __ini_faddKey (ini, ini->ftmp, pos, length); fseek (ini->ftmp, 0, SEEK_END); fputc ('=', ini->ftmp); if (_key) ini->flags |= INI_MODIFIED; return _key; } /******************************************************************************************************************** * Function : __ini_averageLengthKey * Parameters : current_h - pointer to current header. * Returns : Returns the average key length * Globals Used : * Globals Modified : * Description : Finds average key length for aligning equals. ********************************************************************************************************************/ size_t __ini_averageLengthKey (struct section_tag *current_h) { #ifdef INI_EQUALS_ALIGN size_t equal_pos, equal_max, keylength; size_t average = 0, count = 0; struct key_tag *current_k; // Rev 1.1 Added - Line up equals characters for keys // Calculate Average current_k = current_h->first; while (current_k) { count++; average += strlen (current_k->key); current_k = current_k->pNext; } if (!count) return 0; average /= count; equal_pos = (equal_max = average); #if INI_EQUALS_ALIGN > 0 // Work out the longest key in that range current_k = current_h->first; while (current_k) { keylength = strlen (current_k->key); equal_max = average + INI_EQUALS_ALIGN; if ((equal_max > keylength) && (keylength > equal_pos)) equal_pos = keylength; current_k = current_k->pNext; } #endif // INI_EQUALS_ALIGN > 0 return equal_pos; #else return 0; #endif // INI_EQUALS_ALIGN } /******************************************************************************************************************** * Function : __ini_faddKey * Parameters : ini - pointer to ini file database, file - ini file to read key from * : pos - key position in file, length - key length * Returns : Pointer to key. * Globals Used : * Globals Modified : * Description : Adds a new key to the ini file database from the input file. * : A heading operation must be called before this function. ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ struct key_tag *__ini_faddKey (ini_t *ini, FILE *file, long pos, size_t length) { struct key_tag *_key; char *str; length++; str = (char *) malloc (sizeof(char) * length); assert (str); fseek (file, pos, SEEK_SET); fgets (str, (int) length, file); __ini_strtrim (str); _key = __ini_createKey (ini, str); if (!_key) { free (str); return NULL; } _key->pos = pos + (long) length; return _key; } /******************************************************************************************************************** * Function : __ini_createKey * Parameters : ini - pointer to ini file database. key - key name * Returns : Pointer to key. * Globals Used : * Globals Modified : * Description : Adds an entry into the key linked list ready for formating by the addKey commands * : A heading operation must be called before this function. ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ struct key_tag *__ini_createKey (ini_t *ini, char *key) { struct section_tag *section; struct key_tag *pNew; long pos; if (!*key) return NULL; section = ini->selected; pNew = __ini_locateKey (ini, key); if (pNew) { // Reset details of existing key free (pNew->key); pNew->key = key; pos = 0; } else { // Create a new key and add at end; pNew = (struct key_tag *) malloc (sizeof (struct key_tag)); if (!pNew) return NULL; memset (pNew, 0, sizeof (struct key_tag)); pNew->key = key; if (!section->first) section->first = pNew; else section->last->pNext = pNew; pNew->pPrev = section->last; section->last = pNew; section->selected = pNew; #ifdef INI_USE_HASH_TABLE { // Rev 1.3 - Added struct key_tag *pOld; unsigned long crc32; unsigned char accel; crc32 = __ini_createCrc32 (key, (ini->flags & INI_CASE) != 0); pNew->crc = crc32; // Rev 1.3 - Add accelerator list accel = (unsigned char) crc32 & 0x0FF; pNew->pPrev_Acc = NULL; pOld = section->keys[accel]; section->keys[accel] = pNew; if (pOld) pOld->pPrev_Acc = pNew; pNew->pNext_Acc = pOld; } #endif } section->selected = pNew; return pNew; } /******************************************************************************************************************** * Function : __ini_deleteKey * Parameters : ini - pointer to ini file database. key - key name * Returns : * Globals Used : * Globals Modified : * Description : Removes a key from the database only. * : This change does not occur in the file until ini_close is called. * : A heading operation must be called before this function. ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ void __ini_deleteKey (ini_t *ini) { struct key_tag *current_k; struct section_tag *section = ini->selected; current_k = section->selected; if (current_k) { // Tidy up all users of this key section->selected = NULL; if (section->last == current_k) section->last = current_k->pPrev; // Check to see if all keys were removed if (!current_k->pPrev) section->first = current_k->pNext; else current_k->pPrev->pNext = current_k->pNext; if (current_k->pNext) current_k->pNext->pPrev = current_k->pPrev; #ifdef INI_USE_HASH_TABLE // Rev 1.3 - Take member out of accelerator list if (!current_k->pPrev_Acc) section->keys[(unsigned char) current_k->crc & 0x0FF] = current_k->pNext_Acc; else current_k->pPrev_Acc->pNext_Acc = current_k->pNext_Acc; if (current_k->pNext_Acc) current_k->pNext_Acc->pPrev_Acc = current_k->pPrev_Acc; #endif // INI_USE_HASH_TABLE // Delete Key free (current_k->key); free (current_k); } } /******************************************************************************************************************** * Function : __ini_locateKey * Parameters : ini - pointer to ini file database. key - key name * Returns : Pointer to key. * Globals Used : * Globals Modified : * Description : Locates a key entry in the database. * : A heading operation must be called before this function. ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ struct key_tag *__ini_locateKey (ini_t *ini, const char *key) { struct key_tag *current_k; struct section_tag *section; section = ini->selected; #ifdef INI_USE_HASH_TABLE { // Rev 1.3 - Added unsigned long crc32; crc32 = __ini_createCrc32 (key, (ini->flags & INI_CASE) != 0); // Search for key for (current_k = section->keys[(unsigned char) crc32 & 0x0FF]; current_k; current_k = current_k->pNext_Acc) { if (current_k->crc == crc32) { if (ini->flags & INI_CASE) { if (!strcmp (current_k->key, key)) break; } else if (!strcasecmp (current_k->key, key)) break; } } } #else { // Search for key for (current_k = section->first; current_k; current_k = current_k->pNext) { if (ini->flags & INI_CASE) { if (!strcmp (current_k->key, key)) break; } else if (!strcasecmp (current_k->key, key)) break; } } #endif // INI_USE_HASH_TABLE section->selected = current_k; return current_k; } /******************************************************************************************************************** * Function : (public) ini_deleteKey * Parameters : ini - pointer to ini file database. heading - heading name. key - key name. * Returns : -1 for Error and 0 on success * Globals Used : * Globals Modified : * Description : Equivalent Microsoft write string API call where data set to NULL ********************************************************************************************************************/ int INI_LINKAGE ini_deleteKey (ini_fd_t fd) { ini_t *ini = (ini_t *) fd; if (!ini->selected || !ini->selected->selected) return -1; // Can't delete a temporary key if (ini->selected->selected == &(ini->tmpKey)) return -1; // Is file read only? if (ini->mode == INI_READ) return -1; __ini_deleteKey (ini); ini->flags |= INI_MODIFIED; return 0; } /******************************************************************************************************************** * Function : (public) ini_locateKey * Parameters : fd - pointer to ini file descriptor * Returns : -1 for Error and 0 on success * Globals Used : * Globals Modified : * Description : ********************************************************************************************************************/ int INI_LINKAGE ini_locateKey (ini_fd_t fd, const char *key) { ini_t *ini = (ini_t *) fd; struct key_tag *_key = NULL; if (!key) return -1; if (!ini->selected) return -1; // Can't search for a key in a temporary heading if (ini->selected != &(ini->tmpSection)) _key = __ini_locateKey (ini, key); #ifdef INI_ADD_LIST_SUPPORT // Rev 1.1 - Remove buffered list if (ini->list) { free (ini->list); ini->list = NULL; } #endif // INI_ADD_LIST_SUPPORT if (_key) return 0; // Ok no key was found, but maybe the user is wanting to create a // new one so create it temporarily and see what actually happens later { // Remove all key _key = &(ini->tmpKey); if (_key->key) free (_key->key); // Add new key _key->key = strdup (key); if (!_key) return -1; ini->selected->selected = _key; } return -1; } /******************************************************************************************************************** * Function : (public) ini_currentKey * Parameters : fd - pointer to ini file descriptor * Returns : NULL for Error and on success pointer to key * Globals Used : * Globals Modified : * Description : ********************************************************************************************************************/ const char * INI_LINKAGE ini_currentKey (ini_fd_t fd) { ini_t *ini = (ini_t *) fd; struct section_tag *section; struct key_tag *key; if (!ini) return NULL; section = ini->selected; if (!section) return NULL; key = section->selected; if (!key) return NULL; return key->key; } sidplayfp-1.1.0.1/src/ini/headings.i0000644000076400007640000003406012215661707014110 00000000000000/*************************************************************************** headings.i - Section Heading Manipulation Functions ------------------- begin : Fri Apr 21 2000 copyright : (C) 2000 by Simon White email : s_a_white@email.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include #include #include #include "headings.h" #if defined(HAVE_STRINGS_H) # include #endif #ifndef HAVE_STRCASECMP # define strcasecmp stricmp #endif /******************************************************************************************************************** * Function : __ini_addHeading * Parameters : ini - pointer to ini file database. heading - heading name * Returns : Pointer to new heading. * Globals Used : * Globals Modified : * Description : Adds a new heading to the ini file database and updates the temporary workfile ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ struct section_tag *__ini_addHeading (ini_t *ini, char *heading) { struct section_tag *section; size_t length; long pos; // Format heading for storing __ini_strtrim (heading); /* Create a backup of the file we are about to edit */ if (ini->heading == heading) return __ini_locateHeading (ini, heading); // Add new heading to work file and read it in // using file add fseek (ini->ftmp, 0, SEEK_END); fputs ("\n[", ini->ftmp); pos = ftell (ini->ftmp); fputs (heading, ini->ftmp); length = (size_t) (ftell (ini->ftmp) - pos); section = __ini_faddHeading (ini, ini->ftmp, pos, length); fseek (ini->ftmp, 0, SEEK_END); fputs ("]\n", ini->ftmp); ini->heading = section->heading; if (section) ini->flags |= INI_MODIFIED; return section; } /******************************************************************************************************************** * Function : __ini_faddheading * Parameters : ini - pointer to ini file database, file - ini file to read heading from * : pos - heading position in file, length - heading length * Returns : Pointer to new heading. * Globals Used : * Globals Modified : * Description : Adds a new heading to the ini file database from the input file. ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ struct section_tag *__ini_faddHeading (ini_t *ini, FILE *file, long pos, size_t length) { struct section_tag *section; char *str; if (length) { length++; str = (char *) malloc (sizeof(char) * length); assert (str); fseek (file, pos, SEEK_SET); fgets (str, (int) length, file); __ini_strtrim (str); } else { str = (char *) malloc (sizeof(char)); assert (str); *str = '\0'; } section = __ini_createHeading (ini, str); // Make sure heading was created if (!section) { free (str); return NULL; } return section; } /******************************************************************************************************************** * Function : __ini_createHeading * Parameters : ini - pointer to ini file database. heading - heading name * Returns : Pointer to new heading. * Globals Used : * Globals Modified : * Description : Adds an entry into the heading linked list ready for formating by the addHeading commands ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ struct section_tag *__ini_createHeading (ini_t *ini, char *heading) { struct section_tag *pNew; pNew = __ini_locateHeading (ini, heading); // Check to see if heading already exists if (pNew) free (heading); else { // Create a new heading as dosen't exist pNew = (struct section_tag *) malloc (sizeof (struct section_tag)); if (!pNew) return NULL; memset (pNew, 0, sizeof (struct section_tag)); pNew->heading = heading; if (*heading) { // Found a named heading pNew->pPrev = ini->last; ini->last = pNew; if (pNew->pPrev) pNew->pPrev->pNext = pNew; else ini->first = pNew; } else { // Anonymous heading (special case), // always comes first pNew->pNext = ini->first; ini->first = pNew; if (pNew->pNext) pNew->pNext->pPrev = pNew; else ini->last = pNew; } #ifdef INI_USE_HASH_TABLE { // Rev 1.3 - Added struct section_tag *pOld; unsigned long crc32; unsigned char accel; crc32 = __ini_createCrc32 (heading, (ini->flags & INI_CASE) != 0); pNew->crc = crc32; // Rev 1.3 - Add accelerator list accel = (unsigned char) crc32 & 0x0FF; pNew->pPrev_Acc = NULL; pOld = ini->sections[accel]; ini->sections[accel] = pNew; if (pOld) pOld->pPrev_Acc = pNew; pNew->pNext_Acc = pOld; } #endif // INI_USE_HASH_TABLE } ini->selected = pNew; return pNew; } /******************************************************************************************************************** * Function : __ini_deleteHeading * Parameters : ini - pointer to ini file database. heading - heading name * Returns : * Globals Used : * Globals Modified : * Description : Removes a heading from the database only. * : This change does not occur in the file until ini_close is called. ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ void __ini_deleteHeading (ini_t *ini) { struct section_tag *current_h; // Delete Heading current_h = ini->selected; if (current_h) { // Delete Keys while (current_h->first) { current_h->selected = current_h->first; __ini_deleteKey (ini); } // Tidy up all users of this heading ini->selected = NULL; if (ini->last == current_h) ini->last = current_h->pPrev; // Break heading out of list if (!current_h->pPrev) ini->first = current_h->pNext; else current_h->pPrev->pNext = current_h->pNext; if (current_h->pNext) current_h->pNext->pPrev = current_h->pPrev; #ifdef INI_USE_HASH_TABLE // Rev 1.3 - Take member out of accelerator list if (!current_h->pPrev_Acc) ini->sections[(unsigned char) current_h->crc & 0x0FF] = current_h->pNext_Acc; else current_h->pPrev_Acc->pNext_Acc = current_h->pNext_Acc; if (current_h->pNext_Acc) current_h->pNext_Acc->pPrev_Acc = current_h->pPrev_Acc; #endif // INI_USE_HASH_TABLE // Delete Heading free (current_h->heading); free (current_h); } } /******************************************************************************************************************** * Function : __ini_locateHeading * Parameters : ini - pointer to ini file database. heading - heading name * Returns : Pointer to heading. * Globals Used : * Globals Modified : * Description : Locates a heading entry in the database. ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ struct section_tag *__ini_locateHeading (ini_t *ini, const char *heading) { struct section_tag *current_h; #ifdef INI_USE_HASH_TABLE // Rev 1.3 - Revised to use new accelerator unsigned long crc32; crc32 = __ini_createCrc32 (heading, (ini->flags & INI_CASE) != 0); // Search for heading for (current_h = ini->sections[(unsigned char) crc32 & 0x0FF]; current_h; current_h = current_h->pNext_Acc) { if (current_h->crc == crc32) { if (ini->flags & INI_CASE) { if (!strcmp (current_h->heading, heading)) break; } else if (!strcasecmp (current_h->heading, heading)) break; } } #else // Search for heading for (current_h = ini->first; current_h; current_h = current_h->pNext) { if (ini->flags & INI_CASE) { if (!strcmp (current_h->heading, heading)) break; } else if (!strcasecmp (current_h->heading, heading)) break; } #endif // INI_USE_HASH_TABLE ini->selected = current_h; return current_h; } /******************************************************************************************************************** * Function : (public) ini_deleteHeading * Parameters : ini - pointer to ini file descriptor * Returns : -1 for Error and 0 on success * Globals Used : * Globals Modified : * Description : Equivalent Microsoft write string API call where both data & key are set to NULL. ********************************************************************************************************************/ int INI_LINKAGE ini_deleteHeading (ini_fd_t fd) { ini_t *ini = (ini_t *) fd; if (!ini->selected) return -1; // Is file read only? if (ini->mode == INI_READ) return -1; // Can't delete a temporary section if (ini->selected == &(ini->tmpSection)) return -1; __ini_deleteHeading (ini); ini->flags |= INI_MODIFIED; return 0; } /******************************************************************************************************************** * Function : (public) ini_locateHeading * Parameters : fd - pointer to ini file descriptor * Returns : -1 for Error and 0 on success * Globals Used : * Globals Modified : * Description : Equivalent Microsoft write string API call where both data & key are set to NULL. ********************************************************************************************************************/ int INI_LINKAGE ini_locateHeading (ini_fd_t fd, const char *heading) { ini_t *ini = (ini_t *) fd; struct section_tag *section; if (!heading) return -1; section = __ini_locateHeading (ini, heading); #ifdef INI_ADD_LIST_SUPPORT // Rev 1.1 - Remove buffered list if (ini->list) { free (ini->list); ini->list = NULL; } #endif // INI_ADD_LIST_SUPPORT if (section) { section->selected = NULL; return 0; } // Ok no section was found, but maybe the user is wanting to create a // new one so create it temporarily and see what actually happens later { // Remove old heading section = &(ini->tmpSection); if (section->heading) free (section->heading); // Add new heading section->heading = strdup (heading); if (!section->heading) return -1; section->selected = NULL; ini->selected = section; } return -1; } /******************************************************************************************************************** * Function : (public) ini_currentHeading * Parameters : fd - pointer to ini file descriptor * Returns : NULL for Error and on success pointer to heading * Globals Used : * Globals Modified : * Description : Returns currently selected heading ********************************************************************************************************************/ const char * INI_LINKAGE ini_currentHeading (ini_fd_t fd) { ini_t *ini = (ini_t *) fd; struct section_tag *section; if (!ini) return NULL; section = ini->selected; if (!section) return NULL; return section->heading; } sidplayfp-1.1.0.1/src/ini/types.i0000644000076400007640000004617312215661707013502 00000000000000/*************************************************************************** types.i - Libini supported data types Use readString for others ------------------- begin : Fri Apr 21 2000 copyright : (C) 2000 by Simon White email : s_a_white@email.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include #include #include #include #include "ini.h" /******************************************************************************************************************** * Function : __ini_read * Parameters : ini - pointer to ini file database, size - key length returned here * Returns : -1 for Error and 0 on success. * Globals Used : * Globals Modified : * Description : Common read functionality ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ static int __ini_read (ini_t *ini, size_t *size) { struct key_tag *_key; if (!ini->selected) return -1; // Locate and read keys value _key = ini->selected->selected; if (!_key) return -1; if (_key->length) { // Locate and read back keys data fseek (ini->ftmp, _key->pos, SEEK_SET); } else if (_key == &ini->tmpKey) return -1; // Can't read tmpKey *size = _key->length; return 0; } #ifdef INI_ADD_LIST_SUPPORT /******************************************************************************************************************** * Function : __ini_readList * Parameters : ini - pointer to ini file database. * Returns : Pointer to buffer holding data. * Globals Used : * Globals Modified : * Description : Common read functionality from a list ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ static const char *__ini_readList (ini_t *ini) { if (!ini->selected) return NULL; // Locate and read keys value if (!ini->selected->selected) return NULL; return __ini_listRead (ini); } #endif // INI_ADD_LIST_SUPPORT /******************************************************************************************************************** * Function : __ini_write * Parameters : ini - pointer to ini file database. heading - heading name. key - key name. * Returns : Pointer to new key. * Globals Used : * Globals Modified : * Description : Make calls to add a new key and appends a description of changes in the backup file ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ static struct key_tag *__ini_write (ini_t *ini) { struct section_tag *section; struct key_tag *key; // Is file read only? if (ini->mode == INI_READ) return NULL; // Check to make sure a section/key has // been asked for by the user section = ini->selected; if (!section) return NULL; key = section->selected; if (!key) return NULL; // Add or replace key if (!__ini_addHeading (ini, section->heading)) return NULL; return __ini_addKey (ini, key->key); } /******************************************************************************************************************** * Function : ini_readString * Parameters : ini - pointer to ini file database. * : value - keys data * Returns : -1 for error or the number of chars read. * Globals Used : * Globals Modified : * Description : Reads data part from a key and returns it as a string ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int INI_LINKAGE ini_readString (ini_fd_t fd, char *str, size_t size) { ini_t *ini = (ini_t *) fd; // Check size and reserve space for NULL if (size-- <= 0) return -1; #ifdef INI_ADD_LIST_SUPPORT if (ini->listDelims) { const char *data = __ini_readList (ini); if (!data) return -1; strncpy (str, data, size); } else #endif // INI_ADD_LIST_SUPPORT { // Locate and read back keys data (Index ignored) // Check to make sure size is correct size_t length; if (__ini_read (ini, &length) < 0) return -1; if (size > length) size = length; size = fread (str, sizeof(char), size, ini->ftmp); } str[size] = '\0'; __ini_strtrim (str); return (int) size; } /******************************************************************************************************************** * Function : ini_writeString * Parameters : ini - pointer to ini file database. * : value - keys data * Returns : -1 for Error and 0 on success * Globals Used : * Globals Modified : * Description : Writes data part to a key. * : Conforms to Microsoft API call. E.g. use NULLS to remove headings/keys * : Headings and keys will be created as necessary ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int INI_LINKAGE ini_writeString (ini_fd_t fd, const char *str) { ini_t *ini = (ini_t *) fd; struct key_tag *_key; _key = __ini_write (ini); if (!_key) return -1; // Write data to bottom of backup file _key->length = strlen (str); fprintf (ini->ftmp, "%s\n", str); return 0; } /******************************************************************************************************************** * Function : ini_readInt * Parameters : ini - pointer to ini file database. * : value - keys data * Returns : -1 for error or the number of values read. * Globals Used : * Globals Modified : * Description : Reads data part from a key and returns it as a int ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int INI_LINKAGE ini_readInt (ini_fd_t fd, int *value) { ini_t *ini = (ini_t *) fd; int ret = 0; #ifdef INI_ADD_LIST_SUPPORT if (ini->listDelims) { const char *data = __ini_readList (ini); if (data) sscanf (data, "%d", value); } else #endif // INI_ADD_LIST_SUPPORT { size_t length; if (__ini_read (ini, &length) >= 0) { if (length > 0) ret = fscanf (ini->ftmp, "%d", value); } } if (ret == 1) return 0; return -1; } #ifdef INI_ADD_EXTRAS /******************************************************************************************************************** * Function : ini_readLong * Parameters : ini - pointer to ini file database. * : value - keys data * Returns : -1 for error or the number of values read. * Globals Used : * Globals Modified : * Description : Reads data part from a key and returns it as a long ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int INI_LINKAGE ini_readLong (ini_fd_t fd, long *value) { ini_t *ini = (ini_t *) fd; int ret = 0; #ifdef INI_ADD_LIST_SUPPORT if (ini->listDelims) { const char *data = __ini_readList (ini); if (data) ret = sscanf (data, "%ld", value); } else #endif // INI_ADD_LIST_SUPPORT { size_t length; if (__ini_read (ini, &length) >= 0) { if (length > 0) ret = fscanf (ini->ftmp, "%ld", value); } } if (ret == 1) return 0; return -1; } /******************************************************************************************************************** * Function : ini_readDouble * Parameters : ini - pointer to ini file database. * : value - keys data * Returns : -1 for error or the number of values read. * Globals Used : * Globals Modified : * Description : Reads data part from a key and returns it as a double (real) ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int INI_LINKAGE ini_readDouble (ini_fd_t fd, double *value) { ini_t *ini = (ini_t *) fd; int ret = 0; #ifdef INI_ADD_LIST_SUPPORT if (ini->listDelims) { const char *data = __ini_readList (ini); if (data) ret = sscanf (data, "%lf", value); } else #endif // INI_ADD_LIST_SUPPORT { size_t length; if (__ini_read (ini, &length) >= 0) { if (length > 0) ret = fscanf (ini->ftmp, "%lf", value); } } if (ret == 1) return 0; return -1; } /******************************************************************************************************************** * Function : ini_readBool * Parameters : ini - pointer to ini file database. * : value - keys data * Returns : -1 for error or the number of values read. * Globals Used : * Globals Modified : * Description : Reads data part from a key and returns it as a int. Supported bool strings are 0, 1, true * : false. ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int INI_LINKAGE ini_readBool (ini_fd_t fd, int *value) { ini_t *ini = (ini_t *) fd; char buffer[6] = ""; #ifdef INI_ADD_LIST_SUPPORT if (ini->listDelims) { const char *data = __ini_readList (ini); if (!data) return -1; sscanf (data, "%5s", buffer); } else #endif // INI_ADD_LIST_SUPPORT { size_t length; if (__ini_read (ini, &length) < 0) return -1; if (length > 0) fscanf (ini->ftmp, "%5s", buffer); } { // Convert string to lower case char *p = buffer; while (*p != '\0') { *p = (char) tolower (*p); p++; } } // Decode supported bool types switch (*buffer) { case '0': case '1': if (buffer[1] != '\0') return -1; *value = *buffer - '0'; break; default: if (!strcasecmp (buffer, "true")) *value = 1; else if (!strcasecmp (buffer, "false")) *value = 0; else if (!strcasecmp (buffer, "on")) *value = 1; else if (!strcasecmp (buffer, "off")) *value = 0; else if (!strcasecmp (buffer, "yes")) *value = 1; else if (!strcasecmp (buffer, "no")) *value = 0; else // No match return -1; break; } return 0; } /******************************************************************************************************************** * Function : ini_writeInt * Parameters : ini - pointer to ini file database. * : value - keys data * Returns : -1 for Error and 0 on success * Globals Used : * Globals Modified : * Description : Writes data part to a key. * : Headings and keys will be created as necessary ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int INI_LINKAGE ini_writeInt (ini_fd_t fd, int value) { ini_t *ini = (ini_t *) fd; struct key_tag *_key; long pos; _key = __ini_write (ini); if (!_key) return -1; // Write data to bottom of backup file fprintf (ini->ftmp, "%d", value); pos = ftell (ini->ftmp); _key->length = (size_t) (pos - _key->pos); fprintf (ini->ftmp, "\n"); return 0; } /******************************************************************************************************************** * Function : ini_writeLong * Parameters : ini - pointer to ini file database. * : value - keys data * Returns : -1 for Error and 0 on success * Globals Used : * Globals Modified : * Description : Writes data part to a key. * : Headings and keys will be created as necessary ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int INI_LINKAGE ini_writeLong (ini_fd_t fd, long value) { ini_t *ini = (ini_t *) fd; struct key_tag *_key; long pos; _key = __ini_write (ini); if (!_key) return -1; // Write data to bottom of backup file fprintf (ini->ftmp, "%ld", value); pos = ftell (ini->ftmp); _key->length = (size_t) (pos - _key->pos); fprintf (ini->ftmp, "\n"); return 0; } /******************************************************************************************************************** * Function : ini_writeDouble * Parameters : ini - pointer to ini file database. * : value - keys data * Returns : -1 for Error and 0 on success * Globals Used : * Globals Modified : * Description : Writes data part to a key. * : Headings and keys will be created as necessary ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int INI_LINKAGE ini_writeDouble (ini_fd_t fd, double value) { ini_t *ini = (ini_t *) fd; struct key_tag *_key; long pos; _key = __ini_write (ini); if (!_key) return -1; // Write data to bottom of backup file fprintf (ini->ftmp, "%f", value); pos = ftell (ini->ftmp); _key->length = (size_t) (pos - _key->pos); fprintf (ini->ftmp, "\n"); return 0; } /******************************************************************************************************************** * Function : ini_writeBool * Parameters : ini - pointer to ini file database. * : value - keys data * Returns : -1 for Error and 0 on success * Globals Used : * Globals Modified : * Description : Writes data part to a key. * : Headings and keys will be created as necessary ******************************************************************************************************************** * Rev | Date | By | Comment * ---------------------------------------------------------------------------------------------------------------- ********************************************************************************************************************/ int INI_LINKAGE ini_writeBool (ini_fd_t fd, int value) { ini_t *ini = (ini_t *) fd; struct key_tag *_key; long pos; // Check if value is legal if ((value < 0) || (value > 1)) return -1; _key = __ini_write (ini); if (!_key) return -1; // Write data to bottom of backup file if (value) fprintf (ini->ftmp, "true"); else fprintf (ini->ftmp, "false"); pos = ftell (ini->ftmp); _key->length = (size_t) (pos - _key->pos); fprintf (ini->ftmp, "\n"); return 0; } #endif // INI_ADD_EXTRAS sidplayfp-1.1.0.1/src/audio/0000755000076400007640000000000012223740347012550 500000000000000sidplayfp-1.1.0.1/src/audio/AudioDrv.h0000644000076400007640000000265212215661707014366 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.1.0.1/src/audio/null/0000755000076400007640000000000012223740347013522 500000000000000sidplayfp-1.1.0.1/src/audio/null/null.h0000644000076400007640000000273612215661707014600 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.1.0.1/src/audio/null/Makefile.am0000644000076400007640000000014412215661707015500 00000000000000AM_CPPFLAGS = -I $(top_builddir) noinst_LIBRARIES = libnull.a libnull_a_SOURCES = null.cpp null.h sidplayfp-1.1.0.1/src/audio/null/null.cpp0000644000076400007640000000256112215661707015127 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.1.0.1/src/audio/null/Makefile.in0000644000076400007640000004035712223740332015512 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/audio/null DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/build-aux/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libnull_a_AR = $(AR) $(ARFLAGS) libnull_a_LIBADD = am_libnull_a_OBJECTS = null.$(OBJEXT) libnull_a_OBJECTS = $(am_libnull_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libnull_a_SOURCES) DIST_SOURCES = $(libnull_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUDIO_DRV = @AUDIO_DRV@ AUDIO_LDFLAGS = @AUDIO_LDFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PULSE_CFLAGS = @PULSE_CFLAGS@ PULSE_LIBS = @PULSE_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIDPLAYFP_CFLAGS = @SIDPLAYFP_CFLAGS@ SIDPLAYFP_LIBS = @SIDPLAYFP_LIBS@ STILVIEW_CFLAGS = @STILVIEW_CFLAGS@ STILVIEW_LIBS = @STILVIEW_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I $(top_builddir) noinst_LIBRARIES = libnull.a libnull_a_SOURCES = null.cpp null.h all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/audio/null/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/audio/null/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libnull.a: $(libnull_a_OBJECTS) $(libnull_a_DEPENDENCIES) $(EXTRA_libnull_a_DEPENDENCIES) $(AM_V_at)-rm -f libnull.a $(AM_V_AR)$(libnull_a_AR) libnull.a $(libnull_a_OBJECTS) $(libnull_a_LIBADD) $(AM_V_at)$(RANLIB) libnull.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/null.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: sidplayfp-1.1.0.1/src/audio/pulse/0000755000076400007640000000000012223740347013700 500000000000000sidplayfp-1.1.0.1/src/audio/pulse/audiodrv.h0000644000076400007640000000273712215661707015622 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.1.0.1/src/audio/pulse/Makefile.am0000644000076400007640000000015612215661707015661 00000000000000AM_CPPFLAGS = -I $(top_builddir) noinst_LIBRARIES = libpulse.a libpulse_a_SOURCES = audiodrv.cpp audiodrv.h sidplayfp-1.1.0.1/src/audio/pulse/audiodrv.cpp0000644000076400007640000000552012222342377016143 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.1.0.1/src/audio/pulse/Makefile.in0000644000076400007640000004042512223740332015664 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/audio/pulse DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/build-aux/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libpulse_a_AR = $(AR) $(ARFLAGS) libpulse_a_LIBADD = am_libpulse_a_OBJECTS = audiodrv.$(OBJEXT) libpulse_a_OBJECTS = $(am_libpulse_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libpulse_a_SOURCES) DIST_SOURCES = $(libpulse_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUDIO_DRV = @AUDIO_DRV@ AUDIO_LDFLAGS = @AUDIO_LDFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PULSE_CFLAGS = @PULSE_CFLAGS@ PULSE_LIBS = @PULSE_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIDPLAYFP_CFLAGS = @SIDPLAYFP_CFLAGS@ SIDPLAYFP_LIBS = @SIDPLAYFP_LIBS@ STILVIEW_CFLAGS = @STILVIEW_CFLAGS@ STILVIEW_LIBS = @STILVIEW_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I $(top_builddir) noinst_LIBRARIES = libpulse.a libpulse_a_SOURCES = audiodrv.cpp audiodrv.h all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/audio/pulse/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/audio/pulse/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libpulse.a: $(libpulse_a_OBJECTS) $(libpulse_a_DEPENDENCIES) $(EXTRA_libpulse_a_DEPENDENCIES) $(AM_V_at)-rm -f libpulse.a $(AM_V_AR)$(libpulse_a_AR) libpulse.a $(libpulse_a_OBJECTS) $(libpulse_a_LIBADD) $(AM_V_at)$(RANLIB) libpulse.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiodrv.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: sidplayfp-1.1.0.1/src/audio/Makefile.am0000644000076400007640000000032212215661707014524 00000000000000AM_CPPFLAGS = -I $(top_builddir) noinst_LIBRARIES = libaudio.a libaudio_a_SOURCES = AudioDrv.cpp AudioDrv.h SUBDIRS = alsa directx mmsystem null oss pulse wav EXTRA_DIST = IAudio.h AudioBase.h AudioConfig.h sidplayfp-1.1.0.1/src/audio/IAudio.h0000644000076400007640000000241212215661707014015 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.1.0.1/src/audio/alsa/0000755000076400007640000000000012223740347013470 500000000000000sidplayfp-1.1.0.1/src/audio/alsa/audiodrv.h0000644000076400007640000000305312215661707015402 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.1.0.1/src/audio/alsa/Makefile.am0000644000076400007640000000015412215661707015447 00000000000000AM_CPPFLAGS = -I $(top_builddir) noinst_LIBRARIES = libalsa.a libalsa_a_SOURCES = audiodrv.cpp audiodrv.h sidplayfp-1.1.0.1/src/audio/alsa/audiodrv.cpp0000644000076400007640000000776212215661707015750 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.1.0.1/src/audio/alsa/Makefile.in0000644000076400007640000004037712223740332015462 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/audio/alsa DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/build-aux/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libalsa_a_AR = $(AR) $(ARFLAGS) libalsa_a_LIBADD = am_libalsa_a_OBJECTS = audiodrv.$(OBJEXT) libalsa_a_OBJECTS = $(am_libalsa_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libalsa_a_SOURCES) DIST_SOURCES = $(libalsa_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUDIO_DRV = @AUDIO_DRV@ AUDIO_LDFLAGS = @AUDIO_LDFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PULSE_CFLAGS = @PULSE_CFLAGS@ PULSE_LIBS = @PULSE_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIDPLAYFP_CFLAGS = @SIDPLAYFP_CFLAGS@ SIDPLAYFP_LIBS = @SIDPLAYFP_LIBS@ STILVIEW_CFLAGS = @STILVIEW_CFLAGS@ STILVIEW_LIBS = @STILVIEW_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I $(top_builddir) noinst_LIBRARIES = libalsa.a libalsa_a_SOURCES = audiodrv.cpp audiodrv.h all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/audio/alsa/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/audio/alsa/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libalsa.a: $(libalsa_a_OBJECTS) $(libalsa_a_DEPENDENCIES) $(EXTRA_libalsa_a_DEPENDENCIES) $(AM_V_at)-rm -f libalsa.a $(AM_V_AR)$(libalsa_a_AR) libalsa.a $(libalsa_a_OBJECTS) $(libalsa_a_LIBADD) $(AM_V_at)$(RANLIB) libalsa.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiodrv.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: sidplayfp-1.1.0.1/src/audio/AudioDrv.cpp0000644000076400007640000000360512215661710014712 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.1.0.1/src/audio/wav/0000755000076400007640000000000012223740347013345 500000000000000sidplayfp-1.1.0.1/src/audio/wav/WavFile.cpp0000644000076400007640000001242112215661707015331 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.1.0.1/src/audio/wav/Makefile.am0000644000076400007640000000017412215661707015326 00000000000000AM_CPPFLAGS = -I $(top_builddir) $(SIDPLAYFP_CFLAGS) noinst_LIBRARIES = libwav.a libwav_a_SOURCES = WavFile.cpp WavFile.h sidplayfp-1.1.0.1/src/audio/wav/WavFile.h0000644000076400007640000000603212215661707014777 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.1.0.1/src/audio/wav/Makefile.in0000644000076400007640000004037112223740332015331 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/audio/wav DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/build-aux/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libwav_a_AR = $(AR) $(ARFLAGS) libwav_a_LIBADD = am_libwav_a_OBJECTS = WavFile.$(OBJEXT) libwav_a_OBJECTS = $(am_libwav_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libwav_a_SOURCES) DIST_SOURCES = $(libwav_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUDIO_DRV = @AUDIO_DRV@ AUDIO_LDFLAGS = @AUDIO_LDFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PULSE_CFLAGS = @PULSE_CFLAGS@ PULSE_LIBS = @PULSE_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIDPLAYFP_CFLAGS = @SIDPLAYFP_CFLAGS@ SIDPLAYFP_LIBS = @SIDPLAYFP_LIBS@ STILVIEW_CFLAGS = @STILVIEW_CFLAGS@ STILVIEW_LIBS = @STILVIEW_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I $(top_builddir) $(SIDPLAYFP_CFLAGS) noinst_LIBRARIES = libwav.a libwav_a_SOURCES = WavFile.cpp WavFile.h all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/audio/wav/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/audio/wav/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libwav.a: $(libwav_a_OBJECTS) $(libwav_a_DEPENDENCIES) $(EXTRA_libwav_a_DEPENDENCIES) $(AM_V_at)-rm -f libwav.a $(AM_V_AR)$(libwav_a_AR) libwav.a $(libwav_a_OBJECTS) $(libwav_a_LIBADD) $(AM_V_at)$(RANLIB) libwav.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WavFile.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: sidplayfp-1.1.0.1/src/audio/directx/0000755000076400007640000000000012223740347014212 500000000000000sidplayfp-1.1.0.1/src/audio/directx/audiodrv.h0000644000076400007640000000413412215661707016125 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.1.0.1/src/audio/directx/Makefile.am0000644000076400007640000000016212215661707016170 00000000000000AM_CPPFLAGS = -I $(top_builddir) noinst_LIBRARIES = libdirectx.a libdirectx_a_SOURCES = audiodrv.cpp audiodrv.h sidplayfp-1.1.0.1/src/audio/directx/audiodrv.cpp0000644000076400007640000002121112215661707016453 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.1.0.1/src/audio/directx/Makefile.in0000644000076400007640000004050112223740332016171 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/audio/directx DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/build-aux/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libdirectx_a_AR = $(AR) $(ARFLAGS) libdirectx_a_LIBADD = am_libdirectx_a_OBJECTS = audiodrv.$(OBJEXT) libdirectx_a_OBJECTS = $(am_libdirectx_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libdirectx_a_SOURCES) DIST_SOURCES = $(libdirectx_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUDIO_DRV = @AUDIO_DRV@ AUDIO_LDFLAGS = @AUDIO_LDFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PULSE_CFLAGS = @PULSE_CFLAGS@ PULSE_LIBS = @PULSE_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIDPLAYFP_CFLAGS = @SIDPLAYFP_CFLAGS@ SIDPLAYFP_LIBS = @SIDPLAYFP_LIBS@ STILVIEW_CFLAGS = @STILVIEW_CFLAGS@ STILVIEW_LIBS = @STILVIEW_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I $(top_builddir) noinst_LIBRARIES = libdirectx.a libdirectx_a_SOURCES = audiodrv.cpp audiodrv.h all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/audio/directx/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/audio/directx/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libdirectx.a: $(libdirectx_a_OBJECTS) $(libdirectx_a_DEPENDENCIES) $(EXTRA_libdirectx_a_DEPENDENCIES) $(AM_V_at)-rm -f libdirectx.a $(AM_V_AR)$(libdirectx_a_AR) libdirectx.a $(libdirectx_a_OBJECTS) $(libdirectx_a_LIBADD) $(AM_V_at)$(RANLIB) libdirectx.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiodrv.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: sidplayfp-1.1.0.1/src/audio/oss/0000755000076400007640000000000012223740347013354 500000000000000sidplayfp-1.1.0.1/src/audio/oss/audiodrv.h0000644000076400007640000000377612215661707015302 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.1.0.1/src/audio/oss/Makefile.am0000644000076400007640000000015212215661707015331 00000000000000AM_CPPFLAGS = -I $(top_builddir) noinst_LIBRARIES = liboss.a liboss_a_SOURCES = audiodrv.cpp audiodrv.h sidplayfp-1.1.0.1/src/audio/oss/audiodrv.cpp0000644000076400007640000000735112215661707015626 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.1.0.1/src/audio/oss/Makefile.in0000644000076400007640000004035112223740332015336 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/audio/oss DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/build-aux/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = liboss_a_AR = $(AR) $(ARFLAGS) liboss_a_LIBADD = am_liboss_a_OBJECTS = audiodrv.$(OBJEXT) liboss_a_OBJECTS = $(am_liboss_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(liboss_a_SOURCES) DIST_SOURCES = $(liboss_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUDIO_DRV = @AUDIO_DRV@ AUDIO_LDFLAGS = @AUDIO_LDFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PULSE_CFLAGS = @PULSE_CFLAGS@ PULSE_LIBS = @PULSE_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIDPLAYFP_CFLAGS = @SIDPLAYFP_CFLAGS@ SIDPLAYFP_LIBS = @SIDPLAYFP_LIBS@ STILVIEW_CFLAGS = @STILVIEW_CFLAGS@ STILVIEW_LIBS = @STILVIEW_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I $(top_builddir) noinst_LIBRARIES = liboss.a liboss_a_SOURCES = audiodrv.cpp audiodrv.h all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/audio/oss/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/audio/oss/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) liboss.a: $(liboss_a_OBJECTS) $(liboss_a_DEPENDENCIES) $(EXTRA_liboss_a_DEPENDENCIES) $(AM_V_at)-rm -f liboss.a $(AM_V_AR)$(liboss_a_AR) liboss.a $(liboss_a_OBJECTS) $(liboss_a_LIBADD) $(AM_V_at)$(RANLIB) liboss.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiodrv.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: sidplayfp-1.1.0.1/src/audio/AudioBase.h0000644000076400007640000000355612215661707014511 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.1.0.1/src/audio/mmsystem/0000755000076400007640000000000012223740347014426 500000000000000sidplayfp-1.1.0.1/src/audio/mmsystem/audiodrv.h0000644000076400007640000000371012215661710016332 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.1.0.1/src/audio/mmsystem/Makefile.am0000644000076400007640000000016412215661710016400 00000000000000AM_CPPFLAGS = -I $(top_builddir) noinst_LIBRARIES = libmmsystem.a libmmsystem_a_SOURCES = audiodrv.cpp audiodrv.h sidplayfp-1.1.0.1/src/audio/mmsystem/audiodrv.cpp0000644000076400007640000002054712215661710016674 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.1.0.1/src/audio/mmsystem/Makefile.in0000644000076400007640000004052712223740332016415 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/audio/mmsystem DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/build-aux/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libmmsystem_a_AR = $(AR) $(ARFLAGS) libmmsystem_a_LIBADD = am_libmmsystem_a_OBJECTS = audiodrv.$(OBJEXT) libmmsystem_a_OBJECTS = $(am_libmmsystem_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libmmsystem_a_SOURCES) DIST_SOURCES = $(libmmsystem_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUDIO_DRV = @AUDIO_DRV@ AUDIO_LDFLAGS = @AUDIO_LDFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PULSE_CFLAGS = @PULSE_CFLAGS@ PULSE_LIBS = @PULSE_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIDPLAYFP_CFLAGS = @SIDPLAYFP_CFLAGS@ SIDPLAYFP_LIBS = @SIDPLAYFP_LIBS@ STILVIEW_CFLAGS = @STILVIEW_CFLAGS@ STILVIEW_LIBS = @STILVIEW_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I $(top_builddir) noinst_LIBRARIES = libmmsystem.a libmmsystem_a_SOURCES = audiodrv.cpp audiodrv.h all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/audio/mmsystem/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/audio/mmsystem/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmmsystem.a: $(libmmsystem_a_OBJECTS) $(libmmsystem_a_DEPENDENCIES) $(EXTRA_libmmsystem_a_DEPENDENCIES) $(AM_V_at)-rm -f libmmsystem.a $(AM_V_AR)$(libmmsystem_a_AR) libmmsystem.a $(libmmsystem_a_OBJECTS) $(libmmsystem_a_LIBADD) $(AM_V_at)$(RANLIB) libmmsystem.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiodrv.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: sidplayfp-1.1.0.1/src/audio/AudioConfig.h0000644000076400007640000000226112215661707015034 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.1.0.1/src/audio/Makefile.in0000644000076400007640000005112112223740332014527 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/audio DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/build-aux/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libaudio_a_AR = $(AR) $(ARFLAGS) libaudio_a_LIBADD = am_libaudio_a_OBJECTS = AudioDrv.$(OBJEXT) libaudio_a_OBJECTS = $(am_libaudio_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libaudio_a_SOURCES) DIST_SOURCES = $(libaudio_a_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUDIO_DRV = @AUDIO_DRV@ AUDIO_LDFLAGS = @AUDIO_LDFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PULSE_CFLAGS = @PULSE_CFLAGS@ PULSE_LIBS = @PULSE_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIDPLAYFP_CFLAGS = @SIDPLAYFP_CFLAGS@ SIDPLAYFP_LIBS = @SIDPLAYFP_LIBS@ STILVIEW_CFLAGS = @STILVIEW_CFLAGS@ STILVIEW_LIBS = @STILVIEW_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I $(top_builddir) noinst_LIBRARIES = libaudio.a libaudio_a_SOURCES = AudioDrv.cpp AudioDrv.h SUBDIRS = alsa directx mmsystem null oss pulse wav EXTRA_DIST = IAudio.h AudioBase.h AudioConfig.h all: all-recursive .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/audio/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/audio/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libaudio.a: $(libaudio_a_OBJECTS) $(libaudio_a_DEPENDENCIES) $(EXTRA_libaudio_a_DEPENDENCIES) $(AM_V_at)-rm -f libaudio.a $(AM_V_AR)$(libaudio_a_AR) libaudio.a $(libaudio_a_OBJECTS) $(libaudio_a_LIBADD) $(AM_V_at)$(RANLIB) libaudio.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AudioDrv.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LIBRARIES) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-noinstLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: sidplayfp-1.1.0.1/src/Makefile.am0000644000076400007640000000143712215661710013425 00000000000000 SUBDIRS = audio AM_CPPFLAGS = \ -I $(top_builddir) \ -DPKGDATADIR="\"$(pkgdatadir)/\"" \ $(SIDPLAYFP_CFLAGS) \ $(STILVIEW_CFLAGS) \ $(ALSA_CFLAGS) \ $(PULSE_CFLAGS) # The console user interface. bin_PROGRAMS = sidplayfp stilview sidplayfp_SOURCES = \ IniConfig.cpp \ IniConfig.h \ args.cpp \ keyboard.cpp \ keyboard.h \ main.cpp \ menu.cpp \ player.cpp \ player.h \ utils.cpp \ utils.h \ ini/libini.h \ ini/headings.h \ ini/headings.i \ ini/ini.cpp \ ini/ini.h \ ini/keys.h \ ini/keys.i \ ini/list.h \ ini/list.i \ ini/types.i sidplayfp_LDADD = \ ./audio/libaudio.a \ ./audio/null/libnull.a \ ./audio/wav/libwav.a \ $(AUDIO_DRV) \ $(AUDIO_LDFLAGS) \ $(SIDPLAYFP_LIBS) \ $(BUILDERS_LDFLAGS) \ $(ALSA_LIBS) \ $(PULSE_LIBS) stilview_SOURCES = \ stilview.cpp stilview_LDADD = \ $(STILVIEW_LIBS) sidplayfp-1.1.0.1/src/player.cpp0000644000076400007640000004772312215661710013401 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2011-2013 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 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 #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 ConsolePlayer::ConsolePlayer (const char * const name) : Event("External Timer\n"), m_name(name), m_tune(0), m_state(playerStopped), m_outfile(NULL), m_context(NULL), m_filename(""), m_quietLevel(0), m_verboseLevel(0), m_cpudebug(false) { // Other defaults m_filter.enabled = true; m_driver.device = NULL; 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; } createOutput (OUT_NULL, NULL); createSidEmu (EMU_NONE); uint8_t *kernalRom = loadRom((m_iniCfg.sidplay2()).kernalRom, 8192, "kernal"); uint8_t *basicRom = loadRom((m_iniCfg.sidplay2()).basicRom, 8192, "basic"); uint8_t *chargenRom = loadRom((m_iniCfg.sidplay2()).chargenRom, 4096, "chargen"); m_engine.setRoms(kernalRom, basicRom, chargenRom); delete [] kernalRom; delete [] basicRom; delete [] chargenRom; } uint8_t* ConsolePlayer::loadRom(const char* romPath, const int size, const char defaultRom[]) { std::string dataPath; try { dataPath = utils::getDataPath(); } catch (utils::error const &e) { return 0; } dataPath.append("/sidplayfp/").append(defaultRom); #if !defined _WIN32 && defined HAVE_UNISTD_H if (::access(dataPath.c_str(), R_OK) != 0) { dataPath = PKGDATADIR; dataPath.append(defaultRom); } #endif std::ifstream is((romPath)?romPath:dataPath.c_str(), std::ios::binary); if (is.fail()) goto error; { try { uint8_t *buffer = new uint8_t[size]; is.read((char*)buffer, size); if (is.fail()) goto error; is.close(); return buffer; } catch (std::bad_alloc const &ba) { goto error; } } error: is.close(); return 0; } 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, v1mute); m_engine.mute(0, 1, v2mute); m_engine.mute(0, 2, v3mute); m_engine.mute(1, 0, v4mute); m_engine.mute(1, 1, v5mute); m_engine.mute(1, 2, v6mute); // 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_context = m_engine.getEventContext(); 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(); event(); 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) { // 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; } 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::event (void) { const uint_least32_t seconds = m_engine.time(); 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; } if (seconds != m_timer.current) { 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; } } // Units in C64 clock cycles m_context->schedule (*this, 900000, EVENT_CLOCK_PHI1); } 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: v1mute = !v1mute; m_engine.mute(0, 0, v1mute); break; case A_TOGGLE_VOICE2: v2mute = !v2mute; m_engine.mute(0, 1, v2mute); break; case A_TOGGLE_VOICE3: v3mute = !v3mute; m_engine.mute(0, 2, v3mute); break; case A_TOGGLE_VOICE4: v4mute = !v4mute; m_engine.mute(1, 0, v4mute); break; case A_TOGGLE_VOICE5: v5mute = !v5mute; m_engine.mute(1, 1, v5mute); break; case A_TOGGLE_VOICE6: v6mute = !v6mute; m_engine.mute(1, 2, v6mute); 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.1.0.1/src/args.cpp0000644000076400007640000004042212215661710013026 00000000000000/* * This file is part of sidplayfp, a console SID player. * * Copyright 2011-2013 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 #ifdef HAVE_UNISTD_H # include #endif #include #include using std::cout; using std::cerr; using std::endl; #ifdef HAVE_SIDPLAYFP_BUILDERS_HARDSID_H # include #endif // 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; m_driver.sid = EMU_RESIDFP; v1mute = v2mute = v3mute = false; v4mute = v5mute = v6mute = 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; } 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]); switch (voice) { case 1: v1mute = true; break; case 2: v2mute = true; break; case 3: v3mute = true; break; case 4: v4mute = true; break; case 5: v5mute = true; break; case 6: v6mute = true; break; } } } 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], "-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 } // Load the tune m_filename = argv[infile]; m_tune.load (m_filename); if (!m_tune.getStatus()) { displayError (m_tune.statusString()); 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) { #if !defined _WIN32 && defined HAVE_UNISTD_H char buffer[PATH_MAX]; #endif const char *database = (m_iniCfg.sidplay2()).database; m_timer.length = (m_iniCfg.sidplay2()).playLength; if (m_driver.file) m_timer.length = (m_iniCfg.sidplay2()).recordLength; #if !defined _WIN32 && defined HAVE_UNISTD_H if (!database || *database == '\0') { snprintf(buffer, PATH_MAX, "%sSonglengths.txt", PKGDATADIR); if (::access(buffer, R_OK) == 0) database = buffer; } #endif if (database && (*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) < 0) { // 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 << " [-