Sanitized version hash. Moved WIP version box check to check AFTER previous version number is loaded.
This commit is contained in:
@@ -21,6 +21,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <zlib.h>
|
||||||
|
|
||||||
char *VERSION_STR;
|
char *VERSION_STR;
|
||||||
|
|
||||||
@@ -39,3 +40,9 @@ void placetime()
|
|||||||
strlen(VERSION_STR) -
|
strlen(VERSION_STR) -
|
||||||
strlen(__TIME__), __TIME__);
|
strlen(__TIME__), __TIME__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int version_hash()
|
||||||
|
{
|
||||||
|
return(~crc32(crc32(0, (const unsigned char *)__DATE__, strlen(__DATE__)), (const unsigned char *)__TIME__, strlen(__TIME__)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 vesa2_bfull,vesa2_btrcl,vesa2_btrcla,Init_2xSaIMMXW
|
||||||
EXTSYM ZsnesPage,V8Mode,GrayscaleMode,PrevWinMode,PrevFSMode,FrameSemaphore
|
EXTSYM ZsnesPage,V8Mode,GrayscaleMode,PrevWinMode,PrevFSMode,FrameSemaphore
|
||||||
EXTSYM _imp__GetLocalTime@4
|
EXTSYM _imp__GetLocalTime@4
|
||||||
|
EXTSYM DisplayWIPDisclaimer
|
||||||
|
|
||||||
; NOTE: For timing, Game60hzcall should be called at 50hz or 60hz (depending
|
; NOTE: For timing, Game60hzcall should be called at 50hz or 60hz (depending
|
||||||
; on romispal) after a call to InitPreGame and before DeInitPostGame are
|
; on romispal) after a call to InitPreGame and before DeInitPostGame are
|
||||||
@@ -100,11 +101,14 @@ NEWSYM SystemInit
|
|||||||
call ccmdline
|
call ccmdline
|
||||||
call tparms
|
call tparms
|
||||||
call preparedir
|
call preparedir
|
||||||
; call getblaster ; get set blaster environment
|
|
||||||
; cmp byte[Force8b],1
|
%ifndef __DEVELOPER__
|
||||||
; jne .noforce8b
|
pushad
|
||||||
|
call DisplayWIPDisclaimer
|
||||||
|
popad
|
||||||
|
%endif
|
||||||
|
|
||||||
mov byte[SBHDMA],1
|
mov byte[SBHDMA],1
|
||||||
;.noforce8b
|
|
||||||
pop es
|
pop es
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ extern "C" {
|
|||||||
#include <ddraw.h>
|
#include <ddraw.h>
|
||||||
#include <mmsystem.h>
|
#include <mmsystem.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <zlib.h>
|
|
||||||
}
|
}
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <dsound.h>
|
#include <dsound.h>
|
||||||
@@ -2072,10 +2071,6 @@ void initwinvideo(void)
|
|||||||
{
|
{
|
||||||
atexit(ExitFunction);
|
atexit(ExitFunction);
|
||||||
|
|
||||||
#ifndef __DEVELOPER__
|
|
||||||
DisplayWIPDisclaimer();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!QueryPerformanceFrequency((LARGE_INTEGER*)&freq)) return;
|
if (!QueryPerformanceFrequency((LARGE_INTEGER*)&freq)) return;
|
||||||
|
|
||||||
if (!RegisterWinClass())
|
if (!RegisterWinClass())
|
||||||
@@ -3140,29 +3135,20 @@ int CheckBatteryPercent()
|
|||||||
return((SysPowerStat.BatteryLifePercent == 255) ? -1 : SysPowerStat.BatteryLifePercent);
|
return((SysPowerStat.BatteryLifePercent == 255) ? -1 : SysPowerStat.BatteryLifePercent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern "C" unsigned int PrevBuildNum;
|
extern "C" unsigned int PrevBuildNum;
|
||||||
extern "C" char *VERSION_STR;
|
|
||||||
|
|
||||||
void DisplayWIPDisclaimer()
|
void DisplayWIPDisclaimer()
|
||||||
{
|
{
|
||||||
void placedate();
|
unsigned int version_hash();
|
||||||
void placetime();
|
unsigned int CurrentBuildNum = version_hash();
|
||||||
|
|
||||||
// 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);
|
|
||||||
|
|
||||||
if (CurrentBuildNum != PrevBuildNum)
|
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;
|
PrevBuildNum = CurrentBuildNum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user