z_actor with some documentation, with 1 NON_EQUIVALENTs (#401)

* Match Player_GetHeight

* Another bunch

* Fix merge conflict

* rename Gfx_DrawDListXlu

* add WEEROR

* Actor_Spawn

* almost Actor_SpawnTransitionActors  and Actor_Delete

* A bunch of small actors

* More renames

* format

* Some Player renames

* a few more

* import data

* run formatter

* func_800B7170

* whoops

* Fix merge issues

* Whoops 2

* func_800B83BC and func_800B83F8

* Actor_IsActorFacingPlayerAndWithinRange

* add some prototypes

* match Actor_UpdateBgCheckInfo

* func_800B7678

* mark Actor_SpawnAsChildAndCutscene as non_matching

* Actor_Draw

* Update is chaotic

* 2 new matches

* func_800BC8B8

* Another bunch

* function renames

* run formatter

* cleanup

* remove unnecesary casts

* add missing sfx

* Fix renames

* fix merge

* func_800BF7CC

* small bunch

* another bunch

* func_800BE184 non_matching

* two more

* split z_cheap_proc

* Another bunch

* another bunch

* a few and a non matching

* yeee

* a

* Actor_DrawAll non_equivalent

* Actor_RecordUndrawnActor

* i don't know what to put in this commit message

* func_800B4B50 non matching

* func_800B42F8 non matching

* func_800B5040

* func_800B5814 non_equiv

* func_800B6584

* func_800B6608

* func_800B6680

* func_800B7E04

* func_800B8118

* func_800b9170

* ,

* func_800BC4EC

* func_800BA6FC

* func_800BA798

* func_800BA8B8

* Actor_LoadOverlay

* small cleanup

* func_800BB2D0

* meh

* func_800BBAC0

* func_800BC270

* func_800B5208 non matching

* Fix warnings

* meh

* rename some ActorShadow_ functions

* fairy

* Flags_

* fix warnings

* format

* Actor_PickUp and family

* func_800B8E58

* match Actor_RemoveFromCategory

* another bit of docs

* Match func_800B86C8

* And another bit

* rename Player_GetRunSpeedLimit

* func_800B9E84

* func_800BE63C

* func_800BB8EC

* match func_800B5814

* match func_800B9334

* cleanup

* fix conflicts: first pass

* another fix

* actorfixer fix

* fix conflicts

* func_800BE680 non_equivalent

* Improve func_800BE680 a bit

* func_800BE680 equivalent (?)

* func_800BE680 equivalent

* Actor_UpdateActor equivalent

* format

* use some  ExchangeItemID enum values

* Some more cleaning

* more cleanup

* More name stealing from OoT

* match func_800B82EC

* match func_800B9D1C and a bit of cleanup

* Add ACTOR_FLAGS placeholders

* Renames and match func_800BE184

* last pass of name stealing

* format

* fix conflicts

* more cleanup

* more cleanup

* cleanup and OVERLAY_RELOCATION_OFFSET macro

* Remove prototypes of obviously internal-only functions,
update variable names,
forward declare where necessary,
remove all `param_\d`s

* remove newlines

* minor rename

* Use ACTOR_FLAGS in z_actor

* Match func_800BE3D0

* Rename movement functions

* Document Actor_CalcOffsetOrientedToDrawRotation

* velX -> horizontalSpeed

* A bit of documentation for actor movement functions

* format

* Fix merge issues

* format

* Format

* Fix renames

* fix warnings

* fix conflicts

* review :D

* Update src/overlays/actors/ovl_En_Ma4/z_en_ma4.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Fix

* format

* Actor_SpawnSetupActors

* engineer review

* Update src/code/z_actor.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* A bunch of Engineer's reviews

* more Engineer's review

* a

* whoops

* run actorfixer

* c'mon

* 😮‍💨

* whoops

* warning

* More engineer's review

* run format

* I'm dumb

* a

* match func_800BE680

* Match Actor_DrawZTarget

* Match Actor_SpawnAsChildAndCutscene, fix non-equivalent in Actor_UpdateActor

* Fix merge issue

* format

* update actor

* Steal a bit of @Thar0 documentation from OoT's z_message

* Run actorfixer

* Fix renames

* Match func_800B4B50 thanks to @hensldm

* Improve ActorShadow_DrawFeet thanks to @hensldm

* whoops

* Actor_PlaySfxAtProjectedPos

* Actor_UpdateActor matched by @hensldm

* Match func_800BA2FC by @hensldm

* Match Actor_SpawnTransitionActors by @hensldm

* Match func_800BB604 by @hensldm

* Match Actor_DrawAll by @hensldm

* ActorShadow_DrawFeet by @hensldm

* Actor_UpdateAll by @hensldm

* Match func_800BCCDC by @engineer124

* Small Actor_PlaySfxAtPos by @engineer124

* ACTOR_FLAGS_ALL and a bit of cleanup

* Add invisible comment

* Small docs pass

* Fix merge

* Engineer's review

* format lol

* Actor_DrawDoorLock docs

* Actor_SpawnShieldParticlesMetal

* fix merge issues

* sActorFaultClient

* fix

* commit message

* Run actorfixer.py && format.sh

* Fix warnings

* fixes

* format

* bss

* Update include/functions.h

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Address review

* Fix merge issues, format and such

* fix merge issues

* Add ACTORCAT_MAX

* actorList -> actorLists

* Fix merge issues

* format

* Enable WERROR on jenkinsfile

* Fix merge

* Use object symbols

* address review

* format

* review

* fix merge issues

* fix

* VRAM_PTR_SIZE, small cleanup and format

* review

Co-authored-by: Elliptic Ellipsis <elliptic.ellipsis@gmail.com>
Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
Co-authored-by: engineer124 <engineer124engineer124@gmail.com>
This commit is contained in:
Anghelo Carvajal
2022-01-10 14:04:28 -03:00
committed by GitHub
parent b74bec0e1d
commit 6069a1585f
260 changed files with 7753 additions and 3747 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A5BD0/func_801A5C8C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A5BD0/func_801A5CFC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A5BD0/Audio_PlaySfxGeneral.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A5BD0/func_801A5DDC.s")
+1 -1
View File
@@ -97,7 +97,7 @@ void* Graph_FaultAddrConvFunc(void* address, void* param) {
s32 i;
for (i = 0; i < graphNumGameStates; i++, gamestateOvl++) {
diff = (uintptr_t)gamestateOvl->vramEnd - (uintptr_t)gamestateOvl->vramStart;
diff = VRAM_PTR_SIZE(gamestateOvl);
ramStart = gamestateOvl->loadedRamAddr;
ramConv = (uintptr_t)gamestateOvl->vramStart - (uintptr_t)ramStart;
+1
View File
@@ -1,3 +1,4 @@
#include "prevent_bss_reordering.h"
#include "global.h"
#define RSP_DONE_MSG 667
+1 -1
View File
@@ -138,7 +138,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_IsPointInSphere.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017D668.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_PointDistToLine2D.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017D7C0.s")
+4297 -452
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -722,7 +722,7 @@ void ActorOverlayTable_FaultPrint(void* arg0, void* arg1) {
FaultDrawer_Printf("No. RamStart- RamEnd cn Name\n");
for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxActorId; i++, overlayEntry++) {
overlaySize = (u32)overlayEntry->vramEnd - (u32)overlayEntry->vramStart;
overlaySize = VRAM_PTR_SIZE(overlayEntry);
if (overlayEntry->loadedRamAddr != NULL) {
FaultDrawer_Printf("%3d %08x-%08x %3d %s\n", i, overlayEntry->loadedRamAddr,
(u32)overlayEntry->loadedRamAddr + overlaySize, overlayEntry->numLoaded, "");
@@ -740,7 +740,7 @@ void* ActorOverlayTable_FaultAddrConv(void* arg0, void* arg1) {
u32 offset;
for (i = 0; i < gMaxActorId; i++, overlayEntry++) {
size = (u8*)overlayEntry->vramEnd - (u8*)overlayEntry->vramStart;
size = VRAM_PTR_SIZE(overlayEntry);
ramStart = overlayEntry->loadedRamAddr;
ramEnd = ramStart + size;
offset = (u8*)overlayEntry->vramStart - ramStart;
+1 -1
View File
@@ -3991,7 +3991,7 @@ void BgCheck_InitCollisionHeaders(CollisionContext* colCtx, GlobalContext* globa
for (i = 0; i < BG_ACTOR_MAX; i++) {
flag = dyna->bgActorFlags[i];
if ((flag & 1) && !(flag & 2)) {
Actor_SetObjectSegment(globalCtx, dyna->bgActors[i].actor);
Actor_SetObjectDependency(globalCtx, dyna->bgActors[i].actor);
CollisionHeader_SegmentedToVirtual(dyna->bgActors[i].colHeader);
}
}
+1 -1
View File
@@ -312,7 +312,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_SetMode.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DF840.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ChangeMode.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DF86C.s")
+39
View File
@@ -0,0 +1,39 @@
#include "global.h"
/**
* Draws a display list to the opaque display buffer
*/
void Gfx_DrawDListOpa(GlobalContext* globalCtx, Gfx* dlist) {
Gfx* dl;
OPEN_DISPS(globalCtx->state.gfxCtx);
dl = POLY_OPA_DISP;
gSPDisplayList(&dl[0], &sSetupDL[6 * 0x19]);
gSPMatrix(&dl[1], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(&dl[2], dlist);
POLY_OPA_DISP = &dl[3];
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
/**
* Draws a display list to the translucent display buffer
*/
void Gfx_DrawDListXlu(GlobalContext* globalCtx, Gfx* dlist) {
Gfx* dl;
OPEN_DISPS(globalCtx->state.gfxCtx);
dl = POLY_XLU_DISP;
gSPDisplayList(&dl[0], &sSetupDL[6 * 0x19]);
gSPMatrix(&dl[1], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(&dl[2], dlist);
POLY_XLU_DISP = &dl[3];
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
+3 -5
View File
@@ -172,7 +172,7 @@ void EffectSs_Spawn(GlobalContext* globalCtx, s32 type, s32 priority, void* init
}
sEffectSsInfo.searchIndex = index + 1;
overlaySize = (uintptr_t)entry->vramEnd - (uintptr_t)entry->vramStart;
overlaySize = VRAM_PTR_SIZE(entry);
if (entry->vramStart == NULL) {
initInfo = entry->initInfo;
@@ -187,10 +187,8 @@ void EffectSs_Spawn(GlobalContext* globalCtx, s32 type, s32 priority, void* init
Load2_LoadOverlay(entry->vromStart, entry->vromEnd, entry->vramStart, entry->vramEnd, entry->loadedRamAddr);
}
initInfo = (u32)((entry->initInfo != NULL)
? (EffectSsInit*)(-((uintptr_t)entry->vramStart - (uintptr_t)entry->loadedRamAddr) +
(uintptr_t)entry->initInfo)
: NULL);
initInfo = (uintptr_t)(
(entry->initInfo != NULL) ? (void*)(-OVERLAY_RELOCATION_OFFSET(entry) + (uintptr_t)entry->initInfo) : NULL);
}
if (initInfo->init != NULL) {
+3 -3
View File
@@ -795,7 +795,7 @@ void EffectSsEnIce_SpawnFlyingVec3f(GlobalContext* globalCtx, Actor* actor, Vec3
initParams.scale = scale;
if (actor != NULL) {
Audio_PlayActorSound2(actor, NA_SE_PL_FREEZE_S);
Actor_PlaySfxAtPos(actor, NA_SE_PL_FREEZE_S);
}
EffectSs_Spawn(globalCtx, EFFECT_SS_EN_ICE, 80, &initParams);
@@ -888,7 +888,7 @@ void EffectSsEnFire_SpawnVec3f(GlobalContext* globalCtx, Actor* actor, Vec3f* po
initParams.bodyPart = bodyPart;
if (actor != NULL) {
Audio_PlayActorSound2(actor, NA_SE_EV_FLAME_IGNITION);
Actor_PlaySfxAtPos(actor, NA_SE_EV_FLAME_IGNITION);
}
EffectSs_Spawn(globalCtx, EFFECT_SS_EN_FIRE, 128, &initParams);
@@ -908,7 +908,7 @@ void EffectSsEnFire_SpawnVec3s(GlobalContext* globalCtx, Actor* actor, Vec3s* po
initParams.bodyPart = bodyPart;
if (actor != NULL) {
Audio_PlayActorSound2(actor, NA_SE_EV_FLAME_IGNITION);
Actor_PlaySfxAtPos(actor, NA_SE_EV_FLAME_IGNITION);
}
EffectSs_Spawn(globalCtx, EFFECT_SS_EN_FIRE, 128, &initParams);
+6 -6
View File
@@ -11,10 +11,10 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.textId = ((this->actor.params >> 8) & 0xFF) | 0x300;
this->actor.params = (this->actor.params & 0xFF) - 9;
Actor_ProcessInitChain(&this->actor, &enAObjInitVar);
ActorShape_Init(&this->actor.shape, 0, func_800B3FC0, 12);
ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 12);
Collider_InitAndSetCylinder(globalCtx, &this->collision, &this->actor, &enAObjCylinderInit);
Collider_UpdateCylinder(&this->actor, &this->collision);
this->actor.colChkInfo.mass = 255;
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actionFunc = EnAObj_Update1;
}
@@ -27,7 +27,7 @@ void EnAObj_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void EnAObj_Update1(EnAObj* this, GlobalContext* globalCtx) {
s32 yawDiff;
if (func_800B84D0(&this->actor, globalCtx)) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
this->actionFunc = EnAObj_Update2;
} else {
yawDiff = ABS_ALT((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y));
@@ -39,7 +39,7 @@ void EnAObj_Update1(EnAObj* this, GlobalContext* globalCtx) {
}
void EnAObj_Update2(EnAObj* this, GlobalContext* globalCtx) {
if (func_800B867C(&this->actor, globalCtx)) {
if (Actor_TextboxIsClosing(&this->actor, globalCtx)) {
this->actionFunc = EnAObj_Update1;
}
}
@@ -48,10 +48,10 @@ void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx) {
EnAObj* this = THIS;
this->actionFunc(this, globalCtx);
Actor_SetHeight(&this->actor, 45.0f);
Actor_SetFocus(&this->actor, 45.0f);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collision.base);
}
void EnAObj_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_800BDFC0(globalCtx, enAObjDisplayLists[thisx->params]);
Gfx_DrawDListOpa(globalCtx, enAObjDisplayLists[thisx->params]);
}
+3 -3
View File
@@ -131,7 +131,7 @@ void func_800F0BB4(EnHy* enHy, GlobalContext* globalCtx, Actor* door, s16 arg3,
Vec3f offset;
f32 phi_f0;
Actor_CalcOffsetOrientedToDrawRotation(door, &offset, &enHy->actor.world.pos);
Actor_OffsetOfPointInActorCoords(door, &offset, &enHy->actor.world.pos);
phi_f0 = (offset.z >= 0.0f) ? 1.0f : -1.0f;
sp3B = ((s8)phi_f0 < 0) ? 0 : 2;
EnHy_ChangeObjectAndAnim(enHy, globalCtx, (sp3B == 0) ? arg3 : arg4);
@@ -260,12 +260,12 @@ s32 EnHy_PlayWalkingSound(EnHy* enHy, GlobalContext* globalCtx, f32 distAboveThr
enHy->isLeftFootOnGround = isFootOnGround = func_8013DB90(globalCtx, &enHy->leftFootPos, distAboveThreshold);
if (enHy->isLeftFootOnGround && !wasLeftFootOnGround && isFootOnGround) {
Audio_PlayActorSound2(&enHy->actor, sfxId);
Actor_PlaySfxAtPos(&enHy->actor, sfxId);
}
enHy->isRightFootOnGround = isFootOnGround = func_8013DB90(globalCtx, &enHy->rightFootPos, distAboveThreshold);
if (enHy->isRightFootOnGround && !wasRightFootOnGround && isFootOnGround) {
Audio_PlayActorSound2(&enHy->actor, sfxId);
Actor_PlaySfxAtPos(&enHy->actor, sfxId);
}
return 0;
}
+16 -16
View File
@@ -43,7 +43,7 @@ static InitChainEntry sInitChain[] = {
};
void EnItem00_SetObject(EnItem00* this, GlobalContext* globalCtx, f32* shadowOffset, f32* shadowScale) {
Actor_SetObjectSegment(globalCtx, &this->actor);
Actor_SetObjectDependency(globalCtx, &this->actor);
Actor_SetScale(&this->actor, 0.5f);
this->unk154 = 0.5f;
*shadowOffset = 0.0f;
@@ -63,7 +63,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
thisx->params &= 0xFF; // Has to be thisx to match
if (Actor_GetCollectibleFlag(globalCtx, this->collectibleFlag)) {
if (Flags_GetCollectible(globalCtx, this->collectibleFlag)) {
if (this->actor.params == ITEM00_HEART_PIECE) {
sp30 = 0;
this->collectibleFlag = 0;
@@ -169,7 +169,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
}
this->unk14E = 0;
ActorShape_Init(&this->actor.shape, shadowOffset, func_800B3FC0, shadowScale);
ActorShape_Init(&this->actor.shape, shadowOffset, ActorShadow_DrawCircle, shadowScale);
this->actor.shape.shadowAlpha = 180;
this->actor.focus.pos = this->actor.world.pos;
this->unk14A = GI_NONE;
@@ -251,7 +251,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
}
if ((getItemId != GI_NONE) && (Actor_HasParent(&this->actor, globalCtx) == 0)) {
func_800B8A1C(&this->actor, globalCtx, getItemId, 50.0f, 20.0f);
Actor_PickUp(&this->actor, globalCtx, getItemId, 50.0f, 20.0f);
}
this->actionFunc = func_800A6A40;
@@ -407,7 +407,7 @@ void func_800A6A40(EnItem00* this, GlobalContext* globalCtx) {
if (this->unk14A != GI_NONE) {
if (Actor_HasParent(&this->actor, globalCtx) == 0) {
func_800B8A1C(&this->actor, globalCtx, this->unk14A, 50.0f, 80.0f);
Actor_PickUp(&this->actor, globalCtx, this->unk14A, 50.0f, 80.0f);
this->unk152++;
} else {
this->unk14A = GI_NONE;
@@ -457,7 +457,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actor.scale.y = this->actor.scale.x;
if (this->actor.gravity != 0.0f) {
Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor);
Actor_MoveWithGravity(&this->actor);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 15.0f, 15.0f, 0x1D);
if (this->actor.floorHeight <= BGCHECK_Y_MIN) {
@@ -574,7 +574,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
if (getItemId != GI_NONE) {
if (!Actor_HasParent(&this->actor, globalCtx)) {
func_800B8A1C(&this->actor, globalCtx, getItemId, 50.0f, 20.0f);
Actor_PickUp(&this->actor, globalCtx, getItemId, 50.0f, 20.0f);
}
}
@@ -586,7 +586,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
case ITEM00_MAP:
case ITEM00_COMPASS:
if (Actor_HasParent(&this->actor, globalCtx)) {
Actor_SetCollectibleFlag(globalCtx, this->collectibleFlag);
Flags_SetCollectible(globalCtx, this->collectibleFlag);
Actor_MarkForDeath(&this->actor);
}
return;
@@ -598,7 +598,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
play_sound(NA_SE_SY_GET_RUPY);
} else if (getItemId != GI_NONE) {
if (Actor_HasParent(&this->actor, globalCtx)) {
Actor_SetCollectibleFlag(globalCtx, this->collectibleFlag);
Flags_SetCollectible(globalCtx, this->collectibleFlag);
Actor_MarkForDeath(&this->actor);
}
return;
@@ -606,7 +606,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
play_sound(NA_SE_SY_GET_ITEM);
}
Actor_SetCollectibleFlag(globalCtx, this->collectibleFlag);
Flags_SetCollectible(globalCtx, this->collectibleFlag);
this->unk152 = 15;
this->unk14C = 35;
@@ -651,7 +651,7 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART);
if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) {
this->actor.objBankIndex = bankIndex;
Actor_SetObjectSegment(globalCtx, &this->actor);
Actor_SetObjectDependency(globalCtx, &this->actor);
this->unk152 = -2;
}
} else {
@@ -848,7 +848,7 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, u32 param
}
} else if (paramFF == ITEM00_MUSHROOM_CLOUD) {
param7F00 >>= 8;
if (!Actor_GetCollectibleFlag(globalCtx, param7F00)) {
if (!Flags_GetCollectible(globalCtx, param7F00)) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_OBJ_KINOKO, spawnPos->x, spawnPos->y, spawnPos->z, 0, 0,
0, param7F00);
}
@@ -857,7 +857,7 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, u32 param
if (newParamFF == ITEM00_FLEXIBLE) {
spawnedActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f,
spawnPos->z, 0, 0, 0, ((((param7F00 >> 8) & 0x7F) << 9) & 0xFE00) | 0x102);
if (!Actor_GetCollectibleFlag(globalCtx, (param7F00 >> 8) & 0x7F)) {
if (!Flags_GetCollectible(globalCtx, (param7F00 >> 8) & 0x7F)) {
Audio_PlaySoundAtPosition(globalCtx, spawnPos, 40, NA_SE_EV_BUTTERFRY_TO_FAIRY);
}
} else {
@@ -865,7 +865,7 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, u32 param
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELFORG, spawnPos->x, spawnPos->y + 40.0f,
spawnPos->z, 0, 0, 0, ((((param7F00 >> 8) & 0x7F) & 0x7F) << 9) | 7);
if (param20000 == 0) {
if (!Actor_GetCollectibleFlag(globalCtx, (param7F00 >> 8) & 0x7F)) {
if (!Flags_GetCollectible(globalCtx, (param7F00 >> 8) & 0x7F)) {
Audio_PlaySoundAtPosition(globalCtx, spawnPos, 40, NA_SE_EV_BUTTERFRY_TO_FAIRY);
}
}
@@ -923,7 +923,7 @@ Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s32 para
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELFORG, spawnPos->x, spawnPos->y + 40.0f,
spawnPos->z, 0, 0, 0, ((((param7F00 >> 8) & 0x7F) & 0x7F) << 9) | 7);
}
if (Actor_GetCollectibleFlag(globalCtx, (param7F00 >> 8) & 0x7F) == 0) {
if (Flags_GetCollectible(globalCtx, (param7F00 >> 8) & 0x7F) == 0) {
Audio_PlaySoundAtPosition(globalCtx, spawnPos, 40, NA_SE_EV_BUTTERFRY_TO_FAIRY);
}
} else {
@@ -1179,5 +1179,5 @@ s32 func_800A817C(s32 index) {
}
s32 func_800A81A4(GlobalContext* globalCtx, s32 a1, s32 a2) {
return (func_800A8150(a1) == ITEM00_BIG_FAIRY) && (!Actor_GetCollectibleFlag(globalCtx, a2));
return (func_800A8150(a1) == ITEM00_BIG_FAIRY) && (!Flags_GetCollectible(globalCtx, a2));
}
+3 -3
View File
@@ -24,7 +24,7 @@ void* KaleidoManager_FaultAddrConvFunc(void* address, void* param) {
uintptr_t offset;
if (ovl != NULL) {
size = (u8*)ovl->vramEnd - (u8*)ovl->vramStart;
size = VRAM_PTR_SIZE(ovl);
ramStart = ovl->loadedRamAddr;
ramEnd = ramStart + size;
offset = (u8*)ovl->vramStart - ramStart;
@@ -47,7 +47,7 @@ void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl) {
void KaleidoManager_ClearOvl(KaleidoMgrOverlay* ovl) {
if (ovl->loadedRamAddr != NULL) {
ovl->offset = 0;
bzero(ovl->loadedRamAddr, (uintptr_t)ovl->vramEnd - (uintptr_t)ovl->vramStart);
bzero(ovl->loadedRamAddr, VRAM_PTR_SIZE(ovl));
ovl->loadedRamAddr = NULL;
gKaleidoMgrCurOvl = NULL;
}
@@ -59,7 +59,7 @@ void KaleidoManager_Init(GlobalContext* globalCtx) {
u32 i;
for (i = 0; i < ARRAY_COUNT(gKaleidoMgrOverlayTable); i++) {
size = (uintptr_t)gKaleidoMgrOverlayTable[i].vramEnd - (uintptr_t)gKaleidoMgrOverlayTable[i].vramStart;
size = VRAM_PTR_SIZE(&gKaleidoMgrOverlayTable[i]);
if (size > largestSize) {
largestSize = size;
}
+2 -2
View File
@@ -399,9 +399,9 @@ void LifeMeter_UpdateSizeAndBeep(GlobalContext* globalCtx) {
if (interfaceCtx->lifeSizeChange <= 0) {
interfaceCtx->lifeSizeChange = 0;
interfaceCtx->lifeSizeChangeDirection = 0;
if (func_801233E4(globalCtx) == 0 && (globalCtx->pauseCtx.state == 0) &&
if (Player_InCsMode(&globalCtx->state) == 0 && (globalCtx->pauseCtx.state == 0) &&
(globalCtx->pauseCtx.debugState == 0) && LifeMeter_IsCritical() && func_801690CC(globalCtx) == 0) {
// func_801233E4 and func_801690CC : Check if in Cutscene
// Player_InCsMode and func_801690CC : Check if in Cutscene
play_sound(NA_SE_SY_HITPOINT_ALARM);
}
}
+1 -1
View File
@@ -382,7 +382,7 @@ void Lights_GlowCheck(GlobalContext* globalCtx) {
pos.x = params->x;
pos.y = params->y;
pos.z = params->z;
func_800B4EDC(globalCtx, &pos, &multDest, &wDest);
Actor_GetProjectedPos(globalCtx, &pos, &multDest, &wDest);
params->drawGlow = 0;
+1 -1
View File
@@ -80,7 +80,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message/func_80152464.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message/func_80152498.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message/Message_GetState.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message/func_8015268C.s")
+2 -2
View File
@@ -38,7 +38,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80123358.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_801233E4.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/Player_InCsMode.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80123420.s")
@@ -114,7 +114,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8012422C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80124258.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/Player_GetExplosiveHeld.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80124278.s")
+1 -1
View File
@@ -608,7 +608,7 @@ void Quake2_Update(void) {
player = GET_PLAYER(globalCtx);
if (&player->actor != NULL) {
func_800B8248(&playerPosRot, player);
Actor_GetWorldPosShapeRot(&playerPosRot, &player->actor);
}
angle1Speed = 359.2f;
+2 -2
View File
@@ -20,7 +20,7 @@ s32 func_8013A240(GlobalContext* globalCtx) {
}
for (; type < 12; type++) {
for (actor = globalCtx->actorCtx.actorList[type].first; actor != NULL; actor = actor->next) {
for (actor = globalCtx->actorCtx.actorLists[type].first; actor != NULL; actor = actor->next) {
seen = 0;
switch (globalCtx->sceneNum) {
@@ -134,7 +134,7 @@ s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos,
ret |= 0x3e;
}
func_800B4EDC(globalCtx, pos, &screenSpace, &distance);
Actor_GetProjectedPos(globalCtx, pos, &screenSpace, &distance);
x = (s16)(screenSpace.x * distance * 160.0f + 160.0f) - 85;
y = (s16)(screenSpace.y * distance * -120.0f + 120.0f) - 67;
if ((x < 0) || (0x96 < x) || (y < 0) || (0x69 < y)) {
+2 -2
View File
@@ -142,7 +142,7 @@ Actor* SubS_FindActor(GlobalContext* globalCtx, Actor* actorListStart, u8 actorC
Actor* actor = actorListStart;
if (actor == NULL) {
actor = globalCtx->actorCtx.actorList[actorCategory].first;
actor = globalCtx->actorCtx.actorLists[actorCategory].first;
}
while (actor != NULL && actorId != actor->id) {
@@ -191,7 +191,7 @@ Actor* SubS_FindActorCustom(GlobalContext* globalCtx, Actor* actor, Actor* actor
Actor* actorIter = actorListStart;
if (actorListStart == NULL) {
actorIter = globalCtx->actorCtx.actorList[actorCategory].first;
actorIter = globalCtx->actorCtx.actorLists[actorCategory].first;
}
while (actorIter != NULL && (actorId != actorIter->id ||