summaryrefslogtreecommitdiff
path: root/docs/tutorial/advanced_control_flow.md
diff options
context:
space:
mode:
authorAndzura <11079691+Andzura@users.noreply.github.com>2022-03-27 17:09:47 +0200
committerGitHub <noreply@github.com>2022-03-27 12:09:47 -0300
commit4f3202fd7e5313ab7b777eb3be162283fe5ea142 (patch)
treed674155db4f1660a5f18a7af5b00598ebf73644e /docs/tutorial/advanced_control_flow.md
parent02cb97161609e1c9aa53e2bbdc29e8b6f4f46c47 (diff)
z_message progress (#701)
* 8 functions matching, 1 non-matching, 45 untouched * match func_801518B0 * match func_8014CC14 * matching 8 func, 1 non-matching * matched func_80148CBC * matched func_80156758 * matched func_80147564 * matched func_80151BB4 * matched func80152EC0/Message_Spawn_Song_Effect * matched func_80151C9C * WIP func_80148B98 * WIP func_80151938 * matched func_80151938 * matched func_80148B98 * matched func_80147734 * matched func_80147624 * WIP func_8014EBC * match func_801518B0 * matched func_80147564 * matched func80152EC0/Message_Spawn_Song_Effect * matched func_80151C9C * WIP func_80148B98 * matched func_80151938 * matched func_80148B98 * matched func_80147734 * matched func_80147624 * WIP#2 func_8014EBC * matched func_80149EBC * WIP func_8014CCB4 * matched func_8014CCB4 * matched func_80151A68 * WIP func_8014D62C * fix func_8015A68 signature * z_message_nes & z_message_staff progress * z_message_nes & z_message_staff renaming * documenting z_message * cleaning & renaming * documenting MessageContext * matched func_80151A68 * format * naming convention fix * re-add func_80147564 * apply renaming of Message_ShouldAdvanceSilent on the whole project * re-format, add clang-format off/on in z_message.c needed for matching * rename staff => credits; add renames in actorfixer. * change rupees array to ascii * remove useless comments * change MessageContext.decodedBuffer to a union * remove decodedBuffer from actorfixer * applied AngheloAlf suggestions & ran sfxconvert on z_message.c * rename message_struct => message_data_static; revert decodedBuffer as union creating differences. * use true/false instead of 1/0 * use SET_FULLSCREEN_VIEWPORT macro in func_80152c64 * AngheloAlf suggestions. * extract assign from dayTime calculation for readability in Message_LoadTimeNES * remove bss_reordering from osFlash, idle & boot_main to typedef MessageTableEntry in message_data_static & make decodedBuffer an union. * remove useless casts * Changes hexa to ascii chars when it's meaningful; add comments to func_8014CCB4 to show what hexa constant means. * Hensldm suggestions * ran actorfixer on new changes; fix new bss reordering error introduced with rebase * use new TIME_TO_MINUTES_F macro * re-ran format.sh * hensldm suggestions #2 + overall cleaning * remove useless parenthesis * Update include/message_data_static.h Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com> * actorfixer and format * more fixes Co-authored-by: Andzura <andzura@andzura.fr> Co-authored-by: abaud <adrien.baud@inria.fr> Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>
Diffstat (limited to 'docs/tutorial/advanced_control_flow.md')
-rw-r--r--docs/tutorial/advanced_control_flow.md42
1 files changed, 21 insertions, 21 deletions
diff --git a/docs/tutorial/advanced_control_flow.md b/docs/tutorial/advanced_control_flow.md
index 3420fc597..8cd9660ba 100644
--- a/docs/tutorial/advanced_control_flow.md
+++ b/docs/tutorial/advanced_control_flow.md
@@ -159,14 +159,14 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
temp_v0 = Message_GetState(&globalCtx->msgCtx);
if (temp_v0 != 4) {
if (temp_v0 != 5) {
- if ((temp_v0 == 6) && (func_80147624(globalCtx) != 0)) {
+ if ((temp_v0 == 6) && (Message_ShouldAdvance(globalCtx) != 0)) {
this->actionFunc = func_80952734;
return;
}
// Duplicate return node #17. Try simplifying control flow for better match
return;
}
- if (func_80147624(globalCtx) != 0) {
+ if (Message_ShouldAdvance(globalCtx) != 0) {
func_801477B4(globalCtx);
Actor_PickUp((Actor *) this, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel);
this->actionFunc = func_809529AC;
@@ -175,7 +175,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
// Duplicate return node #17. Try simplifying control flow for better match
return;
}
- if (func_80147624(globalCtx) != 0) {
+ if (Message_ShouldAdvance(globalCtx) != 0) {
temp_v0_2 = globalCtx->msgCtx.choiceIndex;
if (temp_v0_2 != 0) {
if (temp_v0_2 != 1) {
@@ -211,7 +211,7 @@ which is long, messy, and contains some rather nasty-looking control flow, inclu
temp_v0 = Message_GetState(&globalCtx->msgCtx);
if (temp_v0 != 4) {
if (temp_v0 != 5) {
- if ((temp_v0 == 6) && (func_80147624(globalCtx) != 0)) {
+ if ((temp_v0 == 6) && (Message_ShouldAdvance(globalCtx) != 0)) {
this->actionFunc = func_80952734;
return;
}
@@ -248,13 +248,13 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
if (temp_v0 != 6) {
goto block_17;
}
- if (func_80147624(globalCtx) == 0) {
+ if (Message_ShouldAdvance(globalCtx) == 0) {
goto block_17;
}
this->actionFunc = func_80952734;
return;
block_5:
- if (func_80147624(globalCtx) == 0) {
+ if (Message_ShouldAdvance(globalCtx) == 0) {
goto block_17;
}
func_801477B4(globalCtx);
@@ -262,7 +262,7 @@ block_5:
this->actionFunc = func_809529AC;
return;
block_7:
- if (func_80147624(globalCtx) == 0) {
+ if (Message_ShouldAdvance(globalCtx) == 0) {
goto block_17;
}
temp_v0_2 = globalCtx->msgCtx.choiceIndex;
@@ -350,13 +350,13 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
if (temp_v0 != 6) {
goto block_17;
}
- if (func_80147624(globalCtx) == 0) {
+ if (Message_ShouldAdvance(globalCtx) == 0) {
goto block_17;
}
this->actionFunc = func_80952734;
return;
block_5:
- if (func_80147624(globalCtx) == 0) {
+ if (Message_ShouldAdvance(globalCtx) == 0) {
goto block_17;
}
func_801477B4(globalCtx);
@@ -364,7 +364,7 @@ block_5:
this->actionFunc = func_809529AC;
return;
block_7:
- if (func_80147624(globalCtx) == 0) {
+ if (Message_ShouldAdvance(globalCtx) == 0) {
goto block_17;
}
temp_v0_2 = globalCtx->msgCtx.choiceIndex;
@@ -420,13 +420,13 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
if (temp_v0 != 6) {
return;
}
- if (func_80147624(globalCtx) == 0) {
+ if (Message_ShouldAdvance(globalCtx) == 0) {
return;
}
this->actionFunc = func_80952734;
return;
block_5:
- if (func_80147624(globalCtx) == 0) {
+ if (Message_ShouldAdvance(globalCtx) == 0) {
return;
}
func_801477B4(globalCtx);
@@ -434,7 +434,7 @@ block_5:
this->actionFunc = func_809529AC;
return;
block_7:
- if (func_80147624(globalCtx) == 0) {
+ if (Message_ShouldAdvance(globalCtx) == 0) {
return;
}
temp_v0_2 = globalCtx->msgCtx.choiceIndex;
@@ -557,7 +557,7 @@ There's a couple of other obvious things here:
Well, at least the bottom half looks respectable now. Again, there is no code after the switch, so the next thing up, namely
```C
- if (func_80147624(globalCtx) == 0) {
+ if (Message_ShouldAdvance(globalCtx) == 0) {
return;
}
```
@@ -578,13 +578,13 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
if (temp_v0 != 6) {
return;
}
- if (func_80147624(globalCtx) == 0) {
+ if (Message_ShouldAdvance(globalCtx) == 0) {
return;
}
this->actionFunc = func_80952734;
return;
block_5:
- if (func_80147624(globalCtx) == 0) {
+ if (Message_ShouldAdvance(globalCtx) == 0) {
return;
}
func_801477B4(globalCtx);
@@ -592,7 +592,7 @@ block_5:
this->actionFunc = func_809529AC;
return;
block_7:
- if (func_80147624(globalCtx) != 0) {
+ if (Message_ShouldAdvance(globalCtx) != 0) {
switch (globalCtx->msgCtx.choiceIndex) {
case 0:
func_801477B4(globalCtx);
@@ -647,7 +647,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
break;
case 5:
- if (func_80147624(globalCtx) == 0) {
+ if (Message_ShouldAdvance(globalCtx) == 0) {
return;
}
func_801477B4(globalCtx);
@@ -656,7 +656,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
break;
case 4:
- if (func_80147624(globalCtx) != 0) {
+ if (Message_ShouldAdvance(globalCtx) != 0) {
switch (globalCtx->msgCtx.choiceIndex) {
case 0:
func_801477B4(globalCtx);
@@ -700,7 +700,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
break;
case 5:
- if (func_80147624(globalCtx) != 0) {
+ if (Message_ShouldAdvance(globalCtx) != 0) {
func_801477B4(globalCtx);
Actor_PickUp((Actor *) this, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel);
this->actionFunc = func_809529AC;
@@ -708,7 +708,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
break;
case 4:
- if (func_80147624(globalCtx) != 0) {
+ if (Message_ShouldAdvance(globalCtx) != 0) {
switch (globalCtx->msgCtx.choiceIndex) {
case 0:
func_801477B4(globalCtx);