Merge branch 'accurate' into portable

This commit is contained in:
Clownacy 2019-11-09 14:24:55 +00:00
commit 8344716548
7 changed files with 9 additions and 9 deletions

View file

@ -46,7 +46,7 @@ BOOL LoadConfigData(CONFIG *conf)
fclose(fp);
// Check if version is not correct, and return if it failed
if (strcmp(conf->proof, config_magic))
if (strcmp(conf->proof, config_magic) != 0)
{
memset(conf, 0, sizeof(CONFIG));
return FALSE;

View file

@ -6,9 +6,9 @@
// Macros for setting, un-setting and getting flags
// Each flag is stored in a bit, so we can use the exact same macros we'd use for bits
#define SET_FLAG(x, i) ((x)[(i) / 8] |= 1 << (i) % 8)
#define UNSET_FLAG(x, i) ((x)[(i) / 8] &= ~(1 << (i) % 8))
#define GET_FLAG(x, i) ((x)[(i) / 8] & (1 << (i) % 8))
#define SET_FLAG(x, i) ((x)[(i) / 8] |= 1 << ((i) % 8))
#define UNSET_FLAG(x, i) ((x)[(i) / 8] &= ~(1 << ((i) % 8)))
#define GET_FLAG(x, i) ((x)[(i) / 8] & (1 << ((i) % 8)))
unsigned char gFlagNPC[1000];
unsigned char gSkipFlag[8];

View file

@ -42,7 +42,7 @@ BOOL LoadMapData2(const char *path_map)
char check[3];
fread(check, 1, 3, fp);
if (memcmp(check, code_pxma, 3))
if (memcmp(check, code_pxma, 3) != 0)
{
fclose(fp);
return FALSE;

View file

@ -69,7 +69,7 @@ BOOL LoadEvent(const char *path_event)
// Read "PXE" check
char code[4];
fread(code, 1, 4, fp);
if (memcmp(code, gPassPixEve, 3))
if (memcmp(code, gPassPixEve, 3) != 0)
{
#ifdef FIX_BUGS
// The original game forgot to close the file here

View file

@ -137,7 +137,7 @@ BOOL LoadProfile(const char *name)
// Check header code
fread(profile.code, 8, 1, fp);
if (memcmp(profile.code, gProfileCode, 8))
if (memcmp(profile.code, gProfileCode, 8) != 0)
{
#ifdef FIX_BUGS
fclose(fp); // The original game forgets to close the file

View file

@ -250,7 +250,7 @@ MusicID gMusicNo;
void ChangeMusic(MusicID no)
{
if (no && no == gMusicNo)
if (no != MUS_SILENCE && no == gMusicNo)
return;
//Stop and keep track of old song

View file

@ -33,7 +33,7 @@
#include "Stage.h"
#include "Tags.h"
#define IS_COMMAND(c1, c2, c3) gTS.data[gTS.p_read + 1] == c1 && gTS.data[gTS.p_read + 2] == c2 && gTS.data[gTS.p_read + 3] == c3
#define IS_COMMAND(c1, c2, c3) (gTS.data[gTS.p_read + 1] == (c1) && gTS.data[gTS.p_read + 2] == (c2) && gTS.data[gTS.p_read + 3] == (c3))
#define TSC_BUFFER_SIZE 0x5000