summaryrefslogtreecommitdiff
path: root/src/code_8057824.c
diff options
context:
space:
mode:
authorSeth Barberee <seth.barberee@gmail.com>2021-04-19 21:55:40 -0700
committerGitHub <noreply@github.com>2021-04-19 23:55:40 -0500
commitf65dee5a143bd543c74c010d7252eb76893ee243 (patch)
treed343e826c63f8b501d37873c3c7bc1f010819deb /src/code_8057824.c
parentd316d1e359c7672277a9cf644acd4e40170f5968 (diff)
Wonder mail and some boss dialogues (#36)
* more wonder mail and main menu work * Lots of things.. doc'ing, decomping, and other things * continue decomping boss scenes * up to Suicune * up to Mewtwo dialogue * up to Raquaza * fix spelling error on Rayquaza and decomp a few more * up to groudon * divide > shift
Diffstat (limited to 'src/code_8057824.c')
-rw-r--r--src/code_8057824.c118
1 files changed, 118 insertions, 0 deletions
diff --git a/src/code_8057824.c b/src/code_8057824.c
new file mode 100644
index 0000000..edc338d
--- /dev/null
+++ b/src/code_8057824.c
@@ -0,0 +1,118 @@
+#include "global.h"
+#include "gUnknown_203B418.h"
+#include "code_8041D5C.h"
+
+extern struct unkStruct_203B418 *gUnknown_203B418;
+
+extern u32 gUnknown_80FCF74;
+extern u32 gUnknown_80FCF80;
+extern u16 gUnknown_80F4F42;
+
+extern u32 gUnknown_8106A50;
+extern u32 gUnknown_8106A4C;
+extern s16 gUnknown_80F4DB6;
+extern u32 gUnknown_80FAC88;
+
+extern void sub_80775DC(struct unkDungeon_8041D5C *r0, struct unkDungeon_8041D5C *r1, u32, u32);
+extern void sub_80772C0(struct unkDungeon_8041D5C *r0, struct unkDungeon_8041D5C *r1, u32, u32, u32);
+extern u8 sub_807EAA0(u32, u32);
+extern void sub_80522F4(struct unkDungeon_8041D5C *r1, struct unkDungeon_8041D5C *r2, u32);
+extern void sub_8079F20(struct unkDungeon_8041D5C *r0, struct unkDungeon_8041D5C *r1, u32, u32);
+
+extern u8 sub_805727C(u32, u32, s16);
+extern u32 sub_8055640(u32, u32, u32, u32, u32);
+extern void sub_80779F0(u32, u32, u32, u32);
+extern void sub_8078968();
+extern void sub_8079618(struct unkDungeon_8041D5C *r0, struct unkDungeon_8041D5C *r1, u32, u32, u32);
+
+extern void sub_806F370(struct unkDungeon_8041D5C *r0, struct unkDungeon_8041D5C *r1, u32, u32, u8 *, u8, s32, u32, u32, u32);
+
+
+
+extern u32 gUnknown_80FD018;
+extern s16 sub_8057600(u32, u32);
+extern u32 sub_8092B00(u32);
+
+u32 sub_8057824(struct unkDungeon_8041D5C *param_1, struct unkDungeon_8041D5C *param_2)
+{
+ sub_80775DC(param_1,param_2,gUnknown_8106A50,1);
+ return 1;
+}
+
+u32 sub_805783C(struct unkDungeon_8041D5C *param_1, struct unkDungeon_8041D5C *param_2)
+{
+ sub_80772C0(param_1,param_2,gUnknown_8106A4C,0x80,1);
+ return 1;
+}
+
+u32 sub_805785C(struct unkDungeon_8041D5C *param_1, struct unkDungeon_8041D5C *param_2)
+{
+ gUnknown_203B418->unkE26B = gUnknown_80F4F42;
+ if (sub_807EAA0(1,0) == '\0') {
+ // The weather remains unchanged
+ sub_80522F4(param_1,param_2,gUnknown_80FCF74);
+ }
+ return 1;
+}
+
+u32 sub_80578A4(struct unkDungeon_8041D5C *param_1, struct unkDungeon_8041D5C *param_2)
+{
+ gUnknown_203B418->unkE26C = gUnknown_80F4F42;
+ if (sub_807EAA0(1,0) == '\0') {
+ // The weather remains unchanged
+ sub_80522F4(param_1,param_2,gUnknown_80FCF80);
+ }
+ return 1;
+}
+
+u32 sub_80578EC(struct unkDungeon_8041D5C *r0, struct unkDungeon_8041D5C *r1)
+{
+ sub_8079F20(r0, r1, 1, 0);
+ return 1;
+}
+
+u32 sub_80578FC(u32 param_1, u32 param_2, u32 param_3, u32 param_4)
+{
+ u32 uVar3;
+
+ uVar3 = 0;
+ if (sub_8055640(param_1, param_2, param_3, 0x80 << 1, param_4) != 0) {
+ uVar3 = 1;
+ if (sub_805727C(param_1,param_2, gUnknown_80F4DB6) != '\0') {
+ sub_80779F0(param_1, param_2, 1, 0);
+ }
+ }
+ return uVar3;
+}
+
+u32 sub_8057948(void)
+{
+ sub_8078968();
+ return 1;
+}
+
+u32 sub_8057954(struct unkDungeon_8041D5C *param_1, struct unkDungeon_8041D5C *param_2, u32 param_3)
+{
+ // $m0 is enraged
+ sub_8079618(param_1,param_2,0xc,param_3,gUnknown_80FAC88);
+ return 1;
+}
+
+u8 sub_8057974(struct unkDungeon_8041D5C *param_1, struct unkDungeon_8041D5C *param_2, u32 param_3, u32 param_4)
+{
+ s32 newHP;
+ u8 local_24;
+
+ newHP = param_2->unk70->unkE / 2;
+ local_24 = 0;
+ if (newHP != 0) {
+ sub_806F370(param_1,param_2,newHP,1,&local_24,sub_8092B00(param_3),sub_8057600(param_3,param_4),0,1,0);
+ local_24 = local_24 == 0;
+ }
+ else
+ {
+ // The target's HP can't be halved anymore
+ sub_80522F4(param_1,param_2,gUnknown_80FD018);
+ }
+ return local_24;
+}