more documentation and cleanup

This commit is contained in:
Seth Barberee 2024-02-12 21:20:54 -08:00
parent fb62dd4a7b
commit 04efa8e29d
5 changed files with 59 additions and 66 deletions

View File

@ -5,15 +5,6 @@
.text
thumb_func_start HandleWonderTile
HandleWonderTile:
push {lr}
movs r2, 0
bl sub_8079E34
pop {r0}
bx r0
thumb_func_end HandleWonderTile
thumb_func_start HandleSealTrap
HandleSealTrap:
push {r4-r7,lr}

View File

@ -120,19 +120,19 @@ _08081526:
ldr r0, _08081638
adds r1, r0
adds r0, r7, 0
bl sub_80830D8
bl SavePosition
ldr r1, [r4]
ldr r2, _0808163C
adds r1, r2
adds r0, r7, 0
bl sub_80830D8
bl SavePosition
ldr r6, _08081640
movs r5, 0x7
_08081560:
ldr r1, [r4]
adds r1, r6
adds r0, r7, 0
bl sub_80830D8
bl SavePosition
adds r6, 0x4
subs r5, 0x1
cmp r5, 0
@ -577,7 +577,7 @@ sub_80818E4:
adds r4, 0x10
adds r0, r5, 0
adds r1, r4, 0
bl sub_80830D8
bl SavePosition
pop {r4,r5}
pop {r0}
bx r0

View File

@ -1,4 +1,5 @@
#include "global.h"
#include "structs/str_position.h"
extern void sub_8082FE0(u32, void *, u32);
extern void sub_8082FA8(void *, void *, u32);
@ -76,10 +77,10 @@ void sub_80830B4(u32 *param_1, u8 param_2)
sub_8082FA8(param_1,&local_8,1);
}
void sub_80830D8(u32 *param_1, u16 *param_2)
void SavePosition(u32 *param_1, Position *param_2)
{
sub_8082FA8(param_1, &param_2[0], 1);
sub_8082FA8(param_1, &param_2[1], 1);
sub_8082FA8(param_1, &param_2->x, 1);
sub_8082FA8(param_1, &param_2->y, 1);
}
void sub_80830F8(u32 *param_1, u32 *param_2)
@ -96,9 +97,9 @@ void sub_808312C(u32 *param_1, u16 *param_2)
sub_8082FA8(param_1, &param_2[1], 1);
}
void sub_808314C(u32 *param_1, u32 *param_2, u32 param_3)
void SaveSpeedCounters(u32 *param_1, u32 *speedCounters, u32 numCounters)
{
sub_8082FA8(param_1, param_2, param_3);
sub_8082FA8(param_1, speedCounters, numCounters);
}
u16 sub_8083158(u32 param_1)

View File

