Match sub_0806A26C

This commit is contained in:
hatal175 2022-01-11 15:14:35 +01:00
parent 688508b1af
commit 9cb81ae723
2 changed files with 9 additions and 51 deletions

View File

@ -1,43 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
push {r4, r5, lr}
adds r5, r0, #0
movs r0, #0xf
movs r1, #0x2f
movs r2, #0
bl CreateObject
adds r4, r0, #0
cmp r4, #0
beq _0806A2AE
adds r0, r5, #0
adds r1, r4, #0
bl PositionEntityOnTop
bl Random
adds r5, r0, #0
ldr r2, _0806A2B0 @ =gUnk_081121DC
movs r1, #7
ands r0, r1
adds r0, r0, r2
ldrb r0, [r0]
adds r3, r4, #0
adds r3, #0x62
strb r0, [r3]
lsrs r0, r5, #8
ands r0, r1
adds r0, r0, r2
ldrb r0, [r0]
subs r0, #8
adds r1, r4, #0
adds r1, #0x63
strb r0, [r1]
_0806A2AE:
pop {r4, r5, pc}
.align 2, 0
_0806A2B0: .4byte gUnk_081121DC
.syntax divided

View File

@ -41,20 +41,21 @@ void sub_0806A234(Entity* this) {
extern u8 gUnk_081121DC[]; extern u8 gUnk_081121DC[];
NONMATCH("asm/non_matching/syrup/sub_0806A26C.inc", void sub_0806A26C(Entity* this)) { void sub_0806A26C(Entity* this) {
u8 unk; u8 unk;
u32 uVar2; u8* ptr;
u32 uVar2, uVar1;
Entity* pEVar1; Entity* pEVar1;
pEVar1 = CreateObject(SPECIAL_FX, 0x2f, 0); pEVar1 = CreateObject(SPECIAL_FX, 0x2f, 0);
if (pEVar1 != NULL) { if (pEVar1 != NULL) {
PositionEntityOnTop(this, pEVar1); PositionEntityOnTop(this, pEVar1);
if (uVar2 = Random(), uVar2) { uVar2 = uVar1 = Random();
unk = -unk; // wtf?! ptr = gUnk_081121DC;
} pEVar1->spriteOffsetX = (u8)ptr[uVar2 & 7];
pEVar1->spriteOffsetX = (u8)gUnk_081121DC[uVar2 & 7]; uVar1 /= 256;
pEVar1->spriteOffsetY = (u8)gUnk_081121DC[(uVar2 / 256) & 7] - 8; uVar1 &= 7;
pEVar1->spriteOffsetY = (u8)ptr[uVar1] - 8;
} }
} }
END_NONMATCH
ASM_FUNC("asm/non_matching/syrup/Syrup_Head.inc", void Syrup_Head(Entity* this)) ASM_FUNC("asm/non_matching/syrup/Syrup_Head.inc", void Syrup_Head(Entity* this))