From 69aff34afd58d5770c070d14b016fb30f304b59c Mon Sep 17 00:00:00 2001 From: jiangzhengwenjz Date: Fri, 6 Mar 2020 05:25:31 +0800 Subject: [PATCH] sub_8027E30 --- src/dodrio_berry_picking.c | 449 ++----------------------------------- 1 file changed, 16 insertions(+), 433 deletions(-) diff --git a/src/dodrio_berry_picking.c b/src/dodrio_berry_picking.c index 958922067d..40074e0afd 100644 --- a/src/dodrio_berry_picking.c +++ b/src/dodrio_berry_picking.c @@ -2770,22 +2770,22 @@ struct UnkPacket2 u8 id; u8 unk1_0:4; u8 unk1_1:4; - u8 unk2_0:4; - u8 unk2_1:4; - u8 unk3_0:4; - u8 unk3_1:4; - u8 unk4_0:4; - u8 unk4_1:4; - u8 unk5_0:4; - u8 unk5_1:4; - u8 unk6_0:2; - u8 unk6_1:2; - u8 unk6_2:2; - u8 unk6_3:2; - u8 unk7_0:2; - u8 unk7_1:2; - u8 unk7_2:2; - u8 unk7_3:2; + u16 unk2_0:4; + u16 unk2_1:4; + u16 unk3_0:4; + u16 unk3_1:4; + u16 unk4_0:4; + u16 unk4_1:4; + u16 unk5_0:4; + u16 unk5_1:4; + u16 unk6_0:2; + u16 unk6_1:2; + u16 unk6_2:2; + u16 unk6_3:2; + u16 unk7_0:2; + u16 unk7_1:2; + u16 unk7_2:2; + u16 unk7_3:2; u8 unk8_0:2; u8 unk8_1:2; u8 unk8_2:2; @@ -2808,7 +2808,6 @@ struct UnkPacket2 u8 unkB_6:1; }; -#ifdef NONMATCHING static void sub_8027E30(struct DodrioSubstruct_31A0 *arg0, struct DodrioSubstruct_31A0_2C *arg1, struct DodrioSubstruct_31A0_2C *arg2, struct DodrioSubstruct_31A0_2C *arg3, struct DodrioSubstruct_31A0_2C *arg4, struct DodrioSubstruct_31A0_2C *arg5, u8 arg6, u32 arg7, u32 arg8) { struct UnkPacket2 packet; @@ -2860,422 +2859,6 @@ static void sub_8027E30(struct DodrioSubstruct_31A0 *arg0, struct DodrioSubstruc packet.unkB_0 = arg8; sub_800FE50(&packet); } -#else -NAKED -static void sub_8027E30(struct DodrioSubstruct_31A0 *arg0, struct DodrioSubstruct_31A0_2C *arg1, struct DodrioSubstruct_31A0_2C *arg2, struct DodrioSubstruct_31A0_2C *arg3, struct DodrioSubstruct_31A0_2C *arg4, struct DodrioSubstruct_31A0_2C *arg5, u8 arg6, u32 arg7, u32 arg8) -{ - asm_unified(" push {r4-r7,lr}\n\ - mov r7, r10\n\ - mov r6, r9\n\ - mov r5, r8\n\ - push {r5-r7}\n\ - sub sp, 0x20\n\ - ldr r4, [sp, 0x48]\n\ - lsls r4, 24\n\ - str r4, [sp, 0x1C]\n\ - movs r4, 0x14\n\ - adds r4, r0\n\ - mov r9, r4\n\ - mov r5, sp\n\ - movs r4, 0x2\n\ - strb r4, [r5]\n\ - mov r10, sp\n\ - mov r5, r9\n\ - ldrb r4, [r5, 0xB]\n\ - movs r7, 0xF\n\ - adds r5, r7, 0\n\ - ands r5, r4\n\ - mov r6, r10\n\ - ldrb r6, [r6, 0x1]\n\ - mov r8, r6\n\ - movs r4, 0x10\n\ - negs r4, r4\n\ - mov r6, r8\n\ - ands r4, r6\n\ - orrs r4, r5\n\ - mov r5, r10\n\ - strb r4, [r5, 0x1]\n\ - mov r8, sp\n\ - mov r6, r9\n\ - ldrb r5, [r6, 0xC]\n\ - lsls r5, 4\n\ - ands r4, r7\n\ - orrs r4, r5\n\ - mov r5, r8\n\ - strb r4, [r5, 0x1]\n\ - ldrb r5, [r6, 0xD]\n\ - movs r6, 0xF\n\ - ands r5, r6\n\ - mov r4, r10\n\ - ldrb r4, [r4, 0x2]\n\ - mov r8, r4\n\ - movs r4, 0x10\n\ - negs r4, r4\n\ - mov r6, r8\n\ - ands r4, r6\n\ - orrs r4, r5\n\ - mov r5, r10\n\ - strb r4, [r5, 0x2]\n\ - mov r8, sp\n\ - mov r6, r9\n\ - ldrb r5, [r6, 0xE]\n\ - lsls r5, 4\n\ - ands r4, r7\n\ - orrs r4, r5\n\ - mov r5, r8\n\ - strb r4, [r5, 0x2]\n\ - ldrb r5, [r6, 0xF]\n\ - movs r6, 0xF\n\ - ands r5, r6\n\ - mov r4, r10\n\ - ldrb r4, [r4, 0x3]\n\ - mov r8, r4\n\ - movs r4, 0x10\n\ - negs r4, r4\n\ - mov r6, r8\n\ - ands r4, r6\n\ - orrs r4, r5\n\ - mov r5, r10\n\ - strb r4, [r5, 0x3]\n\ - mov r8, sp\n\ - mov r6, r9\n\ - ldrb r5, [r6, 0x10]\n\ - lsls r5, 4\n\ - ands r4, r7\n\ - orrs r4, r5\n\ - mov r5, r8\n\ - strb r4, [r5, 0x3]\n\ - ldrb r5, [r6, 0x11]\n\ - movs r6, 0xF\n\ - ands r5, r6\n\ - mov r4, r10\n\ - ldrb r4, [r4, 0x4]\n\ - mov r8, r4\n\ - movs r4, 0x10\n\ - negs r4, r4\n\ - mov r6, r8\n\ - ands r4, r6\n\ - orrs r4, r5\n\ - mov r5, r10\n\ - strb r4, [r5, 0x4]\n\ - mov r8, sp\n\ - mov r6, r9\n\ - ldrb r5, [r6, 0x12]\n\ - lsls r5, 4\n\ - ands r4, r7\n\ - orrs r4, r5\n\ - mov r5, r8\n\ - strb r4, [r5, 0x4]\n\ - ldrb r4, [r6, 0x13]\n\ - movs r6, 0xF\n\ - ands r4, r6\n\ - mov r6, r8\n\ - ldrb r5, [r6, 0x5]\n\ - movs r6, 0x10\n\ - negs r6, r6\n\ - ands r6, r5\n\ - orrs r6, r4\n\ - str r6, [sp, 0xC]\n\ - mov r4, r8\n\ - strb r6, [r4, 0x5]\n\ - mov r5, sp\n\ - mov r6, r9\n\ - ldrb r4, [r6, 0x14]\n\ - lsls r4, 4\n\ - ldr r6, [sp, 0xC]\n\ - ands r6, r7\n\ - orrs r6, r4\n\ - strb r6, [r5, 0x5]\n\ - mov r7, sp\n\ - movs r4, 0x3\n\ - mov r8, r4\n\ - ldrb r0, [r0, 0x14]\n\ - mov r5, r8\n\ - ands r0, r5\n\ - ldrb r5, [r7, 0x6]\n\ - movs r6, 0x4\n\ - negs r6, r6\n\ - mov r10, r6\n\ - mov r4, r10\n\ - ands r4, r5\n\ - orrs r4, r0\n\ - strb r4, [r7, 0x6]\n\ - mov r5, r9\n\ - ldrb r0, [r5, 0x1]\n\ - mov r6, r8\n\ - ands r0, r6\n\ - lsls r0, 2\n\ - movs r5, 0xD\n\ - negs r5, r5\n\ - ands r5, r4\n\ - orrs r5, r0\n\ - strb r5, [r7, 0x6]\n\ - mov r0, r9\n\ - ldrb r4, [r0, 0x2]\n\ - ands r4, r6\n\ - lsls r4, 4\n\ - movs r0, 0x31\n\ - negs r0, r0\n\ - ands r0, r5\n\ - orrs r0, r4\n\ - strb r0, [r7, 0x6]\n\ - mov r5, sp\n\ - mov r6, r9\n\ - ldrb r4, [r6, 0x3]\n\ - lsls r4, 6\n\ - movs r6, 0x3F\n\ - ands r0, r6\n\ - orrs r0, r4\n\ - strb r0, [r5, 0x6]\n\ - mov r4, r9\n\ - ldrb r0, [r4, 0x4]\n\ - mov r5, r8\n\ - ands r0, r5\n\ - ldrb r5, [r7, 0x7]\n\ - mov r4, r10\n\ - ands r4, r5\n\ - orrs r4, r0\n\ - strb r4, [r7, 0x7]\n\ - mov r6, r9\n\ - ldrb r0, [r6, 0x5]\n\ - mov r5, r8\n\ - ands r0, r5\n\ - lsls r0, 2\n\ - movs r5, 0xD\n\ - negs r5, r5\n\ - ands r5, r4\n\ - orrs r5, r0\n\ - strb r5, [r7, 0x7]\n\ - ldrb r4, [r6, 0x6]\n\ - mov r6, r8\n\ - ands r4, r6\n\ - lsls r4, 4\n\ - movs r0, 0x31\n\ - negs r0, r0\n\ - ands r0, r5\n\ - orrs r0, r4\n\ - strb r0, [r7, 0x7]\n\ - mov r5, sp\n\ - mov r6, r9\n\ - ldrb r4, [r6, 0x7]\n\ - lsls r4, 6\n\ - movs r6, 0x3F\n\ - ands r0, r6\n\ - orrs r0, r4\n\ - strb r0, [r5, 0x7]\n\ - mov r8, sp\n\ - mov r0, r9\n\ - ldrb r4, [r0, 0x8]\n\ - movs r7, 0x3\n\ - adds r0, r7, 0\n\ - ands r0, r4\n\ - mov r4, r8\n\ - ldrb r5, [r4, 0x8]\n\ - mov r4, r10\n\ - ands r4, r5\n\ - orrs r4, r0\n\ - mov r5, r8\n\ - strb r4, [r5, 0x8]\n\ - mov r6, r9\n\ - ldrb r5, [r6, 0x9]\n\ - adds r0, r7, 0\n\ - ands r0, r5\n\ - lsls r0, 2\n\ - movs r5, 0xD\n\ - negs r5, r5\n\ - ands r5, r4\n\ - orrs r5, r0\n\ - mov r0, r8\n\ - strb r5, [r0, 0x8]\n\ - ldrb r0, [r1]\n\ - adds r4, r7, 0\n\ - ands r4, r0\n\ - lsls r4, 4\n\ - movs r0, 0x31\n\ - negs r0, r0\n\ - ands r0, r5\n\ - orrs r0, r4\n\ - mov r4, r8\n\ - strb r0, [r4, 0x8]\n\ - mov r5, sp\n\ - ldrb r4, [r2]\n\ - lsls r4, 6\n\ - movs r6, 0x3F\n\ - ands r0, r6\n\ - orrs r0, r4\n\ - strb r0, [r5, 0x8]\n\ - ldrb r4, [r3]\n\ - adds r0, r7, 0\n\ - ands r0, r4\n\ - ldrb r4, [r5, 0x9]\n\ - mov r6, r10\n\ - ands r6, r4\n\ - orrs r6, r0\n\ - mov r10, r6\n\ - strb r6, [r5, 0x9]\n\ - ldr r0, [sp, 0x40]\n\ - ldrb r4, [r0]\n\ - adds r0, r7, 0\n\ - ands r0, r4\n\ - lsls r0, 2\n\ - movs r4, 0xD\n\ - negs r4, r4\n\ - ands r6, r4\n\ - orrs r6, r0\n\ - str r6, [sp, 0x10]\n\ - strb r6, [r5, 0x9]\n\ - mov r4, sp\n\ - ldr r5, [sp, 0x44]\n\ - ldrb r0, [r5]\n\ - adds r6, r7, 0\n\ - ands r6, r0\n\ - lsls r0, r6, 4\n\ - subs r7, 0x34\n\ - ldr r5, [sp, 0x10]\n\ - ands r7, r5\n\ - orrs r7, r0\n\ - strb r7, [r4, 0x9]\n\ - mov r5, sp\n\ - ldrb r0, [r1, 0x4]\n\ - movs r6, 0x1\n\ - mov r12, r6\n\ - mov r4, r12\n\ - ands r4, r0\n\ - lsls r4, 6\n\ - movs r0, 0x41\n\ - negs r0, r0\n\ - mov r10, r0\n\ - ands r0, r7\n\ - orrs r0, r4\n\ - strb r0, [r5, 0x9]\n\ - ldrb r4, [r2, 0x4]\n\ - lsls r4, 7\n\ - movs r5, 0x7F\n\ - ands r0, r5\n\ - orrs r0, r4\n\ - mov r4, r8\n\ - strb r0, [r4, 0x9]\n\ - ldrb r4, [r3, 0x4]\n\ - mov r0, r12\n\ - ands r0, r4\n\ - mov r5, r8\n\ - ldrb r4, [r5, 0xA]\n\ - movs r7, 0x2\n\ - negs r7, r7\n\ - adds r5, r7, 0\n\ - ands r5, r4\n\ - orrs r5, r0\n\ - mov r6, r8\n\ - strb r5, [r6, 0xA]\n\ - mov r9, sp\n\ - ldr r4, [sp, 0x40]\n\ - ldrb r0, [r4, 0x4]\n\ - mov r4, r12\n\ - ands r4, r0\n\ - lsls r4, 1\n\ - movs r6, 0x3\n\ - negs r6, r6\n\ - mov r8, r6\n\ - mov r0, r8\n\ - ands r0, r5\n\ - orrs r0, r4\n\ - mov r4, r9\n\ - strb r0, [r4, 0xA]\n\ - ldr r6, [sp, 0x44]\n\ - ldrb r5, [r6, 0x4]\n\ - mov r4, r12\n\ - ands r4, r5\n\ - lsls r4, 2\n\ - movs r5, 0x5\n\ - negs r5, r5\n\ - ands r0, r5\n\ - orrs r0, r4\n\ - mov r4, r9\n\ - strb r0, [r4, 0xA]\n\ - mov r4, sp\n\ - ldrb r1, [r1, 0x8]\n\ - mov r0, r12\n\ - ands r0, r1\n\ - lsls r0, 2\n\ - ldrb r1, [r4, 0xB]\n\ - ands r5, r1\n\ - orrs r5, r0\n\ - strb r5, [r4, 0xB]\n\ - ldrb r1, [r2, 0x8]\n\ - mov r0, r12\n\ - ands r0, r1\n\ - lsls r0, 3\n\ - movs r1, 0x9\n\ - negs r1, r1\n\ - ands r1, r5\n\ - orrs r1, r0\n\ - strb r1, [r4, 0xB]\n\ - ldrb r2, [r3, 0x8]\n\ - mov r0, r12\n\ - ands r0, r2\n\ - lsls r0, 4\n\ - movs r2, 0x11\n\ - negs r2, r2\n\ - ands r2, r1\n\ - orrs r2, r0\n\ - strb r2, [r4, 0xB]\n\ - mov r3, sp\n\ - ldr r5, [sp, 0x40]\n\ - ldrb r0, [r5, 0x8]\n\ - mov r1, r12\n\ - ands r1, r0\n\ - lsls r1, 5\n\ - movs r0, 0x21\n\ - negs r0, r0\n\ - ands r0, r2\n\ - orrs r0, r1\n\ - strb r0, [r3, 0xB]\n\ - mov r2, sp\n\ - ldrb r1, [r6, 0x8]\n\ - mov r6, r12\n\ - ands r6, r1\n\ - lsls r1, r6, 6\n\ - mov r3, r10\n\ - ands r0, r3\n\ - orrs r0, r1\n\ - strb r0, [r2, 0xB]\n\ - ldr r4, [sp, 0x1C]\n\ - lsrs r3, r4, 21\n\ - ldrb r1, [r2, 0xA]\n\ - movs r0, 0x7\n\ - ands r0, r1\n\ - orrs r0, r3\n\ - strb r0, [r2, 0xA]\n\ - mov r1, sp\n\ - ldr r5, [sp, 0x4C]\n\ - movs r6, 0x1\n\ - ands r5, r6\n\ - lsls r2, r5, 1\n\ - ldrb r0, [r1, 0xB]\n\ - mov r3, r8\n\ - ands r3, r0\n\ - orrs r3, r2\n\ - mov r8, r3\n\ - strb r3, [r1, 0xB]\n\ - mov r0, sp\n\ - ldr r4, [sp, 0x50]\n\ - ands r4, r6\n\ - mov r5, r8\n\ - ands r5, r7\n\ - orrs r5, r4\n\ - strb r5, [r0, 0xB]\n\ - bl sub_800FE50\n\ - add sp, 0x20\n\ - pop {r3-r5}\n\ - mov r8, r3\n\ - mov r9, r4\n\ - mov r10, r5\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ -"); -} -#endif static u32 sub_8028164(u32 unused, struct DodrioSubstruct_31A0 *arg0, struct DodrioSubstruct_31A0_2C *arg1, struct DodrioSubstruct_31A0_2C *arg2, struct DodrioSubstruct_31A0_2C *arg3, struct DodrioSubstruct_31A0_2C *arg4, struct DodrioSubstruct_31A0_2C *arg5, u8 *arg6, u32 *arg7, u32 *arg8) {