Sanitized version hash. Moved WIP version box check to check AFTER previous version number is loaded.

This commit is contained in:
n-a-c-h
2006-02-14 21:52:18 +00:00
parent 2e8439b0f5
commit 6d37656f82
3 changed files with 22 additions and 25 deletions

View File

@@ -21,6 +21,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <string.h>
#include <zlib.h>
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__)));
}

View File

@@ -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

View File

@@ -29,7 +29,6 @@ extern "C" {
#include <ddraw.h>
#include <mmsystem.h>
#include <time.h>
#include <zlib.h>
}
#include <math.h>
#include <dsound.h>
@@ -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;
}
}