Match sub_080A22C4

This commit is contained in:
Tal Hayon 2022-04-23 22:54:51 +03:00
parent a4e7f0b2e6
commit a1ed36ce3c
2 changed files with 4 additions and 75 deletions

View File

@ -1,66 +0,0 @@
.syntax unified
push {r4, r5, lr}
adds r4, r0, #0
ldrb r5, [r4, #0xc]
cmp r5, #0
beq _080A22FC
cmp r5, #1
beq _080A231C
ldrb r0, [r4, #0xe]
subs r0, #1
strb r0, [r4, #0xe]
lsls r0, r0, #0x18
cmp r0, #0
bne _080A233E
movs r0, #8
strb r0, [r4, #0xe]
ldrb r0, [r4, #0xf]
adds r0, #1
movs r1, #3
ands r0, r1
strb r0, [r4, #0xf]
ldrb r1, [r4, #0xd]
adds r0, r1, r0
strb r0, [r4, #0x1e]
lsls r1, r1, #0x18
lsls r0, r0, #0x18
cmp r1, r0
bne _080A233E
b _080A233A
_080A22FC:
adds r0, r4, #0
bl sub_080A2340
movs r0, #8
strb r0, [r4, #0xe]
strb r5, [r4, #0xf]
ldrb r0, [r4, #0x1e]
strb r0, [r4, #0xd]
bl Random
movs r1, #3
ands r0, r1
lsls r0, r0, #4
adds r0, #0x1e
strh r0, [r4, #0x24]
b _080A233E
_080A231C:
ldrh r0, [r4, #0x24]
subs r0, #1
strh r0, [r4, #0x24]
lsls r0, r0, #0x10
cmp r0, #0
bne _080A233E
bl Random
movs r1, #7
ands r0, r1
lsls r0, r0, #4
adds r0, #0x1e
strh r0, [r4, #0x24]
movs r0, #2
b _080A233C
_080A233A:
movs r0, #1
_080A233C:
strb r0, [r4, #0xc]
_080A233E:
pop {r4, r5, pc}
.syntax divided

View File

@ -58,12 +58,8 @@ void sub_080A22B0(Entity* this) {
} }
} }
NONMATCH("asm/non_matching/objectBD/sub_080A22C4.inc", void sub_080A22C4(Entity* this)) { void sub_080A22C4(Entity* this) {
u8 bVar1; u32 tmp1, tmp2, tmp3;
u8 uVar2;
s16 sVar3;
u32 uVar4;
u32 tmp1, tmp2, tmp3, tmp4;
switch (this->action) { switch (this->action) {
case 0: case 0:
@ -71,13 +67,13 @@ NONMATCH("asm/non_matching/objectBD/sub_080A22C4.inc", void sub_080A22C4(Entity*
this->timer = 8; this->timer = 8;
this->subtimer = 0; this->subtimer = 0;
this->subAction = this->frameIndex; this->subAction = this->frameIndex;
this->speed = (Random() & 3) * 0x10 + 0x1e; this->speed = ((Random() & 3) << 4) + 0x1e;
break; break;
case 1: case 1:
if (--this->speed != 0) { if (--this->speed != 0) {
return; return;
} }
this->speed = (Random() & 7) * 0x10 + 0x1e; this->speed = ((Random() & 7) << 4) + 0x1e;
this->action = 2; this->action = 2;
break; break;
default: default:
@ -96,7 +92,6 @@ NONMATCH("asm/non_matching/objectBD/sub_080A22C4.inc", void sub_080A22C4(Entity*
break; break;
} }
} }
END_NONMATCH
void sub_080A2340(Entity* this) { void sub_080A2340(Entity* this) {
const struct_08125014* ptr; const struct_08125014* ptr;