Merge pull request #276 from nonmatch/patch-10

Match sub_08068190
This commit is contained in:
notyourav 2022-01-11 19:41:28 -08:00 committed by GitHub
commit a33338a5bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 52 deletions

View File

@ -1,48 +0,0 @@
.syntax unified
push {r4, lr}
adds r2, r0, #0
ldrb r4, [r2, #0x14]
ldrb r1, [r2, #0x15]
movs r0, #0x80
ands r0, r1
cmp r0, #0
bne _0806F9E6
movs r0, #0x1c
ands r0, r1
lsrs r3, r0, #2
movs r1, #1
adds r0, r3, #0
ands r0, r1
cmp r0, #0
beq _0806F9C4
subs r0, r3, r4
adds r0, #1
movs r1, #4
ands r0, r1
cmp r0, #0
beq _0806F9E6
_0806F9C4:
ldrb r0, [r2, #0x15]
lsrs r0, r0, #2
movs r1, #0x7e
ands r0, r1
strb r0, [r2, #0x14]
adds r4, r0, #0
cmp r4, #4
bhi _0806F9DE
ldrb r1, [r2, #0x18]
movs r0, #0x41
rsbs r0, r0, #0
ands r0, r1
b _0806F9E4
_0806F9DE:
ldrb r0, [r2, #0x18]
movs r1, #0x40
orrs r0, r1
_0806F9E4:
strb r0, [r2, #0x18]
_0806F9E6:
adds r0, r4, #0
pop {r4, pc}
.align 2, 0
.syntax divided

View File

@ -260,11 +260,10 @@ u32 sub_0806F948(Entity* ent) {
return ent->animationState;
}
NONMATCH("asm/non_matching/sub_0806F998.inc", u32 sub_0806F998(Entity* ent)) {
u32 sub_0806F998(Entity* ent) {
u8 state = ent->animationState;
if ((ent->direction & 0x80) == 0) {
u8 tmp = ((ent->direction & 0x1c) >> 2);
if ((tmp & 0x1) == 0 || ((tmp - state + 1) & 0x4)) {
if ((((ent->direction & 0x1c) >> 2) & 0x1) == 0 || ((((ent->direction & 0x1c) >> 2) - state + 1) & 0x4)) {
u8 dir = ent->direction;
state = ent->animationState = (dir >> 2) & 0x7e;
if (ent->animationState <= 4) {
@ -276,7 +275,6 @@ NONMATCH("asm/non_matching/sub_0806F998.inc", u32 sub_0806F998(Entity* ent)) {
}
return state;
}
END_NONMATCH
s16 FixedMul(s16 r0, s16 r1) {
s32 temp = r0 * r1;