Add a z64play.h header (#1646)

* z64play.h

* Move macros, functions and variables to header

* cleanup

* Reduce needed headers on z_collision_check

* Change play functions to take PlayState

* Move `Actor_ProcessInitChain` to `ichain.h`

* format

* Update src/code/z_play.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Add macros.h to sys_math3d.c

* Rename SequenceContext to SceneSequences

---------

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
This commit is contained in:
Anghelo Carvajal 2024-06-25 15:17:03 -04:00 committed by GitHub
parent 0bb57352a5
commit 6541532abb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
51 changed files with 558 additions and 508 deletions

View File

@ -6,4 +6,4 @@ def apply(config, args):
config['mapfile'] = 'build/n64-us/mm-n64-us.map'
config['source_directories'] = ['./src','./include']
config['objdump_flags'] = ['-M','reg-names=32']
config['makeflags'] = ['KEEP_MDEBUG=1']
config['makeflags'] = ['KEEP_MDEBUG=1', 'WERROR=0', 'OBJDUMP_BUILD=0']

View File

@ -26,7 +26,7 @@ typedef struct {
} Color_RGB16; // size = 0x6
// only use when necessary for alignment purposes
typedef union {
typedef union Color_RGBA8_u32 {
struct {
u8 r, g, b, a;
};

View File

@ -264,57 +264,6 @@ void Inventory_IncrementSkullTokenCount(s16 sceneIndex);
s16 Inventory_GetSkullTokenCount(s16 sceneIndex);
void Inventory_SaveLotteryCodeGuess(PlayState* play);
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 Play_Update(PlayState* this);
void Play_Draw(PlayState* this);
void Play_Main(GameState* thisx);
bool Play_InCsMode(PlayState* this);
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);
s32 Play_ChangeCameraStatus(PlayState* this, s16 camId, s16 status);
void Play_ClearCamera(PlayState* this, s16 camId);
Camera* Play_GetCamera(PlayState* this, s16 camId);
s32 Play_SetCameraAtEye(PlayState* this, s16 camId, Vec3f* at, Vec3f* eye);
s32 Play_SetCameraAtEyeUp(PlayState* this, s16 camId, Vec3f* at, Vec3f* eye, Vec3f* up);
s32 Play_SetCameraFov(PlayState* this, s16 camId, f32 fov);
s32 Play_SetCameraRoll(PlayState* this, s16 camId, s16 roll);
void Play_CopyCamera(PlayState* this, s16 destCamId, s16 srcCamId);
s32 func_80169A50(PlayState* this, s16 camId, Player* player, s16 setting);
s32 Play_ChangeCameraSetting(PlayState* this, s16 camId, s16 setting);
void func_80169AFC(PlayState* this, s16 camId, s16 timer);
u16 Play_GetActorCsCamSetting(PlayState* this, s32 csCamDataIndex);
Vec3s* Play_GetActorCsCamFuncData(PlayState* this, s32 csCamDataIndex);
s16 Play_GetOriginalSceneId(s16 sceneId);
void Play_SaveCycleSceneFlags(GameState* thisx);
void Play_SetRespawnData(GameState* thisx, s32 respawnMode, u16 entrance, s32 roomIndex, s32 playerParams, Vec3f* pos, s16 yaw);
void Play_SetupRespawnPoint(GameState* thisx, s32 respawnMode, s32 playerParams);
void func_80169EFC(GameState* thisx);
void func_80169F78(GameState* thisx);
void func_80169FDC(GameState* thisx);
s32 Play_CamIsNotFixed(GameState* thisx);
s32 FrameAdvance_IsEnabled(GameState* thisx);
s32 func_8016A02C(GameState* thisx, Actor* actor, s16* yaw);
s32 Play_IsUnderwater(PlayState* this, Vec3f* pos);
s32 Play_IsDebugCamEnabled(void);
void Play_AssignPlayerCsIdsFromScene(GameState* thisx, s32 spawnCsId);
void Play_FillScreen(GameState* thisx, s16 fillScreenOn, u8 red, u8 green, u8 blue, u8 alpha);
void Play_Init(GameState* thisx);
void Graph_FaultClient(void);
void Graph_InitTHGA(TwoHeadGfxArena* arena, Gfx* buffer, s32 size);
void Graph_SetNextGfxPool(GraphicsContext* gfxCtx);

View File

@ -55,4 +55,8 @@ typedef enum {
#define ICHAIN_CONTINUE 1
#define ICHAIN_STOP 0
struct Actor;
void Actor_ProcessInitChain(struct Actor* actor, struct InitChainEntry* ichain);
#endif

View File

@ -2,7 +2,6 @@
#define MACROS_H
#include "stdint.h"
#include "PR/os_convert.h"
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
@ -20,12 +19,6 @@
#define ARRAY_COUNT_2D(arr) (ARRAY_COUNT(arr) * ARRAY_COUNT(arr[0]))
#define GET_ACTIVE_CAM(play) ((play)->cameraPtrs[(play)->activeCamId])
#define GET_PLAYER(play) ((Player*)(play)->actorCtx.actorLists[ACTORCAT_PLAYER].first)
#define GET_FIRST_ENEMY(play) ((Actor*)(play)->actorCtx.actorLists[ACTORCAT_ENEMY].first)
#define CLOCK_TIME(hr, min) (s32)(((hr) * 60 + (min)) * 0x10000 / (24 * 60))
#define CLOCK_TIME_MINUTE (CLOCK_TIME(0, 1))
#define CLOCK_TIME_HOUR (CLOCK_TIME(1, 0))

View File

@ -23,8 +23,6 @@ extern s16 gItemPrices[];
extern u16 gSceneIdsPerRegion[11][27];
extern u8 gPlayerFormItemRestrictions[PLAYER_FORM_MAX][114];
extern s32 gDbgCamEnabled;
extern s16 gLowPassFilterData[];
extern s16 gHighPassFilterData[];
extern s16 gBandStopFilterData[];
@ -62,9 +60,6 @@ extern u8 gSampleBankTable[];
// bss
extern s32 gTransitionTileState;
extern Color_RGBA8_u32 gPlayVisMonoColor;
extern GfxMasterList* gGfxMasterDL;
extern u64* gAudioSPDataPtr;

View File

@ -59,6 +59,7 @@
#include "z64object.h"
#include "z64ocarina.h"
#include "z64pause_menu.h"
#include "z64play.h"
#include "z64player.h"
#include "z64prerender.h"
#include "z64save.h"
@ -73,110 +74,4 @@
#include "z64transition.h"
#include "z64view.h"
typedef struct {
/* 0x0 */ u8 seqId;
/* 0x1 */ u8 ambienceId;
} SequenceContext; // size = 0x2
typedef struct PlayState {
/* 0x00000 */ GameState state;
/* 0x000A4 */ s16 sceneId;
/* 0x000A6 */ u8 sceneConfig;
/* 0x000A7 */ char unk_A7[0x9];
/* 0x000B0 */ void* sceneSegment;
/* 0x000B4 */ char unk_B4[0x4];
/* 0x000B8 */ View view;
/* 0x00220 */ Camera mainCamera;
/* 0x00398 */ Camera subCameras[NUM_CAMS - CAM_ID_SUB_FIRST];
/* 0x00800 */ Camera* cameraPtrs[NUM_CAMS];
/* 0x00810 */ s16 activeCamId;
/* 0x00812 */ s16 nextCamera;
/* 0x00814 */ SequenceContext sequenceCtx;
/* 0x00818 */ LightContext lightCtx;
/* 0x00828 */ FrameAdvanceContext frameAdvCtx;
/* 0x00830 */ CollisionContext colCtx;
/* 0x01CA0 */ ActorContext actorCtx;
/* 0x01F24 */ CutsceneContext csCtx;
/* 0x01F78 */ SoundSource soundSources[SOUND_SOURCE_COUNT];
/* 0x02138 */ EffFootmark footprintInfo[100];
/* 0x046B8 */ SramContext sramCtx;
/* 0x046E0 */ SkyboxContext skyboxCtx;
/* 0x04908 */ MessageContext msgCtx;
/* 0x169E8 */ InterfaceContext interfaceCtx;
/* 0x16D30 */ PauseContext pauseCtx;
/* 0x17000 */ GameOverContext gameOverCtx;
/* 0x17004 */ EnvironmentContext envCtx;
/* 0x17104 */ AnimationContext animationCtx;
/* 0x17D88 */ ObjectContext objectCtx;
/* 0x186E0 */ RoomContext roomCtx;
/* 0x18760 */ TransitionActorList transitionActors;
/* 0x18768 */ void (*playerInit)(Player* player, struct PlayState* play, FlexSkeletonHeader* skelHeader);
/* 0x1876C */ void (*playerUpdate)(Player* player, struct PlayState* play, Input* input);
/* 0x18770 */ void (*unk_18770)(struct PlayState* play, Player* player);
/* 0x18774 */ s32 (*startPlayerFishing)(struct PlayState* play);
/* 0x18778 */ s32 (*grabPlayer)(struct PlayState* play, Player* player);
/* 0x1877C */ s32 (*tryPlayerCsAction)(struct PlayState* play, Player* player, PlayerCsAction csAction);
/* 0x18780 */ void (*func_18780)(Player* player, struct PlayState* play);
/* 0x18784 */ s32 (*damagePlayer)(struct PlayState* play, s32 damage);
/* 0x18788 */ void (*talkWithPlayer)(struct PlayState* play, Actor* actor);
/* 0x1878C */ void (*unk_1878C)(struct PlayState* play);
/* 0x18790 */ void (*unk_18790)(struct PlayState* play, s16 arg1);
/* 0x18794 */ PlayerItemAction (*unk_18794)(struct PlayState* play, Player* player, ItemId itemId);
/* 0x18798 */ s32 (*setPlayerTalkAnim)(struct PlayState* play, PlayerAnimationHeader* talkAnim, AnimationMode animMode);
/* 0x1879C */ s16 playerCsIds[PLAYER_CS_ID_MAX];
/* 0x187B0 */ MtxF viewProjectionMtxF;
/* 0x187F0 */ Vec3f projectionMtxFDiagonal;
/* 0x187FC */ MtxF billboardMtxF;
/* 0x1883C */ Mtx* billboardMtx;
/* 0x18840 */ u32 gameplayFrames;
/* 0x18844 */ u8 unk_18844; // bool
/* 0x18845 */ u8 haltAllActors;
/* 0x18846 */ s16 numSetupActors;
/* 0x18848 */ u8 numRooms;
/* 0x1884C */ RomFile* roomList;
/* 0x18850 */ ActorEntry* linkActorEntry;
/* 0x18854 */ ActorEntry* setupActorList;
/* 0x18858 */ ActorCsCamInfo* actorCsCamList;
/* 0x1885C */ EntranceEntry* setupEntranceList;
/* 0x18860 */ u16* setupExitList;
/* 0x18864 */ Path* setupPathList;
/* 0x18868 */ void* naviQuestHints; // leftover from OoT, system which processes this is removed
/* 0x1886C */ AnimatedMaterial* sceneMaterialAnims;
/* 0x18870 */ void* specialEffects;
/* 0x18874 */ u8 skyboxId; // @see SkyboxId enum
/* 0x18875 */ s8 transitionTrigger; // "fade_direction"
/* 0x18876 */ s16 worldCoverAlpha;
/* 0x18878 */ s16 bgCoverAlpha;
/* 0x1887A */ u16 nextEntrance;
/* 0x1887C */ s8 unk_1887C; // shootingGalleryStatus?
/* 0x1887D */ s8 unk_1887D;
/* 0x1887E */ s8 unk_1887E;
/* 0x1887F */ u8 transitionType; // fadeTransition
/* 0x18880 */ u8 unk_18880;
/* 0x18884 */ CollisionCheckContext colChkCtx;
/* 0x18B20 */ u16 cutsceneFlags[20];
/* 0x18B48 */ u8 curSpawn;
/* 0x18B49 */ u8 unk_18B49;
/* 0x18B4A */ u8 transitionMode;
/* 0x18B4C */ PreRender pauseBgPreRender;
/* 0x18B9C */ char unk_18B9C[0x54];
/* 0x18BF0 */ TransitionContext transitionCtx;
/* 0x18E48 */ TransitionFade unk_18E48;
/* 0x18E54 */ SceneTableEntry* loadedScene;
/* 0x18E58 */ void* unk_18E58;
/* 0x18E5C */ TexturePtr pictoPhotoI8;
/* 0x18E60 */ void* unk_18E60;
/* 0x18E64 */ void* unk_18E64;
/* 0x18E68 */ void* unk_18E68; // framebuffer related to Lens of Truth
/* 0x18E6C */ char unk_18E6C[0x3EC];
} PlayState; // size = 0x19258
typedef enum {
/* 0 */ PICTO_PHOTO_STATE_OFF,
/* 1 */ PICTO_PHOTO_STATE_SETUP,
/* 2 */ PICTO_PHOTO_STATE_PROCESS,
/* 3 */ PICTO_PHOTO_STATE_READY
} PictoPhotoState;
#endif

View File

@ -34,7 +34,7 @@ typedef enum BombersNotebookEvent {
#undef DEFINE_PERSON
#undef DEFINE_EVENT
typedef struct {
typedef struct BombersNotebook {
/* 0x00 */ u8 loadState;
/* 0x01 */ UNK_TYPE1 pad01[0x3F];
/* 0x40 */ void* scheduleDmaSegment;

View File

@ -272,7 +272,7 @@ typedef struct EnvironmentContext {
/* 0xED */ u8 customSkyboxFilter;
/* 0xEE */ u8 skyboxFilterColor[4];
/* 0xF2 */ u8 precipitation[PRECIP_MAX];
/* 0xF7 */ UNK_TYPE1 unk_FA[9];
/* 0xF7 */ UNK_TYPE1 unk_F7[9];
} EnvironmentContext; // size = 0x100
s32 Environment_ZBufValToFixedPoint(s32 zBufferVal);

View File

@ -4,6 +4,7 @@
#include "ultra64.h"
struct Input;
struct PlayState;
typedef struct FrameAdvanceContext {
@ -14,4 +15,6 @@ typedef struct FrameAdvanceContext {
void FrameAdvance_Init(FrameAdvanceContext* frameAdvCtx);
s32 FrameAdvance_Update(FrameAdvanceContext* frameAdvCtx, struct Input* input);
s32 FrameAdvance_IsEnabled(struct PlayState* this);
#endif

View File

@ -8,14 +8,11 @@
#include "color.h"
#include "z64math.h"
struct Actor;
struct InitChainEntry;
struct Input;
void* Lib_MemCpy(void* dest, void* src, size_t size);
void* Lib_MemSet(void* buffer, s32 value, size_t size);
void Lib_GetControlStickData(f32* outMagnitude, s16* outAngle, struct Input* input);
void Actor_ProcessInitChain(struct Actor* actor, struct InitChainEntry* ichain);
void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src);
void Lib_PlaySfx(u16 sfxId);
void Lib_PlaySfx_2(u16 sfxId);

196
include/z64play.h Normal file
View File

@ -0,0 +1,196 @@
#ifndef Z64PLAY_H
#define Z64PLAY_H
#include "ultra64.h"
#include "z64actor.h"
#include "z64animation.h"
#include "z64bgcheck.h"
#include "z64camera.h"
#include "z64collision_check.h"
#include "z64cutscene.h"
#include "z64eff_footmark.h"
#include "z64environment.h"
#include "z64frameadvance.h"
#include "z64game_over.h"
#include "z64game.h"
#include "z64interface.h"
#include "z64item.h"
#include "z64light.h"
#include "z64math.h"
#include "z64message.h"
#include "z64pause_menu.h"
#include "z64player.h"
#include "z64prerender.h"
#include "z64save.h"
#include "z64scene.h"
#include "z64skybox.h"
#include "z64sound_source.h"
#include "z64transition.h"
#include "z64view.h"
typedef struct SceneSequences {
/* 0x0 */ u8 seqId;
/* 0x1 */ u8 ambienceId;
} SceneSequences; // size = 0x2
typedef struct PlayState {
/* 0x00000 */ GameState state;
/* 0x000A4 */ s16 sceneId;
/* 0x000A6 */ u8 sceneConfig;
/* 0x000A7 */ char unk_A7[0x9];
/* 0x000B0 */ void* sceneSegment;
/* 0x000B8 */ View view;
/* 0x00220 */ Camera mainCamera;
/* 0x00398 */ Camera subCameras[NUM_CAMS - CAM_ID_SUB_FIRST];
/* 0x00800 */ Camera* cameraPtrs[NUM_CAMS];
/* 0x00810 */ s16 activeCamId;
/* 0x00812 */ s16 nextCamera;
/* 0x00814 */ SceneSequences sceneSequences;
/* 0x00818 */ LightContext lightCtx;
/* 0x00828 */ FrameAdvanceContext frameAdvCtx;
/* 0x00830 */ CollisionContext colCtx;
/* 0x01CA0 */ ActorContext actorCtx;
/* 0x01F24 */ CutsceneContext csCtx;
/* 0x01F78 */ SoundSource soundSources[SOUND_SOURCE_COUNT];
/* 0x02138 */ EffFootmark footprintInfo[100];
/* 0x046B8 */ SramContext sramCtx;
/* 0x046E0 */ SkyboxContext skyboxCtx;
/* 0x04908 */ MessageContext msgCtx;
/* 0x169E8 */ InterfaceContext interfaceCtx;
/* 0x16D30 */ PauseContext pauseCtx;
/* 0x17000 */ GameOverContext gameOverCtx;
/* 0x17004 */ EnvironmentContext envCtx;
/* 0x17104 */ AnimationContext animationCtx;
/* 0x17D88 */ ObjectContext objectCtx;
/* 0x186E0 */ RoomContext roomCtx;
/* 0x18760 */ TransitionActorList transitionActors;
/* 0x18768 */ void (*playerInit)(Player* player, struct PlayState* play, FlexSkeletonHeader* skelHeader);
/* 0x1876C */ void (*playerUpdate)(Player* player, struct PlayState* play, Input* input);
/* 0x18770 */ void (*unk_18770)(struct PlayState* play, Player* player);
/* 0x18774 */ s32 (*startPlayerFishing)(struct PlayState* play);
/* 0x18778 */ s32 (*grabPlayer)(struct PlayState* play, Player* player);
/* 0x1877C */ s32 (*tryPlayerCsAction)(struct PlayState* play, Player* player, PlayerCsAction csAction);
/* 0x18780 */ void (*func_18780)(Player* player, struct PlayState* play);
/* 0x18784 */ s32 (*damagePlayer)(struct PlayState* play, s32 damage);
/* 0x18788 */ void (*talkWithPlayer)(struct PlayState* play, Actor* actor);
/* 0x1878C */ void (*unk_1878C)(struct PlayState* play);
/* 0x18790 */ void (*unk_18790)(struct PlayState* play, s16 arg1);
/* 0x18794 */ PlayerItemAction (*unk_18794)(struct PlayState* play, Player* player, ItemId itemId);
/* 0x18798 */ s32 (*setPlayerTalkAnim)(struct PlayState* play, PlayerAnimationHeader* talkAnim, AnimationMode animMode);
/* 0x1879C */ s16 playerCsIds[PLAYER_CS_ID_MAX];
/* 0x187B0 */ MtxF viewProjectionMtxF;
/* 0x187F0 */ Vec3f projectionMtxFDiagonal;
/* 0x187FC */ MtxF billboardMtxF;
/* 0x1883C */ Mtx* billboardMtx;
/* 0x18840 */ u32 gameplayFrames;
/* 0x18844 */ u8 unk_18844; // bool
/* 0x18845 */ u8 haltAllActors;
/* 0x18846 */ s16 numSetupActors;
/* 0x18848 */ u8 numRooms;
/* 0x1884C */ RomFile* roomList;
/* 0x18850 */ ActorEntry* linkActorEntry;
/* 0x18854 */ ActorEntry* setupActorList;
/* 0x18858 */ ActorCsCamInfo* actorCsCamList;
/* 0x1885C */ EntranceEntry* setupEntranceList;
/* 0x18860 */ u16* setupExitList;
/* 0x18864 */ Path* setupPathList;
/* 0x18868 */ void* naviQuestHints; // leftover from OoT, system which processes this is removed
/* 0x1886C */ AnimatedMaterial* sceneMaterialAnims;
/* 0x18870 */ void* specialEffects;
/* 0x18874 */ u8 skyboxId; // @see SkyboxId enum
/* 0x18875 */ s8 transitionTrigger; // "fade_direction"
/* 0x18876 */ s16 worldCoverAlpha;
/* 0x18878 */ s16 bgCoverAlpha;
/* 0x1887A */ u16 nextEntrance;
/* 0x1887C */ s8 unk_1887C; // shootingGalleryStatus?
/* 0x1887D */ s8 unk_1887D;
/* 0x1887E */ s8 unk_1887E;
/* 0x1887F */ u8 transitionType; // fadeTransition
/* 0x18880 */ u8 unk_18880;
/* 0x18884 */ CollisionCheckContext colChkCtx;
/* 0x18B20 */ u16 cutsceneFlags[20];
/* 0x18B48 */ u8 curSpawn;
/* 0x18B49 */ u8 unk_18B49;
/* 0x18B4A */ u8 transitionMode;
/* 0x18B4C */ PreRender pauseBgPreRender;
/* 0x18B9C */ char unk_18B9C[0x54];
/* 0x18BF0 */ TransitionContext transitionCtx;
/* 0x18E48 */ TransitionFade unk_18E48;
/* 0x18E54 */ SceneTableEntry* loadedScene;
/* 0x18E58 */ void* unk_18E58;
/* 0x18E5C */ TexturePtr pictoPhotoI8;
/* 0x18E60 */ void* unk_18E60;
/* 0x18E64 */ void* unk_18E64;
/* 0x18E68 */ void* unk_18E68; // framebuffer related to Lens of Truth
/* 0x18E6C */ char unk_18E6C[0x3EC];
} PlayState; // size = 0x19258
typedef enum PictoPhotoState {
/* 0 */ PICTO_PHOTO_STATE_OFF,
/* 1 */ PICTO_PHOTO_STATE_SETUP,
/* 2 */ PICTO_PHOTO_STATE_PROCESS,
/* 3 */ PICTO_PHOTO_STATE_READY
} PictoPhotoState;
#define GET_ACTIVE_CAM(play) ((play)->cameraPtrs[(play)->activeCamId])
#define GET_PLAYER(play) ((Player*)(play)->actorCtx.actorLists[ACTORCAT_PLAYER].first)
#define GET_FIRST_ENEMY(play) ((Actor*)(play)->actorCtx.actorLists[ACTORCAT_ENEMY].first)
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 Play_Update(PlayState* this);
void Play_Draw(PlayState* this);
void Play_Main(GameState* thisx);
bool Play_InCsMode(PlayState* this);
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);
s32 Play_ChangeCameraStatus(PlayState* this, s16 camId, s16 status);
void Play_ClearCamera(PlayState* this, s16 camId);
Camera* Play_GetCamera(PlayState* this, s16 camId);
s32 Play_SetCameraAtEye(PlayState* this, s16 camId, Vec3f* at, Vec3f* eye);
s32 Play_SetCameraAtEyeUp(PlayState* this, s16 camId, Vec3f* at, Vec3f* eye, Vec3f* up);
s32 Play_SetCameraFov(PlayState* this, s16 camId, f32 fov);
s32 Play_SetCameraRoll(PlayState* this, s16 camId, s16 roll);
void Play_CopyCamera(PlayState* this, s16 destCamId, s16 srcCamId);
s32 func_80169A50(PlayState* this, s16 camId, Player* player, s16 setting);
s32 Play_ChangeCameraSetting(PlayState* this, s16 camId, s16 setting);
void func_80169AFC(PlayState* this, s16 camId, s16 timer);
u16 Play_GetActorCsCamSetting(PlayState* this, s32 csCamDataIndex);
Vec3s* Play_GetActorCsCamFuncData(PlayState* this, s32 csCamDataIndex);
s16 Play_GetOriginalSceneId(s16 sceneId);
void Play_SaveCycleSceneFlags(PlayState* this);
void Play_SetRespawnData(PlayState* this, s32 respawnMode, u16 entrance, s32 roomIndex, s32 playerParams, Vec3f* pos, s16 yaw);
void Play_SetupRespawnPoint(PlayState* this, s32 respawnMode, s32 playerParams);
void func_80169EFC(PlayState* this);
void func_80169F78(PlayState* this);
void func_80169FDC(PlayState* this);
s32 Play_CamIsNotFixed(PlayState* this);
s32 func_8016A02C(PlayState* this, Actor* actor, s16* yaw);
s32 Play_IsUnderwater(PlayState* this, Vec3f* pos);
s32 Play_IsDebugCamEnabled(void);
void Play_AssignPlayerCsIdsFromScene(PlayState* this, s32 spawnCsId);
void Play_FillScreen(PlayState* this, s16 fillScreenOn, u8 red, u8 green, u8 blue, u8 alpha);
void Play_Init(GameState* thisx);
extern s32 gDbgCamEnabled;
extern s32 gTransitionTileState;
extern Color_RGBA8_u32 gPlayVisMonoColor;
#endif

View File

@ -2,6 +2,7 @@
* Maths library: two factorials, integer power, wrappers for libultra's sins and coss (the main ones used), and some
* random functions moved from OoT's z_actor
*/
#include "global.h"
static f32 sFactorialTbl[] = {

View File

@ -38,11 +38,11 @@ struct Dummy227 { int x; };
#include "PR/gu.h"
// The bss index at this point should be 184
#include "macros.h"
Vec3f gZeroVec3f = { 0.0f, 0.0f, 0.0f };
Vec3s gZeroVec3s = { 0, 0, 0 };
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
f32 Math3D_Normalize(Vec3f* vec) {
f32 magnitude = Math3D_Vec3fMagnitude(vec);

View File

@ -3184,7 +3184,7 @@ void Actor_CleanupContext(ActorContext* actorCtx, PlayState* play) {
actorCtx->absoluteSpace = NULL;
}
Play_SaveCycleSceneFlags(&play->state);
Play_SaveCycleSceneFlags(play);
ActorOverlayTable_Cleanup();
}

File diff suppressed because it is too large Load Diff

View File

@ -440,7 +440,7 @@ void CutsceneCmd_FadeOutSequence(PlayState* play, CutsceneContext* csCtx, CsCmdF
void CutsceneCmd_StartAmbience(PlayState* play, CutsceneContext* csCtx, CsCmdStartAmbience* cmd) {
if (csCtx->curFrame == cmd->startFrame) {
Audio_PlayAmbience(play->sequenceCtx.ambienceId);
Audio_PlayAmbience(play->sceneSequences.ambienceId);
}
}

View File

@ -166,7 +166,7 @@ void Effect_Add(PlayState* play, s32* pIndex, EffectType type, u8 arg3, u8 arg4,
*pIndex = TOTAL_EFFECT_COUNT;
if (FrameAdvance_IsEnabled(&play->state) != true) {
if (FrameAdvance_IsEnabled(play) != true) {
slotFound = false;
switch (type) {
case EFFECT_SPARK:

View File

@ -159,7 +159,7 @@ s32 EffectSS_FindFreeSpace(s32 priority, s32* tableEntry) {
void EffectSS_Copy(PlayState* play, EffectSs* effectsSs) {
s32 index;
if (FrameAdvance_IsEnabled(&play->state) != true) {
if (FrameAdvance_IsEnabled(play) != true) {
if (EffectSS_FindFreeSpace(effectsSs->priority, &index) == 0) {
sEffectSsInfo.searchIndex = index + 1;
sEffectSsInfo.dataTable[index] = *effectsSs;

View File

@ -75,7 +75,7 @@ void GameOver_Update(PlayState* play) {
case GAMEOVER_DEATH_FADE_OUT:
if (AudioSeq_GetActiveSeqId(SEQ_PLAYER_FANFARE) != NA_BGM_GAME_OVER) {
func_80169F78(&play->state);
func_80169F78(play);
if (gSaveContext.respawnFlag != -7) {
gSaveContext.respawnFlag = -6;
}

View File

@ -1204,7 +1204,7 @@ void Environment_UpdateTime(PlayState* play, EnvironmentContext* envCtx, PauseCo
(msgCtx->currentTextId == 0x140C) ||
((msgCtx->currentTextId >= 0x100) && (msgCtx->currentTextId <= 0x200)) ||
(gSaveContext.gameMode == GAMEMODE_END_CREDITS)) {
if (!FrameAdvance_IsEnabled(&play->state) &&
if (!FrameAdvance_IsEnabled(play) &&
((play->transitionMode == TRANS_MODE_OFF) || (gSaveContext.gameMode != GAMEMODE_NORMAL))) {
if (play->transitionTrigger == TRANS_TRIGGER_OFF) {
if ((CutsceneManager_GetCurrentCsId() == CS_ID_NONE) && !Play_InCsMode(play)) {
@ -2436,28 +2436,28 @@ void Environment_PlaySceneSequence(PlayState* play) {
gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX;
} else if (!Environment_IsFinalHours(play) || func_800FE5D0(play) ||
(AudioSeq_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) != NA_BGM_FINAL_HOURS)) {
if (play->sequenceCtx.seqId == NA_BGM_NO_MUSIC) {
if (play->sequenceCtx.ambienceId == AMBIENCE_ID_13) {
if (play->sceneSequences.seqId == NA_BGM_NO_MUSIC) {
if (play->sceneSequences.ambienceId == AMBIENCE_ID_13) {
return;
}
if (play->sequenceCtx.ambienceId != ((void)0, gSaveContext.ambienceId)) {
Audio_PlayAmbience(play->sequenceCtx.ambienceId);
if (play->sceneSequences.ambienceId != ((void)0, gSaveContext.ambienceId)) {
Audio_PlayAmbience(play->sceneSequences.ambienceId);
}
} else if (play->sequenceCtx.ambienceId == AMBIENCE_ID_13) {
if (play->sequenceCtx.seqId != ((void)0, gSaveContext.seqId)) {
Audio_PlaySceneSequence(play->sequenceCtx.seqId, dayMinusOne);
} else if (play->sceneSequences.ambienceId == AMBIENCE_ID_13) {
if (play->sceneSequences.seqId != ((void)0, gSaveContext.seqId)) {
Audio_PlaySceneSequence(play->sceneSequences.seqId, dayMinusOne);
}
} else if ((CURRENT_TIME >= CLOCK_TIME(6, 0)) && (CURRENT_TIME <= CLOCK_TIME(17, 10))) {
if (gSceneSeqState != SCENESEQ_DEFAULT) {
Audio_PlayMorningSceneSequence(play->sequenceCtx.seqId, dayMinusOne);
Audio_PlayMorningSceneSequence(play->sceneSequences.seqId, dayMinusOne);
} else if ((CURRENT_TIME >= CLOCK_TIME(6, 1)) &&
(play->sequenceCtx.seqId != ((void)0, gSaveContext.seqId))) {
Audio_PlaySceneSequence(play->sequenceCtx.seqId, dayMinusOne);
(play->sceneSequences.seqId != ((void)0, gSaveContext.seqId))) {
Audio_PlaySceneSequence(play->sceneSequences.seqId, dayMinusOne);
}
play->envCtx.timeSeqState = TIMESEQ_FADE_DAY_BGM;
} else {
if (play->sequenceCtx.ambienceId != ((void)0, gSaveContext.ambienceId)) {
Audio_PlayAmbience(play->sequenceCtx.ambienceId);
if (play->sceneSequences.ambienceId != ((void)0, gSaveContext.ambienceId)) {
Audio_PlayAmbience(play->sceneSequences.ambienceId);
}
if ((CURRENT_TIME > CLOCK_TIME(17, 10)) && (CURRENT_TIME < CLOCK_TIME(19, 0))) {
play->envCtx.timeSeqState = TIMESEQ_EARLY_NIGHT_CRITTERS;
@ -2499,7 +2499,7 @@ void Environment_UpdateTimeBasedSequence(PlayState* play) {
case TIMESEQ_EARLY_NIGHT_CRITTERS:
if (play->envCtx.precipitation[PRECIP_RAIN_CUR] < 9) {
Audio_PlayAmbience(play->sequenceCtx.ambienceId);
Audio_PlayAmbience(play->sceneSequences.ambienceId);
Audio_SetAmbienceChannelIO(AMBIENCE_CHANNEL_CRITTER_0, 1, 1);
}
play->envCtx.timeSeqState++;
@ -2600,7 +2600,7 @@ void Environment_FadeInGameOverLights(PlayState* play) {
sGameOverLightsIntensity += 2;
}
if (Play_CamIsNotFixed(&play->state)) {
if (Play_CamIsNotFixed(play)) {
for (i = 0; i < 3; i++) {
if (play->envCtx.adjLightSettings.ambientColor[i] > -255) {
play->envCtx.adjLightSettings.ambientColor[i] -= 12;
@ -2647,7 +2647,7 @@ void Environment_FadeOutGameOverLights(PlayState* play) {
sGameOverLightsIntensity, sGameOverLightsIntensity, sGameOverLightsIntensity, 255);
}
if (Play_CamIsNotFixed(&play->state)) {
if (Play_CamIsNotFixed(play)) {
for (i = 0; i < 3; i++) {
Math_SmoothStepToS(&play->envCtx.adjLightSettings.ambientColor[i], 0, 5, 12, 1);
Math_SmoothStepToS(&play->envCtx.adjLightSettings.light1Color[i], 0, 5, 12, 1);
@ -2944,7 +2944,7 @@ s32 Environment_AdjustLights(PlayState* play, f32 arg1, f32 arg2, f32 arg3, f32
return 0;
}
if (!Play_CamIsNotFixed(&play->state)) {
if (!Play_CamIsNotFixed(play)) {
return 0;
}
if (play->unk_18880) {
@ -3050,12 +3050,12 @@ s32 Environment_IsForcedSequenceDisabled(void) {
}
void Environment_PlayStormNatureAmbience(PlayState* play) {
if (((play->sequenceCtx.seqId != NA_BGM_NO_MUSIC) && (play->sequenceCtx.ambienceId == AMBIENCE_ID_13)) ||
if (((play->sceneSequences.seqId != NA_BGM_NO_MUSIC) && (play->sceneSequences.ambienceId == AMBIENCE_ID_13)) ||
(AudioSeq_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) == NA_BGM_FINAL_HOURS)) {
Audio_PlayAmbience(AMBIENCE_ID_07);
} else if ((play->sequenceCtx.seqId != NA_BGM_NO_MUSIC) && (play->sequenceCtx.ambienceId != AMBIENCE_ID_13)) {
} else if ((play->sceneSequences.seqId != NA_BGM_NO_MUSIC) && (play->sceneSequences.ambienceId != AMBIENCE_ID_13)) {
if ((CURRENT_TIME >= CLOCK_TIME(6, 0)) && (CURRENT_TIME < CLOCK_TIME(18, 0))) {
Audio_PlayAmbience(play->sequenceCtx.ambienceId);
Audio_PlayAmbience(play->sceneSequences.ambienceId);
}
}
@ -3064,10 +3064,10 @@ void Environment_PlayStormNatureAmbience(PlayState* play) {
}
void Environment_StopStormNatureAmbience(PlayState* play) {
if (((play->sequenceCtx.seqId != NA_BGM_NO_MUSIC) && (play->sequenceCtx.ambienceId == AMBIENCE_ID_13)) ||
if (((play->sceneSequences.seqId != NA_BGM_NO_MUSIC) && (play->sceneSequences.ambienceId == AMBIENCE_ID_13)) ||
(AudioSeq_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) == NA_BGM_FINAL_HOURS)) {
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_AMBIENCE, 20);
} else if ((play->sequenceCtx.seqId != NA_BGM_NO_MUSIC) && (play->sequenceCtx.ambienceId != AMBIENCE_ID_13)) {
} else if ((play->sceneSequences.seqId != NA_BGM_NO_MUSIC) && (play->sceneSequences.ambienceId != AMBIENCE_ID_13)) {
if ((CURRENT_TIME >= CLOCK_TIME(6, 0)) && (CURRENT_TIME < CLOCK_TIME(18, 0))) {
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_AMBIENCE, 20);
}

View File

@ -1,12 +1,11 @@
#include "z64lib.h"
#include "ichain.h"
#include "libc64/qrand.h"
#include "main.h"
#include "ichain.h"
#include "sfx.h"
#include "z64actor.h"
#include "z64game.h"
#include "functions.h"
#include "macros.h"
void* Lib_MemCpy(void* dest, void* src, size_t size) {
bcopy(src, dest, size);
@ -453,7 +452,7 @@ void (*sInitChainHandlers[])(u8* ptr, InitChainEntry* ichain) = {
IChain_Apply_Vec3f, IChain_Apply_Vec3fdiv1000, IChain_Apply_Vec3s,
};
void Actor_ProcessInitChain(Actor* actor, InitChainEntry* ichain) {
void Actor_ProcessInitChain(struct Actor* actor, InitChainEntry* ichain) {
do {
sInitChainHandlers[ichain->type]((u8*)actor, ichain);
} while ((ichain++)->cont);

View File

@ -5966,7 +5966,7 @@ void Message_Update(PlayState* play) {
case MSGMODE_OWL_SAVE_0:
play->state.unk_A3 = 1;
gSaveContext.save.isOwlSave = true;
Play_SaveCycleSceneFlags(&play->state);
Play_SaveCycleSceneFlags(play);
func_8014546C(&play->sramCtx);
if (gSaveContext.fileNum != 0xFF) {

View File

@ -4437,7 +4437,7 @@ void Interface_DrawClock(PlayState* play) {
((play->actorCtx.flags & ACTORCTX_FLAG_TELESCOPE_ON) && !Play_InCsMode(play)) ||
(msgCtx->msgMode == MSGMODE_NONE) || ((msgCtx->currentTextId >= 0x100) && (msgCtx->currentTextId <= 0x200)) ||
(gSaveContext.gameMode == GAMEMODE_END_CREDITS)) &&
!FrameAdvance_IsEnabled(&play->state) && !Environment_IsTimeStopped() && (gSaveContext.save.day <= 3)) {
!FrameAdvance_IsEnabled(play) && !Environment_IsTimeStopped() && (gSaveContext.save.day <= 3)) {
/**
* Section: Changes Clock's transparancy depending if Player is moving or not and possibly other things
*/

View File

@ -1,32 +1,34 @@
#include "z64.h"
#include "regs.h"
#include "z64malloc.h"
#include "z64vis.h"
#include "z64visfbuf.h"
#include "PR/ultratypes.h"
// Variables are put before most headers as a hacky way to bypass bss reordering
s16 sTransitionFillTimer;
Input D_801F6C18;
TransitionTile sTransitionTile;
struct Input D_801F6C18;
struct TransitionTile sTransitionTile;
s32 gTransitionTileState;
VisMono sPlayVisMono;
Color_RGBA8_u32 gPlayVisMonoColor;
VisFbuf sPlayVisFbuf;
VisFbuf* sPlayVisFbufInstance;
BombersNotebook sBombersNotebook;
struct VisMono sPlayVisMono;
union Color_RGBA8_u32 gPlayVisMonoColor;
struct VisFbuf sPlayVisFbuf;
struct VisFbuf* sPlayVisFbufInstance;
struct BombersNotebook sBombersNotebook;
u8 sBombersNotebookOpen;
u8 sMotionBlurStatus;
#include "macros.h"
#include "z64play.h"
#include "buffers.h"
#include "idle.h"
#include "regs.h"
#include "sys_cfb.h"
#include "z64bombers_notebook.h"
#include "z64debug_display.h"
#include "z64malloc.h"
#include "z64quake.h"
#include "z64rumble.h"
#include "z64shrink_window.h"
#include "z64view.h"
#include "z64vis.h"
#include "z64visfbuf.h"
#include "overlays/gamestates/ovl_daytelop/z_daytelop.h"
#include "overlays/gamestates/ovl_opening/z_opening.h"
@ -1863,8 +1865,7 @@ s16 Play_GetOriginalSceneId(s16 sceneId) {
* Copies the flags set in ActorContext over to the current scene's CycleSceneFlags, usually using the original scene
* number. Exception for Inverted Stone Tower Temple, which uses its own.
*/
void Play_SaveCycleSceneFlags(GameState* thisx) {
PlayState* this = (PlayState*)thisx;
void Play_SaveCycleSceneFlags(PlayState* this) {
CycleSceneFlags* cycleSceneFlags;
cycleSceneFlags = &gSaveContext.cycleSceneFlags[Play_GetOriginalSceneId(this->sceneId)];
@ -1880,9 +1881,8 @@ void Play_SaveCycleSceneFlags(GameState* thisx) {
cycleSceneFlags->clearedRoom = this->actorCtx.sceneFlags.clearedRoom;
}
void Play_SetRespawnData(GameState* thisx, s32 respawnMode, u16 entrance, s32 roomIndex, s32 playerParams, Vec3f* pos,
void Play_SetRespawnData(PlayState* this, s32 respawnMode, u16 entrance, s32 roomIndex, s32 playerParams, Vec3f* pos,
s16 yaw) {
PlayState* this = (PlayState*)thisx;
gSaveContext.respawn[respawnMode].entrance = Entrance_Create(entrance >> 9, 0, entrance & 0xF);
gSaveContext.respawn[respawnMode].roomIndex = roomIndex;
@ -1894,12 +1894,11 @@ void Play_SetRespawnData(GameState* thisx, s32 respawnMode, u16 entrance, s32 ro
gSaveContext.respawn[respawnMode].tempCollectFlags = this->actorCtx.sceneFlags.collectible[2];
}
void Play_SetupRespawnPoint(GameState* thisx, s32 respawnMode, s32 playerParams) {
PlayState* this = (PlayState*)thisx;
void Play_SetupRespawnPoint(PlayState* this, s32 respawnMode, s32 playerParams) {
Player* player = GET_PLAYER(this);
if (this->sceneId != SCENE_KAKUSIANA) { // Grottos
Play_SetRespawnData(&this->state, respawnMode, ((void)0, gSaveContext.save.entrance), this->roomCtx.curRoom.num,
Play_SetRespawnData(this, respawnMode, ((void)0, gSaveContext.save.entrance), this->roomCtx.curRoom.num,
playerParams, &player->actor.world.pos, player->actor.shape.rot.y);
}
}
@ -1914,9 +1913,7 @@ void func_80169ECC(PlayState* this) {
// Gameplay_TriggerVoidOut ?
// Used by Player, Ikana_Rotaryroom, Bji01, Kakasi, LiftNuts, Test4, Warptag, WarpUzu, Roomtimer
void func_80169EFC(GameState* thisx) {
PlayState* this = (PlayState*)thisx;
void func_80169EFC(PlayState* this) {
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempSwitchFlags = this->actorCtx.sceneFlags.switches[2];
gSaveContext.respawn[RESPAWN_MODE_DOWN].unk_18 = this->actorCtx.sceneFlags.collectible[1];
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempCollectFlags = this->actorCtx.sceneFlags.collectible[2];
@ -1929,9 +1926,7 @@ void func_80169EFC(GameState* thisx) {
// Gameplay_LoadToLastEntrance ?
// Used by game_over and Test7
void func_80169F78(GameState* thisx) {
PlayState* this = (PlayState*)thisx;
void func_80169F78(PlayState* this) {
this->nextEntrance = gSaveContext.respawn[RESPAWN_MODE_TOP].entrance;
gSaveContext.respawnFlag = -1;
func_80169ECC(this);
@ -1941,20 +1936,16 @@ void func_80169F78(GameState* thisx) {
// Gameplay_TriggerRespawn ?
// Used for void by Wallmaster, Deku Shrine doors. Also used by Player, Kaleido, DoorWarp1
void func_80169FDC(GameState* thisx) {
func_80169F78(thisx);
void func_80169FDC(PlayState* this) {
func_80169F78(this);
}
s32 Play_CamIsNotFixed(GameState* thisx) {
PlayState* this = (PlayState*)thisx;
s32 Play_CamIsNotFixed(PlayState* this) {
return this->roomCtx.curRoom.roomShape->base.type != ROOM_SHAPE_TYPE_IMAGE;
}
s32 FrameAdvance_IsEnabled(GameState* thisx) {
PlayState* this = (PlayState*)thisx;
return this->frameAdvCtx.enabled != 0;
s32 FrameAdvance_IsEnabled(PlayState* this) {
return this->frameAdvCtx.enabled != false;
}
// Unused, unchanged from OoT, which uses it only in one Camera function.
@ -1966,8 +1957,7 @@ s32 FrameAdvance_IsEnabled(GameState* thisx) {
* @param[out] yaw Facing angle of the actor, or reverse if in the back room.
* @return true if \p actor is a door and the sides are in different rooms, false otherwise
*/
s32 func_8016A02C(GameState* thisx, Actor* actor, s16* yaw) {
PlayState* this = (PlayState*)thisx;
s32 func_8016A02C(PlayState* this, Actor* actor, s16* yaw) {
TransitionActorEntry* transitionActor;
s8 frontRoom;
@ -2041,8 +2031,7 @@ s16 sPlayerCsIdToCsCamId[] = {
* Otherwise, if there is an CutsceneEntry where csCamId matches the appropriate element of sPlayerCsIdToCsCamId,
* set the corresponding playerActorCsId (and possibly change its priority for the zeroth one).
*/
void Play_AssignPlayerCsIdsFromScene(GameState* thisx, s32 spawnCsId) {
PlayState* this = (PlayState*)thisx;
void Play_AssignPlayerCsIdsFromScene(PlayState* this, s32 spawnCsId) {
s32 i;
s16* curPlayerCsId = this->playerCsIds;
s16* csCamId = sPlayerCsIdToCsCamId;
@ -2068,7 +2057,7 @@ void Play_AssignPlayerCsIdsFromScene(GameState* thisx, s32 spawnCsId) {
}
// Set values to fill screen
void Play_FillScreen(GameState* thisx, s16 fillScreenOn, u8 red, u8 green, u8 blue, u8 alpha) {
void Play_FillScreen(PlayState* this, s16 fillScreenOn, u8 red, u8 green, u8 blue, u8 alpha) {
R_PLAY_FILL_SCREEN_ON = fillScreenOn;
R_PLAY_FILL_SCREEN_R = red;
R_PLAY_FILL_SCREEN_G = green;
@ -2340,8 +2329,8 @@ void Play_Init(GameState* thisx) {
CutsceneManager_StoreCamera(&this->mainCamera);
Interface_SetSceneRestrictions(this);
Environment_PlaySceneSequence(this);
gSaveContext.seqId = this->sequenceCtx.seqId;
gSaveContext.ambienceId = this->sequenceCtx.ambienceId;
gSaveContext.seqId = this->sceneSequences.seqId;
gSaveContext.ambienceId = this->sceneSequences.ambienceId;
AnimationContext_Update(this, &this->animationCtx);
Cutscene_HandleEntranceTriggers(this);
gSaveContext.respawnFlag = 0;

View File

@ -81,7 +81,7 @@ void func_80127B64(struct_801F58B0 arg0[], s32 count, Vec3f* arg2);
s32 func_801226E0(PlayState* play, s32 arg1) {
if (arg1 == 0) {
Play_SetupRespawnPoint(&play->state, RESPAWN_MODE_DOWN, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B));
Play_SetupRespawnPoint(play, RESPAWN_MODE_DOWN, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B));
if (play->sceneId == SCENE_KAKUSIANA) {
return 1;
}

View File

@ -454,8 +454,8 @@ void Scene_Command09(PlayState* play, SceneCmd* cmd) {
// SceneTableEntry Header Command 0x15: Sound Settings
void Scene_CommandSoundSettings(PlayState* play, SceneCmd* cmd) {
play->sequenceCtx.seqId = cmd->soundSettings.seqId;
play->sequenceCtx.ambienceId = cmd->soundSettings.ambienceId;
play->sceneSequences.seqId = cmd->soundSettings.seqId;
play->sceneSequences.ambienceId = cmd->soundSettings.ambienceId;
if (gSaveContext.seqId == (u8)NA_BGM_DISABLED ||
AudioSeq_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) == NA_BGM_FINAL_HOURS) {

View File

@ -444,7 +444,7 @@ void Sram_SaveEndOfCycle(PlayState* play) {
}
sceneId = Play_GetOriginalSceneId(play->sceneId);
Play_SaveCycleSceneFlags(&play->state);
Play_SaveCycleSceneFlags(play);
play->actorCtx.sceneFlags.chest &= sPersistentCycleSceneFlags[sceneId].chest;
play->actorCtx.sceneFlags.switches[0] &= sPersistentCycleSceneFlags[sceneId].switch0;

View File

@ -329,7 +329,7 @@ void BgCraceMovebg_ClosingDoor_Close(BgCraceMovebg* this, PlayState* play) {
if (!(this->stateFlags & BG_CRACE_MOVEBG_FLAG_PLAYER_IS_BEYOND_DOOR) &&
!Flags_GetSwitch(play, BG_CRACE_MOVEBG_GET_SWITCH_FLAG(&this->dyna.actor) + 1)) {
play->haltAllActors = true;
func_80169FDC(&play->state);
func_80169FDC(play);
Audio_PlaySfx(NA_SE_OC_ABYSS);
}

View File

@ -4,7 +4,6 @@
* Description: Snowhead Temple Central Pillar
*/
#include "prevent_bss_reordering.h"
#include "z_bg_hakugin_post.h"
#include "z64quake.h"
#include "z64rumble.h"

View File

@ -649,7 +649,7 @@ void func_80B814B8(BgIkanaRotaryroom* this, PlayState* play) {
if (CutsceneManager_GetCurrentCsId() == this->dyna.actor.csId) {
if (player->actor.bgCheckFlags & BGCHECKFLAG_CRUSHED) {
Player_PlaySfx(player, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->voiceSfxIdOffset);
func_80169EFC(&play->state);
func_80169EFC(play);
Player_PlaySfx(player, NA_SE_VO_LI_TAKEN_AWAY + player->ageProperties->voiceSfxIdOffset);
play->haltAllActors = true;
Audio_PlaySfx(NA_SE_OC_ABYSS);

View File

@ -1868,7 +1868,7 @@ void DmStk_Update(Actor* thisx, PlayState* play) {
// This code is responsible for making in-game time pass while using the telescope in the Astral Observatory.
// Skull Kid is always loaded in the scene, even if he isn't visible, hence why time always passes.
if ((play->actorCtx.flags & ACTORCTX_FLAG_TELESCOPE_ON) && (play->msgCtx.msgMode != MSGMODE_NONE) &&
(play->msgCtx.currentTextId == 0x5E6) && !FrameAdvance_IsEnabled(&play->state) &&
(play->msgCtx.currentTextId == 0x5E6) && !FrameAdvance_IsEnabled(play) &&
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE) &&
(play->csCtx.state == CS_STATE_IDLE)) {
gSaveContext.save.time = CURRENT_TIME + (u16)R_TIME_SPEED;

View File

@ -141,7 +141,7 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) {
} else {
s32 destinationIdx = DOORANA_GET_ENTRANCE(&this->actor);
Play_SetupRespawnPoint(&play->state, RESPAWN_MODE_UNK_3, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_4));
Play_SetupRespawnPoint(play, RESPAWN_MODE_UNK_3, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_4));
gSaveContext.respawn[RESPAWN_MODE_UNK_3].pos.y = this->actor.world.pos.y;
gSaveContext.respawn[RESPAWN_MODE_UNK_3].yaw = this->actor.home.rot.y;

View File

@ -489,7 +489,7 @@ void func_808B98A8(DoorWarp1* this, PlayState* play) {
Scene_SetExitFade(play);
play->transitionTrigger = TRANS_TRIGGER_START;
} else {
func_80169FDC(&play->state);
func_80169FDC(play);
}
}
}
@ -772,7 +772,7 @@ void func_808BA10C(DoorWarp1* this, PlayState* play) {
Scene_SetExitFade(play);
play->transitionTrigger = TRANS_TRIGGER_START;
} else {
func_80169FDC(&play->state);
func_80169FDC(play);
}
}

View File

@ -344,7 +344,7 @@ void func_809CD634(EnBji01* this, PlayState* play) {
SEQCMD_DISABLE_PLAY_SEQUENCES(true);
play->nextEntrance = ENTRANCE(TERMINA_FIELD, 10); /* Telescope entrance */
gSaveContext.respawn[RESPAWN_MODE_DOWN].entrance = play->nextEntrance;
func_80169EFC(&play->state); /* Load new entrance? */
func_80169EFC(play); /* Load new entrance? */
gSaveContext.respawnFlag = -2;
this->actionFunc = EnBji01_DoNothing;
}

View File

@ -949,9 +949,9 @@ void EnKakasi_DancingNightAway(EnKakasi* this, PlayState* play) {
if (this->unk204 == 0) {
player = GET_PLAYER(play);
Play_SetRespawnData(&play->state, RESPAWN_MODE_DOWN, Entrance_CreateFromSpawn(0), player->unk_3CE,
Play_SetRespawnData(play, RESPAWN_MODE_DOWN, Entrance_CreateFromSpawn(0), player->unk_3CE,
PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &player->unk_3C0, player->unk_3CC);
func_80169EFC(&play->state);
func_80169EFC(play);
if ((CURRENT_TIME > CLOCK_TIME(18, 0)) || (CURRENT_TIME < CLOCK_TIME(6, 0))) {
gSaveContext.save.time = CLOCK_TIME(6, 0);

View File

@ -904,7 +904,7 @@ void EnLiftNuts_EndGame(EnLiftNuts* this, PlayState* play) {
CLEAR_EVENTINF(EVENTINF_34);
gSaveContext.respawn[RESPAWN_MODE_DOWN].entrance = ENTRANCE(DEKU_SCRUB_PLAYGROUND, 1);
gSaveContext.nextCutsceneIndex = 0;
func_80169EFC(&play->state);
func_80169EFC(play);
gSaveContext.respawnFlag = -2;
play->transitionType = TRANS_TYPE_64;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;

View File

@ -428,7 +428,7 @@ s32 func_80BC01DC(Actor* thisx, PlayState* play) {
case ENNB_BEHAVIOUR_1:
// Setup a black fill-screen, although initialize to 0 alpha
Play_FillScreen(&play->state, true, 0, 0, 0, 0);
Play_FillScreen(play, true, 0, 0, 0, 0);
this->storyTimer = 40;
this->behaviour = (u16)(this->behaviour + 1);
break;

View File

@ -59,7 +59,7 @@ void func_8096B174(EnOkarinaEffect* this, PlayState* play) {
DECR(this->timer);
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
(play->msgCtx.msgLength == 0) && !FrameAdvance_IsEnabled(&play->state) && (this->timer == 0)) {
(play->msgCtx.msgLength == 0) && !FrameAdvance_IsEnabled(play) && (this->timer == 0)) {
EnOkarinaEffect_SetupAction(this, func_8096B1FC);
}
}

View File

@ -453,9 +453,9 @@ void EnTest4_HandleEvents(EnTest4* this, PlayState* play) {
} else {
// Turn day with DayTelop cutscene
gSaveContext.screenScale = 0.0f;
Play_SetRespawnData(&play->state, RESPAWN_MODE_DOWN, Entrance_CreateFromSpawn(0), player->unk_3CE,
Play_SetRespawnData(play, RESPAWN_MODE_DOWN, Entrance_CreateFromSpawn(0), player->unk_3CE,
PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &player->unk_3C0, player->unk_3CC);
func_80169EFC(&play->state);
func_80169EFC(play);
if (player->stateFlags1 & PLAYER_STATE1_800000) {
EnHorse* rideActor = (EnHorse*)player->rideActor;
@ -512,7 +512,7 @@ void EnTest4_HandleEvents(EnTest4* this, PlayState* play) {
playerParams = PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B);
}
Play_SetRespawnData(&play->state, RESPAWN_MODE_RETURN, entrance, player->unk_3CE, playerParams,
Play_SetRespawnData(play, RESPAWN_MODE_RETURN, entrance, player->unk_3CE, playerParams,
&player->unk_3C0, player->unk_3CC);
if ((play->sceneId == SCENE_TENMON_DAI) || (play->sceneId == SCENE_00KEIKOKU)) {

View File

@ -1081,9 +1081,8 @@ void EnTest6_SharedSoTCutscene(EnTest6* this, PlayState* play) {
return;
case SOTCS_CUEID_DOUBLE_END:
Play_SetRespawnData(&play->state, RESPAWN_MODE_RETURN, ((void)0, gSaveContext.save.entrance),
player->unk_3CE, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &player->unk_3C0,
player->unk_3CC);
Play_SetRespawnData(play, RESPAWN_MODE_RETURN, ((void)0, gSaveContext.save.entrance), player->unk_3CE,
PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &player->unk_3C0, player->unk_3CC);
this->drawType = SOTCS_DRAW_TYPE_NONE;
play->transitionTrigger = TRANS_TRIGGER_START;
play->nextEntrance = gSaveContext.respawn[RESPAWN_MODE_RETURN].entrance;
@ -1163,7 +1162,7 @@ void EnTest6_SharedSoTCutscene(EnTest6* this, PlayState* play) {
case SOTCS_CUEID_DOUBLE_END:
if (CURRENT_TIME > CLOCK_TIME(12, 0)) {
Play_SetRespawnData(&play->state, RESPAWN_MODE_RETURN, ((void)0, gSaveContext.save.entrance),
Play_SetRespawnData(play, RESPAWN_MODE_RETURN, ((void)0, gSaveContext.save.entrance),
player->unk_3CE, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &player->unk_3C0,
player->unk_3CC);
this->drawType = SOTCS_DRAW_TYPE_NONE;

View File

@ -660,7 +660,7 @@ void EnTest7_WarpCsWarp(EnTest7* this, PlayState* play) {
if (play->sceneId == SCENE_SECOM) {
play->nextEntrance = ENTRANCE(IKANA_CANYON, 6);
} else if (OWL_WARP_CS_GET_OCARINA_MODE(&this->actor) == OCARINA_MODE_WARP_TO_ENTRANCE) {
func_80169F78(&play->state);
func_80169F78(play);
gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams =
PLAYER_PARAMS(gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams, PLAYER_INITMODE_6);
gSaveContext.respawnFlag = -6;

View File

@ -80,7 +80,7 @@ void EnTorch2_Destroy(Actor* thisx, PlayState* play) {
EnTorch2* this = THIS;
Collider_DestroyCylinder(play, &this->collider);
Play_SetRespawnData(&play->state, this->actor.params + RESPAWN_MODE_GORON - 1, 0xFF, 0,
Play_SetRespawnData(play, this->actor.params + RESPAWN_MODE_GORON - 1, 0xFF, 0,
PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &this->actor.world.pos, this->actor.shape.rot.y);
play->actorCtx.elegyShells[this->actor.params] = NULL;
}

View File

@ -1015,7 +1015,7 @@ s32 func_80A87B48(Actor* thisx, PlayState* play) {
sp4C.z = 40.0f;
Lib_Vec3f_TranslateAndRotateY(&this->actor.world.pos, sp3E, &sp4C, &sp40);
func_80A85620(this->unk_394, &sp40, 2.0f, 0.08f, 60.0f);
Play_FillScreen(&play->state, true, 160, 160, 160, 0);
Play_FillScreen(play, true, 160, 160, 160, 0);
this->unk_370 = 20;
this->unk_372 = 10;
this->unk_364++;

View File

@ -499,7 +499,7 @@ void EnWallmas_TakePlayer(EnWallmas* this, PlayState* play) {
if (this->timer == 30) {
Audio_PlaySfx(NA_SE_OC_ABYSS);
func_80169FDC(&play->state);
func_80169FDC(play);
}
}

View File

@ -113,7 +113,7 @@ void func_80A66278(EnWarpUzu* this, PlayState* play) {
void func_80A66384(EnWarpUzu* this, PlayState* play) {
play->nextEntrance = ENTRANCE(PIRATES_FORTRESS, 10);
gSaveContext.respawn[RESPAWN_MODE_DOWN].entrance = play->nextEntrance;
func_80169EFC(&play->state);
func_80169EFC(play);
gSaveContext.respawnFlag = -2;
this->actionFunc = EnWarpUzu_DoNothing;
}

View File

@ -211,11 +211,11 @@ void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play) {
// why are we getting player home rotation from the room data? doesnt player have home.rot.y?
// especially because we are converting from deg to binang, but isnt home.rot.y already in binang??
Play_SetRespawnData(&play->state, RESPAWN_MODE_DOWN, entrance,
play->setupEntranceList[playerSpawnIndex].room, playerParams, &newRespawnPos,
Play_SetRespawnData(play, RESPAWN_MODE_DOWN, entrance, play->setupEntranceList[playerSpawnIndex].room,
playerParams, &newRespawnPos,
DEG_TO_BINANG_ALT((playerActorEntry->rot.y >> 7) & 0x1FF));
func_80169EFC(&play->state);
func_80169EFC(play);
gSaveContext.respawnFlag = -5;
Play_DisableMotionBlur();
}

View File

@ -489,7 +489,7 @@ void EnWeatherTag_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
if ((play->actorCtx.flags & ACTORCTX_FLAG_TELESCOPE_ON) && (play->msgCtx.msgMode != MSGMODE_NONE) &&
(play->msgCtx.currentTextId == 0x5E6) && !FrameAdvance_IsEnabled(&play->state) &&
(play->msgCtx.currentTextId == 0x5E6) && !FrameAdvance_IsEnabled(play) &&
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE) &&
(play->csCtx.state == CS_STATE_IDLE)) {

View File

@ -68,7 +68,7 @@ void func_80973D3C(ObjRoomtimer* this, PlayState* play) {
this->actionFunc = func_80973DE0;
} else if ((this->actor.params != 0x1FF) && (gSaveContext.timerStates[TIMER_ID_MINIGAME_2] == TIMER_STATE_OFF)) {
Audio_PlaySfx(NA_SE_OC_ABYSS);
func_80169EFC(&play->state);
func_80169EFC(play);
Actor_Kill(&this->actor);
}
}

View File

@ -5742,11 +5742,11 @@ s32 func_80834600(Player* this, PlayState* play) {
Player_AnimSfx_PlayVoice(this, NA_SE_VO_LI_DAMAGE_S);
if (var_v0) {
func_80169FDC(&play->state);
func_80169FDC(play);
func_808345C8();
Scene_SetExitFade(play);
} else {
func_80169EFC(&play->state);
func_80169EFC(play);
func_808345C8();
}
@ -6074,7 +6074,7 @@ void func_808354A4(PlayState* play, s32 exitIndex, s32 arg2) {
} else {
if (arg2) {
gSaveContext.respawn[RESPAWN_MODE_DOWN].entrance = play->nextEntrance;
func_80169EFC(&play->state);
func_80169EFC(play);
gSaveContext.respawnFlag = -2;
}
@ -6125,7 +6125,7 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol
}
if (exitIndexPlusOne == 0) {
func_80169EFC(&play->state);
func_80169EFC(play);
Scene_SetExitFade(play);
} else {
func_808354A4(play, exitIndexPlusOne - 1,
@ -6173,7 +6173,7 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol
BgCheck_EntityRaycastFloor7(&play->colCtx, &this->actor.floorPoly, &sp30, &this->actor,
&this->actor.world.pos);
if (this->actor.floorPoly == NULL) {
func_80169EFC(&play->state);
func_80169EFC(play);
return false;
}
//! FAKE
@ -6187,10 +6187,10 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol
((sPlayerYDistToFloor < 100.0f) || (this->fallDistance > 400))))) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (this->floorProperty == FLOOR_PROPERTY_5) {
func_80169FDC(&play->state);
func_80169FDC(play);
func_808345C8();
} else {
func_80169EFC(&play->state);
func_80169EFC(play);
}
if (!SurfaceType_IsWallDamage(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId)) {
gSaveContext.respawnFlag = -5;
@ -8263,7 +8263,7 @@ void func_8083A98C(Actor* thisx, PlayState* play2) {
gSaveContext.respawn[RESPAWN_MODE_DOWN].entrance = entrance;
}
func_80169EFC(&play->state);
func_80169EFC(play);
gSaveContext.respawnFlag = -2;
play->transitionType = TRANS_TYPE_CIRCLE;
}
@ -8613,7 +8613,7 @@ void func_8083BB4C(PlayState* play, Player* this) {
} else if ((this->unk_3CF == 0) &&
((play->sceneId == SCENE_30GYOSON) || (play->sceneId == SCENE_31MISAKI) ||
(play->sceneId == SCENE_TORIDE))) {
func_80169EFC(&play->state);
func_80169EFC(play);
func_808345C8();
} else {
Player_SetAction(play, this, Player_Action_1, 0);
@ -10817,7 +10817,7 @@ void Player_Init(Actor* thisx, PlayState* play) {
Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 255, 128, 0, -1);
this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo);
Play_AssignPlayerCsIdsFromScene(&play->state, this->actor.csId);
Play_AssignPlayerCsIdsFromScene(play, this->actor.csId);
respawnFlag = gSaveContext.respawnFlag;
if (respawnFlag != 0) {
@ -13281,7 +13281,7 @@ void func_80848640(PlayState* play, Player* this) {
if (torch2 != NULL) {
play->actorCtx.elegyShells[this->transformation] = torch2;
Play_SetupRespawnPoint(&play->state, this->transformation + 3, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B));
Play_SetupRespawnPoint(play, this->transformation + 3, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B));
}
effChange = Actor_Spawn(&play->actorCtx, play, ACTOR_EFF_CHANGE, this->actor.world.pos.x, this->actor.world.pos.y,
@ -15337,7 +15337,7 @@ void Player_Action_36(Player* this, PlayState* play) {
}
func_800E0238(Play_GetCamera(play, CAM_ID_MAIN));
Play_SetupRespawnPoint(&play->state, RESPAWN_MODE_DOWN, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B));
Play_SetupRespawnPoint(play, RESPAWN_MODE_DOWN, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B));
}
}
} else if (!(this->stateFlags1 & PLAYER_STATE1_20000000) && PlayerAnimation_OnFrame(&this->skelAnime, 15.0f)) {
@ -17608,9 +17608,9 @@ void Player_Action_77(Player* this, PlayState* play) {
if ((this->av2.actionVar2++ >= 9) && !func_8082DA90(play)) {
if (this->av1.actionVar1 != 0) {
if (this->av1.actionVar1 < 0) {
func_80169FDC(&play->state);
func_80169FDC(play);
} else {
func_80169EFC(&play->state);
func_80169EFC(play);
}
if (!SurfaceType_IsWallDamage(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId)) {
gSaveContext.respawnFlag = -5;

View File

@ -3065,7 +3065,7 @@ void KaleidoScope_Update(PlayState* play) {
pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_RETURN_TO_MENU;
} else {
Audio_PlaySfx(NA_SE_SY_PIECE_OF_HEART);
Play_SaveCycleSceneFlags(&play->state);
Play_SaveCycleSceneFlags(play);
gSaveContext.save.saveInfo.playerData.savedSceneId = play->sceneId;
func_8014546C(sramCtx);
if (!gSaveContext.flashSaveAvailable) {
@ -3331,7 +3331,7 @@ void KaleidoScope_Update(PlayState* play) {
} else {
Audio_PlaySfx(NA_SE_SY_PIECE_OF_HEART);
pauseCtx->promptChoice = PAUSE_PROMPT_YES;
Play_SaveCycleSceneFlags(&play->state);
Play_SaveCycleSceneFlags(play);
gSaveContext.save.saveInfo.playerData.savedSceneId = play->sceneId;
gSaveContext.save.saveInfo.playerData.health = 0x30;
func_8014546C(sramCtx);
@ -3381,7 +3381,7 @@ void KaleidoScope_Update(PlayState* play) {
if (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_START)) {
if (pauseCtx->promptChoice == PAUSE_PROMPT_YES) {
Audio_PlaySfx(NA_SE_SY_PIECE_OF_HEART);
Play_SaveCycleSceneFlags(&play->state);
Play_SaveCycleSceneFlags(play);
if (gSaveContext.save.entrance == ENTRANCE(UNSET_0D, 0)) {}
} else { // PAUSE_PROMPT_NO
Audio_PlaySfx(NA_SE_SY_DECIDE);
@ -3403,7 +3403,7 @@ void KaleidoScope_Update(PlayState* play) {
BgCheck_InitCollisionHeaders(&play->colCtx, play);
if (pauseCtx->promptChoice == PAUSE_PROMPT_YES) {
func_80169FDC(&play->state);
func_80169FDC(play);
gSaveContext.respawnFlag = -2;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.save.saveInfo.playerData.health = 0x30;