diff --git a/include/functions.h b/include/functions.h index ff4252365c..b3bfdb0696 100644 --- a/include/functions.h +++ b/include/functions.h @@ -2456,8 +2456,8 @@ void Play_DisableMotionBlur(void); // void Play_ClearTransition(void); Gfx* Play_SetFog(PlayState* this, Gfx* gfx); void Play_Destroy(GameState* thisx); -void Play_CompressI8ToI5(u8* srcI8, s8* destI5, size_t size); -void Play_DecompressI5ToI8(u8* srcI5, s8* destI8, size_t size); +void Play_CompressI8ToI5(void* srcI8, void* destI5, size_t size); +void Play_DecompressI5ToI8(void* srcI5, void* destI8, size_t size); // void Play_GetWaterSurface(void); void Play_UpdateWaterCamera(PlayState* this, Camera* camera); void Play_UpdateTransition(PlayState* this); diff --git a/include/z64.h b/include/z64.h index 72e86ba26e..1066590b38 100644 --- a/include/z64.h +++ b/include/z64.h @@ -257,7 +257,7 @@ typedef struct GraphicsContext { /* 0x2EA */ u8 updateViMode; /* 0x2EB */ u8 framebufferIndex; /* 0x2EC */ void (*callback)(struct GraphicsContext*, u32); - /* 0x2F0 */ u32 callbackParam; + /* 0x2F0 */ u32 callbackArg; /* 0x2F4 */ f32 xScale; /* 0x2F8 */ f32 yScale; /* 0x2FC */ GfxMasterList* masterList; diff --git a/src/code/graph.c b/src/code/graph.c index 2ed5df95d2..f402905218 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -165,7 +165,7 @@ retry: gfxCtx->masterList = gGfxMasterDL; if (gfxCtx->callback != NULL) { - gfxCtx->callback(gfxCtx, gfxCtx->callbackParam); + gfxCtx->callback(gfxCtx, gfxCtx->callbackArg); } task->type = M_GFXTASK; diff --git a/src/code/z_play.c b/src/code/z_play.c index 01e6491347..95898fd1c0 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -12,18 +12,18 @@ s32 gDbgCamEnabled = false; u8 D_801D0D54 = false; // bss -s16 sTransitionFillTimer; // 0x801F6C10 -Input D_801F6C18; // 0x801F6C18 -FbDemoStruct sTrnsnUnk; // 0x801F6C30 -u16* D_801F6D0C; // 0x801F6D0C -s32 gTrnsnUnkState; // 0x801F6D10 -VisMono sVisMono; // 0x801F6D18 -Color_RGBA8_u32 gVisMonoColor; // 0x801F6D30 -Struct_80140E80 D_801F6D38; // 0x801F6D38 -Struct_80140E80* D_801F6D4C; // 0x801F6D4C +s16 sTransitionFillTimer; // 0x801F6C10 +Input D_801F6C18; // 0x801F6C18 +FbDemoStruct sTrnsnUnk; // 0x801F6C30 +u16* D_801F6D0C; // 0x801F6D0C +s32 gTrnsnUnkState; // 0x801F6D10 +VisMono sVisMono; // 0x801F6D18 +Color_RGBA8_u32 gVisMonoColor; // 0x801F6D30 +Struct_80140E80 D_801F6D38; // 0x801F6D38 +Struct_80140E80* D_801F6D4C; // 0x801F6D4C BombersNotebook sBombersNotebook; // 0x801F6D50 -u8 sBombersNotebookOpen; // 0x801F6DFC -u8 sMotionBlurStatus; // 0x801F6DFD +u8 sBombersNotebookOpen; // 0x801F6DFC +u8 sMotionBlurStatus; // 0x801F6DFD typedef enum { /* 0 */ MOTION_BLUR_OFF, @@ -335,7 +335,7 @@ Gfx* Play_SetFog(PlayState* this, Gfx* gfx) { s32 fogFar = this->lightCtx.fogFar * (5.0f / 64.0f); return Gfx_SetFogWithSync(gfx, this->lightCtx.fogColor.r, this->lightCtx.fogColor.g, this->lightCtx.fogColor.b, 0, - this->lightCtx.fogNear, (fogFar <= 1000) ? 1000 : fogFar); + this->lightCtx.fogNear, ((fogFar <= 1000) ? 1000 : fogFar)); } void Play_Destroy(GameState* thisx) { @@ -357,7 +357,7 @@ void Play_Destroy(GameState* thisx) { BombersNotebook_Destroy(&sBombersNotebook); this->state.gfxCtx->callback = NULL; - this->state.gfxCtx->callbackParam = 0; + this->state.gfxCtx->callbackArg = 0; Play_DestroyMotionBlur(); if (R_PAUSE_MENU_MODE != PAUSE_BG_PRERENDER_OFF) { @@ -404,7 +404,8 @@ void Play_Destroy(GameState* thisx) { ZeldaArena_Cleanup(); } -void Play_CompressI8ToI5(u8* srcI8, s8* destI5, size_t size) { +// TODO: More Docs +void Play_CompressI8ToI5(void* srcI8, void* destI5, size_t size) { u32 i; u8* src = srcI8; s8* dest = destI5; @@ -415,7 +416,7 @@ void Play_CompressI8ToI5(u8* srcI8, s8* destI5, size_t size) { for (i = 0; i < size; i++) { srcPixel = *src++; - srcPixel = (srcPixel * 0x1F + 0x80) / 255; + srcPixel = (srcPixel * 0x1F + 0x80) / 0xFF; var_a1 = var_a3 - 5; if (var_a1 > 0) { destPixel |= srcPixel << (var_a1); @@ -433,7 +434,8 @@ void Play_CompressI8ToI5(u8* srcI8, s8* destI5, size_t size) { } } -void Play_DecompressI5ToI8(u8* srcI5, s8* destI8, size_t size) { +// TODO: More Docs +void Play_DecompressI5ToI8(void* srcI5, void* destI8, size_t size) { u32 i; u8* src = srcI5; s8* dest = destI8;