1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-01 15:26:01 +00:00

Retail z_quake.c and z_room.c OK (#1661)

* quake OK

* z_room OK
This commit is contained in:
engineer124 2024-01-30 13:08:35 +11:00 committed by GitHub
parent 5ba625b171
commit 6d09437c21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 27 additions and 21 deletions

View file

@ -411,10 +411,6 @@ s16 Quake_Update(Camera* camera, ShakeInfo* camShake) {
zeroVec.y = 0.0f; zeroVec.y = 0.0f;
zeroVec.z = 0.0f; zeroVec.z = 0.0f;
camShake->upPitchOffset = 0;
camShake->upYawOffset = 0;
camShake->fovOffset = 0;
camShake->atOffset.x = 0.0f; camShake->atOffset.x = 0.0f;
camShake->atOffset.y = 0.0f; camShake->atOffset.y = 0.0f;
camShake->atOffset.z = 0.0f; camShake->atOffset.z = 0.0f;
@ -423,6 +419,10 @@ s16 Quake_Update(Camera* camera, ShakeInfo* camShake) {
camShake->eyeOffset.y = 0.0f; camShake->eyeOffset.y = 0.0f;
camShake->eyeOffset.z = 0.0f; camShake->eyeOffset.z = 0.0f;
camShake->upPitchOffset = 0;
camShake->upYawOffset = 0;
camShake->fovOffset = 0;
camShake->maxOffset = 0.0f; camShake->maxOffset = 0.0f;
if (sQuakeRequestCount == 0) { if (sQuakeRequestCount == 0) {

View file

@ -385,18 +385,20 @@ void Room_DrawImageSingle(PlayState* play, Room* room, u32 flags) {
if (drawBackground) { if (drawBackground) {
gSPLoadUcodeL(POLY_OPA_DISP++, gspS2DEX2d_fifo); gSPLoadUcodeL(POLY_OPA_DISP++, gspS2DEX2d_fifo);
gfx = POLY_OPA_DISP;
{ {
Vec3f quakeOffset; Vec3f quakeOffset;
gfx = POLY_OPA_DISP;
quakeOffset = Camera_GetQuakeOffset(activeCam); quakeOffset = Camera_GetQuakeOffset(activeCam);
Room_DrawBackground2D(&gfx, roomShape->source, roomShape->tlut, roomShape->width, roomShape->height, Room_DrawBackground2D(&gfx, roomShape->source, roomShape->tlut, roomShape->width, roomShape->height,
roomShape->fmt, roomShape->siz, roomShape->tlutMode, roomShape->tlutCount, roomShape->fmt, roomShape->siz, roomShape->tlutMode, roomShape->tlutCount,
(quakeOffset.x + quakeOffset.z) * 1.2f + quakeOffset.y * 0.6f, (quakeOffset.x + quakeOffset.z) * 1.2f + quakeOffset.y * 0.6f,
quakeOffset.y * 2.4f + (quakeOffset.x + quakeOffset.z) * 0.3f); quakeOffset.y * 2.4f + (quakeOffset.x + quakeOffset.z) * 0.3f);
POLY_OPA_DISP = gfx;
} }
POLY_OPA_DISP = gfx;
gSPLoadUcode(POLY_OPA_DISP++, SysUcode_GetUCode(), SysUcode_GetUCodeData()); gSPLoadUcode(POLY_OPA_DISP++, SysUcode_GetUCode(), SysUcode_GetUCodeData());
} }
} }
@ -483,18 +485,20 @@ void Room_DrawImageMulti(PlayState* play, Room* room, u32 flags) {
if (drawBackground) { if (drawBackground) {
gSPLoadUcodeL(POLY_OPA_DISP++, gspS2DEX2d_fifo); gSPLoadUcodeL(POLY_OPA_DISP++, gspS2DEX2d_fifo);
gfx = POLY_OPA_DISP;
{ {
Vec3f quakeOffset; Vec3f quakeOffset;
gfx = POLY_OPA_DISP;
quakeOffset = Camera_GetQuakeOffset(activeCam); quakeOffset = Camera_GetQuakeOffset(activeCam);
Room_DrawBackground2D(&gfx, bgEntry->source, bgEntry->tlut, bgEntry->width, bgEntry->height, Room_DrawBackground2D(&gfx, bgEntry->source, bgEntry->tlut, bgEntry->width, bgEntry->height,
bgEntry->fmt, bgEntry->siz, bgEntry->tlutMode, bgEntry->tlutCount, bgEntry->fmt, bgEntry->siz, bgEntry->tlutMode, bgEntry->tlutCount,
(quakeOffset.x + quakeOffset.z) * 1.2f + quakeOffset.y * 0.6f, (quakeOffset.x + quakeOffset.z) * 1.2f + quakeOffset.y * 0.6f,
quakeOffset.y * 2.4f + (quakeOffset.x + quakeOffset.z) * 0.3f); quakeOffset.y * 2.4f + (quakeOffset.x + quakeOffset.z) * 0.3f);
POLY_OPA_DISP = gfx;
} }
POLY_OPA_DISP = gfx;
gSPLoadUcode(POLY_OPA_DISP++, SysUcode_GetUCode(), SysUcode_GetUCodeData()); gSPLoadUcode(POLY_OPA_DISP++, SysUcode_GetUCode(), SysUcode_GetUCodeData());
} }
} }
@ -528,7 +532,6 @@ void func_80096FD4(PlayState* play, Room* room) {
u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) { u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) {
u32 maxRoomSize = 0; u32 maxRoomSize = 0;
RomFile* roomList = play->roomList;
u32 roomSize; u32 roomSize;
s32 i; s32 i;
s32 j; s32 j;
@ -537,6 +540,10 @@ u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) {
u32 frontRoomSize; u32 frontRoomSize;
u32 backRoomSize; u32 backRoomSize;
u32 cumulRoomSize; u32 cumulRoomSize;
s32 pad;
{
RomFile* roomList = play->roomList;
for (i = 0; i < play->numRooms; i++) { for (i = 0; i < play->numRooms; i++) {
roomSize = roomList[i].vromEnd - roomList[i].vromStart; roomSize = roomList[i].vromEnd - roomList[i].vromStart;
@ -545,8 +552,9 @@ u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) {
maxRoomSize = roomSize; maxRoomSize = roomSize;
} }
} }
}
if (play->transiActorCtx.numActors != 0) { if ((u32)play->transiActorCtx.numActors != 0) {
RomFile* roomList = play->roomList; RomFile* roomList = play->roomList;
TransitionActorEntry* transitionActor = &play->transiActorCtx.list[0]; TransitionActorEntry* transitionActor = &play->transiActorCtx.list[0];
@ -589,9 +597,9 @@ u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) {
} }
s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum) { s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum) {
if (roomCtx->status == 0) {
u32 size; u32 size;
if (roomCtx->status == 0) {
roomCtx->prevRoom = roomCtx->curRoom; roomCtx->prevRoom = roomCtx->curRoom;
roomCtx->curRoom.num = roomNum; roomCtx->curRoom.num = roomNum;
roomCtx->curRoom.segment = NULL; roomCtx->curRoom.segment = NULL;
@ -624,12 +632,10 @@ s32 func_800973FC(PlayState* play, RoomContext* roomCtx) {
Scene_ExecuteCommands(play, roomCtx->curRoom.segment); Scene_ExecuteCommands(play, roomCtx->curRoom.segment);
Player_SetBootData(play, GET_PLAYER(play)); Player_SetBootData(play, GET_PLAYER(play));
Actor_SpawnTransitionActors(play, &play->actorCtx); Actor_SpawnTransitionActors(play, &play->actorCtx);
} else {
return 1;
}
return 0; return 0;
} }
}
return 1; return 1;
} }