through sub_8025324

This commit is contained in:
scnorton 2019-03-25 11:22:48 -04:00
parent c005c2f737
commit 4780f208d3
2 changed files with 200 additions and 458 deletions

View File

@ -5,462 +5,6 @@
.text
thumb_func_start sub_80250D4
sub_80250D4: @ 80250D4
push {r4,r5,lr}
bl sub_802671C
bl sub_8025F48
bl sub_8026C50
cmp r0, 0x1
bne _080250F2
bl sub_80272A4
movs r0, 0x5
bl sub_8026240
b _08025150
_080250F2:
ldr r0, =gUnknown_02022C98
ldr r2, [r0]
movs r1, 0x96
lsls r1, 1
adds r4, r2, r1
movs r1, 0x1
str r1, [r4]
movs r3, 0x1
adds r1, r2, 0
adds r1, 0x24
adds r5, r0, 0
ldrb r1, [r1]
cmp r3, r1
bcs _08025150
movs r1, 0x9A
lsls r1, 1
adds r0, r2, r1
ldr r0, [r0]
cmp r0, 0x1
beq _08025124
movs r0, 0
str r0, [r4]
b _08025150
.pool
_08025124:
adds r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
ldr r2, [r5]
adds r0, r2, 0
adds r0, 0x24
ldrb r0, [r0]
cmp r3, r0
bcs _08025150
lsls r0, r3, 2
movs r4, 0x98
lsls r4, 1
adds r1, r2, r4
adds r1, r0
ldr r0, [r1]
cmp r0, 0x1
beq _08025124
movs r0, 0x96
lsls r0, 1
adds r1, r2, r0
movs r0, 0
str r0, [r1]
_08025150:
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end sub_80250D4
thumb_func_start sub_8025158
sub_8025158: @ 8025158
push {lr}
bl sub_8026044
bl sub_8026C90
cmp r0, 0x1
bne _0802516C
movs r0, 0x5
bl sub_8026240
_0802516C:
pop {r0}
bx r0
thumb_func_end sub_8025158
thumb_func_start sub_8025170
sub_8025170: @ 8025170
push {r4,lr}
bl GetBlockReceivedStatus
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
bl sub_800A9D8
lsls r0, 24
lsrs r0, 24
cmp r4, r0
beq _0802518C
movs r0, 0
b _08025192
_0802518C:
bl ResetBlockReceivedFlags
movs r0, 0x1
_08025192:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_8025170
thumb_func_start sub_8025198
sub_8025198: @ 8025198
push {r4,r5,lr}
ldr r5, =gUnknown_02022C98
ldr r1, [r5]
ldrb r4, [r1, 0x10]
cmp r4, 0x1
beq _080251D0
cmp r4, 0x1
bgt _080251B4
cmp r4, 0
beq _080251BA
b _0802520C
.pool
_080251B4:
cmp r4, 0x2
beq _080251DC
b _0802520C
_080251BA:
adds r1, 0x4A
movs r0, 0
movs r2, 0x3C
bl SendBlock
lsls r0, 24
cmp r0, 0
beq _08025226
ldr r0, [r5]
strb r4, [r0, 0x8]
b _08025202
_080251D0:
bl IsLinkTaskFinished
lsls r0, 24
cmp r0, 0
beq _08025226
b _08025202
_080251DC:
bl sub_8025170
cmp r0, 0
beq _080251EE
ldr r0, [r5]
adds r1, r0, 0
adds r1, 0x24
ldrb r1, [r1]
strb r1, [r0, 0x8]
_080251EE:
ldr r2, [r5]
adds r1, r2, 0
adds r1, 0x24
ldrb r0, [r2, 0x8]
ldrb r1, [r1]
cmp r0, r1
bcc _08025226
ldrb r0, [r2, 0x14]
adds r0, 0x1
strb r0, [r2, 0x14]
_08025202:
ldr r1, [r5]
ldrb r0, [r1, 0x10]
adds r0, 0x1
strb r0, [r1, 0x10]
b _08025226
_0802520C:
movs r0, 0x1
bl WaitFanfare
lsls r0, 24
cmp r0, 0
beq _08025226
movs r0, 0x6
bl sub_8026240
ldr r0, =0x0000020b
movs r1, 0x4
bl FadeOutAndPlayNewMapMusic
_08025226:
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_8025198
thumb_func_start sub_8025230
sub_8025230: @ 8025230
push {r4,r5,lr}
ldr r5, =gUnknown_02022C98
ldr r2, [r5]
ldrb r4, [r2, 0x10]
cmp r4, 0x1
beq _08025274
cmp r4, 0x1
bgt _0802524C
cmp r4, 0
beq _08025252
b _080252DC
.pool
_0802524C:
cmp r4, 0x2
beq _08025282
b _080252DC
_08025252:
ldrb r0, [r2, 0x14]
lsls r1, r0, 1
adds r1, r0
lsls r1, 2
adds r1, 0x4A
adds r1, r2, r1
movs r0, 0
movs r2, 0x3C
bl SendBlock
lsls r0, 24
cmp r0, 0
beq _08025316
ldr r0, [r5]
strb r4, [r0, 0x8]
ldr r1, [r5]
b _080252CC
_08025274:
bl IsLinkTaskFinished
lsls r0, 24
cmp r0, 0
beq _08025316
ldr r1, [r5]
b _080252CC
_08025282:
bl sub_8025170
cmp r0, 0
beq _080252B4
movs r4, 0
b _080252AA
_0802528E:
ldr r0, [r5]
adds r0, 0x4A
ldr r1, =gBlockRecvBuffer
movs r2, 0x3C
bl memcpy
ldr r1, [r5]
adds r0, r1, 0
adds r0, 0x24
ldrb r0, [r0]
strb r0, [r1, 0x8]
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
_080252AA:
ldr r0, [r5]
adds r0, 0x24
ldrb r0, [r0]
cmp r4, r0
bcc _0802528E
_080252B4:
ldr r3, =gUnknown_02022C98
ldr r2, [r3]
adds r1, r2, 0
adds r1, 0x24
ldrb r0, [r2, 0x8]
ldrb r1, [r1]
cmp r0, r1
bcc _08025316
ldrb r0, [r2, 0x14]
adds r0, 0x1
strb r0, [r2, 0x14]
ldr r1, [r3]
_080252CC:
ldrb r0, [r1, 0x10]
adds r0, 0x1
strb r0, [r1, 0x10]
b _08025316
.pool
_080252DC:
movs r0, 0x1
bl WaitFanfare
lsls r0, 24
cmp r0, 0
beq _08025316
ldr r0, =gUnknown_02022C98
ldr r2, [r0]
adds r0, r2, 0
adds r0, 0x28
ldrb r0, [r0]
lsls r1, r0, 1
adds r1, r0
lsls r1, 2
adds r0, r2, 0
adds r0, 0x54
adds r0, r1
ldrh r1, [r0]
movs r3, 0x8A
lsls r3, 1
adds r0, r2, r3
strh r1, [r0]
movs r0, 0x6
bl sub_8026240
ldr r0, =0x0000020b
movs r1, 0x4
bl FadeOutAndPlayNewMapMusic
_08025316:
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_8025230
thumb_func_start sub_8025324
sub_8025324: @ 8025324
push {r4,r5,lr}
sub sp, 0x4
movs r1, 0x1
mov r0, sp
strb r1, [r0]
ldr r0, =gUnknown_02022C98
ldr r0, [r0]
ldrb r0, [r0, 0x10]
cmp r0, 0x4
bls _0802533A
b _08025458
_0802533A:
lsls r0, 2
ldr r1, =_0802534C
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_0802534C:
.4byte _08025360
.4byte _08025384
.4byte _0802539C
.4byte _080253BC
.4byte _080253DC
_08025360:
bl sub_802749C
movs r0, 0x1
bl sub_80289E8
bl sub_8028DFC
movs r0, 0x1
bl sub_8028EC8
movs r0, 0x2
bl sub_80292E0
ldr r0, =gUnknown_02022C98
ldr r1, [r0]
b _08025448
.pool
_08025384:
bl sub_802A770
cmp r0, 0
bne _08025466
movs r0, 0x5
bl sub_80292E0
ldr r0, =gUnknown_02022C98
ldr r1, [r0]
b _08025448
.pool
_0802539C:
bl sub_802A794
mov r1, sp
strb r0, [r1]
movs r0, 0
movs r2, 0x1
bl SendBlock
lsls r0, 24
cmp r0, 0
beq _08025466
ldr r0, =gUnknown_02022C98
ldr r1, [r0]
b _08025448
.pool
_080253BC:
bl IsLinkTaskFinished
lsls r0, 24
cmp r0, 0
beq _08025466
ldr r3, =gUnknown_02022C98
ldr r1, [r3]
ldrb r0, [r1, 0x10]
adds r0, 0x1
movs r2, 0
strb r0, [r1, 0x10]
ldr r0, [r3]
strb r2, [r0, 0x8]
b _08025466
.pool
_080253DC:
bl sub_8025170
cmp r0, 0
beq _08025422
movs r2, 0
ldr r1, =gUnknown_02022C98
ldr r0, [r1]
adds r0, 0x24
ldrb r0, [r0]
cmp r2, r0
bcs _08025422
adds r3, r1, 0
movs r5, 0x86
lsls r5, 1
ldr r4, =gBlockRecvBuffer
_080253FA:
ldr r1, [r3]
adds r1, r2, r1
adds r1, r5
lsls r0, r2, 8
adds r0, r4
ldrb r0, [r0]
strb r0, [r1]
ldr r1, [r3]
adds r0, r1, 0
adds r0, 0x24
ldrb r0, [r0]
strb r0, [r1, 0x8]
adds r0, r2, 0x1
lsls r0, 24
lsrs r2, r0, 24
ldr r0, [r3]
adds r0, 0x24
ldrb r0, [r0]
cmp r2, r0
bcc _080253FA
_08025422:
ldr r4, =gUnknown_02022C98
ldr r2, [r4]
adds r1, r2, 0
adds r1, 0x24
ldrb r0, [r2, 0x8]
ldrb r1, [r1]
cmp r0, r1
bcc _08025466
ldrb r0, [r2, 0x14]
adds r0, 0x1
strb r0, [r2, 0x14]
lsls r0, 24
lsrs r0, 24
cmp r0, 0x77
bls _08025466
movs r0, 0x6
bl sub_80292E0
ldr r1, [r4]
_08025448:
ldrb r0, [r1, 0x10]
adds r0, 0x1
strb r0, [r1, 0x10]
b _08025466
.pool
_08025458:
bl sub_802A770
cmp r0, 0
bne _08025466
movs r0, 0x7
bl sub_8026240
_08025466:
add sp, 0x4
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end sub_8025324
thumb_func_start sub_8025470
sub_8025470: @ 8025470
push {r4,r5,lr}

