summaryrefslogtreecommitdiff
path: root/src/code/z_actor.c
diff options
context:
space:
mode:
authorDerek Hensley <hensley.derek58@gmail.com>2023-06-23 21:26:36 -0700
committerGitHub <noreply@github.com>2023-06-24 14:26:36 +1000
commit5619dc5b5e3a1507feb7828ccfd70fe67268ece4 (patch)
treefbe6c35e740d095b949a809c11f32ea662b6d51b /src/code/z_actor.c
parentaa9e368561ae13106daa14da4e2bf0656bfc70da (diff)
Load Docs (#1222)
* Sync with OoT * Macro cleanup * Some cleanup/rename load system name to Fragment * Format * bss * Some clarifying comments regarding fragments * PR suggestions * size_t and numRelocations
Diffstat (limited to 'src/code/z_actor.c')
-rw-r--r--src/code/z_actor.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c
index ac014e5ca..9d1ec98a5 100644
--- a/src/code/z_actor.c
+++ b/src/code/z_actor.c
@@ -4,8 +4,8 @@
*/
#include "global.h"
+#include "loadfragment.h"
#include "z64horse.h"
-#include "z64load.h"
#include "z64quake.h"
#include "z64rumble.h"
#include "overlays/actors/ovl_En_Horse/z_en_horse.h"
@@ -3157,7 +3157,7 @@ ActorInit* Actor_LoadOverlay(ActorContext* actorCtx, s16 index) {
ActorOverlay* overlayEntry = &gActorOverlayTable[index];
ActorInit* actorInit;
- overlaySize = VRAM_PTR_SIZE(overlayEntry);
+ overlaySize = (uintptr_t)overlayEntry->vramEnd - (uintptr_t)overlayEntry->vramStart;
if (overlayEntry->vramStart == NULL) {
actorInit = overlayEntry->initInfo;
@@ -3178,14 +3178,15 @@ ActorInit* Actor_LoadOverlay(ActorContext* actorCtx, s16 index) {
return NULL;
}
- Load2_LoadOverlay(overlayEntry->vromStart, overlayEntry->vromEnd, overlayEntry->vramStart,
- overlayEntry->vramEnd, overlayEntry->loadedRamAddr);
+ Overlay_Load(overlayEntry->vromStart, overlayEntry->vromEnd, overlayEntry->vramStart, overlayEntry->vramEnd,
+ overlayEntry->loadedRamAddr);
overlayEntry->numLoaded = 0;
}
actorInit = (uintptr_t)(
(overlayEntry->initInfo != NULL)
- ? (void*)((uintptr_t)overlayEntry->initInfo - (intptr_t)OVERLAY_RELOCATION_OFFSET(overlayEntry))
+ ? (void*)((uintptr_t)overlayEntry->initInfo -
+ (intptr_t)((uintptr_t)overlayEntry->vramStart - (uintptr_t)overlayEntry->loadedRamAddr))
: NULL);
}