sub_8123254

This commit is contained in:
PikalaxALT 2017-10-29 21:38:45 -04:00
parent 8d35bf1c9e
commit 16c5a58f35
3 changed files with 48 additions and 116 deletions

View File

@ -5,121 +5,6 @@
.text
thumb_func_start sub_8123254
sub_8123254: @ 8123254
push {r4-r6,lr}
movs r4, 0
ldr r3, =gUnknown_0203A144
ldr r0, [r3]
mov r12, r0
adds r0, 0x6A
strh r4, [r0]
mov r5, r12
adds r5, 0x68
strh r4, [r5]
ldr r2, =gMain
ldrh r1, [r2, 0x2C]
movs r0, 0x40
ands r0, r1
adds r6, r3, 0
adds r3, r2, 0
cmp r0, 0
beq _0812328E
mov r0, r12
adds r0, 0x5E
movs r2, 0
ldrsh r1, [r0, r2]
movs r0, 0x34
negs r0, r0
cmp r1, r0
ble _0812328E
ldr r0, =0x0000ffff
strh r0, [r5]
movs r4, 0x1
_0812328E:
ldrh r1, [r3, 0x2C]
movs r0, 0x80
ands r0, r1
cmp r0, 0
beq _081232AE
ldr r1, [r6]
adds r0, r1, 0
adds r0, 0x5E
movs r5, 0
ldrsh r0, [r0, r5]
cmp r0, 0x3B
bgt _081232AE
adds r1, 0x68
movs r0, 0x1
strh r0, [r1]
movs r4, 0x1
_081232AE:
ldrh r1, [r3, 0x2C]
movs r0, 0x20
ands r0, r1
cmp r0, 0
beq _081232D4
ldr r2, [r6]
adds r0, r2, 0
adds r0, 0x5C
movs r5, 0
ldrsh r1, [r0, r5]
movs r0, 0x2C
negs r0, r0
cmp r1, r0
ble _081232D4
adds r1, r2, 0
adds r1, 0x6A
ldr r0, =0x0000ffff
strh r0, [r1]
movs r4, 0x1
_081232D4:
ldrh r1, [r3, 0x2C]
movs r0, 0x10
ands r0, r1
cmp r0, 0
beq _081232F4
ldr r1, [r6]
adds r0, r1, 0
adds r0, 0x5C
movs r2, 0
ldrsh r0, [r0, r2]
cmp r0, 0xAB
bgt _081232F4
adds r1, 0x6A
movs r0, 0x1
strh r0, [r1]
movs r4, 0x1
_081232F4:
ldrh r2, [r3, 0x2E]
movs r0, 0x1
ands r0, r2
cmp r0, 0
beq _08123300
movs r4, 0x4
_08123300:
movs r0, 0x2
ands r0, r2
cmp r0, 0
beq _0812330A
movs r4, 0x5
_0812330A:
cmp r4, 0x1
bne _0812331A
ldr r0, [r6]
ldr r1, =sub_8123334
str r1, [r0, 0x18]
adds r0, 0x6C
movs r1, 0
strh r1, [r0]
_0812331A:
adds r0, r4, 0
pop {r4-r6}
pop {r1}
bx r1
.pool
thumb_func_end sub_8123254
thumb_func_start sub_8123334
sub_8123334: @ 8123334
push {r4,r5,lr}

View File

@ -243,7 +243,10 @@ struct RegionMap {
/*0x060*/ u8 filler_060[0x4];
/*0x064*/ u16 unk_064;
/*0x066*/ u16 unk_066;
/*0x068*/ u8 filler_068[0x8];
/*0x068*/ s16 unk_068;
/*0x06a*/ s16 unk_06a;
/*0x06c*/ u16 unk_06c;
/*0x06e*/ u8 filler_06e[2];
/*0x070*/ u16 unk_070;
/*0x072*/ u16 unk_072;
/*0x074*/ u16 unk_074;

View File

@ -29,6 +29,7 @@ u8 get_flagnr_blue_points(u16 mapSecId);
u16 sub_8123EB4(u16 mapSecId);
void sub_8123FB0(void);
u8 _swiopen(void);
u8 sub_8123334(void);
u16 sub_812386C(u16 x, u16 y);
// .rodata
@ -267,3 +268,46 @@ u8 _swiopen(void)
gUnknown_0203A144->inputCallback = sub_81230C4;
return INPUT_EVENT_MOVE_END;
}
u8 sub_8123254(void)
{
u8 input;
input = INPUT_EVENT_NONE;
gUnknown_0203A144->unk_06a = 0;
gUnknown_0203A144->unk_068 = 0;
if (gMain.heldKeys & DPAD_UP && gUnknown_0203A144->unk_05e > -0x34)
{
gUnknown_0203A144->unk_068 = -1;
input = INPUT_EVENT_MOVE_START;
}
if (gMain.heldKeys & DPAD_DOWN && gUnknown_0203A144->unk_05e < 0x3c)
{
gUnknown_0203A144->unk_068 = +1;
input = INPUT_EVENT_MOVE_START;
}
if (gMain.heldKeys & DPAD_LEFT && gUnknown_0203A144->unk_05c > -0x2c)
{
gUnknown_0203A144->unk_06a = -1;
input = INPUT_EVENT_MOVE_START;
}
if (gMain.heldKeys & DPAD_RIGHT && gUnknown_0203A144->unk_05c < 0xac)
{
gUnknown_0203A144->unk_06a = +1;
input = INPUT_EVENT_MOVE_START;
}
if (gMain.newKeys & A_BUTTON)
{
input = INPUT_EVENT_A_BUTTON;
}
if (gMain.newKeys & B_BUTTON)
{
input = INPUT_EVENT_B_BUTTON;
}
if (input == INPUT_EVENT_MOVE_START)
{
gUnknown_0203A144->inputCallback = sub_8123334;
gUnknown_0203A144->unk_06c = 0;
}
return input;
}