diff --git a/zsnes/src/configure b/zsnes/src/configure index 70e245b2..bcc3cf26 100755 --- a/zsnes/src/configure +++ b/zsnes/src/configure @@ -536,7 +536,7 @@ fi echo -- Where is our compiler, and who are we compiling for? -CFLAGS="-pipe -I." +CFLAGS="-pipe -I. -Wall" # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 @@ -980,7 +980,6 @@ case "$target" in *-*-cygwin* | *-*-*ming*) CFLAGS="$CFLAGS -D__LINUX__" NFLAGS="$NFLAGS -D__LINUX__ -f win32" - ZSNESEXE=".exe" ;; *) { echo "configure: error: This Target is Not Supported" 1>&2; exit 1; } @@ -991,7 +990,7 @@ esac echo -- Do we have X, and where is it? Needed for Mesa Checking echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:995: checking how to run the C preprocessor" >&5 +echo "configure:994: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1006,13 +1005,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1015: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1023,13 +1022,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1032: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1040,13 +1039,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1050: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1075,7 +1074,7 @@ echo "$ac_t""$CPP" 1>&6 # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:1079: checking for X" >&5 +echo "configure:1078: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -1137,12 +1136,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1145: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1211,14 +1210,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -1351,7 +1350,7 @@ fi # Extract the first word of "sdl-config", so it can be a program name with args. set dummy sdl-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1355: checking for $ac_word" >&5 +echo "configure:1354: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SDL_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1386,7 +1385,7 @@ fi min_sdl_version=1.2.0 echo $ac_n "checking for SDL - version >= $min_sdl_version""... $ac_c" 1>&6 -echo "configure:1390: checking for SDL - version >= $min_sdl_version" >&5 +echo "configure:1389: checking for SDL - version >= $min_sdl_version" >&5 no_sdl="" if test "$SDL_CONFIG" = "no" ; then no_sdl=yes @@ -1410,7 +1409,7 @@ echo "configure:1390: checking for SDL - version >= $min_sdl_version" >&5 echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < @@ -1471,7 +1470,7 @@ int main (int argc, char *argv[]) EOF -if { (eval echo configure:1475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1505,7 +1504,7 @@ fi CFLAGS="$CFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" cat > conftest.$ac_ext < @@ -1520,7 +1519,7 @@ int main() { return 0; ; return 0; } EOF -if { (eval echo configure:1524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding SDL or finding the wrong" @@ -1557,10 +1556,10 @@ CFLAGS="$CFLAGS $SDL_CFLAGS" LDFLAGS="$LDFLAGS $SDL_LIBS" echo $ac_n "checking for zlib""... $ac_c" 1>&6 -echo "configure:1561: checking for zlib" >&5 +echo "configure:1560: checking for zlib" >&5 with_zlib=no cat > conftest.$ac_ext < @@ -1571,7 +1570,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* with_zlib=yes @@ -1597,11 +1596,11 @@ if test "${with_opengl+set}" = set; then fi echo $ac_n "checking for OpenGL support""... $ac_c" 1>&6 -echo "configure:1601: checking for OpenGL support" >&5 +echo "configure:1600: checking for OpenGL support" >&5 if test x$with_opengl != xno; then with_opengl=no cat > conftest.$ac_ext < @@ -1612,7 +1611,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* with_opengl=yes @@ -1640,11 +1639,11 @@ if test "${enable_png+set}" = set; then fi echo $ac_n "checking for libPNG support""... $ac_c" 1>&6 -echo "configure:1644: checking for libPNG support" >&5 +echo "configure:1643: checking for libPNG support" >&5 if test x$with_png != xno; then with_png=no cat > conftest.$ac_ext < @@ -1655,7 +1654,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1659: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* with_png=yes @@ -1681,24 +1680,24 @@ if test "${enable_debug+set}" = set; then fi echo $ac_n "checking if you want gdb friendly executable""... $ac_c" 1>&6 -echo "configure:1685: checking if you want gdb friendly executable" >&5 +echo "configure:1684: checking if you want gdb friendly executable" >&5 if test x$debug = xyes; then echo "$ac_t""yes" 1>&6 - CFLAGS="$CFLAGS -Wall -O0 -fno-omit-frame-pointer -ggdb3" - NFLAGS="$NFLAGS -g -s" - ZSNESEXE="zsnes-debug$ZSNESEXE" + CFLAGS="$CFLAGS -DDEBUG -O0 -fno-omit-frame-pointer -ggdb3" + NFLAGS="$NFLAGS -DDEBUG -g -s" + ZSNESEXE="zsnesd" else echo "$ac_t""no" 1>&6 CFLAGS="$CFLAGS -Os -ffast-math -fomit-frame-pointer -fschedule-insns2 -s" - ZSNESEXE="zsnes$ZSNESEXE" + ZSNESEXE="zsnes" fi echo $ac_n "checking which processor class to optimize for""... $ac_c" 1>&6 -echo "configure:1702: checking which processor class to optimize for" >&5 +echo "configure:1701: checking which processor class to optimize for" >&5 if test x$debug != xyes; then case "$target" in i486-*-*) @@ -1728,12 +1727,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1732: checking for $ac_hdr that defines DIR" >&5 +echo "configure:1731: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -1741,7 +1740,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1766,7 +1765,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1770: checking for opendir in -ldir" >&5 +echo "configure:1769: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1774,7 +1773,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1807,7 +1806,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1811: checking for opendir in -lx" >&5 +echo "configure:1810: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1815,7 +1814,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1849,12 +1848,12 @@ fi fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1853: checking for ANSI C header files" >&5 +echo "configure:1852: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1862,7 +1861,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1865: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1879,7 +1878,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1897,7 +1896,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1918,7 +1917,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1929,7 +1928,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1956,17 +1955,17 @@ for ac_hdr in fcntl.h limits.h malloc.h sys/ioctl.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1960: checking for $ac_hdr" >&5 +echo "configure:1959: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1970: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1969: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1994,12 +1993,12 @@ done echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1998: checking for working const" >&5 +echo "configure:1997: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2069,12 +2068,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2073: checking for size_t" >&5 +echo "configure:2072: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2102,12 +2101,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:2106: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:2105: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2116,7 +2115,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:2120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -2140,17 +2139,17 @@ for ac_hdr in sys/time.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2144: checking for $ac_hdr" >&5 +echo "configure:2143: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2154: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2153: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2465,7 +2464,6 @@ rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 echo -echo You may now type gmake to compile $ZSNESEXE -echo Please make sure you use gmake, as other makes tend not to function -echo correctly with zsnes\'s makefiles. +echo You may now run make to compile $ZSNESEXE +echo Make sure you use GNU make when compiling. diff --git a/zsnes/src/configure.in b/zsnes/src/configure.in index 5c6d075a..7c12c47b 100644 --- a/zsnes/src/configure.in +++ b/zsnes/src/configure.in @@ -15,7 +15,7 @@ dnl See also: remarks supplied in the debug checking area below AC_INIT(init.asm) echo -- Where is our compiler, and who are we compiling for? -CFLAGS="-pipe -I." +CFLAGS="-pipe -I. -Wall" AC_PROG_CC AC_PATH_PROG(NASMPATH,nasm,[AC_MSG_ERROR(nasm 0.98 is required)]) NFLAGS="$NFLAGS -w-orphan-labels" @@ -33,7 +33,6 @@ case "$target" in *-*-cygwin* | *-*-*ming*) CFLAGS="$CFLAGS -D__LINUX__" NFLAGS="$NFLAGS -D__LINUX__ -f win32" - ZSNESEXE=".exe" ;; *) AC_MSG_ERROR(This Target is Not Supported) @@ -124,9 +123,9 @@ if test x$debug = xyes; then dnl It is actually easier to debug zsnes with no optimization dnl enabled. - CFLAGS="$CFLAGS -Wall -O0 -fno-omit-frame-pointer -ggdb3" - NFLAGS="$NFLAGS -g -s" - ZSNESEXE="zsnes-debug$ZSNESEXE" + CFLAGS="$CFLAGS -DDEBUG -O0 -fno-omit-frame-pointer -ggdb3" + NFLAGS="$NFLAGS -DDEBUG -g -s" + ZSNESEXE="zsnesd" else AC_MSG_RESULT(no) @@ -136,7 +135,7 @@ else dnl effectivly use branch prediction. CFLAGS="$CFLAGS -Os -ffast-math -fomit-frame-pointer -fschedule-insns2 -s" - ZSNESEXE="zsnes$ZSNESEXE" + ZSNESEXE="zsnes" fi AC_MSG_CHECKING(which processor class to optimize for) @@ -181,7 +180,6 @@ AC_SUBST(GL_DRAW) AC_SUBST(NFLAGS) AC_OUTPUT(Makefile) echo -echo You may now type gmake to compile $ZSNESEXE -echo Please make sure you use gmake, as other makes tend not to function -echo correctly with zsnes\'s makefiles. +echo You may now run make to compile $ZSNESEXE +echo Make sure you use GNU make when compiling. diff --git a/zsnes/src/gblhdr.h b/zsnes/src/gblhdr.h index ece5135c..003b20b7 100644 --- a/zsnes/src/gblhdr.h +++ b/zsnes/src/gblhdr.h @@ -59,26 +59,19 @@ // General stdc header stuff, including memory.h stuff, like the fact that // memcpy, and memmove are easily definable... - #ifdef ZDOS - #define STDC_HEADERS - #endif - #ifdef _MSC_VER - #define STDC_HEADERS - #endif - #ifdef STDC_HEADERS #include #include #include - #else # ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy ((s), (d), (n)) #define memmove(d, s, n) bcopy ((s), (d), (n)) # endif - #endif // unistd.h stuff - #if HAVE_UNISTD_H + //#if HAVE_UNISTD_H + //Small hack for now + #if unix #include #include #endif diff --git a/zsnes/src/linux/gl_draw.c b/zsnes/src/linux/gl_draw.c index c8596821..0ed5c677 100644 --- a/zsnes/src/linux/gl_draw.c +++ b/zsnes/src/linux/gl_draw.c @@ -69,7 +69,7 @@ int gl_start(int width, int height, int req_depth, int FullScreen) return FALSE; } - glvidbuffer = malloc(512 * 512 * 2); + glvidbuffer = (unsigned short *) malloc(512 * 512 * sizeof(short)); gl_clearwin(); SDL_WarpMouse(SurfaceX / 4, SurfaceY / 4);