Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
14181ee
feat(restoration): Scaffold N64 heap fragmentation shadow arena
unreference May 7, 2026
0a21eab
feat(debugger): Add ZeldaArena heap viewer
unreference May 7, 2026
b07fd2a
refactor(enhancements): N64 memory model, not just heap fragmentation
unreference May 7, 2026
6dd560f
feat(restoration): Shadow arena allocator for N64 memory model
unreference May 7, 2026
e796770
feat(restoration): N64 memory model orchestration layer
unreference May 7, 2026
c26695c
feat(restoration): Actor overlay and instance hooks
unreference May 7, 2026
09cbafb
feat(restoration): Collider and effect overlay hooks
unreference May 7, 2026
6984087
feat(restoration): Remaining subsidiary hooks
unreference May 7, 2026
50faa7c
feat(restoration): ShadowArena via heap viewer
unreference May 7, 2026
ec2e468
feat(restoration): Dynamic arena sizing via THA remainder
unreference May 7, 2026
580adb3
feat(restoration): NTSC 1.2 arena sizing
unreference May 8, 2026
4124f94
feat(restoration): Exactly 16 unloads for Sun's Song grave
unreference May 8, 2026
1077761
chore(repo): OTRExporter and ZAPDTR submodules
unreference May 8, 2026
9f75b81
feat(restoration): Load scene file sizes from OTR via DMA size table
unreference May 8, 2026
bea5bf0
chore(repo): Update OTRExporter
unreference May 8, 2026
16d88b6
feat(restoration): Load overlay sizes from OTR instead of hardcoded t…
unreference May 8, 2026
7c2d538
fix(restoration): Use N64 DMA buffer sizes for doAction and mapSegment
unreference May 8, 2026
df57ad2
feat(restoration): Account for ovl_map_mark_data THA consumer in dung…
unreference May 8, 2026
c81d0bb
feat(restoration): Load actor instance sizes from OTR
unreference May 8, 2026
fce6d58
feat(restoration): ALIGN16 each THA consumer individually
unreference May 9, 2026
1f342ea
feat(restoration): elfMsg size from DMA blob
unreference May 9, 2026
8c44905
feat(restoration): Derive parameterStaticSize and effectiveSsSize
unreference May 9, 2026
0b9f527
feat(restoration): Skyblox per-ID DMA lookups
unreference May 9, 2026
e5f184c
feat(restoration): Derive kaleidoOverlayVramSize from OTR, eliminate …
unreference May 9, 2026
7352d5c
feat(restoration): Force immediate Actor_Delete in room teardown
unreference May 9, 2026
30bb02e
feat(restoration): MallocR for actor overlay shadow allocations
unreference May 9, 2026
e149bc4
feat(restoration): Instance-region gap correction for Object_Kankyo leak
unreference May 9, 2026
88fac9a
refactor: Clang format and other cleanups
unreference May 9, 2026
f4b4198
fix(restoration): Save actor ID before free in Actor_Delete
unreference May 10, 2026
ebbb450
feat(restoration): Use original actor sizes for enemy randomizer comp…
unreference May 10, 2026
f293931
feat(restoration): allocType from original actor for enemy randomizer
unreference May 10, 2026
a7c807a
fix(restoration): Skip subsidiary shadow for randomized actors
unreference May 10, 2026
5e71030
Revert "fix(restoration): Skip subsidiary shadow for randomized actors"
unreference May 10, 2026
991c849
Reapply "fix(restoration): Skip subsidiary shadow for randomized actors"
unreference May 10, 2026
01b99e8
feat(restoration): Skip child shadow tracking for randomized actors
unreference May 10, 2026
3e033c1
fix(restoration): Track overlays by original actor ID for enemy rando…
unreference May 10, 2026
9d3d6fa
feat(debugger): Heap viewer block identity, type coloring, and actor …
unreference May 10, 2026
0d082f8
feat(debugger): Heap viewer pinning with ghost rows for freed blocks
unreference May 10, 2026
9ebd3d4
fix(restoration): Reallocate cary-over overlay shadows after arena reset
unreference May 10, 2026
96c630b
Revert "fix(restoration): Reallocate cary-over overlay shadows after …
unreference May 10, 2026
2f999e7
fix(restoration): Version-specific ArenaNode size for shadow arena
unreference May 10, 2026
8d2fcca
fix(restoration): Version-specific GI object segment size
unreference May 10, 2026
f4399be
chore(repo): Update OTRExporter
unreference May 10, 2026
3b4b8f1
feat(restoration): Route overlay loads through correct allocator dire…
unreference May 11, 2026
e5d10ab
chore(repo): Update submodules to fix shadowed arena node resolution
unreference May 11, 2026
fdc99c0
Revert "chore(repo): Update submodules to fix shadowed arena node res…
unreference May 11, 2026
3f7008e
feat(restoration): Replicate N64 culling
unreference May 11, 2026
9e34fa3
chore(refactor): Comments for explaining memory interceptions
unreference May 11, 2026
b2f80c3
fix(restoration): Use original N64 culling check for actors
unreference May 11, 2026
4d54214
chore: Remove accidental SaveManager change
unreference May 11, 2026
3822c30
chore: More descriptive comments about how culling is handled
unreference May 12, 2026
3023fc8
fix(save): Guard sohStats access in StartupCheckAndInitMeta
unreference May 12, 2026
6ce7a62
chore: Clang format
unreference May 15, 2026
abfbe9d
chore: Remove from config updater
unreference May 15, 2026
cd83836
refactor: Prefer stdint over libultraship types
unreference May 15, 2026
70b66a0
chore: Update comments about OTR blob references
unreference May 15, 2026
f3941f6
chore: Cleanup comments and includes
unreference May 15, 2026
e65e8f0
fix(restoration): Suppress shadow allocations for randomized actor ch…
unreference May 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OTRExporter
2 changes: 1 addition & 1 deletion ZAPDTR
Submodule ZAPDTR updated 3 files
+70 −3 ZAPD/ZRom.cpp
+13 −9 ZAPD/ZRom.h
+43 −5 ZAPD/ZTextMM.cpp
4 changes: 4 additions & 0 deletions soh/include/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,10 @@ void ZeldaArena_FreeDebug(void* ptr, const char* file, s32 line);
void* ZeldaArena_Calloc(size_t num, size_t size);
void ZeldaArena_Display();
void ZeldaArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc);

