Changed some things to BOOL/BOOLEAN, for ASM-accuracy

This commit is contained in:
Clownacy 2019-02-22 22:23:57 +00:00
parent 923749e41e
commit 3e5f44f8de
6 changed files with 33 additions and 29 deletions

View file

@ -16,7 +16,7 @@
#include "MyChar.h"
#include "Stage.h"
int8_t gMapping[0x80];
BOOLEAN gMapping[0x80];
void WriteMiniMapLine(int line)
{
@ -196,17 +196,17 @@ int MiniMapLoop()
return 1;
}
bool IsMapping()
BOOL IsMapping()
{
return gMapping[gStageNo] != 0;
return gMapping[gStageNo];
}
void StartMapping()
{
memset(gMapping, 0, 0x80u);
memset(gMapping, FALSE, 0x80);
}
void SetMapping(int a)
{
gMapping[a] = 1;
gMapping[a] = TRUE;
}

View file

@ -2,9 +2,11 @@
#include <stdint.h>
extern int8_t gMapping[0x80];
#include "WindowsWrapper.h"
extern BOOLEAN gMapping[0x80];
int MiniMapLoop();
bool IsMapping();
BOOL IsMapping();
void StartMapping();
void SetMapping(int a);

View file

@ -594,26 +594,26 @@ void GetNpCharPosition(int *x, int *y, int i)
*y = gNPC[i].y;
}
bool IsNpCharCode(int code)
BOOL IsNpCharCode(int code)
{
for (int i = 0; i < NPC_MAX; i++)
{
if ((gNPC[i].cond & 0x80) && gNPC[i].code_char == code)
return true;
return TRUE;
}
return false;
return FALSE;
}
bool GetNpCharAlive(int code_event)
BOOL GetNpCharAlive(int code_event)
{
for (int i = 0; i < NPC_MAX; i++)
{
if ((gNPC[i].cond & 0x80) && gNPC[i].code_event == code_event)
return true;
return TRUE;
}
return false;
return FALSE;
}
int CountAliveNpChar()

View file

@ -101,6 +101,6 @@ void BackStepMyChar(int code_event);
void DeleteNpCharEvent(int code);
void DeleteNpCharCode(int code, bool bSmoke);
void GetNpCharPosition(int *x, int *y, int i);
bool IsNpCharCode(int code);
bool GetNpCharAlive(int code_event);
BOOL IsNpCharCode(int code);
BOOL GetNpCharAlive(int code_event);
int CountAliveNpChar();

View file

@ -129,12 +129,12 @@ const STAGE_TABLE gTMT[95] = {
STAGE_ENTRY("Oside", "Clock", 6, "bkMoon", "Moon", "0", 0, "Clock Room", "ŽžŒv‰®"),
};
bool TransferStage(int no, int w, int x, int y)
BOOL TransferStage(int no, int w, int x, int y)
{
//Move character
SetMyCharPosition(x << 13, y << 13);
bool bError = false;
BOOL bError = FALSE;
//Get path
char path_dir[20];
@ -144,31 +144,31 @@ bool TransferStage(int no, int w, int x, int y)
char path[PATH_LENGTH];
sprintf(path, "%s/Prt%s", path_dir, gTMT[no].parts);
if (!ReloadBitmap_File(path, SURFACE_ID_LEVEL_TILESET))
bError = true;
bError = TRUE;
sprintf(path, "%s/%s.pxa", path_dir, gTMT[no].parts);
if (!LoadAttributeData(path))
bError = true;
bError = TRUE;
//Load tilemap
sprintf(path, "%s/%s.pxm", path_dir, gTMT[no].map);
if (!LoadMapData2(path))
bError = true;
bError = TRUE;
//Load NPCs
sprintf(path, "%s/%s.pxe", path_dir, gTMT[no].map);
if (!LoadEvent(path))
bError = true;
bError = TRUE;
//Load script
sprintf(path, "%s/%s.tsc", path_dir, gTMT[no].map);
if (!LoadTextScript_Stage(path))
bError = true;
bError = TRUE;
//Load background
strcpy(path, gTMT[no].back);
if (!InitBack(path, gTMT[no].bkType))
bError = true;
bError = TRUE;
//Get path
strcpy(path_dir, "Npc");
@ -176,16 +176,16 @@ bool TransferStage(int no, int w, int x, int y)
//Load NPC sprite sheets
sprintf(path, "%s/Npc%s", path_dir, gTMT[no].npc);
if (!ReloadBitmap_File(path, SURFACE_ID_LEVEL_SPRITESET_1))
bError = true;
bError = TRUE;
sprintf(path, "%s/Npc%s", path_dir, gTMT[no].boss);
if (!ReloadBitmap_File(path, SURFACE_ID_LEVEL_SPRITESET_2))
bError = true;
bError = TRUE;
if (bError)
{
printf("Failed to load stage %d\n", no);
return false;
return FALSE;
}
else
{
@ -201,10 +201,10 @@ bool TransferStage(int no, int w, int x, int y)
InitBossChar(gTMT[no].boss_no);
ResetFlash();
gStageNo = no;
return true;
return TRUE;
}
return false;
return FALSE;
}
//Music

View file

@ -1,5 +1,7 @@
#pragma once
#include "WindowsWrapper.h"
struct STAGE_TABLE
{
char parts[0x20];
@ -15,6 +17,6 @@ struct STAGE_TABLE
extern int gStageNo;
extern int gMusicNo;
bool TransferStage(int no, int w, int x, int y);
BOOL TransferStage(int no, int w, int x, int y);
void ChangeMusic(int no);
void ReCallMusic();