updated flag func calls

This commit is contained in:
theo3
2020-07-18 16:03:20 -07:00
parent cce6a23fbb
commit c084cfbae2
11 changed files with 46 additions and 50 deletions
+1 -1
View File
@@ -130,6 +130,6 @@ enum {
/*0x62*/ MAZE_CLEAR, /* Cleared Castle maze */ /*0x62*/ MAZE_CLEAR, /* Cleared Castle maze */
/*0x63*/ TINY_ENTRANCE, /* Ezlo described entrances */ /*0x63*/ TINY_ENTRANCE, /* Ezlo described entrances */
/*0x64*/ CASTLE_BGM, /* Castle intro BGM */ /*0x64*/ CASTLE_BGM, /* Castle intro BGM */
} FLAG; };
#endif #endif
+18 -22
View File
@@ -1,8 +1,8 @@
#include "global.h" #include "global.h"
#include "room.h" #include "room.h"
#include "flags.h"
void LoadRoomEntityList(EntityData* dat); void LoadRoomEntityList(EntityData* dat);
s32 CheckGlobalFlag(u32 flag);
extern EntityData* GetCurrentRoomProperty(u32 unk); extern EntityData* GetCurrentRoomProperty(u32 unk);
extern void sub_0804B058(EntityData* dat); extern void sub_0804B058(EntityData* dat);
extern void sub_0804B1AC(EntityData* dat); extern void sub_0804B1AC(EntityData* dat);
@@ -21,7 +21,7 @@ void LoadRoom(void) {
LoadRoomEntityList(GetCurrentRoomProperty(1)); LoadRoomEntityList(GetCurrentRoomProperty(1));
LoadRoomEntityList(GetCurrentRoomProperty(0)); LoadRoomEntityList(GetCurrentRoomProperty(0));
if (CheckGlobalFlag(21)) if (CheckGlobalFlag(TABIDACHI))
sub_0804B058(GetCurrentRoomProperty(2)); sub_0804B058(GetCurrentRoomProperty(2));
sub_0804B1AC(GetCurrentRoomProperty(3)); sub_0804B1AC(GetCurrentRoomProperty(3));
@@ -51,34 +51,30 @@ void sub_0804B058(EntityData* dat) {
} }
} }
void sub_0804B0B0(u32 arg0, u32 arg1) void sub_0804B0B0(u32 arg0, u32 arg1) {
{ LoadRoomEntityList(GetRoomProperty(arg0, arg1, 1));
LoadRoomEntityList(GetRoomProperty(arg0, arg1, 1));
} }
void SetCurrentRoomPropertyList(u32 arg0, u32 arg1) void SetCurrentRoomPropertyList(u32 arg0, u32 arg1) {
{
u32** arr; u32** arr;
gUnk_02017654 = 0; gUnk_02017654 = 0;
arr = &gUnk_080D50FC; arr = &gUnk_080D50FC;
if (arr[arg0] != 0) { if (arr[arg0] != 0) {
gUnk_02017654 = arr[arg0][arg1]; gUnk_02017654 = arr[arg0][arg1];
} }
} }
void sub_0804B0E8(u32 arg0, u32 arg1) void sub_0804B0E8(u32 arg0, u32 arg1) {
{ void (*func)();
void (* func)();
func = (void (*)())GetRoomProperty(arg0, arg1, 4); func = (void (*)())GetRoomProperty(arg0, arg1, 4);
if (func != NULL) { if (func != NULL) {
func(); func();
} }
} }
// returns multiple types of data? // returns multiple types of data?
void* GetRoomProperty(u32 arg0, u32 arg1, u32 arg2) void* GetRoomProperty(u32 arg0, u32 arg1, u32 arg2) {
{
u32 temp; u32 temp;
u32** arr; u32** arr;
temp = 0; temp = 0;
@@ -86,7 +82,7 @@ void* GetRoomProperty(u32 arg0, u32 arg1, u32 arg2)
if (arr[arg0] != NULL) { if (arr[arg0] != NULL) {
temp = arr[arg0][arg1]; temp = arr[arg0][arg1];
if (temp != 0) { if (temp != 0) {
temp = *(u32 *)(arg2 * 4 + temp); temp = *(u32*)(arg2 * 4 + temp);
} }
} }
return (void*)temp; return (void*)temp;
+6 -6
View File
@@ -155,7 +155,7 @@ void sub_080601D4(Entity* this) {
u32 temp; u32 temp;
u32 uVar2; u32 uVar2;
if (CheckGlobalFlag(4) == 0) { if (CheckGlobalFlag(LV3_CLEAR) == 0) {
uVar2 = 2; uVar2 = 2;
} else { } else {
temp = CheckKinstoneFused(0x17); temp = CheckKinstoneFused(0x17);
@@ -202,9 +202,9 @@ void sub_08060270(Entity *this)
//flippers //flippers
if (GetInventoryValue(0x46) == 0) { if (GetInventoryValue(0x46) == 0) {
index = 1; index = 1;
if (CheckGlobalFlag(0x29) == 0) { if (CheckGlobalFlag(MIZUKAKI_START) == 0) {
index = 0; index = 0;
SetGlobalFlag(0x29); SetGlobalFlag(MIZUKAKI_START);
} }
} }
else { else {
@@ -266,19 +266,19 @@ u32 sub_08060354(void)
s32 iVar2; s32 iVar2;
iVar2 = gUnk_02002A40.unk2 - gUnk_02002A40.unk3; iVar2 = gUnk_02002A40.unk2 - gUnk_02002A40.unk3;
if (CheckGlobalFlag(0x3b) == 0) { if (CheckGlobalFlag(DRUG_1) == 0) {
if (4 < iVar2) { if (4 < iVar2) {
return 0x8444; return 0x8444;
} }
} }
else { else {
if (CheckGlobalFlag(0x3c) == 0) { if (CheckGlobalFlag(DRUG_2) == 0) {
if (iVar2 > 9) { if (iVar2 > 9) {
return 0x8444; return 0x8444;
} }
} }
else { else {
if (CheckGlobalFlag(0x3d) == 0) { if (CheckGlobalFlag(DRUG_3) == 0) {
if (iVar2 > 14) { if (iVar2 > 14) {
return 0x8444; return 0x8444;
} }
+1 -1
View File
@@ -67,7 +67,7 @@ void sub_080670B4(Entity *this)
uVar2 = 0; uVar2 = 0;
if (GetInventoryValue(0x11) == 0) { if (GetInventoryValue(0x11) == 0) {
uVar1 = CheckGlobalFlag(0x15); uVar1 = CheckGlobalFlag(TABIDACHI);
uVar2 = (-uVar1 | uVar1) >> 0x1f; uVar2 = (-uVar1 | uVar1) >> 0x1f;
} }
TextboxNoOverlap(gUnk_08110C0C[uVar2],this); TextboxNoOverlap(gUnk_08110C0C[uVar2],this);
+1 -1
View File
@@ -49,7 +49,7 @@ void Simon_CreateChest(Entity *this)
void sub_0806C280(void) void sub_0806C280(void)
{ {
SetGlobalFlag(0x50); SetGlobalFlag(MAROYA_WAKEUP);
DoExitTransition(&gUnk_0813AD74); DoExitTransition(&gUnk_0813AD74);
gUnk_030010A0.unk = 6; gUnk_030010A0.unk = 6;
} }
+1 -1
View File
@@ -283,7 +283,7 @@ void sub_0806200C(Entity* this) {
u32 index; u32 index;
index = 0; index = 0;
if ((CheckGlobalFlag(0x29) != 0) && (CheckLocalFlag(0x6b))) { if ((CheckGlobalFlag(MIZUKAKI_START) != 0) && (CheckLocalFlag(0x6b))) {
// hyrule bestiary // hyrule bestiary
if (GetInventoryValue(0x39) == 2) { if (GetInventoryValue(0x39) == 2) {
+2 -2
View File
@@ -52,7 +52,7 @@ void sub_0806C7D4(Entity* this) {
sub_0806F118(this); sub_0806F118(this);
} else { } else {
sub_0807DD94(this, 0); sub_0807DD94(this, 0);
if ((this->entityType.parameter == 3) && (!CheckGlobalFlag(0x58)) && (CheckLocalFlag(0x63)) && if ((this->entityType.parameter == 3) && (!CheckGlobalFlag(WARP_EVENT_END)) && (CheckLocalFlag(0x63)) &&
(CheckRoomFlag(0))) { (CheckRoomFlag(0))) {
(this->entityType).parameter = 7; (this->entityType).parameter = 7;
sub_0807DD80(this, &gUnk_08014A80); sub_0807DD80(this, &gUnk_08014A80);
@@ -130,7 +130,7 @@ void sub_0806C944(Entity *this)
int iVar1; int iVar1;
int iVar2; int iVar2;
iVar1 = CheckGlobalFlag(0x58); iVar1 = CheckGlobalFlag(WARP_EVENT_END);
if (iVar1 == 0) { if (iVar1 == 0) {
iVar2 = 0; iVar2 = 0;
} }
+1 -1
View File
@@ -84,7 +84,7 @@ void sub_08066D94(Entity* ent) {
u32 roomID; u32 roomID;
Entity* npc; Entity* npc;
SetGlobalFlag(0x1C); SetGlobalFlag(ZELDA_CHASE);
npc = CreateNPC(0x2E, 0, 0); npc = CreateNPC(0x2E, 0, 0);
if (npc != NULL) { if (npc != NULL) {
npc->animationState = gLinkEntity.animationState; npc->animationState = gLinkEntity.animationState;
+1 -1
View File
@@ -72,7 +72,7 @@ void sub_0809F548(Entity* this) {
void sub_0809F5B0(Entity* this) { void sub_0809F5B0(Entity* this) {
if (--this->actionDelay == 0) { if (--this->actionDelay == 0) {
PlaySFX(115); PlaySFX(115);
SetGlobalFlag(36); SetGlobalFlag(KUMOTATSUMAKI);
LoadRoomEntityList(&gUnk_080DD750); LoadRoomEntityList(&gUnk_080DD750);
DeleteThisEntity(); DeleteThisEntity();
} }
+1 -1
View File
@@ -35,7 +35,7 @@ void sub_0809E83C(Entity* this) {
void sub_0809E86C(Entity* this) { void sub_0809E86C(Entity* this) {
if (sub_0800419C(this, &gLinkEntity, 0x30, 0x30)) { if (sub_0800419C(this, &gLinkEntity, 0x30, 0x30)) {
if (CheckGlobalFlag(0x14)) { if (CheckGlobalFlag(EZERO_1ST)) {
if (((gUnk_030010A0 & 3) == 0)) { if (((gUnk_030010A0 & 3) == 0)) {
sub_080A2B80(this); sub_080A2B80(this);
} }
+11 -11
View File
@@ -165,7 +165,7 @@ void sub_0804B4E4(void) {
sub_080580B0(0x22); sub_080580B0(0x22);
// white sword // white sword
if (GetInventoryValue(0x2)) if (GetInventoryValue(0x2))
SetGlobalFlag(0x56); SetGlobalFlag(WHITE_SWORD_END);
} }
void sub_0804B500() { void sub_0804B500() {
@@ -361,7 +361,7 @@ void sub_0804B738(void) {
LoadRoomEntityList(&gUnk_080D6714); LoadRoomEntityList(&gUnk_080D6714);
} }
// flippers // flippers
if (!GetInventoryValue(0x46) && CheckGlobalFlag(0x29) && CheckLocalFlag(0x6a)) { if (!GetInventoryValue(0x46) && CheckGlobalFlag(MIZUKAKI_START) && CheckLocalFlag(0x6a)) {
LoadRoomEntityList(&gUnk_080D6734); LoadRoomEntityList(&gUnk_080D6734);
} else { } else {
LoadRoomEntityList(&gUnk_080D66F4); LoadRoomEntityList(&gUnk_080D66F4);
@@ -481,9 +481,9 @@ void sub_0804B938(void) {
return; return;
} }
if (CheckGlobalFlag(0x2b)) { if (CheckGlobalFlag(RENTED_HOUSE_DIN)) {
if (!CheckGlobalFlag(0x2f)) { if (!CheckGlobalFlag(NEW_HOUSE_NAYRU)) {
if (!CheckGlobalFlag(0x30)) { if (!CheckGlobalFlag(NEW_HOUSE_FARORE)) {
LoadRoomEntityList(&UpperInn_NoDin); LoadRoomEntityList(&UpperInn_NoDin);
} else { } else {
LoadRoomEntityList(&UpperInn_Nayru); LoadRoomEntityList(&UpperInn_Nayru);
@@ -491,18 +491,18 @@ void sub_0804B938(void) {
} else { } else {
LoadRoomEntityList(&UpperInn_Farore); LoadRoomEntityList(&UpperInn_Farore);
} }
} else if (CheckGlobalFlag(0x2c)) { } else if (CheckGlobalFlag(RENTED_HOUSE_NAYRU)) {
if (CheckGlobalFlag(0x2e)) { if (CheckGlobalFlag(NEW_HOUSE_DIN)) {
LoadRoomEntityList(&UpperInn_Farore); LoadRoomEntityList(&UpperInn_Farore);
} else if (!CheckGlobalFlag(0x30)) { } else if (!CheckGlobalFlag(NEW_HOUSE_FARORE)) {
LoadRoomEntityList(&UpperInn_NoNayru); LoadRoomEntityList(&UpperInn_NoNayru);
} else { } else {
LoadRoomEntityList(&UpperInn_Din); LoadRoomEntityList(&UpperInn_Din);
} }
} else if (CheckGlobalFlag(0x2d)) { } else if (CheckGlobalFlag(RENTED_HOUSE_FARORE)) {
if (CheckGlobalFlag(0x2e)) { if (CheckGlobalFlag(NEW_HOUSE_DIN)) {
LoadRoomEntityList(&UpperInn_Nayru); LoadRoomEntityList(&UpperInn_Nayru);
} else if (CheckGlobalFlag(0x2f)) { } else if (CheckGlobalFlag(NEW_HOUSE_NAYRU)) {
LoadRoomEntityList(&UpperInn_Din); LoadRoomEntityList(&UpperInn_Din);
} else { } else {
LoadRoomEntityList(&UpperInn_NoFarore); LoadRoomEntityList(&UpperInn_NoFarore);