diff options
| author | Derek Hensley <hensley.derek58@gmail.com> | 2023-01-14 07:18:13 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-14 12:18:13 -0300 |
| commit | ab8d34b8dc2ccd28ae4224d8500decff0fa25a1c (patch) | |
| tree | 6cc53d451407b073e7c53349a2564a8062887312 /include | |
| parent | e2b61f88e46efc994db334ac5f03e1174de67058 (diff) | |
Play (2 NON_MATCHINGS) (#1109)
* Bring over progress from another branch
Co-authored-by: Maide <34639600+Kelebek1@users.noreply.github.com>
* cleanup, fake match Play_Init
* small fixes
* Some small cleanup
* Match func_80165460 (from debug)
* Match func_80165658
* Match func_80165DB8, func_80165DCC, func_80165DF0, func_80165E04
* Match func_80167DE4 (from debug)
* Match func_80167F0C
* Match func_80168DAC
* Matched func_80169100
* Matched func_801691F0
* import D_801DFA18
* match Play_Main thanks to debug
* cleanup
* synray does it again
* add docs from debug
* fix func_801656A4
* more docs and cleanup
* Match func_80166B30 and diff fake match in Init
* import transition docs from OoT
* Play Update, sort of
* cleanup Play_Update
* more cleanup
* slightly more docs
* small docs
* Play_Draw WIP Thanks @petrie911
* progress?
* two more matches
* format
* misc play docs
* transitions cleanup
* Motion Blur
* Transitions
* Fog
* Bombers notebook + small cleanup
* bss
* Camera Functions
* Picto functions
* Init
* MotionBlur Clean up
* Floor Surface
* Pictographs some more
* regs
* fix circular dependency problem
* Cleanup PR commits outside play
* namefixer
* PR picto
* PR audio
* PR small clean ups
* debug strings
* Picto defines
* bss
* enums
* remove void
* typedefs
* Hireso -> BombersNotebook
* bss comments
* bss and I8/I5 functions
* Smaller PR comments
* Transitions
* Combine enums
* Revert "Combine enums"
This reverts commit 0da1ebcaed69a3ce0fbd5942460b67f80f0e15e7.
* Fix Transition defines
* RGBA16 macros
* Unname
* worldCoverAlpha
* Rename Update and Draw
* PR review, plus annotate bug
* Clean up nonmatchings with a closer DrawGame
* Format
* New macros
* UpdateMain and DrawMain
* Fix merge
* Small cleanups from PR
* zFar
* Intensity macros
* Format
* Remove bss comments
* Compression/decompression
* Small cleanup
* Format
* More PR cleanup
* Cleanup picto stuff
* format
* Fix compression comments
* Play processes state enums DONE -> READY
* cutscene comment
* fix bss
Co-authored-by: Maide <34639600+Kelebek1@users.noreply.github.com>
Co-authored-by: engineer124 <engineer124engineer124@gmail.com>
Co-authored-by: petrie911 <pmontag@PHYS-S129.iowa.uiowa.edu>
Co-authored-by: angie <angheloalf95@gmail.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/functions.h | 155 | ||||
| -rw-r--r-- | include/macros.h | 4 | ||||
| -rw-r--r-- | include/regs.h | 5 | ||||
| -rw-r--r-- | include/variables.h | 59 | ||||
| -rw-r--r-- | include/z64.h | 150 | ||||
| -rw-r--r-- | include/z64light.h | 12 | ||||
| -rw-r--r-- | include/z64math.h | 3 | ||||
| -rw-r--r-- | include/z64player.h | 2 | ||||
| -rw-r--r-- | include/z64quake.h | 6 | ||||
| -rw-r--r-- | include/z64save.h | 2 | ||||
| -rw-r--r-- | include/z64scene.h | 1 | ||||
| -rw-r--r-- | include/z64snap.h | 50 | ||||
| -rw-r--r-- | include/z64transition.h | 129 |
13 files changed, 321 insertions, 257 deletions
diff --git a/include/functions.h b/include/functions.h index 88b8f2503..5ce1ce872 100644 --- a/include/functions.h +++ b/include/functions.h @@ -978,7 +978,7 @@ s32 Camera_ChangeMode(Camera* camera, s16 mode); s32 func_800DF86C(Camera* camera, s16 arg1); // void func_800DF8EC(void); s32 Camera_ChangeSetting(Camera* camera, s16 setting); -u32 Camera_ChangeDataIdx(Camera* camera, u32 camDataIdx); +s32 Camera_ChangeDataIdx(Camera* camera, s32 camDataIdx); // void func_800DFC1C(void); // void func_800DFC40(void); s32 Camera_GetInputDirYaw(Camera* camera); @@ -988,7 +988,7 @@ s16 Camera_GetCamDirYaw(Camera* camera); void Camera_AddQuake(Camera* camera, s32 arg1, s16 y, s32 countdown); s32 Camera_SetViewParam(Camera* camera, s32 viewFlag, void* param); // UNK_TYPE4 func_800DFEF0(s32 param_1, u16 param_2); -// UNK_TYPE4 func_800DFF18(Camera* iParm1, UNK_TYPE2 uParm2); +void func_800DFF18(Camera* camera, s32 arg1); // UNK_TYPE4 func_800DFF34(s32 param_1); // UNK_TYPE4 func_800DFF44(void); s16 Camera_SetFlags(Camera* iParm1, s16 flags); @@ -1227,7 +1227,8 @@ s32 Actor_TrackPlayerSetFocusHeight(PlayState* play, Actor* actor, Vec3s* headRo s32 Actor_TrackPlayer(PlayState* play, Actor* actor, Vec3s* headRot, Vec3s* torsoRot, Vec3f focusPos); void SaveContext_Init(void); void GameInfo_Init(void); -// void DebugDisplay_Init(void); +DebugDispObject* DebugDisplay_Init(void); +void DebugDisplay_DrawObjects(PlayState* play); DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, f32 scaleX, f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha, s16 type, GraphicsContext* gfxCtx); // void func_800E9C90(void); // void func_800E9CA0(s32 param_1, UNK_TYPE1 param_2, s8* param_3); @@ -1274,11 +1275,11 @@ s16 func_800F1460(s16 param_1); ActorCutscene* ActorCutscene_GetCutsceneImpl(s16 index); void ActorCutscene_Init(PlayState* play, ActorCutscene* cutscenes, s32 num); void func_800F15D8(Camera* camera); -// void ActorCutscene_ClearWaiting(void); +void ActorCutscene_ClearWaiting(void); // void ActorCutscene_ClearNextCutscenes(void); // void ActorCutscene_MarkNextCutscenes(void); // void ActorCutscene_End(void); -// void ActorCutscene_Update(void); +s16 ActorCutscene_Update(void); void ActorCutscene_SetIntentToPlay(s16 index); s16 ActorCutscene_GetCanPlayNext(s16 index); s16 ActorCutscene_StartAndSetUnkLinkFields(s16 index, Actor* actor); @@ -1323,13 +1324,13 @@ void Font_LoadMessageBoxEndIcon(Font* font, u16 icon); void Font_LoadOrderedFont(Font* font); // void func_800F5090(void); // void func_800F50D4(void); -void Kankyo_Init(PlayState* play, EnvironmentContext* envCtx); +void Environment_Init(PlayState* play, EnvironmentContext* envCtx, s32 arg2); u32 func_800F5954(u8* param_1, u32 param_2, u32 param_3, u8 param_4, u8 param_5); f32 Environment_LerpWeight(u16 max, u16 min, u16 val); // void func_800F5B10(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5); -// void func_800F5CD0(void); +void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxContext* skyboxCtx); void func_800F6834(PlayState* play, s32 waterLightsIndex); -// void func_800F694C(void); +void func_800F694C(PlayState* play); // void func_800F6A04(void); // void func_800F6A40(void); // void func_800F6AB8(void); @@ -1342,13 +1343,15 @@ void func_800F6FF8(PlayState* play, EnvironmentContext* envCtx, LightContext* li // void func_800F88C4(void); // void func_800F8970(void); // void func_800F8A9C(void); -// void func_800F8CD4(PlayState* play, EnvironmentContext* envCtx, LightContext* lightCtx, s32 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); +void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContext* lightCtx, + PauseContext* pauseCtx, MessageContext* msgCtx, GameOverContext* gameOverCtx, + GraphicsContext* gfxCtx); // void func_800F8D84(void); -// void func_800F9728(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7); +void Environment_DrawSunLensFlare(PlayState* play, EnvironmentContext* envCtx, View* view, GraphicsContext* gfxCtx, Vec3f pos); void func_800F9824(PlayState* play, EnvironmentContext* envCtx, View* view, GraphicsContext* gfxCtx, Vec3f vec, f32 arg5, f32 arg6, s8 arg7, s8 arg8); // void func_800FA39C(void); // void func_800FA3C4(void); -// void func_800FA9FC(void); +void Environment_DrawRain(PlayState* play, View* view, GraphicsContext* gfxCtx); void func_800FAAB4(PlayState* play, u8 arg1); // void func_800FAC20(void); // void func_800FAF74(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE1 param_5); @@ -1357,13 +1360,13 @@ void Environment_AddLightningBolts(PlayState* play, u8 num); // void func_800FB388(void); void func_800FB758(PlayState* play); // void func_800FB9B4(void); -// void func_800FBCBC(void); +void Environment_DrawCustomLensFlare(PlayState* play); void Kankyo_InitGameOverLights(PlayState* play); void Kankyo_FadeInGameOverLights(PlayState* play); void Kankyo_FadeOutGameOverLights(PlayState* play); // void func_800FC3DC(void); -void func_800FC444(GraphicsContext* gfxCtx, u8 arg1, u8 arg2, u8 arg3, u8 arg4, UNK_TYPE arg5); -// void func_800FC64C(void); +void Environment_FillScreen(GraphicsContext* gfxCtx, u8 red, u8 green, u8 blue, u8 alpha, u8 drawFlags); +void Environment_DrawSandstorm(PlayState* play, u8 sandstormState); s32 func_800FD2B4(PlayState* play, f32 arg1, f32 arg2, f32 arg3, f32 arg4); void func_800FD538(Color_RGB8* param_1, Color_RGB8* param_2, f32 param_3, Vec3s* param_4); void func_800FD59C(PlayState* play, Color_RGB8* pzParm2, f32 fParm3); @@ -1374,20 +1377,20 @@ void func_800FD698(PlayState* play, s16 arg1, s16 arg2, f32 arg3); // void reset_days_elapsed(void); // u32 get_current_day(void); void func_800FD750(u16 seqId); -// void func_800FD768(void); +s32 func_800FD768(void); void func_800FD78C(PlayState* play); void func_800FD858(PlayState* play); void func_800FD928(s32 param_1); // void func_800FD980(void); // void func_800FDAF8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); // void func_800FDC94(void); -// void func_800FE390(void); -// void func_800FE3E0(void); +void func_800FE390(PlayState* play); +void func_800FE3E0(PlayState* play); void Environment_StopTime(void); void Environment_StartTime(void); u8 Environment_IsTimeStopped(void); u32 func_800FE4B8(PlayState* play); -// void func_800FE590(void); +s32 func_800FE590(PlayState* play); // void func_800FE5D0(void); // UNK_TYPE4 func_800FE610(void); u32 func_800FE620(PlayState* play); @@ -1496,7 +1499,7 @@ LightNode* Lights_FindBufSlot(); void Lights_FreeNode(LightNode* light); void LightContext_Init(PlayState* play, LightContext* lightCtx); void LightContext_SetAmbientColor(LightContext* lightCtx, u8 r, u8 g, u8 b); -void func_80102544(LightContext* lightCtx, u8 a1, u8 a2, u8 a3, s16 numLights, s16 sp16); +void LightContext_SetFog(LightContext* lightCtx, u8 r, u8 g, u8 b, s16 near, s16 far); Lights* LightContext_NewLights(LightContext* lightCtx, GraphicsContext* gfxCtx); void LightContext_InitList(PlayState* play, LightContext* lightCtx); void LightContext_DestroyList(PlayState* play, LightContext* lightCtx); @@ -1514,7 +1517,7 @@ void* ZeldaArena_Calloc(u32 num, size_t size); void ZeldaArena_GetSizes(size_t* outMaxFree, size_t* outFree, size_t* outAlloc); s32 ZeldaArena_Check(); void ZeldaArena_Init(void* start, size_t size); -void ZeldaArena_Cleanup(); +void ZeldaArena_Cleanup(void); u8 ZeldaArena_IsInitialized(); // void func_80102E40(void); // void func_80102E90(void); @@ -1974,7 +1977,7 @@ void Scene_SetExitFade(PlayState* play); s32 Scene_ProcessHeader(PlayState* play, SceneCmd* header); u16 Entrance_Create(s32 scene, s32 spawn, s32 layer); u16 Entrance_CreateFromSpawn(s32 spawn); -void Scene_ExecuteDrawConfig(PlayState* play); +void Scene_Draw(PlayState* play); void Scene_DrawConfigDefault(PlayState* play); Gfx* AnimatedMat_TexScroll(PlayState* play, AnimatedMatTexScrollParams* params); void AnimatedMat_DrawTexScroll(PlayState* play, s32 segment, void* params); @@ -2141,8 +2144,8 @@ void func_80140900(void* arg0); void func_80140CE0(void* arg0); void func_80140D04(void* arg0); void func_80140D10(void* arg0, Gfx** gfx, u32 arg2); -void func_80140E80(void* param_1); -// void func_80140EA0(void); +void func_80140E80(Struct_80140E80* arg0); +void func_80140EA0(Struct_80140E80* arg0); // void func_80140EAC(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_80141008(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10); void func_8014116C(Gfx** gfxP, u16* arg1, u16* arg2, s32 width, s32 height, s32 arg5); @@ -2150,7 +2153,7 @@ void func_8014116C(Gfx** gfxP, u16* arg1, u16* arg2, s32 width, s32 height, s32 // void func_80141200(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_8014151C(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_80141678(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); -// void func_80141778(void); +void func_80141778(Struct_80140E80* arg0, Gfx** gfxp, void* unk_18E60, GraphicsContext* gfxCtx); void VisMono_Init(VisMono* this); void VisMono_Destroy(VisMono* this); // void VisMono_DesaturateTLUT(u16* tlut); @@ -2169,7 +2172,7 @@ void Skybox_Init(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyboxId); Mtx* SkyboxDraw_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z); void SkyboxDraw_SetColors(SkyboxContext* skyboxCtx, u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB); void SkyboxDraw_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y, f32 z); -void SkyboxDraw_Noop(SkyboxContext* skyboxCtx); +void SkyboxDraw_Update(SkyboxContext* skyboxCtx); // void func_80147520(void); void func_80147564(PlayState* play); @@ -2221,8 +2224,8 @@ u8 Message_GetState(MessageContext* msgCtx); // void func_80153E7C(void); // void func_80153EF0(void); void func_801541D4(PlayState* play, Gfx** gfxp); -// void func_80156758(void); -void func_8015680C(PlayState* play); +void Message_Draw(PlayState* play); +void Message_Update(PlayState* play); void func_801586A4(PlayState* play); void Message_Init(PlayState* play); void Message_FindMessageNES(PlayState* play, u16 textId); @@ -2265,7 +2268,7 @@ void* KaleidoManager_FaultAddrConvFunc(void* address, void* param); void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl); void KaleidoManager_ClearOvl(KaleidoMgrOverlay* ovl); void KaleidoManager_Init(PlayState* play); -void KaleidoManager_Destroy(); +void KaleidoManager_Destroy(void); void* KaleidoManager_GetRamAddr(void* vram); void KaleidoScopeCall_LoadPlayer(void); void KaleidoScopeCall_Init(PlayState* play); @@ -2276,21 +2279,22 @@ void Transition_Init(TransitionContext* transitionCtx); void Transition_Destroy(TransitionContext* transitionCtx); // void func_80163DC0(void); // void func_8016418C(void); -// void func_8016424C(void); -// void func_801642D8(void); +void TransitionUnk_Destroy(FbDemoStruct* this); +FbDemoStruct* TransitionUnk_Init(FbDemoStruct* this, s32 row, s32 col); // void func_80164438(void); -// void func_8016454C(void); +void TransitionUnk_Draw(FbDemoStruct* this, Gfx**); // void func_80164678(void); -// void func_801647AC(void); +void func_801647AC(FbDemoStruct* this); // UNK_TYPE4 func_801647B8(void); // void TransitionFade_Start(void); -void* TransitionFade_Init(void* param_1); -// void TransitionFade_Destroy(void); -// void TransitionFade_Update(void); -// void TransitionFade_Draw(void); +void* TransitionFade_Init(TransitionFade* arg0); +void TransitionFade_Destroy(TransitionFade* arg0); +void TransitionFade_Update(TransitionFade* thisx, s32 updateRate); +void TransitionFade_Draw(void* thisx, Gfx** gfxP); // void TransitionFade_IsDone(void); -// void TransitionFade_SetColor(void); -// void TransitionFade_SetType(void); +void TransitionFade_SetColor(TransitionFade* arg0, u32 color); +void TransitionFade_SetType(TransitionFade* arg0, s32 arg1); +void TransitionFade_Start(TransitionFade* arg0); void TransitionOverlay_ClearLoadInfo(TransitionOverlay *overlayEntry); void TransitionOverlay_SetSegment(TransitionOverlay *overlayEntry, void* vramStart, void* vramEnd, uintptr_t vromStart, uintptr_t vromEnd); void TransitionCircle_Start(void* thisx); @@ -2299,8 +2303,7 @@ void TransitionCircle_Destroy(void* thisx); void TransitionCircle_Update(void* thisx); void TransitionCircle_SetColor(void* thisx, u32 color); void TransitionCircle_SetType(void* thisx, s32 type); -void TransitionCircle_LoadAndSetTexture(Gfx** gfxp, TexturePtr texture, s32 fmt, s32 arg3, s32 masks, s32 maskt, - f32 arg6); +void TransitionCircle_LoadAndSetTexture(Gfx** gfxp, TexturePtr texture, s32 fmt, s32 arg3, s32 masks, s32 maskt, f32 arg6); void TransitionCircle_Draw(void* thisx, Gfx** gfxp); s32 TransitionCircle_IsDone(void* thisx); void* TransitionOverlay_VramToRam(TransitionOverlay *overlayEntry, void* vramAddr); @@ -2309,39 +2312,26 @@ s32 TransitionOverlay_Load(TransitionOverlay *overlayEntry); s32 TransitionOverlay_Free(TransitionOverlay *overlayEntry); void func_80165438(UNK_PTR param_1); // void func_80165444(s32 param_1, UNK_TYPE4 param_2, UNK_TYPE4 param_3, UNK_TYPE4 param_4, UNK_TYPE4 param_5); -// void func_80165460(void); -// void func_80165608(void); -// void func_80165630(void); -void func_80165658(u32 arg0); -void func_8016566C(u32 arg0); -void func_80165690(void); -// void func_801656A4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8); -void func_80165DCC(s32 arg0); -void func_80165DF0(void); -// void func_80165E1C(void); -// void func_80165E7C(void); -// void func_80165EC0(void); -// void func_80166060(void); -Gfx* func_801660B8(PlayState* play, Gfx* gfx); + +void Play_SetMotionBlurAlpha(u32 alpha); +void Play_EnableMotionBlur(u32 alpha); +void Play_DisableMotionBlur(void); +void Play_SetMotionBlurPriorityAlpha(u32 alpha); +void Play_EnableMotionBlurPriority(u32 alpha); +void Play_DisableMotionBlurPriority(void); +void Play_TriggerPictoPhoto(void); +Gfx* Play_SetFog(PlayState* this, Gfx* gfx); void Play_Destroy(GameState* thisx); void Play_CompressI8ToI5(void* srcI8, void* destI5, size_t size); void Play_DecompressI5ToI8(void* srcI5, void* destI8, size_t size); -// void func_801668B4(void); -void func_80166968(PlayState* play, Camera* camera); -void func_80166B30(PlayState* play); -void Play_Update(PlayState* play); -void func_80167DE4(PlayState* play); -// void func_80167F0C(void); -void Play_Draw(PlayState* play); -void func_80168DAC(PlayState* play); -void Play_Main(PlayState* play); +void Play_Update(PlayState* this); +void Play_Draw(PlayState* this); +void Play_Main(GameState* thisx); s32 Play_InCsMode(PlayState* this); -f32 func_80169100(PlayState* play, MtxF* mtx, CollisionPoly** arg2, s32* arg3, Vec3f* feetPosPtr); -void func_801691F0(PlayState* play, MtxF* mtx, Vec3f* arg2); -void* Play_LoadScene(PlayState* play, RomFile* entry); -void func_8016927C(PlayState* play, s16 sParm2); -// void func_801692C4(PlayState* play, UNK_TYPE1 uParm2); -// void Play_SceneInit(PlayState* play, s32 sceneIndex, UNK_TYPE1 param_3); +f32 Play_GetFloorSurfaceImpl(PlayState* this, MtxF* mtx, CollisionPoly** poly, s32* bgId, Vec3f* pos); +void Play_GetFloorSurface(PlayState* this, MtxF* mtx, Vec3f* pos); +void* Play_LoadFile(PlayState* this, RomFile* entry); +void Play_InitEnvironment(PlayState* this, s16 skyboxId); void Play_GetScreenPos(PlayState* this, Vec3f* worldPos, Vec3f* screenPos); s16 Play_CreateSubCamera(PlayState* this); s16 Play_GetActiveCamId(PlayState* this); @@ -2371,8 +2361,9 @@ s32 func_8016A02C(GameState* thisx, Actor* actor, s16* yaw); s32 Play_IsUnderwater(PlayState* this, Vec3f* pos); s32 Play_IsDebugCamEnabled(void); void Play_AssignPlayerActorCsIdsFromScene(GameState* thisx, s32 startActorCsId); -void Play_FillScreen(GameState* gameState, s16 fillScreenOn, u8 red, u8 green, u8 blue, u8 alpha); -void Play_Init(GameState* gameState); +void Play_FillScreen(GameState* thisx, s16 fillScreenOn, u8 red, u8 green, u8 blue, u8 alpha); +void Play_Init(GameState* thisx); + // void func_8016AC10(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10); // void func_8016AE1C(void); // void func_8016B278(void); @@ -2381,11 +2372,11 @@ void Play_Init(GameState* gameState); // void func_8016CD4C(void); // void func_8016E40C(void); // void func_8016EA90(void); -// void func_8016F1A8(void); +void BombersNotebook_Draw(BombersNotebook* this, GraphicsContext* gfxCtx); // void func_8016F4EC(void); -void func_8016F5A8(PlayState* play, s8* pcParm2, Input* iParm3); -// void func_8016FC78(void); -// void func_8016FC98(void); +void BombersNotebook_Update(PlayState* play, BombersNotebook* this, Input* input); +void BombersNotebook_Init(BombersNotebook* this); +void BombersNotebook_Destroy(BombersNotebook* this); void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg); void PreRender_Init(PreRender* this); void PreRender_SetValues(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf); @@ -2556,12 +2547,12 @@ void Mtx_SetTranslateScaleMtx(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, f32 void Mtx_SetRotationMtx(Mtx* mtx, s32 angle, f32 axisX, f32 axisY, f32 axisZ); void Mtx_SetTranslationRotationScaleMtx(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, s32 angle, f32 axisX, f32 axisY, f32 axisZ,f32 translateX, f32 translateY, f32 translateZ); -// void func_80178750(void); -// void func_80178818(void); +void func_80178750(void); +void func_80178818(void); void func_80178978(void); // void func_801789D4(void); -u32 SysCfb_GetFbPtr(s32 index); -u32 SysCfb_GetZBuffer(void); +void* SysCfb_GetFbPtr(s32 index); +void* SysCfb_GetZBuffer(void); // UNK_TYPE4 func_80178A24(void); // void func_80178A34(void); s32 func_80178A94(s32 param_1, s32 param_2); @@ -2990,14 +2981,14 @@ void func_801A3CD8(s8 param_1); void func_801A3CF4(s8 arg0); void func_801A3D98(s8 audioSetting); void func_801A3E38(u8 arg0); -// void func_801A3EC0(void); +void func_801A3EC0(u8 arg0); void Audio_SetCutsceneFlag(s8 flag); // void func_801A3F6C(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_801A3FB4(void); // void func_801A3FFC(UNK_TYPE1 param_1); void Audio_SetSpec(u32 specId); void func_801A4058(UNK_TYPE arg0); -// void func_801A41C8(void); +void func_801A41C8(s32 arg0); void func_801A41F8(UNK_TYPE arg0); // void func_801A429C(void); // void func_801A42C8(void); @@ -3073,6 +3064,6 @@ u8 func_801A982C(void); void GameOver_Init(PlayState* play); void GameOver_FadeLights(PlayState* play); void GameOver_Update(PlayState* play); -void func_801AAAA0(PlayState* play); +void Regs_InitData(PlayState* play); #endif diff --git a/include/macros.h b/include/macros.h index 913ccac4a..77d3eadad 100644 --- a/include/macros.h +++ b/include/macros.h @@ -140,6 +140,10 @@ extern GraphicsContext* __gfxCtx; #define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x)) #define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x)) +#define RGBA16_GET_R(pixel) (((pixel) >> 11) & 0x1F) +#define RGBA16_GET_G(pixel) (((pixel) >> 6) & 0x1F) +#define RGBA16_GET_B(pixel) (((pixel) >> 1) & 0x1F) + #define ROUND(x) (s32)(((x) >= 0.0) ? ((x) + 0.5) : ((x) - 0.5)) #define SWAP(type, a, b) \ diff --git a/include/regs.h b/include/regs.h index b19131748..9ea58aed1 100644 --- a/include/regs.h +++ b/include/regs.h @@ -52,6 +52,11 @@ #define R_FB_FILTER_PRIM_COLOR(c) SREG(81 + c) #define R_FB_FILTER_A SREG(84) #define R_FB_FILTER_ENV_COLOR(c) SREG(85 + c) +#define R_PICTO_PHOTO_STATE SREG(89) +#define R_MOTION_BLUR_ALPHA SREG(90) +#define R_MOTION_BLUR_ENABLED SREG(91) +#define R_MOTION_BLUR_PRIORITY_ALPHA SREG(92) +#define R_MOTION_BLUR_PRIORITY_ENABLED SREG(93) #define R_PAUSE_BG_PRERENDER_STATE SREG(94) #define R_PLAY_FILL_SCREEN_ON MREG(64) diff --git a/include/variables.h b/include/variables.h index 7cc0f3b28..af32d062e 100644 --- a/include/variables.h +++ b/include/variables.h @@ -810,8 +810,8 @@ extern KaleidoMgrOverlay* gKaleidoMgrCurOvl; extern Gfx D_801D0D00[]; extern s32 gDbgCamEnabled; // extern UNK_TYPE1 D_801D0D54; -// extern UNK_TYPE2 D_801D0D58; -// extern UNK_TYPE2 D_801D0D5C; +// extern UNK_TYPE2 sQuakeIndex; +// extern UNK_TYPE2 sIsCameraUnderwater; extern Input* D_801D0D60; // extern UNK_TYPE2 D_801D0D64; // extern UNK_TYPE1 D_801D0D7A; @@ -2325,26 +2325,17 @@ extern TriNorm D_801EDBB0; // extern UNK_TYPE1 D_801EDBD8; // extern UNK_TYPE1 D_801EDBDC; // extern UNK_TYPE1 D_801EDBE0; -// extern UNK_TYPE1 D_801EDBF4; -// extern UNK_TYPE1 D_801EDBF8; -// extern UNK_TYPE1 D_801EDC00; -// extern UNK_TYPE1 D_801EDC04; -// extern UNK_TYPE1 D_801EDC08; -// extern UNK_TYPE1 D_801EDC0C; -// extern UNK_TYPE1 D_801EDC10; -// extern UNK_TYPE1 D_801EDC14; -// extern UNK_TYPE1 D_801EDC28; -// extern UNK_TYPE1 D_801EDC30; -// extern UNK_TYPE1 D_801EDC8C; -// extern UNK_TYPE1 D_801EDC90; -// extern UNK_TYPE1 D_801EDC92; -// extern UNK_TYPE1 D_801EDC94; -// extern UNK_TYPE1 D_801EDC96; -// extern UNK_TYPE1 D_801EDDD0; -// extern UNK_TYPE1 D_801EDDD4; -// extern UNK_TYPE1 D_801EDDD8; -// extern UNK_TYPE1 D_801EDDE0; -// extern UNK_TYPE1 D_801EDDF0; + +// extern s16 D_801EDBF0; +// extern f32 D_801EDBF4; +// extern f32 D_801EDBF8; +// extern CameraCollision D_801EDC00; +// extern PlayState* sCamPlayState; +// extern SwingAnimation D_801EDC30[4]; +// extern Vec3f D_801EDDD0; +// extern Vec3f D_801EDDE0; +// extern Vec3f D_801EDDF0; + extern Vec3f D_801EDE00; extern Vec3f D_801EDE10; extern Vec3f D_801EDE20; @@ -2488,18 +2479,18 @@ extern s16 D_801F4E7A; extern void (*sKaleidoScopeUpdateFunc)(PlayState* play); extern void (*sKaleidoScopeDrawFunc)(PlayState* play); extern FaultAddrConvClient sKaleidoAreaFaultClient; -// extern UNK_TYPE1 D_801F6C10; +extern s16 sTransitionFillTimer; extern Input D_801F6C18; -// extern UNK_TYPE1 D_801F6C30; -// extern UNK_TYPE1 D_801F6D0C; -extern UNK_TYPE4 D_801F6D10; -// extern UNK_TYPE1 D_801F6D18; -extern Color_RGBA8 D_801F6D30; -// extern UNK_TYPE1 D_801F6D38; -// extern UNK_TYPE4 D_801F6D4C; -// extern UNK_TYPE1 D_801F6D50; -extern u8 D_801F6DFC; -// extern UNK_TYPE1 D_801F6DFD; +extern FbDemoStruct sTrnsnUnk; +extern u16* D_801F6D0C; +extern s32 gTrnsnUnkState; +extern VisMono sVisMono; +extern Color_RGBA8_u32 gVisMonoColor; +extern Struct_80140E80 D_801F6D38; +extern Struct_80140E80* D_801F6D4C; +extern BombersNotebook sBombersNotebook; +extern u8 sBombersNotebookOpen; +extern u8 sMotionBlurStatus; extern SlowlyTask D_801F6E00; extern s32 D_801F6FC0; extern StackEntry slowlyStackEntry; @@ -2573,7 +2564,7 @@ extern UNK_TYPE2 D_801FBBCC; extern UNK_TYPE2 D_801FBBCE; // extern UNK_TYPE1 D_801FBBD0; // extern UNK_TYPE1 D_801FBBD2; -// extern UNK_TYPE1 D_801FBBD4; +extern u8 D_801FBBD4; extern Vec3f D_801FBBF0; extern LineSegment Math3D_ColSphereTri_line; extern Vec3f Math3D_ColSphereTri_point; diff --git a/include/z64.h b/include/z64.h index b8a3ac01e..1a6fcd1d3 100644 --- a/include/z64.h +++ b/include/z64.h @@ -245,9 +245,9 @@ typedef struct GraphicsContext { /* 0x2E4 */ u32 viConfigFeatures; /* 0x2E8 */ char unk_2E8[0x2]; /* 0x2EA */ u8 updateViMode; - /* 0x2EB */ u8 framebufferIdx; + /* 0x2EB */ u8 framebufferIndex; /* 0x2EC */ void (*callback)(struct GraphicsContext*, u32); - /* 0x2F0 */ u32 callbackParam; + /* 0x2F0 */ u32 callbackArg; /* 0x2F4 */ f32 xScale; /* 0x2F8 */ f32 yScale; /* 0x2FC */ GfxMasterList* masterList; @@ -534,8 +534,8 @@ typedef struct { /* 0xE5 */ u8 fillScreen; /* 0xE6 */ u8 screenFillColor[4]; /* 0xEA */ u8 sandstormState; - /* 0xEB */ u8 unk_EB; - /* 0xEC */ u8 unk_EC; + /* 0xEB */ u8 sandstormPrimA; + /* 0xEC */ u8 sandstormEnvA; /* 0xED */ u8 unk_ED; /* 0xEE */ u8 unk_EE[4]; /* 0xF2 */ u8 unk_F2[8]; // [3] is used by both DemoKankyo and ObjectKankyo effect count @@ -619,64 +619,6 @@ typedef struct { /* 0x24 */ u32 flags; } PreRenderParams; // size = 0x28 -#define TRANS_TRIGGER_OFF 0 // transition is not active -#define TRANS_TRIGGER_START 20 // start transition (exiting an area) -#define TRANS_TRIGGER_END -20 // transition is ending (arriving in a new area) - -typedef enum TransitionMode { - /* 0 */ TRANS_MODE_OFF, - /* 1 */ TRANS_MODE_01, - /* 2 */ TRANS_MODE_02, - /* 3 */ TRANS_MODE_03, - /* 4 */ TRANS_MODE_04, - /* 5 */ TRANS_MODE_05, - /* 6 */ TRANS_MODE_06, - /* 7 */ TRANS_MODE_07, - /* 8 */ TRANS_MODE_08, - /* 9 */ TRANS_MODE_09, - /* 10 */ TRANS_MODE_10, - /* 11 */ TRANS_MODE_11, - /* 12 */ TRANS_MODE_12, - /* 13 */ TRANS_MODE_13, - /* 14 */ TRANS_MODE_14, - /* 15 */ TRANS_MODE_15, - /* 16 */ TRANS_MODE_16, - /* 17 */ TRANS_MODE_17 -} TransitionMode; - -typedef enum TransitionType { - /* 0 */ TRANS_TYPE_00, - /* 1 */ TRANS_TYPE_01, - /* 2 */ TRANS_TYPE_02, - /* 3 */ TRANS_TYPE_03, - /* 4 */ TRANS_TYPE_04, - /* 5 */ TRANS_TYPE_05, - /* 6 */ TRANS_TYPE_06, - /* 7 */ TRANS_TYPE_07, - /* 8 */ TRANS_TYPE_08, - /* 9 */ TRANS_TYPE_09, - /* 10 */ TRANS_TYPE_10, - /* 11 */ TRANS_TYPE_11, - /* 12 */ TRANS_TYPE_12, - /* 13 */ TRANS_TYPE_13, - /* 14 */ TRANS_TYPE_14, - /* 15 */ TRANS_TYPE_15, - /* 16 */ TRANS_TYPE_16, - /* 17 */ TRANS_TYPE_17, - /* 18 */ TRANS_TYPE_18, - /* 19 */ TRANS_TYPE_19, - /* 20 */ TRANS_TYPE_20, - /* 21 */ TRANS_TYPE_21, - /* 64 */ TRANS_TYPE_64 = 64, - /* 70 */ TRANS_TYPE_70 = 70, - /* 72 */ TRANS_TYPE_72 = 72, - /* 73 */ TRANS_TYPE_73, - /* 80 */ TRANS_TYPE_80 = 80, - /* 86 */ TRANS_TYPE_86 = 86 -} TransitionType; - -#define TRANS_NEXT_TYPE_DEFAULT 0xFF - typedef struct FaultAddrConvClient { /* 0x0 */ struct FaultAddrConvClient* next; /* 0x4 */ void* (*callback)(void*, void*); @@ -708,10 +650,6 @@ typedef struct { /* 0x844 */ void* fb; } FaultThreadStruct; // size = 0x848 -typedef struct FireObj FireObj; - -typedef struct FireObjLight FireObjLight; - struct GameState; typedef void (*GameStateFunc)(struct GameState* gameState); @@ -767,15 +705,14 @@ typedef struct { /* 0x10 */ OSTime resetTime; } PreNmiBuff; // size = 0x18 (actually osAppNmiBuffer is 0x40 bytes large but the rest is unused) -typedef struct PlayState PlayState; -typedef s32 (*ColChkResetFunc)(PlayState*, Collider*); -typedef void (*ColChkBloodFunc)(PlayState*, Collider*, Vec3f*); -typedef void (*ColChkApplyFunc)(PlayState*, CollisionCheckContext*, Collider*); -typedef void (*ColChkVsFunc)(PlayState*, CollisionCheckContext*, Collider*, Collider*); -typedef s32 (*ColChkLineFunc)(PlayState*, CollisionCheckContext*, Collider*, Vec3f*, Vec3f*); +typedef s32 (*ColChkResetFunc)(struct PlayState*, Collider*); +typedef void (*ColChkBloodFunc)(struct PlayState*, Collider*, Vec3f*); +typedef void (*ColChkApplyFunc)(struct PlayState*, CollisionCheckContext*, Collider*); +typedef void (*ColChkVsFunc)(struct PlayState*, CollisionCheckContext*, Collider*, Collider*); +typedef s32 (*ColChkLineFunc)(struct PlayState*, CollisionCheckContext*, Collider*, Vec3f*, Vec3f*); -typedef void(*room_draw_func)(PlayState* play, Room* room, u32 flags); +typedef void(*room_draw_func)(struct PlayState* play, Room* room, u32 flags); typedef struct { /* 0x000 */ u8 controllers; // bit 0 is set if controller 1 is plugged in, etc. @@ -816,11 +753,11 @@ typedef enum { STACK_STATUS_OVERFLOW = 2 } StackStatus; -struct FireObjLight { +typedef struct FireObjLight { /* 0x00 */ LightNode* light; /* 0x04 */ LightInfo lightInfo; /* 0x12 */ u8 lightParamsIndex; -}; // size = 0x14 +} FireObjLight; // size = 0x14 #define OS_SC_RETRACE_MSG 1 #define OS_SC_DONE_MSG 2 @@ -859,7 +796,7 @@ typedef struct { /* 0x5E */ u16 age; } EffFootmark; // size = 0x60 -struct FireObj { +typedef struct FireObj { /* 0x00 */ Vec3f position; /* 0x0C */ f32 size; /* 0x10 */ f32 sizeInv; @@ -876,7 +813,7 @@ struct FireObj { /* 0x2A */ s16 ignitionDelay; /* 0x2C */ ColliderCylinder collision; /* 0x78 */ FireObjLight light; -}; // size = 0x8B +} FireObj; // size = 0x8B typedef struct { /* 0x0 */ u8 seqId; @@ -904,7 +841,7 @@ typedef struct { /* 0x0 */ u16 state; } GameOverContext; // size = 0x2 -struct PlayState { +typedef struct PlayState { /* 0x00000 */ GameState state; /* 0x000A4 */ s16 sceneId; /* 0x000A6 */ u8 sceneConfig; @@ -951,12 +888,12 @@ struct PlayState { /* 0x18798 */ s32 (*setPlayerTalkAnim)(struct PlayState* play, LinkAnimationHeader* talkAnim, s32 animMode); /* 0x1879C */ s16 playerActorCsIds[10]; /* 0x187B0 */ MtxF viewProjectionMtxF; - /* 0x187F0 */ Vec3f unk_187F0; + /* 0x187F0 */ Vec3f projectionMtxFDiagonal; /* 0x187FC */ MtxF billboardMtxF; /* 0x1883C */ Mtx* billboardMtx; /* 0x18840 */ u32 gameplayFrames; /* 0x18844 */ u8 unk_18844; - /* 0x18845 */ u8 unk_18845; + /* 0x18845 */ u8 haltAllActors; /* 0x18846 */ s16 numSetupActors; /* 0x18848 */ u8 numRooms; /* 0x1884C */ RomFile* roomList; @@ -971,7 +908,7 @@ struct PlayState { /* 0x18870 */ void* specialEffects; /* 0x18874 */ u8 skyboxId; /* 0x18875 */ s8 transitionTrigger; // "fade_direction" - /* 0x18876 */ s16 unk_18876; + /* 0x18876 */ s16 worldCoverAlpha; /* 0x18878 */ s16 bgCoverAlpha; /* 0x1887A */ u16 nextEntrance; /* 0x1887C */ s8 unk_1887C; // shootingGalleryStatus? @@ -985,14 +922,57 @@ struct PlayState { /* 0x18B49 */ u8 unk_18B49; /* 0x18B4A */ u8 transitionMode; /* 0x18B4C */ PreRender pauseBgPreRender; - /* 0x18B9C */ char unk_18B9C[0x2B8]; + /* 0x18B9C */ char unk_18B9C[0x54]; + /* 0x18BF0 */ TransitionContext transitionCtx; + /* 0x18E48 */ TransitionFade unk_18E48; /* 0x18E54 */ SceneTableEntry* loadedScene; - /* 0x18E58 */ char unk_18E58[0x4]; + /* 0x18E58 */ void* unk_18E58; /* 0x18E5C */ TexturePtr pictoPhotoI8; - /* 0x18E60 */ char unk_18E60[0x8]; + /* 0x18E60 */ void* unk_18E60; + /* 0x18E64 */ void* unk_18E64; /* 0x18E68 */ void* unk_18E68; /* 0x18E6C */ char unk_18E6C[0x3EC]; -}; // size = 0x19258 +} PlayState; // size = 0x19258 + +typedef struct { + /* 0x00 */ u8 unk_00; + /* 0x01 */ char unk_01[0x3F]; + /* 0x40 */ void* unk_40; + /* 0x44 */ u32 unk_44; + /* 0x48 */ u32 unk_48; + /* 0x4C */ DmaRequest unk_4C; + /* 0x6C */ OSMesgQueue unk_6C; + /* 0x84 */ OSMesg unk_84[1]; + /* 0x88 */ void* unk_88; + /* 0x8C */ uintptr_t unk_8C; + /* 0x90 */ size_t unk_90; + /* 0x94 */ s32 unk_94; + /* 0x98 */ s32 unk_98; + /* 0x9C */ s32 unk_9C; + /* 0xA0 */ char unk_A0[0x4]; + /* 0xA4 */ s32 unk_A4; + /* 0xA8 */ s32 unk_A8; +} BombersNotebook; // size = 0xAC + +typedef enum { + /* 0 */ PICTO_PHOTO_STATE_OFF, + /* 1 */ PICTO_PHOTO_STATE_SETUP, + /* 2 */ PICTO_PHOTO_STATE_PROCESS, + /* 3 */ PICTO_PHOTO_STATE_READY +} PictoPhotoState; + +// OoT's TransitionUnk +typedef struct { + /* 0x00 */ char unk_00[0xDC]; +} FbDemoStruct; // size = 0xDC + +typedef struct { + /* 0x00 */ u8 mode; + /* 0x04 */ f32 scale; + /* 0x08 */ f32 lodProportion; // expected to be between 0.0f and 1.0f + /* 0x0C */ Color_RGBA8_u32 primColor; + /* 0x10 */ Color_RGBA8_u32 envColor; +} Struct_80140E80; // size = 0x14 typedef struct { /* 0x00 */ s32 unk0; diff --git a/include/z64light.h b/include/z64light.h index d9404ab4c..8eaebca61 100644 --- a/include/z64light.h +++ b/include/z64light.h @@ -13,7 +13,7 @@ typedef struct { /* 0x0C */ u8 diffuseColor[3]; /* 0x0F */ u8 fogColor[3]; /* 0x12 */ s16 fogNear; - /* 0x14 */ s16 fogFar; + /* 0x14 */ s16 zFar; } LightSettings; // size = 0x16 typedef struct { @@ -22,7 +22,7 @@ typedef struct { /* 0x0C */ s16 diffuseColor2[3]; /* 0x12 */ s16 fogColor[3]; /* 0x18 */ s16 fogNear; - /* 0x1A */ s16 fogFar; + /* 0x1A */ s16 zFar; } EnvLightSettings; // size = 0x1C typedef struct { @@ -74,11 +74,9 @@ typedef struct LightsBuffer { typedef struct LightContext { /* 0x0 */ LightNode* listHead; /* 0x4 */ Color_RGB8 ambient; - /* 0x7 */ u8 unk7; - /* 0x8 */ u8 unk8; - /* 0x9 */ u8 unk9; - /* 0xA */ s16 unkA; - /* 0xC */ s16 unkC; + /* 0x7 */ Color_RGB8 fogColor; + /* 0xA */ s16 fogNear; // how close until fog starts taking effect. range 0 - 996 + /* 0xC */ s16 zFar; // draw distance. range 0 - 12800 } LightContext; // size = 0x10 typedef enum LightType { diff --git a/include/z64math.h b/include/z64math.h index 323042b15..70a115966 100644 --- a/include/z64math.h +++ b/include/z64math.h @@ -117,7 +117,8 @@ typedef struct { #define RADF_TO_BINANG(radf) (s16)((radf) * (0x8000 / M_PI)) #define RADF_TO_DEGF(radf) ((radf) * (180.0f / M_PI)) #define DEGF_TO_RADF(degf) ((degf) * (M_PI / 180.0f)) -#define BINANG_TO_RAD(binang) (((f32)binang / 0x8000) * M_PI) +#define BINANG_TO_RAD(binang) ((f32)binang * (M_PI / 0x8000)) +#define BINANG_TO_RAD_ALT(binang) (((f32)binang / 0x8000) * M_PI) // Angle arithmetic macros #define BINANG_ROT180(angle) ((s16)(angle + 0x8000)) diff --git a/include/z64player.h b/include/z64player.h index e99b261ce..96abf00c8 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -745,7 +745,7 @@ typedef enum PlayerCsMode { #define PLAYER_STATE3_2000 (1 << 13) // #define PLAYER_STATE3_4000 (1 << 14) -// +// Swimming Zora #define PLAYER_STATE3_8000 (1 << 15) // #define PLAYER_STATE3_10000 (1 << 16) diff --git a/include/z64quake.h b/include/z64quake.h index a1272941d..f0bd401fc 100644 --- a/include/z64quake.h +++ b/include/z64quake.h @@ -47,9 +47,9 @@ s32 Quake_NumActiveQuakes(void); void Quake_Init(void); #define DISTORTION_TYPE_0 (1 << 0) -#define DISTORTION_TYPE_2 (1 << 2) -#define DISTORTION_TYPE_3 (1 << 3) -#define DISTORTION_TYPE_4 (1 << 4) +#define DISTORTION_TYPE_NON_ZORA_SWIMMING (1 << 2) +#define DISTORTION_TYPE_ZORA_SWIMMING (1 << 3) +#define DISTORTION_TYPE_UNDERWATER_ENTRY (1 << 4) #define DISTORTION_TYPE_5 (1 << 5) #define DISTORTION_TYPE_6 (1 << 6) #define DISTORTION_TYPE_7 (1 << 7) diff --git a/include/z64save.h b/include/z64save.h index f9083144d..d3f538029 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -253,7 +253,7 @@ typedef struct SavePlayerData { } SavePlayerData; // size = 0x28 typedef struct Save { - /* 0x0000 */ u32 entrance; // "scene_no" + /* 0x0000 */ s32 entrance; // "scene_no" /* 0x0004 */ u8 equippedMask; // "player_mask" /* 0x0005 */ u8 isFirstCycle; // "opening_flag" /* 0x0006 */ u8 unk_06; diff --git a/include/z64scene.h b/include/z64scene.h index 025726ed0..41198af71 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -341,6 +341,7 @@ typedef struct { /* 0xA */ u8 unk_A; /* 0xB */ u8 drawConfig; /* 0xC */ u8 unk_C; + /* 0xD */ u8 unk_D; } SceneTableEntry; // size = 0x10 typedef struct { diff --git a/include/z64snap.h b/include/z64snap.h index fb3f86186..4f9dca9d4 100644 --- a/include/z64snap.h +++ b/include/z64snap.h @@ -11,36 +11,36 @@ typedef struct { /* 0x144 */ PictoValidationFunc validationFunc; } PictoActor; -// Picto box flags +// Picto validation flags typedef enum { // Used externally, set and read by actors - /* 0x00 */ PICTOGRAPH_0, - /* 0x01 */ PICTOGRAPH_IN_SWAMP, - /* 0x02 */ PICTOGRAPH_MONKEY, - /* 0x03 */ PICTOGRAPH_BIG_OCTO, - /* 0x04 */ PICTOGRAPH_LULU_HEAD, - /* 0x05 */ PICTOGRAPH_LULU_RIGHT_ARM, - /* 0x06 */ PICTOGRAPH_LULU_LEFT_ARM, // Need all three of these to qualify as a good picture - /* 0x07 */ PICTOGRAPH_SCARECROW, - /* 0x08 */ PICTOGRAPH_TINGLE, - /* 0x09 */ PICTOGRAPH_PIRATE_GOOD, - /* 0x0A */ PICTOGRAPH_DEKU_KING, - /* 0x0B */ PICTOGRAPH_PIRATE_TOO_FAR, // overlaps with PICTOGRAPH_PIRATE_GOOD, but that is checked first + /* 0x00 */ PICTO_VALID_0, + /* 0x01 */ PICTO_VALID_IN_SWAMP, + /* 0x02 */ PICTO_VALID_MONKEY, + /* 0x03 */ PICTO_VALID_BIG_OCTO, + /* 0x04 */ PICTO_VALID_LULU_HEAD, + /* 0x05 */ PICTO_VALID_LULU_RIGHT_ARM, + /* 0x06 */ PICTO_VALID_LULU_LEFT_ARM, // Need all three of these to qualify as a good picture + /* 0x07 */ PICTO_VALID_SCARECROW, + /* 0x08 */ PICTO_VALID_TINGLE, + /* 0x09 */ PICTO_VALID_PIRATE_GOOD, + /* 0x0A */ PICTO_VALID_DEKU_KING, + /* 0x0B */ PICTO_VALID_PIRATE_TOO_FAR, // overlaps with PICTO_VALID_PIRATE_GOOD, but that is checked first // Used internally, test for failures of position, angle etc. - /* 0x3B */ PICTOGRAPH_BEHIND_COLLISION = 0x3B, - /* 0x3C */ PICTOGRAPH_BEHIND_BG, - /* 0x3D */ PICTOGRAPH_NOT_IN_VIEW, - /* 0x3E */ PICTOGRAPH_BAD_ANGLE, - /* 0x3F */ PICTOGRAPH_BAD_DISTANCE -} PictographFlag; - -// The following macros are subject to renaming once the capture system is better understood -#define PICTO_RESOLUTION_HORIZONTAL 150 -#define PICTO_RESOLUTION_VERTICAL 105 -#define PICTO_CAPTURE_REGION_TOPLEFT_X ((SCREEN_WIDTH - PICTO_RESOLUTION_HORIZONTAL) / 2) -#define PICTO_CAPTURE_REGION_TOPLEFT_Y ((SCREEN_HEIGHT - PICTO_RESOLUTION_VERTICAL) / 2) + /* 0x3B */ PICTO_VALID_BEHIND_COLLISION = 0x3B, + /* 0x3C */ PICTO_VALID_BEHIND_BG, + /* 0x3D */ PICTO_VALID_NOT_IN_VIEW, + /* 0x3E */ PICTO_VALID_BAD_ANGLE, + /* 0x3F */ PICTO_VALID_BAD_DISTANCE +} PictoValidFlag; + +// The subregion of the picto photo that will set the flag for an actor being in the photo +#define PICTO_VALID_WIDTH 150 +#define PICTO_VALID_HEIGHT 105 +#define PICTO_VALID_TOPLEFT_X ((SCREEN_WIDTH - PICTO_VALID_WIDTH) / 2) +#define PICTO_VALID_TOPLEFT_Y ((SCREEN_HEIGHT - PICTO_VALID_HEIGHT) / 2) s32 Snap_RecordPictographedActors(PlayState* play); void Snap_SetFlag(s32 flag); diff --git a/include/z64transition.h b/include/z64transition.h index 45178ba8e..98720e9a7 100644 --- a/include/z64transition.h +++ b/include/z64transition.h @@ -1,8 +1,14 @@ -#ifndef _Z64_TRANSITION_H_ -#define _Z64_TRANSITION_H_ +#ifndef Z64_TRANSITION_H +#define Z64_TRANSITION_H #include "ultra64.h" +#include "overlays/fbdemos/ovl_fbdemo_triforce/z_fbdemo_triforce.h" +#include "overlays/fbdemos/ovl_fbdemo_wipe1/z_fbdemo_wipe1.h" +#include "overlays/fbdemos/ovl_fbdemo_wipe3/z_fbdemo_wipe3.h" +#include "overlays/fbdemos/ovl_fbdemo_wipe4/z_fbdemo_wipe4.h" +#include "overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.h" + #define TC_SET_PARAMS (1 << 7) typedef struct { @@ -32,22 +38,6 @@ typedef struct { /* 0x14 */ TransitionInit* initInfo; /* 0x18 */ size_t size; } TransitionOverlay; - -typedef struct { - /* 0x000 */ s16 transitionType; - /* 0x002 */ s8 fbdemoType; - /* 0x003 */ char unk_003[0x22B]; - /* 0x230 */ void* (*init)(void* transition); - /* 0x234 */ void (*destroy)(void* transition); - /* 0x238 */ void (*update)(void* transition, s32 updateRate); - /* 0x23C */ void (*draw)(void* transition, Gfx** gfxP); - /* 0x240 */ void (*start)(void* transition); - /* 0x244 */ void (*setType)(void* transition, s32 type); - /* 0x248 */ void (*setColor)(void* transition, u32 color); - /* 0x24C */ void (*setEnvColor)(void* transition, u32 color); - /* 0x250 */ s32 (*isDone)(void* transition); - /* 0x254 */ char unk_254[0x4]; -} TransitionContext; // size = 0x258 typedef struct { /* 0x0 */ char unk_0[0xC]; @@ -76,4 +66,107 @@ typedef struct { /* 0x1F */ s8 unk_1F; // Set to 0 and never used } TransitionCircle; // size = 0x20 +#define TRANS_TRIGGER_OFF 0 // transition is not active +#define TRANS_TRIGGER_START 20 // start transition (exiting an area) +#define TRANS_TRIGGER_END -20 // transition is ending (arriving in a new area) + +typedef enum { + /* 0 */ TRANS_MODE_OFF, + /* 1 */ TRANS_MODE_SETUP, + /* 2 */ TRANS_MODE_INSTANCE_INIT, + /* 3 */ TRANS_MODE_INSTANCE_RUNNING, + /* 4 */ TRANS_MODE_FILL_WHITE_INIT, + /* 5 */ TRANS_MODE_FILL_IN, + /* 6 */ TRANS_MODE_FILL_OUT, + /* 7 */ TRANS_MODE_FILL_BROWN_INIT, + /* 8 */ TRANS_MODE_08, // unused + /* 9 */ TRANS_MODE_09, // unused + /* 10 */ TRANS_MODE_INSTANT, + /* 11 */ TRANS_MODE_INSTANCE_WAIT, + /* 12 */ TRANS_MODE_SANDSTORM_INIT, + /* 13 */ TRANS_MODE_SANDSTORM, + /* 14 */ TRANS_MODE_SANDSTORM_END_INIT, + /* 15 */ TRANS_MODE_SANDSTORM_END, + /* 16 */ TRANS_MODE_CS_BLACK_FILL_INIT, + /* 17 */ TRANS_MODE_CS_BLACK_FILL +} TransitionMode; + +#define TRANS_TYPE_WIPE4 (1 << 5) +#define TRANS_TYPE_WIPE3 (1 << 6) +#define TRANS_TYPE_SET_PARAMS (1 << 7) + +typedef enum { + /* 0 */ TRANS_TYPE_WIPE, + /* 1 */ TRANS_TYPE_TRIFORCE, + /* 2 */ TRANS_TYPE_FADE_BLACK, + /* 3 */ TRANS_TYPE_FADE_WHITE, + /* 4 */ TRANS_TYPE_FADE_BLACK_FAST, + /* 5 */ TRANS_TYPE_FADE_WHITE_FAST, + /* 6 */ TRANS_TYPE_FADE_BLACK_SLOW, + /* 7 */ TRANS_TYPE_FADE_WHITE_SLOW, + /* 8 */ TRANS_TYPE_WIPE_FAST, + /* 9 */ TRANS_TYPE_FILL_WHITE_FAST, // Not actually fast due to bug in Play_UpdateTransition + /* 10 */ TRANS_TYPE_FILL_WHITE, + /* 11 */ TRANS_TYPE_INSTANT, + /* 12 */ TRANS_TYPE_FILL_BROWN, + /* 13 */ TRANS_TYPE_FADE_WHITE_CS_DELAYED, + /* 14 */ TRANS_TYPE_SANDSTORM_PERSIST, + /* 15 */ TRANS_TYPE_SANDSTORM_END, + /* 16 */ TRANS_TYPE_CS_BLACK_FILL, + /* 17 */ TRANS_TYPE_FADE_WHITE_INSTANT, + /* 18 */ TRANS_TYPE_FADE_GREEN, + /* 19 */ TRANS_TYPE_FADE_BLUE, + /* 20 */ TRANS_TYPE_FADE_DYNAMIC, // Chooses Black or White based on time of day + /* 21 */ TRANS_TYPE_CIRCLE, + /* 22 */ TRANS_TYPE_WIPE5, + // transition types 23 - 31 are unused + // transition types 32 - 39 are Wipe4 TODO needs macro + // transition types 40 - 63 are unused + // transition types 64 - 127 are Wipe3 TODO needs macro + /* 64 */ TRANS_TYPE_64 = 64, + /* 70 */ TRANS_TYPE_70 = 70, + /* 72 */ TRANS_TYPE_72 = 72, + /* 73 */ TRANS_TYPE_73, + /* 80 */ TRANS_TYPE_80 = 80, + /* 86 */ TRANS_TYPE_86 = 86 +} TransitionType; + +typedef enum { + /* 0 */ FBDEMO_FADE, + /* 1 */ FBDEMO_TRIFORCE, + /* 2 */ FBDEMO_WIPE1, + /* 3 */ FBDEMO_WIPE3, + /* 4 */ FBDEMO_WIPE4, + /* 5 */ FBDEMO_CIRCLE, + /* 6 */ FBDEMO_WIPE5 +} FbDemoType; + +#define TRANS_NEXT_TYPE_DEFAULT 0xFF + +typedef struct { + /* 0x000 */ s16 transitionType; + /* 0x002 */ s8 fbdemoType; + /* 0x003 */ char unk_003[0x5]; + /* 0x008 */ union { + TransitionFade fade; + TransitionCircle circle; + TransitionTriforce triforce; + TransitionWipe1 wipe1; + TransitionWipe3 wipe3; + TransitionWipe4 wipe4; + TransitionWipe5 wipe5; + } instanceData; + /* 0x220 */ char unk_220[0x10]; + /* 0x230 */ void* (*init)(void* transition); + /* 0x234 */ void (*destroy)(void* transition); + /* 0x238 */ void (*update)(void* transition, s32 updateRate); + /* 0x23C */ void (*draw)(void* transition, Gfx** gfxP); + /* 0x240 */ void (*start)(void* transition); + /* 0x244 */ void (*setType)(void* transition, s32 type); + /* 0x248 */ void (*setColor)(void* transition, u32 color); + /* 0x24C */ void (*setEnvColor)(void* transition, u32 color); + /* 0x250 */ s32 (*isDone)(void* transition); + /* 0x254 */ char unk_254[0x4]; +} TransitionContext; // size = 0x258 + #endif |
