From: S?bastien G. <kx...@us...> - 2004-05-20 21:01:58
|
Update of /cvsroot/vba/VisualBoyAdvance/src/sdl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6428/src/sdl Modified Files: Makefile.am Makefile.in SDL.cpp TestEmu.cpp Log Message: Updated env macros, using WIN32 when more appropriate. Added SDL_QUIT event support. VisualBoyAdvance.cfg is now installed in sysconfdir (*/etc). Index: Makefile.in =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/sdl/Makefile.in,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.in 13 May 2004 23:10:49 -0000 1.4 --- Makefile.in 20 May 2004 21:01:30 -0000 1.5 *************** *** 309,314 **** AM_CPPFLAGS = \ ! -I$(top_srcdir)/src \ ! -DSDL --- 309,315 ---- AM_CPPFLAGS = \ ! -I$(top_srcdir)/src \ ! -DSDL \ ! -DSYSCONFDIR=\"$(sysconfdir)\" Index: TestEmu.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/sdl/TestEmu.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestEmu.cpp 13 May 2004 23:52:35 -0000 1.3 --- TestEmu.cpp 20 May 2004 21:01:30 -0000 1.4 *************** *** 34,44 **** #include "gb/gbGlobals.h" ! #ifdef __GNUC__ ! #include <unistd.h> ! #define GETCWD getcwd ! #else ! #include <direct.h> ! #define GETCWD _getcwd ! #endif #ifdef MMX --- 34,44 ---- #include "gb/gbGlobals.h" ! #ifndef WIN32 ! # include <unistd.h> ! # define GETCWD getcwd ! #else // WIN32 ! # include <direct.h> ! # define GETCWD _getcwd ! #endif // WIN32 #ifdef MMX *************** *** 60,71 **** struct EmulatedSystem emulator; - static u8 COPYRIGHT[] = { - 0xa9, 0x96, 0x8c, 0x8a, 0x9e, 0x93, 0xbd, 0x90, 0x86, 0xbe, 0x9b, 0x89, - 0x9e, 0x91, 0x9c, 0x9a, 0xdf, 0xd7, 0xbc, 0xd6, 0xdf, 0xce, 0xc6, 0xc6, - 0xc6, 0xd3, 0xcd, 0xcf, 0xcf, 0xcf, 0xd3, 0xcd, 0xcf, 0xcf, 0xce, 0xdf, - 0x9d, 0x86, 0xdf, 0xb9, 0x90, 0x8d, 0x98, 0x90, 0x8b, 0x8b, 0x9a, 0x91, - 0x00 - }; - int systemRedShift = 0; int systemBlueShift = 16; --- 60,63 ---- *************** *** 138,146 **** { fprintf(stderr,"VisualBoyAdvance-Test version %s\n", VERSION); - #ifdef __GNUC__ - fprintf(stderr,"Linux version\n"); - #else - fprintf(stderr,"Windows version\n"); - #endif captureDir[0] = 0; --- 130,133 ---- Index: Makefile.am =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/sdl/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.am 13 May 2004 23:10:49 -0000 1.3 --- Makefile.am 20 May 2004 21:01:30 -0000 1.4 *************** *** 153,158 **** AM_CPPFLAGS = \ ! -I$(top_srcdir)/src \ ! -DSDL AM_CXXFLAGS = -fno-exceptions @SDL_CFLAGS@ --- 153,159 ---- AM_CPPFLAGS = \ ! -I$(top_srcdir)/src \ ! -DSDL \ ! -DSYSCONFDIR=\"$(sysconfdir)\" AM_CXXFLAGS = -fno-exceptions @SDL_CFLAGS@ Index: SDL.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/sdl/SDL.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SDL.cpp 13 May 2004 23:52:35 -0000 1.3 --- SDL.cpp 20 May 2004 21:01:30 -0000 1.4 *************** *** 40,59 **** #include "gb/gbGlobals.h" ! #ifdef __GNUC__ ! #include <unistd.h> ! #define GETCWD getcwd ! #else ! #include <direct.h> ! #define GETCWD _getcwd ! #endif #ifndef __GNUC__ ! #define HAVE_DECL_GETOPT 0 ! #define __STDC__ 1 ! #include "getopt.h" ! #else ! #define HAVE_DECL_GETOPT 1 ! #include "getopt.h" ! #endif #ifdef MMX --- 40,59 ---- #include "gb/gbGlobals.h" ! #ifndef WIN32 ! # include <unistd.h> ! # define GETCWD getcwd ! #else // WIN32 ! # include <direct.h> ! # define GETCWD _getcwd ! #endif // WIN32 #ifndef __GNUC__ ! # define HAVE_DECL_GETOPT 0 ! # define __STDC__ 1 ! # include "getopt.h" ! #else // ! __GNUC__ ! # define HAVE_DECL_GETOPT 1 ! # include "getopt.h" ! #endif // ! __GNUC__ #ifdef MMX *************** *** 128,139 **** }; - static u8 COPYRIGHT[] = { - 0xa9, 0x96, 0x8c, 0x8a, 0x9e, 0x93, 0xbd, 0x90, 0x86, 0xbe, 0x9b, 0x89, - 0x9e, 0x91, 0x9c, 0x9a, 0xdf, 0xd7, 0xbc, 0xd6, 0xdf, 0xce, 0xc6, 0xc6, - 0xc6, 0xd3, 0xcd, 0xcf, 0xcf, 0xcf, 0xd3, 0xcd, 0xcf, 0xcf, 0xce, 0xdf, - 0x9d, 0x86, 0xdf, 0xb9, 0x90, 0x8d, 0x98, 0x90, 0x8b, 0x8b, 0x9a, 0x91, - 0x00 - }; - SDL_Surface *surface = NULL; SDL_Overlay *overlay = NULL; --- 128,131 ---- *************** *** 871,892 **** char path[2048]; ! #ifdef __GNUC__ ! #define PATH_SEP ":" ! #define FILE_SEP '/' ! #define EXE_NAME "VisualBoyAdvance" ! #else #define PATH_SEP ";" #define FILE_SEP '\\' #define EXE_NAME "VisualBoyAdvance-SDL.exe" ! #endif ! fprintf(stderr, "Seaching for file %s\n", name); if(GETCWD(buffer, 2048)) { ! fprintf(stderr, "Searching current dir: %s\n", buffer); } ! FILE *f = fopen(name,"r"); ! if(f != NULL) { return f; --- 863,883 ---- char path[2048]; ! #ifdef WIN32 #define PATH_SEP ";" #define FILE_SEP '\\' #define EXE_NAME "VisualBoyAdvance-SDL.exe" ! #else // ! WIN32 ! #define PATH_SEP ":" ! #define FILE_SEP '/' ! #define EXE_NAME "VisualBoyAdvance" ! #endif // ! WIN32 ! fprintf(stderr, "Searching for file %s\n", name); if(GETCWD(buffer, 2048)) { ! fprintf(stderr, "Searching current directory: %s\n", buffer); } ! FILE *f = fopen(name, "r"); if(f != NULL) { return f; *************** *** 896,908 **** if(home != NULL) { ! fprintf(stderr, "Seaching home directory: %s\n", home); sprintf(path, "%s%c%s", home, FILE_SEP, name); f = fopen(path, "r"); ! ! if(f) return f; } ! #ifdef _MSC_VER home = getenv("USERPROFILE"); if(home != NULL) { --- 887,898 ---- if(home != NULL) { ! fprintf(stderr, "Searching home directory: %s\n", home); sprintf(path, "%s%c%s", home, FILE_SEP, name); f = fopen(path, "r"); ! if(f != NULL) return f; } ! #ifdef WIN32 home = getenv("USERPROFILE"); if(home != NULL) { *************** *** 910,918 **** sprintf(path, "%s%c%s", home, FILE_SEP, name); f = fopen(path, "r"); ! if(f) return f; } ! #endif ! if(!strchr(arg0, '/') && !strchr(arg0, '\\')) { --- 900,914 ---- sprintf(path, "%s%c%s", home, FILE_SEP, name); f = fopen(path, "r"); ! if(f != NULL) return f; } ! #else // ! WIN32 ! fprintf(stderr, "Searching system config directory: %s\n", SYSCONFDIR); ! sprintf(path, "%s%c%s", SYSCONFDIR, FILE_SEP, name); ! f = fopen(path, "r"); ! if(f != NULL) ! return f; ! #endif // ! WIN32 ! if(!strchr(arg0, '/') && !strchr(arg0, '\\')) { *************** *** 933,937 **** sprintf(path2, "%s%c%s", tok, FILE_SEP, name); f = fopen(path2, "r"); ! if(f) { fprintf(stderr, "Found at %s\n", path2); return f; --- 929,933 ---- sprintf(path2, "%s%c%s", tok, FILE_SEP, name); f = fopen(path2, "r"); ! if(f != NULL) { fprintf(stderr, "Found at %s\n", path2); return f; *************** *** 950,954 **** sprintf(path, "%s%c%s", buffer, FILE_SEP, name); f = fopen(path, "r"); ! if(f) return f; } --- 946,950 ---- sprintf(path, "%s%c%s", buffer, FILE_SEP, name); f = fopen(path, "r"); ! if(f != NULL) return f; } *************** *** 1659,1662 **** --- 1655,1661 ---- while(SDL_PollEvent(&event)) { switch(event.type) { + case SDL_QUIT: + emulating = 0; + break; case SDL_ACTIVEEVENT: if(pauseWhenInactive && (event.active.state & SDL_APPINPUTFOCUS)) { *************** *** 1934,1942 **** { fprintf(stderr,"VisualBoyAdvance-SDL version %s\n", VERSION); ! #ifdef __GNUC__ ! fprintf(stderr,"Linux version\n"); ! #else ! fprintf(stderr,"Windows version\n"); ! #endif arg0 = argv[0]; --- 1933,1937 ---- { fprintf(stderr,"VisualBoyAdvance-SDL version %s\n", VERSION); ! arg0 = argv[0]; |