mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 19:47:35 +01:00
sub_8026634
This commit is contained in:
parent
df538ff7ab
commit
2eba82b0fb
@ -5,122 +5,6 @@
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_8026634
|
||||
sub_8026634: @ 8026634
|
||||
push {r4-r7,lr}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
lsls r1, 24
|
||||
lsrs r3, r1, 24
|
||||
lsls r2, 24
|
||||
lsrs r6, r2, 24
|
||||
movs r7, 0
|
||||
ldr r2, =gUnknown_02022C98
|
||||
ldr r1, [r2]
|
||||
adds r0, r1, 0
|
||||
adds r0, 0x24
|
||||
ldrb r0, [r0]
|
||||
subs r0, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
ldr r0, =0x000032e0
|
||||
adds r1, r0
|
||||
mov r12, r2
|
||||
cmp r3, 0x2
|
||||
beq _08026670
|
||||
cmp r3, 0x2
|
||||
bgt _08026676
|
||||
cmp r3, 0x1
|
||||
beq _08026674
|
||||
b _08026676
|
||||
.pool
|
||||
_08026670:
|
||||
movs r7, 0x1
|
||||
b _08026676
|
||||
_08026674:
|
||||
movs r7, 0x2
|
||||
_08026676:
|
||||
adds r0, r1, 0
|
||||
adds r0, 0xB
|
||||
adds r0, r6
|
||||
ldrb r0, [r0]
|
||||
subs r0, 0x6
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
bhi _080266D4
|
||||
ldr r0, =gUnknown_082F449C+0x113
|
||||
lsls r1, r4, 1
|
||||
adds r1, r4
|
||||
adds r1, r7, r1
|
||||
lsls r2, r5, 4
|
||||
subs r2, r5
|
||||
adds r1, r2
|
||||
adds r1, r0
|
||||
ldrb r1, [r1]
|
||||
cmp r6, r1
|
||||
bne _0802670A
|
||||
mov r0, r12
|
||||
ldr r1, [r0]
|
||||
adds r0, r1, 0
|
||||
adds r0, 0xC4
|
||||
adds r0, r6
|
||||
ldrb r0, [r0]
|
||||
subs r0, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
bhi _080266D0
|
||||
lsls r0, r4, 4
|
||||
subs r0, r4
|
||||
lsls r0, 2
|
||||
adds r0, r1, r0
|
||||
ldr r1, =0x000031d4
|
||||
adds r0, r1
|
||||
movs r1, 0x1
|
||||
strb r1, [r0]
|
||||
b _0802670A
|
||||
.pool
|
||||
_080266D0:
|
||||
movs r0, 0x1
|
||||
b _0802670C
|
||||
_080266D4:
|
||||
ldr r0, =gUnknown_082F449C+0x113
|
||||
lsls r1, r4, 1
|
||||
adds r1, r4
|
||||
adds r1, r7, r1
|
||||
lsls r2, r5, 4
|
||||
subs r2, r5
|
||||
adds r1, r2
|
||||
adds r1, r0
|
||||
ldrb r1, [r1]
|
||||
cmp r6, r1
|
||||
bne _0802670A
|
||||
mov r1, r12
|
||||
ldr r0, [r1]
|
||||
adds r0, 0xA8
|
||||
adds r0, r4
|
||||
movs r1, 0x4
|
||||
strb r1, [r0]
|
||||
mov r0, r12
|
||||
ldr r1, [r0]
|
||||
lsls r0, r4, 4
|
||||
subs r0, r4
|
||||
lsls r0, 2
|
||||
adds r1, r0
|
||||
ldr r0, =0x000031d4
|
||||
adds r1, r0
|
||||
movs r0, 0x1
|
||||
strb r0, [r1]
|
||||
_0802670A:
|
||||
movs r0, 0
|
||||
_0802670C:
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_8026634
|
||||
|
||||
thumb_func_start sub_802671C
|
||||
sub_802671C: @ 802671C
|
||||
push {r4-r7,lr}
|
||||
|
@ -39,36 +39,39 @@ gUnknown_082F449C:: @ 82F449C
|
||||
.byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x06, 0x07, 0x08
|
||||
.byte 0x09, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
|
||||
.byte 0x08, 0x09, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05
|
||||
.byte 0x06, 0x07, 0x08, 0x04, 0x05, 0x06, 0x00, 0x00
|
||||
.byte 0x06, 0x07, 0x08
|
||||
|
||||
gUknnown_082F45AF::
|
||||
.byte 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03
|
||||
.byte 0x04, 0x05, 0x05, 0x06, 0x03, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05
|
||||
.byte 0x06, 0x06, 0x07, 0x02, 0x02, 0x03, 0x04, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x05
|
||||
.byte 0x05, 0x06, 0x07, 0x07, 0x08, 0x01, 0x01, 0x02
|
||||
.byte 0x03, 0x00, 0x00, 0x00, 0x04, 0x05, 0x06, 0x06
|
||||
.byte 0x07, 0x08, 0x08, 0x09, 0x00, 0x00, 0x01, 0x02
|
||||
.byte 0x02, 0x03, 0x04, 0x01, 0x00, 0x01, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x03, 0x04, 0x05, 0x05, 0x06, 0x03
|
||||
.byte 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x04, 0x05, 0x06, 0x06, 0x07, 0x02, 0x02
|
||||
.byte 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x04, 0x05, 0x05, 0x06, 0x07, 0x07, 0x08
|
||||
.byte 0x01, 0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0x04
|
||||
.byte 0x05, 0x06, 0x06, 0x07, 0x08, 0x08, 0x09, 0x00
|
||||
.byte 0x00, 0x01, 0x02, 0x02, 0x03, 0x04, 0x01, 0x00
|
||||
.byte 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01
|
||||
.byte 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00
|
||||
.byte 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01
|
||||
.byte 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x01, 0x02
|
||||
.byte 0x01, 0x02, 0x03, 0x02, 0x03, 0x04, 0x03, 0x04
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x09, 0x09, 0x09, 0x09
|
||||
.byte 0x01, 0x01, 0x01, 0x09, 0x09, 0x09, 0x09, 0x09
|
||||
.byte 0x09, 0x09, 0x00, 0x00, 0x01, 0x01, 0x00, 0x09
|
||||
.byte 0x09, 0x09, 0x09, 0x09, 0x02, 0x02, 0x00, 0x00
|
||||
.byte 0x01, 0x01, 0x01, 0x09, 0x09, 0x09, 0x03, 0x03
|
||||
.byte 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x09
|
||||
.byte 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x01, 0x01
|
||||
.byte 0x02, 0x02, 0x03, 0x05, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x04, 0x06, 0x00, 0x00, 0x00, 0x03, 0x05, 0x07
|
||||
.byte 0x00, 0x00, 0x02, 0x04, 0x06, 0x08, 0x00, 0x01
|
||||
.byte 0x03, 0x05, 0x06, 0x09
|
||||
.byte 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01
|
||||
.byte 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x03, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02
|
||||
.byte 0x03, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x04
|
||||
.byte 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x03
|
||||
.byte 0x02, 0x03, 0x04, 0x03, 0x04, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x09, 0x09, 0x09, 0x09, 0x01, 0x01, 0x01
|
||||
.byte 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x00
|
||||
.byte 0x00, 0x01, 0x01, 0x00, 0x09, 0x09, 0x09, 0x09
|
||||
.byte 0x09, 0x02, 0x02, 0x00, 0x00, 0x01, 0x01, 0x01
|
||||
.byte 0x09, 0x09, 0x09, 0x03, 0x03, 0x00, 0x00, 0x01
|
||||
.byte 0x01, 0x02, 0x02, 0x03, 0x09, 0x03, 0x03, 0x04
|
||||
.byte 0x04, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03
|
||||
.byte 0x05, 0x00, 0x00, 0x00, 0x00, 0x04, 0x06, 0x00
|
||||
.byte 0x00, 0x00, 0x03, 0x05, 0x07, 0x00, 0x00, 0x02
|
||||
.byte 0x04, 0x06, 0x08, 0x00, 0x01, 0x03, 0x05, 0x06
|
||||
.byte 0x09
|
||||
|
||||
.align 2
|
||||
gUnknown_082F7DF0_UnrefDupe:: @ 82F4698
|
||||
|
@ -30,13 +30,17 @@ struct DodrioBerryPickingStruct_2022CF4
|
||||
u8 filler_00[0x40];
|
||||
}; // size = 0x40
|
||||
|
||||
struct DodrioBerryPickingSubstruct_31A0_14
|
||||
{
|
||||
u8 unk_0[11];
|
||||
u8 unk_B[11];
|
||||
};
|
||||
|
||||
struct DodrioBerryPickingSubstruct_31A0
|
||||
{
|
||||
u8 unk_00[0x10];
|
||||
u32 unk_10;
|
||||
u8 unk_14[11];
|
||||
u8 unk_1F[11];
|
||||
u8 filler_2A[2];
|
||||
struct DodrioBerryPickingSubstruct_31A0_14 unk_14;
|
||||
u8 unk_2C;
|
||||
u8 filler_2D[3];
|
||||
u8 unk_30;
|
||||
@ -233,6 +237,7 @@ u8 sub_802A794(void);
|
||||
|
||||
extern const u8 gUnknown_082F7A88[][3];
|
||||
extern const u8 gUnknown_082F449C[];
|
||||
extern const u8 gUknnown_082F45AF[];
|
||||
extern const u8 gUnknown_082F7A94[];
|
||||
extern void (*const gUnknown_082F7AC4[])(void);
|
||||
extern void (*const gUnknown_082F7AF4[])(void);
|
||||
@ -1304,13 +1309,12 @@ void sub_8026044(void)
|
||||
}
|
||||
for (r4 = r8; r4 < r7; r4++)
|
||||
{
|
||||
struct DodrioBerryPickingSubstruct_31A0 * ptr = &gUnknown_02022C98->unk_31A0[gUnknown_02022C98->multiplayerId];
|
||||
u8 * r1 = ptr->unk_14;
|
||||
if (ptr->unk_1F[r4] >= 10)
|
||||
struct DodrioBerryPickingSubstruct_31A0_14 * ptr = &gUnknown_02022C98->unk_31A0[gUnknown_02022C98->multiplayerId].unk_14;
|
||||
if (ptr->unk_B[r4] >= 10)
|
||||
{
|
||||
if (gUnknown_02022C98->unk_0148[r4] == 0)
|
||||
{
|
||||
PlaySE(SE_FUUSEN1 + r1[r4]);
|
||||
PlaySE(SE_FUUSEN1 + ptr->unk_0[r4]);
|
||||
gUnknown_02022C98->unk_0148[r4] = 1;
|
||||
}
|
||||
}
|
||||
@ -1403,10 +1407,9 @@ void sub_80262C0(void)
|
||||
|
||||
for (i = start; i < finish; i++)
|
||||
{
|
||||
struct DodrioBerryPickingSubstruct_31A0 * ptr = &gUnknown_02022C98->unk_32CC;
|
||||
u8 * r4 = gUnknown_02022C98->unk_32CC.unk_14;
|
||||
ptr->unk_1F[i] = (i % 2 == 0) ? 1 : 0;
|
||||
r4[i] = 0;
|
||||
struct DodrioBerryPickingSubstruct_31A0_14 * ptr = &gUnknown_02022C98->unk_32CC.unk_14;
|
||||
ptr->unk_B[i] = (i % 2 == 0) ? 1 : 0;
|
||||
ptr->unk_0[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1475,7 +1478,7 @@ void sub_8026324(void)
|
||||
{
|
||||
r3 = 2;
|
||||
}
|
||||
r2 = gUnknown_082F7A88[r3][gUnknown_02022C98->unk_31A0[0].unk_14[r5]] - gUnknown_02022C98->unk_00D0[r5];
|
||||
r2 = gUnknown_082F7A88[r3][gUnknown_02022C98->unk_31A0[0].unk_14.unk_0[r5]] - gUnknown_02022C98->unk_00D0[r5];
|
||||
if (r2 < 6)
|
||||
{
|
||||
gUnknown_02022C98->unk_009C[r5] += r2;
|
||||
@ -1516,8 +1519,8 @@ void sub_8026324(void)
|
||||
sub_8026F1C(0, r5, r4);
|
||||
sub_8027234(1);
|
||||
sub_8026D1C(r4);
|
||||
gUnknown_02022C98->unk_00E8[r5] = gUnknown_02022C98->unk_32CC.unk_14[r5];
|
||||
gUnknown_02022C98->unk_32CC.unk_14[r5] = 3;
|
||||
gUnknown_02022C98->unk_00E8[r5] = gUnknown_02022C98->unk_32CC.unk_14.unk_0[r5];
|
||||
gUnknown_02022C98->unk_32CC.unk_14.unk_0[r5] = 3;
|
||||
gUnknown_02022C98->unk_00F4[r5][0] = 0xFF;
|
||||
gUnknown_02022C98->unk_00F4[r5][1] = 0xFF;
|
||||
}
|
||||
@ -1914,3 +1917,48 @@ void sub_8026324(void)
|
||||
"\t.pool");
|
||||
}
|
||||
#endif // NONMATCHING
|
||||
|
||||
u32 sub_8026634(u8 a0, u8 a1, u8 a2)
|
||||
{
|
||||
s32 r7 = 0;
|
||||
u8 r5 = gUnknown_02022C98->unk_0024 - 1;
|
||||
struct DodrioBerryPickingSubstruct_31A0_14 * ptr = &gUnknown_02022C98->unk_32CC.unk_14;
|
||||
|
||||
switch (a1)
|
||||
{
|
||||
case 3:
|
||||
default:
|
||||
r7 = 0;
|
||||
break;
|
||||
case 2:
|
||||
r7 = 1;
|
||||
break;
|
||||
case 1:
|
||||
r7 = 2;
|
||||
break;
|
||||
}
|
||||
if (ptr->unk_B[a2] == 6 || ptr->unk_B[a2] == 7)
|
||||
{
|
||||
if (a2 == gUknnown_082F45AF[r7 + a0 * 3 + 15 * r5])
|
||||
{
|
||||
if (gUnknown_02022C98->unk_00C4[a2] == 1 || gUnknown_02022C98->unk_00C4[a2] == 2)
|
||||
{
|
||||
gUnknown_02022C98->unk_31A0[a0].unk_34 = 1;
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (a2 == gUknnown_082F45AF[r7 + a0 * 3 + 15 * r5])
|
||||
{
|
||||
gUnknown_02022C98->unk_00A8[a0] = 4;
|
||||
gUnknown_02022C98->unk_31A0[a0].unk_34 = 1;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user