diff options
author | Seth Barberee <seth.barberee@gmail.com> | 2021-03-23 12:11:10 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-23 12:11:10 -0500 |
commit | 2fd4f339b42c010191c199772b09ac34c580de94 (patch) | |
tree | e562899f35861ece70c292602fe6aac2f50906bf /src/code_80A26CC.c | |
parent | 7b142311a7294c4c7a943870fa5f24f0fbea604a (diff) |
Miscellaneous Work (Again) (#31)
* move some personality data from asm to C
* combine personality_test files and add my close attempt at RedrawPartnerSelectionMenu
* decomp some more wonder mail funcs and label some more data
* lots of data splitting and move some to src
* split out more dungeon data
* continue splitting out more dungeon data
* doc rescue team rank/pts funcs/data and exclusive pokemon ewram
* doc more sound things and decomp a func
* decomp LoadTeamRankBadge and label some data members
* split out rescue team and text util stuff
* forgot a constant
* match a few funcs and clean up a few
* cleaned up sub_80A28B4
Diffstat (limited to 'src/code_80A26CC.c')
-rw-r--r-- | src/code_80A26CC.c | 112 |
1 files changed, 81 insertions, 31 deletions
diff --git a/src/code_80A26CC.c b/src/code_80A26CC.c index 0217d51..110c278 100644 --- a/src/code_80A26CC.c +++ b/src/code_80A26CC.c @@ -14,12 +14,80 @@ struct unkStruct_80A2608 /* 0x11 */ u8 unk11; }; -extern struct unkStruct_80A2608 *sub_80A2608(s32); -extern struct unkStruct_80A2608 *sub_80A2620(u32); extern u8 sub_80023E4(u32); extern u8 sub_80973F4(s16); extern u8 sub_8097384(s16); +s16 sub_80A26B8(s16); extern s16 gUnknown_8116F9A[]; +extern s16 gUnknown_8116F24[]; +extern struct unkStruct_80A2608 gUnknown_81168A8[]; + +struct unkStruct_80A2608 *sub_80A2608(s16 r0) +{ + return &gUnknown_81168A8[r0]; +} + +struct unkStruct_80A2608 *sub_80A2620(s16 r0) +{ + u32 temp; + temp = sub_80A26B8(r0); + return &gUnknown_81168A8[temp]; +} + +s16 sub_80A2644(u32 r0) +{ + return gUnknown_8116F24[r0]; +} + +s16 sub_80A2654(s16 r0) +{ + struct unkStruct_80A2608 *temp; + temp = sub_80A2608(r0); + return temp->unkE; +} + +// This is very ugly +s32 sub_80A2668(u32 r0) +{ + u32 temp; + temp = 0xffc90000 + (r0 << 16); + if(temp >> 16 < 0x19) + { + return ((s32)temp >> 16); + } + else + { + return -1; + } +} + +u32 sub_80A2688(u8 r0, u32 r1) +{ + u32 uVar1; + + uVar1 = r0 - 0x4B; + + // u8 cast is needed for only this compare + if ((u8)uVar1 < 0x17) + { + return uVar1; + } + else + { + if(r0 == 0x2F) + { + return 0x17; + } + else if (r0 == 0x30) + { + return 0x18; + } + else + { + return -1; + } + } +} s16 sub_80A26B8(s16 r0) { @@ -143,8 +211,6 @@ u32 sub_80A27CC(s16 r0) u32 sub_80A2824(u8 r0) { s32 counter; - s32 counter2; - s32 temp2; struct unkStruct_80A2608 *temp; if(sub_80023E4(5) != 0) @@ -155,18 +221,16 @@ u32 sub_80A2824(u8 r0) { for(counter = 0; counter <= 0x2D; counter++) { - temp2 = counter << 0x10; - counter2 = temp2 >> 0x10; - temp = sub_80A2620(counter2); + temp = sub_80A2620(counter); if(temp->unk11 != 0) { if(temp->unkC == r0) { - if(sub_8097384(counter2) != 0) + if(sub_8097384(counter) != 0) { return 1; } - if(sub_80973F4(counter2) != 0) + if(sub_80973F4(counter) != 0) { return 1; } @@ -178,14 +242,12 @@ u32 sub_80A2824(u8 r0) { for(counter = 0; counter <= 0x2D; counter++) { - temp2 = counter << 0x10; - counter2 = temp2 >> 0x10; - temp = sub_80A2620(counter2); + temp = sub_80A2620(counter); if(temp->unk11 != 0) { if(temp->unkC == r0) { - if(sub_8097384(counter2) != 0) + if(sub_8097384(counter) != 0) { return 1; } @@ -199,27 +261,19 @@ u32 sub_80A2824(u8 r0) u32 sub_80A28B4(s16 r0) { - s32 counter2; - s32 temp2; struct unkStruct_80A2608 *temp; - temp2 = r0 << 0x10; - counter2 = temp2 >> 0x10; - temp = sub_80A2620(counter2); + temp = sub_80A2620(r0); if(temp->unk0 != -1) { - if(sub_8097384(counter2) == 0) + if(sub_8097384(r0) == 0 && sub_80973F4(r0) == 0) { - if(sub_80973F4(counter2) == 0) - { - return 0; - } + return 0; } else { return 1; } - return 1; } return 0; } @@ -227,24 +281,20 @@ u32 sub_80A28B4(s16 r0) u32 sub_80A28F0(u8 r0) { s32 counter; - s32 counter2; - s32 temp2; struct unkStruct_80A2608 *temp; for(counter = 0; counter <= 0x2D; counter++) { - temp2 = counter << 0x10; - counter2 = temp2 >> 0x10; - temp = sub_80A2620(counter2); + temp = sub_80A2620(counter); if(temp->unk11 != 0) { if(temp->unkC == r0) { - if(sub_8097384(counter2) != 0) + if(sub_8097384(counter) != 0) { return 1; } - if(sub_80973F4(counter2) != 0) + if(sub_80973F4(counter) != 0) { return 1; } |