Merge pull request #590 from nonmatch/patch-62

Match sub_0809CBE4
This commit is contained in:
notyourav 2023-01-07 16:17:36 -08:00 committed by GitHub
commit 9c7a1c998c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 44 deletions

View File

@ -1,40 +0,0 @@
.syntax unified
push {r4, lr}
adds r2, r0, #0
adds r3, r2, #0
adds r3, #0x79
ldrb r0, [r2, #0xf]
ldrb r4, [r3]
adds r1, r0, r4
strb r1, [r3]
ldrb r4, [r2, #0xf]
movs r0, #0xf
ldrsb r0, [r2, r0]
cmp r0, #0
bge _0809CC16
ldrb r0, [r2, #0xe]
lsls r1, r1, #0x18
lsls r0, r0, #0x18
cmn r1, r0
bge _0809CC2C
rsbs r0, r4, #0
strb r0, [r2, #0xf]
movs r0, #0xcf
lsls r0, r0, #1
bl SoundReq
b _0809CC2C
_0809CC16:
movs r0, #0
ldrsb r0, [r3, r0]
ldrb r1, [r2, #0xe]
cmp r0, r1
ble _0809CC2C
rsbs r0, r4, #0
strb r0, [r2, #0xf]
movs r0, #0xcf
lsls r0, r0, #1
bl SoundReq
_0809CC2C:
pop {r4, pc}
.align 2, 0
.syntax divided

View File

@ -421,10 +421,17 @@ void sub_0809CB70(FrozenOctorokEntity* this, s32 angle, s32 radius) {
super->z.WORD = super->parent->z.WORD;
}
NONMATCH("asm/non_matching/frozenOctorok/sub_0809CBE4.inc", void sub_0809CBE4(FrozenOctorokEntity* this)) {
this->unk_79 += super->subtimer;
void sub_0809CBE4(FrozenOctorokEntity* this) {
u16 tmp1;
FORCE_REGISTER(u8 tmp4, r4);
u8* tmp3 = &this->unk_79;
tmp1 = super->subtimer;
tmp4 = *tmp3;
tmp1 += tmp4;
this->unk_79 = tmp1;
if ((s8)super->subtimer < 0) {
if (super->timer < -this->unk_79) {
u8 tmp_r0 = super->timer;
if (tmp1 << 0x18 < -tmp_r0 << 0x18) {
super->subtimer = -super->subtimer;
SoundReq(SFX_19E);
}
@ -433,7 +440,6 @@ NONMATCH("asm/non_matching/frozenOctorok/sub_0809CBE4.inc", void sub_0809CBE4(Fr
SoundReq(SFX_19E);
}
}
END_NONMATCH
void FrozenOctorok_ChangeObjPaletteOfChildren(FrozenOctorokEntity* this, u32 palette) {
u32 index;