diff --git a/zsnes/src/version.c b/zsnes/src/version.c index ed7474be..7c9e7b66 100644 --- a/zsnes/src/version.c +++ b/zsnes/src/version.c @@ -21,6 +21,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include +#include char *VERSION_STR; @@ -39,3 +40,9 @@ void placetime() strlen(VERSION_STR) - strlen(__TIME__), __TIME__); } + +unsigned int version_hash() +{ + return(~crc32(crc32(0, (const unsigned char *)__DATE__, strlen(__DATE__)), (const unsigned char *)__TIME__, strlen(__TIME__))); +} + diff --git a/zsnes/src/win/winintrf.asm b/zsnes/src/win/winintrf.asm index 12e0bf85..55ccff31 100644 --- a/zsnes/src/win/winintrf.asm +++ b/zsnes/src/win/winintrf.asm @@ -48,6 +48,7 @@ EXTSYM vesa2_rfull,vesa2_rtrcl,vesa2_rtrcla,vesa2_gfull,vesa2_gtrcl,vesa2_gtrcla EXTSYM vesa2_bfull,vesa2_btrcl,vesa2_btrcla,Init_2xSaIMMXW EXTSYM ZsnesPage,V8Mode,GrayscaleMode,PrevWinMode,PrevFSMode,FrameSemaphore EXTSYM _imp__GetLocalTime@4 +EXTSYM DisplayWIPDisclaimer ; NOTE: For timing, Game60hzcall should be called at 50hz or 60hz (depending ; on romispal) after a call to InitPreGame and before DeInitPostGame are @@ -100,11 +101,14 @@ NEWSYM SystemInit call ccmdline call tparms call preparedir -; call getblaster ; get set blaster environment -; cmp byte[Force8b],1 -; jne .noforce8b + +%ifndef __DEVELOPER__ + pushad + call DisplayWIPDisclaimer + popad +%endif + mov byte[SBHDMA],1 -;.noforce8b pop es ret diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index b497441f..ab5ac332 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -29,7 +29,6 @@ extern "C" { #include #include #include - #include } #include #include @@ -2072,10 +2071,6 @@ void initwinvideo(void) { atexit(ExitFunction); -#ifndef __DEVELOPER__ - DisplayWIPDisclaimer(); -#endif - if (!QueryPerformanceFrequency((LARGE_INTEGER*)&freq)) return; if (!RegisterWinClass()) @@ -3140,29 +3135,20 @@ int CheckBatteryPercent() return((SysPowerStat.BatteryLifePercent == 255) ? -1 : SysPowerStat.BatteryLifePercent); } + extern "C" unsigned int PrevBuildNum; -extern "C" char *VERSION_STR; void DisplayWIPDisclaimer() { - void placedate(); - void placetime(); - - // This stupid function calculates a build hash based on the build date - - unsigned int ver_len = strlen(__DATE__) + strlen(__TIME__) + 15; //+15 because some names are longer than others - - VERSION_STR = (char *)malloc(ver_len); - *VERSION_STR = 0; - placedate(); - placetime(); - - unsigned int CurrentBuildNum = ~crc32(0, (const unsigned char *)VERSION_STR, ver_len); - free(VERSION_STR); + unsigned int version_hash(); + unsigned int CurrentBuildNum = version_hash(); if (CurrentBuildNum != PrevBuildNum) { - MessageBox(NULL, "This build of ZSNES is a WORK IN PROGRESS. This means that it is known to contain bugs and certain features\nmay or may not be working correctly. This build is not any representation of final work and is provided AS IS\nfor people to try bleeding edge code.\n\nPlease see http://zsnes.game-host.org/~pagefault/ for a list of current issues.", "Disclaimer", MB_OK); + char text[1024]; + sprintf(text, "%s Current: %x; Old: %x\n", "This build of ZSNES is a WORK IN PROGRESS. This means that it is known to contain bugs and certain features\nmay or may not be working correctly. This build is not any representation of final work and is provided AS IS\nfor people to try bleeding edge code.\n\nPlease see http://zsnes.game-host.org/~pagefault/ for a list of current issues.", CurrentBuildNum, PrevBuildNum); + + MessageBox(NULL, text, "Disclaimer", MB_OK); PrevBuildNum = CurrentBuildNum; } }