From 017a3aaf5cdf650f756cc59a5f25a65f4de2ce58 Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Mon, 20 Jun 2022 13:17:09 -0700 Subject: 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 --- src/code/z_actor.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/code') 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); -- cgit v1.2.3