From d5382702c29431b5ce0cab53abdc9c242a97ac67 Mon Sep 17 00:00:00 2001 From: zeromus Date: Fri, 4 Dec 2009 06:49:24 +0000 Subject: [PATCH] try to rebuild fewer files when svn version changes --- desmume/ChangeLog | 2 + desmume/src/Makefile.am | 2 +- desmume/src/movie.cpp | 2 +- desmume/src/saves.cpp | 2 +- desmume/src/version.cpp | 92 +++++++++++++++++++++++++ desmume/src/version.h | 72 ++----------------- desmume/src/windows/AboutBox.cpp | 4 +- desmume/src/windows/DeSmuME_2005.vcproj | 4 ++ desmume/src/windows/console.cpp | 4 +- desmume/src/windows/main.cpp | 2 +- 10 files changed, 112 insertions(+), 74 deletions(-) create mode 100644 desmume/src/version.cpp diff --git a/desmume/ChangeLog b/desmume/ChangeLog index f85c41da2..a07377135 100644 --- a/desmume/ChangeLog +++ b/desmume/ChangeLog @@ -4,12 +4,14 @@ General/Core: bug: emulate keypad interrupt bug: fix dma address reloading bug: fix rom close memory corruption + bug: fix div and sqrt busy flag bug Graphics: bug: fix a mistakenly rendered OBJ window Windows: bug: fix 16bpp display + bug: more fixes to multi-gamepads enh: add EPX and EPX1.5X resize filters 0.9.4 -> 0.9.5 (r2437-r3075) diff --git a/desmume/src/Makefile.am b/desmume/src/Makefile.am index 5ee8cf0f7..17db3cd44 100644 --- a/desmume/src/Makefile.am +++ b/desmume/src/Makefile.am @@ -52,7 +52,7 @@ libdesmume_a_SOURCES = \ cheatSystem.cpp cheatSystem.h \ texcache.cpp texcache.h rasterize.cpp rasterize.h \ metaspu/metaspu.cpp metaspu/metaspu.h \ - version.h + version.cpp version.h if HAVE_ALSA libdesmume_a_SOURCES += mic_alsa.cpp diff --git a/desmume/src/movie.cpp b/desmume/src/movie.cpp index b96b8a268..86abdd7f0 100644 --- a/desmume/src/movie.cpp +++ b/desmume/src/movie.cpp @@ -167,7 +167,7 @@ void MovieRecord::dump(MovieData* md, EMUFILE* fp, int index) MovieData::MovieData() : version(MOVIE_VERSION) - , emuVersion(DESMUME_VERSION_NUMERIC) + , emuVersion(EMU_DESMUME_VERSION_NUMERIC()) , romChecksum(0) , rerecordCount(0) , binaryFlag(false) diff --git a/desmume/src/saves.cpp b/desmume/src/saves.cpp index c36dec417..41ee117d6 100644 --- a/desmume/src/saves.cpp +++ b/desmume/src/saves.cpp @@ -983,7 +983,7 @@ bool savestate_save(EMUFILE* outstream, int compressionLevel) outstream->fseek(0,SEEK_SET); outstream->fwrite(magic,16); write32le(SAVESTATE_VERSION,outstream); - write32le(DESMUME_VERSION_NUMERIC,outstream); //desmume version + write32le(EMU_DESMUME_VERSION_NUMERIC(),outstream); //desmume version write32le(len,outstream); //uncompressed length write32le(comprlen,outstream); //compressed length (-1 if it is not compressed) diff --git a/desmume/src/version.cpp b/desmume/src/version.cpp new file mode 100644 index 000000000..231a980da --- /dev/null +++ b/desmume/src/version.cpp @@ -0,0 +1,92 @@ +/* Copyright (C) 2009 DeSmuME team + + This file is part of DeSmuME + + DeSmuME is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DeSmuME is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DeSmuME; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +//todo - everyone will want to support this eventually, i suppose +#ifdef _MSC_VER +#include "svnrev.h" +#else +#ifdef SVN_REV +#define SVN_REV_STR SVN_REV +#else +#define SVN_REV_STR "" +#endif +#endif + +#define DESMUME_NAME "DeSmuME" + +#ifdef _WIN64 +#define DESMUME_PLATFORM_STRING " x64" +#else +#ifdef _WIN32 +#define DESMUME_PLATFORM_STRING " x86" +#else +#define DESMUME_PLATFORM_STRING "" +#endif +#endif + +#ifndef ENABLE_SSE2 + #ifndef ENABLE_SSE + #define DESMUME_CPUEXT_STRING " NOSSE" + #else + #define DESMUME_CPUEXT_STRING " NOSSE2" + #endif +#else +#define DESMUME_CPUEXT_STRING "" +#endif + +#ifdef DEVELOPER +#define DESMUME_FEATURE_STRING " dev+" +#else +#define DESMUME_FEATURE_STRING "" +#endif + +#ifdef DEBUG +#define DESMUME_SUBVERSION_STRING " debug" +#elif defined(PUBLIC_RELEASE) +#define DESMUME_SUBVERSION_STRING "" +#else +#define DESMUME_SUBVERSION_STRING " svn" SVN_REV_STR +#endif + +#ifdef __INTEL_COMPILER +#define DESMUME_COMPILER " (Intel) " +#define DESMUME_COMPILER_DETAIL " (Intel) " +#elif defined(_MSC_VER) +#define DESMUME_COMPILER "" +#define DESMUME_COMPILER_DETAIL " msvc " _Py_STRINGIZE(_MSC_VER) +#define _Py_STRINGIZE(X) _Py_STRINGIZE1((X)) +#define _Py_STRINGIZE1(X) _Py_STRINGIZE2 ## X +#define _Py_STRINGIZE2(X) #X +//re: http://72.14.203.104/search?q=cache:HG-okth5NGkJ:mail.python.org/pipermail/python-checkins/2002-November/030704.html+_msc_ver+compiler+version+string&hl=en&gl=us&ct=clnk&cd=5 +#else +// TODO: make for others compilers +#define DESMUME_COMPILER "" +#define DESMUME_COMPILER_DETAIL "" +#endif + +#define DESMUME_VERSION_NUMERIC 90600 +#define DESMUME_VERSION_STRING " " "0.9.6" DESMUME_SUBVERSION_STRING DESMUME_FEATURE_STRING DESMUME_PLATFORM_STRING DESMUME_CPUEXT_STRING DESMUME_COMPILER +#define DESMUME_NAME_AND_VERSION " " DESMUME_NAME DESMUME_VERSION_STRING + +u32 EMU_DESMUME_VERSION_NUMERIC() { return DESMUME_VERSION_NUMERIC; } +const char* EMU_DESMUME_VERSION_STRING() { return DESMUME_VERSION_STRING; } +const char* EMU_DESMUME_NAME_AND_VERSION() { return DESMUME_NAME_AND_VERSION; } +const char* EMU_DESMUME_COMPILER_DETAIL() { return DESMUME_COMPILER_DETAIL; } \ No newline at end of file diff --git a/desmume/src/version.h b/desmume/src/version.h index 0c2f54bae..9adebfd96 100644 --- a/desmume/src/version.h +++ b/desmume/src/version.h @@ -17,70 +17,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#include -//todo - everyone will want to support this eventually, i suppose -#ifdef _MSC_VER -#include "svnrev.h" -#else -#ifdef SVN_REV -#define SVN_REV_STR SVN_REV -#else -#define SVN_REV_STR "" -#endif -#endif - -#define DESMUME_NAME "DeSmuME" - -#ifdef _WIN64 -#define DESMUME_PLATFORM_STRING " x64" -#else -#ifdef _WIN32 -#define DESMUME_PLATFORM_STRING " x86" -#else -#define DESMUME_PLATFORM_STRING "" -#endif -#endif - -#ifndef ENABLE_SSE2 - #ifndef ENABLE_SSE - #define DESMUME_CPUEXT_STRING " NOSSE" - #else - #define DESMUME_CPUEXT_STRING " NOSSE2" - #endif -#else -#define DESMUME_CPUEXT_STRING "" -#endif - -#ifdef DEVELOPER -#define DESMUME_FEATURE_STRING " dev+" -#else -#define DESMUME_FEATURE_STRING "" -#endif - -#ifdef DEBUG -#define DESMUME_SUBVERSION_STRING " debug" -#elif defined(PUBLIC_RELEASE) -#define DESMUME_SUBVERSION_STRING "" -#else -#define DESMUME_SUBVERSION_STRING " svn" SVN_REV_STR -#endif - -#ifdef __INTEL_COMPILER -#define DESMUME_COMPILER " (Intel) " -#define DESMUME_COMPILER_DETAIL " (Intel) " -#elif defined(_MSC_VER) -#define DESMUME_COMPILER "" -#define DESMUME_COMPILER_DETAIL " msvc " _Py_STRINGIZE(_MSC_VER) -#define _Py_STRINGIZE(X) _Py_STRINGIZE1((X)) -#define _Py_STRINGIZE1(X) _Py_STRINGIZE2 ## X -#define _Py_STRINGIZE2(X) #X -//re: http://72.14.203.104/search?q=cache:HG-okth5NGkJ:mail.python.org/pipermail/python-checkins/2002-November/030704.html+_msc_ver+compiler+version+string&hl=en&gl=us&ct=clnk&cd=5 -#else -// TODO: make for others compilers -#define DESMUME_COMPILER "" -#define DESMUME_COMPILER_DETAIL "" -#endif - -#define DESMUME_VERSION_NUMERIC 90600 -#define DESMUME_VERSION_STRING " " "0.9.6" DESMUME_SUBVERSION_STRING DESMUME_FEATURE_STRING DESMUME_PLATFORM_STRING DESMUME_CPUEXT_STRING DESMUME_COMPILER -#define DESMUME_NAME_AND_VERSION " " DESMUME_NAME DESMUME_VERSION_STRING +u32 EMU_DESMUME_VERSION_NUMERIC(); +const char* EMU_DESMUME_VERSION_STRING(); +const char* EMU_DESMUME_NAME_AND_VERSION(); +const char* EMU_DESMUME_COMPILER_DETAIL(); \ No newline at end of file diff --git a/desmume/src/windows/AboutBox.cpp b/desmume/src/windows/AboutBox.cpp index 068db7409..15227edb2 100644 --- a/desmume/src/windows/AboutBox.cpp +++ b/desmume/src/windows/AboutBox.cpp @@ -87,8 +87,8 @@ BOOL CALLBACK AboutBox_Proc (HWND dialog, UINT message,WPARAM wparam,LPARAM lpar { char buf[2048]; memset(buf, 0, sizeof(buf)); - wsprintf(buf, "version %s", DESMUME_VERSION_STRING DESMUME_COMPILER_DETAIL); - SetDlgItemText(dialog, IDC_TXT_VERSION, buf); + std::string version = (std::string)"version " + EMU_DESMUME_VERSION_STRING() + EMU_DESMUME_COMPILER_DETAIL(); + SetDlgItemText(dialog, IDC_TXT_VERSION, version.c_str()); memset(buf, 0, sizeof(buf)); wsprintf(buf, "compiled: %s %s", __DATE__,__TIME__); diff --git a/desmume/src/windows/DeSmuME_2005.vcproj b/desmume/src/windows/DeSmuME_2005.vcproj index 4b17c743f..19bdb8552 100644 --- a/desmume/src/windows/DeSmuME_2005.vcproj +++ b/desmume/src/windows/DeSmuME_2005.vcproj @@ -1654,6 +1654,10 @@ RelativePath="..\types.h" > + + diff --git a/desmume/src/windows/console.cpp b/desmume/src/windows/console.cpp index ea50df9a0..ebc59f4ab 100644 --- a/desmume/src/windows/console.cpp +++ b/desmume/src/windows/console.cpp @@ -78,7 +78,7 @@ void OpenConsole() *stderr = *fp; memset(buf,0,256); - sprintf(buf,"%s OUTPUT", DESMUME_NAME_AND_VERSION); + sprintf(buf,"%s OUTPUT", EMU_DESMUME_NAME_AND_VERSION()); SetConsoleTitle(TEXT(buf)); csize.X = 60; csize.Y = 800; @@ -91,7 +91,7 @@ void OpenConsole() SetConsoleCP(GetACP()); SetConsoleOutputCP(GetACP()); if(attached) printlog("\n"); - printlog("%s\n",DESMUME_NAME_AND_VERSION); + printlog("%s\n",EMU_DESMUME_NAME_AND_VERSION()); printlog("- compiled: %s %s\n\n",__DATE__,__TIME__); diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index e987f73fe..6382230cd 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -2292,7 +2292,7 @@ int _main() SetProcessAffinityMask(GetCurrentProcess(),1); MainWindow = new WINCLASS(CLASSNAME, hAppInst); - if (!MainWindow->create(DESMUME_NAME_AND_VERSION, WndX, WndY, video.width,video.height+video.screengap, + if (!MainWindow->create((char*)EMU_DESMUME_NAME_AND_VERSION(), WndX, WndY, video.width,video.height+video.screengap, WS_CAPTION| WS_SYSMENU | WS_SIZEBOX | WS_MINIMIZEBOX | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, NULL)) {