View File

@ -42,7 +42,9 @@ struct DodrioBerryPickingSubstruct_318C
struct DodrioBerryPickingStruct
{
/*0x0000*/ void (*savedCallback)(void);
/*0x0004*/ u8 filler_0004[8];
/*0x0004*/ u8 filler_0004[4];
/*0x0008*/ u8 unk_0008;
/*0x0009*/ u8 filler_0009[3];
/*0x000C*/ u8 unk_000C;
/*0x000D*/ u8 filler_000D[3];
/*0x0010*/ u8 unk_0010;
@ -88,7 +90,9 @@ struct DodrioBerryPickingStruct
/*0x00F4*/ u8 unk_00F4[11][2];
/*0x010A*/ u8 filler_010A[2];
/*0x010C*/ u8 unk_010C[5];
/*0x0111*/ u8 filler_0111[7];
/*0x0111*/ u8 filler_0111[3];
/*0x0114*/ u16 unk_0114;
// align 2
/*0x0118*/ u32 unk_0118;
/*0x011C*/ u32 unk_011C;
/*0x0120*/ u32 unk_0120;
@ -150,19 +154,27 @@ void sub_802671C(void);
void sub_8026AF4(void);
void sub_8026B28(void);
void sub_8026B5C(u8, u8*, u8*);
bool32 sub_8026C50(void);
bool32 sub_8026C90(void);
void sub_80272A4(void);
void sub_80273F0(void);
void sub_802749C(void);
u8 sub_8027518(u8);
void sub_80283A8(void);
void sub_8028408(struct DodrioBerryPickingSubstruct_318C *, u8, u8, u8);
void sub_8028504(u8);
void sub_802868C(u8, u8);
void sub_8028734(void);
void sub_80289E8(u8);
void sub_8028A34(void);
void sub_8028A88(void);
void sub_8028D44(void);
void sub_8028DFC(void);
void sub_8028EC8(u8);
void sub_8029274(struct DodrioBerryPickingSubstruct_0160 *);
void sub_80292E0(u8);
bool32 sub_802A770(void);
u8 sub_802A794(void);
extern void (*const gUnknown_082F7AC4[])(void);
extern void (*const gUnknown_082F7AF4[])(void);
@ -514,3 +526,189 @@ void sub_8024FFC(void)
}
sub_8026044();
}
void sub_80250D4(void)
{
u8 i;
sub_802671C();
sub_8025F48();
if (sub_8026C50() == 1)
{
sub_80272A4();
sub_8026240(5);
}
else
{
gUnknown_02022C98->unk_012C = 1;
for (i = 1; i < gUnknown_02022C98->unk_0024; i++)
{
if (gUnknown_02022C98->unk_0130[i] != 1)
{
gUnknown_02022C98->unk_012C = 0;
break;
}
}
}
}
void sub_8025158(void)
{
sub_8026044();
if (sub_8026C90() == 1)
sub_8026240(5);
}
bool32 sub_8025170(void)
{
u8 r4 = GetBlockReceivedStatus();
u8 r0 = sub_800A9D8();
if (r4 == r0)
{
ResetBlockReceivedFlags();
return TRUE;
}
else
{
return FALSE;
}
}
void sub_8025198(void)
{
switch (gUnknown_02022C98->unk_0010)
{
case 0:
if (SendBlock(0, gUnknown_02022C98->unk_004A, sizeof(gUnknown_02022C98->unk_004A)))
{
gUnknown_02022C98->unk_0008 = 0;
gUnknown_02022C98->unk_0010++;
}
break;
case 1:
if (IsLinkTaskFinished())
{
gUnknown_02022C98->unk_0010++;
}
break;
case 2:
if (sub_8025170())
{
gUnknown_02022C98->unk_0008 = gUnknown_02022C98->unk_0024;
}
if (gUnknown_02022C98->unk_0008 >= gUnknown_02022C98->unk_0024)
{
gUnknown_02022C98->unk_0014++;
gUnknown_02022C98->unk_0010++;
}
break;
default:
if (WaitFanfare(TRUE))
{
sub_8026240(6);
FadeOutAndPlayNewMapMusic(MUS_RG_WIN_YASEI, 4);
}
break;
}
}
void sub_8025230(void)
{
u8 i;
switch (gUnknown_02022C98->unk_0010) {
case 0:
if (SendBlock(0, gUnknown_02022C98->unk_004A[gUnknown_02022C98->unk_0014],
sizeof(gUnknown_02022C98->unk_004A))) {
gUnknown_02022C98->unk_0008 = 0;
gUnknown_02022C98->unk_0010++;
}
break;
case 1:
if (IsLinkTaskFinished()) {
gUnknown_02022C98->unk_0010++;
}
break;
case 2:
if (sub_8025170()) {
for (i = 0; i < gUnknown_02022C98->unk_0024; i++) {
memcpy(gUnknown_02022C98->unk_004A, gBlockRecvBuffer, sizeof(gUnknown_02022C98->unk_004A));
gUnknown_02022C98->unk_0008 = gUnknown_02022C98->unk_0024;
}
}
if (gUnknown_02022C98->unk_0008 >= gUnknown_02022C98->unk_0024) {
gUnknown_02022C98->unk_0014++;
gUnknown_02022C98->unk_0010++;
}
break;
default:
if (WaitFanfare(TRUE)) {
gUnknown_02022C98->unk_0114 = gUnknown_02022C98->unk_004A[gUnknown_02022C98->multiplayerId][5];
sub_8026240(6);
FadeOutAndPlayNewMapMusic(MUS_RG_WIN_YASEI, 4);
}
break;
}
}
void sub_8025324(void)
{
u8 sp00 = 1;
u8 i;
switch (gUnknown_02022C98->unk_0010)
{
case 0:
sub_802749C();
sub_80289E8(1);
sub_8028DFC();
sub_8028EC8(1);
sub_80292E0(2);
gUnknown_02022C98->unk_0010++;
break;
case 1:
if (!sub_802A770())
{
sub_80292E0(5);
gUnknown_02022C98->unk_0010++;
}
break;
case 2:
sp00 = sub_802A794();
if (SendBlock(0, &sp00, sizeof(sp00)))
{
gUnknown_02022C98->unk_0010++;
}
break;
case 3:
if (IsLinkTaskFinished())
{
gUnknown_02022C98->unk_0010++;
gUnknown_02022C98->unk_0008 = 0;
}
break;
case 4:
if (sub_8025170())
{
for (i = 0; i < gUnknown_02022C98->unk_0024; i++)
{
*(gUnknown_02022C98->unk_010C + i) = *(u8 *)gBlockRecvBuffer[i];
gUnknown_02022C98->unk_0008 = gUnknown_02022C98->unk_0024;
}
}
if (gUnknown_02022C98->unk_0008 >= gUnknown_02022C98->unk_0024) {
if (++gUnknown_02022C98->unk_0014 >= 120)
{
sub_80292E0(6);
gUnknown_02022C98->unk_0010++;
}
}
break;
default:
if (!sub_802A770())
{
sub_8026240(7);
}
break;
}
}