// [SOH] Enhancement - Heap Viewer
ArenaNode* ZeldaArena_GetHead(void);

void ZeldaArena_Check();
void ZeldaArena_Init(void* start, size_t size);
void ZeldaArena_Cleanup();
Expand Down
12 changes: 10 additions & 2 deletions soh/soh/ActorDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@ ActorDB* ActorDB::Instance;
struct AddPair {
const char* name;
ActorInit& init;
// #region SOH [Enhancement] - Hardware Memory Limits
AllocType allocType;
// #endregion
};

#define DEFINE_ACTOR_INTERNAL(name, _1, allocType) { #name, name##_InitVars },
#define DEFINE_ACTOR(name, _1, allocType) { #name, name##_InitVars },
// #region SOH [Enhancement] - Hardware Memory Limits
#define DEFINE_ACTOR_INTERNAL(name, _1, allocType) { #name, name##_InitVars, allocType },
#define DEFINE_ACTOR(name, _1, allocType) { #name, name##_InitVars, allocType },
// #endregion
#define DEFINE_ACTOR_UNSET(_0)

static constexpr AddPair initialActorTable[] = {
Expand Down Expand Up @@ -470,6 +475,9 @@ ActorDB::ActorDB() {
db.reserve(ACTOR_NUMBER_MAX); // reserve size for all initial entries so we don't do it for each
for (const AddPair& pair : initialActorTable) {
Entry& entry = AddEntry(pair.name, actorDescriptions[pair.init.id], pair.init);
// #region SOH [Enhancement] - Hardware Memory Limits
entry.entry.allocType = pair.allocType;
// #endregion
}
}

Expand Down
3 changes: 3 additions & 0 deletions soh/soh/ActorDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ typedef struct {
ActorFunc draw;
ActorResetFunc reset;
s32 numLoaded;
// #region SOH [Enhancement] - Hardware Memory Limits
AllocType allocType;
// #endregion
} ActorDBEntry;

#ifdef __cplusplus
Expand Down
13 changes: 12 additions & 1 deletion soh/soh/Enhancements/ExtraModes/EnemyRandomizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "soh/ResourceManagerHelpers.h"
#include "soh/SohGui/MenuTypes.h"
#include "soh/SohGui/SohMenu.h"
#include "soh/Enhancements/Restorations/HardwareMemoryLimits/HardwareMemoryLimits.hpp"

extern "C" {
#include <z64.h>
Expand Down Expand Up @@ -458,9 +459,19 @@ uint8_t GetRandomizedEnemy(PlayState* play, int16_t* actorId, s16* posX, s16* po
play->sceneNum + *actorId + (int)*posX + (int)*posY + (int)*posZ + *rotX + *rotY + *rotZ + *params;
EnemyEntry randomEnemy = GetRandomizedEnemyEntry(seed, play);

// #region SOH [Enhancement] - Hardware Memory Limits
// Save the original actor ID before randomization swap it. The shadow heap needs the original ID to allocate
// the correct overlay and instance sizes.
const s16 originalActorId = *actorId;
// #endregion

*actorId = randomEnemy.id;
*params = randomEnemy.params;

// #region SOH [Enhancement] - Hardware Memory Limits
N64Mem_SetOriginalActorId(originalActorId);
// #endregion

// Straighten out enemies so they aren't flipped on their sides when the original spawn is.
*rotX = 0;

Expand Down Expand Up @@ -986,4 +997,4 @@ void RegisterEnemyRandomizerWidgets() {
}

static RegisterShipInitFunc initFunc(RegisterEnemyRandomizer, { CVAR_ENEMY_RANDOMIZER_NAME });
static RegisterMenuInitFunc menuInitFunc(RegisterEnemyRandomizerWidgets);
static RegisterMenuInitFunc menuInitFunc(RegisterEnemyRandomizerWidgets);
Loading