mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-05 07:24:34 +00:00
Update Room Documentation (#2015)
* Update Room Documentation * Write more complete documentation, implement suggestions. * Function name changes; minor comment tweaks * nit * Resolve Dragorn fixes * Resolve Fig suggestions, fix comment wording * fix bss, fig suggestion * bss
This commit is contained in:
parent
dbb059c6a7
commit
acb5c7f20c
27 changed files with 243 additions and 195 deletions
|
@ -42,8 +42,8 @@
|
|||
*/
|
||||
#if PLATFORM_GC
|
||||
|
||||
#pragma increment_block_number "gc-eu:240 gc-eu-mq:240 gc-eu-mq-dbg:224 gc-jp:240 gc-jp-ce:240 gc-jp-mq:240 gc-us:240" \
|
||||
"gc-us-mq:240"
|
||||
#pragma increment_block_number "gc-eu:224 gc-eu-mq:224 gc-eu-mq-dbg:224 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224" \
|
||||
"gc-us-mq:224"
|
||||
|
||||
#include "global.h"
|
||||
#include "alloca.h"
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "global.h"
|
||||
#include "fault.h"
|
||||
#include "terminal.h"
|
||||
#pragma increment_block_number "gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
|
||||
|
||||
#if PLATFORM_GC
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ s32 gScreenWidth = SCREEN_WIDTH;
|
|||
s32 gScreenHeight = SCREEN_HEIGHT;
|
||||
u32 gSystemHeapSize = 0;
|
||||
|
||||
#pragma increment_block_number "gc-eu:224 gc-eu-mq:224 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224"
|
||||
#pragma increment_block_number "gc-eu:208 gc-eu-mq:208 gc-jp:208 gc-jp-ce:208 gc-jp-mq:208 gc-us:208 gc-us-mq:208"
|
||||
|
||||
PreNmiBuff* gAppNmiBufferPtr;
|
||||
Scheduler gScheduler;
|
||||
|
|
|
@ -1972,7 +1972,7 @@ void func_8002F994(Actor* actor, s32 timer) {
|
|||
// Tests if something hit Jabu Jabu surface, displaying hit splash and playing sfx if true
|
||||
s32 func_8002F9EC(PlayState* play, Actor* actor, CollisionPoly* poly, s32 bgId, Vec3f* pos) {
|
||||
if (SurfaceType_GetFloorType(&play->colCtx, poly, bgId) == FLOOR_TYPE_8) {
|
||||
play->roomCtx.unk_74[0] = 1;
|
||||
play->roomCtx.drawParams[0] = 1;
|
||||
CollisionCheck_BlueBlood(play, NULL, pos);
|
||||
Actor_PlaySfx(actor, NA_SE_IT_WALL_HIT_BUYO);
|
||||
return true;
|
||||
|
@ -3079,8 +3079,8 @@ void Actor_SpawnTransitionActors(PlayState* play, ActorContext* actorCtx) {
|
|||
u8 numActors;
|
||||
s32 i;
|
||||
|
||||
transitionActor = play->transiActorCtx.list;
|
||||
numActors = play->transiActorCtx.numActors;
|
||||
transitionActor = play->transitionActors.list;
|
||||
numActors = play->transitionActors.count;
|
||||
|
||||
for (i = 0; i < numActors; i++) {
|
||||
if (transitionActor->id >= 0) {
|
||||
|
@ -3095,7 +3095,7 @@ void Actor_SpawnTransitionActors(PlayState* play, ActorContext* actorCtx) {
|
|||
(i << TRANSITION_ACTOR_PARAMS_INDEX_SHIFT) + transitionActor->params);
|
||||
|
||||
transitionActor->id = -transitionActor->id;
|
||||
numActors = play->transiActorCtx.numActors;
|
||||
numActors = play->transitionActors.count;
|
||||
}
|
||||
}
|
||||
transitionActor++;
|
||||
|
|
|
@ -310,8 +310,8 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) {
|
|||
break;
|
||||
|
||||
case CS_MISC_FADE_KOKIRI_GRASS_ENV_ALPHA:
|
||||
if (play->roomCtx.unk_74[0] <= 127) {
|
||||
play->roomCtx.unk_74[0] += 4;
|
||||
if (play->roomCtx.drawParams[0] <= 127) {
|
||||
play->roomCtx.drawParams[0] += 4;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -324,14 +324,14 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) {
|
|||
break;
|
||||
|
||||
case CS_MISC_DEKU_TREE_DEATH:
|
||||
if (play->roomCtx.unk_74[0] < 1650) {
|
||||
play->roomCtx.unk_74[0] += 20;
|
||||
if (play->roomCtx.drawParams[0] < 1650) {
|
||||
play->roomCtx.drawParams[0] += 20;
|
||||
}
|
||||
|
||||
if (csCtx->curFrame == 783) {
|
||||
Sfx_PlaySfxCentered(NA_SE_EV_DEKU_DEATH);
|
||||
} else if (csCtx->curFrame == 717) {
|
||||
play->roomCtx.unk_74[0] = 0;
|
||||
play->roomCtx.drawParams[0] = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -344,12 +344,12 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) {
|
|||
break;
|
||||
|
||||
case CS_MISC_TRIFORCE_FLASH:
|
||||
if (play->roomCtx.unk_74[1] == 0) {
|
||||
if (play->roomCtx.drawParams[1] == 0) {
|
||||
Sfx_PlaySfxCentered(NA_SE_EV_TRIFORCE_FLASH);
|
||||
}
|
||||
|
||||
if (play->roomCtx.unk_74[1] < 255) {
|
||||
play->roomCtx.unk_74[1] += 5;
|
||||
if (play->roomCtx.drawParams[1] < 255) {
|
||||
play->roomCtx.drawParams[1] += 5;
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -441,8 +441,8 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused)
|
|||
sLightningBolts[i].state = LIGHTNING_BOLT_INACTIVE;
|
||||
}
|
||||
|
||||
play->roomCtx.unk_74[0] = 0;
|
||||
play->roomCtx.unk_74[1] = 0;
|
||||
play->roomCtx.drawParams[0] = 0;
|
||||
play->roomCtx.drawParams[1] = 0;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(play->csCtx.actorCues); i++) {
|
||||
play->csCtx.actorCues[i] = NULL;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "n64dd.h"
|
||||
#endif
|
||||
|
||||
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
|
||||
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
|
||||
|
||||
#if PLATFORM_N64
|
||||
#define OCARINA_BUTTON_A_PRIM_R 80
|
||||
|
|
|
@ -468,7 +468,8 @@ void Play_Init(GameState* thisx) {
|
|||
|
||||
Actor_InitContext(this, &this->actorCtx, this->playerEntry);
|
||||
|
||||
while (!func_800973FC(this, &this->roomCtx)) {
|
||||
// Busyloop until the room loads
|
||||
while (!Room_ProcessRoomRequest(this, &this->roomCtx)) {
|
||||
; // Empty Loop
|
||||
}
|
||||
|
||||
|
@ -950,7 +951,7 @@ void Play_Update(PlayState* this) {
|
|||
}
|
||||
} else {
|
||||
PLAY_LOG(3606);
|
||||
func_800973FC(this, &this->roomCtx);
|
||||
Room_ProcessRoomRequest(this, &this->roomCtx);
|
||||
|
||||
PLAY_LOG(3612);
|
||||
CollisionCheck_AT(this, &this->colChkCtx);
|
||||
|
@ -1524,8 +1525,8 @@ void Play_InitScene(PlayState* this, s32 spawn) {
|
|||
|
||||
Object_InitContext(this, &this->objectCtx);
|
||||
LightContext_Init(this, &this->lightCtx);
|
||||
TransitionActor_InitContext(&this->state, &this->transiActorCtx);
|
||||
func_80096FD4(this, &this->roomCtx.curRoom);
|
||||
Scene_ResetTransitionActorList(&this->state, &this->transitionActors);
|
||||
Room_Init(this, &this->roomCtx.curRoom);
|
||||
R_SCENE_CAM_TYPE = SCENE_CAM_TYPE_DEFAULT;
|
||||
gSaveContext.worldMapArea = WORLD_MAP_AREA_HYRULE_FIELD;
|
||||
Scene_ExecuteCommands(this, this->sceneSegment);
|
||||
|
@ -1579,7 +1580,7 @@ void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn) {
|
|||
}
|
||||
#endif
|
||||
|
||||
size = func_80096FE8(this, &this->roomCtx);
|
||||
size = Room_SetupFirstRoom(this, &this->roomCtx);
|
||||
|
||||
PRINTF("ROOM SIZE=%fK\n", size / 1024.0f);
|
||||
}
|
||||
|
@ -1913,7 +1914,7 @@ s32 func_800C0D34(PlayState* this, Actor* actor, s16* yaw) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
transitionActor = &this->transiActorCtx.list[GET_TRANSITION_ACTOR_INDEX(actor)];
|
||||
transitionActor = &this->transitionActors.list[GET_TRANSITION_ACTOR_INDEX(actor)];
|
||||
frontRoom = transitionActor->sides[0].room;
|
||||
|
||||
if (frontRoom == transitionActor->sides[1].room) {
|
||||
|
|
|
@ -536,13 +536,18 @@ void Room_DrawImage(PlayState* play, Room* room, u32 flags) {
|
|||
}
|
||||
}
|
||||
|
||||
void func_80096FD4(PlayState* play, Room* room) {
|
||||
void Room_Init(PlayState* play, Room* room) {
|
||||
room->num = -1;
|
||||
room->segment = NULL;
|
||||
}
|
||||
|
||||
u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) {
|
||||
u32 maxRoomSize = 0;
|
||||
/**
|
||||
* Allocates memory for rooms and fetches the first room that the player will spawn into.
|
||||
*
|
||||
* @return u32 size of the buffer reserved for room data
|
||||
*/
|
||||
u32 Room_SetupFirstRoom(PlayState* play, RoomContext* roomCtx) {
|
||||
u32 roomBufferSize = 0;
|
||||
u32 roomSize;
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
@ -553,25 +558,27 @@ u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) {
|
|||
u32 cumulRoomSize;
|
||||
s32 pad;
|
||||
|
||||
// Set roomBufferSize to the largest room
|
||||
{
|
||||
RomFile* roomList = play->roomList;
|
||||
RomFile* roomList = play->roomList.romFiles;
|
||||
|
||||
for (i = 0; i < play->numRooms; i++) {
|
||||
for (i = 0; i < play->roomList.count; i++) {
|
||||
roomSize = roomList[i].vromEnd - roomList[i].vromStart;
|
||||
PRINTF("ROOM%d size=%d\n", i, roomSize);
|
||||
if (maxRoomSize < roomSize) {
|
||||
maxRoomSize = roomSize;
|
||||
if (roomBufferSize < roomSize) {
|
||||
roomBufferSize = roomSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((u32)play->transiActorCtx.numActors != 0) {
|
||||
RomFile* roomList = play->roomList;
|
||||
TransitionActorEntry* transitionActor = &play->transiActorCtx.list[0];
|
||||
// If there any rooms are connected, find their combined size and update roomBufferSize if larger
|
||||
if ((u32)play->transitionActors.count != 0) {
|
||||
RomFile* roomList = play->roomList.romFiles;
|
||||
TransitionActorEntry* transitionActor = &play->transitionActors.list[0];
|
||||
|
||||
LOG_NUM("game_play->room_rom_address.num", play->numRooms, "../z_room.c", 912);
|
||||
LOG_NUM("game_play->room_rom_address.num", play->roomList.count, "../z_room.c", 912);
|
||||
|
||||
for (j = 0; j < play->transiActorCtx.numActors; j++) {
|
||||
for (j = 0; j < play->transitionActors.count; j++) {
|
||||
frontRoom = transitionActor->sides[0].room;
|
||||
backRoom = transitionActor->sides[1].room;
|
||||
frontRoomSize = (frontRoom < 0) ? 0 : roomList[frontRoom].vromEnd - roomList[frontRoom].vromStart;
|
||||
|
@ -580,32 +587,52 @@ u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) {
|
|||
|
||||
PRINTF("DOOR%d=<%d> ROOM1=<%d, %d> ROOM2=<%d, %d>\n", j, cumulRoomSize, frontRoom, frontRoomSize, backRoom,
|
||||
backRoomSize);
|
||||
if (maxRoomSize < cumulRoomSize) {
|
||||
maxRoomSize = cumulRoomSize;
|
||||
if (roomBufferSize < cumulRoomSize) {
|
||||
roomBufferSize = cumulRoomSize;
|
||||
}
|
||||
transitionActor++;
|
||||
}
|
||||
}
|
||||
|
||||
PRINTF(VT_FGCOL(YELLOW));
|
||||
PRINTF(T("部屋バッファサイズ=%08x(%5.1fK)\n", "Room buffer size=%08x(%5.1fK)\n"), maxRoomSize,
|
||||
maxRoomSize / 1024.0f);
|
||||
roomCtx->bufPtrs[0] = GAME_STATE_ALLOC(&play->state, maxRoomSize, "../z_room.c", 946);
|
||||
PRINTF(T("部屋バッファサイズ=%08x(%5.1fK)\n", "Room buffer size=%08x(%5.1fK)\n"), roomBufferSize,
|
||||
roomBufferSize / 1024.0f);
|
||||
roomCtx->bufPtrs[0] = GAME_STATE_ALLOC(&play->state, roomBufferSize, "../z_room.c", 946);
|
||||
PRINTF(T("部屋バッファ開始ポインタ=%08x\n", "Room buffer initial pointer=%08x\n"), roomCtx->bufPtrs[0]);
|
||||
roomCtx->bufPtrs[1] = (void*)((uintptr_t)roomCtx->bufPtrs[0] + maxRoomSize);
|
||||
roomCtx->bufPtrs[1] = (void*)((uintptr_t)roomCtx->bufPtrs[0] + roomBufferSize);
|
||||
PRINTF(T("部屋バッファ終了ポインタ=%08x\n", "Room buffer end pointer=%08x\n"), roomCtx->bufPtrs[1]);
|
||||
PRINTF(VT_RST);
|
||||
roomCtx->unk_30 = 0;
|
||||
roomCtx->activeBufPage = 0;
|
||||
roomCtx->status = 0;
|
||||
|
||||
frontRoom = gSaveContext.respawnFlag > 0 ? ((void)0, gSaveContext.respawn[gSaveContext.respawnFlag - 1].roomIndex)
|
||||
: play->spawnList[play->spawn].room;
|
||||
func_8009728C(play, roomCtx, frontRoom);
|
||||
|
||||
return maxRoomSize;
|
||||
// Load into a room for the first time.
|
||||
// Since curRoom was initialized to `room = -1` and `segment = NULL` in Play_InitScene, the previous room
|
||||
// will also be initialized to the nulled state when this function completes.
|
||||
Room_RequestNewRoom(play, roomCtx, frontRoom);
|
||||
|
||||
return roomBufferSize;
|
||||
}
|
||||
|
||||
s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum) {
|
||||
/**
|
||||
* Tries to create an asynchronous request to transfer room data into memory.
|
||||
* If successful, the requested room will be loaded into memory and becomes the new current room; the room that was
|
||||
* current before becomes the previous room.
|
||||
*
|
||||
* Room_RequestNewRoom will be blocked from loading new rooms until Room_ProcessRoomRequest completes room
|
||||
* initialization.
|
||||
*
|
||||
* Calling Room_RequestNewRoom outside of Room_SetupFirstRoom will allow for two rooms being initialized simultaneously.
|
||||
* This allows an actor like ACTOR_EN_HOLL to seamlessly swap the two rooms as the player moves between them. Calling
|
||||
* Room_FinishRoomChange afterward will finalize the room swap.
|
||||
*
|
||||
* @param roomNum is the id of the room to load. roomNum must NOT be the same id as curRoom.num, since this will create
|
||||
* duplicate actor instances that cannot be cleaned up by calling Room_FinishRoomChange
|
||||
* @returns bool false if the request could not be created.
|
||||
*/
|
||||
s32 Room_RequestNewRoom(PlayState* play, RoomContext* roomCtx, s32 roomNum) {
|
||||
if (roomCtx->status == 0) {
|
||||
u32 size;
|
||||
|
||||
|
@ -614,11 +641,11 @@ s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum) {
|
|||
roomCtx->curRoom.segment = NULL;
|
||||
roomCtx->status = 1;
|
||||
|
||||
ASSERT(roomNum < play->numRooms, "read_room_ID < game_play->room_rom_address.num", "../z_room.c", 1009);
|
||||
ASSERT(roomNum < play->roomList.count, "read_room_ID < game_play->room_rom_address.num", "../z_room.c", 1009);
|
||||
|
||||
size = play->roomList[roomNum].vromEnd - play->roomList[roomNum].vromStart;
|
||||
roomCtx->unk_34 =
|
||||
(void*)ALIGN16((uintptr_t)roomCtx->bufPtrs[roomCtx->unk_30] - ((size + 8) * roomCtx->unk_30 + 7));
|
||||
size = play->roomList.romFiles[roomNum].vromEnd - play->roomList.romFiles[roomNum].vromStart;
|
||||
roomCtx->roomRequestAddr = (void*)ALIGN16((uintptr_t)roomCtx->bufPtrs[roomCtx->activeBufPage] -
|
||||
((size + 8) * roomCtx->activeBufPage + 7));
|
||||
|
||||
osCreateMesgQueue(&roomCtx->loadQueue, &roomCtx->loadMsg, 1);
|
||||
|
||||
|
@ -626,37 +653,44 @@ s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum) {
|
|||
if ((B_80121220 != NULL) && (B_80121220->unk_08 != NULL)) {
|
||||
B_80121220->unk_08(play, roomCtx, roomNum);
|
||||
} else {
|
||||
DMA_REQUEST_ASYNC(&roomCtx->dmaRequest, roomCtx->unk_34, play->roomList[roomNum].vromStart, size, 0,
|
||||
&roomCtx->loadQueue, NULL, "../z_room.c", 1036);
|
||||
DMA_REQUEST_ASYNC(&roomCtx->dmaRequest, roomCtx->roomRequestAddr,
|
||||
play->roomList.romFiles[roomNum].vromStart, size, 0, &roomCtx->loadQueue, NULL,
|
||||
"../z_room.c", 1036);
|
||||
}
|
||||
#else
|
||||
DMA_REQUEST_ASYNC(&roomCtx->dmaRequest, roomCtx->unk_34, play->roomList[roomNum].vromStart, size, 0,
|
||||
&roomCtx->loadQueue, NULL, "../z_room.c", 1036);
|
||||
DMA_REQUEST_ASYNC(&roomCtx->dmaRequest, roomCtx->roomRequestAddr, play->roomList.romFiles[roomNum].vromStart,
|
||||
size, 0, &roomCtx->loadQueue, NULL, "../z_room.c", 1036);
|
||||
#endif
|
||||
|
||||
roomCtx->unk_30 ^= 1;
|
||||
roomCtx->activeBufPage ^= 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
s32 func_800973FC(PlayState* play, RoomContext* roomCtx) {
|
||||
/**
|
||||
* Completes room initialization for the room requested by a call to Room_RequestNewRoom.
|
||||
* This function does not block the thread if the room data is still being transferred.
|
||||
*
|
||||
* @returns bool false if a dma transfer is in progress.
|
||||
*/
|
||||
s32 Room_ProcessRoomRequest(PlayState* play, RoomContext* roomCtx) {
|
||||
if (roomCtx->status == 1) {
|
||||
if (osRecvMesg(&roomCtx->loadQueue, NULL, OS_MESG_NOBLOCK) == 0) {
|
||||
roomCtx->status = 0;
|
||||
roomCtx->curRoom.segment = roomCtx->unk_34;
|
||||
gSegments[3] = VIRTUAL_TO_PHYSICAL(roomCtx->unk_34);
|
||||
roomCtx->curRoom.segment = roomCtx->roomRequestAddr;
|
||||
gSegments[3] = VIRTUAL_TO_PHYSICAL(roomCtx->curRoom.segment);
|
||||
|
||||
Scene_ExecuteCommands(play, roomCtx->curRoom.segment);
|
||||
Player_SetBootData(play, GET_PLAYER(play));
|
||||
Actor_SpawnTransitionActors(play, &play->actorCtx);
|
||||
} else {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Room_Draw(PlayState* play, Room* room, u32 flags) {
|
||||
|
@ -668,9 +702,17 @@ void Room_Draw(PlayState* play, Room* room, u32 flags) {
|
|||
}
|
||||
}
|
||||
|
||||
void func_80097534(PlayState* play, RoomContext* roomCtx) {
|
||||
/**
|
||||
* Finalizes a swap between two rooms.
|
||||
*
|
||||
* When a new room is created with Room_RequestNewRoom, the previous room and its actors remain in memory. This allows
|
||||
* an actor like ACTOR_EN_HOLL to seamlessly swap the two rooms as the player moves between them.
|
||||
*/
|
||||
void Room_FinishRoomChange(PlayState* play, RoomContext* roomCtx) {
|
||||
// Delete the previous room
|
||||
roomCtx->prevRoom.num = -1;
|
||||
roomCtx->prevRoom.segment = NULL;
|
||||
|
||||
func_80031B14(play, &play->actorCtx);
|
||||
Actor_SpawnTransitionActors(play, &play->actorCtx);
|
||||
Map_InitRoomData(play, roomCtx->curRoom.num);
|
||||
|
|
|
@ -230,8 +230,8 @@ BAD_RETURN(s32) Scene_CommandCollisionHeader(PlayState* play, SceneCmd* cmd) {
|
|||
}
|
||||
|
||||
BAD_RETURN(s32) Scene_CommandRoomList(PlayState* play, SceneCmd* cmd) {
|
||||
play->numRooms = cmd->roomList.length;
|
||||
play->roomList = SEGMENTED_TO_VIRTUAL(cmd->roomList.data);
|
||||
play->roomList.count = cmd->roomList.length;
|
||||
play->roomList.romFiles = SEGMENTED_TO_VIRTUAL(cmd->roomList.data);
|
||||
}
|
||||
|
||||
BAD_RETURN(s32) Scene_CommandSpawnList(PlayState* play, SceneCmd* cmd) {
|
||||
|
@ -327,12 +327,12 @@ BAD_RETURN(s32) Scene_CommandPathList(PlayState* play, SceneCmd* cmd) {
|
|||
}
|
||||
|
||||
BAD_RETURN(s32) Scene_CommandTransitionActorEntryList(PlayState* play, SceneCmd* cmd) {
|
||||
play->transiActorCtx.numActors = cmd->transiActorList.length;
|
||||
play->transiActorCtx.list = SEGMENTED_TO_VIRTUAL(cmd->transiActorList.data);
|
||||
play->transitionActors.count = cmd->transiActorList.length;
|
||||
play->transitionActors.list = SEGMENTED_TO_VIRTUAL(cmd->transiActorList.data);
|
||||
}
|
||||
|
||||
void TransitionActor_InitContext(GameState* state, TransitionActorContext* transiActorCtx) {
|
||||
transiActorCtx->numActors = 0;
|
||||
void Scene_ResetTransitionActorList(GameState* state, TransitionActorList* transitionActors) {
|
||||
transitionActors->count = 0;
|
||||
}
|
||||
|
||||
BAD_RETURN(s32) Scene_CommandLightSettingsList(PlayState* play, SceneCmd* cmd) {
|
||||
|
|
|
@ -289,12 +289,12 @@ void Scene_DrawConfigDodongosCavern(PlayState* play) {
|
|||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0B, displayListHead);
|
||||
gDPPipeSync(displayListHead++);
|
||||
gDPSetEnvColor(displayListHead++, 255, 255, 255, play->roomCtx.unk_74[BGDODOAGO_EYE_LEFT]);
|
||||
gDPSetEnvColor(displayListHead++, 255, 255, 255, play->roomCtx.drawParams[BGDODOAGO_EYE_LEFT]);
|
||||
gSPEndDisplayList(displayListHead++);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0C, displayListHead);
|
||||
gDPPipeSync(displayListHead++);
|
||||
gDPSetEnvColor(displayListHead++, 255, 255, 255, play->roomCtx.unk_74[BGDODOAGO_EYE_RIGHT]);
|
||||
gDPSetEnvColor(displayListHead++, 255, 255, 255, play->roomCtx.drawParams[BGDODOAGO_EYE_RIGHT]);
|
||||
gSPEndDisplayList(displayListHead++);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_scene_table.c", 4956);
|
||||
|
@ -306,7 +306,7 @@ void Scene_DrawConfigTempleOfTime(PlayState* play) {
|
|||
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 5069);
|
||||
|
||||
temp = play->roomCtx.unk_74[0] / 255.0f;
|
||||
temp = play->roomCtx.drawParams[0] / 255.0f;
|
||||
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, displayListHead);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, displayListHead);
|
||||
|
@ -323,7 +323,7 @@ void Scene_DrawConfigTempleOfTime(PlayState* play) {
|
|||
gSPSegment(POLY_OPA_DISP++, 0x0A, displayListHead);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x0A, displayListHead);
|
||||
gDPPipeSync(displayListHead++);
|
||||
gDPSetEnvColor(displayListHead++, 0, 0, 0, play->roomCtx.unk_74[0]);
|
||||
gDPSetEnvColor(displayListHead++, 0, 0, 0, play->roomCtx.drawParams[0]);
|
||||
gSPEndDisplayList(displayListHead++);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0B, displayListHead);
|
||||
|
@ -331,7 +331,7 @@ void Scene_DrawConfigTempleOfTime(PlayState* play) {
|
|||
gDPSetPrimColor(displayListHead++, 0, 0, 89 + (u8)(166.0f * temp), 89 + (u8)(166.0f * temp),
|
||||
89 + (u8)(166.0f * temp), 255);
|
||||
gDPPipeSync(displayListHead++);
|
||||
gDPSetEnvColor(displayListHead++, 0, 0, 0, play->roomCtx.unk_74[0]);
|
||||
gDPSetEnvColor(displayListHead++, 0, 0, 0, play->roomCtx.drawParams[0]);
|
||||
gSPEndDisplayList(displayListHead++);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0C, displayListHead);
|
||||
|
@ -339,13 +339,13 @@ void Scene_DrawConfigTempleOfTime(PlayState* play) {
|
|||
gDPSetPrimColor(displayListHead++, 0, 0, 255 + (u8)(179.0f * temp), 255 + (u8)(179.0f * temp),
|
||||
255 + (u8)(179.0f * temp), 255);
|
||||
gDPPipeSync(displayListHead++);
|
||||
gDPSetEnvColor(displayListHead++, 0, 0, 0, play->roomCtx.unk_74[0]);
|
||||
gDPSetEnvColor(displayListHead++, 0, 0, 0, play->roomCtx.drawParams[0]);
|
||||
gSPEndDisplayList(displayListHead++);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0D, displayListHead);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x0D, displayListHead);
|
||||
gDPPipeSync(displayListHead++);
|
||||
gDPSetEnvColor(displayListHead++, 0, 0, 0, play->roomCtx.unk_74[1]);
|
||||
gDPSetEnvColor(displayListHead++, 0, 0, 0, play->roomCtx.drawParams[1]);
|
||||
gSPEndDisplayList(displayListHead);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_scene_table.c", 5145);
|
||||
|
@ -539,8 +539,8 @@ void Scene_DrawConfigWaterTemple(PlayState* play) {
|
|||
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 5535);
|
||||
|
||||
spB0 = (play->roomCtx.unk_74[1] >> 8) & 0xFF;
|
||||
spAC = play->roomCtx.unk_74[1] & 0xFF;
|
||||
spB0 = (play->roomCtx.drawParams[1] >> 8) & 0xFF;
|
||||
spAC = play->roomCtx.drawParams[1] & 0xFF;
|
||||
gameplayFrames = play->gameplayFrames;
|
||||
|
||||
#if !OOT_MQ
|
||||
|
@ -613,7 +613,7 @@ void Scene_DrawConfigWaterTempleBoss(PlayState* play) {
|
|||
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, gameplayFrames * 1, 0, 32, 32, 1, 0, 0, 32, 32));
|
||||
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, play->roomCtx.unk_74[0]);
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, play->roomCtx.drawParams[0]);
|
||||
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 128, 128, 128, 145);
|
||||
|
@ -913,7 +913,7 @@ void Scene_DrawConfigFishingPond(PlayState* play) {
|
|||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScrollPrimColor(play->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128,
|
||||
32, 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, 255, 255,
|
||||
255, play->roomCtx.unk_74[0] + 127));
|
||||
255, play->roomCtx.drawParams[0] + 127));
|
||||
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128);
|
||||
|
@ -1093,16 +1093,16 @@ void Scene_DrawConfigHyruleField(PlayState* play) {
|
|||
gSPEndDisplayList(displayListHead++);
|
||||
} else {
|
||||
if (gSaveContext.save.dayTime > CLOCK_TIME(18, 30)) {
|
||||
if (play->roomCtx.unk_74[0] != 255) {
|
||||
Math_StepToS(&play->roomCtx.unk_74[0], 255, 5);
|
||||
if (play->roomCtx.drawParams[0] != 255) {
|
||||
Math_StepToS(&play->roomCtx.drawParams[0], 255, 5);
|
||||
}
|
||||
} else if (gSaveContext.save.dayTime >= CLOCK_TIME(6, 0)) {
|
||||
if (play->roomCtx.unk_74[0] != 0) {
|
||||
Math_StepToS(&play->roomCtx.unk_74[0], 0, 10);
|
||||
if (play->roomCtx.drawParams[0] != 0) {
|
||||
Math_StepToS(&play->roomCtx.drawParams[0], 0, 10);
|
||||
}
|
||||
}
|
||||
|
||||
gDPSetPrimColor(displayListHead++, 0, 0, 255, 255, 255, play->roomCtx.unk_74[0]);
|
||||
gDPSetPrimColor(displayListHead++, 0, 0, 255, 255, 255, play->roomCtx.drawParams[0]);
|
||||
gSPDisplayList(displayListHead++, spot00_room_0DL_012B20);
|
||||
gSPEndDisplayList(displayListHead++);
|
||||
}
|
||||
|
@ -1187,9 +1187,9 @@ void Scene_DrawConfigKokiriForest(PlayState* play) {
|
|||
gDPSetEnvColor(POLY_XLU_DISP++, 128, 128, 128, 128);
|
||||
|
||||
if (gSaveContext.sceneLayer == 4) {
|
||||
spA3 = 255 - (u8)play->roomCtx.unk_74[0];
|
||||
spA3 = 255 - (u8)play->roomCtx.drawParams[0];
|
||||
} else if (gSaveContext.sceneLayer == 6) {
|
||||
spA0 = play->roomCtx.unk_74[0] + 500;
|
||||
spA0 = play->roomCtx.drawParams[0] + 500;
|
||||
} else if ((!IS_CUTSCENE_LAYER || LINK_IS_ADULT) && GET_EVENTCHKINF(EVENTCHKINF_07)) {
|
||||
spA0 = 2150;
|
||||
}
|
||||
|
@ -1206,8 +1206,8 @@ void Scene_DrawConfigKokiriForest(PlayState* play) {
|
|||
gSPEndDisplayList(displayListHead++);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0C,
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, (s16)(-play->roomCtx.unk_74[0] * 0.02f), 32, 16,
|
||||
1, 0, (s16)(-play->roomCtx.unk_74[0] * 0.02f), 32, 16));
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, (s16)(-play->roomCtx.drawParams[0] * 0.02f), 32,
|
||||
16, 1, 0, (s16)(-play->roomCtx.drawParams[0] * 0.02f), 32, 16));
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_scene_table.c", 7044);
|
||||
}
|
||||
|
@ -1218,16 +1218,16 @@ void Scene_DrawConfigLakeHylia(PlayState* play) {
|
|||
OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 7058);
|
||||
|
||||
if (IS_CUTSCENE_LAYER || (LINK_IS_ADULT && !GET_EVENTCHKINF(EVENTCHKINF_69))) {
|
||||
play->roomCtx.unk_74[0] = 87;
|
||||
play->roomCtx.drawParams[0] = 87;
|
||||
}
|
||||
|
||||
gameplayFrames = play->gameplayFrames;
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08,
|
||||
Gfx_TwoTexScrollEnvColor(play->state.gfxCtx, G_TX_RENDERTILE, gameplayFrames, gameplayFrames, 32, 32, 1,
|
||||
0, 0, 32, 32, 0, 0, 0, play->roomCtx.unk_74[0] + 168));
|
||||
0, 0, 32, 32, 0, 0, 0, play->roomCtx.drawParams[0] + 168));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09,
|
||||
Gfx_TwoTexScrollEnvColor(play->state.gfxCtx, G_TX_RENDERTILE, -gameplayFrames, -gameplayFrames, 32, 32,
|
||||
1, 0, 0, 16, 64, 0, 0, 0, play->roomCtx.unk_74[0] + 168));
|
||||
1, 0, 0, 16, 64, 0, 0, 0, play->roomCtx.drawParams[0] + 168));
|
||||
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, 128);
|
||||
|
@ -1341,12 +1341,12 @@ void Scene_DrawConfigLostWoods(PlayState* play) {
|
|||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128);
|
||||
|
||||
if ((play->roomCtx.unk_74[0] == 0) && (INV_CONTENT(ITEM_COJIRO) == ITEM_COJIRO)) {
|
||||
if (play->roomCtx.unk_74[1] == 50) {
|
||||
if ((play->roomCtx.drawParams[0] == 0) && (INV_CONTENT(ITEM_COJIRO) == ITEM_COJIRO)) {
|
||||
if (play->roomCtx.drawParams[1] == 50) {
|
||||
Player_PlaySfx(GET_PLAYER(play), NA_SE_EV_CHICKEN_CRY_M);
|
||||
play->roomCtx.unk_74[0] = 1;
|
||||
play->roomCtx.drawParams[0] = 1;
|
||||
}
|
||||
play->roomCtx.unk_74[1]++;
|
||||
play->roomCtx.drawParams[1]++;
|
||||
}
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_scene_table.c", 7309);
|
||||
|
@ -1441,16 +1441,16 @@ void Scene_DrawConfigDeathMountainTrail(PlayState* play) {
|
|||
gSPEndDisplayList(displayListHead++);
|
||||
} else {
|
||||
if (gSaveContext.save.dayTime > CLOCK_TIME(18, 0)) {
|
||||
if (play->roomCtx.unk_74[0] != 255) {
|
||||
Math_StepToS(&play->roomCtx.unk_74[0], 255, 5);
|
||||
if (play->roomCtx.drawParams[0] != 255) {
|
||||
Math_StepToS(&play->roomCtx.drawParams[0], 255, 5);
|
||||
}
|
||||
} else if (gSaveContext.save.dayTime >= CLOCK_TIME(6, 0)) {
|
||||
if (play->roomCtx.unk_74[0] != 0) {
|
||||
Math_StepToS(&play->roomCtx.unk_74[0], 0, 10);
|
||||
if (play->roomCtx.drawParams[0] != 0) {
|
||||
Math_StepToS(&play->roomCtx.drawParams[0], 0, 10);
|
||||
}
|
||||
}
|
||||
|
||||
gDPSetPrimColor(displayListHead++, 0, 0, 255, 255, 255, play->roomCtx.unk_74[0]);
|
||||
gDPSetPrimColor(displayListHead++, 0, 0, 255, 255, 255, play->roomCtx.drawParams[0]);
|
||||
gSPDisplayList(displayListHead++, spot16_room_0DL_00AA48);
|
||||
gSPEndDisplayList(displayListHead++);
|
||||
}
|
||||
|
@ -1604,27 +1604,27 @@ void Scene_DrawConfigJabuJabu(PlayState* play) {
|
|||
1.f + (1 * temp * Math_CosS(D_8012A39C)));
|
||||
View_SetDistortionSpeed(&play->view, 0.95f);
|
||||
|
||||
switch (play->roomCtx.unk_74[0]) {
|
||||
switch (play->roomCtx.drawParams[0]) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
if (play->roomCtx.unk_74[1] < 1200) {
|
||||
play->roomCtx.unk_74[1] += 200;
|
||||
if (play->roomCtx.drawParams[1] < 1200) {
|
||||
play->roomCtx.drawParams[1] += 200;
|
||||
} else {
|
||||
play->roomCtx.unk_74[0]++;
|
||||
play->roomCtx.drawParams[0]++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (play->roomCtx.unk_74[1] > 0) {
|
||||
play->roomCtx.unk_74[1] -= 30;
|
||||
if (play->roomCtx.drawParams[1] > 0) {
|
||||
play->roomCtx.drawParams[1] -= 30;
|
||||
} else {
|
||||
play->roomCtx.unk_74[1] = 0;
|
||||
play->roomCtx.unk_74[0] = 0;
|
||||
play->roomCtx.drawParams[1] = 0;
|
||||
play->roomCtx.drawParams[0] = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
D_8012A398 += 0.15f + (play->roomCtx.unk_74[1] * 0.001f);
|
||||
D_8012A398 += 0.15f + (play->roomCtx.drawParams[1] * 0.001f);
|
||||
}
|
||||
|
||||
if (play->roomCtx.curRoom.num == 2) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue