Misc cleanup 13 (#1189)

* FaultAddrConv Functions

* Invisible Ruppe macros

* skybox

* Z64 header defines

* ActorId

* remove i from KaleidoManager_FaultAddrConv

* size_t and parens
This commit is contained in:
Derek Hensley 2023-03-07 20:44:18 -08:00 committed by GitHub
parent d7af72273d
commit c917880261
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 122 additions and 129 deletions

View File

@ -776,8 +776,8 @@ s32 Actor_IsSmallChest(struct EnBox* chest);
void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16 limbPosCount, f32 effectScale, f32 frozenSteamScale, f32 effectAlpha, u8 type); void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16 limbPosCount, f32 effectScale, f32 frozenSteamScale, f32 effectAlpha, u8 type);
void Actor_SpawnIceEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s32 limbPosCount, s32 effectsPerLimb, f32 scale, f32 scaleRange); void Actor_SpawnIceEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s32 limbPosCount, s32 effectsPerLimb, f32 scale, f32 scaleRange);
void ActorOverlayTable_FaultPrint(void* arg0, void* arg1); void ActorOverlayTable_FaultClient(void* arg0, void* arg1);
void* ActorOverlayTable_FaultAddrConv(void* arg0, void* arg1); void* ActorOverlayTable_FaultAddrConv(void* address, void* param);
void ActorOverlayTable_Init(void); void ActorOverlayTable_Init(void);
void ActorOverlayTable_Cleanup(void); void ActorOverlayTable_Cleanup(void);
@ -2242,7 +2242,7 @@ void func_80161C0C(void);
// void func_801631DC(void); // void func_801631DC(void);
// void func_80163334(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); // void func_80163334(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_80163660(void); // void func_80163660(void);
void* KaleidoManager_FaultAddrConvFunc(void* address, void* param); void* KaleidoManager_FaultAddrConv(void* address, void* param);
void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl); void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl);
void KaleidoManager_ClearOvl(KaleidoMgrOverlay* ovl); void KaleidoManager_ClearOvl(KaleidoMgrOverlay* ovl);
void KaleidoManager_Init(PlayState* play); void KaleidoManager_Init(PlayState* play);
@ -2443,7 +2443,7 @@ void Graph_FaultClient(void);
void Graph_InitTHGA(TwoHeadGfxArena* arena, Gfx* buffer, s32 size); void Graph_InitTHGA(TwoHeadGfxArena* arena, Gfx* buffer, s32 size);
void Graph_SetNextGfxPool(GraphicsContext* gfxCtx); void Graph_SetNextGfxPool(GraphicsContext* gfxCtx);
GameStateOverlay* Graph_GetNextGameState(GameState* gameState); GameStateOverlay* Graph_GetNextGameState(GameState* gameState);
void* Graph_FaultAddrConvFunc(void* address, void* param); void* Graph_FaultAddrConv(void* address, void* param);
void Graph_Init(GraphicsContext* gfxCtx); void Graph_Init(GraphicsContext* gfxCtx);
void Graph_Destroy(GraphicsContext* gfxCtx); void Graph_Destroy(GraphicsContext* gfxCtx);
void Graph_TaskSet00(GraphicsContext* gfxCtx, GameState* gameState); void Graph_TaskSet00(GraphicsContext* gfxCtx, GameState* gameState);

View File

@ -490,7 +490,7 @@ extern PlayState* actorCutscenesPlayState;
extern s16 actorCutsceneReturnCamera; extern s16 actorCutsceneReturnCamera;
extern s16 D_801BD8C6; extern s16 D_801BD8C6;
extern GameStateOverlay gGameStateOverlayTable[]; extern GameStateOverlay gGameStateOverlayTable[];
extern s32 graphNumGameStates; extern s32 gGraphNumGameStates;
// extern UNK_TYPE2 D_801BDA70; // extern UNK_TYPE2 D_801BDA70;
// extern UNK_TYPE2 D_801BDA74; // extern UNK_TYPE2 D_801BDA74;
// extern UNK_TYPE2 D_801BDA78; // extern UNK_TYPE2 D_801BDA78;
@ -2304,8 +2304,8 @@ extern f32 D_801ED8D0;
// extern UNK_TYPE1 D_801ED8DC; // extern UNK_TYPE1 D_801ED8DC;
extern Mtx D_801ED8E0; extern Mtx D_801ED8E0;
// extern UNK_TYPE1 D_801ED920; // extern UNK_TYPE1 D_801ED920;
extern FaultClient D_801ED930; extern FaultClient sActorOverlayTableFaultClient;
extern FaultAddrConvClient D_801ED940; extern FaultAddrConvClient sActorOverlayTableFaultAddrConvClient;
extern char D_801ED950[80]; extern char D_801ED950[80];
extern char D_801ED9A0[80]; extern char D_801ED9A0[80];
extern Vec3f D_801ED9F0[3]; extern Vec3f D_801ED9F0[3];
@ -2476,7 +2476,7 @@ extern s16 D_801F4E7A;
// extern UNK_TYPE1 D_801F6B58; // extern UNK_TYPE1 D_801F6B58;
extern void (*sKaleidoScopeUpdateFunc)(PlayState* play); extern void (*sKaleidoScopeUpdateFunc)(PlayState* play);
extern void (*sKaleidoScopeDrawFunc)(PlayState* play); extern void (*sKaleidoScopeDrawFunc)(PlayState* play);
extern FaultAddrConvClient sKaleidoAreaFaultClient; extern FaultAddrConvClient sKaleidoMgrFaultAddrConvClient;
extern s16 sTransitionFillTimer; extern s16 sTransitionFillTimer;
extern Input D_801F6C18; extern Input D_801F6C18;
extern TransitionTile sTransitionTile; extern TransitionTile sTransitionTile;

