Match ActorManager::FindActorById

This commit is contained in:
Mike
2024-05-11 14:44:34 -04:00
parent b7a6355bc6
commit 902f3bbce4
2 changed files with 6 additions and 53 deletions
@@ -1,43 +0,0 @@
stmdb sp!, {r3, lr}
cmp r1, #0
mov ip, #0
blt _020c366c
ldr r3, [r0, #8]
cmp r3, #0
blt _020c3628
ldr r2, [r0, #4]
cmp r3, r2
bge _020c3628
ldr r2, [r0, #0x10]
ldr r3, [r2, r3, lsl #2]
cmp r3, #0
ldrneb r2, [r3, #0x118]
cmpne r2, #0
beq _020c3628
ldr r2, [r3, #8]
cmp r1, r2
moveq ip, r3
beq _020c366c
_020c3628:
ldr r3, [r0, #0x10]
ldr r0, [r0, #4]
add lr, r3, r0, lsl #2
cmp r3, lr
bhs _020c366c
_020c363c:
ldr r2, [r3]
cmp r2, #0
ldrneb r0, [r2, #0x118]
cmpne r0, #0
beq _020c3660
ldr r0, [r2, #8]
cmp r1, r0
moveq ip, r2
beq _020c366c
_020c3660:
add r3, r3, #4
cmp r3, lr
blo _020c363c
_020c366c:
mov r0, ip
ldmia sp!, {r3, pc}
+6 -10
View File
@@ -135,10 +135,7 @@ ARM void ActorManager::Actor_vfunc_10(u32 param1) {
return;
}
Actor* NONMATCH(ActorManager::FindActorById)(s32 id) {
#ifndef NONMATCHING
#include "../asm/ov00/Actor/ActorManager_Actor_FindActorById.inc"
#else
ARM Actor* ActorManager::FindActorById(s32 id) {
u32 actorId;
s32 cacheIndex;
Actor *actor;
@@ -150,11 +147,10 @@ Actor* NONMATCH(ActorManager::FindActorById)(s32 id) {
cacheIndex = this->mCacheEmptyActorIndex;
if ((cacheIndex >= 0) && (cacheIndex < this->mMaxActorIndex)) {
pActor = this->mActorTable;
actor = this->mActorTable[cacheIndex];
if (actor != NULL) {
pActor = (Actor**)(u32)actor->mAlive;
if (pActor != NULL && id == actor->mId) {
return actor;
if (pActor[cacheIndex] != NULL) {
if ((Actor**)(u32)pActor[cacheIndex]->mAlive != NULL && id == pActor[cacheIndex]->mId) {
actor = pActor[cacheIndex];
goto ret;
}
}
}
@@ -173,8 +169,8 @@ Actor* NONMATCH(ActorManager::FindActorById)(s32 id) {
}
}
ret:
return actor;
#endif
}
Actor* ActorManager::GetActor(ActorRef *ref) {