From 603efdcb04f1c84beec1b5be68bd629bf9b24aa0 Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Wed, 4 May 2022 22:57:40 +0300 Subject: [PATCH] match sub_080A7B98 --- .../playerItemSword/sub_080A7B98.inc | 55 ------------------- src/playerItem/playerItemSword.c | 22 +++++++- 2 files changed, 21 insertions(+), 56 deletions(-) delete mode 100644 asm/non_matching/playerItemSword/sub_080A7B98.inc diff --git a/asm/non_matching/playerItemSword/sub_080A7B98.inc b/asm/non_matching/playerItemSword/sub_080A7B98.inc deleted file mode 100644 index 051160de..00000000 --- a/asm/non_matching/playerItemSword/sub_080A7B98.inc +++ /dev/null @@ -1,55 +0,0 @@ - .syntax unified - push {r4, r5, r6, r7, lr} - mov r7, sl - mov r6, sb - mov r5, r8 - push {r5, r6, r7} - adds r6, r0, #0 - ldr r0, _080A7BFC @ =gPlayerState - adds r0, #0xac - ldrh r1, [r0] - movs r0, #8 - ands r0, r1 - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - rsbs r0, r0, #0 - lsrs r0, r0, #0x1f - mov sl, r0 - movs r7, #0x10 - rsbs r7, r7, #0 - movs r0, #0 -_080A7BBE: - movs r5, #0x10 - rsbs r5, r5, #0 - movs r4, #0 - movs r1, #0x10 - adds r1, r1, r7 - mov sb, r1 - adds r0, #1 - mov r8, r0 -_080A7BCE: - movs r0, #0x2e - ldrsh r2, [r6, r0] - adds r2, r2, r5 - movs r1, #0x32 - ldrsh r3, [r6, r1] - adds r3, r3, r7 - adds r0, r6, #0 - mov r1, sl - bl sub_08008796 - adds r5, #0x10 - adds r4, #1 - cmp r4, #2 - bls _080A7BCE - mov r7, sb - mov r0, r8 - cmp r0, #2 - bls _080A7BBE - pop {r3, r4, r5} - mov r8, r3 - mov sb, r4 - mov sl, r5 - pop {r4, r5, r6, r7, pc} - .align 2, 0 -_080A7BFC: .4byte gPlayerState - .syntax divided diff --git a/src/playerItem/playerItemSword.c b/src/playerItem/playerItemSword.c index 5f6ed69a..cb0fef2a 100644 --- a/src/playerItem/playerItemSword.c +++ b/src/playerItem/playerItemSword.c @@ -337,4 +337,24 @@ void sub_080A7A54(PlayerItemSwordEntity* this) { ASM_FUNC("asm/non_matching/playerItemSword/sub_080A7A84.inc", void sub_080A7A84(PlayerItemSwordEntity* this)) -ASM_FUNC("asm/non_matching/playerItemSword/sub_080A7B98.inc", void sub_080A7B98(PlayerItemSwordEntity* this)) +void sub_080A7B98(PlayerItemSwordEntity* this) { + u32 i, j; + u32 uVar2; + s32 xOffset; + s32 yOffset; + if ((gPlayerState.skills & 8) != 0) { + uVar2 = 1; + } else { + uVar2 = 0; + } + yOffset = -0x10; + + for (i = 0; i < 3; i++) { + xOffset = -0x10; + for (j = 0; j < 3; j++) { + sub_08008796(super, uVar2, super->x.HALF.HI + xOffset, super->y.HALF.HI + yOffset); + xOffset += 0x10; + } + yOffset += 0x10; + } +}