View File

@ -1,5 +1,5 @@
#ifndef Z64_ANIMATION_H #ifndef Z64ANIMATION_H
#define Z64_ANIMATION_H #define Z64ANIMATION_H
#include "PR/ultratypes.h" #include "PR/ultratypes.h"
#include "PR/gbi.h" #include "PR/gbi.h"

View File

@ -1,5 +1,5 @@
#ifndef Z64_AUDIO_H #ifndef Z64AUDIO_H
#define Z64_AUDIO_H #define Z64AUDIO_H
#include "audiothread_cmd.h" #include "audiothread_cmd.h"

View File

@ -1,5 +1,5 @@
#ifndef Z64_BGCHECK_H #ifndef Z64BGCHECK_H
#define Z64_BGCHECK_H #define Z64BGCHECK_H
struct PlayState; struct PlayState;
struct Actor; struct Actor;

View File

@ -1,5 +1,5 @@
#ifndef _Z_COLLISION_CHECK_H_ #ifndef Z64COLLISION_CHECK_H
#define _Z_COLLISION_CHECK_H_ #define Z64COLLISION_CHECK_H
#include "PR/ultratypes.h" #include "PR/ultratypes.h"
#include "z64math.h" #include "z64math.h"

View File

@ -1,5 +1,5 @@
#ifndef Z64_CURVE_H #ifndef Z64CURVE_H
#define Z64_CURVE_H #define Z64CURVE_H
#include "PR/ultratypes.h" #include "PR/ultratypes.h"
#include "z64math.h" #include "z64math.h"

View File

@ -1,5 +1,5 @@
#ifndef _Z64_DMA_H_ #ifndef Z64DMA_H
#define _Z64_DMA_H_ #define Z64DMA_H
#include "ultra64.h" #include "ultra64.h"

View File

@ -1,5 +1,5 @@
#ifndef _Z64EFFECT_H_ #ifndef Z64EFFECT_H
#define _Z64EFFECT_H_ #define Z64EFFECT_H
#include "PR/ultratypes.h" #include "PR/ultratypes.h"
#include "color.h" #include "color.h"

View File

@ -1,5 +1,5 @@
#ifndef Z64_JPEG_H #ifndef Z64JPEG_H
#define Z64_JPEG_H #define Z64JPEG_H
#include "PR/ultratypes.h" #include "PR/ultratypes.h"
#include "ultra64/message.h" #include "ultra64/message.h"

View File

@ -1,5 +1,5 @@
#ifndef Z64_SKIN_H #ifndef Z64SKIN_H
#define Z64_SKIN_H #define Z64SKIN_H
#include "z64animation.h" #include "z64animation.h"

View File