@ -63,6 +63,7 @@ extern u32 sub_806B7F8(struct unkStruct_806B7F8 *, u32);
void sub_806A9B4(Entity *, u32);
void sub_8079E34(Entity *param_1, Entity *param_2, u32);
s16 sub_803D970(u32);
u8 sub_806AA0C(s32, s32);
void sub_80421EC(Position *, u32);
@ -745,17 +746,15 @@ void HandlePitfallTrap(Entity *pokemon, Entity *target, Tile *tile)
void HandleSummonTrap(Entity *pokemon,Position *pos)
{
int r6;
s32 r4;
u32 direction;
int pokemonSummonCount;
s16 species;
struct unkStruct_806B7F8 stack;
s32 i;
s32 i;
r6 = DungeonRandInt(3);
r4 = r6 + 2;
r4 = DungeonRandInt(3) + 2;
direction = DungeonRandInt(NUM_DIRECTIONS);
if (IsBossFight()) {
goto _ret;
@ -764,7 +763,7 @@ void HandleSummonTrap(Entity *pokemon,Position *pos)
{
pokemonSummonCount = 0;
if (pokemonSummonCount < r4) {
for (i = 0; i < r6 + 2; i++)
for (i = 0; i < r4; i++)
{
species = sub_803D970(0);
direction &= DIRECTION_MASK;
@ -832,3 +831,8 @@ void HandlePPZeroTrap(Entity *param_1,Entity *param_2)
sub_80522F4(param_1,param_2,*gUnknown_80FDAA0);
}
}
void HandleWonderTile(Entity *param_1, Entity *param_2)
{
sub_8079E34(param_1, param_2, 0);
}

View File

@ -17,7 +17,6 @@ void sub_80830B4(void *, u8);
void sub_8083030(void *, u16);
void sub_8080E0C(unkStruct_8094924 *, Entity *);
void sub_808300C(void *, u8 *);
void sub_8081788(void *, Item *);
void sub_8080B90(unkStruct_8094924 *param_1);
void SaveItemData(unkStruct_8094924 *param_1);
@ -29,7 +28,40 @@ void sub_8080CF0(unkStruct_8094924 *param_1);
void nullsub_98(unkStruct_8094924 *param_1);
void sub_8082F9C(unkStruct_8094924 *param_1, u32, u32);
void sub_8049ED4(void);
void sub_8083060(void *, u32);
void sub_80817F4(void *, u32);
void sub_80830A0(void *, u32);
void sub_808180C(void *, u32);
void sub_8083048(void *, u32);
void sub_80818C8(void *, bool8 *);
void sub_80817C8(void *, void *);
void sub_8081B34(void *, void *);
void sub_8081B08(void *, Move *);
void sub_8081824(void *, u32);
void sub_80817B0(void *, u32);
void SavePosition(void*, Position *);
void sub_80818E4(void *, u8 *);
void sub_8081B54(void *, u8 *);
void sub_808186C(void *, s32);
void sub_8081854(void *, s32);
void sub_808183C(void *, s32);
void sub_8081AB8(void *, bool8 *);
void sub_8081A9C(void *, u8*);
void sub_8081A80(void *, u8*);
void sub_8081A74(void *, u8*);
void sub_8081A58(void *, u8*);
void sub_8081A24(void *, u8*);
void sub_8081994(void *, u8*);
void sub_8081968(void *, u8*);
void sub_808193C(void *, u8*);
void sub_8081920(void *, u8*);
void sub_8081880(void *, u8);
void sub_8081898(void *, s16 *);
void sub_80819B0(void *, u8 *);
void sub_80819D4(void *, u8 *);
void sub_80819F0(void *, u8 *);
void SaveSpeedCounters(void *, u8 *, u32);
void sub_80818B8(void *, u32);
void sub_803E708(u32, u32);
void sub_80421C0(Entity *, u32);
void sub_804687C(Entity *, Position *, Position *, Item *, u32);
@ -188,46 +220,11 @@ void sub_8080CF0(unkStruct_8094924 *param_1)
}
}
void sub_8083060(void *, u32);
void sub_80817F4(void *, u32);
void sub_80830A0(void *, u32);
void sub_808180C(void *, u32);
void sub_8083048(void *, u32);
void sub_80818C8(void *, bool8 *);
void sub_80817C8(void *, void *);
void sub_8081B34(void *, void *);
void sub_8081B08(void *, Move *);
void sub_8081824(void *, u32);
void sub_80817B0(void *, u32);
void sub_80830D8(void*, Position *);
void sub_80818E4(void *, u8 *);
void sub_8081B54(void *, u8 *);
void sub_808186C(void *, s32);
void sub_8081854(void *, s32);
void sub_808183C(void *, s32);
void sub_8081AB8(void *, bool8 *);
void sub_8081A9C(void *, u8*);
void sub_8081A80(void *, u8*);
void sub_8081A74(void *, u8*);
void sub_8081A58(void *, u8*);
void sub_8081A24(void *, u8*);
void sub_8081994(void *, u8*);
void sub_8081968(void *, u8*);
void sub_808193C(void *, u8*);
void sub_8081920(void *, u8*);
void sub_8081880(void *, u8);
void sub_8081898(void *, s16 *);
void sub_80819B0(void *, u8 *);
void sub_80819D4(void *, u8 *);
void sub_80819F0(void *, u8 *);
void sub_808314C(void *, u8 *, u32);
void sub_80818B8(void *, u32);
void sub_8080E0C(unkStruct_8094924 *param_1,Entity *param_2)
{
Position *pos;
EntityInfo *info;
int iVar4;
int counter;
EntityInfo info2;
u32 uStack_ac;
u32 uStack_a8;
@ -364,9 +361,9 @@ void sub_8080E0C(unkStruct_8094924 *param_1,Entity *param_2)
puStack_90 = &info->clientType;
pos = info->prevPos;
for(iVar4 = 0; iVar4 < 4; iVar4++)
for(counter = 0; counter < NUM_PREV_POS; counter++)
{
sub_80830D8(param_1,pos);
SavePosition(param_1,pos);
pos++;
}
@ -407,8 +404,8 @@ void sub_8080E0C(unkStruct_8094924 *param_1,Entity *param_2)
sub_808183C(param_1,*puStack_24);
sub_8081854(param_1,info->targetingDecoy);
sub_808186C(param_1,info->speedStage);
sub_808314C(param_1,info->speedUpCounters,5);
sub_808314C(param_1,info->speedDownCounters,5);
SaveSpeedCounters(param_1,info->speedUpCounters,NUM_SPEED_COUNTERS);
SaveSpeedCounters(param_1,info->speedDownCounters,NUM_SPEED_COUNTERS);
sub_8083060(param_1,info->stockpileStage);
sub_8083060(param_1,info->fill113);
sub_8083060(param_1,(u8)info->moveRandomly);
@ -437,7 +434,7 @@ void sub_8080E0C(unkStruct_8094924 *param_1,Entity *param_2)
sub_8083060(param_1,info->unk167);
sub_8083060(param_1,info->unk168);
sub_8083060(param_1,info->turnsSinceWarpScarfActivation);
sub_80830D8(param_1,&(info->targetPos));
SavePosition(param_1,&(info->targetPos));
sub_80830A0(param_1,info->unk174);
sub_8083030(param_1,info->unk178);
sub_8083048(param_1,info->unk1F8);