summaryrefslogtreecommitdiff
path: root/src/friend_area_1.c
diff options
context:
space:
mode:
authorDennis <dhilhorst2000@gmail.com>2021-07-17 18:45:13 +0200
committerGitHub <noreply@github.com>2021-07-17 09:45:13 -0700
commitbad7f7f688253c87c2cb2d063ea57c884cb6adff (patch)
treef853042438f42634f8d64b6daec015f3e287d77a /src/friend_area_1.c
parenta65d358927f668cb5e34a6046afef5bd61380a28 (diff)
More item related decomp (#45)
* decompile sub_80918EC * some more item related functions * more item functions * more decomp, fix types in other places * more small functions * more item related decomp * one more weird branching item function * fix global.h includes * figured out branch pattern * decompile sub_8090F58 * make temporary struct for function * :crab: items.s is gone :crab: * some renaming * rename some obvious item related constants * fix spelling error
Diffstat (limited to 'src/friend_area_1.c')
-rw-r--r--src/friend_area_1.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/src/friend_area_1.c b/src/friend_area_1.c
index 44f00a8..ff1da5d 100644
--- a/src/friend_area_1.c
+++ b/src/friend_area_1.c
@@ -1,47 +1,45 @@
#include "global.h"
#include "constants/friend_area.h"
+#include "code_8092334.h"
extern bool8 *gFriendAreas;
-extern void sub_809485C(u32 *r0, u8 *r1, u32 size);
-extern void sub_8094924(u32 *r0, u32 *r1, u32);
-extern void nullsub_102(u32 *r0);
-extern void sub_809488C(u32 *r0, u32 *r1, u32 r2);
-extern void sub_809486C(u32 *r0, u8 *r1, u32 size);
u32 SaveFriendAreas(u8 *r0, u32 size)
{
- u32 temp[5];
+ struct unkStruct_8094924 unk;
+ u32 temp;
s32 counter;
- sub_809486C(temp, r0, size);
+ sub_809486C(&unk, r0, size);
for(counter = 0; counter < NUM_FRIEND_AREAS; counter++)
{
if(gFriendAreas[counter] != 0)
- temp[4] = -1;
+ temp = -1;
else
- temp[4] = 0;
- sub_809488C(temp, &(temp[4]), 1);
+ temp = 0;
+ sub_809488C(&unk, (u8*)&temp, 1);
}
- nullsub_102(temp);
- return temp[2];
+ nullsub_102(&unk);
+ return unk.unk8;
}
u32 ReadSavedFriendAreas(u8 *r0, s32 size)
{
- u32 temp[5];
+ struct unkStruct_8094924 unk;
+ u32 temp;
s32 counter;
- sub_809485C(temp, r0, size);
+ sub_809485C(&unk, r0, size);
for(counter = 0; counter < NUM_FRIEND_AREAS; counter++)
{
- sub_8094924(temp, &(temp[4]), 1);
+ sub_8094924(&unk, (u8*)&temp, 1);
// It's setting whether we have the friend area or not
- if((temp[4] & 1))
- gFriendAreas[counter] = TRUE;
+ if(temp & 1)
+ gFriendAreas[counter] = 1;
else
- gFriendAreas[counter] = FALSE;
+ gFriendAreas[counter] = 0;
}
- nullsub_102(temp);
- return temp[2];
+ nullsub_102(&unk);
+ return unk.unk8;
}