@ -1,8 +1,9 @@
#ifndef Z64_SKYBOX_H #ifndef Z64SKYBOX_H
#define Z64_SKYBOX_H #define Z64SKYBOX_H
#include "PR/ultratypes.h" #include "PR/ultratypes.h"
#include "PR/gbi.h" #include "PR/gbi.h"
#include "color.h"
#include "z64dma.h" #include "z64dma.h"
#include "z64math.h" #include "z64math.h"
@ -33,17 +34,11 @@ typedef struct SkyboxContext {
/* 0x1E8 */ OSMesgQueue loadQueue; /* 0x1E8 */ OSMesgQueue loadQueue;
/* 0x200 */ OSMesg loadMsg; /* 0x200 */ OSMesg loadMsg;
/* 0x204 */ s16 skyboxShouldDraw; /* 0x204 */ s16 skyboxShouldDraw;
/* 0x208 */ f32 rotX; /* 0x208 */ Vec3f rot;
/* 0x20C */ f32 rotY;
/* 0x210 */ f32 rotZ;
/* 0x214 */ Vec3f eye; /* 0x214 */ Vec3f eye;
/* 0x220 */ s16 angle; /* 0x220 */ s16 angle;
/* 0x222 */ u8 primR; /* 0x222 */ Color_RGB8 prim;
/* 0x223 */ u8 primG; /* 0x225 */ Color_RGB8 env;
/* 0x224 */ u8 primB;
/* 0x225 */ u8 envR;
/* 0x226 */ u8 envG;
/* 0x227 */ u8 envB;
} SkyboxContext; // size = 0x228 } SkyboxContext; // size = 0x228
typedef struct struct_801C5F44 { typedef struct struct_801C5F44 {

View File

@ -1,5 +1,5 @@
#ifndef Z64_SNAP_H #ifndef Z64SNAP_H
#define Z64_SNAP_H #define Z64SNAP_H
#include "PR/ultratypes.h" #include "PR/ultratypes.h"
#include "z64actor.h" #include "z64actor.h"

View File

@ -1,5 +1,5 @@
#ifndef Z_EN_HY_CODE_H #ifndef Z64ENHY_CODE_H
#define Z_EN_HY_CODE_H #define Z64ENHY_CODE_H
#include "global.h" #include "global.h"
#include "overlays/actors/ovl_En_Door/z_en_door.h" #include "overlays/actors/ovl_En_Door/z_en_door.h"

View File

@ -1,5 +1,5 @@
#ifndef Z64_PRENMI_H #ifndef Z64PRENMI_H
#define Z64_PRENMI_H #define Z64PRENMI_H
#include "global.h" #include "global.h"

View File

@ -1,5 +1,5 @@
#ifndef Z64_TITLE_SETUP_H #ifndef Z64TITLE_SETUP_H
#define Z64_TITLE_SETUP_H #define Z64TITLE_SETUP_H
#include "global.h" #include "global.h"

View File

@ -90,21 +90,21 @@ GameStateOverlay* Graph_GetNextGameState(GameState* gameState) {
return NULL; return NULL;
} }
void* Graph_FaultAddrConvFunc(void* address, void* param) { void* Graph_FaultAddrConv(void* address, void* param) {
uintptr_t addr = address; uintptr_t addr = address;
GameStateOverlay* gameStateOvl = &gGameStateOverlayTable[0]; GameStateOverlay* gameStateOvl = &gGameStateOverlayTable[0];
uintptr_t ramConv; size_t ramConv;
void* ramStart; void* ramStart;
uintptr_t diff; size_t diff;
s32 i; s32 i;
for (i = 0; i < graphNumGameStates; i++, gameStateOvl++) { for (i = 0; i < gGraphNumGameStates; i++, gameStateOvl++) {
diff = VRAM_PTR_SIZE(gameStateOvl); diff = VRAM_PTR_SIZE(gameStateOvl);
ramStart = gameStateOvl->loadedRamAddr; ramStart = gameStateOvl->loadedRamAddr;
ramConv = (uintptr_t)gameStateOvl->vramStart - (uintptr_t)ramStart; ramConv = (uintptr_t)gameStateOvl->vramStart - (uintptr_t)ramStart;
if (ramStart != NULL) { if (ramStart != NULL) {
if (addr >= (uintptr_t)ramStart && addr < (uintptr_t)ramStart + diff) { if ((addr >= (uintptr_t)ramStart) && (addr < (uintptr_t)ramStart + diff)) {
return addr + ramConv; return addr + ramConv;
} }
} }
@ -122,7 +122,7 @@ void Graph_Init(GraphicsContext* gfxCtx) {
gfxCtx->yScale = gViConfigYScale; gfxCtx->yScale = gViConfigYScale;
osCreateMesgQueue(&gfxCtx->queue, gfxCtx->msgBuff, ARRAY_COUNT(gfxCtx->msgBuff)); osCreateMesgQueue(&gfxCtx->queue, gfxCtx->msgBuff, ARRAY_COUNT(gfxCtx->msgBuff));
Fault_AddClient(&sGraphFaultClient, Graph_FaultClient, NULL, NULL); Fault_AddClient(&sGraphFaultClient, Graph_FaultClient, NULL, NULL);
Fault_AddAddrConvClient(&sGraphFaultAddrConvClient, Graph_FaultAddrConvFunc, NULL); Fault_AddAddrConvClient(&sGraphFaultAddrConvClient, Graph_FaultAddrConv, NULL);
} }
void Graph_Destroy(GraphicsContext* gfxCtx) { void Graph_Destroy(GraphicsContext* gfxCtx) {

View File

@ -38,45 +38,44 @@ ActorOverlay gActorOverlayTable[] = {
ActorId gMaxActorId = 0; ActorId gMaxActorId = 0;
FaultClient D_801ED930; FaultClient sActorOverlayTableFaultClient;
FaultAddrConvClient D_801ED940; FaultAddrConvClient sActorOverlayTableFaultAddrConvClient;
void ActorOverlayTable_FaultPrint(void* arg0, void* arg1) { void ActorOverlayTable_FaultClient(void* arg0, void* arg1) {
ActorOverlay* overlayEntry; ActorOverlay* overlayEntry;
u32 overlaySize; u32 overlaySize;
ActorId i; ActorId actorId;
FaultDrawer_SetCharPad(-2, 0); FaultDrawer_SetCharPad(-2, 0);
FaultDrawer_Printf("actor_dlftbls %u\n", gMaxActorId); FaultDrawer_Printf("actor_dlftbls %u\n", gMaxActorId);
FaultDrawer_Printf("No. RamStart- RamEnd cn Name\n"); FaultDrawer_Printf("No. RamStart- RamEnd cn Name\n");
for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxActorId; i++, overlayEntry++) { for (actorId = 0, overlayEntry = &gActorOverlayTable[0]; actorId < gMaxActorId; actorId++, overlayEntry++) {
overlaySize = VRAM_PTR_SIZE(overlayEntry); overlaySize = VRAM_PTR_SIZE(overlayEntry);
if (overlayEntry->loadedRamAddr != NULL) { if (overlayEntry->loadedRamAddr != NULL) {
FaultDrawer_Printf("%3d %08x-%08x %3d %s\n", i, overlayEntry->loadedRamAddr, FaultDrawer_Printf("%3d %08x-%08x %3d %s\n", actorId, overlayEntry->loadedRamAddr,
(u32)overlayEntry->loadedRamAddr + overlaySize, overlayEntry->numLoaded, ""); (u32)overlayEntry->loadedRamAddr + overlaySize, overlayEntry->numLoaded, "");
} }
} }
} }
void* ActorOverlayTable_FaultAddrConv(void* arg0, void* arg1) { void* ActorOverlayTable_FaultAddrConv(void* address, void* param) {
u8* ptr = arg0; uintptr_t addr = address;
ActorOverlay* overlayEntry = &gActorOverlayTable[0]; ActorOverlay* actorOvl = &gActorOverlayTable[0];
ActorId i; size_t ramConv;
u8* ramStart; void* ramStart;
u8* ramEnd; size_t diff;
size_t size; ActorId actorId;
u32 offset;
for (actorId = 0; actorId < gMaxActorId; actorId++, actorOvl++) {
diff = VRAM_PTR_SIZE(actorOvl);
ramStart = actorOvl->loadedRamAddr;
ramConv = (uintptr_t)actorOvl->vramStart - (uintptr_t)ramStart;
for (i = 0; i < gMaxActorId; i++, overlayEntry++) {
size = VRAM_PTR_SIZE(overlayEntry);
ramStart = overlayEntry->loadedRamAddr;
ramEnd = ramStart + size;
offset = (u8*)overlayEntry->vramStart - ramStart;
if (ramStart != NULL) { if (ramStart != NULL) {
if (ptr >= ramStart && ptr < ramEnd) { if ((addr >= (uintptr_t)ramStart) && (addr < (uintptr_t)ramStart + diff)) {
return ptr + offset; return addr + ramConv;
} }
} }
} }
@ -85,12 +84,12 @@ void* ActorOverlayTable_FaultAddrConv(void* arg0, void* arg1) {
void ActorOverlayTable_Init(void) { void ActorOverlayTable_Init(void) {
gMaxActorId = ACTOR_ID_MAX; gMaxActorId = ACTOR_ID_MAX;
Fault_AddClient(&D_801ED930, &ActorOverlayTable_FaultPrint, NULL, NULL); Fault_AddClient(&sActorOverlayTableFaultClient, ActorOverlayTable_FaultClient, NULL, NULL);
Fault_AddAddrConvClient(&D_801ED940, &ActorOverlayTable_FaultAddrConv, NULL); Fault_AddAddrConvClient(&sActorOverlayTableFaultAddrConvClient, ActorOverlayTable_FaultAddrConv, NULL);
} }
void ActorOverlayTable_Cleanup(void) { void ActorOverlayTable_Cleanup(void) {
Fault_RemoveClient(&D_801ED930); Fault_RemoveClient(&sActorOverlayTableFaultClient);
Fault_RemoveAddrConvClient(&D_801ED940); Fault_RemoveAddrConvClient(&sActorOverlayTableFaultAddrConvClient);
gMaxActorId = 0; gMaxActorId = 0;
} }

View File

@ -24,4 +24,4 @@ GameStateOverlay gGameStateOverlayTable[] = {
GAMESTATE_OVERLAY(daytelop, DayTelop_Init, DayTelop_Destroy, sizeof(DayTelopState)), GAMESTATE_OVERLAY(daytelop, DayTelop_Init, DayTelop_Destroy, sizeof(DayTelopState)),
}; };
s32 graphNumGameStates = ARRAY_COUNT(gGameStateOverlayTable); s32 gGraphNumGameStates = ARRAY_COUNT(gGameStateOverlayTable);

View File

@ -14,24 +14,23 @@ KaleidoMgrOverlay gKaleidoMgrOverlayTable[] = {
void* sKaleidoAreaPtr = NULL; void* sKaleidoAreaPtr = NULL;
KaleidoMgrOverlay* gKaleidoMgrCurOvl = NULL; KaleidoMgrOverlay* gKaleidoMgrCurOvl = NULL;
FaultAddrConvClient sKaleidoAreaFaultClient; FaultAddrConvClient sKaleidoMgrFaultAddrConvClient;
void* KaleidoManager_FaultAddrConvFunc(void* address, void* param) { void* KaleidoManager_FaultAddrConv(void* address, void* param) {
u8* ptr = address; uintptr_t addr = address;
KaleidoMgrOverlay* ovl = &gKaleidoMgrCurOvl[0]; KaleidoMgrOverlay* kaleidoMgrOvl = gKaleidoMgrCurOvl;
u8* ramStart; size_t ramConv;
u8* ramEnd; void* ramStart;
size_t size; size_t diff;
uintptr_t offset;
if (kaleidoMgrOvl != NULL) {
diff = VRAM_PTR_SIZE(kaleidoMgrOvl);
ramStart = kaleidoMgrOvl->loadedRamAddr;
ramConv = (uintptr_t)kaleidoMgrOvl->vramStart - (uintptr_t)ramStart;
if (ovl != NULL) {
size = VRAM_PTR_SIZE(ovl);
ramStart = ovl->loadedRamAddr;
ramEnd = ramStart + size;
offset = (u8*)ovl->vramStart - ramStart;
if (ramStart != NULL) { if (ramStart != NULL) {
if (ptr >= ramStart && ptr < ramEnd) { if ((addr >= (uintptr_t)ramStart) && (addr < (uintptr_t)ramStart + diff)) {
return ptr + offset; return addr + ramConv;
} }
} }
} }
@ -68,11 +67,11 @@ void KaleidoManager_Init(PlayState* play) {
sKaleidoAreaPtr = THA_AllocEndAlign16(&play->state.heap, largestSize); sKaleidoAreaPtr = THA_AllocEndAlign16(&play->state.heap, largestSize);
gKaleidoMgrCurOvl = NULL; gKaleidoMgrCurOvl = NULL;
Fault_AddAddrConvClient(&sKaleidoAreaFaultClient, KaleidoManager_FaultAddrConvFunc, NULL); Fault_AddAddrConvClient(&sKaleidoMgrFaultAddrConvClient, KaleidoManager_FaultAddrConv, NULL);
} }
void KaleidoManager_Destroy() { void KaleidoManager_Destroy() {
Fault_RemoveAddrConvClient(&sKaleidoAreaFaultClient); Fault_RemoveAddrConvClient(&sKaleidoMgrFaultAddrConvClient);
if (gKaleidoMgrCurOvl != NULL) { if (gKaleidoMgrCurOvl != NULL) {
KaleidoManager_ClearOvl(gKaleidoMgrCurOvl); KaleidoManager_ClearOvl(gKaleidoMgrCurOvl);

View File

@ -188,7 +188,7 @@ void Skybox_Setup(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyboxId)
size_t size; size_t size;
void* segment; void* segment;
skyboxCtx->rotZ = 0.0f; skyboxCtx->rot.z = 0.0f;
switch (skyboxId) { switch (skyboxId) {
case SKYBOX_NORMAL_SKY: case SKYBOX_NORMAL_SKY:
@ -210,17 +210,17 @@ void Skybox_Setup(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyboxId)
segment = (void*)ALIGN8((uintptr_t)segment + size); segment = (void*)ALIGN8((uintptr_t)segment + size);
DmaMgr_SendRequest0(skyboxCtx->paletteStaticSegment, SEGMENT_ROM_START(d2_fine_pal_static), size); DmaMgr_SendRequest0(skyboxCtx->paletteStaticSegment, SEGMENT_ROM_START(d2_fine_pal_static), size);
skyboxCtx->primR = 145; skyboxCtx->prim.r = 145;
skyboxCtx->primG = 120; skyboxCtx->prim.g = 120;
skyboxCtx->primB = 155; skyboxCtx->prim.b = 155;
skyboxCtx->envR = 40; skyboxCtx->env.r = 40;
skyboxCtx->envG = 0; skyboxCtx->env.g = 0;
skyboxCtx->envB = 40; skyboxCtx->env.b = 40;
// Inverted Stone Tower Temple and Inverted Stone Tower // Inverted Stone Tower Temple and Inverted Stone Tower
if ((play->sceneId == SCENE_F41) || (play->sceneId == SCENE_INISIE_R)) { if ((play->sceneId == SCENE_F41) || (play->sceneId == SCENE_INISIE_R)) {
skyboxCtx->rotZ = 3.15f; skyboxCtx->rot.z = 3.15f;
} }
break; break;
@ -289,7 +289,7 @@ void func_80143324(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
void Skybox_Init(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyboxId) { void Skybox_Init(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyboxId) {
skyboxCtx->skyboxShouldDraw = false; skyboxCtx->skyboxShouldDraw = false;
skyboxCtx->rotX = skyboxCtx->rotY = skyboxCtx->rotZ = 0.0f; skyboxCtx->rot.x = skyboxCtx->rot.y = skyboxCtx->rot.z = 0.0f;
Skybox_Setup(gameState, skyboxCtx, skyboxId); Skybox_Setup(gameState, skyboxCtx, skyboxId);

View File

@ -5,19 +5,19 @@ Mtx* sSkyboxDrawMatrix;
Mtx* Skybox_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z) { Mtx* Skybox_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z) {
Matrix_Translate(x, y, z, MTXMODE_NEW); Matrix_Translate(x, y, z, MTXMODE_NEW);
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
Matrix_RotateXFApply(skyboxCtx->rotX); Matrix_RotateXFApply(skyboxCtx->rot.x);
Matrix_RotateYF(skyboxCtx->rotY, MTXMODE_APPLY); Matrix_RotateYF(skyboxCtx->rot.y, MTXMODE_APPLY);
Matrix_RotateZF(skyboxCtx->rotZ, MTXMODE_APPLY); Matrix_RotateZF(skyboxCtx->rot.z, MTXMODE_APPLY);
return Matrix_ToMtx(sSkyboxDrawMatrix); return Matrix_ToMtx(sSkyboxDrawMatrix);
} }
void Skybox_SetColors(SkyboxContext* skyboxCtx, u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB) { void Skybox_SetColors(SkyboxContext* skyboxCtx, u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB) {
skyboxCtx->primR = primR; skyboxCtx->prim.r = primR;
skyboxCtx->primG = primG; skyboxCtx->prim.g = primG;
skyboxCtx->primB = primB; skyboxCtx->prim.b = primB;
skyboxCtx->envR = envR; skyboxCtx->env.r = envR;
skyboxCtx->envG = envG; skyboxCtx->env.g = envG;
skyboxCtx->envB = envB; skyboxCtx->env.b = envB;
} }
void Skybox_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y, f32 z) { void Skybox_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y, f32 z) {
@ -32,9 +32,9 @@ void Skybox_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId
Matrix_Translate(x, y, z, MTXMODE_NEW); Matrix_Translate(x, y, z, MTXMODE_NEW);
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
Matrix_RotateXFApply(skyboxCtx->rotX); Matrix_RotateXFApply(skyboxCtx->rot.x);
Matrix_RotateYF(skyboxCtx->rotY, MTXMODE_APPLY); Matrix_RotateYF(skyboxCtx->rot.y, MTXMODE_APPLY);
Matrix_RotateZF(skyboxCtx->rotZ, MTXMODE_APPLY); Matrix_RotateZF(skyboxCtx->rot.z, MTXMODE_APPLY);
Matrix_ToMtx(sSkyboxDrawMatrix); Matrix_ToMtx(sSkyboxDrawMatrix);
gSPMatrix(POLY_OPA_DISP++, sSkyboxDrawMatrix, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(POLY_OPA_DISP++, sSkyboxDrawMatrix, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@ -45,8 +45,8 @@ void Skybox_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId
gDPSetTextureConvert(POLY_OPA_DISP++, G_TC_FILT); gDPSetTextureConvert(POLY_OPA_DISP++, G_TC_FILT);
gDPSetCombineLERP(POLY_OPA_DISP++, TEXEL1, TEXEL0, PRIMITIVE_ALPHA, TEXEL0, TEXEL1, TEXEL0, PRIMITIVE, TEXEL0, gDPSetCombineLERP(POLY_OPA_DISP++, TEXEL1, TEXEL0, PRIMITIVE_ALPHA, TEXEL0, TEXEL1, TEXEL0, PRIMITIVE, TEXEL0,
PRIMITIVE, ENVIRONMENT, COMBINED, ENVIRONMENT, 0, 0, 0, COMBINED); PRIMITIVE, ENVIRONMENT, COMBINED, ENVIRONMENT, 0, 0, 0, COMBINED);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, skyboxCtx->primR, skyboxCtx->primG, skyboxCtx->primB, blend); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, skyboxCtx->prim.r, skyboxCtx->prim.g, skyboxCtx->prim.b, blend);
gDPSetEnvColor(POLY_OPA_DISP++, skyboxCtx->envR, skyboxCtx->envG, skyboxCtx->envB, 0); gDPSetEnvColor(POLY_OPA_DISP++, skyboxCtx->env.r, skyboxCtx->env.g, skyboxCtx->env.b, 0);
gSPDisplayList(POLY_OPA_DISP++, &skyboxCtx->dListBuf[0]); gSPDisplayList(POLY_OPA_DISP++, &skyboxCtx->dListBuf[0]);
gSPDisplayList(POLY_OPA_DISP++, &skyboxCtx->dListBuf[2]); gSPDisplayList(POLY_OPA_DISP++, &skyboxCtx->dListBuf[2]);

View File

@ -575,7 +575,7 @@ void EnFall_Fireball_Update(Actor* thisx, PlayState* play) {
EnFall* this = THIS; EnFall* this = THIS;
if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 2)) { if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 2)) {
play->skyboxCtx.rotY -= 0.05f; play->skyboxCtx.rot.y -= 0.05f;
} }
if (Cutscene_CheckActorAction(play, 450)) { if (Cutscene_CheckActorAction(play, 450)) {

View File

@ -60,7 +60,7 @@ void func_80C258A0(EnInvisibleRuppe* this, PlayState* play) {
void func_80C2590C(EnInvisibleRuppe* this, PlayState* play) { void func_80C2590C(EnInvisibleRuppe* this, PlayState* play) {
if (this->collider.base.ocFlags1 & OC1_HIT) { if (this->collider.base.ocFlags1 & OC1_HIT) {
switch (INVISIBLERUPPE_GET_3(this)) { switch (INVISIBLERUPPE_GET_3(&this->actor)) {
case 0: case 0:
play_sound(NA_SE_SY_GET_RUPY); play_sound(NA_SE_SY_GET_RUPY);
Item_DropCollectible(play, &this->actor.world.pos, 0x8000 | ITEM00_RUPEE_GREEN); Item_DropCollectible(play, &this->actor.world.pos, 0x8000 | ITEM00_RUPEE_GREEN);
@ -93,7 +93,7 @@ void EnInvisibleRuppe_Init(Actor* thisx, PlayState* play) {
s32 pad; s32 pad;
EnInvisibleRuppe* this = THIS; EnInvisibleRuppe* this = THIS;
this->unk_190 = INVISIBLERUPPE_GET_1FC(this); this->unk_190 = INVISIBLERUPPE_GET_1FC(&this->actor);
if (this->unk_190 == 0x7F) { if (this->unk_190 == 0x7F) {
this->unk_190 = -1; this->unk_190 = -1;

View File

@ -7,8 +7,8 @@ struct EnInvisibleRuppe;
typedef void (*EnInvisibleRuppeActionFunc)(struct EnInvisibleRuppe*, PlayState*); typedef void (*EnInvisibleRuppeActionFunc)(struct EnInvisibleRuppe*, PlayState*);
#define INVISIBLERUPPE_GET_3(thisx) ((thisx)->actor.params & 3) #define INVISIBLERUPPE_GET_3(thisx) ((thisx)->params & 3)
#define INVISIBLERUPPE_GET_1FC(thisx) (((thisx)->actor.params & 0x1FC) >> 2) #define INVISIBLERUPPE_GET_1FC(thisx) (((thisx)->params & 0x1FC) >> 2)
typedef struct EnInvisibleRuppe { typedef struct EnInvisibleRuppe {
/* 0x000 */ Actor actor; /* 0x000 */ Actor actor;

View File

@ -895,7 +895,7 @@
0x800BE63C:("Actor_IsSmallChest",), 0x800BE63C:("Actor_IsSmallChest",),
0x800BE680:("Actor_DrawDamageEffects",), 0x800BE680:("Actor_DrawDamageEffects",),
0x800BF7CC:("Actor_SpawnIceEffects",), 0x800BF7CC:("Actor_SpawnIceEffects",),
0x800BF9A0:("ActorOverlayTable_FaultPrint",), 0x800BF9A0:("ActorOverlayTable_FaultClient",),
0x800BFA78:("ActorOverlayTable_FaultAddrConv",), 0x800BFA78:("ActorOverlayTable_FaultAddrConv",),
0x800BFAE8:("ActorOverlayTable_Init",), 0x800BFAE8:("ActorOverlayTable_Init",),
0x800BFB40:("ActorOverlayTable_Cleanup",), 0x800BFB40:("ActorOverlayTable_Cleanup",),
@ -2925,7 +2925,7 @@
0x801631DC:("func_801631DC",), 0x801631DC:("func_801631DC",),
0x80163334:("func_80163334",), 0x80163334:("func_80163334",),
0x80163660:("func_80163660",), 0x80163660:("func_80163660",),
0x80163700:("KaleidoManager_FaultAddrConvFunc",), 0x80163700:("KaleidoManager_FaultAddrConv",),
0x80163758:("KaleidoManager_LoadOvl",), 0x80163758:("KaleidoManager_LoadOvl",),
0x801637B4:("KaleidoManager_ClearOvl",), 0x801637B4:("KaleidoManager_ClearOvl",),
0x80163804:("KaleidoManager_Init",), 0x80163804:("KaleidoManager_Init",),
@ -3148,7 +3148,7 @@
0x80173DAC:("Graph_InitTHGA",), 0x80173DAC:("Graph_InitTHGA",),
0x80173DCC:("Graph_SetNextGfxPool",), 0x80173DCC:("Graph_SetNextGfxPool",),
0x80173F98:("Graph_GetNextGameState",), 0x80173F98:("Graph_GetNextGameState",),
0x80174060:("Graph_FaultAddrConvFunc",), 0x80174060:("Graph_FaultAddrConv",),
0x801740D0:("Graph_Init",), 0x801740D0:("Graph_Init",),
0x80174174:("Graph_Destroy",), 0x80174174:("Graph_Destroy",),
0x801741A8:("Graph_TaskSet00",), 0x801741A8:("Graph_TaskSet00",),

View File

@ -3857,7 +3857,7 @@
0x801ED8E0:("D_801ED8E0","Mtx","",0x40), 0x801ED8E0:("D_801ED8E0","Mtx","",0x40),
0x801ED920:("D_801ED920","UNK_TYPE1","",0x1), 0x801ED920:("D_801ED920","UNK_TYPE1","",0x1),
0x801ED930:("D_801ED930","FaultClient","",0x10), 0x801ED930:("D_801ED930","FaultClient","",0x10),
0x801ED940:("D_801ED940","FaultAddrConvClient","",0xc), 0x801ED940:("sActorOverlayTableFaultAddrConvClient","FaultAddrConvClient","",0xC),
0x801ED950:("D_801ED950","char","[80]",0x50), 0x801ED950:("D_801ED950","char","[80]",0x50),
0x801ED9A0:("D_801ED9A0","char","[80]",0x50), 0x801ED9A0:("D_801ED9A0","char","[80]",0x50),
0x801ED9F0:("D_801ED9F0","Vec3f","[3]",0x24), 0x801ED9F0:("D_801ED9F0","Vec3f","[3]",0x24),
@ -4049,7 +4049,7 @@
0x801F6B44:("sShrinkWindowPtr","ShrinkWindow*","",0x4), 0x801F6B44:("sShrinkWindowPtr","ShrinkWindow*","",0x4),
0x801F6B50:("D_801F6B50","UNK_TYPE4","",0x4), 0x801F6B50:("D_801F6B50","UNK_TYPE4","",0x4),
0x801F6B58:("D_801F6B58","UNK_TYPE1","",0x1), 0x801F6B58:("D_801F6B58","UNK_TYPE1","",0x1),
0x801F6BF0:("sKaleidoAreaFaultClient","FaultAddrConvClient","",0xC), 0x801F6BF0:("sKaleidoMgrFaultAddrConvClient","FaultAddrConvClient","",0xC),
0x801F6C00:("sKaleidoScopeUpdateFunc","void*","",0x4), 0x801F6C00:("sKaleidoScopeUpdateFunc","void*","",0x4),
0x801F6C04:("sKaleidoScopeDrawFunc","void*","",0x4), 0x801F6C04:("sKaleidoScopeDrawFunc","void*","",0x4),
0x801F6C10:("sTransitionFillTimer","UNK_TYPE1","",0x1), 0x801F6C10:("sTransitionFillTimer","UNK_TYPE1","",0x1),

View File

@ -409,7 +409,7 @@ asm/non_matchings/code/z_actor/func_800BE5CC.s,func_800BE5CC,0x800BE5CC,0x1C
asm/non_matchings/code/z_actor/func_800BE63C.s,func_800BE63C,0x800BE63C,0x11 asm/non_matchings/code/z_actor/func_800BE63C.s,func_800BE63C,0x800BE63C,0x11
asm/non_matchings/code/z_actor/Actor_DrawDamageEffects.s,Actor_DrawDamageEffects,0x800BE680,0x453 asm/non_matchings/code/z_actor/Actor_DrawDamageEffects.s,Actor_DrawDamageEffects,0x800BE680,0x453
asm/non_matchings/code/z_actor/Actor_SpawnIceEffects.s,Actor_SpawnIceEffects,0x800BF7CC,0x75 asm/non_matchings/code/z_actor/Actor_SpawnIceEffects.s,Actor_SpawnIceEffects,0x800BF7CC,0x75
asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_FaultPrint.s,ActorOverlayTable_FaultPrint,0x800BF9A0,0x36 asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_FaultClient.s,ActorOverlayTable_FaultClient,0x800BF9A0,0x36
asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_FaultAddrConv.s,ActorOverlayTable_FaultAddrConv,0x800BFA78,0x1C asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_FaultAddrConv.s,ActorOverlayTable_FaultAddrConv,0x800BFA78,0x1C
asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_Init.s,ActorOverlayTable_Init,0x800BFAE8,0x16 asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_Init.s,ActorOverlayTable_Init,0x800BFAE8,0x16
asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_Cleanup.s,ActorOverlayTable_Cleanup,0x800BFB40,0x10 asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_Cleanup.s,ActorOverlayTable_Cleanup,0x800BFB40,0x10
@ -2662,7 +2662,7 @@ asm/non_matchings/code/graph/Graph_FaultClient.s,Graph_FaultClient,0x80173D30,0x
asm/non_matchings/code/graph/Graph_InitTHGA.s,Graph_InitTHGA,0x80173DAC,0x8 asm/non_matchings/code/graph/Graph_InitTHGA.s,Graph_InitTHGA,0x80173DAC,0x8
asm/non_matchings/code/graph/Graph_SetNextGfxPool.s,Graph_SetNextGfxPool,0x80173DCC,0x73 asm/non_matchings/code/graph/Graph_SetNextGfxPool.s,Graph_SetNextGfxPool,0x80173DCC,0x73
asm/non_matchings/code/graph/Graph_GetNextGameState.s,Graph_GetNextGameState,0x80173F98,0x32 asm/non_matchings/code/graph/Graph_GetNextGameState.s,Graph_GetNextGameState,0x80173F98,0x32
asm/non_matchings/code/graph/Graph_FaultAddrConvFunc.s,Graph_FaultAddrConvFunc,0x80174060,0x1C asm/non_matchings/code/graph/Graph_FaultAddrConv.s,Graph_FaultAddrConv,0x80174060,0x1C
asm/non_matchings/code/graph/Graph_Init.s,Graph_Init,0x801740D0,0x29 asm/non_matchings/code/graph/Graph_Init.s,Graph_Init,0x801740D0,0x29
asm/non_matchings/code/graph/Graph_Destroy.s,Graph_Destroy,0x80174174,0xD asm/non_matchings/code/graph/Graph_Destroy.s,Graph_Destroy,0x80174174,0xD
asm/non_matchings/code/graph/Graph_TaskSet00.s,Graph_TaskSet00,0x801741A8,0xC1 asm/non_matchings/code/graph/Graph_TaskSet00.s,Graph_TaskSet00,0x801741A8,0xC1

1 asm/non_matchings/code/z_en_a_keep/EnAObj_Init.s EnAObj_Init 0x800A5AC0 0x2B
409 asm/non_matchings/code/z_actor/func_800BE63C.s func_800BE63C 0x800BE63C 0x11
410 asm/non_matchings/code/z_actor/Actor_DrawDamageEffects.s Actor_DrawDamageEffects 0x800BE680 0x453
411 asm/non_matchings/code/z_actor/Actor_SpawnIceEffects.s Actor_SpawnIceEffects 0x800BF7CC 0x75
412 asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_FaultPrint.s asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_FaultClient.s ActorOverlayTable_FaultPrint ActorOverlayTable_FaultClient 0x800BF9A0 0x36
413 asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_FaultAddrConv.s ActorOverlayTable_FaultAddrConv 0x800BFA78 0x1C
414 asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_Init.s ActorOverlayTable_Init 0x800BFAE8 0x16
415 asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_Cleanup.s ActorOverlayTable_Cleanup 0x800BFB40 0x10
2662 asm/non_matchings/code/graph/Graph_InitTHGA.s Graph_InitTHGA 0x80173DAC 0x8
2663 asm/non_matchings/code/graph/Graph_SetNextGfxPool.s Graph_SetNextGfxPool 0x80173DCC 0x73
2664 asm/non_matchings/code/graph/Graph_GetNextGameState.s Graph_GetNextGameState 0x80173F98 0x32
2665 asm/non_matchings/code/graph/Graph_FaultAddrConvFunc.s asm/non_matchings/code/graph/Graph_FaultAddrConv.s Graph_FaultAddrConvFunc Graph_FaultAddrConv 0x80174060 0x1C
2666 asm/non_matchings/code/graph/Graph_Init.s Graph_Init 0x801740D0 0x29
2667 asm/non_matchings/code/graph/Graph_Destroy.s Graph_Destroy 0x80174174 0xD
2668 asm/non_matchings/code/graph/Graph_TaskSet00.s Graph_TaskSet00 0x801741A8 0xC1