through sub_8024F38

This commit is contained in:
PikalaxALT 2019-03-24 22:56:16 -04:00
parent d49d3b6858
commit d4cca4ffa2
3 changed files with 72 additions and 118 deletions

View file

@ -5,122 +5,6 @@
.text
thumb_func_start sub_8024F10
sub_8024F10: @ 8024F10
push {lr}
ldr r0, =gUnknown_02022C98
ldr r1, [r0]
ldrb r0, [r1, 0x10]
cmp r0, 0
bne _08024F2E
movs r2, 0x8E
lsls r2, 1
adds r0, r1, r2
ldr r0, [r0]
cmp r0, 0
beq _08024F2E
movs r0, 0x4
bl sub_8026240
_08024F2E:
pop {r0}
bx r0
.pool
thumb_func_end sub_8024F10
thumb_func_start sub_8024F38
sub_8024F38: @ 8024F38
push {r4,lr}
ldr r4, =gUnknown_02022C98
ldr r2, [r4]
ldrb r0, [r2, 0x10]
cmp r0, 0
bne _08024FF6
adds r0, r2, 0
adds r0, 0x40
ldrb r0, [r0]
cmp r0, 0x9
bhi _08024FE8
adds r0, r2, 0
adds r0, 0xA8
ldrb r0, [r0]
cmp r0, 0
bne _08024FEE
ldr r0, =gMain
ldrh r1, [r0, 0x2E]
movs r0, 0x40
ands r0, r1
cmp r0, 0
beq _08024F88
ldr r1, =0x000031cc
adds r0, r2, r1
ldrb r1, [r0]
cmp r1, 0
bne _08024FEE
ldr r3, =0x000031d0
adds r0, r2, r3
strb r1, [r0]
movs r0, 0x2
b _08024FC2
.pool
_08024F88:
movs r0, 0x10
ands r0, r1
cmp r0, 0
beq _08024FA8
ldr r3, =0x000031cc
adds r0, r2, r3
ldrb r1, [r0]
cmp r1, 0
bne _08024FEE
adds r3, 0x4
adds r0, r2, r3
strb r1, [r0]
movs r0, 0x1
b _08024FC2
.pool
_08024FA8:
movs r0, 0x20
ands r0, r1
cmp r0, 0
beq _08024FD4
ldr r3, =0x000031cc
adds r0, r2, r3
ldrb r1, [r0]
cmp r1, 0
bne _08024FEE
adds r3, 0x4
adds r0, r2, r3
strb r1, [r0]
movs r0, 0x3
_08024FC2:
bl sub_8027518
ldr r1, [r4]
ldr r2, =0x000031cc
adds r1, r2
strb r0, [r1]
b _08024FEE
.pool
_08024FD4:
movs r0, 0
bl sub_8027518
ldr r1, [r4]
ldr r3, =0x000031cc
adds r1, r3
strb r0, [r1]
b _08024FEE
.pool
_08024FE8:
movs r0, 0xB
bl sub_8026240
_08024FEE:
bl sub_802671C
bl sub_8025F48
_08024FF6:
pop {r4}
pop {r0}
bx r0
thumb_func_end sub_8024F38
thumb_func_start sub_8024FFC
sub_8024FFC: @ 8024FFC
push {lr}

View file

@ -86,6 +86,11 @@
#define T2_READ_32(ptr) ((ptr)[0] + ((ptr)[1] << 8) + ((ptr)[2] << 16) + ((ptr)[3] << 24))
#define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr)
// Macros for checking the joypad
#define TEST_BUTTON(field, button) ({(field) & (button);})
#define JOY_NEW(button) TEST_BUTTON(gMain.newKeys, button)
#define JOY_HELD(button) TEST_BUTTON(gMain.heldKeys, button)
#define S16TOPOSFLOAT(val) \
({ \
s16 v = (val); \

View file

@ -27,7 +27,11 @@ struct DodrioBerryPickingStruct_2022CF4
struct DodrioBerryPickingSubstruct_31A0
{
u8 unk_00[0x3C - 0x00];
u8 unk_00[0x2C - 0x00];
u8 unk_2C;
u8 filler_2D[3];
u8 unk_30;
u8 filler_31[11];
}; // size = 0x3C
struct DodrioBerryPickingSubstruct_318C
@ -119,6 +123,7 @@ void sub_8024F10(void);
void sub_8024F38(void);
void sub_8024FFC(void);
void sub_80250D4(void);
void sub_8025158(void);
void sub_8025198(void);
void sub_8025230(void);
void sub_8025324(void);
@ -126,13 +131,13 @@ void sub_8025470(void);
void sub_8025644(void);
void sub_80256AC(void);
void sub_8025758(void);
void sub_8025158(void);
void sub_802589C(u8 taskId);
void sub_8025910(u8 taskId);
void sub_8025D04(void);
void sub_8025D50(void);
void sub_8025E0C(void);
void sub_8025ED8(void);
void sub_8025F48(void);
void sub_80261CC(void);
void sub_80261E4(void);
void sub_80261F8(struct DodrioBerryPickingSubstruct_318C *, struct Pokemon *);
@ -140,10 +145,12 @@ void sub_802620C(TaskFunc, u8);
void sub_802621C(TaskFunc);
void sub_8026240(u8);
void sub_80262C0(void);
void sub_802671C(void);
void sub_8026AF4(void);
void sub_8026B28(void);
void sub_8026B5C(u8, u8*, u8*);
void sub_80273F0(void);
u8 sub_8027518(u8);
void sub_80283A8(void);
void sub_8028408(struct DodrioBerryPickingSubstruct_318C *, u8, u8, u8);
void sub_8028504(u8);
@ -411,3 +418,61 @@ void sub_8024E38(void)
break;
}
}
void sub_8024F10(void)
{
if (gUnknown_02022C98->unk_0010 == 0)
{
if (gUnknown_02022C98->unk_011C != 0)
{
sub_8026240(4);
}
}
}
void sub_8024F38(void)
{
if (gUnknown_02022C98->unk_0010 == 0)
{
if (gUnknown_02022C98->unk_0040 < 10)
{
if (gUnknown_02022C98->unk_00A8[0] == 0)
{
if (JOY_NEW(DPAD_UP))
{
if (gUnknown_02022C98->unk_31A0[0].unk_2C == 0)
{
gUnknown_02022C98->unk_31A0[0].unk_30 = 0;
gUnknown_02022C98->unk_31A0[0].unk_2C = sub_8027518(2);
}
}
else if (JOY_NEW(DPAD_RIGHT))
{
if (gUnknown_02022C98->unk_31A0[0].unk_2C == 0)
{
gUnknown_02022C98->unk_31A0[0].unk_30 = 0;
gUnknown_02022C98->unk_31A0[0].unk_2C = sub_8027518(1);
}
}
else if (JOY_NEW(DPAD_LEFT))
{
if (gUnknown_02022C98->unk_31A0[0].unk_2C == 0)
{
gUnknown_02022C98->unk_31A0[0].unk_30 = 0;
gUnknown_02022C98->unk_31A0[0].unk_2C = sub_8027518(3);
}
}
else
{
gUnknown_02022C98->unk_31A0[0].unk_2C = sub_8027518(0);
}
}
}
else
{
sub_8026240(11);
}
sub_802671C();
sub_8025F48();
}
}