summaryrefslogtreecommitdiff
path: root/src/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/script.c')
-rw-r--r--src/script.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/script.c b/src/script.c
index ff74b40bc..097f6d3f3 100644
--- a/src/script.c
+++ b/src/script.c
@@ -28,7 +28,7 @@ static struct ScriptContext sScriptContext1;
static u32 sUnusedVariable2;
static struct ScriptContext sScriptContext2;
static bool8 sScriptContext2Enabled;
-static u8 gUnknown_3000F9D;
+static u8 sMsgBoxWalkawayDisabled;
static u8 sMsgBoxIsCancelable;
static u8 sQuestLogInput;
static u8 sQuestLogInputIsDpad;
@@ -235,19 +235,19 @@ u8 GetRegisteredQuestLogInput(void)
return sQuestLogInput;
}
-void sub_80699BC(void)
+void DisableMsgBoxWalkaway(void)
{
- gUnknown_3000F9D = TRUE;
+ sMsgBoxWalkawayDisabled = TRUE;
}
-void sub_80699C8(void)
+void EnableMsgBoxWalkaway(void)
{
- gUnknown_3000F9D = FALSE;
+ sMsgBoxWalkawayDisabled = FALSE;
}
-bool8 sub_80699D4(void)
+bool8 IsMsgBoxWalkawayDisabled(void)
{
- return gUnknown_3000F9D;
+ return sMsgBoxWalkawayDisabled;
}
void SetWalkingIntoSignVars(void)
@@ -330,7 +330,7 @@ bool8 ScriptContext2_RunScript(void)
void ScriptContext1_SetupScript(const u8 *ptr)
{
ClearMsgBoxCancelableState();
- sub_80699C8();
+ EnableMsgBoxWalkaway();
ClearQuestLogInputIsDpadFlag();
InitScriptContext(&sScriptContext1, gScriptCmdTable, gScriptCmdTableEnd);
SetupBytecodeScript(&sScriptContext1, ptr);
@@ -358,7 +358,7 @@ void ScriptContext2_RunNewScript(const u8 *ptr)
u8 *mapheader_get_tagged_pointer(u8 tag)
{
- u8 *mapScripts = gMapHeader.mapScripts;
+ const u8 *mapScripts = gMapHeader.mapScripts;
if (mapScripts == NULL)
return NULL;
@@ -370,7 +370,7 @@ u8 *mapheader_get_tagged_pointer(u8 tag)
if (*mapScripts == tag)
{
mapScripts++;
- return (u8 *)(mapScripts[0] + (mapScripts[1] << 8) + (mapScripts[2] << 16) + (mapScripts[3] << 24));
+ return T2_READ_PTR(mapScripts);
}
mapScripts += 5;
}
@@ -379,7 +379,7 @@ u8 *mapheader_get_tagged_pointer(u8 tag)
void mapheader_run_script_by_tag(u8 tag)
{
u8 *ptr = mapheader_get_tagged_pointer(tag);
- if (ptr)
+ if (ptr != NULL)
ScriptContext2_RunNewScript(ptr);
}
@@ -387,7 +387,7 @@ u8 *mapheader_get_first_match_from_tagged_ptr_list(u8 tag)
{
u8 *ptr = mapheader_get_tagged_pointer(tag);
- if (!ptr)
+ if (ptr == NULL)
return NULL;
while (1)
@@ -411,22 +411,22 @@ void RunOnLoadMapScript(void)
mapheader_run_script_by_tag(1);
}
-void mapheader_run_script_with_tag_x3(void)
+void RunOnTransitionMapScript(void)
{
mapheader_run_script_by_tag(3);
}
-void mapheader_run_script_with_tag_x5(void)
+void RunOnResumeMapScript(void)
{
mapheader_run_script_by_tag(5);
}
-void mapheader_run_script_with_tag_x7(void)
+void RunOnReturnToFieldMapScript(void)
{
mapheader_run_script_by_tag(7);
}
-void mapheader_run_script_with_tag_x6(void)
+void RunOnDiveWarpMapScript(void)
{
mapheader_run_script_by_tag(6);
}
@@ -447,7 +447,7 @@ bool8 TryRunOnFrameMapScript(void)
return 1;
}
-void mapheader_run_first_tag4_script_list_match(void)
+void TryRunOnWarpIntoMapScript(void)
{
u8 *ptr = mapheader_get_first_match_from_tagged_ptr_list(4);
if (ptr)