shithub: cstory

Download patch

ref: 3e5f44f8deb12840d892b3cc5d204542b05f0d78
parent: 923749e41e323a85953bdde7ae0c3510ab687fac
author: Clownacy <Clownacy@users.noreply.github.com>
date: Fri Feb 22 17:23:57 EST 2019

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

--- a/src/MiniMap.cpp
+++ b/src/MiniMap.cpp
@@ -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 @@
 	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;
 }
--- a/src/MiniMap.h
+++ b/src/MiniMap.h
@@ -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);
--- a/src/NpChar.cpp
+++ b/src/NpChar.cpp
@@ -594,26 +594,26 @@
   *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()
--- a/src/NpChar.h
+++ b/src/NpChar.h
@@ -101,6 +101,6 @@
 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();
--- a/src/Stage.cpp
+++ b/src/Stage.cpp
@@ -129,12 +129,12 @@
 	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 @@
 	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 @@
 	//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 @@
 		InitBossChar(gTMT[no].boss_no);
 		ResetFlash();
 		gStageNo = no;
-		return true;
+		return TRUE;
 	}
 	
-	return false;
+	return FALSE;
 }
 
 //Music
--- a/src/Stage.h
+++ b/src/Stage.h
@@ -1,5 +1,7 @@
 #pragma once
 
+#include "WindowsWrapper.h"
+
 struct STAGE_TABLE
 {
 	char parts[0x20];
@@ -15,6 +17,6 @@
 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();