fork of PCE focusing on macplus, supporting DaynaPort SCSI network emulation
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

sound: Add a sound driver framework

Hampa Hug 4bed876d 01fccae9

+1320 -233
+15
Makefile.dep
··· 1909 1909 src/config.h \ 1910 1910 src/drivers/options.h 1911 1911 1912 + src/drivers/sound/sound-null.o: src/drivers/sound/sound-null.c \ 1913 + src/drivers/sound/sound-null.h \ 1914 + src/drivers/sound/sound.h 1915 + 1916 + src/drivers/sound/sound-wav.o: src/drivers/sound/sound-wav.c \ 1917 + src/drivers/options.h \ 1918 + src/drivers/sound/sound-wav.h \ 1919 + src/drivers/sound/sound.h 1920 + 1921 + src/drivers/sound/sound.o: src/drivers/sound/sound.c \ 1922 + src/config.h \ 1923 + src/drivers/options.h \ 1924 + src/drivers/sound/sound-wav.h \ 1925 + src/drivers/sound/sound.h 1926 + 1912 1927 src/lib/brkpt.o: src/lib/brkpt.c \ 1913 1928 src/lib/brkpt.h \ 1914 1929 src/lib/cmd.h
+1
Makefile.inc.in
··· 127 127 include $(srcdir)/src/lib/Makefile.inc 128 128 include $(srcdir)/src/drivers/Makefile.inc 129 129 include $(srcdir)/src/drivers/char/Makefile.inc 130 + include $(srcdir)/src/drivers/sound/Makefile.inc 130 131 include $(srcdir)/src/terminal/Makefile.inc 131 132 include $(srcdir)/src/arch/Makefile.inc 132 133 include $(srcdir)/src/arch/ibmpc/Makefile.inc
+279 -223
configure
··· 1 1 #! /bin/sh 2 2 # Guess values for system-dependent variables and create Makefiles. 3 - # Generated by GNU Autoconf 2.64. 3 + # Generated by GNU Autoconf 2.67. 4 + # 4 5 # 5 6 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 6 - # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software 7 + # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software 7 8 # Foundation, Inc. 9 + # 8 10 # 9 11 # This configure script is free software; the Free Software Foundation 10 12 # gives unlimited permission to copy, distribute and modify it. ··· 314 316 test -d "$as_dir" && break 315 317 done 316 318 test -z "$as_dirs" || eval "mkdir $as_dirs" 317 - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" 319 + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" 318 320 319 321 320 322 } # as_fn_mkdir_p ··· 354 356 fi # as_fn_arith 355 357 356 358 357 - # as_fn_error ERROR [LINENO LOG_FD] 358 - # --------------------------------- 359 + # as_fn_error STATUS ERROR [LINENO LOG_FD] 360 + # ---------------------------------------- 359 361 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are 360 362 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the 361 - # script with status $?, using 1 if that was 0. 363 + # script with STATUS, using 1 if that was 0. 362 364 as_fn_error () 363 365 { 364 - as_status=$?; test $as_status -eq 0 && as_status=1 365 - if test "$3"; then 366 - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 367 - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 366 + as_status=$1; test $as_status -eq 0 && as_status=1 367 + if test "$4"; then 368 + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 369 + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 368 370 fi 369 - $as_echo "$as_me: error: $1" >&2 371 + $as_echo "$as_me: error: $2" >&2 370 372 as_fn_exit $as_status 371 373 } # as_fn_error 372 374 ··· 524 526 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" 525 527 526 528 527 - exec 7<&0 </dev/null 6>&1 529 + test -n "$DJDIR" || exec 7<&0 </dev/null 530 + exec 6>&1 528 531 529 532 # Name of the host. 530 - # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, 533 + # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, 531 534 # so uname gets run too. 532 535 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` 533 536 ··· 794 797 fi 795 798 796 799 case $ac_option in 797 - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; 798 - *) ac_optarg=yes ;; 800 + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; 801 + *=) ac_optarg= ;; 802 + *) ac_optarg=yes ;; 799 803 esac 800 804 801 805 # Accept the important Cygnus configure options, so we can diagnose typos. ··· 840 844 ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` 841 845 # Reject names that are not valid shell variable names. 842 846 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && 843 - as_fn_error "invalid feature name: $ac_useropt" 847 + as_fn_error $? "invalid feature name: $ac_useropt" 844 848 ac_useropt_orig=$ac_useropt 845 849 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` 846 850 case $ac_user_opts in ··· 866 870 ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` 867 871 # Reject names that are not valid shell variable names. 868 872 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && 869 - as_fn_error "invalid feature name: $ac_useropt" 873 + as_fn_error $? "invalid feature name: $ac_useropt" 870 874 ac_useropt_orig=$ac_useropt 871 875 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` 872 876 case $ac_user_opts in ··· 1070 1074 ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` 1071 1075 # Reject names that are not valid shell variable names. 1072 1076 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && 1073 - as_fn_error "invalid package name: $ac_useropt" 1077 + as_fn_error $? "invalid package name: $ac_useropt" 1074 1078 ac_useropt_orig=$ac_useropt 1075 1079 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` 1076 1080 case $ac_user_opts in ··· 1086 1090 ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` 1087 1091 # Reject names that are not valid shell variable names. 1088 1092 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && 1089 - as_fn_error "invalid package name: $ac_useropt" 1093 + as_fn_error $? "invalid package name: $ac_useropt" 1090 1094 ac_useropt_orig=$ac_useropt 1091 1095 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` 1092 1096 case $ac_user_opts in ··· 1116 1120 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) 1117 1121 x_libraries=$ac_optarg ;; 1118 1122 1119 - -*) as_fn_error "unrecognized option: \`$ac_option' 1120 - Try \`$0 --help' for more information." 1123 + -*) as_fn_error $? "unrecognized option: \`$ac_option' 1124 + Try \`$0 --help' for more information" 1121 1125 ;; 1122 1126 1123 1127 *=*) ··· 1125 1129 # Reject names that are not valid shell variable names. 1126 1130 case $ac_envvar in #( 1127 1131 '' | [0-9]* | *[!_$as_cr_alnum]* ) 1128 - as_fn_error "invalid variable name: \`$ac_envvar'" ;; 1132 + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; 1129 1133 esac 1130 1134 eval $ac_envvar=\$ac_optarg 1131 1135 export $ac_envvar ;; ··· 1143 1147 1144 1148 if test -n "$ac_prev"; then 1145 1149 ac_option=--`echo $ac_prev | sed 's/_/-/g'` 1146 - as_fn_error "missing argument to $ac_option" 1150 + as_fn_error $? "missing argument to $ac_option" 1147 1151 fi 1148 1152 1149 1153 if test -n "$ac_unrecognized_opts"; then 1150 1154 case $enable_option_checking in 1151 1155 no) ;; 1152 - fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; 1156 + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; 1153 1157 *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; 1154 1158 esac 1155 1159 fi ··· 1172 1176 [\\/$]* | ?:[\\/]* ) continue;; 1173 1177 NONE | '' ) case $ac_var in *prefix ) continue;; esac;; 1174 1178 esac 1175 - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" 1179 + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" 1176 1180 done 1177 1181 1178 1182 # There might be people who depend on the old broken behavior: `$host' ··· 1186 1190 if test "x$host_alias" != x; then 1187 1191 if test "x$build_alias" = x; then 1188 1192 cross_compiling=maybe 1189 - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. 1190 - If a cross compiler is detected then cross compile mode will be used." >&2 1193 + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. 1194 + If a cross compiler is detected then cross compile mode will be used" >&2 1191 1195 elif test "x$build_alias" != "x$host_alias"; then 1192 1196 cross_compiling=yes 1193 1197 fi ··· 1202 1206 ac_pwd=`pwd` && test -n "$ac_pwd" && 1203 1207 ac_ls_di=`ls -di .` && 1204 1208 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || 1205 - as_fn_error "working directory cannot be determined" 1209 + as_fn_error $? "working directory cannot be determined" 1206 1210 test "X$ac_ls_di" = "X$ac_pwd_ls_di" || 1207 - as_fn_error "pwd does not report name of working directory" 1211 + as_fn_error $? "pwd does not report name of working directory" 1208 1212 1209 1213 1210 1214 # Find the source files, if location was not specified. ··· 1243 1247 fi 1244 1248 if test ! -r "$srcdir/$ac_unique_file"; then 1245 1249 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." 1246 - as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" 1250 + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" 1247 1251 fi 1248 1252 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" 1249 1253 ac_abs_confdir=`( 1250 - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" 1254 + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" 1251 1255 pwd)` 1252 1256 # When building in place, set srcdir=. 1253 1257 if test "$ac_abs_confdir" = "$ac_pwd"; then ··· 1287 1291 --help=short display options specific to this package 1288 1292 --help=recursive display the short help of all the included packages 1289 1293 -V, --version display version information and exit 1290 - -q, --quiet, --silent do not print \`checking...' messages 1294 + -q, --quiet, --silent do not print \`checking ...' messages 1291 1295 --cache-file=FILE cache test results in FILE [disabled] 1292 1296 -C, --config-cache alias for \`--cache-file=config.cache' 1293 1297 -n, --no-create do not create output files ··· 1379 1383 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a 1380 1384 nonstandard directory <lib dir> 1381 1385 LIBS libraries to pass to the linker, e.g. -l<library> 1382 - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if 1386 + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if 1383 1387 you have headers in a nonstandard directory <include dir> 1384 1388 CPP C preprocessor 1385 1389 XMKMF Path to xmkmf, Makefile generator for X Window System ··· 1451 1455 if $ac_init_version; then 1452 1456 cat <<\_ACEOF 1453 1457 configure 1454 - generated by GNU Autoconf 2.64 1458 + generated by GNU Autoconf 2.67 1455 1459 1456 - Copyright (C) 2009 Free Software Foundation, Inc. 1460 + Copyright (C) 2010 Free Software Foundation, Inc. 1457 1461 This configure script is free software; the Free Software Foundation 1458 1462 gives unlimited permission to copy, distribute and modify it. 1459 1463 _ACEOF ··· 1498 1502 ac_retval=1 1499 1503 fi 1500 1504 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} 1501 - return $ac_retval 1505 + as_fn_set_status $ac_retval 1502 1506 1503 1507 } # ac_fn_c_try_compile 1504 1508 ··· 1523 1527 mv -f conftest.er1 conftest.err 1524 1528 fi 1525 1529 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 1526 - test $ac_status = 0; } >/dev/null && { 1530 + test $ac_status = 0; } > conftest.i && { 1527 1531 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || 1528 1532 test ! -s conftest.err 1529 1533 }; then : ··· 1535 1539 ac_retval=1 1536 1540 fi 1537 1541 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} 1538 - return $ac_retval 1542 + as_fn_set_status $ac_retval 1539 1543 1540 1544 } # ac_fn_c_try_cpp 1541 1545 ··· 1577 1581 fi 1578 1582 rm -rf conftest.dSYM conftest_ipa8_conftest.oo 1579 1583 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} 1580 - return $ac_retval 1584 + as_fn_set_status $ac_retval 1581 1585 1582 1586 } # ac_fn_c_try_run 1583 1587 ··· 1589 1593 ac_fn_c_check_header_mongrel () 1590 1594 { 1591 1595 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 1592 - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : 1596 + if eval "test \"\${$3+set}\"" = set; then : 1593 1597 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 1594 1598 $as_echo_n "checking for $2... " >&6; } 1595 - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : 1599 + if eval "test \"\${$3+set}\"" = set; then : 1596 1600 $as_echo_n "(cached) " >&6 1597 1601 fi 1598 1602 eval ac_res=\$$3 ··· 1628 1632 else 1629 1633 ac_header_preproc=no 1630 1634 fi 1631 - rm -f conftest.err conftest.$ac_ext 1635 + rm -f conftest.err conftest.i conftest.$ac_ext 1632 1636 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 1633 1637 $as_echo "$ac_header_preproc" >&6; } 1634 1638 ··· 1655 1659 esac 1656 1660 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 1657 1661 $as_echo_n "checking for $2... " >&6; } 1658 - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : 1662 + if eval "test \"\${$3+set}\"" = set; then : 1659 1663 $as_echo_n "(cached) " >&6 1660 1664 else 1661 1665 eval "$3=\$ac_header_compiler" ··· 1677 1681 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 1678 1682 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 1679 1683 $as_echo_n "checking for $2... " >&6; } 1680 - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : 1684 + if eval "test \"\${$3+set}\"" = set; then : 1681 1685 $as_echo_n "(cached) " >&6 1682 1686 else 1683 1687 cat confdefs.h - <<_ACEOF >conftest.$ac_ext ··· 1741 1745 # left behind by Apple's compiler. We do this before executing the actions. 1742 1746 rm -rf conftest.dSYM conftest_ipa8_conftest.oo 1743 1747 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} 1744 - return $ac_retval 1748 + as_fn_set_status $ac_retval 1745 1749 1746 1750 } # ac_fn_c_try_link 1747 1751 ··· 1753 1757 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 1754 1758 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 1755 1759 $as_echo_n "checking for $2... " >&6; } 1756 - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : 1760 + if eval "test \"\${$3+set}\"" = set; then : 1757 1761 $as_echo_n "(cached) " >&6 1758 1762 else 1759 1763 cat confdefs.h - <<_ACEOF >conftest.$ac_ext ··· 1816 1820 running configure, to aid debugging if configure makes a mistake. 1817 1821 1818 1822 It was created by $as_me, which was 1819 - generated by GNU Autoconf 2.64. Invocation command line was 1823 + generated by GNU Autoconf 2.67. Invocation command line was 1820 1824 1821 1825 $ $0 $@ 1822 1826 ··· 1926 1930 { 1927 1931 echo 1928 1932 1929 - cat <<\_ASBOX 1930 - ## ---------------- ## 1933 + $as_echo "## ---------------- ## 1931 1934 ## Cache variables. ## 1932 - ## ---------------- ## 1933 - _ASBOX 1935 + ## ---------------- ##" 1934 1936 echo 1935 1937 # The following way of writing the cache mishandles newlines in values, 1936 1938 ( ··· 1964 1966 ) 1965 1967 echo 1966 1968 1967 - cat <<\_ASBOX 1968 - ## ----------------- ## 1969 + $as_echo "## ----------------- ## 1969 1970 ## Output variables. ## 1970 - ## ----------------- ## 1971 - _ASBOX 1971 + ## ----------------- ##" 1972 1972 echo 1973 1973 for ac_var in $ac_subst_vars 1974 1974 do ··· 1981 1981 echo 1982 1982 1983 1983 if test -n "$ac_subst_files"; then 1984 - cat <<\_ASBOX 1985 - ## ------------------- ## 1984 + $as_echo "## ------------------- ## 1986 1985 ## File substitutions. ## 1987 - ## ------------------- ## 1988 - _ASBOX 1986 + ## ------------------- ##" 1989 1987 echo 1990 1988 for ac_var in $ac_subst_files 1991 1989 do ··· 1999 1997 fi 2000 1998 2001 1999 if test -s confdefs.h; then 2002 - cat <<\_ASBOX 2003 - ## ----------- ## 2000 + $as_echo "## ----------- ## 2004 2001 ## confdefs.h. ## 2005 - ## ----------- ## 2006 - _ASBOX 2002 + ## ----------- ##" 2007 2003 echo 2008 2004 cat confdefs.h 2009 2005 echo ··· 2058 2054 ac_site_file1=NONE 2059 2055 ac_site_file2=NONE 2060 2056 if test -n "$CONFIG_SITE"; then 2061 - ac_site_file1=$CONFIG_SITE 2057 + # We do not want a PATH search for config.site. 2058 + case $CONFIG_SITE in #(( 2059 + -*) ac_site_file1=./$CONFIG_SITE;; 2060 + */*) ac_site_file1=$CONFIG_SITE;; 2061 + *) ac_site_file1=./$CONFIG_SITE;; 2062 + esac 2062 2063 elif test "x$prefix" != xNONE; then 2063 2064 ac_site_file1=$prefix/share/config.site 2064 2065 ac_site_file2=$prefix/etc/config.site ··· 2069 2070 for ac_site_file in "$ac_site_file1" "$ac_site_file2" 2070 2071 do 2071 2072 test "x$ac_site_file" = xNONE && continue 2072 - if test -r "$ac_site_file"; then 2073 + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then 2073 2074 { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 2074 2075 $as_echo "$as_me: loading site script $ac_site_file" >&6;} 2075 2076 sed 's/^/| /' "$ac_site_file" >&5 2076 - . "$ac_site_file" 2077 + . "$ac_site_file" \ 2078 + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 2079 + $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 2080 + as_fn_error $? "failed to load site script $ac_site_file 2081 + See \`config.log' for more details" "$LINENO" 5; } 2077 2082 fi 2078 2083 done 2079 2084 2080 2085 if test -r "$cache_file"; then 2081 - # Some versions of bash will fail to source /dev/null (special 2082 - # files actually), so we avoid doing that. 2083 - if test -f "$cache_file"; then 2086 + # Some versions of bash will fail to source /dev/null (special files 2087 + # actually), so we avoid doing that. DJGPP emulates it as a regular file. 2088 + if test /dev/null != "$cache_file" && test -f "$cache_file"; then 2084 2089 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 2085 2090 $as_echo "$as_me: loading cache $cache_file" >&6;} 2086 2091 case $cache_file in ··· 2149 2154 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 2150 2155 { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 2151 2156 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} 2152 - as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 2157 + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 2153 2158 fi 2154 2159 ## -------------------- ## 2155 2160 ## Main body of script. ## ··· 2246 2251 2247 2252 ac_aux_dir= 2248 2253 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do 2249 - for ac_t in install-sh install.sh shtool; do 2250 - if test -f "$ac_dir/$ac_t"; then 2251 - ac_aux_dir=$ac_dir 2252 - ac_install_sh="$ac_aux_dir/$ac_t -c" 2253 - break 2 2254 - fi 2255 - done 2254 + if test -f "$ac_dir/install-sh"; then 2255 + ac_aux_dir=$ac_dir 2256 + ac_install_sh="$ac_aux_dir/install-sh -c" 2257 + break 2258 + elif test -f "$ac_dir/install.sh"; then 2259 + ac_aux_dir=$ac_dir 2260 + ac_install_sh="$ac_aux_dir/install.sh -c" 2261 + break 2262 + elif test -f "$ac_dir/shtool"; then 2263 + ac_aux_dir=$ac_dir 2264 + ac_install_sh="$ac_aux_dir/shtool install -c" 2265 + break 2266 + fi 2256 2267 done 2257 2268 if test -z "$ac_aux_dir"; then 2258 - as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 2269 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 2259 2270 fi 2260 2271 2261 2272 # These three variables are undocumented and unsupported, ··· 2269 2280 2270 2281 # Make sure we can run config.sub. 2271 2282 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || 2272 - as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 2283 + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 2273 2284 2274 2285 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 2275 2286 $as_echo_n "checking build system type... " >&6; } ··· 2280 2291 test "x$ac_build_alias" = x && 2281 2292 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` 2282 2293 test "x$ac_build_alias" = x && 2283 - as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 2294 + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 2284 2295 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || 2285 - as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 2296 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 2286 2297 2287 2298 fi 2288 2299 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 2289 2300 $as_echo "$ac_cv_build" >&6; } 2290 2301 case $ac_cv_build in 2291 2302 *-*-*) ;; 2292 - *) as_fn_error "invalid value of canonical build" "$LINENO" 5;; 2303 + *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; 2293 2304 esac 2294 2305 build=$ac_cv_build 2295 2306 ac_save_IFS=$IFS; IFS='-' ··· 2314 2325 ac_cv_host=$ac_cv_build 2315 2326 else 2316 2327 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || 2317 - as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 2328 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 2318 2329 fi 2319 2330 2320 2331 fi ··· 2322 2333 $as_echo "$ac_cv_host" >&6; } 2323 2334 case $ac_cv_host in 2324 2335 *-*-*) ;; 2325 - *) as_fn_error "invalid value of canonical host" "$LINENO" 5;; 2336 + *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; 2326 2337 esac 2327 2338 host=$ac_cv_host 2328 2339 ac_save_IFS=$IFS; IFS='-' ··· 2724 2735 2725 2736 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 2726 2737 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 2727 - as_fn_error "no acceptable C compiler found in \$PATH 2728 - See \`config.log' for more details." "$LINENO" 5; } 2738 + as_fn_error $? "no acceptable C compiler found in \$PATH 2739 + See \`config.log' for more details" "$LINENO" 5; } 2729 2740 2730 2741 # Provide some information about the compiler. 2731 2742 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 ··· 2746 2757 ... rest of stderr output deleted ... 2747 2758 10q' conftest.err >conftest.er1 2748 2759 cat conftest.er1 >&5 2749 - rm -f conftest.er1 conftest.err 2750 2760 fi 2761 + rm -f conftest.er1 conftest.err 2751 2762 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 2752 2763 test $ac_status = 0; } 2753 2764 done 2754 2765 2755 2766 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2756 2767 /* end confdefs.h. */ 2757 - #include <stdio.h> 2768 + 2758 2769 int 2759 2770 main () 2760 2771 { 2761 - FILE *f = fopen ("conftest.out", "w"); 2762 - return ferror (f) || fclose (f) != 0; 2763 2772 2764 2773 ; 2765 2774 return 0; 2766 2775 } 2767 2776 _ACEOF 2768 2777 ac_clean_files_save=$ac_clean_files 2769 - ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out" 2778 + ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" 2770 2779 # Try to create an executable without -o first, disregard a.out. 2771 2780 # It will help us diagnose broken compilers, and finding out an intuition 2772 2781 # of exeext. 2773 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 2774 - $as_echo_n "checking for C compiler default output file name... " >&6; } 2782 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 2783 + $as_echo_n "checking whether the C compiler works... " >&6; } 2775 2784 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` 2776 2785 2777 2786 # The possible output files: ··· 2833 2842 else 2834 2843 ac_file='' 2835 2844 fi 2836 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 2837 - $as_echo "$ac_file" >&6; } 2838 2845 if test -z "$ac_file"; then : 2839 - $as_echo "$as_me: failed program was:" >&5 2846 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 2847 + $as_echo "no" >&6; } 2848 + $as_echo "$as_me: failed program was:" >&5 2840 2849 sed 's/^/| /' conftest.$ac_ext >&5 2841 2850 2842 2851 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 2843 2852 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 2844 - { as_fn_set_status 77 2845 - as_fn_error "C compiler cannot create executables 2846 - See \`config.log' for more details." "$LINENO" 5; }; } 2853 + as_fn_error 77 "C compiler cannot create executables 2854 + See \`config.log' for more details" "$LINENO" 5; } 2855 + else 2856 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 2857 + $as_echo "yes" >&6; } 2847 2858 fi 2859 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 2860 + $as_echo_n "checking for C compiler default output file name... " >&6; } 2861 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 2862 + $as_echo "$ac_file" >&6; } 2848 2863 ac_exeext=$ac_cv_exeext 2849 2864 2850 - # Check that the compiler produces executables we can run. If not, either 2851 - # the compiler is broken, or we cross compile. 2852 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 2853 - $as_echo_n "checking whether the C compiler works... " >&6; } 2854 - # If not cross compiling, check that we can run a simple program. 2855 - if test "$cross_compiling" != yes; then 2856 - if { ac_try='./$ac_file' 2857 - { { case "(($ac_try" in 2858 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 2859 - *) ac_try_echo=$ac_try;; 2860 - esac 2861 - eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" 2862 - $as_echo "$ac_try_echo"; } >&5 2863 - (eval "$ac_try") 2>&5 2864 - ac_status=$? 2865 - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 2866 - test $ac_status = 0; }; }; then 2867 - cross_compiling=no 2868 - else 2869 - if test "$cross_compiling" = maybe; then 2870 - cross_compiling=yes 2871 - else 2872 - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 2873 - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 2874 - as_fn_error "cannot run C compiled programs. 2875 - If you meant to cross compile, use \`--host'. 2876 - See \`config.log' for more details." "$LINENO" 5; } 2877 - fi 2878 - fi 2879 - fi 2880 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 2881 - $as_echo "yes" >&6; } 2882 - 2883 - rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out 2865 + rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out 2884 2866 ac_clean_files=$ac_clean_files_save 2885 - # Check that the compiler produces executables we can run. If not, either 2886 - # the compiler is broken, or we cross compile. 2887 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 2888 - $as_echo_n "checking whether we are cross compiling... " >&6; } 2889 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 2890 - $as_echo "$cross_compiling" >&6; } 2891 - 2892 2867 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 2893 2868 $as_echo_n "checking for suffix of executables... " >&6; } 2894 2869 if { { ac_try="$ac_link" ··· 2918 2893 else 2919 2894 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 2920 2895 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 2921 - as_fn_error "cannot compute suffix of executables: cannot compile and link 2922 - See \`config.log' for more details." "$LINENO" 5; } 2896 + as_fn_error $? "cannot compute suffix of executables: cannot compile and link 2897 + See \`config.log' for more details" "$LINENO" 5; } 2923 2898 fi 2924 - rm -f conftest$ac_cv_exeext 2899 + rm -f conftest conftest$ac_cv_exeext 2925 2900 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 2926 2901 $as_echo "$ac_cv_exeext" >&6; } 2927 2902 2928 2903 rm -f conftest.$ac_ext 2929 2904 EXEEXT=$ac_cv_exeext 2930 2905 ac_exeext=$EXEEXT 2906 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2907 + /* end confdefs.h. */ 2908 + #include <stdio.h> 2909 + int 2910 + main () 2911 + { 2912 + FILE *f = fopen ("conftest.out", "w"); 2913 + return ferror (f) || fclose (f) != 0; 2914 + 2915 + ; 2916 + return 0; 2917 + } 2918 + _ACEOF 2919 + ac_clean_files="$ac_clean_files conftest.out" 2920 + # Check that the compiler produces executables we can run. If not, either 2921 + # the compiler is broken, or we cross compile. 2922 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 2923 + $as_echo_n "checking whether we are cross compiling... " >&6; } 2924 + if test "$cross_compiling" != yes; then 2925 + { { ac_try="$ac_link" 2926 + case "(($ac_try" in 2927 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 2928 + *) ac_try_echo=$ac_try;; 2929 + esac 2930 + eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" 2931 + $as_echo "$ac_try_echo"; } >&5 2932 + (eval "$ac_link") 2>&5 2933 + ac_status=$? 2934 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 2935 + test $ac_status = 0; } 2936 + if { ac_try='./conftest$ac_cv_exeext' 2937 + { { case "(($ac_try" in 2938 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 2939 + *) ac_try_echo=$ac_try;; 2940 + esac 2941 + eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" 2942 + $as_echo "$ac_try_echo"; } >&5 2943 + (eval "$ac_try") 2>&5 2944 + ac_status=$? 2945 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 2946 + test $ac_status = 0; }; }; then 2947 + cross_compiling=no 2948 + else 2949 + if test "$cross_compiling" = maybe; then 2950 + cross_compiling=yes 2951 + else 2952 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 2953 + $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 2954 + as_fn_error $? "cannot run C compiled programs. 2955 + If you meant to cross compile, use \`--host'. 2956 + See \`config.log' for more details" "$LINENO" 5; } 2957 + fi 2958 + fi 2959 + fi 2960 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 2961 + $as_echo "$cross_compiling" >&6; } 2962 + 2963 + rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out 2964 + ac_clean_files=$ac_clean_files_save 2931 2965 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 2932 2966 $as_echo_n "checking for suffix of object files... " >&6; } 2933 2967 if test "${ac_cv_objext+set}" = set; then : ··· 2970 3004 2971 3005 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 2972 3006 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 2973 - as_fn_error "cannot compute suffix of object files: cannot compile 2974 - See \`config.log' for more details." "$LINENO" 5; } 3007 + as_fn_error $? "cannot compute suffix of object files: cannot compile 3008 + See \`config.log' for more details" "$LINENO" 5; } 2975 3009 fi 2976 3010 rm -f conftest.$ac_cv_objext conftest.$ac_ext 2977 3011 fi ··· 3428 3462 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } 3429 3463 set x ${MAKE-make} 3430 3464 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` 3431 - if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : 3465 + if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : 3432 3466 $as_echo_n "(cached) " >&6 3433 3467 else 3434 3468 cat >conftest.make <<\_ACEOF ··· 3436 3470 all: 3437 3471 @echo '@@@%%%=$(MAKE)=@@@%%%' 3438 3472 _ACEOF 3439 - # GNU make sometimes prints "make[1]: Entering...", which would confuse us. 3473 + # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. 3440 3474 case `${MAKE-make} -f conftest.make 2>/dev/null` in 3441 3475 *@@@%%%=?*=@@@%%%*) 3442 3476 eval ac_cv_prog_make_${ac_make}_set=yes;; ··· 3608 3642 # Broken: fails on valid input. 3609 3643 continue 3610 3644 fi 3611 - rm -f conftest.err conftest.$ac_ext 3645 + rm -f conftest.err conftest.i conftest.$ac_ext 3612 3646 3613 3647 # OK, works on sane cases. Now check whether nonexistent headers 3614 3648 # can be detected and how. ··· 3624 3658 ac_preproc_ok=: 3625 3659 break 3626 3660 fi 3627 - rm -f conftest.err conftest.$ac_ext 3661 + rm -f conftest.err conftest.i conftest.$ac_ext 3628 3662 3629 3663 done 3630 3664 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. 3631 - rm -f conftest.err conftest.$ac_ext 3665 + rm -f conftest.i conftest.err conftest.$ac_ext 3632 3666 if $ac_preproc_ok; then : 3633 3667 break 3634 3668 fi ··· 3667 3701 # Broken: fails on valid input. 3668 3702 continue 3669 3703 fi 3670 - rm -f conftest.err conftest.$ac_ext 3704 + rm -f conftest.err conftest.i conftest.$ac_ext 3671 3705 3672 3706 # OK, works on sane cases. Now check whether nonexistent headers 3673 3707 # can be detected and how. ··· 3683 3717 ac_preproc_ok=: 3684 3718 break 3685 3719 fi 3686 - rm -f conftest.err conftest.$ac_ext 3720 + rm -f conftest.err conftest.i conftest.$ac_ext 3687 3721 3688 3722 done 3689 3723 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. 3690 - rm -f conftest.err conftest.$ac_ext 3724 + rm -f conftest.i conftest.err conftest.$ac_ext 3691 3725 if $ac_preproc_ok; then : 3692 3726 3693 3727 else 3694 3728 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 3695 3729 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 3696 - as_fn_error "C preprocessor \"$CPP\" fails sanity check 3697 - See \`config.log' for more details." "$LINENO" 5; } 3730 + as_fn_error $? "C preprocessor \"$CPP\" fails sanity check 3731 + See \`config.log' for more details" "$LINENO" 5; } 3698 3732 fi 3699 3733 3700 3734 ac_ext=c ··· 3755 3789 done 3756 3790 IFS=$as_save_IFS 3757 3791 if test -z "$ac_cv_path_GREP"; then 3758 - as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 3792 + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 3759 3793 fi 3760 3794 else 3761 3795 ac_cv_path_GREP=$GREP ··· 3821 3855 done 3822 3856 IFS=$as_save_IFS 3823 3857 if test -z "$ac_cv_path_EGREP"; then 3824 - as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 3858 + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 3825 3859 fi 3826 3860 else 3827 3861 ac_cv_path_EGREP=$EGREP ··· 3953 3987 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 3954 3988 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default 3955 3989 " 3956 - eval as_val=\$$as_ac_Header 3957 - if test "x$as_val" = x""yes; then : 3990 + if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : 3958 3991 cat >>confdefs.h <<_ACEOF 3959 3992 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 3960 3993 _ACEOF ··· 3985 4018 do : 3986 4019 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 3987 4020 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 3988 - eval as_val=\$$as_ac_Header 3989 - if test "x$as_val" = x""yes; then : 4021 + if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : 3990 4022 cat >>confdefs.h <<_ACEOF 3991 4023 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 3992 4024 _ACEOF ··· 4098 4130 do : 4099 4131 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` 4100 4132 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" 4101 - eval as_val=\$$as_ac_var 4102 - if test "x$as_val" = x""yes; then : 4133 + if eval test \"x\$"$as_ac_var"\" = x"yes"; then : 4103 4134 cat >>confdefs.h <<_ACEOF 4104 4135 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 4105 4136 _ACEOF ··· 4348 4379 have_x=disabled 4349 4380 else 4350 4381 case $x_includes,$x_libraries in #( 4351 - *\'*) as_fn_error "cannot use X directory names containing '" "$LINENO" 5;; #( 4382 + *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( 4352 4383 *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then : 4353 4384 $as_echo_n "(cached) " >&6 4354 4385 else ··· 4366 4397 @echo libdir='${LIBDIR}' 4367 4398 _ACEOF 4368 4399 if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then 4369 - # GNU make sometimes prints "make[1]: Entering...", which would confuse us. 4400 + # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. 4370 4401 for ac_var in incroot usrlibdir libdir; do 4371 4402 eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" 4372 4403 done ··· 4452 4483 fi 4453 4484 done 4454 4485 fi 4455 - rm -f conftest.err conftest.$ac_ext 4486 + rm -f conftest.err conftest.i conftest.$ac_ext 4456 4487 fi # $ac_x_includes = no 4457 4488 4458 4489 if test "$ac_x_libraries" = no; then ··· 5507 5538 fi 5508 5539 5509 5540 5541 + sound1=" null wav" 5542 + sound2="" 5543 + 5544 + 5510 5545 option1="" 5511 5546 option2="" 5512 5547 ··· 5608 5643 5609 5644 ac_libobjs= 5610 5645 ac_ltlibobjs= 5646 + U= 5611 5647 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue 5612 5648 # 1. Remove the extension, and $U if already installed. 5613 5649 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ··· 5769 5805 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH 5770 5806 5771 5807 5772 - # as_fn_error ERROR [LINENO LOG_FD] 5773 - # --------------------------------- 5808 + # as_fn_error STATUS ERROR [LINENO LOG_FD] 5809 + # ---------------------------------------- 5774 5810 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are 5775 5811 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the 5776 - # script with status $?, using 1 if that was 0. 5812 + # script with STATUS, using 1 if that was 0. 5777 5813 as_fn_error () 5778 5814 { 5779 - as_status=$?; test $as_status -eq 0 && as_status=1 5780 - if test "$3"; then 5781 - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 5782 - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 5815 + as_status=$1; test $as_status -eq 0 && as_status=1 5816 + if test "$4"; then 5817 + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 5818 + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 5783 5819 fi 5784 - $as_echo "$as_me: error: $1" >&2 5820 + $as_echo "$as_me: error: $2" >&2 5785 5821 as_fn_exit $as_status 5786 5822 } # as_fn_error 5787 5823 ··· 5977 6013 test -d "$as_dir" && break 5978 6014 done 5979 6015 test -z "$as_dirs" || eval "mkdir $as_dirs" 5980 - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" 6016 + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" 5981 6017 5982 6018 5983 6019 } # as_fn_mkdir_p ··· 6031 6067 # values after options handling. 6032 6068 ac_log=" 6033 6069 This file was extended by $as_me, which was 6034 - generated by GNU Autoconf 2.64. Invocation command line was 6070 + generated by GNU Autoconf 2.67. Invocation command line was 6035 6071 6036 6072 CONFIG_FILES = $CONFIG_FILES 6037 6073 CONFIG_HEADERS = $CONFIG_HEADERS ··· 6070 6106 6071 6107 -h, --help print this help, then exit 6072 6108 -V, --version print version number and configuration settings, then exit 6109 + --config print configuration, then exit 6073 6110 -q, --quiet, --silent 6074 6111 do not print progress messages 6075 6112 -d, --debug don't remove temporary files ··· 6089 6126 6090 6127 _ACEOF 6091 6128 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 6129 + ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" 6092 6130 ac_cs_version="\\ 6093 6131 config.status 6094 - configured by $0, generated by GNU Autoconf 2.64, 6095 - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" 6132 + configured by $0, generated by GNU Autoconf 2.67, 6133 + with options \\"\$ac_cs_config\\" 6096 6134 6097 - Copyright (C) 2009 Free Software Foundation, Inc. 6135 + Copyright (C) 2010 Free Software Foundation, Inc. 6098 6136 This config.status script is free software; the Free Software Foundation 6099 6137 gives unlimited permission to copy, distribute and modify it." 6100 6138 ··· 6110 6148 while test $# != 0 6111 6149 do 6112 6150 case $1 in 6113 - --*=*) 6151 + --*=?*) 6114 6152 ac_option=`expr "X$1" : 'X\([^=]*\)='` 6115 6153 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` 6154 + ac_shift=: 6155 + ;; 6156 + --*=) 6157 + ac_option=`expr "X$1" : 'X\([^=]*\)='` 6158 + ac_optarg= 6116 6159 ac_shift=: 6117 6160 ;; 6118 6161 *) ··· 6128 6171 ac_cs_recheck=: ;; 6129 6172 --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) 6130 6173 $as_echo "$ac_cs_version"; exit ;; 6174 + --config | --confi | --conf | --con | --co | --c ) 6175 + $as_echo "$ac_cs_config"; exit ;; 6131 6176 --debug | --debu | --deb | --de | --d | -d ) 6132 6177 debug=: ;; 6133 6178 --file | --fil | --fi | --f ) 6134 6179 $ac_shift 6135 6180 case $ac_optarg in 6136 6181 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; 6182 + '') as_fn_error $? "missing file argument" ;; 6137 6183 esac 6138 6184 as_fn_append CONFIG_FILES " '$ac_optarg'" 6139 6185 ac_need_defaults=false;; ··· 6146 6192 ac_need_defaults=false;; 6147 6193 --he | --h) 6148 6194 # Conflict between --help and --header 6149 - as_fn_error "ambiguous option: \`$1' 6195 + as_fn_error $? "ambiguous option: \`$1' 6150 6196 Try \`$0 --help' for more information.";; 6151 6197 --help | --hel | -h ) 6152 6198 $as_echo "$ac_cs_usage"; exit ;; ··· 6155 6201 ac_cs_silent=: ;; 6156 6202 6157 6203 # This is an error. 6158 - -*) as_fn_error "unrecognized option: \`$1' 6204 + -*) as_fn_error $? "unrecognized option: \`$1' 6159 6205 Try \`$0 --help' for more information." ;; 6160 6206 6161 6207 *) as_fn_append ac_config_targets " $1" ··· 6209 6255 "Makefile.inc") CONFIG_FILES="$CONFIG_FILES Makefile.inc" ;; 6210 6256 "src/config.inc") CONFIG_FILES="$CONFIG_FILES src/config.inc" ;; 6211 6257 6212 - *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 6258 + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 6213 6259 esac 6214 6260 done 6215 6261 ··· 6246 6292 { 6247 6293 tmp=./conf$$-$RANDOM 6248 6294 (umask 077 && mkdir "$tmp") 6249 - } || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 6295 + } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 6250 6296 6251 6297 # Set up the scripts for CONFIG_FILES section. 6252 6298 # No need to generate them if there are no CONFIG_FILES. ··· 6263 6309 fi 6264 6310 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` 6265 6311 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then 6266 - ac_cs_awk_cr='\r' 6312 + ac_cs_awk_cr='\\r' 6267 6313 else 6268 6314 ac_cs_awk_cr=$ac_cr 6269 6315 fi ··· 6277 6323 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && 6278 6324 echo "_ACEOF" 6279 6325 } >conf$$subs.sh || 6280 - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 6281 - ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` 6326 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 6327 + ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` 6282 6328 ac_delim='%!_!# ' 6283 6329 for ac_last_try in false false false false false :; do 6284 6330 . ./conf$$subs.sh || 6285 - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 6331 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 6286 6332 6287 6333 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` 6288 6334 if test $ac_delim_n = $ac_delim_num; then 6289 6335 break 6290 6336 elif $ac_last_try; then 6291 - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 6337 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 6292 6338 else 6293 6339 ac_delim="$ac_delim!$ac_delim _$ac_delim!! " 6294 6340 fi ··· 6310 6356 t delim 6311 6357 :nl 6312 6358 h 6313 - s/\(.\{148\}\).*/\1/ 6359 + s/\(.\{148\}\)..*/\1/ 6314 6360 t more1 6315 6361 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ 6316 6362 p ··· 6324 6370 t nl 6325 6371 :delim 6326 6372 h 6327 - s/\(.\{148\}\).*/\1/ 6373 + s/\(.\{148\}\)..*/\1/ 6328 6374 t more2 6329 6375 s/["\\]/\\&/g; s/^/"/; s/$/"/ 6330 6376 p ··· 6377 6423 else 6378 6424 cat 6379 6425 fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ 6380 - || as_fn_error "could not setup config files machinery" "$LINENO" 5 6426 + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 6381 6427 _ACEOF 6382 6428 6383 - # VPATH may cause trouble with some makes, so we remove $(srcdir), 6384 - # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and 6429 + # VPATH may cause trouble with some makes, so we remove sole $(srcdir), 6430 + # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and 6385 6431 # trailing colons and then remove the whole line if VPATH becomes empty 6386 6432 # (actually we leave an empty line to preserve line numbers). 6387 6433 if test "x$srcdir" = x.; then 6388 - ac_vpsub='/^[ ]*VPATH[ ]*=/{ 6389 - s/:*\$(srcdir):*/:/ 6390 - s/:*\${srcdir}:*/:/ 6391 - s/:*@srcdir@:*/:/ 6392 - s/^\([^=]*=[ ]*\):*/\1/ 6434 + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ 6435 + h 6436 + s/// 6437 + s/^/:/ 6438 + s/[ ]*$/:/ 6439 + s/:\$(srcdir):/:/g 6440 + s/:\${srcdir}:/:/g 6441 + s/:@srcdir@:/:/g 6442 + s/^:*// 6393 6443 s/:*$// 6444 + x 6445 + s/\(=[ ]*\).*/\1/ 6446 + G 6447 + s/\n// 6394 6448 s/^[^=]*=[ ]*$// 6395 6449 }' 6396 6450 fi ··· 6418 6472 if test -z "$ac_t"; then 6419 6473 break 6420 6474 elif $ac_last_try; then 6421 - as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 6475 + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 6422 6476 else 6423 6477 ac_delim="$ac_delim!$ac_delim _$ac_delim!! " 6424 6478 fi ··· 6503 6557 _ACAWK 6504 6558 _ACEOF 6505 6559 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 6506 - as_fn_error "could not setup config headers machinery" "$LINENO" 5 6560 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 6507 6561 fi # test -n "$CONFIG_HEADERS" 6508 6562 6509 6563 ··· 6516 6570 esac 6517 6571 case $ac_mode$ac_tag in 6518 6572 :[FHL]*:*);; 6519 - :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; 6573 + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; 6520 6574 :[FH]-) ac_tag=-:-;; 6521 6575 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; 6522 6576 esac ··· 6544 6598 [\\/$]*) false;; 6545 6599 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; 6546 6600 esac || 6547 - as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; 6601 + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; 6548 6602 esac 6549 6603 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac 6550 6604 as_fn_append ac_file_inputs " '$ac_f'" ··· 6571 6625 6572 6626 case $ac_tag in 6573 6627 *:-:* | *:-) cat >"$tmp/stdin" \ 6574 - || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; 6628 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; 6575 6629 esac 6576 6630 ;; 6577 6631 esac ··· 6702 6756 $ac_datarootdir_hack 6703 6757 " 6704 6758 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ 6705 - || as_fn_error "could not create $ac_file" "$LINENO" 5 6759 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 6706 6760 6707 6761 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && 6708 6762 { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && 6709 6763 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && 6710 6764 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' 6711 - which seems to be undefined. Please make sure it is defined." >&5 6765 + which seems to be undefined. Please make sure it is defined" >&5 6712 6766 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' 6713 - which seems to be undefined. Please make sure it is defined." >&2;} 6767 + which seems to be undefined. Please make sure it is defined" >&2;} 6714 6768 6715 6769 rm -f "$tmp/stdin" 6716 6770 case $ac_file in 6717 6771 -) cat "$tmp/out" && rm -f "$tmp/out";; 6718 6772 *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; 6719 6773 esac \ 6720 - || as_fn_error "could not create $ac_file" "$LINENO" 5 6774 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 6721 6775 ;; 6722 6776 :H) 6723 6777 # ··· 6728 6782 $as_echo "/* $configure_input */" \ 6729 6783 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" 6730 6784 } >"$tmp/config.h" \ 6731 - || as_fn_error "could not create $ac_file" "$LINENO" 5 6785 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 6732 6786 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then 6733 6787 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 6734 6788 $as_echo "$as_me: $ac_file is unchanged" >&6;} 6735 6789 else 6736 6790 rm -f "$ac_file" 6737 6791 mv "$tmp/config.h" "$ac_file" \ 6738 - || as_fn_error "could not create $ac_file" "$LINENO" 5 6792 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 6739 6793 fi 6740 6794 else 6741 6795 $as_echo "/* $configure_input */" \ 6742 6796 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ 6743 - || as_fn_error "could not create -" "$LINENO" 5 6797 + || as_fn_error $? "could not create -" "$LINENO" 5 6744 6798 fi 6745 6799 ;; 6746 6800 ··· 6755 6809 ac_clean_files=$ac_clean_files_save 6756 6810 6757 6811 test $ac_write_fail = 0 || 6758 - as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 6812 + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 6759 6813 6760 6814 6761 6815 # configure is writing to config.log, and then calls config.status. ··· 6776 6830 exec 5>>config.log 6777 6831 # Use ||, not &&, to avoid exiting from the if with $? = 1, which 6778 6832 # would make configure fail if this is the last instruction. 6779 - $ac_cs_success || as_fn_exit $? 6833 + $ac_cs_success || as_fn_exit 1 6780 6834 fi 6781 6835 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then 6782 6836 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 ··· 6796 6850 echo 6797 6851 echo " prefix: $prefix" 6798 6852 echo 6799 - echo " Emulators built: $emu1" 6800 - echo " Emulators not built: $emu2" 6801 - echo " ROMs built: $romext1" 6802 - echo " ROMs not built: $romext2" 6803 - echo " Terminals built: $term1" 6804 - echo " Terminals not built: $term2" 6805 - echo " Char drivers built: $char1" 6806 - echo " Char drivers not built:$char2" 6807 - echo " Enabled options: $option1" 6808 - echo " Disabled options: $option2" 6853 + echo " Emulators built: $emu1" 6854 + echo " Emulators not built: $emu2" 6855 + echo " ROMs built: $romext1" 6856 + echo " ROMs not built: $romext2" 6857 + echo " Terminals built: $term1" 6858 + echo " Terminals not built: $term2" 6859 + echo " Char drivers built: $char1" 6860 + echo " Char drivers not built: $char2" 6861 + echo " Sound drivers built: $sound1" 6862 + echo " Sound drivers not built:$sound2" 6863 + echo " Enabled options: $option1" 6864 + echo " Disabled options: $option2"
+16 -10
configure.in
··· 923 923 fi 924 924 925 925 926 + sound1=" null wav" 927 + sound2="" 928 + 929 + 926 930 option1="" 927 931 option2="" 928 932 ··· 953 957 echo 954 958 echo " prefix: $prefix" 955 959 echo 956 - echo " Emulators built: $emu1" 957 - echo " Emulators not built: $emu2" 958 - echo " ROMs built: $romext1" 959 - echo " ROMs not built: $romext2" 960 - echo " Terminals built: $term1" 961 - echo " Terminals not built: $term2" 962 - echo " Char drivers built: $char1" 963 - echo " Char drivers not built:$char2" 964 - echo " Enabled options: $option1" 965 - echo " Disabled options: $option2" 960 + echo " Emulators built: $emu1" 961 + echo " Emulators not built: $emu2" 962 + echo " ROMs built: $romext1" 963 + echo " ROMs not built: $romext2" 964 + echo " Terminals built: $term1" 965 + echo " Terminals not built: $term2" 966 + echo " Char drivers built: $char1" 967 + echo " Char drivers not built: $char2" 968 + echo " Sound drivers built: $sound1" 969 + echo " Sound drivers not built:$sound2" 970 + echo " Enabled options: $option1" 971 + echo " Disabled options: $option2"
+34
doc/sound-drivers.txt
··· 1 + Sound drivers 2 + ============= 3 + 4 + The syntax of a sound driver specification is: 5 + 6 + <driver>:<option1>=<value1>:<option2>=<value2>... 7 + 8 + White space around option names and values is ignored. If a value contains 9 + a colon, it must be escaped by repeating it. 10 + 11 + 12 + The following options can be used with all sound drivers: 13 + 14 + wav=<filename> 15 + Write the sound output to a WAV file. 16 + 17 + lowpass=<frequency> 18 + Apply a low-pass filter. If <frequency> is 0 (the default), 19 + the low-pass filter is disabled. 20 + 21 + wavfilter=[0|1] 22 + If true then the low-pass filter is applied before the sound 23 + is written to the WAV file. 24 + 25 + 26 + The following is a list of sound drivers and their options: 27 + 28 + null: 29 + The null sound driver that discards output written to it. It can 30 + still be written to a WAV file as a side effect. 31 + 32 + 33 + wav: 34 + This is another name for the null sound driver.
+26
src/drivers/sound/Makefile.inc
··· 1 + # src/drivers/sound/Makefile.inc 2 + 3 + rel := src/drivers/sound 4 + 5 + DIRS += $(rel) 6 + DIST += $(rel)/Makefile.inc 7 + 8 + DRV_SND_BAS := sound sound-null sound-wav 9 + DRV_SND_NBAS := 10 + 11 + DRV_SND_SRC := $(foreach f,$(DRV_SND_BAS),$(rel)/$(f).c) 12 + DRV_SND_NSRC := $(foreach f,$(DRV_SND_NBAS),$(rel)/$(f).c) 13 + DRV_SND_OBJ := $(foreach f,$(DRV_SND_BAS),$(rel)/$(f).o) 14 + DRV_SND_NOBJ := $(foreach f,$(DRV_SND_NBAS),$(rel)/$(f).o) 15 + DRV_SND_HDR := $(foreach f,$(DRV_SND_BAS),$(rel)/$(f).h) 16 + DRV_SND_NHDR := $(foreach f,$(DRV_SND_NBAS),$(rel)/$(f).h) 17 + DRV_SND_ARC := $(rel)/sound.a 18 + 19 + CLN += $(DRV_SND_OBJ) $(DRV_SND_NOBJ) $(DRV_SND_ARC) 20 + DIST += $(DRV_SND_SRC) $(DRV_SND_HDR) $(DRV_SND_NSRC) $(DRV_SND_NHDR) 21 + 22 + $(rel)/sound.o: $(rel)/sound.c 23 + $(rel)/sound-null.o: $(rel)/sound-null.c 24 + $(rel)/sound-wav.o: $(rel)/sound-wav.c 25 + 26 + $(rel)/sound.a: $(DRV_SND_OBJ)
+89
src/drivers/sound/sound-null.c
··· 1 + /***************************************************************************** 2 + * pce * 3 + *****************************************************************************/ 4 + 5 + /***************************************************************************** 6 + * File name: src/drivers/sound/sound-null.c * 7 + * Created: 2009-10-17 by Hampa Hug <hampa@hampa.ch> * 8 + * Copyright: (C) 2009 Hampa Hug <hampa@hampa.ch> * 9 + *****************************************************************************/ 10 + 11 + /***************************************************************************** 12 + * This program is free software. You can redistribute it and / or modify it * 13 + * under the terms of the GNU General Public License version 2 as published * 14 + * by the Free Software Foundation. * 15 + * * 16 + * This program is distributed in the hope that it will be useful, but * 17 + * WITHOUT ANY WARRANTY, without even the implied warranty of * 18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * 19 + * Public License for more details. * 20 + *****************************************************************************/ 21 + 22 + 23 + #include <stdlib.h> 24 + #include <stdio.h> 25 + #include <string.h> 26 + 27 + #include <drivers/sound/sound.h> 28 + #include <drivers/sound/sound-null.h> 29 + 30 + 31 + static 32 + void snd_null_close (sound_drv_t *sdrv) 33 + { 34 + sound_null_t *drv; 35 + 36 + drv = sdrv->ext; 37 + 38 + free (drv); 39 + } 40 + 41 + static 42 + int snd_null_write (sound_drv_t *sdrv, const uint16_t *buf, unsigned cnt) 43 + { 44 + sound_null_t *drv; 45 + 46 + drv = sdrv->ext; 47 + 48 + return (0); 49 + } 50 + 51 + static 52 + int snd_null_set_params (sound_drv_t *sdrv, unsigned chn, unsigned long srate, int sign) 53 + { 54 + sound_null_t *drv; 55 + 56 + drv = sdrv->ext; 57 + 58 + return (0); 59 + } 60 + 61 + static 62 + int snd_null_init (sound_null_t *drv, const char *name) 63 + { 64 + snd_init (&drv->sdrv, drv); 65 + 66 + drv->sdrv.close = snd_null_close; 67 + drv->sdrv.write = snd_null_write; 68 + drv->sdrv.set_params = snd_null_set_params; 69 + 70 + return (0); 71 + } 72 + 73 + sound_drv_t *snd_null_open (const char *name) 74 + { 75 + sound_null_t *drv; 76 + 77 + drv = malloc (sizeof (sound_null_t)); 78 + 79 + if (drv == NULL) { 80 + return (NULL); 81 + } 82 + 83 + if (snd_null_init (drv, name)) { 84 + free (drv); 85 + return (NULL); 86 + } 87 + 88 + return (&drv->sdrv); 89 + }
+35
src/drivers/sound/sound-null.h
··· 1 + /***************************************************************************** 2 + * pce * 3 + *****************************************************************************/ 4 + 5 + /***************************************************************************** 6 + * File name: src/drivers/sound/sound-null.h * 7 + * Created: 2009-10-17 by Hampa Hug <hampa@hampa.ch> * 8 + * Copyright: (C) 2009 Hampa Hug <hampa@hampa.ch> * 9 + *****************************************************************************/ 10 + 11 + /***************************************************************************** 12 + * This program is free software. You can redistribute it and / or modify it * 13 + * under the terms of the GNU General Public License version 2 as published * 14 + * by the Free Software Foundation. * 15 + * * 16 + * This program is distributed in the hope that it will be useful, but * 17 + * WITHOUT ANY WARRANTY, without even the implied warranty of * 18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * 19 + * Public License for more details. * 20 + *****************************************************************************/ 21 + 22 + 23 + #ifndef PCE_DRIVERS_SOUND_NULL_H 24 + #define PCE_DRIVERS_SOUND_NULL_H 1 25 + 26 + 27 + #include <drivers/sound/sound.h> 28 + 29 + 30 + typedef struct sound_null_t { 31 + sound_drv_t sdrv; 32 + } sound_null_t; 33 + 34 + 35 + #endif
+172
src/drivers/sound/sound-wav.c
··· 1 + /***************************************************************************** 2 + * pce * 3 + *****************************************************************************/ 4 + 5 + /***************************************************************************** 6 + * File name: src/drivers/sound/sound-wav.c * 7 + * Created: 2009-10-18 by Hampa Hug <hampa@hampa.ch> * 8 + * Copyright: (C) 2009-2010 Hampa Hug <hampa@hampa.ch> * 9 + *****************************************************************************/ 10 + 11 + /***************************************************************************** 12 + * This program is free software. You can redistribute it and / or modify it * 13 + * under the terms of the GNU General Public License version 2 as published * 14 + * by the Free Software Foundation. * 15 + * * 16 + * This program is distributed in the hope that it will be useful, but * 17 + * WITHOUT ANY WARRANTY, without even the implied warranty of * 18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * 19 + * Public License for more details. * 20 + *****************************************************************************/ 21 + 22 + 23 + #include <stdlib.h> 24 + #include <stdio.h> 25 + #include <string.h> 26 + 27 + #include <drivers/options.h> 28 + #include <drivers/sound/sound.h> 29 + #include <drivers/sound/sound-wav.h> 30 + 31 + #define WAVE_RIFF 0x46464952 32 + #define WAVE_WAVE 0x45564157 33 + #define WAVE_FMT 0x20746d66 34 + #define WAVE_DATA 0x61746164 35 + 36 + 37 + static 38 + void wav_set_uint16 (void *buf, unsigned i, unsigned v) 39 + { 40 + unsigned char *tmp; 41 + 42 + tmp = (unsigned char *) buf + i; 43 + 44 + tmp[0] = v & 0xff; 45 + tmp[1] = (v >> 8) & 0xff; 46 + } 47 + 48 + static 49 + void wav_set_uint32 (void *buf, unsigned i, unsigned long v) 50 + { 51 + unsigned char *tmp; 52 + 53 + tmp = (unsigned char *) buf + i; 54 + 55 + tmp[0] = v & 0xff; 56 + tmp[1] = (v >> 8) & 0xff; 57 + tmp[2] = (v >> 16) & 0xff; 58 + tmp[3] = (v >> 24) & 0xff; 59 + } 60 + 61 + static 62 + int snd_wav_write_header (sound_drv_t *sdrv) 63 + { 64 + unsigned char buf[64]; 65 + 66 + if (fseek (sdrv->wav_fp, 0, SEEK_SET)) { 67 + return (1); 68 + } 69 + 70 + wav_set_uint32 (buf, 0, WAVE_RIFF); 71 + wav_set_uint32 (buf, 4, sdrv->wav_cnt + 36); 72 + wav_set_uint32 (buf, 8, WAVE_WAVE); 73 + 74 + wav_set_uint32 (buf, 12, WAVE_FMT); 75 + wav_set_uint32 (buf, 16, 16); 76 + wav_set_uint16 (buf, 20, 0x0001); 77 + wav_set_uint16 (buf, 22, sdrv->channels); 78 + wav_set_uint32 (buf, 24, sdrv->sample_rate); 79 + wav_set_uint32 (buf, 28, 2 * sdrv->channels * sdrv->sample_rate); 80 + wav_set_uint16 (buf, 32, 2 * sdrv->channels); 81 + wav_set_uint16 (buf, 34, 16); 82 + 83 + wav_set_uint32 (buf, 36, WAVE_DATA); 84 + wav_set_uint32 (buf, 40, sdrv->wav_cnt); 85 + 86 + if (fwrite (buf, 1, 44, sdrv->wav_fp) != 44) { 87 + return (1); 88 + } 89 + 90 + if (fseek (sdrv->wav_fp, sdrv->wav_cnt + 44, SEEK_SET)) { 91 + return (1); 92 + } 93 + 94 + return (0); 95 + } 96 + 97 + void snd_wav_close (sound_drv_t *sdrv) 98 + { 99 + if (sdrv->wav_fp != NULL) { 100 + snd_wav_write_header (sdrv); 101 + } 102 + } 103 + 104 + int snd_wav_write (sound_drv_t *sdrv, const uint16_t *buf, unsigned cnt) 105 + { 106 + unsigned long bcnt, scnt; 107 + unsigned char *bbuf; 108 + 109 + if (sdrv->wav_fp == NULL) { 110 + return (0); 111 + } 112 + 113 + scnt = (unsigned long) sdrv->channels * (unsigned long) cnt; 114 + bcnt = 2 * scnt; 115 + 116 + bbuf = snd_get_bbuf (sdrv, bcnt); 117 + 118 + if (buf == NULL) { 119 + return (1); 120 + } 121 + 122 + snd_set_buf (bbuf, buf, scnt, sdrv->sample_sign == 0, 0); 123 + 124 + if (fwrite (bbuf, 1, bcnt, sdrv->wav_fp) != bcnt) { 125 + return (1); 126 + } 127 + 128 + sdrv->wav_cnt += bcnt; 129 + 130 + return (0); 131 + } 132 + 133 + int snd_wav_set_params (sound_drv_t *sdrv, unsigned chn, unsigned long srate, int sign) 134 + { 135 + if (sdrv->wav_fp == NULL) { 136 + return (0); 137 + } 138 + 139 + if (snd_wav_write_header (sdrv)) { 140 + return (1); 141 + } 142 + 143 + return (0); 144 + } 145 + 146 + int snd_wav_init (sound_drv_t *sdrv, const char *name) 147 + { 148 + char *wav; 149 + 150 + sdrv->wav_fp = NULL; 151 + sdrv->wav_cnt = 0; 152 + 153 + wav = drv_get_option (name, "wav"); 154 + 155 + if (wav == NULL) { 156 + return (0); 157 + } 158 + 159 + if (*wav == 0) { 160 + return (0); 161 + } 162 + 163 + sdrv->wav_fp = fopen (wav, "wb"); 164 + 165 + free (wav); 166 + 167 + if (sdrv->wav_fp == NULL) { 168 + return (1); 169 + } 170 + 171 + return (0); 172 + }
+37
src/drivers/sound/sound-wav.h
··· 1 + /***************************************************************************** 2 + * pce * 3 + *****************************************************************************/ 4 + 5 + /***************************************************************************** 6 + * File name: src/drivers/sound/sound-wav.h * 7 + * Created: 2009-10-18 by Hampa Hug <hampa@hampa.ch> * 8 + * Copyright: (C) 2009 Hampa Hug <hampa@hampa.ch> * 9 + *****************************************************************************/ 10 + 11 + /***************************************************************************** 12 + * This program is free software. You can redistribute it and / or modify it * 13 + * under the terms of the GNU General Public License version 2 as published * 14 + * by the Free Software Foundation. * 15 + * * 16 + * This program is distributed in the hope that it will be useful, but * 17 + * WITHOUT ANY WARRANTY, without even the implied warranty of * 18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * 19 + * Public License for more details. * 20 + *****************************************************************************/ 21 + 22 + 23 + #ifndef PCE_DRIVERS_SOUND_WAV_H 24 + #define PCE_DRIVERS_SOUND_WAV_H 1 25 + 26 + 27 + #include <drivers/sound/sound.h> 28 + 29 + 30 + void snd_wav_close (sound_drv_t *sdrv); 31 + int snd_wav_write (sound_drv_t *sdrv, const uint16_t *buf, unsigned cnt); 32 + int snd_wav_set_params (sound_drv_t *sdrv, unsigned chn, unsigned long srate, int sign); 33 + int snd_wav_set_params (sound_drv_t *sdrv, unsigned chn, unsigned long srate, int sign); 34 + int snd_wav_init (sound_drv_t *sdrv, const char *name); 35 + 36 + 37 + #endif
+435
src/drivers/sound/sound.c
··· 1 + /***************************************************************************** 2 + * pce * 3 + *****************************************************************************/ 4 + 5 + /***************************************************************************** 6 + * File name: src/drivers/sound/sound.c * 7 + * Created: 2009-10-17 by Hampa Hug <hampa@hampa.ch> * 8 + * Copyright: (C) 2009-2010 Hampa Hug <hampa@hampa.ch> * 9 + *****************************************************************************/ 10 + 11 + /***************************************************************************** 12 + * This program is free software. You can redistribute it and / or modify it * 13 + * under the terms of the GNU General Public License version 2 as published * 14 + * by the Free Software Foundation. * 15 + * * 16 + * This program is distributed in the hope that it will be useful, but * 17 + * WITHOUT ANY WARRANTY, without even the implied warranty of * 18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * 19 + * Public License for more details. * 20 + *****************************************************************************/ 21 + 22 + 23 + #include <config.h> 24 + 25 + #include <stdlib.h> 26 + #include <string.h> 27 + #include <math.h> 28 + 29 + #include <drivers/options.h> 30 + #include <drivers/sound/sound.h> 31 + #include <drivers/sound/sound-wav.h> 32 + 33 + 34 + #define SND_IIR_MUL 8192 35 + 36 + 37 + struct snd_drv_list { 38 + const char *prefix; 39 + sound_drv_t *(*open) (const char *name); 40 + }; 41 + 42 + static 43 + struct snd_drv_list drvtab[] = { 44 + { "null", snd_null_open }, 45 + { "wav", snd_null_open }, 46 + { NULL, NULL } 47 + }; 48 + 49 + 50 + void snd_iir2_init (sound_iir2_t *iir) 51 + { 52 + unsigned i; 53 + 54 + for (i = 0; i < 3; i++) { 55 + iir->a[i] = 0; 56 + iir->b[i] = 0; 57 + iir->x[i] = 0; 58 + iir->y[i] = 0; 59 + } 60 + 61 + iir->a[0] = SND_IIR_MUL; 62 + } 63 + 64 + void snd_iir2_reset (sound_iir2_t *iir) 65 + { 66 + iir->x[0] = 0; 67 + iir->x[1] = 0; 68 + iir->x[2] = 0; 69 + 70 + iir->y[0] = 0; 71 + iir->y[1] = 0; 72 + iir->y[2] = 0; 73 + } 74 + 75 + void snd_iir2_set_lowpass (sound_iir2_t *iir, unsigned long freq, unsigned long srate) 76 + { 77 + double om, b0; 78 + 79 + snd_iir2_init (iir); 80 + 81 + if ((freq == 0) || (srate == 0)) { 82 + return; 83 + } 84 + 85 + if ((2 * freq) >= srate) { 86 + freq = (srate / 2) - 1; 87 + } 88 + 89 + om = 1.0 / tan ((3.14159265358979312 * freq) / srate); 90 + b0 = om * (om + sqrt(2.0)) + 1.0; 91 + 92 + iir->a[0] = (long) (SND_IIR_MUL * 1.0 / b0); 93 + iir->a[1] = (long) (SND_IIR_MUL * 2.0 / b0); 94 + iir->a[2] = (long) (SND_IIR_MUL * 1.0 / b0); 95 + 96 + iir->b[0] = (long) (SND_IIR_MUL * 1.0); 97 + iir->b[1] = (long) (SND_IIR_MUL * 2.0 * (1.0 - om * om) / b0); 98 + iir->b[2] = (long) (SND_IIR_MUL * (om * (om - sqrt(2.0)) + 1.0) / b0); 99 + } 100 + 101 + void snd_iir2_filter (sound_iir2_t *iir, uint16_t *dst, const uint16_t *src, 102 + unsigned cnt, unsigned ofs, int sign) 103 + { 104 + long v; 105 + uint16_t sig; 106 + 107 + sig = sign ? 0x8000 : 0; 108 + 109 + while (cnt > 0) { 110 + v = *src ^ sig; 111 + v -= 32768; 112 + 113 + iir->x[2] = iir->x[1]; 114 + iir->x[1] = iir->x[0]; 115 + iir->x[0] = v; 116 + 117 + iir->y[2] = iir->y[1]; 118 + iir->y[1] = iir->y[0]; 119 + 120 + iir->y[0] = iir->a[0] * iir->x[0]; 121 + iir->y[0] += iir->a[1] * iir->x[1] + iir->a[2] * iir->x[2]; 122 + iir->y[0] -= iir->b[1] * iir->y[1] + iir->b[2] * iir->y[2]; 123 + 124 + iir->y[0] = iir->y[0] / SND_IIR_MUL; 125 + 126 + v = iir->y[0]; 127 + v += 32768; 128 + 129 + if (v < 0) { 130 + v = 0; 131 + } 132 + else if (v > 65535) { 133 + v = 0xffff; 134 + } 135 + else { 136 + v &= 0xffff; 137 + } 138 + 139 + *dst = ((uint16_t) v) ^ sig; 140 + 141 + src += ofs; 142 + dst += ofs; 143 + cnt -= 1; 144 + } 145 + } 146 + 147 + /* 148 + * Initialize the low-pass filter in sdrv->lowpass_iir2 with a cut-off 149 + * frequency of sdrv->lowpass_freq. 150 + */ 151 + static 152 + void snd_fix_lowpass (sound_drv_t *sdrv) 153 + { 154 + unsigned i; 155 + 156 + for (i = 0; i < sdrv->channels; i++) { 157 + snd_iir2_set_lowpass ( 158 + &sdrv->lowpass_iir2[i], 159 + sdrv->lowpass_freq, sdrv->sample_rate 160 + ); 161 + 162 + snd_iir2_reset (&sdrv->lowpass_iir2[i]); 163 + } 164 + } 165 + 166 + unsigned char *snd_get_bbuf (sound_drv_t *sdrv, unsigned long cnt) 167 + { 168 + unsigned char *tmp; 169 + 170 + if (cnt <= sdrv->bbuf_max) { 171 + return (sdrv->bbuf); 172 + } 173 + 174 + tmp = realloc (sdrv->bbuf, cnt); 175 + 176 + if (tmp == NULL) { 177 + return (NULL); 178 + } 179 + 180 + sdrv->bbuf = tmp; 181 + sdrv->bbuf_max = cnt; 182 + 183 + return (sdrv->bbuf); 184 + } 185 + 186 + uint16_t *snd_get_sbuf (sound_drv_t *sdrv, unsigned long cnt) 187 + { 188 + uint16_t *tmp; 189 + 190 + if (cnt <= sdrv->sbuf_max) { 191 + return (sdrv->sbuf); 192 + } 193 + 194 + tmp = realloc (sdrv->sbuf, cnt * sizeof (uint16_t)); 195 + 196 + if (tmp == NULL) { 197 + return (NULL); 198 + } 199 + 200 + sdrv->sbuf = tmp; 201 + sdrv->sbuf_max = cnt; 202 + 203 + return (sdrv->sbuf); 204 + } 205 + 206 + void snd_set_buf (unsigned char *dst, const uint16_t *src, unsigned long cnt, 207 + int sign, int be) 208 + { 209 + unsigned long i; 210 + uint16_t val, sig; 211 + 212 + sig = sign ? 0x8000 : 0x0000; 213 + 214 + if (be) { 215 + for (i = 0; i < cnt; i++) { 216 + val = *src ^ sig; 217 + 218 + dst[0] = (val >> 8) & 0xff; 219 + dst[1] = val & 0xff; 220 + 221 + dst += 2; 222 + src += 1; 223 + } 224 + } 225 + else { 226 + for (i = 0; i < cnt; i++) { 227 + val = *src ^ sig; 228 + 229 + dst[0] = val & 0xff; 230 + dst[1] = (val >> 8) & 0xff; 231 + 232 + dst += 2; 233 + src += 1; 234 + } 235 + } 236 + } 237 + 238 + void snd_init (sound_drv_t *sdrv, void *ext) 239 + { 240 + sdrv->ext = ext; 241 + 242 + sdrv->channels = 0; 243 + sdrv->sample_rate = 0; 244 + sdrv->sample_sign = 0; 245 + 246 + sdrv->lowpass_freq = 0; 247 + 248 + sdrv->bbuf_max = 0; 249 + sdrv->bbuf = NULL; 250 + 251 + sdrv->sbuf_max = 0; 252 + sdrv->sbuf = NULL; 253 + 254 + sdrv->wav_fp = NULL; 255 + sdrv->wav_cnt = 0; 256 + sdrv->wav_filter = 1; 257 + 258 + sdrv->close = NULL; 259 + 260 + sdrv->write = NULL; 261 + 262 + sdrv->set_params = NULL; 263 + } 264 + 265 + void snd_close (sound_drv_t *sdrv) 266 + { 267 + if (sdrv == NULL) { 268 + return; 269 + } 270 + 271 + snd_wav_close (sdrv); 272 + 273 + if (sdrv->close != NULL) { 274 + sdrv->close (sdrv); 275 + } 276 + 277 + if (sdrv->sbuf != NULL) { 278 + free (sdrv->sbuf); 279 + } 280 + 281 + if (sdrv->bbuf != NULL) { 282 + free (sdrv->bbuf); 283 + } 284 + } 285 + 286 + const uint16_t *snd_filter (sound_drv_t *sdrv, const uint16_t *buf, unsigned cnt) 287 + { 288 + unsigned i; 289 + unsigned long scnt; 290 + uint16_t *sbuf; 291 + 292 + if (sdrv->lowpass_freq == 0) { 293 + return (buf); 294 + } 295 + 296 + scnt = (unsigned long) sdrv->channels * (unsigned long) cnt; 297 + 298 + sbuf = snd_get_sbuf (sdrv, scnt); 299 + 300 + if (sbuf == NULL) { 301 + return (NULL); 302 + } 303 + 304 + for (i = 0; i < sdrv->channels; i++) { 305 + snd_iir2_filter ( 306 + &sdrv->lowpass_iir2[i], sbuf + i, buf + i, 307 + cnt, sdrv->channels, sdrv->sample_sign 308 + ); 309 + } 310 + 311 + return (sbuf); 312 + } 313 + 314 + int snd_write (sound_drv_t *sdrv, const uint16_t *buf, unsigned cnt) 315 + { 316 + int r; 317 + const uint16_t *sbuf; 318 + 319 + if ((sdrv == NULL) || (sdrv->write == NULL)) { 320 + return (1); 321 + } 322 + 323 + sbuf = snd_filter (sdrv, buf, cnt); 324 + 325 + r = sdrv->write (sdrv, sbuf, cnt); 326 + 327 + snd_wav_write (sdrv, sdrv->wav_filter ? sbuf : buf, cnt); 328 + 329 + return (r); 330 + } 331 + 332 + /* 333 + * Check if new parameters differ from current parameters. 334 + * Returns 0 if they differ. 335 + */ 336 + static 337 + int snd_check_params (sound_drv_t *sdrv, unsigned chn, unsigned long srate, int sign) 338 + { 339 + if (sdrv->channels != chn) { 340 + return (0); 341 + } 342 + 343 + if (sdrv->sample_rate != srate) { 344 + return (0); 345 + } 346 + 347 + if (sdrv->sample_sign != sign) { 348 + return (0); 349 + } 350 + 351 + return (1); 352 + } 353 + 354 + int snd_set_params (sound_drv_t *sdrv, unsigned chn, unsigned long srate, int sign) 355 + { 356 + if (sdrv == NULL) { 357 + return (1); 358 + } 359 + 360 + if (sdrv->set_params == NULL) { 361 + return (1); 362 + } 363 + 364 + sign = (sign != 0); 365 + 366 + if (chn > SND_CHN_MAX) { 367 + return (1); 368 + } 369 + if (snd_check_params (sdrv, chn, srate, sign)) { 370 + return (0); 371 + } 372 + 373 + if (sdrv->set_params (sdrv, chn, srate, sign)) { 374 + return (1); 375 + } 376 + 377 + sdrv->channels = chn; 378 + sdrv->sample_rate = srate; 379 + sdrv->sample_sign = sign; 380 + 381 + if (snd_wav_set_params (sdrv, chn, srate, sign)) { 382 + return (1); 383 + } 384 + 385 + snd_fix_lowpass (sdrv); 386 + 387 + return (0); 388 + } 389 + 390 + static 391 + sound_drv_t *snd_open_sdrv (sound_drv_t *sdrv, const char *name) 392 + { 393 + if (sdrv == NULL) { 394 + return (NULL); 395 + } 396 + 397 + if (snd_wav_init (sdrv, name)) { 398 + snd_close (sdrv); 399 + return (NULL); 400 + } 401 + 402 + sdrv->wav_filter = drv_get_option_bool (name, "wavfilter", 1); 403 + 404 + sdrv->lowpass_freq = drv_get_option_uint (name, "lowpass", 0); 405 + 406 + snd_fix_lowpass (sdrv); 407 + 408 + return (sdrv); 409 + } 410 + 411 + sound_drv_t *snd_open (const char *name) 412 + { 413 + unsigned i; 414 + const char *s, *d; 415 + 416 + i = 0; 417 + 418 + while (drvtab[i].prefix != NULL) { 419 + s = name; 420 + d = drvtab[i].prefix; 421 + 422 + while ((*d != 0) && (*d == *s)) { 423 + d += 1; 424 + s += 1; 425 + } 426 + 427 + if ((*d == 0) && ((*s == ':') || (*s == 0))) { 428 + return (snd_open_sdrv (drvtab[i].open (name), name)); 429 + } 430 + 431 + i += 1; 432 + } 433 + 434 + return (NULL); 435 + }
+181
src/drivers/sound/sound.h
··· 1 + /***************************************************************************** 2 + * pce * 3 + *****************************************************************************/ 4 + 5 + /***************************************************************************** 6 + * File name: src/drivers/sound/sound.h * 7 + * Created: 2009-10-17 by Hampa Hug <hampa@hampa.ch> * 8 + * Copyright: (C) 2009-2010 Hampa Hug <hampa@hampa.ch> * 9 + *****************************************************************************/ 10 + 11 + /***************************************************************************** 12 + * This program is free software. You can redistribute it and / or modify it * 13 + * under the terms of the GNU General Public License version 2 as published * 14 + * by the Free Software Foundation. * 15 + * * 16 + * This program is distributed in the hope that it will be useful, but * 17 + * WITHOUT ANY WARRANTY, without even the implied warranty of * 18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * 19 + * Public License for more details. * 20 + *****************************************************************************/ 21 + 22 + 23 + #ifndef PCE_DRIVERS_SOUND_SOUND_H 24 + #define PCE_DRIVERS_SOUND_SOUND_H 1 25 + 26 + 27 + #include <stdio.h> 28 + #include <stdint.h> 29 + 30 + 31 + #define SND_CHN_MAX 16 32 + 33 + 34 + /*!*************************************************************************** 35 + * @short A second order IIR filter 36 + *****************************************************************************/ 37 + typedef struct { 38 + long a[3]; 39 + long b[3]; 40 + long x[3]; 41 + long y[3]; 42 + } sound_iir2_t; 43 + 44 + 45 + /*!*************************************************************************** 46 + * @short The sound driver context 47 + *****************************************************************************/ 48 + typedef struct sound_drv_t { 49 + void *ext; 50 + 51 + unsigned channels; 52 + unsigned long sample_rate; 53 + int sample_sign; 54 + 55 + unsigned long lowpass_freq; 56 + sound_iir2_t lowpass_iir2[SND_CHN_MAX]; 57 + 58 + unsigned long bbuf_max; 59 + unsigned char *bbuf; 60 + 61 + unsigned long sbuf_max; 62 + uint16_t *sbuf; 63 + 64 + FILE *wav_fp; 65 + unsigned long wav_cnt; 66 + char wav_filter; 67 + 68 + void (*close) (struct sound_drv_t *sdrv); 69 + 70 + int (*write) (struct sound_drv_t *sdrv, const uint16_t *buf, unsigned cnt); 71 + 72 + int (*set_params) (struct sound_drv_t *sdrv, 73 + unsigned chn, unsigned long srate, int sign 74 + ); 75 + } sound_drv_t; 76 + 77 + 78 + /*!*************************************************************************** 79 + * @short Initialize an IIR2 filter 80 + *****************************************************************************/ 81 + void snd_iir2_init (sound_iir2_t *iir); 82 + 83 + /*!*************************************************************************** 84 + * @short Reset an IIR2 filter 85 + *****************************************************************************/ 86 + void snd_iir2_reset (sound_iir2_t *iir); 87 + 88 + /*!*************************************************************************** 89 + * @short Initialize a low-pass IIR filter 90 + * @param freq The cut-off frequency 91 + * @param srate The sample rate 92 + *****************************************************************************/ 93 + void snd_iir2_set_lowpass (sound_iir2_t *iir, 94 + unsigned long freq, unsigned long srate 95 + ); 96 + 97 + /*!*************************************************************************** 98 + * @short Filter samples with an IIR2 filter 99 + * @param dst The destination buffer 100 + * @param src The source buffer 101 + * @param cnt The sample count 102 + * @param ofs The sample offset in both src and dst 103 + * @param sign The sample signedness in both src and dst 104 + *****************************************************************************/ 105 + void snd_iir2_filter (sound_iir2_t *iir, 106 + uint16_t *dst, const uint16_t *src, unsigned cnt, unsigned ofs, int sign 107 + ); 108 + 109 + 110 + /*!*************************************************************************** 111 + * @short Get a temporary byte buffer 112 + * @param cnt The requested buffer size in bytes 113 + * 114 + * The buffer returned is sdrv->bbuf. Subsequent calls to this function 115 + * will invalidate the buffers returned by earlier calls. 116 + *****************************************************************************/ 117 + unsigned char *snd_get_bbuf (sound_drv_t *sdrv, unsigned long cnt); 118 + 119 + /*!*************************************************************************** 120 + * @short Get a temporary sample buffer 121 + * @param cnt The requested buffer size in samples 122 + * 123 + * The buffer returned is sdrv->sbuf. Subsequent calls to this function 124 + * will invalidate the buffers returned by earlier calls. 125 + *****************************************************************************/ 126 + uint16_t *snd_get_sbuf (sound_drv_t *sdrv, unsigned long cnt); 127 + 128 + /*!*************************************************************************** 129 + * @short Store samples in a byte buffer 130 + * @param dst The destination byte buffer of size (2 * cnt) 131 + * @param src The source sample buffer 132 + * @param cnt The number of samples in src 133 + * @param sign If true the sign of samples is inverted 134 + * @param be If true samples are stored in big endian format. 135 + *****************************************************************************/ 136 + void snd_set_buf (unsigned char *dst, const uint16_t *src, unsigned long cnt, 137 + int sign, int be 138 + ); 139 + 140 + 141 + void snd_init (sound_drv_t *sdrv, void *ext); 142 + 143 + void snd_close (sound_drv_t *sdrv); 144 + 145 + /*!*************************************************************************** 146 + * @short Filter samples 147 + * @param buf The source samples 148 + * @param cnt The number of samples in buf 149 + * 150 + * The samples in buf are filtered by sdrv->lowpass_iir2. The buffer returned 151 + * is sdrv->sbuf. 152 + *****************************************************************************/ 153 + const uint16_t *snd_filter (sound_drv_t *sdrv, const uint16_t *buf, unsigned cnt); 154 + 155 + /*!*************************************************************************** 156 + * @short Write samples 157 + * @param buf The sample buffer 158 + * @param cnt The sample count per channel 159 + * 160 + * The total number of samples in buf is (channels * cnt). 161 + *****************************************************************************/ 162 + int snd_write (sound_drv_t *sdrv, const uint16_t *buf, unsigned cnt); 163 + 164 + /*!*************************************************************************** 165 + * @short Set the sound parameters 166 + * @param chn The number of channels 167 + * @param srate The sample rate in Herz 168 + * @param sign If true, samples are signed otherwise unsigned 169 + * 170 + * This function must be called after snd_open() and before the first call 171 + * to snd_write(). 172 + *****************************************************************************/ 173 + int snd_set_params (sound_drv_t *sdrv, unsigned chn, unsigned long srate, int sign); 174 + 175 + 176 + sound_drv_t *snd_open (const char *name); 177 + 178 + sound_drv_t *snd_null_open (const char *name); 179 + 180 + 181 + #endif