Changed some things to BOOL/BOOLEAN, for ASM-accuracy
This commit is contained in:
parent
923749e41e
commit
3e5f44f8de
6 changed files with 33 additions and 29 deletions
|
@ -16,7 +16,7 @@
|
||||||
#include "MyChar.h"
|
#include "MyChar.h"
|
||||||
#include "Stage.h"
|
#include "Stage.h"
|
||||||
|
|
||||||
int8_t gMapping[0x80];
|
BOOLEAN gMapping[0x80];
|
||||||
|
|
||||||
void WriteMiniMapLine(int line)
|
void WriteMiniMapLine(int line)
|
||||||
{
|
{
|
||||||
|
@ -196,17 +196,17 @@ int MiniMapLoop()
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsMapping()
|
BOOL IsMapping()
|
||||||
{
|
{
|
||||||
return gMapping[gStageNo] != 0;
|
return gMapping[gStageNo];
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartMapping()
|
void StartMapping()
|
||||||
{
|
{
|
||||||
memset(gMapping, 0, 0x80u);
|
memset(gMapping, FALSE, 0x80);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetMapping(int a)
|
void SetMapping(int a)
|
||||||
{
|
{
|
||||||
gMapping[a] = 1;
|
gMapping[a] = TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,11 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
extern int8_t gMapping[0x80];
|
#include "WindowsWrapper.h"
|
||||||
|
|
||||||
|
extern BOOLEAN gMapping[0x80];
|
||||||
|
|
||||||
int MiniMapLoop();
|
int MiniMapLoop();
|
||||||
bool IsMapping();
|
BOOL IsMapping();
|
||||||
void StartMapping();
|
void StartMapping();
|
||||||
void SetMapping(int a);
|
void SetMapping(int a);
|
||||||
|
|
|
@ -594,26 +594,26 @@ void GetNpCharPosition(int *x, int *y, int i)
|
||||||
*y = gNPC[i].y;
|
*y = gNPC[i].y;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsNpCharCode(int code)
|
BOOL IsNpCharCode(int code)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < NPC_MAX; i++)
|
for (int i = 0; i < NPC_MAX; i++)
|
||||||
{
|
{
|
||||||
if ((gNPC[i].cond & 0x80) && gNPC[i].code_char == code)
|
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++)
|
for (int i = 0; i < NPC_MAX; i++)
|
||||||
{
|
{
|
||||||
if ((gNPC[i].cond & 0x80) && gNPC[i].code_event == code_event)
|
if ((gNPC[i].cond & 0x80) && gNPC[i].code_event == code_event)
|
||||||
return true;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CountAliveNpChar()
|
int CountAliveNpChar()
|
||||||
|
|
|
@ -101,6 +101,6 @@ void BackStepMyChar(int code_event);
|
||||||
void DeleteNpCharEvent(int code);
|
void DeleteNpCharEvent(int code);
|
||||||
void DeleteNpCharCode(int code, bool bSmoke);
|
void DeleteNpCharCode(int code, bool bSmoke);
|
||||||
void GetNpCharPosition(int *x, int *y, int i);
|
void GetNpCharPosition(int *x, int *y, int i);
|
||||||
bool IsNpCharCode(int code);
|
BOOL IsNpCharCode(int code);
|
||||||
bool GetNpCharAlive(int code_event);
|
BOOL GetNpCharAlive(int code_event);
|
||||||
int CountAliveNpChar();
|
int CountAliveNpChar();
|
||||||
|
|
|
@ -129,12 +129,12 @@ const STAGE_TABLE gTMT[95] = {
|
||||||
STAGE_ENTRY("Oside", "Clock", 6, "bkMoon", "Moon", "0", 0, "Clock Room", "ŽžŒv‰®"),
|
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
|
//Move character
|
||||||
SetMyCharPosition(x << 13, y << 13);
|
SetMyCharPosition(x << 13, y << 13);
|
||||||
|
|
||||||
bool bError = false;
|
BOOL bError = FALSE;
|
||||||
|
|
||||||
//Get path
|
//Get path
|
||||||
char path_dir[20];
|
char path_dir[20];
|
||||||
|
@ -144,31 +144,31 @@ bool TransferStage(int no, int w, int x, int y)
|
||||||
char path[PATH_LENGTH];
|
char path[PATH_LENGTH];
|
||||||
sprintf(path, "%s/Prt%s", path_dir, gTMT[no].parts);
|
sprintf(path, "%s/Prt%s", path_dir, gTMT[no].parts);
|
||||||
if (!ReloadBitmap_File(path, SURFACE_ID_LEVEL_TILESET))
|
if (!ReloadBitmap_File(path, SURFACE_ID_LEVEL_TILESET))
|
||||||
bError = true;
|
bError = TRUE;
|
||||||
|
|
||||||
sprintf(path, "%s/%s.pxa", path_dir, gTMT[no].parts);
|
sprintf(path, "%s/%s.pxa", path_dir, gTMT[no].parts);
|
||||||
if (!LoadAttributeData(path))
|
if (!LoadAttributeData(path))
|
||||||
bError = true;
|
bError = TRUE;
|
||||||
|
|
||||||
//Load tilemap
|
//Load tilemap
|
||||||
sprintf(path, "%s/%s.pxm", path_dir, gTMT[no].map);
|
sprintf(path, "%s/%s.pxm", path_dir, gTMT[no].map);
|
||||||
if (!LoadMapData2(path))
|
if (!LoadMapData2(path))
|
||||||
bError = true;
|
bError = TRUE;
|
||||||
|
|
||||||
//Load NPCs
|
//Load NPCs
|
||||||
sprintf(path, "%s/%s.pxe", path_dir, gTMT[no].map);
|
sprintf(path, "%s/%s.pxe", path_dir, gTMT[no].map);
|
||||||
if (!LoadEvent(path))
|
if (!LoadEvent(path))
|
||||||
bError = true;
|
bError = TRUE;
|
||||||
|
|
||||||
//Load script
|
//Load script
|
||||||
sprintf(path, "%s/%s.tsc", path_dir, gTMT[no].map);
|
sprintf(path, "%s/%s.tsc", path_dir, gTMT[no].map);
|
||||||
if (!LoadTextScript_Stage(path))
|
if (!LoadTextScript_Stage(path))
|
||||||
bError = true;
|
bError = TRUE;
|
||||||
|
|
||||||
//Load background
|
//Load background
|
||||||
strcpy(path, gTMT[no].back);
|
strcpy(path, gTMT[no].back);
|
||||||
if (!InitBack(path, gTMT[no].bkType))
|
if (!InitBack(path, gTMT[no].bkType))
|
||||||
bError = true;
|
bError = TRUE;
|
||||||
|
|
||||||
//Get path
|
//Get path
|
||||||
strcpy(path_dir, "Npc");
|
strcpy(path_dir, "Npc");
|
||||||
|
@ -176,16 +176,16 @@ bool TransferStage(int no, int w, int x, int y)
|
||||||
//Load NPC sprite sheets
|
//Load NPC sprite sheets
|
||||||
sprintf(path, "%s/Npc%s", path_dir, gTMT[no].npc);
|
sprintf(path, "%s/Npc%s", path_dir, gTMT[no].npc);
|
||||||
if (!ReloadBitmap_File(path, SURFACE_ID_LEVEL_SPRITESET_1))
|
if (!ReloadBitmap_File(path, SURFACE_ID_LEVEL_SPRITESET_1))
|
||||||
bError = true;
|
bError = TRUE;
|
||||||
|
|
||||||
sprintf(path, "%s/Npc%s", path_dir, gTMT[no].boss);
|
sprintf(path, "%s/Npc%s", path_dir, gTMT[no].boss);
|
||||||
if (!ReloadBitmap_File(path, SURFACE_ID_LEVEL_SPRITESET_2))
|
if (!ReloadBitmap_File(path, SURFACE_ID_LEVEL_SPRITESET_2))
|
||||||
bError = true;
|
bError = TRUE;
|
||||||
|
|
||||||
if (bError)
|
if (bError)
|
||||||
{
|
{
|
||||||
printf("Failed to load stage %d\n", no);
|
printf("Failed to load stage %d\n", no);
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -201,10 +201,10 @@ bool TransferStage(int no, int w, int x, int y)
|
||||||
InitBossChar(gTMT[no].boss_no);
|
InitBossChar(gTMT[no].boss_no);
|
||||||
ResetFlash();
|
ResetFlash();
|
||||||
gStageNo = no;
|
gStageNo = no;
|
||||||
return true;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Music
|
//Music
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "WindowsWrapper.h"
|
||||||
|
|
||||||
struct STAGE_TABLE
|
struct STAGE_TABLE
|
||||||
{
|
{
|
||||||
char parts[0x20];
|
char parts[0x20];
|
||||||
|
@ -15,6 +17,6 @@ struct STAGE_TABLE
|
||||||
extern int gStageNo;
|
extern int gStageNo;
|
||||||
extern int gMusicNo;
|
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 ChangeMusic(int no);
|
||||||
void ReCallMusic();
|
void ReCallMusic();
|
||||||
|
|
Loading…
Add table
Reference in a new issue