1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-08 08:55:17 +00:00

[PAL N64] Miscellaneous changes (#2211)

* [PAL N64] Miscellaneous changes

* Reword comment

Co-authored-by: fig02 <fig02srl@gmail.com>

* glitch -> Glitch

---------

Co-authored-by: fig02 <fig02srl@gmail.com>
This commit is contained in:
cadmic 2024-09-23 17:13:09 -07:00 committed by GitHub
parent 56981d5297
commit 52a1c2f969
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 40 additions and 11 deletions

View file

@ -176,8 +176,10 @@ void Play_SetupTransition(PlayState* this, s32 transitionType) {
break;
default:
#if PLATFORM_N64
#if OOT_VERSION < PAL_1_1
HUNGUP_AND_CRASH("../z_play.c", 2269);
#elif OOT_VERSION < GC_JP
HUNGUP_AND_CRASH("../z_play.c", 2272);
#elif OOT_VERSION < GC_EU_MQ_DBG
HUNGUP_AND_CRASH("../z_play.c", 2287);
#elif OOT_VERSION < GC_JP_CE

View file

@ -45,6 +45,15 @@ s32 Object_SpawnPersistent(ObjectContext* objectCtx, s16 objectId) {
return objectCtx->numEntries - 1;
}
// PAL N64 versions reduce the size of object space by 4 KiB in order to give some space back to
// the Zelda arena, which can help prevent an issue where actors fail to spawn in specific areas
// (sometimes referred to as the "Hyrule Field Glitch" although it can happen in more places than Hyrule Field).
#if !OOT_PAL_N64
#define OBJECT_SPACE_ADJUSTMENT 0
#else
#define OBJECT_SPACE_ADJUSTMENT (4 * 1024)
#endif
void Object_InitContext(PlayState* play, ObjectContext* objectCtx) {
PlayState* play2 = play;
s32 pad;
@ -52,21 +61,21 @@ void Object_InitContext(PlayState* play, ObjectContext* objectCtx) {
s32 i;
if (play2->sceneId == SCENE_HYRULE_FIELD) {
spaceSize = 1000 * 1024;
spaceSize = 1000 * 1024 - OBJECT_SPACE_ADJUSTMENT;
} else if (play2->sceneId == SCENE_GANON_BOSS) {
if (gSaveContext.sceneLayer != 4) {
spaceSize = 1150 * 1024;
spaceSize = 1150 * 1024 - OBJECT_SPACE_ADJUSTMENT;
} else {
spaceSize = 1000 * 1024;
spaceSize = 1000 * 1024 - OBJECT_SPACE_ADJUSTMENT;
}
} else if (play2->sceneId == SCENE_SPIRIT_TEMPLE_BOSS) {
spaceSize = 1050 * 1024;
spaceSize = 1050 * 1024 - OBJECT_SPACE_ADJUSTMENT;
} else if (play2->sceneId == SCENE_CHAMBER_OF_THE_SAGES) {
spaceSize = 1050 * 1024;
spaceSize = 1050 * 1024 - OBJECT_SPACE_ADJUSTMENT;
} else if (play2->sceneId == SCENE_GANONDORF_BOSS) {
spaceSize = 1050 * 1024;
spaceSize = 1050 * 1024 - OBJECT_SPACE_ADJUSTMENT;
} else {
spaceSize = 1000 * 1024;
spaceSize = 1000 * 1024 - OBJECT_SPACE_ADJUSTMENT;
}
objectCtx->numEntries = objectCtx->numPersistentEntries = 0;