summaryrefslogtreecommitdiff
path: root/src/code/z_actor.c
diff options
context:
space:
mode:
authorDragorn421 <Dragorn421@users.noreply.github.com>2022-06-20 13:17:09 -0700
committerGitHub <noreply@github.com>2022-06-20 16:17:09 -0400
commit017a3aaf5cdf650f756cc59a5f25a65f4de2ce58 (patch)
tree44b4bcf8aed7e86b671c4c69dab8b2a548e97413 /src/code/z_actor.c
parentb602276fef6690159c3b3d0fedb68a08dd904134 (diff)
Some doc on actor overlays alloc types (#1266)
* Some doc on actor overlays alloc types * Line breaks between defines at the top of actor.h * plain english * `ACTOR_ALLOC_` -> `ACTOROVL_ALLOC_` * More line breaks * `ACTOR_OVERLAY_ABSOLUTE_SPACE_SIZE` -> `ACTOROVL_ABSOLUTE_SPACE_SIZE` * Document bug about Scarecrow's Song not setting the flag to restore Nayru's Love * Try to document the check for needing to actor_kill to leave the absolute space being too broad * "which overlay uses" (bad english) -> simplify to "which uses" * Run formatter
Diffstat (limited to 'src/code/z_actor.c')
-rw-r--r--src/code/z_actor.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c
index aa038eb29..3d9798665 100644
--- a/src/code/z_actor.c
+++ b/src/code/z_actor.c
@@ -2630,11 +2630,11 @@ void Actor_FreeOverlay(ActorOverlay* actorOverlay) {
}
if (actorOverlay->loadedRamAddr != NULL) {
- if (actorOverlay->allocType & ALLOCTYPE_PERMANENT) {
+ if (actorOverlay->allocType & ACTOROVL_ALLOC_PERSISTENT) {
if (HREG(20) != 0) {
osSyncPrintf("オーバーレイ解放しません\n"); // "Overlay will not be deallocated"
}
- } else if (actorOverlay->allocType & ALLOCTYPE_ABSOLUTE) {
+ } else if (actorOverlay->allocType & ACTOROVL_ALLOC_ABSOLUTE) {
if (HREG(20) != 0) {
// "Absolute magic field reserved, so deallocation will not occur"
osSyncPrintf("絶対魔法領域確保なので解放しません\n");
@@ -2696,20 +2696,22 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos
osSyncPrintf("既にロードされています\n"); // "Already loaded"
}
} else {
- if (overlayEntry->allocType & ALLOCTYPE_ABSOLUTE) {
- ASSERT(overlaySize <= AM_FIELD_SIZE, "actor_segsize <= AM_FIELD_SIZE", "../z_actor.c", 6934);
+ if (overlayEntry->allocType & ACTOROVL_ALLOC_ABSOLUTE) {
+ ASSERT(overlaySize <= ACTOROVL_ABSOLUTE_SPACE_SIZE, "actor_segsize <= AM_FIELD_SIZE", "../z_actor.c",
+ 6934);
if (actorCtx->absoluteSpace == NULL) {
// "AMF: absolute magic field"
- actorCtx->absoluteSpace = ZeldaArena_MallocRDebug(AM_FIELD_SIZE, "AMF:絶対魔法領域", 0);
+ actorCtx->absoluteSpace =
+ ZeldaArena_MallocRDebug(ACTOROVL_ABSOLUTE_SPACE_SIZE, "AMF:絶対魔法領域", 0);
if (HREG(20) != 0) {
// "Absolute magic field reservation - %d bytes reserved"
- osSyncPrintf("絶対魔法領域確保 %d バイト確保\n", AM_FIELD_SIZE);
+ osSyncPrintf("絶対魔法領域確保 %d バイト確保\n", ACTOROVL_ABSOLUTE_SPACE_SIZE);
}
}
overlayEntry->loadedRamAddr = actorCtx->absoluteSpace;
- } else if (overlayEntry->allocType & ALLOCTYPE_PERMANENT) {
+ } else if (overlayEntry->allocType & ACTOROVL_ALLOC_PERSISTENT) {
overlayEntry->loadedRamAddr = ZeldaArena_MallocRDebug(overlaySize, name, 0);
} else {
overlayEntry->loadedRamAddr = ZeldaArena_MallocDebug(overlaySize, name, 0);