mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-03 22:44:30 +00:00
Merge branch 'main' into meta_no_asmproc
This commit is contained in:
commit
d64a2922ff
177 changed files with 1962 additions and 1311 deletions
2
Makefile
2
Makefile
|
@ -238,7 +238,7 @@ $(BUILD_DIR)/src/boot/stackcheck.o: OPTFLAGS := -O2
|
||||||
$(BUILD_DIR)/src/code/__osMalloc.o: OPTFLAGS := -O2
|
$(BUILD_DIR)/src/code/__osMalloc.o: OPTFLAGS := -O2
|
||||||
$(BUILD_DIR)/src/code/code_800FC620.o: OPTFLAGS := -O2
|
$(BUILD_DIR)/src/code/code_800FC620.o: OPTFLAGS := -O2
|
||||||
$(BUILD_DIR)/src/code/code_800FCE80.o: OPTFLAGS := -O2
|
$(BUILD_DIR)/src/code/code_800FCE80.o: OPTFLAGS := -O2
|
||||||
$(BUILD_DIR)/src/code/code_800FD970.o: OPTFLAGS := -O2
|
$(BUILD_DIR)/src/code/rand.o: OPTFLAGS := -O2
|
||||||
$(BUILD_DIR)/src/code/gfxprint.o: OPTFLAGS := -O2
|
$(BUILD_DIR)/src/code/gfxprint.o: OPTFLAGS := -O2
|
||||||
$(BUILD_DIR)/src/code/jpegutils.o: OPTFLAGS := -O2
|
$(BUILD_DIR)/src/code/jpegutils.o: OPTFLAGS := -O2
|
||||||
$(BUILD_DIR)/src/code/jpegdecoder.o: OPTFLAGS := -O2
|
$(BUILD_DIR)/src/code/jpegdecoder.o: OPTFLAGS := -O2
|
||||||
|
|
|
@ -103,6 +103,7 @@ cd oot
|
||||||
#### 3. Prepare a base ROM
|
#### 3. Prepare a base ROM
|
||||||
|
|
||||||
Place a copy of the Master Quest (Debug) ROM inside the `baseroms/gc-eu-mq-dbg/` folder.
|
Place a copy of the Master Quest (Debug) ROM inside the `baseroms/gc-eu-mq-dbg/` folder.
|
||||||
|
If you are under WSL, you can run the command `explorer.exe .` to open the current directory in the Windows file explorer.
|
||||||
|
|
||||||
Rename the file to `baserom.z64`, `baserom.n64` or `baserom.v64`, depending on the original extension.
|
Rename the file to `baserom.z64`, `baserom.n64` or `baserom.v64`, depending on the original extension.
|
||||||
|
|
||||||
|
@ -115,7 +116,7 @@ make setup
|
||||||
```
|
```
|
||||||
|
|
||||||
This downloads some dependencies (from pip), and compiles tools for the build process.
|
This downloads some dependencies (from pip), and compiles tools for the build process.
|
||||||
Then it generates a new ROM "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64" that will have the overdump removed and the header patched.
|
Then it generates a new ROM `baseroms/gc-eu-mq-dbg/baserom-decompressed.z64` that will have the overdump removed and the header patched.
|
||||||
It will also extract the individual assets from the ROM.
|
It will also extract the individual assets from the ROM.
|
||||||
|
|
||||||
#### 5. Build the ROM
|
#### 5. Build the ROM
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
glabel sFaultDrawer
|
glabel sFaultDrawer
|
||||||
.space 0x3C
|
.space 0x3C
|
||||||
|
.space 0x04 # padding
|
||||||
|
|
||||||
glabel D_8016B6BC
|
glabel D_8016B6C0
|
||||||
.space 0x24
|
.space 0x20
|
||||||
|
|
|
@ -44,7 +44,7 @@ void Fault_Init(void);
|
||||||
// Fatal Errors
|
// Fatal Errors
|
||||||
|
|
||||||
NORETURN void Fault_AddHungupAndCrashImpl(const char* exp1, const char* exp2);
|
NORETURN void Fault_AddHungupAndCrashImpl(const char* exp1, const char* exp2);
|
||||||
NORETURN void Fault_AddHungupAndCrash(const char* file, s32 line);
|
NORETURN void Fault_AddHungupAndCrash(const char* file, int line);
|
||||||
|
|
||||||
// Client Registration
|
// Client Registration
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ void isPrintfInit(void);
|
||||||
void rmonPrintf(const char* fmt, ...);
|
void rmonPrintf(const char* fmt, ...);
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void* is_proutSyncPrintf(void* arg, const char* str, size_t count);
|
void* is_proutSyncPrintf(void* arg, const char* str, size_t count);
|
||||||
NORETURN void func_80002384(const char* exp, const char* file, u32 line);
|
NORETURN void func_80002384(const char* exp, const char* file, int line);
|
||||||
#endif
|
#endif
|
||||||
OSPiHandle* osDriveRomInit(void);
|
OSPiHandle* osDriveRomInit(void);
|
||||||
void Mio0_Decompress(u8* src, u8* dst);
|
void Mio0_Decompress(u8* src, u8* dst);
|
||||||
|
@ -51,11 +51,11 @@ u32 StackCheck_CheckAll(void);
|
||||||
u32 StackCheck_Check(StackEntry* entry);
|
u32 StackCheck_Check(StackEntry* entry);
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void LogUtils_LogHexDump(void* ptr, s32 size0);
|
void LogUtils_LogHexDump(void* ptr, s32 size0);
|
||||||
void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, s32 line);
|
void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, int line);
|
||||||
void LogUtils_CheckValidPointer(const char* exp, void* ptr, const char* file, s32 line);
|
void LogUtils_CheckValidPointer(const char* exp, void* ptr, const char* file, int line);
|
||||||
void LogUtils_LogThreadId(const char* name, s32 line);
|
void LogUtils_LogThreadId(const char* name, int line);
|
||||||
#endif
|
#endif
|
||||||
void LogUtils_HungupThread(const char* name, s32 line);
|
void LogUtils_HungupThread(const char* name, int line);
|
||||||
void LogUtils_ResetHungup(void);
|
void LogUtils_ResetHungup(void);
|
||||||
void __osPiCreateAccessQueue(void);
|
void __osPiCreateAccessQueue(void);
|
||||||
void __osPiGetAccess(void);
|
void __osPiGetAccess(void);
|
||||||
|
@ -913,10 +913,10 @@ void ZeldaArena_Cleanup(void);
|
||||||
u8 ZeldaArena_IsInitialized(void);
|
u8 ZeldaArena_IsInitialized(void);
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action);
|
void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action);
|
||||||
void* ZeldaArena_MallocDebug(u32 size, const char* file, s32 line);
|
void* ZeldaArena_MallocDebug(u32 size, const char* file, int line);
|
||||||
void* ZeldaArena_MallocRDebug(u32 size, const char* file, s32 line);
|
void* ZeldaArena_MallocRDebug(u32 size, const char* file, int line);
|
||||||
void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line);
|
void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line);
|
||||||
void ZeldaArena_FreeDebug(void* ptr, const char* file, s32 line);
|
void ZeldaArena_FreeDebug(void* ptr, const char* file, int line);
|
||||||
void ZeldaArena_Display(void);
|
void ZeldaArena_Display(void);
|
||||||
#endif
|
#endif
|
||||||
void MapMark_Init(PlayState* play);
|
void MapMark_Init(PlayState* play);
|
||||||
|
@ -1316,8 +1316,8 @@ void GameState_Destroy(GameState* gameState);
|
||||||
GameStateFunc GameState_GetInit(GameState* gameState);
|
GameStateFunc GameState_GetInit(GameState* gameState);
|
||||||
u32 GameState_IsRunning(GameState* gameState);
|
u32 GameState_IsRunning(GameState* gameState);
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void* GameState_Alloc(GameState* gameState, size_t size, char* file, s32 line);
|
void* GameState_Alloc(GameState* gameState, size_t size, const char* file, int line);
|
||||||
void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 line);
|
void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, int line);
|
||||||
#endif
|
#endif
|
||||||
void* GameAlloc_Malloc(GameAlloc* this, u32 size);
|
void* GameAlloc_Malloc(GameAlloc* this, u32 size);
|
||||||
void GameAlloc_Free(GameAlloc* this, void* data);
|
void GameAlloc_Free(GameAlloc* this, void* data);
|
||||||
|
@ -1333,8 +1333,8 @@ void Graph_ThreadEntry(void*);
|
||||||
void* Graph_Alloc(GraphicsContext* gfxCtx, size_t size);
|
void* Graph_Alloc(GraphicsContext* gfxCtx, size_t size);
|
||||||
void* Graph_Alloc2(GraphicsContext* gfxCtx, size_t size);
|
void* Graph_Alloc2(GraphicsContext* gfxCtx, size_t size);
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void Graph_OpenDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, s32 line);
|
void Graph_OpenDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, int line);
|
||||||
void Graph_CloseDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, s32 line);
|
void Graph_CloseDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, int line);
|
||||||
#endif
|
#endif
|
||||||
Gfx* Gfx_Open(Gfx* gfx);
|
Gfx* Gfx_Open(Gfx* gfx);
|
||||||
Gfx* Gfx_Close(Gfx* gfx, Gfx* dst);
|
Gfx* Gfx_Close(Gfx* gfx, Gfx* dst);
|
||||||
|
@ -1437,8 +1437,8 @@ void Matrix_TranslateRotateZYX(Vec3f* translation, Vec3s* rotation);
|
||||||
void Matrix_SetTranslateRotateYXZ(f32 translateX, f32 translateY, f32 translateZ, Vec3s* rot);
|
void Matrix_SetTranslateRotateYXZ(f32 translateX, f32 translateY, f32 translateZ, Vec3s* rot);
|
||||||
Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest);
|
Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest);
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
Mtx* Matrix_ToMtx(Mtx* dest, char* file, s32 line);
|
Mtx* Matrix_ToMtx(Mtx* dest, const char* file, int line);
|
||||||
Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, char* file, s32 line);
|
Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, const char* file, int line);
|
||||||
#else
|
#else
|
||||||
Mtx* Matrix_ToMtx(Mtx* dest);
|
Mtx* Matrix_ToMtx(Mtx* dest);
|
||||||
Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx);
|
Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx);
|
||||||
|
@ -1453,7 +1453,7 @@ void Matrix_MtxFToYXZRotS(MtxF* mf, Vec3s* rotDest, s32 flag);
|
||||||
void Matrix_MtxFToZYXRotS(MtxF* mf, Vec3s* rotDest, s32 flag);
|
void Matrix_MtxFToZYXRotS(MtxF* mf, Vec3s* rotDest, s32 flag);
|
||||||
void Matrix_RotateAxis(f32 angle, Vec3f* axis, u8 mode);
|
void Matrix_RotateAxis(f32 angle, Vec3f* axis, u8 mode);
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line);
|
MtxF* Matrix_CheckFloats(MtxF* mf, const char* file, int line);
|
||||||
#endif
|
#endif
|
||||||
void Matrix_SetTranslateScaleMtx2(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, f32 translateX, f32 translateY,
|
void Matrix_SetTranslateScaleMtx2(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, f32 translateX, f32 translateY,
|
||||||
f32 translateZ);
|
f32 translateZ);
|
||||||
|
@ -1476,10 +1476,10 @@ void DebugArena_Cleanup(void);
|
||||||
u8 DebugArena_IsInitialized(void);
|
u8 DebugArena_IsInitialized(void);
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action);
|
void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action);
|
||||||
void* DebugArena_MallocDebug(u32 size, const char* file, s32 line);
|
void* DebugArena_MallocDebug(u32 size, const char* file, int line);
|
||||||
void* DebugArena_MallocRDebug(u32 size, const char* file, s32 line);
|
void* DebugArena_MallocRDebug(u32 size, const char* file, int line);
|
||||||
void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line);
|
void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line);
|
||||||
void DebugArena_FreeDebug(void* ptr, const char* file, s32 line);
|
void DebugArena_FreeDebug(void* ptr, const char* file, int line);
|
||||||
void DebugArena_Display(void);
|
void DebugArena_Display(void);
|
||||||
#endif
|
#endif
|
||||||
void UCodeDisas_Init(UCodeDisas*);
|
void UCodeDisas_Init(UCodeDisas*);
|
||||||
|
@ -1774,10 +1774,10 @@ void SystemArena_Init(void* start, u32 size);
|
||||||
void SystemArena_Cleanup(void);
|
void SystemArena_Cleanup(void);
|
||||||
u8 SystemArena_IsInitialized(void);
|
u8 SystemArena_IsInitialized(void);
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void* SystemArena_MallocDebug(u32 size, const char* file, s32 line);
|
void* SystemArena_MallocDebug(u32 size, const char* file, int line);
|
||||||
void* SystemArena_MallocRDebug(u32 size, const char* file, s32 line);
|
void* SystemArena_MallocRDebug(u32 size, const char* file, int line);
|
||||||
void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line);
|
void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line);
|
||||||
void SystemArena_FreeDebug(void* ptr, const char* file, s32 line);
|
void SystemArena_FreeDebug(void* ptr, const char* file, int line);
|
||||||
void SystemArena_Display(void);
|
void SystemArena_Display(void);
|
||||||
#endif
|
#endif
|
||||||
u32 Rand_Next(void);
|
u32 Rand_Next(void);
|
||||||
|
@ -1799,10 +1799,10 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize);
|
||||||
void ArenaImpl_GetSizes(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAlloc);
|
void ArenaImpl_GetSizes(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAlloc);
|
||||||
u32 __osCheckArena(Arena* arena);
|
u32 __osCheckArena(Arena* arena);
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void* __osMallocDebug(Arena* arena, u32 size, const char* file, s32 line);
|
void* __osMallocDebug(Arena* arena, u32 size, const char* file, int line);
|
||||||
void* __osMallocRDebug(Arena* arena, u32 size, const char* file, s32 line);
|
void* __osMallocRDebug(Arena* arena, u32 size, const char* file, int line);
|
||||||
void __osFreeDebug(Arena* arena, void* ptr, const char* file, s32 line);
|
void __osFreeDebug(Arena* arena, void* ptr, const char* file, int line);
|
||||||
void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, s32 line);
|
void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, int line);
|
||||||
void __osDisplayArena(Arena* arena);
|
void __osDisplayArena(Arena* arena);
|
||||||
#endif
|
#endif
|
||||||
s32 PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args);
|
s32 PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args);
|
||||||
|
|
|
@ -114,7 +114,7 @@
|
||||||
// argument errors instead.
|
// argument errors instead.
|
||||||
// Note some tools define __sgi but preprocess with a modern cpp implementation,
|
// Note some tools define __sgi but preprocess with a modern cpp implementation,
|
||||||
// ensure that these do not use the IDO workaround to avoid errors.
|
// ensure that these do not use the IDO workaround to avoid errors.
|
||||||
#define IDO_PRINTF_WORKAROUND (__sgi && !__GNUC__ && !PERMUTER && !M2CTX)
|
#define IDO_PRINTF_WORKAROUND (__sgi && !__GNUC__ && !M2CTX)
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
#define PRINTF osSyncPrintf
|
#define PRINTF osSyncPrintf
|
||||||
|
|
|
@ -28,12 +28,24 @@
|
||||||
#define VT_SGR(n) VT_ESC VT_CSI n "m"
|
#define VT_SGR(n) VT_ESC VT_CSI n "m"
|
||||||
|
|
||||||
// Add more macros if necessary
|
// Add more macros if necessary
|
||||||
|
#if OOT_DEBUG
|
||||||
|
|
||||||
#define VT_COL(back, fore) VT_SGR(VT_COLOR(BACKGROUND, back) ";" VT_COLOR(FOREGROUND, fore))
|
#define VT_COL(back, fore) VT_SGR(VT_COLOR(BACKGROUND, back) ";" VT_COLOR(FOREGROUND, fore))
|
||||||
#define VT_FGCOL(color) VT_SGR(VT_COLOR(FOREGROUND, color))
|
#define VT_FGCOL(color) VT_SGR(VT_COLOR(FOREGROUND, color))
|
||||||
#define VT_BGCOL(color) VT_SGR(VT_COLOR(BACKGROUND, color))
|
#define VT_BGCOL(color) VT_SGR(VT_COLOR(BACKGROUND, color))
|
||||||
#define VT_RST VT_SGR("")
|
#define VT_RST VT_SGR("")
|
||||||
#define VT_CLS VT_ED(2)
|
#define VT_CLS VT_ED(2)
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define VT_COL(back, fore) ""
|
||||||
|
#define VT_FGCOL(color) ""
|
||||||
|
#define VT_BGCOL(color) ""
|
||||||
|
#define VT_RST ""
|
||||||
|
#define VT_CLS ""
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
// ASCII BEL character, plays an alert tone
|
// ASCII BEL character, plays an alert tone
|
||||||
#define BEL '\a'
|
#define BEL '\a'
|
||||||
|
|
||||||
|
|
|
@ -143,13 +143,17 @@ extern u16 D_801333D0;
|
||||||
extern Vec3f gSfxDefaultPos;
|
extern Vec3f gSfxDefaultPos;
|
||||||
extern f32 gSfxDefaultFreqAndVolScale;
|
extern f32 gSfxDefaultFreqAndVolScale;
|
||||||
extern s8 gSfxDefaultReverb;
|
extern s8 gSfxDefaultReverb;
|
||||||
|
#if OOT_DEBUG
|
||||||
extern u8 D_801333F0;
|
extern u8 D_801333F0;
|
||||||
extern u8 gAudioSfxSwapOff;
|
extern u8 gAudioSfxSwapOff;
|
||||||
extern u8 D_801333F8;
|
extern u8 D_801333F8;
|
||||||
|
#endif
|
||||||
extern u8 gSeqCmdWritePos;
|
extern u8 gSeqCmdWritePos;
|
||||||
extern u8 gSeqCmdReadPos;
|
extern u8 gSeqCmdReadPos;
|
||||||
extern u8 gStartSeqDisabled;
|
extern u8 gStartSeqDisabled;
|
||||||
|
#if OOT_DEBUG
|
||||||
extern u8 gAudioDebugPrintSeqCmd;
|
extern u8 gAudioDebugPrintSeqCmd;
|
||||||
|
#endif
|
||||||
extern u8 gSoundModeList[];
|
extern u8 gSoundModeList[];
|
||||||
extern u8 gAudioSpecId;
|
extern u8 gAudioSpecId;
|
||||||
extern u8 D_80133418;
|
extern u8 D_80133418;
|
||||||
|
|
|
@ -717,7 +717,7 @@ typedef struct ArenaNode {
|
||||||
/* 0x0C */ struct ArenaNode* prev;
|
/* 0x0C */ struct ArenaNode* prev;
|
||||||
#if OOT_DEBUG // TODO: This debug info is also present in N64 retail builds
|
#if OOT_DEBUG // TODO: This debug info is also present in N64 retail builds
|
||||||
/* 0x10 */ const char* filename;
|
/* 0x10 */ const char* filename;
|
||||||
/* 0x14 */ s32 line;
|
/* 0x14 */ int line;
|
||||||
/* 0x18 */ OSId threadId;
|
/* 0x18 */ OSId threadId;
|
||||||
/* 0x1C */ Arena* arena;
|
/* 0x1C */ Arena* arena;
|
||||||
/* 0x20 */ OSTime time;
|
/* 0x20 */ OSTime time;
|
||||||
|
|
|
@ -9,7 +9,7 @@ typedef struct {
|
||||||
/* 0x04 */ void* dramAddr; // DRAM address (destination)
|
/* 0x04 */ void* dramAddr; // DRAM address (destination)
|
||||||
/* 0x08 */ size_t size; // File Transfer size
|
/* 0x08 */ size_t size; // File Transfer size
|
||||||
/* 0x0C */ const char* filename; // Filename for debugging
|
/* 0x0C */ const char* filename; // Filename for debugging
|
||||||
/* 0x10 */ s32 line; // Line for debugging
|
/* 0x10 */ int line; // Line number for debugging
|
||||||
/* 0x14 */ s32 unk_14;
|
/* 0x14 */ s32 unk_14;
|
||||||
/* 0x18 */ OSMesgQueue* notifyQueue; // Message queue for the notification message
|
/* 0x18 */ OSMesgQueue* notifyQueue; // Message queue for the notification message
|
||||||
/* 0x1C */ OSMesg notifyMsg; // Completion notification message
|
/* 0x1C */ OSMesg notifyMsg; // Completion notification message
|
||||||
|
@ -48,8 +48,8 @@ s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size,
|
||||||
s32 DmaMgr_RequestSync(void* ram, uintptr_t vrom, size_t size);
|
s32 DmaMgr_RequestSync(void* ram, uintptr_t vrom, size_t size);
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
s32 DmaMgr_RequestAsyncDebug(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk5, OSMesgQueue* queue,
|
s32 DmaMgr_RequestAsyncDebug(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk5, OSMesgQueue* queue,
|
||||||
OSMesg msg, const char* file, s32 line);
|
OSMesg msg, const char* file, int line);
|
||||||
s32 DmaMgr_RequestSyncDebug(void* ram, uintptr_t vrom, size_t size, const char* file, s32 line);
|
s32 DmaMgr_RequestSyncDebug(void* ram, uintptr_t vrom, size_t size, const char* file, int line);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Special-purpose DMA Requests
|
// Special-purpose DMA Requests
|
||||||
|
|
2
spec
2
spec
|
@ -482,7 +482,7 @@ beginseg
|
||||||
include "$(BUILD_DIR)/src/code/code_800FCE80.o"
|
include "$(BUILD_DIR)/src/code/code_800FCE80.o"
|
||||||
include "$(BUILD_DIR)/src/code/fp.o"
|
include "$(BUILD_DIR)/src/code/fp.o"
|
||||||
include "$(BUILD_DIR)/src/code/system_malloc.o"
|
include "$(BUILD_DIR)/src/code/system_malloc.o"
|
||||||
include "$(BUILD_DIR)/src/code/code_800FD970.o"
|
include "$(BUILD_DIR)/src/code/rand.o"
|
||||||
include "$(BUILD_DIR)/src/code/__osMalloc.o"
|
include "$(BUILD_DIR)/src/code/__osMalloc.o"
|
||||||
#if !OOT_DEBUG
|
#if !OOT_DEBUG
|
||||||
include "$(BUILD_DIR)/src/libultra/libc/sprintf.o"
|
include "$(BUILD_DIR)/src/libultra/libc/sprintf.o"
|
||||||
|
|
|
@ -44,18 +44,20 @@ s8 gSfxDefaultReverb = 0;
|
||||||
|
|
||||||
s32 D_801333EC = 0; // unused
|
s32 D_801333EC = 0; // unused
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
u8 D_801333F0 = 0;
|
u8 D_801333F0 = 0;
|
||||||
|
|
||||||
u8 gAudioSfxSwapOff = 0;
|
u8 gAudioSfxSwapOff = 0;
|
||||||
|
|
||||||
u8 D_801333F8 = 0;
|
u8 D_801333F8 = 0;
|
||||||
|
|
||||||
s32 D_801333FC = 0; // unused
|
s32 D_801333FC = 0; // unused
|
||||||
|
#endif
|
||||||
|
|
||||||
u8 gSeqCmdWritePos = 0;
|
u8 gSeqCmdWritePos = 0;
|
||||||
u8 gSeqCmdReadPos = 0;
|
u8 gSeqCmdReadPos = 0;
|
||||||
u8 gStartSeqDisabled = false;
|
u8 gStartSeqDisabled = false;
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
u8 gAudioDebugPrintSeqCmd = true;
|
u8 gAudioDebugPrintSeqCmd = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
u8 gSoundModeList[] = {
|
u8 gSoundModeList[] = {
|
||||||
SOUNDMODE_STEREO,
|
SOUNDMODE_STEREO,
|
||||||
|
|
|
@ -1212,8 +1212,10 @@ OcarinaSongButtons gOcarinaSongButtons[OCARINA_SONG_MAX] = {
|
||||||
{ 0, { 0 } },
|
{ 0, { 0 } },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
u32 sAudioUpdateStartTime;
|
u32 sAudioUpdateStartTime;
|
||||||
u32 sAudioUpdateEndTime;
|
u32 sAudioUpdateEndTime;
|
||||||
|
#endif
|
||||||
f32 D_8016B7A8;
|
f32 D_8016B7A8;
|
||||||
f32 D_8016B7AC;
|
f32 D_8016B7AC;
|
||||||
f32 D_8016B7B0;
|
f32 D_8016B7B0;
|
||||||
|
@ -1223,20 +1225,26 @@ FreqLerp sWaterfallFreqScaleLerp;
|
||||||
f32 D_8016B7D8;
|
f32 D_8016B7D8;
|
||||||
s8 D_8016B7DC;
|
s8 D_8016B7DC;
|
||||||
f32 D_8016B7E0;
|
f32 D_8016B7E0;
|
||||||
|
#if OOT_DEBUG
|
||||||
u16 D_8016B7E4;
|
u16 D_8016B7E4;
|
||||||
struct {
|
struct {
|
||||||
char str[5];
|
char str[5];
|
||||||
u16 num;
|
u16 num;
|
||||||
} sAudioScrPrtBuf[SCROLL_PRINT_BUF_SIZE];
|
} sAudioScrPrtBuf[SCROLL_PRINT_BUF_SIZE];
|
||||||
|
#endif
|
||||||
u8 sRiverSoundMainBgmVol;
|
u8 sRiverSoundMainBgmVol;
|
||||||
u8 sRiverSoundMainBgmCurrentVol;
|
u8 sRiverSoundMainBgmCurrentVol;
|
||||||
u8 sRiverSoundMainBgmLower;
|
u8 sRiverSoundMainBgmLower;
|
||||||
u8 sRiverSoundMainBgmRestore;
|
u8 sRiverSoundMainBgmRestore;
|
||||||
u8 sGanonsTowerVol;
|
u8 sGanonsTowerVol;
|
||||||
SfxPlayerState sSfxChannelState[0x10];
|
SfxPlayerState sSfxChannelState[0x10];
|
||||||
|
#if OOT_DEBUG
|
||||||
char sBinToStrBuf[0x20];
|
char sBinToStrBuf[0x20];
|
||||||
|
#endif
|
||||||
u8 sMalonSingingTimer;
|
u8 sMalonSingingTimer;
|
||||||
|
#if OOT_DEBUG
|
||||||
u8 sAudioSpecPeakNumNotes[0x12];
|
u8 sAudioSpecPeakNumNotes[0x12];
|
||||||
|
#endif
|
||||||
u8 sMalonSingingDisabled;
|
u8 sMalonSingingDisabled;
|
||||||
u8 D_8016B9F3;
|
u8 D_8016B9F3;
|
||||||
u8 sFanfareStartTimer;
|
u8 sFanfareStartTimer;
|
||||||
|
@ -1264,8 +1272,10 @@ u16 sMusicStaffCurHeldLength[OCARINA_SONG_MAX];
|
||||||
u16 sMusicStaffExpectedLength[OCARINA_SONG_MAX];
|
u16 sMusicStaffExpectedLength[OCARINA_SONG_MAX];
|
||||||
u8 sMusicStaffExpectedPitch[OCARINA_SONG_MAX];
|
u8 sMusicStaffExpectedPitch[OCARINA_SONG_MAX];
|
||||||
OcarinaNote sScarecrowsLongSongSecondNote;
|
OcarinaNote sScarecrowsLongSongSecondNote;
|
||||||
|
#if OOT_DEBUG
|
||||||
u8 sIsMalonSinging;
|
u8 sIsMalonSinging;
|
||||||
f32 sMalonSingingDist;
|
f32 sMalonSingingDist;
|
||||||
|
#endif
|
||||||
|
|
||||||
void PadMgr_RequestPadData(PadMgr* padMgr, Input* inputs, s32 gameRequest);
|
void PadMgr_RequestPadData(PadMgr* padMgr, Input* inputs, s32 gameRequest);
|
||||||
|
|
||||||
|
|
|
@ -33,9 +33,12 @@ ActiveSfx gActiveSfx[7][3];
|
||||||
u8 sCurSfxPlayerChannelIndex;
|
u8 sCurSfxPlayerChannelIndex;
|
||||||
u8 gSfxBankMuted[7];
|
u8 gSfxBankMuted[7];
|
||||||
UnusedBankLerp sUnusedBankLerp[7];
|
UnusedBankLerp sUnusedBankLerp[7];
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
u16 gAudioSfxSwapSource[10];
|
u16 gAudioSfxSwapSource[10];
|
||||||
u16 gAudioSfxSwapTarget[10];
|
u16 gAudioSfxSwapTarget[10];
|
||||||
u8 gAudioSfxSwapMode[10];
|
u8 gAudioSfxSwapMode[10];
|
||||||
|
#endif
|
||||||
|
|
||||||
void Audio_SetSfxBanksMute(u16 muteMask) {
|
void Audio_SetSfxBanksMute(u16 muteMask) {
|
||||||
u8 bankId;
|
u8 bankId;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
OSPiHandle* sISVHandle; // official name : is_Handle
|
|
||||||
|
|
||||||
#define gISVDbgPrnAdrs ((ISVDbg*)0xB3FF0000)
|
#define gISVDbgPrnAdrs ((ISVDbg*)0xB3FF0000)
|
||||||
#define ASCII_TO_U32(a, b, c, d) ((u32)((a << 24) | (b << 16) | (c << 8) | (d << 0)))
|
#define ASCII_TO_U32(a, b, c, d) ((u32)((a << 24) | (b << 16) | (c << 8) | (d << 0)))
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
|
OSPiHandle* sISVHandle; // official name : is_Handle
|
||||||
|
|
||||||
void isPrintfInit(void) {
|
void isPrintfInit(void) {
|
||||||
sISVHandle = osCartRomInit();
|
sISVHandle = osCartRomInit();
|
||||||
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->put, 0);
|
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->put, 0);
|
||||||
|
@ -95,7 +95,7 @@ void* is_proutSyncPrintf(void* arg, const char* str, size_t count) {
|
||||||
return (void*)1;
|
return (void*)1;
|
||||||
}
|
}
|
||||||
|
|
||||||
NORETURN void func_80002384(const char* exp, const char* file, u32 line) {
|
NORETURN void func_80002384(const char* exp, const char* file, int line) {
|
||||||
osSyncPrintf("File:%s Line:%d %s \n", file, line, exp);
|
osSyncPrintf("File:%s Line:%d %s \n", file, line, exp);
|
||||||
while (true) {
|
while (true) {
|
||||||
;
|
;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
f32 LogUtils_CheckFloatRange(const char* exp, s32 line, const char* valueName, f32 value, const char* minName, f32 min,
|
f32 LogUtils_CheckFloatRange(const char* exp, int line, const char* valueName, f32 value, const char* minName, f32 min,
|
||||||
const char* maxName, f32 max) {
|
const char* maxName, f32 max) {
|
||||||
if (value < min || max < value) {
|
if (value < min || max < value) {
|
||||||
PRINTF("%s %d: range error %s(%f) < %s(%f) < %s(%f)\n", exp, line, minName, min, valueName, value, maxName,
|
PRINTF("%s %d: range error %s(%f) < %s(%f) < %s(%f)\n", exp, line, minName, min, valueName, value, maxName,
|
||||||
|
@ -11,7 +11,7 @@ f32 LogUtils_CheckFloatRange(const char* exp, s32 line, const char* valueName, f
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 LogUtils_CheckIntRange(const char* exp, s32 line, const char* valueName, s32 value, const char* minName, s32 min,
|
s32 LogUtils_CheckIntRange(const char* exp, int line, const char* valueName, s32 value, const char* minName, s32 min,
|
||||||
const char* maxName, s32 max) {
|
const char* maxName, s32 max) {
|
||||||
if (value < min || max < value) {
|
if (value < min || max < value) {
|
||||||
PRINTF("%s %d: range error %s(%d) < %s(%d) < %s(%d)\n", exp, line, minName, min, valueName, value, maxName,
|
PRINTF("%s %d: range error %s(%d) < %s(%d) < %s(%d)\n", exp, line, minName, min, valueName, value, maxName,
|
||||||
|
@ -73,11 +73,11 @@ void LogUtils_LogHexDump(void* ptr, s32 size0) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogUtils_LogPointer(s32 value, u32 max, void* ptr, const char* name, const char* file, s32 line) {
|
void LogUtils_LogPointer(s32 value, u32 max, void* ptr, const char* name, const char* file, int line) {
|
||||||
PRINTF(VT_COL(RED, WHITE) "%s %d %s[%d] max=%u ptr=%08x\n" VT_RST, file, line, name, value, max, ptr);
|
PRINTF(VT_COL(RED, WHITE) "%s %d %s[%d] max=%u ptr=%08x\n" VT_RST, file, line, name, value, max, ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* file, s32 line) {
|
void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* file, int line) {
|
||||||
u32 mask = (unk - 1);
|
u32 mask = (unk - 1);
|
||||||
|
|
||||||
if (value & mask) {
|
if (value & mask) {
|
||||||
|
@ -85,24 +85,24 @@ void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* fi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, s32 line) {
|
void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, int line) {
|
||||||
if (ptr == NULL) {
|
if (ptr == NULL) {
|
||||||
PRINTF(VT_COL(RED, WHITE) "%s %d:%s は はヌルポインタです\n" VT_RST, file, line, exp);
|
PRINTF(VT_COL(RED, WHITE) "%s %d:%s は はヌルポインタです\n" VT_RST, file, line, exp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogUtils_CheckValidPointer(const char* exp, void* ptr, const char* file, s32 line) {
|
void LogUtils_CheckValidPointer(const char* exp, void* ptr, const char* file, int line) {
|
||||||
if (ptr == NULL || (u32)ptr < 0x80000000 || (0x80000000 + osMemSize) <= (u32)ptr) {
|
if (ptr == NULL || (u32)ptr < 0x80000000 || (0x80000000 + osMemSize) <= (u32)ptr) {
|
||||||
PRINTF(VT_COL(RED, WHITE) "%s %d:ポインタ %s(%08x) が異常です\n" VT_RST, file, line, exp, ptr);
|
PRINTF(VT_COL(RED, WHITE) "%s %d:ポインタ %s(%08x) が異常です\n" VT_RST, file, line, exp, ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogUtils_LogThreadId(const char* name, s32 line) {
|
void LogUtils_LogThreadId(const char* name, int line) {
|
||||||
PRINTF("<%d %s %d>", osGetThreadId(NULL), name, line);
|
PRINTF("<%d %s %d>", osGetThreadId(NULL), name, line);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void LogUtils_HungupThread(const char* name, s32 line) {
|
void LogUtils_HungupThread(const char* name, int line) {
|
||||||
OSId threadId = osGetThreadId(NULL);
|
OSId threadId = osGetThreadId(NULL);
|
||||||
|
|
||||||
PRINTF("*** HungUp in thread %d, [%s:%d] ***\n", threadId, name, line);
|
PRINTF("*** HungUp in thread %d, [%s:%d] ***\n", threadId, name, line);
|
||||||
|
|
|
@ -98,6 +98,11 @@ u32 StackCheck_GetState(StackEntry* entry) {
|
||||||
ret = STACK_STATUS_OK;
|
ret = STACK_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !OOT_DEBUG
|
||||||
|
// This string is still in .rodata for retail builds
|
||||||
|
(void)"(null)";
|
||||||
|
#endif
|
||||||
|
|
||||||
PRINTF("head=%08x tail=%08x last=%08x used=%08x free=%08x [%s]\n", entry->head, entry->tail, last, used, free,
|
PRINTF("head=%08x tail=%08x last=%08x used=%08x free=%08x [%s]\n", entry->head, entry->tail, last, used, free,
|
||||||
entry->name != NULL ? entry->name : "(null)");
|
entry->name != NULL ? entry->name : "(null)");
|
||||||
PRINTF(VT_RST);
|
PRINTF(VT_RST);
|
||||||
|
|
|
@ -598,7 +598,7 @@ void DmaMgr_Init(void) {
|
||||||
* @see DmaMgr_RequestAsync
|
* @see DmaMgr_RequestAsync
|
||||||
*/
|
*/
|
||||||
s32 DmaMgr_RequestAsyncDebug(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk5, OSMesgQueue* queue,
|
s32 DmaMgr_RequestAsyncDebug(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk5, OSMesgQueue* queue,
|
||||||
OSMesg msg, const char* file, s32 line) {
|
OSMesg msg, const char* file, int line) {
|
||||||
req->filename = file;
|
req->filename = file;
|
||||||
req->line = line;
|
req->line = line;
|
||||||
return DmaMgr_RequestAsync(req, ram, vrom, size, unk5, queue, msg);
|
return DmaMgr_RequestAsync(req, ram, vrom, size, unk5, queue, msg);
|
||||||
|
@ -609,7 +609,7 @@ s32 DmaMgr_RequestAsyncDebug(DmaRequest* req, void* ram, uintptr_t vrom, size_t
|
||||||
*
|
*
|
||||||
* @see DmaMgr_RequestSync
|
* @see DmaMgr_RequestSync
|
||||||
*/
|
*/
|
||||||
s32 DmaMgr_RequestSyncDebug(void* ram, uintptr_t vrom, size_t size, const char* file, s32 line) {
|
s32 DmaMgr_RequestSyncDebug(void* ram, uintptr_t vrom, size_t size, const char* file, int line) {
|
||||||
DmaRequest req;
|
DmaRequest req;
|
||||||
s32 ret;
|
s32 ret;
|
||||||
OSMesgQueue queue;
|
OSMesgQueue queue;
|
||||||
|
|
|
@ -100,7 +100,7 @@ void ArenaImpl_UnsetCheckFreeBlock(Arena* arena) {
|
||||||
arena->flag &= ~CHECK_FREE_BLOCK_FLAG;
|
arena->flag &= ~CHECK_FREE_BLOCK_FLAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArenaImpl_SetDebugInfo(ArenaNode* node, const char* file, s32 line, Arena* arena) {
|
void ArenaImpl_SetDebugInfo(ArenaNode* node, const char* file, int line, Arena* arena) {
|
||||||
node->filename = file;
|
node->filename = file;
|
||||||
node->line = line;
|
node->line = line;
|
||||||
node->threadId = osGetThreadId(NULL);
|
node->threadId = osGetThreadId(NULL);
|
||||||
|
@ -254,7 +254,7 @@ void __osMalloc_FreeBlockTest(Arena* arena, ArenaNode* node) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void* __osMalloc_NoLockDebug(Arena* arena, u32 size, const char* file, s32 line) {
|
void* __osMalloc_NoLockDebug(Arena* arena, u32 size, const char* file, int line) {
|
||||||
ArenaNode* iter;
|
ArenaNode* iter;
|
||||||
u32 blockSize;
|
u32 blockSize;
|
||||||
ArenaNode* newNode;
|
ArenaNode* newNode;
|
||||||
|
@ -299,7 +299,7 @@ void* __osMalloc_NoLockDebug(Arena* arena, u32 size, const char* file, s32 line)
|
||||||
return alloc;
|
return alloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void* __osMallocDebug(Arena* arena, u32 size, const char* file, s32 line) {
|
void* __osMallocDebug(Arena* arena, u32 size, const char* file, int line) {
|
||||||
void* alloc;
|
void* alloc;
|
||||||
|
|
||||||
ArenaImpl_Lock(arena);
|
ArenaImpl_Lock(arena);
|
||||||
|
@ -309,7 +309,7 @@ void* __osMallocDebug(Arena* arena, u32 size, const char* file, s32 line) {
|
||||||
return alloc;
|
return alloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void* __osMallocRDebug(Arena* arena, u32 size, const char* file, s32 line) {
|
void* __osMallocRDebug(Arena* arena, u32 size, const char* file, int line) {
|
||||||
ArenaNode* iter;
|
ArenaNode* iter;
|
||||||
ArenaNode* newNode;
|
ArenaNode* newNode;
|
||||||
u32 blockSize;
|
u32 blockSize;
|
||||||
|
@ -528,7 +528,7 @@ void __osFree(Arena* arena, void* ptr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, s32 line) {
|
void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, int line) {
|
||||||
ArenaNode* node;
|
ArenaNode* node;
|
||||||
ArenaNode* next;
|
ArenaNode* next;
|
||||||
ArenaNode* prev;
|
ArenaNode* prev;
|
||||||
|
@ -586,7 +586,7 @@ void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, s32 line) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void __osFreeDebug(Arena* arena, void* ptr, const char* file, s32 line) {
|
void __osFreeDebug(Arena* arena, void* ptr, const char* file, int line) {
|
||||||
ArenaImpl_Lock(arena);
|
ArenaImpl_Lock(arena);
|
||||||
__osFree_NoLockDebug(arena, ptr, file, line);
|
__osFree_NoLockDebug(arena, ptr, file, line);
|
||||||
ArenaImpl_Unlock(arena);
|
ArenaImpl_Unlock(arena);
|
||||||
|
@ -695,7 +695,7 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, s32 line) {
|
void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, int line) {
|
||||||
return __osRealloc(arena, ptr, newSize);
|
return __osRealloc(arena, ptr, newSize);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,79 +0,0 @@
|
||||||
#include "global.h"
|
|
||||||
|
|
||||||
// The latest generated random number, used to generate the next number in the sequence.
|
|
||||||
static u32 sRandInt = 1;
|
|
||||||
|
|
||||||
// Space to store a value to be re-interpreted as a float.
|
|
||||||
static u32 sRandFloat;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the next integer in the sequence of pseudo-random numbers.
|
|
||||||
*/
|
|
||||||
u32 Rand_Next(void) {
|
|
||||||
return sRandInt = (sRandInt * 1664525) + 1013904223;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Seeds the pseudo-random number generator by providing a starting value.
|
|
||||||
*/
|
|
||||||
void Rand_Seed(u32 seed) {
|
|
||||||
sRandInt = seed;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a pseudo-random floating-point number between 0.0f and 1.0f, by generating
|
|
||||||
* the next integer and masking it to an IEEE-754 compliant floating-point number
|
|
||||||
* between 1.0f and 2.0f, returning the result subtract 1.0f.
|
|
||||||
*/
|
|
||||||
f32 Rand_ZeroOne(void) {
|
|
||||||
sRandInt = (sRandInt * 1664525) + 1013904223;
|
|
||||||
sRandFloat = ((sRandInt >> 9) | 0x3F800000);
|
|
||||||
return *((f32*)&sRandFloat) - 1.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a pseudo-random floating-point number between -0.5f and 0.5f by the same
|
|
||||||
* manner in which Rand_ZeroOne generates its result.
|
|
||||||
*/
|
|
||||||
f32 Rand_Centered(void) {
|
|
||||||
sRandInt = (sRandInt * 1664525) + 1013904223;
|
|
||||||
sRandFloat = ((sRandInt >> 9) | 0x3F800000);
|
|
||||||
return *((f32*)&sRandFloat) - 1.5f;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Seeds a pseudo-random number at rndNum with a provided seed.
|
|
||||||
*/
|
|
||||||
void Rand_Seed_Variable(u32* rndNum, u32 seed) {
|
|
||||||
*rndNum = seed;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates the next pseudo-random integer from the provided rndNum.
|
|
||||||
*/
|
|
||||||
u32 Rand_Next_Variable(u32* rndNum) {
|
|
||||||
return *rndNum = (*rndNum * 1664525) + 1013904223;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates the next pseudo-random floating-point number between 0.0f and
|
|
||||||
* 1.0f from the provided rndNum.
|
|
||||||
*/
|
|
||||||
f32 Rand_ZeroOne_Variable(u32* rndNum) {
|
|
||||||
u32 next = (*rndNum * 1664525) + 1013904223;
|
|
||||||
|
|
||||||
sRandFloat = ((*rndNum = next) >> 9) | 0x3F800000;
|
|
||||||
return *((f32*)&sRandFloat) - 1.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates the next pseudo-random floating-point number between -0.5f and
|
|
||||||
* 0.5f from the provided rndNum.
|
|
||||||
*/
|
|
||||||
f32 Rand_Centered_Variable(u32* rndNum) {
|
|
||||||
u32 next = (*rndNum * 1664525) + 1013904223;
|
|
||||||
|
|
||||||
*rndNum = next;
|
|
||||||
sRandFloat = (next >> 9) | 0x3F800000;
|
|
||||||
return *((f32*)&sRandFloat) - 1.5f;
|
|
||||||
}
|
|
|
@ -36,7 +36,7 @@ void* DebugArena_Malloc(u32 size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void* DebugArena_MallocDebug(u32 size, const char* file, s32 line) {
|
void* DebugArena_MallocDebug(u32 size, const char* file, int line) {
|
||||||
void* ptr = __osMallocDebug(&sDebugArena, size, file, line);
|
void* ptr = __osMallocDebug(&sDebugArena, size, file, line);
|
||||||
|
|
||||||
DEBUG_ARENA_CHECK_POINTER(ptr, size, "debug_malloc_DEBUG", "確保"); // "Secure"
|
DEBUG_ARENA_CHECK_POINTER(ptr, size, "debug_malloc_DEBUG", "確保"); // "Secure"
|
||||||
|
@ -52,7 +52,7 @@ void* DebugArena_MallocR(u32 size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void* DebugArena_MallocRDebug(u32 size, const char* file, s32 line) {
|
void* DebugArena_MallocRDebug(u32 size, const char* file, int line) {
|
||||||
void* ptr = __osMallocRDebug(&sDebugArena, size, file, line);
|
void* ptr = __osMallocRDebug(&sDebugArena, size, file, line);
|
||||||
|
|
||||||
DEBUG_ARENA_CHECK_POINTER(ptr, size, "debug_malloc_r_DEBUG", "確保"); // "Secure"
|
DEBUG_ARENA_CHECK_POINTER(ptr, size, "debug_malloc_r_DEBUG", "確保"); // "Secure"
|
||||||
|
@ -67,7 +67,7 @@ void* DebugArena_Realloc(void* ptr, u32 newSize) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) {
|
void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line) {
|
||||||
ptr = __osReallocDebug(&sDebugArena, ptr, newSize, file, line);
|
ptr = __osReallocDebug(&sDebugArena, ptr, newSize, file, line);
|
||||||
DEBUG_ARENA_CHECK_POINTER(ptr, newSize, "debug_realloc_DEBUG", "再確保"); // "Re-securing"
|
DEBUG_ARENA_CHECK_POINTER(ptr, newSize, "debug_realloc_DEBUG", "再確保"); // "Re-securing"
|
||||||
return ptr;
|
return ptr;
|
||||||
|
@ -79,7 +79,7 @@ void DebugArena_Free(void* ptr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void DebugArena_FreeDebug(void* ptr, const char* file, s32 line) {
|
void DebugArena_FreeDebug(void* ptr, const char* file, int line) {
|
||||||
__osFreeDebug(&sDebugArena, ptr, file, line);
|
__osFreeDebug(&sDebugArena, ptr, file, line);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1322,7 +1322,7 @@ NORETURN void Fault_AddHungupAndCrashImpl(const char* exp1, const char* exp2) {
|
||||||
* Like `Fault_AddHungupAndCrashImpl`, however provides a fixed message containing
|
* Like `Fault_AddHungupAndCrashImpl`, however provides a fixed message containing
|
||||||
* filename and line number
|
* filename and line number
|
||||||
*/
|
*/
|
||||||
NORETURN void Fault_AddHungupAndCrash(const char* file, s32 line) {
|
NORETURN void Fault_AddHungupAndCrash(const char* file, int line) {
|
||||||
char msg[256];
|
char msg[256];
|
||||||
|
|
||||||
sprintf(msg, "HungUp %s:%d", file, line);
|
sprintf(msg, "HungUp %s:%d", file, line);
|
||||||
|
|
|
@ -102,11 +102,11 @@ FaultDrawer sFaultDrawerDefault = {
|
||||||
#ifndef NON_MATCHING
|
#ifndef NON_MATCHING
|
||||||
// TODO: match .bss (has reordering issues)
|
// TODO: match .bss (has reordering issues)
|
||||||
extern FaultDrawer sFaultDrawer;
|
extern FaultDrawer sFaultDrawer;
|
||||||
extern char D_8016B6BC[0x24];
|
extern char D_8016B6C0[0x20];
|
||||||
#else
|
#else
|
||||||
// Non-matching version for struct shiftability
|
// Non-matching version for struct shiftability
|
||||||
FaultDrawer sFaultDrawer;
|
FaultDrawer sFaultDrawer;
|
||||||
char D_8016B6BC[0x24];
|
char D_8016B6C0[0x20];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled) {
|
void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled) {
|
||||||
|
|
|
@ -6,10 +6,11 @@ VisCvg sVisCvg;
|
||||||
VisZBuf sVisZBuf;
|
VisZBuf sVisZBuf;
|
||||||
VisMono sVisMono;
|
VisMono sVisMono;
|
||||||
ViMode sViMode;
|
ViMode sViMode;
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
FaultClient sGameFaultClient;
|
FaultClient sGameFaultClient;
|
||||||
u16 sLastButtonPressed;
|
u16 sLastButtonPressed;
|
||||||
|
|
||||||
#if OOT_DEBUG
|
|
||||||
void GameState_FaultPrint(void) {
|
void GameState_FaultPrint(void) {
|
||||||
static char sBtnChars[] = "ABZSuldr*+LRudlr";
|
static char sBtnChars[] = "ABZSuldr*+LRudlr";
|
||||||
s32 i;
|
s32 i;
|
||||||
|
@ -408,7 +409,10 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g
|
||||||
gameState->destroy = NULL;
|
gameState->destroy = NULL;
|
||||||
gameState->running = 1;
|
gameState->running = 1;
|
||||||
startTime = osGetTime();
|
startTime = osGetTime();
|
||||||
gameState->size = gameState->init = 0;
|
|
||||||
|
// Thse assignments must be written this way for matching and to avoid a warning due to casting a pointer to an
|
||||||
|
// integer without a cast. This assigns init = NULL and size = 0.
|
||||||
|
gameState->size = (u32)(gameState->init = NULL);
|
||||||
|
|
||||||
{
|
{
|
||||||
s32 requiredScopeTemp;
|
s32 requiredScopeTemp;
|
||||||
|
@ -494,7 +498,7 @@ u32 GameState_IsRunning(GameState* gameState) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void* GameState_Alloc(GameState* gameState, size_t size, char* file, s32 line) {
|
void* GameState_Alloc(GameState* gameState, size_t size, const char* file, int line) {
|
||||||
void* ret;
|
void* ret;
|
||||||
|
|
||||||
if (THA_IsCrash(&gameState->tha)) {
|
if (THA_IsCrash(&gameState->tha)) {
|
||||||
|
|
|
@ -13,7 +13,7 @@ void GameAlloc_Log(GameAlloc* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 line) {
|
void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, int line) {
|
||||||
GameAllocEntry* ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), file, line);
|
GameAllocEntry* ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), file, line);
|
||||||
|
|
||||||
if (ptr != NULL) {
|
if (ptr != NULL) {
|
||||||
|
|
|
@ -14,8 +14,13 @@ OSTime sGraphPrevUpdateEndTime;
|
||||||
*/
|
*/
|
||||||
OSTime sGraphPrevTaskTimeStart;
|
OSTime sGraphPrevTaskTimeStart;
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
FaultClient sGraphFaultClient;
|
FaultClient sGraphFaultClient;
|
||||||
|
#endif
|
||||||
|
|
||||||
CfbInfo sGraphCfbInfos[3];
|
CfbInfo sGraphCfbInfos[3];
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
FaultClient sGraphUcodeFaultClient;
|
FaultClient sGraphUcodeFaultClient;
|
||||||
|
|
||||||
UCodeInfo D_8012D230[3] = {
|
UCodeInfo D_8012D230[3] = {
|
||||||
|
@ -30,7 +35,6 @@ UCodeInfo D_8012D248[3] = {
|
||||||
{ UCODE_S2DEX, gspS2DEX2d_fifoTextStart },
|
{ UCODE_S2DEX, gspS2DEX2d_fifoTextStart },
|
||||||
};
|
};
|
||||||
|
|
||||||
#if OOT_DEBUG
|
|
||||||
void Graph_FaultClient(void) {
|
void Graph_FaultClient(void) {
|
||||||
void* nextFb = osViGetNextFramebuffer();
|
void* nextFb = osViGetNextFramebuffer();
|
||||||
void* newFb = (SysCfb_GetFbPtr(0) != nextFb) ? SysCfb_GetFbPtr(0) : SysCfb_GetFbPtr(1);
|
void* newFb = (SysCfb_GetFbPtr(0) != nextFb) ? SysCfb_GetFbPtr(0) : SysCfb_GetFbPtr(1);
|
||||||
|
@ -501,7 +505,7 @@ void* Graph_Alloc2(GraphicsContext* gfxCtx, size_t size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void Graph_OpenDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, s32 line) {
|
void Graph_OpenDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, int line) {
|
||||||
if (R_HREG_MODE == HREG_MODE_UCODE_DISAS && R_UCODE_DISAS_LOG_MODE != 4) {
|
if (R_HREG_MODE == HREG_MODE_UCODE_DISAS && R_UCODE_DISAS_LOG_MODE != 4) {
|
||||||
dispRefs[0] = gfxCtx->polyOpa.p;
|
dispRefs[0] = gfxCtx->polyOpa.p;
|
||||||
dispRefs[1] = gfxCtx->polyXlu.p;
|
dispRefs[1] = gfxCtx->polyXlu.p;
|
||||||
|
@ -513,7 +517,7 @@ void Graph_OpenDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graph_CloseDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, s32 line) {
|
void Graph_CloseDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, int line) {
|
||||||
if (R_HREG_MODE == HREG_MODE_UCODE_DISAS && R_UCODE_DISAS_LOG_MODE != 4) {
|
if (R_HREG_MODE == HREG_MODE_UCODE_DISAS && R_UCODE_DISAS_LOG_MODE != 4) {
|
||||||
if (dispRefs[0] + 1 == gfxCtx->polyOpa.p) {
|
if (dispRefs[0] + 1 == gfxCtx->polyOpa.p) {
|
||||||
gfxCtx->polyOpa.p = dispRefs[0];
|
gfxCtx->polyOpa.p = dispRefs[0];
|
||||||
|
|
162
src/code/rand.c
Normal file
162
src/code/rand.c
Normal file
|
@ -0,0 +1,162 @@
|
||||||
|
/**
|
||||||
|
* @file rand.c
|
||||||
|
*
|
||||||
|
* This file implements the primary random number generator the game relies on. The generator is pseudo-random and
|
||||||
|
* implemented as a Linear Congruential Generator (LCG).
|
||||||
|
*
|
||||||
|
* A LCG computes random numbers sequentially via the relation
|
||||||
|
* X(n+1) = (a * X(n) + c) mod m
|
||||||
|
* where m is the modulus, a is the multiplier and c is the increment.
|
||||||
|
*
|
||||||
|
* These three parameters (a,c,m) completely specify the LCG and should be chosen such that
|
||||||
|
* - m > 0
|
||||||
|
* - 0 < a < m
|
||||||
|
* - 0 <= c < m
|
||||||
|
*
|
||||||
|
* The period of the LCG (a, c, m) is the smallest period p such that X(n + p) = X(n), past n=p the sequence will repeat
|
||||||
|
* itself in its outputs.
|
||||||
|
* A good LCG should have the maximum possible period, which will be equal to m as there are at most m possible values
|
||||||
|
* for X. This occurs when (Hull, T.E., & Dobell, A.R. (1962). Random Number Generators. Siam Review, 4, 230-254.):
|
||||||
|
* - m,c are relatively prime, that is the only integer that divides both m and c with no remainder is 1.
|
||||||
|
* - a - 1 is divisible by all prime factors of m.
|
||||||
|
* - a - 1 is divisible by 4 if m is divisible by 4.
|
||||||
|
*
|
||||||
|
* Ideally m is chosen to be a large power of 2 so that the modulo operation is inexpensive to compute. In this case the
|
||||||
|
* prime factors of m = 2^k are just k copies of 2. For k > 1 m is divisible by 4, so a - 1 must be divisible by 4. 2^k
|
||||||
|
* and c can easily be made relatively prime by making c an odd number.
|
||||||
|
* If we let k=32 to match the size of an integer, the modulo operation is made implicit by the width of the data type
|
||||||
|
* and becomes free to compute.
|
||||||
|
*
|
||||||
|
* The parameter a should be selected such that a-1 is divisible by 4 (and hence divisible by 2) and c should be any odd
|
||||||
|
* number. The precise values should fare well against the spectral test, a measure of "how random" a particular LCG is.
|
||||||
|
* A pair (a,c) that satisfies these requirements is (1664525, 1013904223), recommended by "Numerical Recipes in C: The
|
||||||
|
* Art of Scientific Computing" (p. 284).
|
||||||
|
*
|
||||||
|
* Therefore, the LCG with parameters (1664525, 1013904223, 2^32) that is implemented in this file has a maximal period
|
||||||
|
* of 2^32 and produces high-quality pseudo-random numbers.
|
||||||
|
*
|
||||||
|
* @note If sampling the LCG for a n-bit number it is important to use the upper n bits instead of the lower n bits of
|
||||||
|
* the LCG output. The lower n bits only have a period of 2^n which may significantly worsen the quality of the
|
||||||
|
* resulting random numbers compared to the quality of the full 32-bit result.
|
||||||
|
*
|
||||||
|
* @note Original name: qrand.c
|
||||||
|
*/
|
||||||
|
#include "ultra64.h"
|
||||||
|
|
||||||
|
#define RAND_MULTIPLIER 1664525
|
||||||
|
#define RAND_INCREMENT 1013904223
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The latest generated random number, used to generate the next number in the sequence.
|
||||||
|
*
|
||||||
|
* @note Original name: __qrand_idum
|
||||||
|
*/
|
||||||
|
static u32 sRandInt = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Space to store a value to be re-interpreted as a float.
|
||||||
|
*
|
||||||
|
* @note Orignal name: __qrand_itemp
|
||||||
|
*/
|
||||||
|
static fu sRandFloat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the next integer in the sequence of pseudo-random numbers.
|
||||||
|
*
|
||||||
|
* @note Original name: qrand
|
||||||
|
*/
|
||||||
|
u32 Rand_Next(void) {
|
||||||
|
return sRandInt = sRandInt * RAND_MULTIPLIER + RAND_INCREMENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Seeds the pseudo-random number generator by providing a starting value.
|
||||||
|
*
|
||||||
|
* @note Original name: sqrand
|
||||||
|
*/
|
||||||
|
void Rand_Seed(u32 seed) {
|
||||||
|
sRandInt = seed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a pseudo-random floating-point number between 0.0f and 1.0f, by generating the next integer and masking it
|
||||||
|
* to an IEEE-754 compliant floating-point number between 1.0f and 2.0f, returning the result subtract 1.0f.
|
||||||
|
*
|
||||||
|
* @note This technique for generating pseudo-random floats is recommended as a particularly fast but potentially
|
||||||
|
* non-portable generator in "Numerical Recipes in C: The Art of Scientic Computing", pp. 284-5.
|
||||||
|
*
|
||||||
|
* @note Original name: fqrand
|
||||||
|
*/
|
||||||
|
f32 Rand_ZeroOne(void) {
|
||||||
|
sRandInt = sRandInt * RAND_MULTIPLIER + RAND_INCREMENT;
|
||||||
|
// Samples the upper 23 bits to avoid effectively reducing the LCG period.
|
||||||
|
sRandFloat.i = (sRandInt >> 9) | 0x3F800000;
|
||||||
|
return sRandFloat.f - 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a pseudo-random floating-point number between -0.5f and 0.5f by the same manner in which Rand_ZeroOne
|
||||||
|
* generates its result.
|
||||||
|
*
|
||||||
|
* @see Rand_ZeroOne
|
||||||
|
*
|
||||||
|
* @note Original name: fqrand2
|
||||||
|
*/
|
||||||
|
f32 Rand_Centered(void) {
|
||||||
|
sRandInt = sRandInt * RAND_MULTIPLIER + RAND_INCREMENT;
|
||||||
|
sRandFloat.i = (sRandInt >> 9) | 0x3F800000;
|
||||||
|
return sRandFloat.f - 1.5f;
|
||||||
|
}
|
||||||
|
|
||||||
|
//! All functions below are unused variants of the above four, that use a provided random number variable instead of the
|
||||||
|
//! internal `sRandInt`
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Seeds a pseudo-random number at rndNum with a provided starting value.
|
||||||
|
*
|
||||||
|
* @see Rand_Seed
|
||||||
|
*
|
||||||
|
* @note Original name: sqrand_r
|
||||||
|
*/
|
||||||
|
void Rand_Seed_Variable(u32* rndNum, u32 seed) {
|
||||||
|
*rndNum = seed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates the next pseudo-random integer from the provided rndNum.
|
||||||
|
*
|
||||||
|
* @see Rand_Next
|
||||||
|
*
|
||||||
|
* @note Original name: qrand_r
|
||||||
|
*/
|
||||||
|
u32 Rand_Next_Variable(u32* rndNum) {
|
||||||
|
return *rndNum = (*rndNum) * RAND_MULTIPLIER + RAND_INCREMENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates the next pseudo-random floating-point number between 0.0f and 1.0f from the provided rndNum.
|
||||||
|
*
|
||||||
|
* @see Rand_ZeroOne
|
||||||
|
*
|
||||||
|
* @note Original name: fqrand_r
|
||||||
|
*/
|
||||||
|
f32 Rand_ZeroOne_Variable(u32* rndNum) {
|
||||||
|
u32 next = (*rndNum) * RAND_MULTIPLIER + RAND_INCREMENT;
|
||||||
|
|
||||||
|
sRandFloat.i = ((*rndNum = next) >> 9) | 0x3F800000;
|
||||||
|
return sRandFloat.f - 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates the next pseudo-random floating-point number between -0.5f and 0.5f from the provided rndNum.
|
||||||
|
*
|
||||||
|
* @see Rand_ZeroOne, Rand_Centered
|
||||||
|
*
|
||||||
|
* @note Original name: fqrand2_r
|
||||||
|
*/
|
||||||
|
f32 Rand_Centered_Variable(u32* rndNum) {
|
||||||
|
u32 next = (*rndNum) * RAND_MULTIPLIER + RAND_INCREMENT;
|
||||||
|
|
||||||
|
sRandFloat.i = ((*rndNum = next) >> 9) | 0x3F800000;
|
||||||
|
return sRandFloat.f - 1.5f;
|
||||||
|
}
|
|
@ -45,14 +45,14 @@
|
||||||
#define RDP_DONE_MSG 668
|
#define RDP_DONE_MSG 668
|
||||||
#define NOTIFY_MSG 670 // original name: ENTRY_MSG
|
#define NOTIFY_MSG 670 // original name: ENTRY_MSG
|
||||||
|
|
||||||
vs32 sSchedDebugPrintfEnabled = false;
|
|
||||||
|
|
||||||
OSTime sRSPGfxTimeStart;
|
OSTime sRSPGfxTimeStart;
|
||||||
OSTime sRSPAudioTimeStart;
|
OSTime sRSPAudioTimeStart;
|
||||||
OSTime sRSPOtherTimeStart;
|
OSTime sRSPOtherTimeStart;
|
||||||
OSTime sRDPTimeStart;
|
OSTime sRDPTimeStart;
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
|
vs32 sSchedDebugPrintfEnabled = false;
|
||||||
|
|
||||||
#define SCHED_DEBUG_PRINTF \
|
#define SCHED_DEBUG_PRINTF \
|
||||||
if (sSchedDebugPrintfEnabled) \
|
if (sSchedDebugPrintfEnabled) \
|
||||||
PRINTF
|
PRINTF
|
||||||
|
|
|
@ -605,11 +605,11 @@ Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest) {
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
|
|
||||||
Mtx* Matrix_ToMtx(Mtx* dest, char* file, s32 line) {
|
Mtx* Matrix_ToMtx(Mtx* dest, const char* file, int line) {
|
||||||
return Matrix_MtxFToMtx(MATRIX_CHECK_FLOATS(sCurrentMatrix, file, line), dest);
|
return Matrix_MtxFToMtx(MATRIX_CHECK_FLOATS(sCurrentMatrix, file, line), dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, char* file, s32 line) {
|
Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, const char* file, int line) {
|
||||||
return Matrix_ToMtx(GRAPH_ALLOC(gfxCtx, sizeof(Mtx)), file, line);
|
return Matrix_ToMtx(GRAPH_ALLOC(gfxCtx, sizeof(Mtx)), file, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -970,7 +970,7 @@ void Matrix_RotateAxis(f32 angle, Vec3f* axis, u8 mode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line) {
|
MtxF* Matrix_CheckFloats(MtxF* mf, const char* file, int line) {
|
||||||
s32 i, j;
|
s32 i, j;
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
|
|
|
@ -36,7 +36,7 @@ void* SystemArena_Malloc(u32 size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void* SystemArena_MallocDebug(u32 size, const char* file, s32 line) {
|
void* SystemArena_MallocDebug(u32 size, const char* file, int line) {
|
||||||
void* ptr = __osMallocDebug(&gSystemArena, size, file, line);
|
void* ptr = __osMallocDebug(&gSystemArena, size, file, line);
|
||||||
|
|
||||||
SYSTEM_ARENA_CHECK_POINTER(ptr, size, "malloc_DEBUG", "確保"); // "Secure"
|
SYSTEM_ARENA_CHECK_POINTER(ptr, size, "malloc_DEBUG", "確保"); // "Secure"
|
||||||
|
@ -52,7 +52,7 @@ void* SystemArena_MallocR(u32 size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void* SystemArena_MallocRDebug(u32 size, const char* file, s32 line) {
|
void* SystemArena_MallocRDebug(u32 size, const char* file, int line) {
|
||||||
void* ptr = __osMallocRDebug(&gSystemArena, size, file, line);
|
void* ptr = __osMallocRDebug(&gSystemArena, size, file, line);
|
||||||
|
|
||||||
SYSTEM_ARENA_CHECK_POINTER(ptr, size, "malloc_r_DEBUG", "確保"); // "Secure"
|
SYSTEM_ARENA_CHECK_POINTER(ptr, size, "malloc_r_DEBUG", "確保"); // "Secure"
|
||||||
|
@ -67,7 +67,7 @@ void* SystemArena_Realloc(void* ptr, u32 newSize) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) {
|
void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line) {
|
||||||
ptr = __osReallocDebug(&gSystemArena, ptr, newSize, file, line);
|
ptr = __osReallocDebug(&gSystemArena, ptr, newSize, file, line);
|
||||||
SYSTEM_ARENA_CHECK_POINTER(ptr, newSize, "realloc_DEBUG", "再確保"); // "Re-securing"
|
SYSTEM_ARENA_CHECK_POINTER(ptr, newSize, "realloc_DEBUG", "再確保"); // "Re-securing"
|
||||||
return ptr;
|
return ptr;
|
||||||
|
@ -79,7 +79,7 @@ void SystemArena_Free(void* ptr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void SystemArena_FreeDebug(void* ptr, const char* file, s32 line) {
|
void SystemArena_FreeDebug(void* ptr, const char* file, int line) {
|
||||||
__osFreeDebug(&gSystemArena, ptr, file, line);
|
__osFreeDebug(&gSystemArena, ptr, file, line);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
#undef DEFINE_ACTOR_UNSET
|
#undef DEFINE_ACTOR_UNSET
|
||||||
|
|
||||||
// Actor Overlay Table definition
|
// Actor Overlay Table definition
|
||||||
|
#if OOT_DEBUG
|
||||||
|
|
||||||
#define DEFINE_ACTOR(name, _1, allocType, nameString) \
|
#define DEFINE_ACTOR(name, _1, allocType, nameString) \
|
||||||
{ (uintptr_t)_ovl_##name##SegmentRomStart, \
|
{ (uintptr_t)_ovl_##name##SegmentRomStart, \
|
||||||
(uintptr_t)_ovl_##name##SegmentRomEnd, \
|
(uintptr_t)_ovl_##name##SegmentRomEnd, \
|
||||||
|
@ -37,6 +39,24 @@
|
||||||
#define DEFINE_ACTOR_INTERNAL(name, _1, allocType, nameString) \
|
#define DEFINE_ACTOR_INTERNAL(name, _1, allocType, nameString) \
|
||||||
{ 0, 0, NULL, NULL, NULL, &name##_InitVars, nameString, allocType, 0 },
|
{ 0, 0, NULL, NULL, NULL, &name##_InitVars, nameString, allocType, 0 },
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
// Actor name is set to NULL in retail builds
|
||||||
|
#define DEFINE_ACTOR(name, _1, allocType, _3) \
|
||||||
|
{ (uintptr_t)_ovl_##name##SegmentRomStart, \
|
||||||
|
(uintptr_t)_ovl_##name##SegmentRomEnd, \
|
||||||
|
_ovl_##name##SegmentStart, \
|
||||||
|
_ovl_##name##SegmentEnd, \
|
||||||
|
NULL, \
|
||||||
|
&name##_InitVars, \
|
||||||
|
NULL, \
|
||||||
|
allocType, \
|
||||||
|
0 },
|
||||||
|
|
||||||
|
#define DEFINE_ACTOR_INTERNAL(name, _1, allocType, _3) { 0, 0, NULL, NULL, NULL, &name##_InitVars, NULL, allocType, 0 },
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#define DEFINE_ACTOR_UNSET(_0) { 0 },
|
#define DEFINE_ACTOR_UNSET(_0) { 0 },
|
||||||
|
|
||||||
ActorOverlay gActorOverlayTable[] = {
|
ActorOverlay gActorOverlayTable[] = {
|
||||||
|
|
|
@ -83,7 +83,7 @@ u16 sSurfaceMaterialToSfxOffset[SURFACE_MATERIAL_MAX] = {
|
||||||
/**
|
/**
|
||||||
* original name: T_BGCheck_PosErrorCheck
|
* original name: T_BGCheck_PosErrorCheck
|
||||||
*/
|
*/
|
||||||
s32 BgCheck_PosErrorCheck(Vec3f* pos, char* file, s32 line) {
|
s32 BgCheck_PosErrorCheck(Vec3f* pos, const char* file, int line) {
|
||||||
if (pos->x >= BGCHECK_XYZ_ABSMAX || pos->x <= -BGCHECK_XYZ_ABSMAX || pos->y >= BGCHECK_XYZ_ABSMAX ||
|
if (pos->x >= BGCHECK_XYZ_ABSMAX || pos->x <= -BGCHECK_XYZ_ABSMAX || pos->y >= BGCHECK_XYZ_ABSMAX ||
|
||||||
pos->y <= -BGCHECK_XYZ_ABSMAX || pos->z >= BGCHECK_XYZ_ABSMAX || pos->z <= -BGCHECK_XYZ_ABSMAX) {
|
pos->y <= -BGCHECK_XYZ_ABSMAX || pos->z >= BGCHECK_XYZ_ABSMAX || pos->z <= -BGCHECK_XYZ_ABSMAX) {
|
||||||
PRINTF(VT_FGCOL(RED));
|
PRINTF(VT_FGCOL(RED));
|
||||||
|
|
|
@ -29,6 +29,7 @@ Color_RGBA8 sDebugCamTextColors[] = {
|
||||||
{ 128, 255, 32, 128 }, // DEBUG_CAM_TEXT_GREEN
|
{ 128, 255, 32, 128 }, // DEBUG_CAM_TEXT_GREEN
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
InputCombo sRegGroupInputCombos[REG_GROUPS] = {
|
InputCombo sRegGroupInputCombos[REG_GROUPS] = {
|
||||||
{ BTN_L, BTN_CUP }, // REG
|
{ BTN_L, BTN_CUP }, // REG
|
||||||
{ BTN_L, BTN_CLEFT }, // SREG
|
{ BTN_L, BTN_CLEFT }, // SREG
|
||||||
|
@ -93,6 +94,7 @@ char sRegGroupChars[REG_GROUPS] = {
|
||||||
'k', // kREG
|
'k', // kREG
|
||||||
'b', // bREG
|
'b', // bREG
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
void Regs_Init(void) {
|
void Regs_Init(void) {
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
|
@ -35,7 +35,7 @@ void* ZeldaArena_Malloc(u32 size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void* ZeldaArena_MallocDebug(u32 size, const char* file, s32 line) {
|
void* ZeldaArena_MallocDebug(u32 size, const char* file, int line) {
|
||||||
void* ptr = __osMallocDebug(&sZeldaArena, size, file, line);
|
void* ptr = __osMallocDebug(&sZeldaArena, size, file, line);
|
||||||
|
|
||||||
ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc_DEBUG", "確保"); // "Secure"
|
ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc_DEBUG", "確保"); // "Secure"
|
||||||
|
@ -51,7 +51,7 @@ void* ZeldaArena_MallocR(u32 size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void* ZeldaArena_MallocRDebug(u32 size, const char* file, s32 line) {
|
void* ZeldaArena_MallocRDebug(u32 size, const char* file, int line) {
|
||||||
void* ptr = __osMallocRDebug(&sZeldaArena, size, file, line);
|
void* ptr = __osMallocRDebug(&sZeldaArena, size, file, line);
|
||||||
|
|
||||||
ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc_r_DEBUG", "確保"); // "Secure"
|
ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc_r_DEBUG", "確保"); // "Secure"
|
||||||
|
@ -66,7 +66,7 @@ void* ZeldaArena_Realloc(void* ptr, u32 newSize) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) {
|
void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line) {
|
||||||
ptr = __osReallocDebug(&sZeldaArena, ptr, newSize, file, line);
|
ptr = __osReallocDebug(&sZeldaArena, ptr, newSize, file, line);
|
||||||
ZELDA_ARENA_CHECK_POINTER(ptr, newSize, "zelda_realloc_DEBUG", "再確保"); // "Re-securing"
|
ZELDA_ARENA_CHECK_POINTER(ptr, newSize, "zelda_realloc_DEBUG", "再確保"); // "Re-securing"
|
||||||
return ptr;
|
return ptr;
|
||||||
|
@ -78,7 +78,7 @@ void ZeldaArena_Free(void* ptr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
void ZeldaArena_FreeDebug(void* ptr, const char* file, s32 line) {
|
void ZeldaArena_FreeDebug(void* ptr, const char* file, int line) {
|
||||||
__osFreeDebug(&sZeldaArena, ptr, file, line);
|
__osFreeDebug(&sZeldaArena, ptr, file, line);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -10,9 +10,12 @@ TransitionTile sTransitionTile;
|
||||||
s32 gTransitionTileState;
|
s32 gTransitionTileState;
|
||||||
VisMono sPlayVisMono;
|
VisMono sPlayVisMono;
|
||||||
Color_RGBA8_u32 gVisMonoColor;
|
Color_RGBA8_u32 gVisMonoColor;
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
FaultClient D_801614B8;
|
FaultClient D_801614B8;
|
||||||
|
#endif
|
||||||
|
|
||||||
s16 sTransitionFillTimer;
|
s16 sTransitionFillTimer;
|
||||||
u64 sDebugCutsceneScriptBuf[0xA00];
|
|
||||||
|
|
||||||
void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn);
|
void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn);
|
||||||
|
|
||||||
|
@ -451,7 +454,10 @@ void Play_Init(GameState* thisx) {
|
||||||
AnimationContext_Update(this, &this->animationCtx);
|
AnimationContext_Update(this, &this->animationCtx);
|
||||||
gSaveContext.respawnFlag = 0;
|
gSaveContext.respawnFlag = 0;
|
||||||
|
|
||||||
if (OOT_DEBUG && R_USE_DEBUG_CUTSCENE) {
|
#if OOT_DEBUG
|
||||||
|
if (R_USE_DEBUG_CUTSCENE) {
|
||||||
|
static u64 sDebugCutsceneScriptBuf[0xA00];
|
||||||
|
|
||||||
gDebugCutsceneScript = sDebugCutsceneScriptBuf;
|
gDebugCutsceneScript = sDebugCutsceneScriptBuf;
|
||||||
PRINTF("\nkawauso_data=[%x]", gDebugCutsceneScript);
|
PRINTF("\nkawauso_data=[%x]", gDebugCutsceneScript);
|
||||||
|
|
||||||
|
@ -459,6 +465,7 @@ void Play_Init(GameState* thisx) {
|
||||||
// Presumably the ROM was larger at a previous point in development when this debug feature was used.
|
// Presumably the ROM was larger at a previous point in development when this debug feature was used.
|
||||||
DmaMgr_DmaRomToRam(0x03FEB000, gDebugCutsceneScript, sizeof(sDebugCutsceneScriptBuf));
|
DmaMgr_DmaRomToRam(0x03FEB000, gDebugCutsceneScript, sizeof(sDebugCutsceneScriptBuf));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Play_Update(PlayState* this) {
|
void Play_Update(PlayState* this) {
|
||||||
|
|
|
@ -347,11 +347,13 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) {
|
||||||
Actor_MoveXZGravity(&this->dyna.actor);
|
Actor_MoveXZGravity(&this->dyna.actor);
|
||||||
func_80888694(this, (BgHidanHamstep*)this->dyna.actor.parent);
|
func_80888694(this, (BgHidanHamstep*)this->dyna.actor.parent);
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
if (((this->dyna.actor.params & 0xFF) <= 0) || ((this->dyna.actor.params & 0xFF) >= 6)) {
|
if (((this->dyna.actor.params & 0xFF) <= 0) || ((this->dyna.actor.params & 0xFF) >= 6)) {
|
||||||
// "[Hammer Step] arg_data strange (arg_data = %d)"
|
// "[Hammer Step] arg_data strange (arg_data = %d)"
|
||||||
PRINTF("【ハンマーステップ】 arg_data おかしい (arg_data = %d)", this->dyna.actor.params);
|
PRINTF("【ハンマーステップ】 arg_data おかしい (arg_data = %d)", this->dyna.actor.params);
|
||||||
PRINTF("%s %d\n", "../z_bg_hidan_hamstep.c", 696);
|
PRINTF("%s %d\n", "../z_bg_hidan_hamstep.c", 696);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (((this->dyna.actor.world.pos.y - this->dyna.actor.home.pos.y) <=
|
if (((this->dyna.actor.world.pos.y - this->dyna.actor.home.pos.y) <=
|
||||||
sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1]) &&
|
sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1]) &&
|
||||||
|
|
|
@ -82,6 +82,7 @@ void BgHidanHrock_Init(Actor* thisx, PlayState* play) {
|
||||||
s32 i;
|
s32 i;
|
||||||
s32 j;
|
s32 j;
|
||||||
CollisionHeader* collisionHeader = NULL;
|
CollisionHeader* collisionHeader = NULL;
|
||||||
|
Vec3f* vtx;
|
||||||
|
|
||||||
Actor_ProcessInitChain(thisx, sInitChain);
|
Actor_ProcessInitChain(thisx, sInitChain);
|
||||||
this->unk_16A = thisx->params & 0x3F;
|
this->unk_16A = thisx->params & 0x3F;
|
||||||
|
@ -103,7 +104,7 @@ void BgHidanHrock_Init(Actor* thisx, PlayState* play) {
|
||||||
|
|
||||||
if (1) {
|
if (1) {
|
||||||
for (j = 0; j < 3; j++) {
|
for (j = 0; j < 3; j++) {
|
||||||
Vec3f* vtx = &colliderElementInit->dim.vtx[j];
|
vtx = &colliderElementInit->dim.vtx[j];
|
||||||
|
|
||||||
vertices[j].x = vtx->z * sinRotY + (thisx->home.pos.x + vtx->x * cosRotY);
|
vertices[j].x = vtx->z * sinRotY + (thisx->home.pos.x + vtx->x * cosRotY);
|
||||||
vertices[j].y = vtx->y + thisx->home.pos.y;
|
vertices[j].y = vtx->y + thisx->home.pos.y;
|
||||||
|
|
|
@ -73,9 +73,12 @@ void BgHidanKousi_Init(Actor* thisx, PlayState* play) {
|
||||||
((s32)thisx->params >> 8) & 0xFF);
|
((s32)thisx->params >> 8) & 0xFF);
|
||||||
|
|
||||||
Actor_ProcessInitChain(thisx, sInitChain);
|
Actor_ProcessInitChain(thisx, sInitChain);
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
if (((thisx->params & 0xFF) < 0) || ((thisx->params & 0xFF) >= 3)) {
|
if (((thisx->params & 0xFF) < 0) || ((thisx->params & 0xFF) >= 3)) {
|
||||||
PRINTF("arg_data おかしい 【格子】\n");
|
PRINTF("arg_data おかしい 【格子】\n");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
CollisionHeader_GetVirtual(sMetalFencesCollisions[thisx->params & 0xFF], &colHeader);
|
CollisionHeader_GetVirtual(sMetalFencesCollisions[thisx->params & 0xFF], &colHeader);
|
||||||
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader);
|
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader);
|
||||||
|
|
|
@ -130,9 +130,10 @@ void func_8088CEC0(BgHidanSekizou* this, s32 arg1, s16 arg2) {
|
||||||
s32 end = start + 3;
|
s32 end = start + 3;
|
||||||
f32 sp30 = Math_SinS(arg2);
|
f32 sp30 = Math_SinS(arg2);
|
||||||
f32 sp2C = Math_CosS(arg2);
|
f32 sp2C = Math_CosS(arg2);
|
||||||
|
ColliderJntSphElement* element;
|
||||||
|
|
||||||
for (i = start; i < end; i++) {
|
for (i = start; i < end; i++) {
|
||||||
ColliderJntSphElement* element = &this->collider.elements[i];
|
element = &this->collider.elements[i];
|
||||||
|
|
||||||
element->dim.worldSphere.center.x = this->dyna.actor.home.pos.x + (sp2C * element->dim.modelSphere.center.x) +
|
element->dim.worldSphere.center.x = this->dyna.actor.home.pos.x + (sp2C * element->dim.modelSphere.center.x) +
|
||||||
(sp30 * element->dim.modelSphere.center.z);
|
(sp30 * element->dim.modelSphere.center.z);
|
||||||
|
@ -301,8 +302,8 @@ Gfx* func_8088D9F4(PlayState* play, BgHidanSekizou* this, s16 arg2, MtxF* arg3,
|
||||||
f32 phi_f12;
|
f32 phi_f12;
|
||||||
|
|
||||||
arg6 = (((arg6 + arg2) % 8) * 7) * (1 / 7.0f);
|
arg6 = (((arg6 + arg2) % 8) * 7) * (1 / 7.0f);
|
||||||
arg2++;
|
|
||||||
gSPSegment(arg7++, 9, SEGMENTED_TO_VIRTUAL(sFireballsTexs[arg6]));
|
gSPSegment(arg7++, 9, SEGMENTED_TO_VIRTUAL(sFireballsTexs[arg6]));
|
||||||
|
arg2++;
|
||||||
if (arg2 != 4) {
|
if (arg2 != 4) {
|
||||||
phi_f12 = arg2 + ((4 - this->unk_170) / 4.0f);
|
phi_f12 = arg2 + ((4 - this->unk_170) / 4.0f);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -49,7 +49,6 @@ void BgIceShutter_Init(Actor* thisx, PlayState* play) {
|
||||||
f32 sp24;
|
f32 sp24;
|
||||||
CollisionHeader* colHeader;
|
CollisionHeader* colHeader;
|
||||||
s32 sp28;
|
s32 sp28;
|
||||||
f32 temp_f6;
|
|
||||||
|
|
||||||
colHeader = NULL;
|
colHeader = NULL;
|
||||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||||
|
@ -78,7 +77,8 @@ void BgIceShutter_Init(Actor* thisx, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sp28 == 2) {
|
if (sp28 == 2) {
|
||||||
temp_f6 = Math_SinS(this->dyna.actor.shape.rot.x) * 50.0f;
|
f32 temp_f6 = Math_SinS(this->dyna.actor.shape.rot.x) * 50.0f;
|
||||||
|
|
||||||
this->dyna.actor.focus.pos.x =
|
this->dyna.actor.focus.pos.x =
|
||||||
(Math_SinS(this->dyna.actor.shape.rot.y) * temp_f6) + this->dyna.actor.home.pos.x;
|
(Math_SinS(this->dyna.actor.shape.rot.y) * temp_f6) + this->dyna.actor.home.pos.x;
|
||||||
this->dyna.actor.focus.pos.y = this->dyna.actor.home.pos.y;
|
this->dyna.actor.focus.pos.y = this->dyna.actor.home.pos.y;
|
||||||
|
|
|
@ -74,10 +74,12 @@ void BgJyaBigmirror_HandleCobra(Actor* thisx, PlayState* play) {
|
||||||
this->puzzleFlags &= ~cobraPuzzleFlags[i];
|
this->puzzleFlags &= ~cobraPuzzleFlags[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
if (curCobraInfo->cobra->dyna.actor.update == NULL) {
|
if (curCobraInfo->cobra->dyna.actor.update == NULL) {
|
||||||
// "Cobra deleted"
|
// "Cobra deleted"
|
||||||
PRINTF("Error : コブラ削除された (%s %d)\n", "../z_bg_jya_bigmirror.c", 203);
|
PRINTF("Error : コブラ削除された (%s %d)\n", "../z_bg_jya_bigmirror.c", 203);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
curCobraInfo->cobra = (BgJyaCobra*)Actor_SpawnAsChild(
|
curCobraInfo->cobra = (BgJyaCobra*)Actor_SpawnAsChild(
|
||||||
&play->actorCtx, &this->actor, play, ACTOR_BG_JYA_COBRA, curSpawnData->pos.x, curSpawnData->pos.y,
|
&play->actorCtx, &this->actor, play, ACTOR_BG_JYA_COBRA, curSpawnData->pos.x, curSpawnData->pos.y,
|
||||||
|
@ -136,17 +138,10 @@ void BgJyaBigmirror_HandleMirRay(Actor* thisx, PlayState* play) {
|
||||||
this->lightBeams[1] = NULL;
|
this->lightBeams[1] = NULL;
|
||||||
this->lightBeams[0] = NULL;
|
this->lightBeams[0] = NULL;
|
||||||
} else {
|
} else {
|
||||||
puzzleSolved = !!(this->puzzleFlags & (BIGMIR_PUZZLE_IN_STATUE_ROOM | BIGMIR_PUZZLE_IN_1ST_TOP_ROOM));
|
// Only spawn if puzzle solved
|
||||||
|
lightBeamToggles[0] = (this->puzzleFlags & (BIGMIR_PUZZLE_IN_STATUE_ROOM | BIGMIR_PUZZLE_IN_1ST_TOP_ROOM)) &&
|
||||||
if (puzzleSolved) {
|
(this->puzzleFlags & BIGMIR_PUZZLE_COBRA2_SOLVED) &&
|
||||||
puzzleSolved = !!(this->puzzleFlags & BIGMIR_PUZZLE_COBRA2_SOLVED);
|
(this->puzzleFlags & BIGMIR_PUZZLE_COBRA1_SOLVED);
|
||||||
|
|
||||||
if (puzzleSolved) {
|
|
||||||
puzzleSolved = !!(this->puzzleFlags & BIGMIR_PUZZLE_COBRA1_SOLVED);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lightBeamToggles[0] = puzzleSolved; // Only spawn if puzzle solved
|
|
||||||
if (1) {}
|
|
||||||
lightBeamToggles[1] = lightBeamToggles[2] =
|
lightBeamToggles[1] = lightBeamToggles[2] =
|
||||||
this->puzzleFlags & (BIGMIR_PUZZLE_IN_1ST_TOP_ROOM | BIGMIR_PUZZLE_IN_2ND_TOP_ROOM);
|
this->puzzleFlags & (BIGMIR_PUZZLE_IN_1ST_TOP_ROOM | BIGMIR_PUZZLE_IN_2ND_TOP_ROOM);
|
||||||
|
|
||||||
|
@ -158,10 +153,12 @@ void BgJyaBigmirror_HandleMirRay(Actor* thisx, PlayState* play) {
|
||||||
Actor_Spawn(&play->actorCtx, play, ACTOR_MIR_RAY, sMirRayPositions[i].x, sMirRayPositions[i].y,
|
Actor_Spawn(&play->actorCtx, play, ACTOR_MIR_RAY, sMirRayPositions[i].x, sMirRayPositions[i].y,
|
||||||
sMirRayPositions[i].z, 0, 0, 0, sMirRayParamsVals[i]);
|
sMirRayPositions[i].z, 0, 0, 0, sMirRayParamsVals[i]);
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
if (this->lightBeams[i] == NULL) {
|
if (this->lightBeams[i] == NULL) {
|
||||||
// "Mir Ray generation failed"
|
// "Mir Ray generation failed"
|
||||||
PRINTF("Error : Mir Ray 発生失敗 (%s %d)\n", "../z_bg_jya_bigmirror.c", 310);
|
PRINTF("Error : Mir Ray 発生失敗 (%s %d)\n", "../z_bg_jya_bigmirror.c", 310);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this->lightBeams[i] != NULL) {
|
if (this->lightBeams[i] != NULL) {
|
||||||
|
|
|
@ -106,10 +106,13 @@ void BgJyaIronobj_SpawnPillarParticles(BgJyaIronobj* this, PlayState* play, EnIk
|
||||||
f32 sins;
|
f32 sins;
|
||||||
s32 pad[2];
|
s32 pad[2];
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) {
|
if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) {
|
||||||
PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 233, enIk->unk_2FF);
|
PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 233, enIk->unk_2FF);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
PRINTF("¢ attack_type(%d)\n", enIk->unk_2FF);
|
PRINTF("¢ attack_type(%d)\n", enIk->unk_2FF);
|
||||||
rotY = Actor_WorldYawTowardActor(&this->dyna.actor, &enIk->actor) + D_808994D8[enIk->unk_2FF - 1];
|
rotY = Actor_WorldYawTowardActor(&this->dyna.actor, &enIk->actor) + D_808994D8[enIk->unk_2FF - 1];
|
||||||
|
|
||||||
|
@ -169,10 +172,13 @@ void BgJyaIronobj_SpawnThroneParticles(BgJyaIronobj* this, PlayState* play, EnIk
|
||||||
f32 sins;
|
f32 sins;
|
||||||
s32 pad[2];
|
s32 pad[2];
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) {
|
if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) {
|
||||||
PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 362, enIk->unk_2FF);
|
PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 362, enIk->unk_2FF);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
PRINTF("¢ attack_type(%d)\n", enIk->unk_2FF);
|
PRINTF("¢ attack_type(%d)\n", enIk->unk_2FF);
|
||||||
rotY = Actor_WorldYawTowardActor(&this->dyna.actor, &enIk->actor) + D_808994D8[enIk->unk_2FF - 1];
|
rotY = Actor_WorldYawTowardActor(&this->dyna.actor, &enIk->actor) + D_808994D8[enIk->unk_2FF - 1];
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
|
|
|
@ -217,10 +217,11 @@ void BgJyaMegami_DetectLight(BgJyaMegami* this, PlayState* play) {
|
||||||
|
|
||||||
void BgJyaMegami_SetupExplode(BgJyaMegami* this) {
|
void BgJyaMegami_SetupExplode(BgJyaMegami* this) {
|
||||||
u32 i;
|
u32 i;
|
||||||
|
Vec3f* pos = &this->dyna.actor.world.pos;
|
||||||
|
|
||||||
this->actionFunc = BgJyaMegami_Explode;
|
this->actionFunc = BgJyaMegami_Explode;
|
||||||
for (i = 0; i < ARRAY_COUNT(this->pieces); i++) {
|
for (i = 0; i < ARRAY_COUNT(this->pieces); i++) {
|
||||||
Math_Vec3f_Copy(&this->pieces[i].pos, &this->dyna.actor.world.pos);
|
Math_Vec3f_Copy(&this->pieces[i].pos, pos);
|
||||||
this->pieces[i].vel.x = sPiecesInit[i].velX;
|
this->pieces[i].vel.x = sPiecesInit[i].velX;
|
||||||
}
|
}
|
||||||
this->explosionTimer = 0;
|
this->explosionTimer = 0;
|
||||||
|
|
|
@ -182,7 +182,14 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
|
||||||
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
|
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
|
||||||
|
|
||||||
switch ((u16)this->dyna.actor.params & 0xF) {
|
switch ((u16)this->dyna.actor.params & 0xF) {
|
||||||
case MIZUBWALL_FLOOR:
|
case MIZUBWALL_FLOOR: {
|
||||||
|
f32 sin;
|
||||||
|
f32 cos;
|
||||||
|
s32 i;
|
||||||
|
s32 j;
|
||||||
|
Vec3f offset;
|
||||||
|
Vec3f vtx[3];
|
||||||
|
|
||||||
if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) {
|
if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) {
|
||||||
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
|
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
|
||||||
this->dList = NULL;
|
this->dList = NULL;
|
||||||
|
@ -194,12 +201,8 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
|
||||||
this->dyna.actor.params);
|
this->dyna.actor.params);
|
||||||
Actor_Kill(&this->dyna.actor);
|
Actor_Kill(&this->dyna.actor);
|
||||||
} else {
|
} else {
|
||||||
f32 sin = Math_SinS(this->dyna.actor.shape.rot.y);
|
sin = Math_SinS(this->dyna.actor.shape.rot.y);
|
||||||
f32 cos = Math_CosS(this->dyna.actor.shape.rot.y);
|
cos = Math_CosS(this->dyna.actor.shape.rot.y);
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
Vec3f offset;
|
|
||||||
Vec3f vtx[3];
|
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) {
|
for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) {
|
||||||
for (j = 0; j < 3; j++) {
|
for (j = 0; j < 3; j++) {
|
||||||
|
@ -217,7 +220,15 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MIZUBWALL_RUTO_ROOM:
|
}
|
||||||
|
case MIZUBWALL_RUTO_ROOM: {
|
||||||
|
f32 sin;
|
||||||
|
f32 cos;
|
||||||
|
s32 i;
|
||||||
|
s32 j;
|
||||||
|
Vec3f offset;
|
||||||
|
Vec3f vtx[3];
|
||||||
|
|
||||||
if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) {
|
if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) {
|
||||||
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
|
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
|
||||||
this->dList = NULL;
|
this->dList = NULL;
|
||||||
|
@ -229,12 +240,8 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
|
||||||
this->dyna.actor.params);
|
this->dyna.actor.params);
|
||||||
Actor_Kill(&this->dyna.actor);
|
Actor_Kill(&this->dyna.actor);
|
||||||
} else {
|
} else {
|
||||||
f32 sin = Math_SinS(this->dyna.actor.shape.rot.y);
|
sin = Math_SinS(this->dyna.actor.shape.rot.y);
|
||||||
f32 cos = Math_CosS(this->dyna.actor.shape.rot.y);
|
cos = Math_CosS(this->dyna.actor.shape.rot.y);
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
Vec3f offset;
|
|
||||||
Vec3f vtx[3];
|
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_COUNT(sTrisElementInitRutoWall); i++) {
|
for (i = 0; i < ARRAY_COUNT(sTrisElementInitRutoWall); i++) {
|
||||||
for (j = 0; j < 3; j++) {
|
for (j = 0; j < 3; j++) {
|
||||||
|
@ -252,7 +259,15 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MIZUBWALL_UNUSED:
|
}
|
||||||
|
case MIZUBWALL_UNUSED: {
|
||||||
|
f32 sin;
|
||||||
|
f32 cos;
|
||||||
|
s32 i;
|
||||||
|
s32 j;
|
||||||
|
Vec3f offset;
|
||||||
|
Vec3f vtx[3];
|
||||||
|
|
||||||
if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) {
|
if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) {
|
||||||
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
|
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
|
||||||
this->dList = NULL;
|
this->dList = NULL;
|
||||||
|
@ -264,12 +279,8 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
|
||||||
this->dyna.actor.params);
|
this->dyna.actor.params);
|
||||||
Actor_Kill(&this->dyna.actor);
|
Actor_Kill(&this->dyna.actor);
|
||||||
} else {
|
} else {
|
||||||
f32 sin = Math_SinS(this->dyna.actor.shape.rot.y);
|
sin = Math_SinS(this->dyna.actor.shape.rot.y);
|
||||||
f32 cos = Math_CosS(this->dyna.actor.shape.rot.y);
|
cos = Math_CosS(this->dyna.actor.shape.rot.y);
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
Vec3f offset;
|
|
||||||
Vec3f vtx[3];
|
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) {
|
for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) {
|
||||||
for (j = 0; j < 3; j++) {
|
for (j = 0; j < 3; j++) {
|
||||||
|
@ -289,7 +300,15 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MIZUBWALL_STINGER_ROOM_1:
|
}
|
||||||
|
case MIZUBWALL_STINGER_ROOM_1: {
|
||||||
|
f32 sin;
|
||||||
|
f32 cos;
|
||||||
|
s32 i;
|
||||||
|
s32 j;
|
||||||
|
Vec3f offset;
|
||||||
|
Vec3f vtx[3];
|
||||||
|
|
||||||
if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) {
|
if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) {
|
||||||
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
|
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
|
||||||
this->dList = NULL;
|
this->dList = NULL;
|
||||||
|
@ -302,12 +321,8 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
|
||||||
this->dyna.actor.params);
|
this->dyna.actor.params);
|
||||||
Actor_Kill(&this->dyna.actor);
|
Actor_Kill(&this->dyna.actor);
|
||||||
} else {
|
} else {
|
||||||
f32 sin = Math_SinS(this->dyna.actor.shape.rot.y);
|
sin = Math_SinS(this->dyna.actor.shape.rot.y);
|
||||||
f32 cos = Math_CosS(this->dyna.actor.shape.rot.y);
|
cos = Math_CosS(this->dyna.actor.shape.rot.y);
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
Vec3f offset;
|
|
||||||
Vec3f vtx[3];
|
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) {
|
for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) {
|
||||||
for (j = 0; j < 3; j++) {
|
for (j = 0; j < 3; j++) {
|
||||||
|
@ -327,7 +342,15 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MIZUBWALL_STINGER_ROOM_2:
|
}
|
||||||
|
case MIZUBWALL_STINGER_ROOM_2: {
|
||||||
|
f32 sin;
|
||||||
|
f32 cos;
|
||||||
|
s32 i;
|
||||||
|
s32 j;
|
||||||
|
Vec3f offset;
|
||||||
|
Vec3f vtx[3];
|
||||||
|
|
||||||
if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) {
|
if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) {
|
||||||
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
|
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
|
||||||
this->dList = NULL;
|
this->dList = NULL;
|
||||||
|
@ -340,12 +363,8 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
|
||||||
this->dyna.actor.params);
|
this->dyna.actor.params);
|
||||||
Actor_Kill(&this->dyna.actor);
|
Actor_Kill(&this->dyna.actor);
|
||||||
} else {
|
} else {
|
||||||
f32 sin = Math_SinS(this->dyna.actor.shape.rot.y);
|
sin = Math_SinS(this->dyna.actor.shape.rot.y);
|
||||||
f32 cos = Math_CosS(this->dyna.actor.shape.rot.y);
|
cos = Math_CosS(this->dyna.actor.shape.rot.y);
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
Vec3f offset;
|
|
||||||
Vec3f vtx[3];
|
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) {
|
for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) {
|
||||||
for (j = 0; j < 3; j++) {
|
for (j = 0; j < 3; j++) {
|
||||||
|
@ -367,6 +386,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void BgMizuBwall_Destroy(Actor* thisx, PlayState* play) {
|
void BgMizuBwall_Destroy(Actor* thisx, PlayState* play) {
|
||||||
s32 pad;
|
s32 pad;
|
||||||
|
@ -377,9 +397,8 @@ void BgMizuBwall_Destroy(Actor* thisx, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BgMizuBwall_SetAlpha(BgMizuBwall* this, PlayState* play) {
|
void BgMizuBwall_SetAlpha(BgMizuBwall* this, PlayState* play) {
|
||||||
f32 waterLevel = play->colCtx.colHeader->waterBoxes[2].ySurface;
|
WaterBox* waterBoxes = play->colCtx.colHeader->waterBoxes;
|
||||||
|
f32 waterLevel = waterBoxes[2].ySurface;
|
||||||
if (play->colCtx.colHeader->waterBoxes) {}
|
|
||||||
|
|
||||||
if (waterLevel < WATER_TEMPLE_WATER_F1_Y) {
|
if (waterLevel < WATER_TEMPLE_WATER_F1_Y) {
|
||||||
this->scrollAlpha1 = 255;
|
this->scrollAlpha1 = 255;
|
||||||
|
|
|
@ -53,6 +53,7 @@ static InitChainEntry sInitChain[] = {
|
||||||
u32 BgMizuWater_GetWaterLevelActionIndex(s16 switchFlag, PlayState* play) {
|
u32 BgMizuWater_GetWaterLevelActionIndex(s16 switchFlag, PlayState* play) {
|
||||||
u32 ret;
|
u32 ret;
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
if (bREG(0) != 0) {
|
if (bREG(0) != 0) {
|
||||||
switch (bREG(1)) {
|
switch (bREG(1)) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -67,6 +68,8 @@ u32 BgMizuWater_GetWaterLevelActionIndex(s16 switchFlag, PlayState* play) {
|
||||||
}
|
}
|
||||||
bREG(0) = 0;
|
bREG(0) = 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (Flags_GetSwitch(play, WATER_TEMPLE_WATER_F1_FLAG) && (switchFlag != WATER_TEMPLE_WATER_F1_FLAG)) {
|
if (Flags_GetSwitch(play, WATER_TEMPLE_WATER_F1_FLAG) && (switchFlag != WATER_TEMPLE_WATER_F1_FLAG)) {
|
||||||
ret = 3;
|
ret = 3;
|
||||||
} else if (Flags_GetSwitch(play, WATER_TEMPLE_WATER_F2_FLAG) && (switchFlag != WATER_TEMPLE_WATER_F2_FLAG)) {
|
} else if (Flags_GetSwitch(play, WATER_TEMPLE_WATER_F2_FLAG) && (switchFlag != WATER_TEMPLE_WATER_F2_FLAG)) {
|
||||||
|
@ -297,10 +300,13 @@ void BgMizuWater_Update(Actor* thisx, PlayState* play) {
|
||||||
s32 unk1;
|
s32 unk1;
|
||||||
s32 pad;
|
s32 pad;
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
if (bREG(15) == 0) {
|
if (bREG(15) == 0) {
|
||||||
PRINTF("%x %x %x\n", Flags_GetSwitch(play, WATER_TEMPLE_WATER_F1_FLAG),
|
PRINTF("%x %x %x\n", Flags_GetSwitch(play, WATER_TEMPLE_WATER_F1_FLAG),
|
||||||
Flags_GetSwitch(play, WATER_TEMPLE_WATER_F2_FLAG), Flags_GetSwitch(play, WATER_TEMPLE_WATER_F3_FLAG));
|
Flags_GetSwitch(play, WATER_TEMPLE_WATER_F2_FLAG), Flags_GetSwitch(play, WATER_TEMPLE_WATER_F3_FLAG));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (this->type == 0) {
|
if (this->type == 0) {
|
||||||
posY = this->actor.world.pos.y;
|
posY = this->actor.world.pos.y;
|
||||||
unk0 = 0;
|
unk0 = 0;
|
||||||
|
|
|
@ -88,11 +88,16 @@ void BgMoriElevator_Init(Actor* thisx, PlayState* play) {
|
||||||
|
|
||||||
this->unk_172 = sIsSpawned;
|
this->unk_172 = sIsSpawned;
|
||||||
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
|
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
if (this->moriTexObjectSlot < 0) {
|
if (this->moriTexObjectSlot < 0) {
|
||||||
Actor_Kill(thisx);
|
Actor_Kill(thisx);
|
||||||
// "Forest Temple obj elevator Bank Danger!"
|
// "Forest Temple obj elevator Bank Danger!"
|
||||||
PRINTF("Error : 森の神殿 obj elevator バンク危険!(%s %d)\n", "../z_bg_mori_elevator.c", 277);
|
PRINTF("Error : 森の神殿 obj elevator バンク危険!(%s %d)\n", "../z_bg_mori_elevator.c", 277);
|
||||||
} else {
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (sIsSpawned) {
|
switch (sIsSpawned) {
|
||||||
case false:
|
case false:
|
||||||
// "Forest Temple elevator CT"
|
// "Forest Temple elevator CT"
|
||||||
|
@ -110,7 +115,6 @@ void BgMoriElevator_Init(Actor* thisx, PlayState* play) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void BgMoriElevator_Destroy(Actor* thisx, PlayState* play) {
|
void BgMoriElevator_Destroy(Actor* thisx, PlayState* play) {
|
||||||
BgMoriElevator* this = (BgMoriElevator*)thisx;
|
BgMoriElevator* this = (BgMoriElevator*)thisx;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
void BgMoriRakkatenjo_Init(Actor* thisx, PlayState* play);
|
void BgMoriRakkatenjo_Init(Actor* thisx, PlayState* play);
|
||||||
void BgMoriRakkatenjo_Destroy(Actor* thisx, PlayState* play);
|
void BgMoriRakkatenjo_Destroy(Actor* thisx, PlayState* play);
|
||||||
void BgMoriRakkatenjo_Update(Actor* thisx, PlayState* play);
|
void BgMoriRakkatenjo_Update(Actor* thisx, PlayState* play2);
|
||||||
void BgMoriRakkatenjo_Draw(Actor* thisx, PlayState* play);
|
void BgMoriRakkatenjo_Draw(Actor* thisx, PlayState* play);
|
||||||
|
|
||||||
void BgMoriRakkatenjo_SetupWaitForMoriTex(BgMoriRakkatenjo* this);
|
void BgMoriRakkatenjo_SetupWaitForMoriTex(BgMoriRakkatenjo* this);
|
||||||
|
@ -52,6 +52,8 @@ void BgMoriRakkatenjo_Init(Actor* thisx, PlayState* play) {
|
||||||
CollisionHeader* colHeader = NULL;
|
CollisionHeader* colHeader = NULL;
|
||||||
|
|
||||||
DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS);
|
DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS);
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
// "Forest Temple obj. Falling Ceiling"
|
// "Forest Temple obj. Falling Ceiling"
|
||||||
PRINTF("森の神殿 obj. 落下天井 (home posY %f)\n", this->dyna.actor.home.pos.y);
|
PRINTF("森の神殿 obj. 落下天井 (home posY %f)\n", this->dyna.actor.home.pos.y);
|
||||||
if ((fabsf(1991.0f - this->dyna.actor.home.pos.x) > 0.001f) ||
|
if ((fabsf(1991.0f - this->dyna.actor.home.pos.x) > 0.001f) ||
|
||||||
|
@ -64,6 +66,8 @@ void BgMoriRakkatenjo_Init(Actor* thisx, PlayState* play) {
|
||||||
// "The set Angle has changed. Let's fix the program."
|
// "The set Angle has changed. Let's fix the program."
|
||||||
PRINTF("Warning : セット Angle が変更されています。プログラムを修正しましょう。\n");
|
PRINTF("Warning : セット Angle が変更されています。プログラムを修正しましょう。\n");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
|
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
|
||||||
if (this->moriTexObjectSlot < 0) {
|
if (this->moriTexObjectSlot < 0) {
|
||||||
// "Forest Temple obj Falling Ceiling Bank Danger!"
|
// "Forest Temple obj Falling Ceiling Bank Danger!"
|
||||||
|
@ -197,8 +201,8 @@ void BgMoriRakkatenjo_Rise(BgMoriRakkatenjo* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BgMoriRakkatenjo_Update(Actor* thisx, PlayState* play) {
|
void BgMoriRakkatenjo_Update(Actor* thisx, PlayState* play2) {
|
||||||
s32 pad;
|
PlayState* play = (PlayState*)play2;
|
||||||
BgMoriRakkatenjo* this = (BgMoriRakkatenjo*)thisx;
|
BgMoriRakkatenjo* this = (BgMoriRakkatenjo*)thisx;
|
||||||
|
|
||||||
if (this->timer > 0) {
|
if (this->timer > 0) {
|
||||||
|
|
|
@ -197,8 +197,9 @@ void BgSpot00Hanebasi_SetTorchLightInfo(BgSpot00Hanebasi* this, PlayState* play)
|
||||||
}
|
}
|
||||||
|
|
||||||
void BgSpot00Hanebasi_Update(Actor* thisx, PlayState* play) {
|
void BgSpot00Hanebasi_Update(Actor* thisx, PlayState* play) {
|
||||||
BgSpot00Hanebasi* this = (BgSpot00Hanebasi*)thisx;
|
|
||||||
s32 pad;
|
s32 pad;
|
||||||
|
BgSpot00Hanebasi* this = (BgSpot00Hanebasi*)thisx;
|
||||||
|
Player* player;
|
||||||
|
|
||||||
this->actionFunc(this, play);
|
this->actionFunc(this, play);
|
||||||
|
|
||||||
|
@ -206,7 +207,7 @@ void BgSpot00Hanebasi_Update(Actor* thisx, PlayState* play) {
|
||||||
if (play->sceneId == SCENE_HYRULE_FIELD) {
|
if (play->sceneId == SCENE_HYRULE_FIELD) {
|
||||||
if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) &&
|
if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) &&
|
||||||
CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !GET_EVENTCHKINF(EVENTCHKINF_80) && LINK_IS_CHILD) {
|
CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !GET_EVENTCHKINF(EVENTCHKINF_80) && LINK_IS_CHILD) {
|
||||||
Player* player = GET_PLAYER(play);
|
player = GET_PLAYER(play);
|
||||||
|
|
||||||
if ((player->actor.world.pos.x > -450.0f) && (player->actor.world.pos.x < 450.0f) &&
|
if ((player->actor.world.pos.x > -450.0f) && (player->actor.world.pos.x < 450.0f) &&
|
||||||
(player->actor.world.pos.z > 1080.0f) && (player->actor.world.pos.z < 1700.0f) &&
|
(player->actor.world.pos.z > 1080.0f) && (player->actor.world.pos.z < 1700.0f) &&
|
||||||
|
|
|
@ -117,10 +117,11 @@ void func_808AAE6C(BgSpot01Idohashira* this, PlayState* play) {
|
||||||
|
|
||||||
void func_808AAF34(BgSpot01Idohashira* this, PlayState* play) {
|
void func_808AAF34(BgSpot01Idohashira* this, PlayState* play) {
|
||||||
s32 pad[2];
|
s32 pad[2];
|
||||||
|
|
||||||
|
if (this->unk_170 != 0) {
|
||||||
Vec3f dest;
|
Vec3f dest;
|
||||||
Vec3f src;
|
Vec3f src;
|
||||||
|
|
||||||
if (this->unk_170 != 0) {
|
|
||||||
src.x = kREG(20) + 1300.0f;
|
src.x = kREG(20) + 1300.0f;
|
||||||
src.y = kREG(21) + 200.0f;
|
src.y = kREG(21) + 200.0f;
|
||||||
src.z = 0.0f;
|
src.z = 0.0f;
|
||||||
|
@ -170,13 +171,11 @@ void func_808AB18C(BgSpot01Idohashira* this) {
|
||||||
f32 func_808AB1DC(f32 arg0, f32 arg1, u16 arg2, u16 arg3, u16 arg4) {
|
f32 func_808AB1DC(f32 arg0, f32 arg1, u16 arg2, u16 arg3, u16 arg4) {
|
||||||
f32 temp_f12;
|
f32 temp_f12;
|
||||||
f32 regFloat;
|
f32 regFloat;
|
||||||
f32 diff23;
|
f32 diff23 = arg2 - arg3;
|
||||||
f32 diff43;
|
f32 diff43 = arg4 - arg3;
|
||||||
|
|
||||||
diff23 = arg2 - arg3;
|
|
||||||
if (diff23 != 0.0f) {
|
if (diff23 != 0.0f) {
|
||||||
regFloat = kREG(9) + 30.0f;
|
regFloat = kREG(9) + 30.0f;
|
||||||
diff43 = arg4 - arg3;
|
|
||||||
temp_f12 = regFloat * diff43;
|
temp_f12 = regFloat * diff43;
|
||||||
return (((((arg1 - arg0) - temp_f12) / SQ(diff23)) * diff43) * diff43) + temp_f12;
|
return (((((arg1 - arg0) - temp_f12) / SQ(diff23)) * diff43) * diff43) + temp_f12;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,8 @@ void BgSpot02Objects_Init(Actor* thisx, PlayState* play);
|
||||||
void BgSpot02Objects_Destroy(Actor* thisx, PlayState* play);
|
void BgSpot02Objects_Destroy(Actor* thisx, PlayState* play);
|
||||||
void BgSpot02Objects_Update(Actor* thisx, PlayState* play);
|
void BgSpot02Objects_Update(Actor* thisx, PlayState* play);
|
||||||
void BgSpot02Objects_Draw(Actor* thisx, PlayState* play);
|
void BgSpot02Objects_Draw(Actor* thisx, PlayState* play);
|
||||||
void func_808ACCB8(Actor* thisx, PlayState* play);
|
void func_808ACCB8(Actor* thisx, PlayState* play2);
|
||||||
void func_808AD450(Actor* thisx, PlayState* play);
|
void func_808AD450(Actor* thisx, PlayState* play2);
|
||||||
|
|
||||||
void func_808AC8FC(BgSpot02Objects* this, PlayState* play);
|
void func_808AC8FC(BgSpot02Objects* this, PlayState* play);
|
||||||
void func_808AC908(BgSpot02Objects* this, PlayState* play);
|
void func_808AC908(BgSpot02Objects* this, PlayState* play);
|
||||||
|
@ -212,10 +212,10 @@ void func_808ACC34(BgSpot02Objects* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_808ACCB8(Actor* thisx, PlayState* play) {
|
void func_808ACCB8(Actor* thisx, PlayState* play2) {
|
||||||
BgSpot02Objects* this = (BgSpot02Objects*)thisx;
|
BgSpot02Objects* this = (BgSpot02Objects*)thisx;
|
||||||
|
PlayState* play = (PlayState*)play2;
|
||||||
f32 rate;
|
f32 rate;
|
||||||
s32 pad;
|
|
||||||
u8 redPrim;
|
u8 redPrim;
|
||||||
u8 greenPrim;
|
u8 greenPrim;
|
||||||
u8 bluePrim;
|
u8 bluePrim;
|
||||||
|
@ -225,6 +225,8 @@ void func_808ACCB8(Actor* thisx, PlayState* play) {
|
||||||
|
|
||||||
OPEN_DISPS(play->state.gfxCtx, "../z_bg_spot02_objects.c", 600);
|
OPEN_DISPS(play->state.gfxCtx, "../z_bg_spot02_objects.c", 600);
|
||||||
|
|
||||||
|
if (1) {}
|
||||||
|
|
||||||
if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.actorCues[0] != NULL && play->csCtx.actorCues[0]->id == 2) {
|
if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.actorCues[0] != NULL && play->csCtx.actorCues[0]->id == 2) {
|
||||||
if (this->unk_16A < 5) {
|
if (this->unk_16A < 5) {
|
||||||
rate = (this->unk_16A / 5.0f);
|
rate = (this->unk_16A / 5.0f);
|
||||||
|
@ -278,9 +280,9 @@ void func_808AD3D4(BgSpot02Objects* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_808AD450(Actor* thisx, PlayState* play) {
|
void func_808AD450(Actor* thisx, PlayState* play2) {
|
||||||
BgSpot02Objects* this = (BgSpot02Objects*)thisx;
|
BgSpot02Objects* this = (BgSpot02Objects*)thisx;
|
||||||
s32 pad;
|
PlayState* play = (PlayState*)play2;
|
||||||
f32 lerp;
|
f32 lerp;
|
||||||
|
|
||||||
OPEN_DISPS(play->state.gfxCtx, "../z_bg_spot02_objects.c", 736);
|
OPEN_DISPS(play->state.gfxCtx, "../z_bg_spot02_objects.c", 736);
|
||||||
|
|
|
@ -147,6 +147,8 @@ void BgSpot03Taki_Draw(Actor* thisx, PlayState* play) {
|
||||||
|
|
||||||
gSPDisplayList(POLY_XLU_DISP++, object_spot03_object_DL_001580);
|
gSPDisplayList(POLY_XLU_DISP++, object_spot03_object_DL_001580);
|
||||||
|
|
||||||
|
if (1) {}
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx, "../z_bg_spot03_taki.c", 358);
|
CLOSE_DISPS(play->state.gfxCtx, "../z_bg_spot03_taki.c", 358);
|
||||||
|
|
||||||
this->bufferIndex = this->bufferIndex == 0;
|
this->bufferIndex = this->bufferIndex == 0;
|
||||||
|
|
|
@ -111,11 +111,12 @@ void BgSpot06Objects_Init(Actor* thisx, PlayState* play) {
|
||||||
if (LINK_IS_ADULT && Flags_GetSwitch(play, this->switchFlag)) {
|
if (LINK_IS_ADULT && Flags_GetSwitch(play, this->switchFlag)) {
|
||||||
thisx->world.pos.y = thisx->home.pos.y + 120.0f;
|
thisx->world.pos.y = thisx->home.pos.y + 120.0f;
|
||||||
this->actionFunc = BgSpot06Objects_DoNothing;
|
this->actionFunc = BgSpot06Objects_DoNothing;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this->actionFunc = BgSpot06Objects_GateWaitForSwitch;
|
this->actionFunc = BgSpot06Objects_GateWaitForSwitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (1) {}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case LHO_WATER_TEMPLE_ENTRANCE_LOCK:
|
case LHO_WATER_TEMPLE_ENTRANCE_LOCK:
|
||||||
Actor_ProcessInitChain(thisx, sInitChain);
|
Actor_ProcessInitChain(thisx, sInitChain);
|
||||||
|
|
|
@ -125,7 +125,6 @@ void BgSpot11Oasis_Update(Actor* thisx, PlayState* play) {
|
||||||
BgSpot11Oasis* this = (BgSpot11Oasis*)thisx;
|
BgSpot11Oasis* this = (BgSpot11Oasis*)thisx;
|
||||||
s32 pad;
|
s32 pad;
|
||||||
u32 gameplayFrames;
|
u32 gameplayFrames;
|
||||||
Vec3f sp30;
|
|
||||||
|
|
||||||
this->actionFunc(this, play);
|
this->actionFunc(this, play);
|
||||||
if (this->actionFunc == func_808B2980) {
|
if (this->actionFunc == func_808B2980) {
|
||||||
|
@ -136,6 +135,8 @@ void BgSpot11Oasis_Update(Actor* thisx, PlayState* play) {
|
||||||
if (this->unk_150 && (this->actor.projectedPos.z < 400.0f) && (this->actor.projectedPos.z > -40.0f)) {
|
if (this->unk_150 && (this->actor.projectedPos.z < 400.0f) && (this->actor.projectedPos.z > -40.0f)) {
|
||||||
gameplayFrames = play->gameplayFrames;
|
gameplayFrames = play->gameplayFrames;
|
||||||
if (gameplayFrames & 4) {
|
if (gameplayFrames & 4) {
|
||||||
|
Vec3f sp30;
|
||||||
|
|
||||||
Math_Vec3f_Sum(&this->actor.world.pos, &D_808B2E34[this->unk_151], &sp30);
|
Math_Vec3f_Sum(&this->actor.world.pos, &D_808B2E34[this->unk_151], &sp30);
|
||||||
EffectSsBubble_Spawn(play, &sp30, 0.0f, 15.0f, 50.0f, (Rand_ZeroOne() * 0.12f) + 0.02f);
|
EffectSsBubble_Spawn(play, &sp30, 0.0f, 15.0f, 50.0f, (Rand_ZeroOne() * 0.12f) + 0.02f);
|
||||||
if (Rand_ZeroOne() < 0.3f) {
|
if (Rand_ZeroOne() < 0.3f) {
|
||||||
|
|
|
@ -230,8 +230,8 @@ s32 func_808B4E58(BgSpot16Bombstone* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BgSpot16Bombstone_Init(Actor* thisx, PlayState* play) {
|
void BgSpot16Bombstone_Init(Actor* thisx, PlayState* play) {
|
||||||
|
s16 shouldLive = true;
|
||||||
BgSpot16Bombstone* this = (BgSpot16Bombstone*)thisx;
|
BgSpot16Bombstone* this = (BgSpot16Bombstone*)thisx;
|
||||||
s16 shouldLive;
|
|
||||||
|
|
||||||
func_808B4C30(this);
|
func_808B4C30(this);
|
||||||
|
|
||||||
|
@ -240,6 +240,7 @@ void BgSpot16Bombstone_Init(Actor* thisx, PlayState* play) {
|
||||||
// The boulder is intact
|
// The boulder is intact
|
||||||
shouldLive = func_808B4D9C(this, play);
|
shouldLive = func_808B4D9C(this, play);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
|
@ -249,11 +250,14 @@ void BgSpot16Bombstone_Init(Actor* thisx, PlayState* play) {
|
||||||
// The boulder is debris
|
// The boulder is debris
|
||||||
shouldLive = func_808B4E58(this, play);
|
shouldLive = func_808B4E58(this, play);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
default:
|
default:
|
||||||
PRINTF("Error : arg_data おかしいな(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot16_bombstone.c", 668,
|
PRINTF("Error : arg_data おかしいな(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot16_bombstone.c", 668,
|
||||||
this->actor.params);
|
this->actor.params);
|
||||||
shouldLive = false;
|
shouldLive = false;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!shouldLive) {
|
if (!shouldLive) {
|
||||||
|
@ -451,12 +455,14 @@ void func_808B5950(BgSpot16Bombstone* this, PlayState* play) {
|
||||||
CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base);
|
CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
if (mREG(64) == 1) {
|
if (mREG(64) == 1) {
|
||||||
func_808B561C(this, play);
|
func_808B561C(this, play);
|
||||||
mREG(64) = -10;
|
mREG(64) = -10;
|
||||||
} else if (mREG(64) < 0) {
|
} else if (mREG(64) < 0) {
|
||||||
mREG(64)++;
|
mREG(64)++;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_808B5A78(BgSpot16Bombstone* this) {
|
void func_808B5A78(BgSpot16Bombstone* this) {
|
||||||
|
|
|
@ -91,11 +91,12 @@ void func_808B7770(BgSpot18Basket* this, PlayState* play, f32 arg2) {
|
||||||
s32 i;
|
s32 i;
|
||||||
f32 randomValue;
|
f32 randomValue;
|
||||||
f32 sinValue;
|
f32 sinValue;
|
||||||
s32 count;
|
|
||||||
|
|
||||||
for (i = 0, count = 2; i != count; i++) {
|
for (i = 0; i != 2; i++) {
|
||||||
if (play) {}
|
if (arg2 < Rand_ZeroOne()) {
|
||||||
if (!(arg2 < Rand_ZeroOne())) {
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
D_808B85D0 += 0x7530;
|
D_808B85D0 += 0x7530;
|
||||||
|
|
||||||
sinValue = Math_SinS(D_808B85D0);
|
sinValue = Math_SinS(D_808B85D0);
|
||||||
|
@ -119,7 +120,6 @@ void func_808B7770(BgSpot18Basket* this, PlayState* play, f32 arg2) {
|
||||||
((Rand_ZeroOne() * 30) + 80));
|
((Rand_ZeroOne() * 30) + 80));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static InitChainEntry sInitChain[] = {
|
static InitChainEntry sInitChain[] = {
|
||||||
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
|
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
|
||||||
|
@ -240,9 +240,6 @@ void func_808B7D38(BgSpot18Basket* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_808B7D50(BgSpot18Basket* this, PlayState* play) {
|
void func_808B7D50(BgSpot18Basket* this, PlayState* play) {
|
||||||
f32 tempValue2;
|
|
||||||
f32 tempValue;
|
|
||||||
|
|
||||||
if (this->unk_216 > 120) {
|
if (this->unk_216 > 120) {
|
||||||
Math_StepToS(&this->unk_210, 0x3E8, 0x32);
|
Math_StepToS(&this->unk_210, 0x3E8, 0x32);
|
||||||
} else {
|
} else {
|
||||||
|
@ -281,12 +278,13 @@ void func_808B7D50(BgSpot18Basket* this, PlayState* play) {
|
||||||
func_808B7770(this, play, 0.8f);
|
func_808B7770(this, play, 0.8f);
|
||||||
}
|
}
|
||||||
|
|
||||||
tempValue2 = (this->unk_210 - 500) * 0.0006f;
|
{
|
||||||
|
f32 tempValue2 = (this->unk_210 - 500) * 0.0006f;
|
||||||
tempValue = CLAMP(tempValue2, 0.0f, 1.5f);
|
f32 tempValue = CLAMP(tempValue2, 0.0f, 1.5f);
|
||||||
|
|
||||||
func_800F436C(&this->dyna.actor.projectedPos, NA_SE_EV_WALL_MOVE_SP - SFX_FLAG, tempValue);
|
func_800F436C(&this->dyna.actor.projectedPos, NA_SE_EV_WALL_MOVE_SP - SFX_FLAG, tempValue);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void func_808B7F74(BgSpot18Basket* this) {
|
void func_808B7F74(BgSpot18Basket* this) {
|
||||||
s16 shapeRotY;
|
s16 shapeRotY;
|
||||||
|
@ -308,9 +306,7 @@ void func_808B7F74(BgSpot18Basket* this) {
|
||||||
void func_808B7FC0(BgSpot18Basket* this, PlayState* play) {
|
void func_808B7FC0(BgSpot18Basket* this, PlayState* play) {
|
||||||
s32 pad;
|
s32 pad;
|
||||||
s32 tempUnk214;
|
s32 tempUnk214;
|
||||||
f32 tempUnk210;
|
|
||||||
s16 arrayValue;
|
s16 arrayValue;
|
||||||
f32 clampedTempUnk210;
|
|
||||||
|
|
||||||
this->unk_212 += 0xBB8;
|
this->unk_212 += 0xBB8;
|
||||||
|
|
||||||
|
@ -343,12 +339,13 @@ void func_808B7FC0(BgSpot18Basket* this, PlayState* play) {
|
||||||
func_808B7770(this, play, 0.3f);
|
func_808B7770(this, play, 0.3f);
|
||||||
}
|
}
|
||||||
|
|
||||||
tempUnk210 = (this->unk_210 - 500) * 0.0006f;
|
{
|
||||||
|
f32 tempUnk210 = (this->unk_210 - 500) * 0.0006f;
|
||||||
clampedTempUnk210 = CLAMP(tempUnk210, 0.0f, 1.5f);
|
f32 clampedTempUnk210 = CLAMP(tempUnk210, 0.0f, 1.5f);
|
||||||
|
|
||||||
func_800F436C(&this->dyna.actor.projectedPos, NA_SE_EV_WALL_MOVE_SP - SFX_FLAG, clampedTempUnk210);
|
func_800F436C(&this->dyna.actor.projectedPos, NA_SE_EV_WALL_MOVE_SP - SFX_FLAG, clampedTempUnk210);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void func_808B818C(BgSpot18Basket* this) {
|
void func_808B818C(BgSpot18Basket* this) {
|
||||||
this->actionFunc = func_808B81A0;
|
this->actionFunc = func_808B81A0;
|
||||||
|
|
|
@ -111,7 +111,7 @@ s32 func_808B8910(BgSpot18Obj* this, PlayState* play) {
|
||||||
case 2:
|
case 2:
|
||||||
PRINTF("Error : Obj出現判定が設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot18_obj.c", 202,
|
PRINTF("Error : Obj出現判定が設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot18_obj.c", 202,
|
||||||
this->dyna.actor.params);
|
this->dyna.actor.params);
|
||||||
break;
|
return 0;
|
||||||
default:
|
default:
|
||||||
PRINTF("Error : Obj出現判定失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot18_obj.c", 210,
|
PRINTF("Error : Obj出現判定失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot18_obj.c", 210,
|
||||||
this->dyna.actor.params);
|
this->dyna.actor.params);
|
||||||
|
@ -235,11 +235,9 @@ void func_808B8E7C(BgSpot18Obj* this, PlayState* play) {
|
||||||
|
|
||||||
void func_808B8EE0(BgSpot18Obj* this) {
|
void func_808B8EE0(BgSpot18Obj* this) {
|
||||||
this->actionFunc = func_808B8F08;
|
this->actionFunc = func_808B8F08;
|
||||||
this->dyna.actor.world.rot.y = 0;
|
|
||||||
this->dyna.actor.speed = 0.0f;
|
this->dyna.actor.speed = 0.0f;
|
||||||
this->dyna.actor.velocity.z = 0.0f;
|
this->dyna.actor.velocity.x = this->dyna.actor.velocity.y = this->dyna.actor.velocity.z = 0.0f;
|
||||||
this->dyna.actor.velocity.y = 0.0f;
|
this->dyna.actor.world.rot.y = 0;
|
||||||
this->dyna.actor.velocity.x = 0.0f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_808B8F08(BgSpot18Obj* this, PlayState* play) {
|
void func_808B8F08(BgSpot18Obj* this, PlayState* play) {
|
||||||
|
|
|
@ -171,10 +171,10 @@ void BgYdanHasi_Update(Actor* thisx, PlayState* play) {
|
||||||
|
|
||||||
void BgYdanHasi_Draw(Actor* thisx, PlayState* play) {
|
void BgYdanHasi_Draw(Actor* thisx, PlayState* play) {
|
||||||
static Gfx* dLists[] = { gDTSlidingPlatformDL, gDTWaterPlaneDL, gDTRisingPlatformsDL };
|
static Gfx* dLists[] = { gDTSlidingPlatformDL, gDTWaterPlaneDL, gDTRisingPlatformsDL };
|
||||||
BgYdanHasi* this = (BgYdanHasi*)thisx;
|
s16 params = thisx->params;
|
||||||
|
|
||||||
if (this->dyna.actor.params == HASI_WATER_BLOCK || this->dyna.actor.params == HASI_THREE_BLOCKS) {
|
if (params == HASI_WATER_BLOCK || params == HASI_THREE_BLOCKS) {
|
||||||
Gfx_DrawDListOpa(play, dLists[this->dyna.actor.params]);
|
Gfx_DrawDListOpa(play, dLists[params]);
|
||||||
} else {
|
} else {
|
||||||
OPEN_DISPS(play->state.gfxCtx, "../z_bg_ydan_hasi.c", 577);
|
OPEN_DISPS(play->state.gfxCtx, "../z_bg_ydan_hasi.c", 577);
|
||||||
|
|
||||||
|
|
|
@ -417,6 +417,9 @@ void BgYdanSp_Draw(Actor* thisx, PlayState* play) {
|
||||||
MtxF mtxF;
|
MtxF mtxF;
|
||||||
|
|
||||||
OPEN_DISPS(play->state.gfxCtx, "../z_bg_ydan_sp.c", 781);
|
OPEN_DISPS(play->state.gfxCtx, "../z_bg_ydan_sp.c", 781);
|
||||||
|
|
||||||
|
if (1) {}
|
||||||
|
|
||||||
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
||||||
if (thisx->params == WEB_WALL) {
|
if (thisx->params == WEB_WALL) {
|
||||||
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_ydan_sp.c", 787),
|
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_ydan_sp.c", 787),
|
||||||
|
|
|
@ -1293,8 +1293,8 @@ void BossGanondrof_Update(Actor* thisx, PlayState* play) {
|
||||||
s32 pad2;
|
s32 pad2;
|
||||||
s16 i;
|
s16 i;
|
||||||
s32 pad;
|
s32 pad;
|
||||||
BossGanondrof* this = (BossGanondrof*)thisx;
|
|
||||||
EnfHG* horse;
|
EnfHG* horse;
|
||||||
|
BossGanondrof* this = (BossGanondrof*)thisx;
|
||||||
|
|
||||||
PRINTF("MOVE START %d\n", this->actor.params);
|
PRINTF("MOVE START %d\n", this->actor.params);
|
||||||
this->actor.flags &= ~ACTOR_FLAG_10;
|
this->actor.flags &= ~ACTOR_FLAG_10;
|
||||||
|
@ -1303,8 +1303,8 @@ void BossGanondrof_Update(Actor* thisx, PlayState* play) {
|
||||||
Actor_Kill(&this->actor);
|
Actor_Kill(&this->actor);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this->work[GND_VARIANCE_TIMER]++;
|
|
||||||
horse = (EnfHG*)this->actor.child;
|
horse = (EnfHG*)this->actor.child;
|
||||||
|
this->work[GND_VARIANCE_TIMER]++;
|
||||||
PRINTF("MOVE START EEEEEEEEEEEEEEEEEEEEEE%d\n", this->actor.params);
|
PRINTF("MOVE START EEEEEEEEEEEEEEEEEEEEEE%d\n", this->actor.params);
|
||||||
|
|
||||||
this->actionFunc(this, play);
|
this->actionFunc(this, play);
|
||||||
|
@ -1520,6 +1520,7 @@ void BossGanondrof_Draw(Actor* thisx, PlayState* play) {
|
||||||
BossGanondrof_PostLimbDraw, this);
|
BossGanondrof_PostLimbDraw, this);
|
||||||
PRINTF("DRAW 22\n");
|
PRINTF("DRAW 22\n");
|
||||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||||
|
if (1) {}
|
||||||
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_ganondrof.c", 3814);
|
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_ganondrof.c", 3814);
|
||||||
PRINTF("DRAW END %d\n", this->actor.params);
|
PRINTF("DRAW END %d\n", this->actor.params);
|
||||||
}
|
}
|
||||||
|
|
|
@ -672,7 +672,8 @@ void BossGoma_SetupEncounterState4(BossGoma* this, PlayState* play) {
|
||||||
void BossGoma_Encounter(BossGoma* this, PlayState* play) {
|
void BossGoma_Encounter(BossGoma* this, PlayState* play) {
|
||||||
Camera* mainCam;
|
Camera* mainCam;
|
||||||
Player* player = GET_PLAYER(play);
|
Player* player = GET_PLAYER(play);
|
||||||
s32 pad[2];
|
f32 s;
|
||||||
|
s32 pad;
|
||||||
|
|
||||||
Math_ApproachZeroF(&this->actor.speed, 0.5f, 2.0f);
|
Math_ApproachZeroF(&this->actor.speed, 0.5f, 2.0f);
|
||||||
|
|
||||||
|
@ -761,7 +762,8 @@ void BossGoma_Encounter(BossGoma* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->frameCount >= 228) {
|
if (this->frameCount >= 228) {
|
||||||
mainCam = Play_GetCamera(play, CAM_ID_MAIN);
|
Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN);
|
||||||
|
|
||||||
mainCam->eye = this->subCamEye;
|
mainCam->eye = this->subCamEye;
|
||||||
mainCam->eyeNext = this->subCamEye;
|
mainCam->eyeNext = this->subCamEye;
|
||||||
mainCam->at = this->subCamAt;
|
mainCam->at = this->subCamAt;
|
||||||
|
@ -909,8 +911,7 @@ void BossGoma_Encounter(BossGoma* this, PlayState* play) {
|
||||||
this->subCamAt.z = this->actor.world.pos.z;
|
this->subCamAt.z = this->actor.world.pos.z;
|
||||||
|
|
||||||
if (this->framesUntilNextAction != 0) {
|
if (this->framesUntilNextAction != 0) {
|
||||||
f32 s = sinf(this->framesUntilNextAction * 3.1415f * 0.5f);
|
s = sinf(this->framesUntilNextAction * 3.1415f * 0.5f);
|
||||||
|
|
||||||
this->subCamAt.y = this->framesUntilNextAction * s * 0.7f + this->actor.world.pos.y;
|
this->subCamAt.y = this->framesUntilNextAction * s * 0.7f + this->actor.world.pos.y;
|
||||||
} else {
|
} else {
|
||||||
Math_ApproachF(&this->subCamAt.y, this->actor.focus.pos.y, 0.1f, 10.0f);
|
Math_ApproachF(&this->subCamAt.y, this->actor.focus.pos.y, 0.1f, 10.0f);
|
||||||
|
@ -2047,9 +2048,8 @@ void BossGoma_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* r
|
||||||
static Vec3f zero = { 0.0f, 0.0f, 0.0f };
|
static Vec3f zero = { 0.0f, 0.0f, 0.0f };
|
||||||
Vec3f childPos;
|
Vec3f childPos;
|
||||||
Vec3s childRot;
|
Vec3s childRot;
|
||||||
EnGoma* babyGohma;
|
|
||||||
BossGoma* this = (BossGoma*)thisx;
|
BossGoma* this = (BossGoma*)thisx;
|
||||||
s32 pad;
|
s32 pad[2];
|
||||||
MtxF mtx;
|
MtxF mtx;
|
||||||
|
|
||||||
if (limbIndex == BOSSGOMA_LIMB_TAIL4) { // tail end/last part
|
if (limbIndex == BOSSGOMA_LIMB_TAIL4) { // tail end/last part
|
||||||
|
@ -2073,6 +2073,8 @@ void BossGoma_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* r
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->deadLimbsState[limbIndex] == 1) {
|
if (this->deadLimbsState[limbIndex] == 1) {
|
||||||
|
EnGoma* babyGohma;
|
||||||
|
|
||||||
this->deadLimbsState[limbIndex] = 2;
|
this->deadLimbsState[limbIndex] = 2;
|
||||||
Matrix_MultVec3f(&zero, &childPos);
|
Matrix_MultVec3f(&zero, &childPos);
|
||||||
Matrix_Get(&mtx);
|
Matrix_Get(&mtx);
|
||||||
|
|
|
@ -407,51 +407,14 @@ void BossMo_SetupTentacle(BossMo* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
s16 tentXrot;
|
|
||||||
s16 sp1B4 = 0;
|
|
||||||
s32 buttons;
|
|
||||||
Player* player = GET_PLAYER(play);
|
|
||||||
s16 indS0;
|
|
||||||
s16 indS1;
|
s16 indS1;
|
||||||
Camera* mainCam1;
|
s16 sp1B4 = 0;
|
||||||
Camera* mainCam2;
|
Player* player = GET_PLAYER(play);
|
||||||
BossMo* otherTent = (BossMo*)this->otherTent;
|
|
||||||
f32 maxSwingRateX;
|
|
||||||
f32 maxSwingLagX;
|
|
||||||
f32 maxSwingSizeX;
|
|
||||||
f32 maxSwingRateZ;
|
|
||||||
f32 maxSwingLagZ;
|
|
||||||
f32 maxSwingSizeZ;
|
|
||||||
f32 swingRateAccel;
|
|
||||||
f32 swingSizeAccel;
|
|
||||||
s16 rippleCount;
|
|
||||||
s16 indT5;
|
|
||||||
Vec3f ripplePos;
|
|
||||||
f32 randAngle;
|
|
||||||
f32 randFloat;
|
|
||||||
f32 tempf1;
|
f32 tempf1;
|
||||||
f32 tempf2;
|
f32 tempf2;
|
||||||
f32 sin;
|
f32 sin;
|
||||||
f32 cos;
|
f32 cos;
|
||||||
f32 temp;
|
BossMo* otherTent = (BossMo*)this->otherTent;
|
||||||
f32 dx;
|
|
||||||
f32 dy;
|
|
||||||
f32 dz;
|
|
||||||
Vec3f sp138;
|
|
||||||
Vec3f sp12C;
|
|
||||||
Vec3f sp120;
|
|
||||||
s32 pad11C;
|
|
||||||
s32 pad118;
|
|
||||||
s32 pad114;
|
|
||||||
s32 pad110;
|
|
||||||
s32 pad10C;
|
|
||||||
s32 pad108;
|
|
||||||
Vec3f spFC;
|
|
||||||
Vec3f spF0;
|
|
||||||
f32 padEC;
|
|
||||||
Vec3f spE0;
|
|
||||||
Vec3f spD4;
|
|
||||||
Vec3f spC8;
|
|
||||||
|
|
||||||
if (this->work[MO_TENT_ACTION_STATE] <= MO_TENT_DEATH_3) {
|
if (this->work[MO_TENT_ACTION_STATE] <= MO_TENT_DEATH_3) {
|
||||||
this->actor.world.pos.y = MO_WATER_LEVEL(play);
|
this->actor.world.pos.y = MO_WATER_LEVEL(play);
|
||||||
|
@ -460,6 +423,15 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
(this->work[MO_TENT_ACTION_STATE] >= MO_TENT_DEATH_START) ||
|
(this->work[MO_TENT_ACTION_STATE] >= MO_TENT_DEATH_START) ||
|
||||||
(this->work[MO_TENT_ACTION_STATE] == MO_TENT_RETREAT) || (this->work[MO_TENT_ACTION_STATE] == MO_TENT_SWING) ||
|
(this->work[MO_TENT_ACTION_STATE] == MO_TENT_RETREAT) || (this->work[MO_TENT_ACTION_STATE] == MO_TENT_SWING) ||
|
||||||
(this->work[MO_TENT_ACTION_STATE] == MO_TENT_SHAKE)) {
|
(this->work[MO_TENT_ACTION_STATE] == MO_TENT_SHAKE)) {
|
||||||
|
f32 maxSwingRateX;
|
||||||
|
f32 maxSwingLagX;
|
||||||
|
f32 maxSwingSizeX;
|
||||||
|
f32 maxSwingRateZ;
|
||||||
|
f32 maxSwingLagZ;
|
||||||
|
f32 maxSwingSizeZ;
|
||||||
|
f32 swingRateAccel;
|
||||||
|
f32 swingSizeAccel;
|
||||||
|
|
||||||
if (this->work[MO_TENT_ACTION_STATE] == MO_TENT_READY) {
|
if (this->work[MO_TENT_ACTION_STATE] == MO_TENT_READY) {
|
||||||
if (sMorphaCore->csState != MO_BATTLE) {
|
if (sMorphaCore->csState != MO_BATTLE) {
|
||||||
maxSwingRateX = 2000.0f;
|
maxSwingRateX = 2000.0f;
|
||||||
|
@ -570,6 +542,13 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
this->timers[0] = 60;
|
this->timers[0] = 60;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (1) {
|
||||||
|
s16 rippleCount;
|
||||||
|
Vec3f ripplePos;
|
||||||
|
f32 randAngle;
|
||||||
|
f32 randFloat;
|
||||||
|
s32 pad;
|
||||||
|
|
||||||
if (this->timers[0] > 50) {
|
if (this->timers[0] > 50) {
|
||||||
rippleCount = 1;
|
rippleCount = 1;
|
||||||
} else if (this->timers[0] > 40) {
|
} else if (this->timers[0] > 40) {
|
||||||
|
@ -590,6 +569,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
ripplePos.y = MO_WATER_LEVEL(play);
|
ripplePos.y = MO_WATER_LEVEL(play);
|
||||||
BossMo_SpawnRipple(play->specialEffects, &ripplePos, 40.0f, 110.0f, 80, 290, MO_FX_SMALL_RIPPLE);
|
BossMo_SpawnRipple(play->specialEffects, &ripplePos, 40.0f, 110.0f, 80, 290, MO_FX_SMALL_RIPPLE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MO_TENT_READY:
|
case MO_TENT_READY:
|
||||||
case MO_TENT_SWING:
|
case MO_TENT_SWING:
|
||||||
|
@ -634,7 +614,8 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
this->attackAngleMod = Rand_CenteredFloat(0x1000);
|
this->attackAngleMod = Rand_CenteredFloat(0x1000);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tentXrot = this->tentRot[28].x;
|
s16 tentXrot = this->tentRot[28].x;
|
||||||
|
|
||||||
if ((this->timers[0] == 0) && (tentXrot >= 0) && (sp1B4 < 0)) {
|
if ((this->timers[0] == 0) && (tentXrot >= 0) && (sp1B4 < 0)) {
|
||||||
this->work[MO_TENT_ACTION_STATE] = MO_TENT_ATTACK;
|
this->work[MO_TENT_ACTION_STATE] = MO_TENT_ATTACK;
|
||||||
if (this == sMorphaTent1) {
|
if (this == sMorphaTent1) {
|
||||||
|
@ -661,9 +642,10 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
Math_ApproachF(&this->tentMaxAngle, 0.5f, 1.0f, 0.01);
|
Math_ApproachF(&this->tentMaxAngle, 0.5f, 1.0f, 0.01);
|
||||||
Math_ApproachF(&this->tentSpeed, 160.0f, 1.0f, 50.0f);
|
Math_ApproachF(&this->tentSpeed, 160.0f, 1.0f, 50.0f);
|
||||||
if ((this->timers[0] == 0) || (this->playerHitTimer != 0)) {
|
if ((this->timers[0] == 0) || (this->playerHitTimer != 0)) {
|
||||||
dx = this->tentPos[22].x - player->actor.world.pos.x;
|
f32 dx = this->tentPos[22].x - player->actor.world.pos.x;
|
||||||
dy = this->tentPos[22].y - player->actor.world.pos.y;
|
f32 dy = this->tentPos[22].y - player->actor.world.pos.y;
|
||||||
dz = this->tentPos[22].z - player->actor.world.pos.z;
|
f32 dz = this->tentPos[22].z - player->actor.world.pos.z;
|
||||||
|
|
||||||
if ((fabsf(dy) < 50.0f) && !HAS_LINK(otherTent) && (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 120.0f)) {
|
if ((fabsf(dy) < 50.0f) && !HAS_LINK(otherTent) && (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 120.0f)) {
|
||||||
this->tentMaxAngle = .001f;
|
this->tentMaxAngle = .001f;
|
||||||
this->work[MO_TENT_ACTION_STATE] = MO_TENT_CURL;
|
this->work[MO_TENT_ACTION_STATE] = MO_TENT_CURL;
|
||||||
|
@ -765,7 +747,8 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
Math_ApproachS(&player->actor.shape.rot.y, this->grabPosRot.rot.y, 2, 0x7D0);
|
Math_ApproachS(&player->actor.shape.rot.y, this->grabPosRot.rot.y, 2, 0x7D0);
|
||||||
Math_ApproachS(&player->actor.shape.rot.z, this->grabPosRot.rot.z, 2, 0x7D0);
|
Math_ApproachS(&player->actor.shape.rot.z, this->grabPosRot.rot.z, 2, 0x7D0);
|
||||||
if (this->timers[0] == 0) {
|
if (this->timers[0] == 0) {
|
||||||
mainCam1 = Play_GetCamera(play, CAM_ID_MAIN);
|
Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN);
|
||||||
|
|
||||||
this->work[MO_TENT_ACTION_STATE] = MO_TENT_SHAKE;
|
this->work[MO_TENT_ACTION_STATE] = MO_TENT_SHAKE;
|
||||||
this->tentMaxAngle = .001f;
|
this->tentMaxAngle = .001f;
|
||||||
this->fwork[MO_TENT_SWING_RATE_X] = this->fwork[MO_TENT_SWING_RATE_Z] =
|
this->fwork[MO_TENT_SWING_RATE_X] = this->fwork[MO_TENT_SWING_RATE_Z] =
|
||||||
|
@ -778,8 +761,8 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
this->subCamId = Play_CreateSubCamera(play);
|
this->subCamId = Play_CreateSubCamera(play);
|
||||||
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_WAIT);
|
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_WAIT);
|
||||||
Play_ChangeCameraStatus(play, this->subCamId, CAM_STAT_ACTIVE);
|
Play_ChangeCameraStatus(play, this->subCamId, CAM_STAT_ACTIVE);
|
||||||
this->subCamEye = mainCam1->eye;
|
this->subCamEye = mainCam->eye;
|
||||||
this->subCamAt = mainCam1->at;
|
this->subCamAt = mainCam->at;
|
||||||
this->subCamYaw = Math_FAtan2F(this->subCamEye.x - this->actor.world.pos.x,
|
this->subCamYaw = Math_FAtan2F(this->subCamEye.x - this->actor.world.pos.x,
|
||||||
this->subCamEye.z - this->actor.world.pos.z);
|
this->subCamEye.z - this->actor.world.pos.z);
|
||||||
this->subCamYawRate = 0;
|
this->subCamYawRate = 0;
|
||||||
|
@ -798,12 +781,14 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
Math_ApproachF(&this->waterLevelMod, -5.0f, 0.1f, 0.4f);
|
Math_ApproachF(&this->waterLevelMod, -5.0f, 0.1f, 0.4f);
|
||||||
sp1B4 = this->tentRot[15].x;
|
sp1B4 = this->tentRot[15].x;
|
||||||
buttons = play->state.input[0].press.button;
|
if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_A) ||
|
||||||
if (CHECK_BTN_ALL(buttons, BTN_A) || CHECK_BTN_ALL(buttons, BTN_B)) {
|
CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B)) {
|
||||||
this->mashCounter++;
|
this->mashCounter++;
|
||||||
}
|
}
|
||||||
for (indS1 = 0; indS1 < 41; indS1++) {
|
for (indS1 = 0; indS1 < 41; indS1++) {
|
||||||
if (indS1 < 20) {
|
if (indS1 < 20) {
|
||||||
|
f32 temp;
|
||||||
|
|
||||||
sin = Math_SinS(((s16)this->fwork[MO_TENT_SWING_LAG_X] * indS1) + this->xSwing);
|
sin = Math_SinS(((s16)this->fwork[MO_TENT_SWING_LAG_X] * indS1) + this->xSwing);
|
||||||
tempf1 = this->fwork[MO_TENT_SWING_SIZE_X] * (indS1 * 0.025f * sin);
|
tempf1 = this->fwork[MO_TENT_SWING_SIZE_X] * (indS1 * 0.025f * sin);
|
||||||
cos = Math_SinS(((s16)this->fwork[MO_TENT_SWING_LAG_Z] * indS1) + this->zSwing);
|
cos = Math_SinS(((s16)this->fwork[MO_TENT_SWING_LAG_Z] * indS1) + this->zSwing);
|
||||||
|
@ -828,7 +813,8 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
Math_ApproachF(&this->tentSpeed, 480.0f, 1.0f, 10.0f);
|
Math_ApproachF(&this->tentSpeed, 480.0f, 1.0f, 10.0f);
|
||||||
Math_ApproachF(&this->tentPulse, 0.3f, 0.5f, 0.03f);
|
Math_ApproachF(&this->tentPulse, 0.3f, 0.5f, 0.03f);
|
||||||
if ((this->mashCounter >= 40) || (this->timers[0] == 0)) {
|
if ((this->mashCounter >= 40) || (this->timers[0] == 0)) {
|
||||||
tentXrot = this->tentRot[15].x;
|
s16 tentXrot = this->tentRot[15].x;
|
||||||
|
|
||||||
if ((tentXrot < 0) && (sp1B4 >= 0)) {
|
if ((tentXrot < 0) && (sp1B4 >= 0)) {
|
||||||
this->work[MO_TENT_ACTION_STATE] = MO_TENT_RETREAT;
|
this->work[MO_TENT_ACTION_STATE] = MO_TENT_RETREAT;
|
||||||
this->work[MO_TENT_INVINC_TIMER] = 50;
|
this->work[MO_TENT_INVINC_TIMER] = 50;
|
||||||
|
@ -844,6 +830,9 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this->subCamId != SUB_CAM_ID_DONE) {
|
if (this->subCamId != SUB_CAM_ID_DONE) {
|
||||||
|
Vec3f sp138;
|
||||||
|
Vec3f sp12C;
|
||||||
|
|
||||||
sp138.x = 0;
|
sp138.x = 0;
|
||||||
sp138.y = 100.0f;
|
sp138.y = 100.0f;
|
||||||
sp138.z = 200.0f;
|
sp138.z = 200.0f;
|
||||||
|
@ -869,6 +858,12 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
Math_ApproachF(&this->tentRippleSize, 0.15f, 0.5f, 0.01);
|
Math_ApproachF(&this->tentRippleSize, 0.15f, 0.5f, 0.01);
|
||||||
if (this->meltIndex < 41) {
|
if (this->meltIndex < 41) {
|
||||||
|
Vec3f sp120;
|
||||||
|
s16 indS0;
|
||||||
|
s32 pad118;
|
||||||
|
s32 pad114;
|
||||||
|
s32 pad110;
|
||||||
|
|
||||||
for (indS0 = 0; indS0 < 10; indS0++) {
|
for (indS0 = 0; indS0 < 10; indS0++) {
|
||||||
sp120 = this->tentPos[this->meltIndex];
|
sp120 = this->tentPos[this->meltIndex];
|
||||||
sp120.x += Rand_CenteredFloat(30.0f);
|
sp120.x += Rand_CenteredFloat(30.0f);
|
||||||
|
@ -895,10 +890,11 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
Math_ApproachF(&this->subCamAt.z, player->actor.world.pos.z, 0.5f, 50.0f);
|
Math_ApproachF(&this->subCamAt.z, player->actor.world.pos.z, 0.5f, 50.0f);
|
||||||
Play_SetCameraAtEye(play, this->subCamId, &this->subCamAt, &this->subCamEye);
|
Play_SetCameraAtEye(play, this->subCamId, &this->subCamAt, &this->subCamEye);
|
||||||
if (player->actor.world.pos.y <= 42.0f) {
|
if (player->actor.world.pos.y <= 42.0f) {
|
||||||
mainCam2 = Play_GetCamera(play, CAM_ID_MAIN);
|
Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN);
|
||||||
mainCam2->eye = this->subCamEye;
|
|
||||||
mainCam2->eyeNext = this->subCamEye;
|
mainCam->eye = this->subCamEye;
|
||||||
mainCam2->at = this->subCamAt;
|
mainCam->eyeNext = this->subCamEye;
|
||||||
|
mainCam->at = this->subCamAt;
|
||||||
Play_ReturnToMainCam(play, this->subCamId, 0);
|
Play_ReturnToMainCam(play, this->subCamId, 0);
|
||||||
this->subCamId = SUB_CAM_ID_DONE;
|
this->subCamId = SUB_CAM_ID_DONE;
|
||||||
Cutscene_StopManual(play, &play->csCtx);
|
Cutscene_StopManual(play, &play->csCtx);
|
||||||
|
@ -917,11 +913,14 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
Math_ApproachF(&this->tentMaxAngle, 0.5f, 1.0f, 0.01);
|
Math_ApproachF(&this->tentMaxAngle, 0.5f, 1.0f, 0.01);
|
||||||
Math_ApproachF(&this->tentSpeed, 320.0f, 1.0f, 50.0f);
|
Math_ApproachF(&this->tentSpeed, 320.0f, 1.0f, 50.0f);
|
||||||
if (this->timers[0] == 0) {
|
if (this->timers[0] == 0) {
|
||||||
|
s16 indS0;
|
||||||
|
Vec3f spFC;
|
||||||
|
Vec3f spF0;
|
||||||
|
|
||||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||||
Math_ApproachF(&this->baseAlpha, 0.0, 1.0f, 5.0f);
|
Math_ApproachF(&this->baseAlpha, 0.0, 1.0f, 5.0f);
|
||||||
for (indS1 = 0; indS1 < 40; indS1++) {
|
for (indS1 = 0; indS1 < 40; indS1++) {
|
||||||
indT5 = Rand_ZeroFloat(20.9f);
|
indS0 = sTentSpawnIndex[(s16)Rand_ZeroFloat(20.9f)];
|
||||||
indS0 = sTentSpawnIndex[indT5];
|
|
||||||
spFC.x = 0;
|
spFC.x = 0;
|
||||||
spFC.y = 0;
|
spFC.y = 0;
|
||||||
spFC.z = 0;
|
spFC.z = 0;
|
||||||
|
@ -1067,6 +1066,8 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
Math_ApproachF(&this->tentSpeed, 0.1f, 1.0f, 0.005f);
|
Math_ApproachF(&this->tentSpeed, 0.1f, 1.0f, 0.005f);
|
||||||
this->actor.velocity.y = 0.0;
|
this->actor.velocity.y = 0.0;
|
||||||
} else {
|
} else {
|
||||||
|
f32 padEC;
|
||||||
|
|
||||||
this->fwork[MO_TENT_MAX_STRETCH] = 0.2f;
|
this->fwork[MO_TENT_MAX_STRETCH] = 0.2f;
|
||||||
this->fwork[MO_TENT_MAX_STRETCH] += Math_SinS(this->work[MO_TENT_MOVE_TIMER] * 0x2000) * 0.05f;
|
this->fwork[MO_TENT_MAX_STRETCH] += Math_SinS(this->work[MO_TENT_MOVE_TIMER] * 0x2000) * 0.05f;
|
||||||
padEC = Math_CosS(this->work[MO_TENT_MOVE_TIMER] * 0x2000) * 0.0005f;
|
padEC = Math_CosS(this->work[MO_TENT_MOVE_TIMER] * 0x2000) * 0.0005f;
|
||||||
|
@ -1081,6 +1082,10 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
this->timers[0] = 60;
|
this->timers[0] = 60;
|
||||||
Sfx_PlaySfxAtPos(&this->tentTipPos, NA_SE_EN_MOFER_CORE_JUMP);
|
Sfx_PlaySfxAtPos(&this->tentTipPos, NA_SE_EN_MOFER_CORE_JUMP);
|
||||||
for (indS1 = 0; indS1 < 300; indS1++) {
|
for (indS1 = 0; indS1 < 300; indS1++) {
|
||||||
|
Vec3f spE0;
|
||||||
|
Vec3f spD4;
|
||||||
|
Vec3f spC8;
|
||||||
|
|
||||||
spC8.x = 0.0;
|
spC8.x = 0.0;
|
||||||
spC8.y = 0.0;
|
spC8.y = 0.0;
|
||||||
spC8.z = indS1 * 0.03f;
|
spC8.z = indS1 * 0.03f;
|
||||||
|
@ -1137,11 +1142,11 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
|
||||||
|
|
||||||
void BossMo_TentCollisionCheck(BossMo* this, PlayState* play) {
|
void BossMo_TentCollisionCheck(BossMo* this, PlayState* play) {
|
||||||
s16 i1;
|
s16 i1;
|
||||||
|
s16 i2;
|
||||||
|
ColliderElement* acHitElem;
|
||||||
|
|
||||||
for (i1 = 0; i1 < ARRAY_COUNT(this->tentElements); i1++) {
|
for (i1 = 0; i1 < ARRAY_COUNT(this->tentElements); i1++) {
|
||||||
if (this->tentCollider.elements[i1].base.bumperFlags & BUMP_HIT) {
|
if (this->tentCollider.elements[i1].base.bumperFlags & BUMP_HIT) {
|
||||||
s16 i2;
|
|
||||||
ColliderElement* acHitElem;
|
|
||||||
|
|
||||||
for (i2 = 0; i2 < 19; i2++) {
|
for (i2 = 0; i2 < 19; i2++) {
|
||||||
this->tentCollider.elements[i2].base.bumperFlags &= ~BUMP_HIT;
|
this->tentCollider.elements[i2].base.bumperFlags &= ~BUMP_HIT;
|
||||||
|
@ -1352,13 +1357,14 @@ void BossMo_IntroCs(BossMo* this, PlayState* play) {
|
||||||
this->work[MO_TENT_ACTION_STATE] = MO_CORE_INTRO_REVEAL;
|
this->work[MO_TENT_ACTION_STATE] = MO_CORE_INTRO_REVEAL;
|
||||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||||
sMorphaTent1->actor.flags |= ACTOR_FLAG_0;
|
sMorphaTent1->actor.flags |= ACTOR_FLAG_0;
|
||||||
} else {
|
goto intro_reveal;
|
||||||
|
}
|
||||||
sMorphaTent1->xSwing = 0xCEC;
|
sMorphaTent1->xSwing = 0xCEC;
|
||||||
sMorphaTent1->fwork[MO_TENT_SWING_RATE_X] = 0.0f;
|
sMorphaTent1->fwork[MO_TENT_SWING_RATE_X] = 0.0f;
|
||||||
sMorphaTent1->fwork[MO_TENT_SWING_LAG_X] = 1000.0f;
|
sMorphaTent1->fwork[MO_TENT_SWING_LAG_X] = 1000.0f;
|
||||||
sMorphaTent1->fwork[MO_TENT_SWING_SIZE_X] = 2500.0f;
|
sMorphaTent1->fwork[MO_TENT_SWING_SIZE_X] = 2500.0f;
|
||||||
break;
|
break;
|
||||||
}
|
intro_reveal:
|
||||||
case MO_INTRO_REVEAL:
|
case MO_INTRO_REVEAL:
|
||||||
if (this->timers[2] >= 160) {
|
if (this->timers[2] >= 160) {
|
||||||
this->subCamEye.x = 150.0f;
|
this->subCamEye.x = 150.0f;
|
||||||
|
@ -1858,13 +1864,6 @@ void BossMo_Core(BossMo* this, PlayState* play) {
|
||||||
s16 index; // not on stack
|
s16 index; // not on stack
|
||||||
f32 sp88;
|
f32 sp88;
|
||||||
s32 pad84;
|
s32 pad84;
|
||||||
f32 sp80;
|
|
||||||
f32 sp7C;
|
|
||||||
Vec3f sp70;
|
|
||||||
Vec3f sp64;
|
|
||||||
f32 sp60;
|
|
||||||
f32 sp5C;
|
|
||||||
f32 sp58;
|
|
||||||
|
|
||||||
this->waterTex1x += -1.0f;
|
this->waterTex1x += -1.0f;
|
||||||
this->waterTex1y += -1.0f;
|
this->waterTex1y += -1.0f;
|
||||||
|
@ -2028,6 +2027,11 @@ void BossMo_Core(BossMo* this, PlayState* play) {
|
||||||
Math_ApproachF(&this->actor.world.pos.z, this->targetPos.z, 0.5f, this->actor.speed);
|
Math_ApproachF(&this->actor.world.pos.z, this->targetPos.z, 0.5f, this->actor.speed);
|
||||||
Math_ApproachF(&this->actor.speed, 30.0f, 1.0f, 1.0f);
|
Math_ApproachF(&this->actor.speed, 30.0f, 1.0f, 1.0f);
|
||||||
} else {
|
} else {
|
||||||
|
f32 sp80;
|
||||||
|
f32 sp7C;
|
||||||
|
Vec3f sp70;
|
||||||
|
Vec3f sp64;
|
||||||
|
|
||||||
switch (this->work[MO_TENT_ACTION_STATE]) {
|
switch (this->work[MO_TENT_ACTION_STATE]) {
|
||||||
case MO_CORE_MOVE:
|
case MO_CORE_MOVE:
|
||||||
sp80 = Math_SinS(this->work[MO_TENT_VAR_TIMER] * 0x800) * 100.0f;
|
sp80 = Math_SinS(this->work[MO_TENT_VAR_TIMER] * 0x800) * 100.0f;
|
||||||
|
@ -2165,6 +2169,9 @@ void BossMo_Core(BossMo* this, PlayState* play) {
|
||||||
} else {
|
} else {
|
||||||
this->timers[3] = 8;
|
this->timers[3] = 8;
|
||||||
for (i = 0; i < 10; i++) {
|
for (i = 0; i < 10; i++) {
|
||||||
|
f32 sp60;
|
||||||
|
f32 sp5C;
|
||||||
|
|
||||||
sp5C = Rand_ZeroFloat(3.14f);
|
sp5C = Rand_ZeroFloat(3.14f);
|
||||||
sp60 = Rand_ZeroFloat(0.6f) + 1.6f;
|
sp60 = Rand_ZeroFloat(0.6f) + 1.6f;
|
||||||
effectVelocity.x = Math_SinS(((i * (f32)0x10000) / 10.0f) + sp5C) * sp60;
|
effectVelocity.x = Math_SinS(((i * (f32)0x10000) / 10.0f) + sp5C) * sp60;
|
||||||
|
@ -2187,6 +2194,8 @@ void BossMo_Core(BossMo* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
if ((this->actor.world.pos.y < MO_WATER_LEVEL(play)) || (this->work[MO_TENT_ACTION_STATE] >= MO_CORE_ATTACK)) {
|
if ((this->actor.world.pos.y < MO_WATER_LEVEL(play)) || (this->work[MO_TENT_ACTION_STATE] >= MO_CORE_ATTACK)) {
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
|
f32 sp58;
|
||||||
|
|
||||||
effectAccel.x = effectAccel.z = 0.0f;
|
effectAccel.x = effectAccel.z = 0.0f;
|
||||||
effectVelocity.x = effectVelocity.y = effectVelocity.z = 0.0f;
|
effectVelocity.x = effectVelocity.y = effectVelocity.z = 0.0f;
|
||||||
if (this->work[MO_TENT_ACTION_STATE] >= MO_CORE_ATTACK) {
|
if (this->work[MO_TENT_ACTION_STATE] >= MO_CORE_ATTACK) {
|
||||||
|
@ -2725,7 +2734,6 @@ void BossMo_DrawTent(Actor* thisx, PlayState* play) {
|
||||||
u16 texCoordScale;
|
u16 texCoordScale;
|
||||||
|
|
||||||
OPEN_DISPS(play->state.gfxCtx, "../z_boss_mo.c", 6958);
|
OPEN_DISPS(play->state.gfxCtx, "../z_boss_mo.c", 6958);
|
||||||
if (1) {}
|
|
||||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, (s8)(this->baseAlpha * 1.5f));
|
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, (s8)(this->baseAlpha * 1.5f));
|
||||||
gDPSetEnvColor(POLY_OPA_DISP++, 150, 150, 150, 0);
|
gDPSetEnvColor(POLY_OPA_DISP++, 150, 150, 150, 0);
|
||||||
|
@ -2743,6 +2751,7 @@ void BossMo_DrawTent(Actor* thisx, PlayState* play) {
|
||||||
if (this->drawActor) {
|
if (this->drawActor) {
|
||||||
BossMo_DrawTentacle(this, play);
|
BossMo_DrawTentacle(this, play);
|
||||||
}
|
}
|
||||||
|
if (1) {}
|
||||||
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_mo.c", 7023);
|
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_mo.c", 7023);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -363,10 +363,11 @@ void BossSst_HeadSetupIntro(BossSst* this, PlayState* play) {
|
||||||
player->actor.world.pos.x = sRoomCenter.x;
|
player->actor.world.pos.x = sRoomCenter.x;
|
||||||
player->actor.world.pos.y = ROOM_CENTER_Y + 1000.0f;
|
player->actor.world.pos.y = ROOM_CENTER_Y + 1000.0f;
|
||||||
player->actor.world.pos.z = sRoomCenter.z;
|
player->actor.world.pos.z = sRoomCenter.z;
|
||||||
player->speedXZ = player->actor.velocity.y = 0.0f;
|
player->speedXZ = 0.0f;
|
||||||
player->actor.shape.rot.y = -0x8000;
|
player->actor.shape.rot.y = -0x8000;
|
||||||
player->zTargetYaw = -0x8000;
|
player->zTargetYaw = -0x8000;
|
||||||
player->yaw = -0x8000;
|
player->yaw = -0x8000;
|
||||||
|
player->actor.velocity.y = 0.0f;
|
||||||
player->fallStartHeight = 0;
|
player->fallStartHeight = 0;
|
||||||
player->stateFlags1 |= PLAYER_STATE1_5;
|
player->stateFlags1 |= PLAYER_STATE1_5;
|
||||||
|
|
||||||
|
@ -654,8 +655,10 @@ void BossSst_HeadNeutral(BossSst* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->timer == 0) {
|
if (this->timer == 0) {
|
||||||
if ((GET_PLAYER(play)->actor.world.pos.y > -50.0f) &&
|
Player* player = GET_PLAYER(play);
|
||||||
!(GET_PLAYER(play)->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_13 | PLAYER_STATE1_14))) {
|
|
||||||
|
if ((player->actor.world.pos.y > -50.0f) &&
|
||||||
|
!(player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_13 | PLAYER_STATE1_14))) {
|
||||||
sHands[Rand_ZeroOne() <= 0.5f]->ready = true;
|
sHands[Rand_ZeroOne() <= 0.5f]->ready = true;
|
||||||
BossSst_HeadSetupWait(this);
|
BossSst_HeadSetupWait(this);
|
||||||
} else {
|
} else {
|
||||||
|
@ -825,9 +828,8 @@ void BossSst_HeadSetupStunned(BossSst* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BossSst_HeadStunned(BossSst* this, PlayState* play) {
|
void BossSst_HeadStunned(BossSst* this, PlayState* play) {
|
||||||
f32 bounce;
|
|
||||||
s32 animFinish;
|
|
||||||
f32 currentFrame;
|
f32 currentFrame;
|
||||||
|
s32 animFinish;
|
||||||
|
|
||||||
Math_StepToF(&sHandOffsets[LEFT].z, 600.0f, 20.0f);
|
Math_StepToF(&sHandOffsets[LEFT].z, 600.0f, 20.0f);
|
||||||
Math_StepToF(&sHandOffsets[RIGHT].z, 600.0f, 20.0f);
|
Math_StepToF(&sHandOffsets[RIGHT].z, 600.0f, 20.0f);
|
||||||
|
@ -837,7 +839,8 @@ void BossSst_HeadStunned(BossSst* this, PlayState* play) {
|
||||||
animFinish = SkelAnime_Update(&this->skelAnime);
|
animFinish = SkelAnime_Update(&this->skelAnime);
|
||||||
currentFrame = this->skelAnime.curFrame;
|
currentFrame = this->skelAnime.curFrame;
|
||||||
if (currentFrame <= 6.0f) {
|
if (currentFrame <= 6.0f) {
|
||||||
bounce = (sinf((M_PI / 11) * currentFrame) * 100.0f) + (this->actor.home.pos.y - 180.0f);
|
f32 bounce = (sinf((M_PI / 11) * currentFrame) * 100.0f) + (this->actor.home.pos.y - 180.0f);
|
||||||
|
|
||||||
if (this->actor.world.pos.y < bounce) {
|
if (this->actor.world.pos.y < bounce) {
|
||||||
this->actor.world.pos.y = bounce;
|
this->actor.world.pos.y = bounce;
|
||||||
}
|
}
|
||||||
|
@ -1565,7 +1568,6 @@ void BossSst_HandSetupSweep(BossSst* this) {
|
||||||
|
|
||||||
void BossSst_HandSweep(BossSst* this, PlayState* play) {
|
void BossSst_HandSweep(BossSst* this, PlayState* play) {
|
||||||
Player* player = GET_PLAYER(play);
|
Player* player = GET_PLAYER(play);
|
||||||
s16 newTargetYaw;
|
|
||||||
|
|
||||||
SkelAnime_Update(&this->skelAnime);
|
SkelAnime_Update(&this->skelAnime);
|
||||||
this->handAngSpeed += 0x60;
|
this->handAngSpeed += 0x60;
|
||||||
|
@ -1575,6 +1577,8 @@ void BossSst_HandSweep(BossSst* this, PlayState* play) {
|
||||||
this->colliderJntSph.base.ocFlags1 &= ~OC1_NO_PUSH;
|
this->colliderJntSph.base.ocFlags1 &= ~OC1_NO_PUSH;
|
||||||
BossSst_HandSetupRetreat(this);
|
BossSst_HandSetupRetreat(this);
|
||||||
} else if (this->colliderJntSph.base.atFlags & AT_HIT) {
|
} else if (this->colliderJntSph.base.atFlags & AT_HIT) {
|
||||||
|
s16 newTargetYaw;
|
||||||
|
|
||||||
this->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT);
|
this->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT);
|
||||||
this->ready = true;
|
this->ready = true;
|
||||||
func_8002F71C(play, &this->actor, 5.0f, this->actor.shape.rot.y - (this->vParity * 0x3800), 0.0f);
|
func_8002F71C(play, &this->actor, 5.0f, this->actor.shape.rot.y - (this->vParity * 0x3800), 0.0f);
|
||||||
|
@ -2772,57 +2776,41 @@ void BossSst_DrawHand(Actor* thisx, PlayState* play) {
|
||||||
s32 BossSst_OverrideHeadDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx,
|
s32 BossSst_OverrideHeadDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx,
|
||||||
Gfx** gfx) {
|
Gfx** gfx) {
|
||||||
BossSst* this = (BossSst*)thisx;
|
BossSst* this = (BossSst*)thisx;
|
||||||
s32 shakeAmp;
|
|
||||||
s32 pad;
|
|
||||||
s32 timer12;
|
|
||||||
f32 shakeMod;
|
|
||||||
|
|
||||||
if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS) && this->vVanish) {
|
if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS) && this->vVanish) {
|
||||||
*dList = NULL;
|
*dList = NULL;
|
||||||
} else if (this->actionFunc == BossSst_HeadThrash) { // Animation modifications for death cutscene
|
} else if (this->actionFunc == BossSst_HeadThrash) { // Animation modifications for death cutscene
|
||||||
shakeAmp = (this->timer / 10) + 1;
|
s32 shakeAmp = (this->timer / 10) + 1;
|
||||||
|
|
||||||
if ((limbIndex == 3) || (limbIndex == 39) || (limbIndex == 42)) {
|
if ((limbIndex == 3) || (limbIndex == 39) || (limbIndex == 42)) {
|
||||||
|
rot->x += ((0x500 * Rand_ZeroOne() + 0xA00) / 0x10) * shakeAmp * sinf(this->timer * (M_PI / 5));
|
||||||
shakeMod = sinf(this->timer * (M_PI / 5));
|
rot->z -=
|
||||||
rot->x += ((0x500 * Rand_ZeroOne() + 0xA00) / 0x10) * shakeAmp * shakeMod;
|
((0x800 * Rand_ZeroOne() + 0x1000) / 0x10) * shakeAmp * sinf((this->timer % 5) * (M_PI / 5)) + 0x1000;
|
||||||
|
|
||||||
shakeMod = sinf((this->timer % 5) * (M_PI / 5));
|
|
||||||
rot->z -= ((0x800 * Rand_ZeroOne() + 0x1000) / 0x10) * shakeAmp * shakeMod + 0x1000;
|
|
||||||
|
|
||||||
if (limbIndex == 3) {
|
if (limbIndex == 3) {
|
||||||
|
rot->y += ((0x500 * Rand_ZeroOne() + 0xA00) / 0x10) * shakeAmp * sinf(this->timer * (M_PI / 5));
|
||||||
shakeMod = sinf(this->timer * (M_PI / 5));
|
|
||||||
rot->y += ((0x500 * Rand_ZeroOne() + 0xA00) / 0x10) * shakeAmp * shakeMod;
|
|
||||||
}
|
}
|
||||||
} else if ((limbIndex == 5) || (limbIndex == 6)) {
|
} else if ((limbIndex == 5) || (limbIndex == 6)) {
|
||||||
|
rot->z -=
|
||||||
shakeMod = sinf((this->timer % 5) * (M_PI / 5));
|
((0x280 * Rand_ZeroOne() + 0x500) / 0x10) * shakeAmp * sinf((this->timer % 5) * (M_PI / 5)) + 0x500;
|
||||||
rot->z -= ((0x280 * Rand_ZeroOne() + 0x500) / 0x10) * shakeAmp * shakeMod + 0x500;
|
|
||||||
|
|
||||||
if (limbIndex == 5) {
|
if (limbIndex == 5) {
|
||||||
|
rot->x += ((0x500 * Rand_ZeroOne() + 0xA00) / 0x10) * shakeAmp * sinf(this->timer * (M_PI / 5));
|
||||||
shakeMod = sinf(this->timer * (M_PI / 5));
|
rot->y += ((0x500 * Rand_ZeroOne() + 0xA00) / 0x10) * shakeAmp * sinf(this->timer * (M_PI / 5));
|
||||||
rot->x += ((0x500 * Rand_ZeroOne() + 0xA00) / 0x10) * shakeAmp * shakeMod;
|
|
||||||
|
|
||||||
shakeMod = sinf(this->timer * (M_PI / 5));
|
|
||||||
rot->y += ((0x500 * Rand_ZeroOne() + 0xA00) / 0x10) * shakeAmp * shakeMod;
|
|
||||||
}
|
}
|
||||||
} else if (limbIndex == 2) {
|
} else if (limbIndex == 2) {
|
||||||
shakeMod = sinf(this->timer * (M_PI / 5));
|
rot->x += ((0x200 * Rand_ZeroOne() + 0x400) / 0x10) * shakeAmp * sinf(this->timer * (M_PI / 5));
|
||||||
rot->x += ((0x200 * Rand_ZeroOne() + 0x400) / 0x10) * shakeAmp * shakeMod;
|
rot->y += ((0x200 * Rand_ZeroOne() + 0x400) / 0x10) * shakeAmp * sinf(this->timer * (M_PI / 5));
|
||||||
|
rot->z -=
|
||||||
shakeMod = sinf(this->timer * (M_PI / 5));
|
((0x100 * Rand_ZeroOne() + 0x200) / 0x10) * shakeAmp * sinf((this->timer % 5) * (M_PI / 5)) + 0x200;
|
||||||
rot->y += ((0x200 * Rand_ZeroOne() + 0x400) / 0x10) * shakeAmp * shakeMod;
|
|
||||||
|
|
||||||
shakeMod = sinf((this->timer % 5) * (M_PI / 5));
|
|
||||||
rot->z -= ((0x100 * Rand_ZeroOne() + 0x200) / 0x10) * shakeAmp * shakeMod + 0x200;
|
|
||||||
}
|
}
|
||||||
} else if (this->actionFunc == BossSst_HeadDeath) {
|
} else if (this->actionFunc == BossSst_HeadDeath) {
|
||||||
|
s32 timer12;
|
||||||
|
|
||||||
if (this->timer > 48) {
|
if (this->timer > 48) {
|
||||||
timer12 = this->timer - 36;
|
timer12 = this->timer - 36;
|
||||||
} else {
|
} else {
|
||||||
pad = ((this->timer > 6) ? 6 : this->timer);
|
timer12 = ((this->timer > 6) ? 6 : this->timer) * 2;
|
||||||
timer12 = pad * 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((limbIndex == 3) || (limbIndex == 39) || (limbIndex == 42)) {
|
if ((limbIndex == 3) || (limbIndex == 39) || (limbIndex == 42)) {
|
||||||
|
@ -2947,14 +2935,16 @@ void BossSst_SpawnHeadShadow(BossSst* this) {
|
||||||
s32 i;
|
s32 i;
|
||||||
f32 sn;
|
f32 sn;
|
||||||
f32 cs;
|
f32 cs;
|
||||||
|
BossSstEffect* shadow;
|
||||||
|
Vec3f* offset;
|
||||||
|
|
||||||
this->effectMode = BONGO_SHADOW;
|
this->effectMode = BONGO_SHADOW;
|
||||||
sn = Math_SinS(this->actor.shape.rot.y);
|
sn = Math_SinS(this->actor.shape.rot.y);
|
||||||
cs = Math_CosS(this->actor.shape.rot.y);
|
cs = Math_CosS(this->actor.shape.rot.y);
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
BossSstEffect* shadow = &this->effects[i];
|
shadow = &this->effects[i];
|
||||||
Vec3f* offset = &shadowOffset[i];
|
offset = &shadowOffset[i];
|
||||||
|
|
||||||
shadow->pos.x = this->actor.world.pos.x + (sn * offset->z) + (cs * offset->x);
|
shadow->pos.x = this->actor.world.pos.x + (sn * offset->z) + (cs * offset->x);
|
||||||
shadow->pos.y = 0.0f;
|
shadow->pos.y = 0.0f;
|
||||||
|
@ -2983,12 +2973,13 @@ void BossSst_SpawnShockwave(BossSst* this) {
|
||||||
s32 i;
|
s32 i;
|
||||||
s32 scale = 120;
|
s32 scale = 120;
|
||||||
s32 alpha = 250;
|
s32 alpha = 250;
|
||||||
|
BossSstEffect* shockwave;
|
||||||
|
|
||||||
Actor_PlaySfx(&this->actor, NA_SE_EN_SHADEST_HAND_WAVE);
|
Actor_PlaySfx(&this->actor, NA_SE_EN_SHADEST_HAND_WAVE);
|
||||||
this->effectMode = BONGO_SHOCKWAVE;
|
this->effectMode = BONGO_SHOCKWAVE;
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
BossSstEffect* shockwave = &this->effects[i];
|
shockwave = &this->effects[i];
|
||||||
|
|
||||||
Math_Vec3f_Copy(&shockwave->pos, &this->actor.world.pos);
|
Math_Vec3f_Copy(&shockwave->pos, &this->actor.world.pos);
|
||||||
shockwave->move = (i + 9) * 2;
|
shockwave->move = (i + 9) * 2;
|
||||||
|
@ -3049,6 +3040,7 @@ void BossSst_SpawnIceShard(BossSst* this) {
|
||||||
s32 i;
|
s32 i;
|
||||||
Vec3f spawnPos;
|
Vec3f spawnPos;
|
||||||
f32 offXZ;
|
f32 offXZ;
|
||||||
|
BossSstEffect* ice;
|
||||||
|
|
||||||
this->effectMode = BONGO_ICE;
|
this->effectMode = BONGO_ICE;
|
||||||
offXZ = Math_CosS(this->actor.shape.rot.x) * 50.0f;
|
offXZ = Math_CosS(this->actor.shape.rot.x) * 50.0f;
|
||||||
|
@ -3057,7 +3049,7 @@ void BossSst_SpawnIceShard(BossSst* this) {
|
||||||
spawnPos.z = Math_SinS(this->actor.shape.rot.y) * offXZ + this->actor.world.pos.z;
|
spawnPos.z = Math_SinS(this->actor.shape.rot.y) * offXZ + this->actor.world.pos.z;
|
||||||
|
|
||||||
for (i = 0; i < 18; i++) {
|
for (i = 0; i < 18; i++) {
|
||||||
BossSstEffect* ice = &this->effects[i];
|
ice = &this->effects[i];
|
||||||
|
|
||||||
Math_Vec3f_Copy(&ice->pos, &spawnPos);
|
Math_Vec3f_Copy(&ice->pos, &spawnPos);
|
||||||
ice->status = 1;
|
ice->status = 1;
|
||||||
|
@ -3120,9 +3112,12 @@ void BossSst_UpdateEffects(Actor* thisx, PlayState* play) {
|
||||||
this->effectMode = BONGO_NULL;
|
this->effectMode = BONGO_NULL;
|
||||||
}
|
}
|
||||||
} else if (this->effectMode == BONGO_SHOCKWAVE) {
|
} else if (this->effectMode == BONGO_SHOCKWAVE) {
|
||||||
|
BossSstEffect* effect2;
|
||||||
|
s32 scale;
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
BossSstEffect* effect2 = &this->effects[i];
|
effect2 = &this->effects[i];
|
||||||
s32 scale = effect2->move * 2;
|
scale = effect2->move * 2;
|
||||||
|
|
||||||
effect2->scale += CLAMP_MAX(scale, 20) + i;
|
effect2->scale += CLAMP_MAX(scale, 20) + i;
|
||||||
if (effect2->move != 0) {
|
if (effect2->move != 0) {
|
||||||
|
|
|
@ -790,7 +790,6 @@ s32 BossTw_BeamHitPlayerCheck(BossTw* this, PlayState* play) {
|
||||||
Vec3f offset;
|
Vec3f offset;
|
||||||
Vec3f beamDistFromPlayer;
|
Vec3f beamDistFromPlayer;
|
||||||
Player* player = GET_PLAYER(play);
|
Player* player = GET_PLAYER(play);
|
||||||
s16 i;
|
|
||||||
|
|
||||||
offset.x = player->actor.world.pos.x - this->beamOrigin.x;
|
offset.x = player->actor.world.pos.x - this->beamOrigin.x;
|
||||||
offset.y = player->actor.world.pos.y - this->beamOrigin.y;
|
offset.y = player->actor.world.pos.y - this->beamOrigin.y;
|
||||||
|
@ -812,6 +811,8 @@ s32 BossTw_BeamHitPlayerCheck(BossTw* this, PlayState* play) {
|
||||||
sFreezeState = 1;
|
sFreezeState = 1;
|
||||||
}
|
}
|
||||||
} else if (!player->bodyIsBurning) {
|
} else if (!player->bodyIsBurning) {
|
||||||
|
s16 i;
|
||||||
|
|
||||||
for (i = 0; i < PLAYER_BODYPART_MAX; i++) {
|
for (i = 0; i < PLAYER_BODYPART_MAX; i++) {
|
||||||
player->bodyFlameTimers[i] = Rand_S16Offset(0, 200);
|
player->bodyFlameTimers[i] = Rand_S16Offset(0, 200);
|
||||||
}
|
}
|
||||||
|
@ -3301,6 +3302,8 @@ void func_80941BC0(BossTw* this, PlayState* play) {
|
||||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaEffectHaloDL));
|
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaEffectHaloDL));
|
||||||
Matrix_Pop();
|
Matrix_Pop();
|
||||||
|
|
||||||
|
if (1) {}
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 6461);
|
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 6461);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3533,9 +3536,10 @@ void BossTw_Draw(Actor* thisx, PlayState* play2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->actor.params == TW_KOTAKE) {
|
if (this->actor.params == TW_KOTAKE) {
|
||||||
|
Vec3f diff;
|
||||||
|
|
||||||
if (this->workf[UNK_F9] > 0.0f) {
|
if (this->workf[UNK_F9] > 0.0f) {
|
||||||
if (this->workf[UNK_F11] > 0.0f) {
|
if (this->workf[UNK_F11] > 0.0f) {
|
||||||
Vec3f diff;
|
|
||||||
diff.x = this->groundBlastPos2.x - player->actor.world.pos.x;
|
diff.x = this->groundBlastPos2.x - player->actor.world.pos.x;
|
||||||
diff.y = this->groundBlastPos2.y - player->actor.world.pos.y;
|
diff.y = this->groundBlastPos2.y - player->actor.world.pos.y;
|
||||||
diff.z = this->groundBlastPos2.z - player->actor.world.pos.z;
|
diff.z = this->groundBlastPos2.z - player->actor.world.pos.z;
|
||||||
|
@ -3564,6 +3568,8 @@ void BossTw_Draw(Actor* thisx, PlayState* play2) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (1) {}
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 7123);
|
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 7123);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4077,7 +4083,7 @@ void BossTw_BlastFire(BossTw* this, PlayState* play) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
if (1) {
|
||||||
f32 sp4C = sGroundBlastType == 2 ? 3.0f : 1.0f;
|
f32 sp4C = sGroundBlastType == 2 ? 3.0f : 1.0f;
|
||||||
|
|
||||||
Math_ApproachF(&sKoumePtr->workf[UNK_F9], 0.0f, 1.0f, 10.0f * sp4C);
|
Math_ApproachF(&sKoumePtr->workf[UNK_F9], 0.0f, 1.0f, 10.0f * sp4C);
|
||||||
|
@ -4231,6 +4237,8 @@ void BossTw_BlastIce(BossTw* this, PlayState* play) {
|
||||||
|
|
||||||
case TW_ICE_BLAST_GROUND:
|
case TW_ICE_BLAST_GROUND:
|
||||||
if (this->timers[0] != 0) {
|
if (this->timers[0] != 0) {
|
||||||
|
s32 pad;
|
||||||
|
|
||||||
if (this->timers[0] == 1) {
|
if (this->timers[0] == 1) {
|
||||||
sEnvType = 0;
|
sEnvType = 0;
|
||||||
}
|
}
|
||||||
|
@ -4242,7 +4250,6 @@ void BossTw_BlastIce(BossTw* this, PlayState* play) {
|
||||||
Actor_PlaySfx(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG);
|
Actor_PlaySfx(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG);
|
||||||
|
|
||||||
if (this->timers[0] > (sTwinrovaPtr->actionFunc == BossTw_Wait ? 70 : 20)) {
|
if (this->timers[0] > (sTwinrovaPtr->actionFunc == BossTw_Wait ? 70 : 20)) {
|
||||||
s32 pad;
|
|
||||||
Vec3f pos;
|
Vec3f pos;
|
||||||
Vec3f velocity;
|
Vec3f velocity;
|
||||||
Vec3f accel;
|
Vec3f accel;
|
||||||
|
@ -4320,12 +4327,13 @@ void BossTw_BlastIce(BossTw* this, PlayState* play) {
|
||||||
s32 BossTw_BlastShieldCheck(BossTw* this, PlayState* play) {
|
s32 BossTw_BlastShieldCheck(BossTw* this, PlayState* play) {
|
||||||
Player* player = GET_PLAYER(play);
|
Player* player = GET_PLAYER(play);
|
||||||
s32 ret = false;
|
s32 ret = false;
|
||||||
ColliderElement* acHitElem;
|
|
||||||
|
|
||||||
if (1) {}
|
if (1) {}
|
||||||
|
|
||||||
if (this->csState1 == 1) {
|
if (this->csState1 == 1) {
|
||||||
if (this->collider.base.acFlags & AC_HIT) {
|
if (this->collider.base.acFlags & AC_HIT) {
|
||||||
|
ColliderElement* acHitElem;
|
||||||
|
|
||||||
this->collider.base.acFlags &= ~AC_HIT;
|
this->collider.base.acFlags &= ~AC_HIT;
|
||||||
this->collider.base.atFlags &= ~AT_HIT;
|
this->collider.base.atFlags &= ~AT_HIT;
|
||||||
acHitElem = this->collider.elem.acHitElem;
|
acHitElem = this->collider.elem.acHitElem;
|
||||||
|
@ -4565,17 +4573,6 @@ void BossTw_UpdateEffects(PlayState* play) {
|
||||||
s16 j;
|
s16 j;
|
||||||
s16 colorIdx;
|
s16 colorIdx;
|
||||||
Vec3f off;
|
Vec3f off;
|
||||||
Vec3f spF4;
|
|
||||||
Vec3f spE8;
|
|
||||||
Vec3f spDC;
|
|
||||||
Vec3f spD0;
|
|
||||||
f32 phi_f22;
|
|
||||||
Vec3f spC0;
|
|
||||||
Vec3f spB4;
|
|
||||||
Vec3f spA8;
|
|
||||||
s16 spA6;
|
|
||||||
f32 phi_f0;
|
|
||||||
Actor* unk44;
|
|
||||||
|
|
||||||
for (i = 0; i < BOSS_TW_EFFECT_COUNT; i++) {
|
for (i = 0; i < BOSS_TW_EFFECT_COUNT; i++) {
|
||||||
if (eff->type != TWEFF_NONE) {
|
if (eff->type != TWEFF_NONE) {
|
||||||
|
@ -4654,6 +4651,10 @@ void BossTw_UpdateEffects(PlayState* play) {
|
||||||
off.z = sTwinrovaPtr->actor.world.pos.z - eff->pos.z;
|
off.z = sTwinrovaPtr->actor.world.pos.z - eff->pos.z;
|
||||||
|
|
||||||
if (sTwinrovaPtr->actionFunc != BossTw_TwinrovaStun) {
|
if (sTwinrovaPtr->actionFunc != BossTw_TwinrovaStun) {
|
||||||
|
Vec3f spF4;
|
||||||
|
Vec3f spE8;
|
||||||
|
Vec3f spDC;
|
||||||
|
|
||||||
if ((SQ(off.x) + SQ(off.y) + SQ(off.z)) < SQ(60.0f)) {
|
if ((SQ(off.x) + SQ(off.y) + SQ(off.z)) < SQ(60.0f)) {
|
||||||
for (j = 0; j < 50; j++) {
|
for (j = 0; j < 50; j++) {
|
||||||
spF4.x = sTwinrovaPtr->actor.world.pos.x + Rand_CenteredFloat(35.0f);
|
spF4.x = sTwinrovaPtr->actor.world.pos.x + Rand_CenteredFloat(35.0f);
|
||||||
|
@ -4715,6 +4716,8 @@ void BossTw_UpdateEffects(PlayState* play) {
|
||||||
Math_ApproachF(&eff->workf[EFF_DIST], 1000.0f, 1.0f, 10.0f);
|
Math_ApproachF(&eff->workf[EFF_DIST], 1000.0f, 1.0f, 10.0f);
|
||||||
if (eff->work[EFF_UNKS1] >= 0x10) {
|
if (eff->work[EFF_UNKS1] >= 0x10) {
|
||||||
if ((eff->work[EFF_UNKS1] == 16) && (sp113 == 0)) {
|
if ((eff->work[EFF_UNKS1] == 16) && (sp113 == 0)) {
|
||||||
|
Vec3f spD0;
|
||||||
|
|
||||||
sp113 = 1;
|
sp113 = 1;
|
||||||
spD0 = eff->pos;
|
spD0 = eff->pos;
|
||||||
if (eff->pos.y > 40.0f) {
|
if (eff->pos.y > 40.0f) {
|
||||||
|
@ -4722,8 +4725,7 @@ void BossTw_UpdateEffects(PlayState* play) {
|
||||||
} else {
|
} else {
|
||||||
spD0.y = -50.0f;
|
spD0.y = -50.0f;
|
||||||
}
|
}
|
||||||
sTwinrovaPtr->groundBlastPos.y = phi_f0 = BossTw_GetFloorY(&spD0);
|
if ((sTwinrovaPtr->groundBlastPos.y = BossTw_GetFloorY(&spD0)) >= 0.0f) {
|
||||||
if (phi_f0 >= 0.0f) {
|
|
||||||
if (sTwinrovaPtr->groundBlastPos.y != 35.0f) {
|
if (sTwinrovaPtr->groundBlastPos.y != 35.0f) {
|
||||||
sTwinrovaPtr->groundBlastPos.x = eff->pos.x;
|
sTwinrovaPtr->groundBlastPos.x = eff->pos.x;
|
||||||
sTwinrovaPtr->groundBlastPos.z = eff->pos.z;
|
sTwinrovaPtr->groundBlastPos.z = eff->pos.z;
|
||||||
|
@ -4790,7 +4792,7 @@ void BossTw_UpdateEffects(PlayState* play) {
|
||||||
}
|
}
|
||||||
} else if (eff->type == TWEFF_PLYR_FRZ) {
|
} else if (eff->type == TWEFF_PLYR_FRZ) {
|
||||||
if (eff->work[EFF_ARGS] < eff->frame) {
|
if (eff->work[EFF_ARGS] < eff->frame) {
|
||||||
phi_f0 = 1.0f;
|
f32 phi_f0 = 1.0f;
|
||||||
|
|
||||||
if (eff->target != NULL || sGroundBlastType == 1) {
|
if (eff->target != NULL || sGroundBlastType == 1) {
|
||||||
phi_f0 *= 3.0f;
|
phi_f0 *= 3.0f;
|
||||||
|
@ -4834,7 +4836,11 @@ void BossTw_UpdateEffects(PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((eff->workf[EFF_DIST] > 0.4f) && ((eff->frame & 7) == 0)) {
|
if ((eff->workf[EFF_DIST] > 0.4f) && ((eff->frame & 7) == 0)) {
|
||||||
spA6 = Rand_ZeroFloat(PLAYER_BODYPART_MAX - 0.1f);
|
Vec3f spC0;
|
||||||
|
Vec3f spB4;
|
||||||
|
Vec3f spA8;
|
||||||
|
s16 spA6 = Rand_ZeroFloat(PLAYER_BODYPART_MAX - 0.1f);
|
||||||
|
f32 phi_f22;
|
||||||
|
|
||||||
if (eff->target == NULL) {
|
if (eff->target == NULL) {
|
||||||
spC0.x = player->bodyPartsPos[spA6].x + Rand_CenteredFloat(5.0f);
|
spC0.x = player->bodyPartsPos[spA6].x + Rand_CenteredFloat(5.0f);
|
||||||
|
@ -4842,7 +4848,8 @@ void BossTw_UpdateEffects(PlayState* play) {
|
||||||
spC0.z = player->bodyPartsPos[spA6].z + Rand_CenteredFloat(5.0f);
|
spC0.z = player->bodyPartsPos[spA6].z + Rand_CenteredFloat(5.0f);
|
||||||
phi_f22 = 10.0f;
|
phi_f22 = 10.0f;
|
||||||
} else {
|
} else {
|
||||||
unk44 = eff->target;
|
Actor* unk44 = eff->target;
|
||||||
|
|
||||||
spC0.x = unk44->world.pos.x + Rand_CenteredFloat(40.0f);
|
spC0.x = unk44->world.pos.x + Rand_CenteredFloat(40.0f);
|
||||||
spC0.y = unk44->world.pos.y + Rand_CenteredFloat(40.0f);
|
spC0.y = unk44->world.pos.y + Rand_CenteredFloat(40.0f);
|
||||||
spC0.z = unk44->world.pos.z + Rand_CenteredFloat(40.0f);
|
spC0.z = unk44->world.pos.z + Rand_CenteredFloat(40.0f);
|
||||||
|
@ -4899,10 +4906,11 @@ void BossTw_DrawEffects(PlayState* play) {
|
||||||
s32 pad;
|
s32 pad;
|
||||||
Player* player = GET_PLAYER(play);
|
Player* player = GET_PLAYER(play);
|
||||||
s16 phi_s4;
|
s16 phi_s4;
|
||||||
BossTwEffect* currentEffect = play->specialEffects;
|
BossTwEffect* currentEffect;
|
||||||
BossTwEffect* effectHead;
|
BossTwEffect* effectHead;
|
||||||
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
||||||
|
|
||||||
|
currentEffect = play->specialEffects;
|
||||||
effectHead = currentEffect;
|
effectHead = currentEffect;
|
||||||
|
|
||||||
OPEN_DISPS(gfxCtx, "../z_boss_tw.c", 9592);
|
OPEN_DISPS(gfxCtx, "../z_boss_tw.c", 9592);
|
||||||
|
@ -5028,10 +5036,10 @@ void BossTw_DrawEffects(PlayState* play) {
|
||||||
currentEffect = effectHead;
|
currentEffect = effectHead;
|
||||||
|
|
||||||
for (i = 0; i < BOSS_TW_EFFECT_COUNT; i++) {
|
for (i = 0; i < BOSS_TW_EFFECT_COUNT; i++) {
|
||||||
|
if (currentEffect->type == TWEFF_PLYR_FRZ) {
|
||||||
Actor* actor;
|
Actor* actor;
|
||||||
Vec3f off;
|
Vec3f off;
|
||||||
|
|
||||||
if (currentEffect->type == TWEFF_PLYR_FRZ) {
|
|
||||||
if (materialFlag == 0) {
|
if (materialFlag == 0) {
|
||||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceSurroundingPlayerMaterialDL));
|
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceSurroundingPlayerMaterialDL));
|
||||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, 255);
|
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, 255);
|
||||||
|
@ -5204,7 +5212,7 @@ void BossTw_TwinrovaShootBlast(BossTw* this, PlayState* play) {
|
||||||
|
|
||||||
sEnvType = twMagic->blastType + 1;
|
sEnvType = twMagic->blastType + 1;
|
||||||
|
|
||||||
{
|
if (1) {
|
||||||
Vec3f velocity = { 0.0f, 0.0f, 0.0f };
|
Vec3f velocity = { 0.0f, 0.0f, 0.0f };
|
||||||
Vec3f accel = { 0.0f, 0.0f, 0.0f };
|
Vec3f accel = { 0.0f, 0.0f, 0.0f };
|
||||||
|
|
||||||
|
|
|
@ -1121,7 +1121,6 @@ void BossVa_SetupBodyPhase2(BossVa* this, PlayState* play) {
|
||||||
|
|
||||||
void BossVa_BodyPhase2(BossVa* this, PlayState* play) {
|
void BossVa_BodyPhase2(BossVa* this, PlayState* play) {
|
||||||
Player* player = GET_PLAYER(play);
|
Player* player = GET_PLAYER(play);
|
||||||
Vec3f sp48;
|
|
||||||
|
|
||||||
if (this->actor.colorFilterTimer == 0) {
|
if (this->actor.colorFilterTimer == 0) {
|
||||||
sPhase2Timer++;
|
sPhase2Timer++;
|
||||||
|
@ -1166,7 +1165,8 @@ void BossVa_BodyPhase2(BossVa* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sPhase2Timer > 10) && !(sPhase2Timer & 7) && (this->actor.speed == 1.0f)) {
|
if ((sPhase2Timer > 10) && !(sPhase2Timer & 7) && (this->actor.speed == 1.0f)) {
|
||||||
sp48 = this->actor.world.pos;
|
Vec3f sp48 = this->actor.world.pos;
|
||||||
|
|
||||||
sp48.y += 310.0f + (this->actor.shape.yOffset * this->actor.scale.y);
|
sp48.y += 310.0f + (this->actor.shape.yOffset * this->actor.scale.y);
|
||||||
sp48.x += -10.0f;
|
sp48.x += -10.0f;
|
||||||
sp48.z += 220.0f;
|
sp48.z += 220.0f;
|
||||||
|
@ -1918,6 +1918,14 @@ void BossVa_ZapperAttack(BossVa* this, PlayState* play) {
|
||||||
u32 sp88;
|
u32 sp88;
|
||||||
Vec3f sp7C;
|
Vec3f sp7C;
|
||||||
s32 pad3;
|
s32 pad3;
|
||||||
|
|
||||||
|
boomerang = BossVa_FindBoomerang(play);
|
||||||
|
|
||||||
|
if ((boomerang == NULL) || (boomerang->moveTo == NULL) || (boomerang->moveTo == &player->actor)) {
|
||||||
|
sp7C = player->actor.world.pos;
|
||||||
|
sp7C.y += 10.0f;
|
||||||
|
sp8E = 0x3E80;
|
||||||
|
} else {
|
||||||
f32 sp74;
|
f32 sp74;
|
||||||
s32 i;
|
s32 i;
|
||||||
s16 sp6E;
|
s16 sp6E;
|
||||||
|
@ -1932,13 +1940,6 @@ void BossVa_ZapperAttack(BossVa* this, PlayState* play) {
|
||||||
s16 sp54;
|
s16 sp54;
|
||||||
f32 sp50;
|
f32 sp50;
|
||||||
|
|
||||||
boomerang = BossVa_FindBoomerang(play);
|
|
||||||
|
|
||||||
if ((boomerang == NULL) || (boomerang->moveTo == NULL) || (boomerang->moveTo == &player->actor)) {
|
|
||||||
sp7C = player->actor.world.pos;
|
|
||||||
sp7C.y += 10.0f;
|
|
||||||
sp8E = 0x3E80;
|
|
||||||
} else {
|
|
||||||
sp74 = R_UPDATE_RATE * 0.5f;
|
sp74 = R_UPDATE_RATE * 0.5f;
|
||||||
sp8E = 0x4650;
|
sp8E = 0x4650;
|
||||||
|
|
||||||
|
@ -3148,6 +3149,8 @@ void BossVa_BariPostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
|
||||||
gSPDisplayList(POLY_XLU_DISP++, *dList);
|
gSPDisplayList(POLY_XLU_DISP++, *dList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (1) {}
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_va.c", 4517);
|
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_va.c", 4517);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3279,10 +3282,6 @@ void BossVa_UpdateEffects(PlayState* play) {
|
||||||
s16 spB6;
|
s16 spB6;
|
||||||
s16 i;
|
s16 i;
|
||||||
f32 spB0;
|
f32 spB0;
|
||||||
f32 spAC;
|
|
||||||
s16 pitch;
|
|
||||||
BossVa* refActor2;
|
|
||||||
BossVa* refActor;
|
|
||||||
|
|
||||||
for (i = 0; i < BOSS_VA_EFFECT_COUNT; i++, effect++) {
|
for (i = 0; i < BOSS_VA_EFFECT_COUNT; i++, effect++) {
|
||||||
if (effect->type == VA_NONE) {
|
if (effect->type == VA_NONE) {
|
||||||
|
@ -3300,15 +3299,16 @@ void BossVa_UpdateEffects(PlayState* play) {
|
||||||
effect->velocity.z += effect->accel.z;
|
effect->velocity.z += effect->accel.z;
|
||||||
|
|
||||||
if ((effect->type == VA_LARGE_SPARK) || (effect->type == VA_SMALL_SPARK)) {
|
if ((effect->type == VA_LARGE_SPARK) || (effect->type == VA_SMALL_SPARK)) {
|
||||||
refActor = effect->parent;
|
BossVa* refActor = effect->parent;
|
||||||
|
|
||||||
effect->rot.z += (s16)(Rand_ZeroOne() * 0x4E20) + 0x2000;
|
effect->rot.z += (s16)(Rand_ZeroOne() * 0x4E20) + 0x2000;
|
||||||
effect->rot.y += (s16)(Rand_ZeroOne() * 0x2710) + 0x2000;
|
effect->rot.y += (s16)(Rand_ZeroOne() * 0x2710) + 0x2000;
|
||||||
|
|
||||||
if ((effect->mode == SPARK_TETHER) || (effect->mode == SPARK_UNUSED)) {
|
if ((effect->mode == SPARK_TETHER) || (effect->mode == SPARK_UNUSED)) {
|
||||||
pitch = effect->rot.x - Math_Vec3f_Pitch(&refActor->actor.world.pos, &GET_BODY(refActor)->unk_1D8);
|
s16 pitch = effect->rot.x - Math_Vec3f_Pitch(&refActor->actor.world.pos, &GET_BODY(refActor)->unk_1D8);
|
||||||
spAC = Math_SinS(refActor->actor.world.rot.y);
|
|
||||||
effect->pos.x = refActor->actor.world.pos.x - (effect->offset.x * spAC);
|
spB0 = Math_SinS(refActor->actor.world.rot.y);
|
||||||
|
effect->pos.x = refActor->actor.world.pos.x - (effect->offset.x * spB0);
|
||||||
spB0 = Math_CosS(refActor->actor.world.rot.y);
|
spB0 = Math_CosS(refActor->actor.world.rot.y);
|
||||||
effect->pos.z = refActor->actor.world.pos.z - (effect->offset.x * spB0);
|
effect->pos.z = refActor->actor.world.pos.z - (effect->offset.x * spB0);
|
||||||
spB0 = Math_CosS(-pitch);
|
spB0 = Math_CosS(-pitch);
|
||||||
|
@ -3347,13 +3347,13 @@ void BossVa_UpdateEffects(PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (effect->type == VA_SPARK_BALL) {
|
if (effect->type == VA_SPARK_BALL) {
|
||||||
refActor2 = effect->parent;
|
BossVa* refActor = effect->parent;
|
||||||
|
|
||||||
effect->rot.z += (s16)(Rand_ZeroOne() * 0x2710) + 0x24A8;
|
effect->rot.z += (s16)(Rand_ZeroOne() * 0x2710) + 0x24A8;
|
||||||
effect->pos.x = effect->offset.x + refActor2->actor.world.pos.x;
|
effect->pos.x = effect->offset.x + refActor->actor.world.pos.x;
|
||||||
effect->pos.y =
|
effect->pos.y =
|
||||||
refActor2->actor.world.pos.y + 310.0f + (refActor2->actor.shape.yOffset * refActor2->actor.scale.y);
|
refActor->actor.world.pos.y + 310.0f + (refActor->actor.shape.yOffset * refActor->actor.scale.y);
|
||||||
effect->pos.z = effect->offset.z + refActor2->actor.world.pos.z;
|
effect->pos.z = effect->offset.z + refActor->actor.world.pos.z;
|
||||||
effect->mode = (effect->mode + 1) & 7;
|
effect->mode = (effect->mode + 1) & 7;
|
||||||
|
|
||||||
if (effect->timer < 100) {
|
if (effect->timer < 100) {
|
||||||
|
@ -3378,9 +3378,9 @@ void BossVa_UpdateEffects(PlayState* play) {
|
||||||
|
|
||||||
if (effect->type == VA_BLOOD) {
|
if (effect->type == VA_BLOOD) {
|
||||||
if (effect->mode < BLOOD_SPOT) {
|
if (effect->mode < BLOOD_SPOT) {
|
||||||
|
f32 floorY;
|
||||||
Vec3f checkPos;
|
Vec3f checkPos;
|
||||||
CollisionPoly* groundPoly;
|
CollisionPoly* groundPoly;
|
||||||
f32 floorY;
|
|
||||||
|
|
||||||
checkPos = effect->pos;
|
checkPos = effect->pos;
|
||||||
checkPos.y -= effect->velocity.y + 4.0f;
|
checkPos.y -= effect->velocity.y + 4.0f;
|
||||||
|
@ -3415,9 +3415,9 @@ void BossVa_UpdateEffects(PlayState* play) {
|
||||||
|
|
||||||
if (effect->type == VA_GORE) {
|
if (effect->type == VA_GORE) {
|
||||||
if (effect->mode == GORE_PERMANENT) {
|
if (effect->mode == GORE_PERMANENT) {
|
||||||
|
f32 floorY;
|
||||||
Vec3f checkPos;
|
Vec3f checkPos;
|
||||||
CollisionPoly* groundPoly;
|
CollisionPoly* groundPoly;
|
||||||
f32 floorY;
|
|
||||||
|
|
||||||
checkPos = effect->pos;
|
checkPos = effect->pos;
|
||||||
checkPos.y -= effect->velocity.y + 4.0f;
|
checkPos.y -= effect->velocity.y + 4.0f;
|
||||||
|
@ -3452,10 +3452,9 @@ void BossVa_UpdateEffects(PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (effect->type == VA_TUMOR) {
|
if (effect->type == VA_TUMOR) {
|
||||||
|
BossVa* refActor = effect->parent;
|
||||||
s16 yaw;
|
s16 yaw;
|
||||||
|
|
||||||
refActor = effect->parent;
|
|
||||||
|
|
||||||
effect->rot.z += 0x157C;
|
effect->rot.z += 0x157C;
|
||||||
effect->envColor[3] = (s16)(Math_SinS(effect->rot.z) * 50.0f) + 80;
|
effect->envColor[3] = (s16)(Math_SinS(effect->rot.z) * 50.0f) + 80;
|
||||||
Math_SmoothStepToF(&effect->scale, effect->scaleMod, 1.0f, 0.01f, 0.005f);
|
Math_SmoothStepToF(&effect->scale, effect->scaleMod, 1.0f, 0.01f, 0.005f);
|
||||||
|
@ -3982,7 +3981,7 @@ void BossVa_DrawDoor(PlayState* play, s16 scale) {
|
||||||
|
|
||||||
Matrix_Get(&doorMtx);
|
Matrix_Get(&doorMtx);
|
||||||
|
|
||||||
for (i = 0; i < 8; i++, segAngle -= M_PI / 4) {
|
for (i = 0; i < 8; i++) {
|
||||||
Matrix_Put(&doorMtx);
|
Matrix_Put(&doorMtx);
|
||||||
Matrix_RotateZ(segAngle, MTXMODE_APPLY);
|
Matrix_RotateZ(segAngle, MTXMODE_APPLY);
|
||||||
Matrix_Translate(0.0f, doorPieceLength[i] * yScale, 0.0f, MTXMODE_APPLY);
|
Matrix_Translate(0.0f, doorPieceLength[i] * yScale, 0.0f, MTXMODE_APPLY);
|
||||||
|
@ -3990,6 +3989,7 @@ void BossVa_DrawDoor(PlayState* play, s16 scale) {
|
||||||
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_va.c", 5621),
|
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_boss_va.c", 5621),
|
||||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
gSPDisplayList(POLY_OPA_DISP++, doorPieceDispList[i]);
|
gSPDisplayList(POLY_OPA_DISP++, doorPieceDispList[i]);
|
||||||
|
segAngle -= M_PI / 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_va.c", 5629);
|
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_va.c", 5629);
|
||||||
|
|
|
@ -775,8 +775,6 @@ void func_80968FB0(Actor* thisx, PlayState* play) {
|
||||||
f32 scaleFactor;
|
f32 scaleFactor;
|
||||||
s32 pad;
|
s32 pad;
|
||||||
|
|
||||||
if (1) {}
|
|
||||||
|
|
||||||
OPEN_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1386);
|
OPEN_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1386);
|
||||||
|
|
||||||
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
||||||
|
@ -787,6 +785,7 @@ void func_80968FB0(Actor* thisx, PlayState* play) {
|
||||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
gSPSegment(POLY_XLU_DISP++, 0x08, displayList);
|
gSPSegment(POLY_XLU_DISP++, 0x08, displayList);
|
||||||
gDPPipeSync(displayList++);
|
gDPPipeSync(displayList++);
|
||||||
|
if (displayList) {}
|
||||||
gDPSetPrimColor(displayList++, 0, 0x80, 255, 255, 255, this->unk_293);
|
gDPSetPrimColor(displayList++, 0, 0x80, 255, 255, 255, this->unk_293);
|
||||||
gDPSetRenderMode(displayList++, G_RM_PASS, G_RM_ZB_CLD_SURF2);
|
gDPSetRenderMode(displayList++, G_RM_PASS, G_RM_ZB_CLD_SURF2);
|
||||||
gSPEndDisplayList(displayList++);
|
gSPEndDisplayList(displayList++);
|
||||||
|
|
|
@ -68,6 +68,7 @@ void DemoDu_SetMouthTexIndex(DemoDu* this, s16 mouthTexIndex) {
|
||||||
this->mouthTexIndex = mouthTexIndex;
|
this->mouthTexIndex = mouthTexIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
// Resets all the values used in this cutscene.
|
// Resets all the values used in this cutscene.
|
||||||
void DemoDu_CsAfterGanon_Reset(DemoDu* this) {
|
void DemoDu_CsAfterGanon_Reset(DemoDu* this) {
|
||||||
this->updateIndex = CS_CHAMBERAFTERGANON_SUBSCENE(0);
|
this->updateIndex = CS_CHAMBERAFTERGANON_SUBSCENE(0);
|
||||||
|
@ -87,12 +88,12 @@ void DemoDu_CsAfterGanon_CheckIfShouldReset(DemoDu* this, PlayState* play) {
|
||||||
DemoDu_CsAfterGanon_Reset(this);
|
DemoDu_CsAfterGanon_Reset(this);
|
||||||
}
|
}
|
||||||
D_8096CE94 = false;
|
D_8096CE94 = false;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
} else if (!D_8096CE94) {
|
} else if (!D_8096CE94) {
|
||||||
D_8096CE94 = true;
|
D_8096CE94 = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
s32 DemoDu_UpdateSkelAnime(DemoDu* this) {
|
s32 DemoDu_UpdateSkelAnime(DemoDu* this) {
|
||||||
return SkelAnime_Update(&this->skelAnime);
|
return SkelAnime_Update(&this->skelAnime);
|
||||||
|
@ -104,8 +105,11 @@ void DemoDu_UpdateBgCheckInfo(DemoDu* this, PlayState* play) {
|
||||||
|
|
||||||
CsCmdActorCue* DemoDu_GetCue(PlayState* play, s32 cueChannel) {
|
CsCmdActorCue* DemoDu_GetCue(PlayState* play, s32 cueChannel) {
|
||||||
if (play->csCtx.state != CS_STATE_IDLE) {
|
if (play->csCtx.state != CS_STATE_IDLE) {
|
||||||
return play->csCtx.actorCues[cueChannel];
|
CsCmdActorCue* cue = play->csCtx.actorCues[cueChannel];
|
||||||
|
|
||||||
|
return cue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -774,7 +778,9 @@ void DemoDu_CsAfterGanon_BackTo01(DemoDu* this, PlayState* play) {
|
||||||
|
|
||||||
void DemoDu_UpdateCs_AG_00(DemoDu* this, PlayState* play) {
|
void DemoDu_UpdateCs_AG_00(DemoDu* this, PlayState* play) {
|
||||||
DemoDu_CsAfterGanon_AdvanceTo01(this, play);
|
DemoDu_CsAfterGanon_AdvanceTo01(this, play);
|
||||||
|
#if OOT_DEBUG
|
||||||
DemoDu_CsAfterGanon_CheckIfShouldReset(this, play);
|
DemoDu_CsAfterGanon_CheckIfShouldReset(this, play);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void DemoDu_UpdateCs_AG_01(DemoDu* this, PlayState* play) {
|
void DemoDu_UpdateCs_AG_01(DemoDu* this, PlayState* play) {
|
||||||
|
@ -782,7 +788,9 @@ void DemoDu_UpdateCs_AG_01(DemoDu* this, PlayState* play) {
|
||||||
DemoDu_UpdateSkelAnime(this);
|
DemoDu_UpdateSkelAnime(this);
|
||||||
DemoDu_UpdateEyes(this);
|
DemoDu_UpdateEyes(this);
|
||||||
DemoDu_CsAfterGanon_AdvanceTo02(this, play);
|
DemoDu_CsAfterGanon_AdvanceTo02(this, play);
|
||||||
|
#if OOT_DEBUG
|
||||||
DemoDu_CsAfterGanon_CheckIfShouldReset(this, play);
|
DemoDu_CsAfterGanon_CheckIfShouldReset(this, play);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void DemoDu_UpdateCs_AG_02(DemoDu* this, PlayState* play) {
|
void DemoDu_UpdateCs_AG_02(DemoDu* this, PlayState* play) {
|
||||||
|
@ -790,7 +798,9 @@ void DemoDu_UpdateCs_AG_02(DemoDu* this, PlayState* play) {
|
||||||
DemoDu_UpdateSkelAnime(this);
|
DemoDu_UpdateSkelAnime(this);
|
||||||
DemoDu_UpdateEyes(this);
|
DemoDu_UpdateEyes(this);
|
||||||
DemoDu_CsAfterGanon_BackTo01(this, play);
|
DemoDu_CsAfterGanon_BackTo01(this, play);
|
||||||
|
#if OOT_DEBUG
|
||||||
DemoDu_CsAfterGanon_CheckIfShouldReset(this, play);
|
DemoDu_CsAfterGanon_CheckIfShouldReset(this, play);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Similar to DemoDu_Draw_01, but this uses POLY_XLU_DISP. Also uses this->shadowAlpha for setting the env color.
|
// Similar to DemoDu_Draw_01, but this uses POLY_XLU_DISP. Also uses this->shadowAlpha for setting the env color.
|
||||||
|
|
|
@ -334,10 +334,12 @@ void DemoEc_UseAnimationObject(DemoEc* this, PlayState* play) {
|
||||||
|
|
||||||
CsCmdActorCue* DemoEc_GetCue(PlayState* play, s32 cueChannel) {
|
CsCmdActorCue* DemoEc_GetCue(PlayState* play, s32 cueChannel) {
|
||||||
if (play->csCtx.state != CS_STATE_IDLE) {
|
if (play->csCtx.state != CS_STATE_IDLE) {
|
||||||
return play->csCtx.actorCues[cueChannel];
|
CsCmdActorCue* cue = play->csCtx.actorCues[cueChannel];
|
||||||
} else {
|
|
||||||
return NULL;
|
return cue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DemoEc_SetStartPosRotFromCue(DemoEc* this, PlayState* play, s32 cueChannel) {
|
void DemoEc_SetStartPosRotFromCue(DemoEc* this, PlayState* play, s32 cueChannel) {
|
||||||
|
|
|
@ -1808,21 +1808,21 @@ void DemoEffect_DrawGodLgt(Actor* thisx, PlayState* play) {
|
||||||
|
|
||||||
void DemoEffect_DrawLightEffect(Actor* thisx, PlayState* play) {
|
void DemoEffect_DrawLightEffect(Actor* thisx, PlayState* play) {
|
||||||
DemoEffect* this = (DemoEffect*)thisx;
|
DemoEffect* this = (DemoEffect*)thisx;
|
||||||
u8* alpha;
|
uintptr_t flashDList = (uintptr_t)gEffFlash1DL;
|
||||||
Gfx* disp;
|
s32 pad2;
|
||||||
|
|
||||||
OPEN_DISPS(play->state.gfxCtx, "../z_demo_effect.c", 2842);
|
OPEN_DISPS(play->state.gfxCtx, "../z_demo_effect.c", 2842);
|
||||||
|
|
||||||
if (!DemoEffect_CheckForCue(this, play, 1)) {
|
if (!DemoEffect_CheckForCue(this, play, 1)) {
|
||||||
|
|
||||||
if (this->light.flicker == 0) {
|
if (this->light.flicker == 0) {
|
||||||
this->light.flicker = 1;
|
this->light.flicker = 1;
|
||||||
} else {
|
} else {
|
||||||
disp = (Gfx*)(uintptr_t)gEffFlash1DL; // necessary to match but probably fake
|
|
||||||
alpha = &this->light.alpha;
|
|
||||||
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
||||||
|
// `(*this).light.alpha` is probably fake and indicates that `alpha`
|
||||||
|
// may have been part of an array (possibly a "workbuf" array
|
||||||
|
// instead of the union of structs we have now).
|
||||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, this->primXluColor[0], this->primXluColor[1],
|
gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, this->primXluColor[0], this->primXluColor[1],
|
||||||
this->primXluColor[2], *alpha);
|
this->primXluColor[2], (*this).light.alpha);
|
||||||
gDPSetEnvColor(POLY_XLU_DISP++, this->envXluColor[0], this->envXluColor[1], this->envXluColor[2], 255);
|
gDPSetEnvColor(POLY_XLU_DISP++, this->envXluColor[0], this->envXluColor[1], this->envXluColor[2], 255);
|
||||||
Matrix_Scale(((this->light.scaleFlag & 1) * 0.05f) + 1.0f, ((this->light.scaleFlag & 1) * 0.05f) + 1.0f,
|
Matrix_Scale(((this->light.scaleFlag & 1) * 0.05f) + 1.0f, ((this->light.scaleFlag & 1) * 0.05f) + 1.0f,
|
||||||
((this->light.scaleFlag & 1) * 0.05f) + 1.0f, MTXMODE_APPLY);
|
((this->light.scaleFlag & 1) * 0.05f) + 1.0f, MTXMODE_APPLY);
|
||||||
|
@ -1831,14 +1831,13 @@ void DemoEffect_DrawLightEffect(Actor* thisx, PlayState* play) {
|
||||||
Matrix_RotateZ(DEG_TO_RAD(this->light.rotation), MTXMODE_APPLY);
|
Matrix_RotateZ(DEG_TO_RAD(this->light.rotation), MTXMODE_APPLY);
|
||||||
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 2866),
|
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 2866),
|
||||||
G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
|
G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
|
||||||
if (disp) {};
|
gSPDisplayList(POLY_XLU_DISP++, flashDList);
|
||||||
gSPDisplayList(POLY_XLU_DISP++, disp);
|
|
||||||
Matrix_Pop();
|
Matrix_Pop();
|
||||||
Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY);
|
Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY);
|
||||||
Matrix_RotateZ(DEG_TO_RAD(-(f32)this->light.rotation), MTXMODE_APPLY);
|
Matrix_RotateZ(DEG_TO_RAD(-(f32)this->light.rotation), MTXMODE_APPLY);
|
||||||
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 2874),
|
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 2874),
|
||||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
gSPDisplayList(POLY_XLU_DISP++, disp);
|
gSPDisplayList(POLY_XLU_DISP++, flashDList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2004,8 +2003,8 @@ s32 DemoEffect_OverrideLimbDrawTimeWarp(PlayState* play, SkelCurve* skelCurve, s
|
||||||
}
|
}
|
||||||
|
|
||||||
void DemoEffect_DrawTimeWarp(Actor* thisx, PlayState* play) {
|
void DemoEffect_DrawTimeWarp(Actor* thisx, PlayState* play) {
|
||||||
DemoEffect* this = (DemoEffect*)thisx;
|
|
||||||
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
||||||
|
DemoEffect* this = (DemoEffect*)thisx;
|
||||||
u8 effectType = (this->actor.params & 0x00FF);
|
u8 effectType = (this->actor.params & 0x00FF);
|
||||||
|
|
||||||
if (effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_LARGE || effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL ||
|
if (effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_LARGE || effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL ||
|
||||||
|
|
|
@ -52,7 +52,9 @@ void DemoExt_PlayVortexSFX(DemoExt* this) {
|
||||||
|
|
||||||
CsCmdActorCue* DemoExt_GetCue(PlayState* play, s32 cueChannel) {
|
CsCmdActorCue* DemoExt_GetCue(PlayState* play, s32 cueChannel) {
|
||||||
if (play->csCtx.state != CS_STATE_IDLE) {
|
if (play->csCtx.state != CS_STATE_IDLE) {
|
||||||
return play->csCtx.actorCues[cueChannel];
|
CsCmdActorCue* cue = play->csCtx.actorCues[cueChannel];
|
||||||
|
|
||||||
|
return cue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -165,7 +165,9 @@ void func_809782A0(DemoGeff* this, PlayState* play) {
|
||||||
void func_80978308(DemoGeff* this, PlayState* play) {
|
void func_80978308(DemoGeff* this, PlayState* play) {
|
||||||
func_809781FC(this, play);
|
func_809781FC(this, play);
|
||||||
func_809782A0(this, play);
|
func_809782A0(this, play);
|
||||||
|
#if OOT_DEBUG
|
||||||
func_80978030(this, play);
|
func_80978030(this, play);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80978344(DemoGeff* this, PlayState* play) {
|
void func_80978344(DemoGeff* this, PlayState* play) {
|
||||||
|
|
|
@ -263,7 +263,7 @@ s32 DemoGj_InitSetIndices(DemoGj* this, PlayState* play, s32 updateMode, s32 dra
|
||||||
}
|
}
|
||||||
|
|
||||||
void DemoGj_DrawCommon(DemoGj* this, PlayState* play, Gfx* displayList) {
|
void DemoGj_DrawCommon(DemoGj* this, PlayState* play, Gfx* displayList) {
|
||||||
if (kREG(0) == 0) {
|
if (!OOT_DEBUG || kREG(0) == 0) {
|
||||||
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
||||||
|
|
||||||
OPEN_DISPS(gfxCtx, "../z_demo_gj.c", 1163);
|
OPEN_DISPS(gfxCtx, "../z_demo_gj.c", 1163);
|
||||||
|
@ -454,7 +454,7 @@ s32 DemoGj_IsGanondorfFloatingInAir(DemoGj* this, PlayState* play) {
|
||||||
|
|
||||||
void DemoGj_SetupMovement(DemoGj* this, PlayState* play) {
|
void DemoGj_SetupMovement(DemoGj* this, PlayState* play) {
|
||||||
Actor* actor = &this->dyna.actor;
|
Actor* actor = &this->dyna.actor;
|
||||||
Player* player;
|
s32 pad;
|
||||||
Vec3f* pos = &actor->world.pos;
|
Vec3f* pos = &actor->world.pos;
|
||||||
Vec3s* unk_172;
|
Vec3s* unk_172;
|
||||||
f32 xDistance;
|
f32 xDistance;
|
||||||
|
@ -544,7 +544,8 @@ void DemoGj_SetupMovement(DemoGj* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xDistance == 0.0f && zDistance == 0.0f) {
|
if (xDistance == 0.0f && zDistance == 0.0f) {
|
||||||
player = GET_PLAYER(play);
|
Player* player = GET_PLAYER(play);
|
||||||
|
|
||||||
xDistance = player->actor.world.pos.x - pos->x;
|
xDistance = player->actor.world.pos.x - pos->x;
|
||||||
zDistance = player->actor.world.pos.z - pos->z;
|
zDistance = player->actor.world.pos.z - pos->z;
|
||||||
|
|
||||||
|
@ -974,8 +975,10 @@ void DemoGj_InitDestructableRubble1(DemoGj* this, PlayState* play) {
|
||||||
DemoGj_InitCylinder(this, play, &this->cylinders[2], &sCylinderInit1);
|
DemoGj_InitCylinder(this, play, &this->cylinders[2], &sCylinderInit1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
void DemoGj_DoNothing1(DemoGj* this, PlayState* play) {
|
void DemoGj_DoNothing1(DemoGj* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Moves the ColliderCylinder's relative to the actor's position.
|
* Moves the ColliderCylinder's relative to the actor's position.
|
||||||
|
@ -1092,7 +1095,9 @@ void DemoGj_Update15(DemoGj* this, PlayState* play) {
|
||||||
// func_8097B370
|
// func_8097B370
|
||||||
void DemoGj_Update18(DemoGj* this, PlayState* play) {
|
void DemoGj_Update18(DemoGj* this, PlayState* play) {
|
||||||
func_8097B22C(this, play);
|
func_8097B22C(this, play);
|
||||||
|
#if OOT_DEBUG
|
||||||
DemoGj_DoNothing1(this, play);
|
DemoGj_DoNothing1(this, play);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void DemoGj_DrawDestructableRubble1(DemoGj* this, PlayState* play) {
|
void DemoGj_DrawDestructableRubble1(DemoGj* this, PlayState* play) {
|
||||||
|
@ -1107,8 +1112,10 @@ void DemoGj_InitDestructableRubble2(DemoGj* this, PlayState* play) {
|
||||||
DemoGj_InitCylinder(this, play, &this->cylinders[2], &sCylinderInit2);
|
DemoGj_InitCylinder(this, play, &this->cylinders[2], &sCylinderInit2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
void DemoGj_DoNothing2(DemoGj* this, PlayState* play) {
|
void DemoGj_DoNothing2(DemoGj* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Moves the ColliderCylinder's relative to the actor's position.
|
// Moves the ColliderCylinder's relative to the actor's position.
|
||||||
void func_8097B450(DemoGj* this, PlayState* play) {
|
void func_8097B450(DemoGj* this, PlayState* play) {
|
||||||
|
@ -1223,7 +1230,9 @@ void DemoGj_Update16(DemoGj* this, PlayState* play) {
|
||||||
// func_8097B894
|
// func_8097B894
|
||||||
void DemoGj_Update19(DemoGj* this, PlayState* play) {
|
void DemoGj_Update19(DemoGj* this, PlayState* play) {
|
||||||
func_8097B750(this, play);
|
func_8097B750(this, play);
|
||||||
|
#if OOT_DEBUG
|
||||||
DemoGj_DoNothing2(this, play);
|
DemoGj_DoNothing2(this, play);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void DemoGj_DemoGj_InitDestructableRubble2(DemoGj* this, PlayState* play) {
|
void DemoGj_DemoGj_InitDestructableRubble2(DemoGj* this, PlayState* play) {
|
||||||
|
@ -1236,8 +1245,10 @@ void DemoGj_InitDestructableRubbleTall(DemoGj* this, PlayState* play) {
|
||||||
DemoGj_InitCylinder(this, play, &this->cylinders[0], &sCylinderInit3);
|
DemoGj_InitCylinder(this, play, &this->cylinders[0], &sCylinderInit3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
void DemoGj_DoNothing3(DemoGj* this, PlayState* play) {
|
void DemoGj_DoNothing3(DemoGj* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void DemoGj_DirectedDoubleExplosion(DemoGj* this, PlayState* play, Vec3f* direction) {
|
void DemoGj_DirectedDoubleExplosion(DemoGj* this, PlayState* play, Vec3f* direction) {
|
||||||
Vec3f pos;
|
Vec3f pos;
|
||||||
|
@ -1308,7 +1319,9 @@ void DemoGj_Update17(DemoGj* this, PlayState* play) {
|
||||||
// func_8097BBA8
|
// func_8097BBA8
|
||||||
void DemoGj_Update20(DemoGj* this, PlayState* play) {
|
void DemoGj_Update20(DemoGj* this, PlayState* play) {
|
||||||
func_8097BA48(this, play);
|
func_8097BA48(this, play);
|
||||||
|
#if OOT_DEBUG
|
||||||
DemoGj_DoNothing3(this, play);
|
DemoGj_DoNothing3(this, play);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void DemoGj_DemoGj_InitDestructableRubbleTall(DemoGj* this, PlayState* play) {
|
void DemoGj_DemoGj_InitDestructableRubbleTall(DemoGj* this, PlayState* play) {
|
||||||
|
|
|
@ -209,10 +209,13 @@ s32 func_8097CDB0(DemoGo* this, PlayState* play, u16 cueId) {
|
||||||
CutsceneContext* csCtx = &play->csCtx;
|
CutsceneContext* csCtx = &play->csCtx;
|
||||||
s32 cueChannel = DemoGo_GetCueChannel(this);
|
s32 cueChannel = DemoGo_GetCueChannel(this);
|
||||||
|
|
||||||
if ((csCtx->state != CS_STATE_IDLE) && (csCtx->actorCues[cueChannel] != NULL) &&
|
if (csCtx->state != CS_STATE_IDLE) {
|
||||||
(csCtx->actorCues[cueChannel]->id == cueId)) {
|
CsCmdActorCue* cue = csCtx->actorCues[cueChannel];
|
||||||
|
|
||||||
|
if (cue != NULL && cue->id == cueId) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -341,13 +344,13 @@ void func_8097D29C(DemoGo* this, PlayState* play) {
|
||||||
s16 eyeTexIdx = this->unk_190;
|
s16 eyeTexIdx = this->unk_190;
|
||||||
SkelAnime* skelAnime = &this->skelAnime;
|
SkelAnime* skelAnime = &this->skelAnime;
|
||||||
void* eyeTexture = sEyeTextures[eyeTexIdx];
|
void* eyeTexture = sEyeTextures[eyeTexIdx];
|
||||||
void* mouthTexture = gGoronCsMouthSmileTex;
|
s32 pad2;
|
||||||
|
|
||||||
OPEN_DISPS(play->state.gfxCtx, "../z_demo_go.c", 732);
|
OPEN_DISPS(play->state.gfxCtx, "../z_demo_go.c", 732);
|
||||||
|
|
||||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||||
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(eyeTexture));
|
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(eyeTexture));
|
||||||
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(mouthTexture));
|
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(gGoronCsMouthSmileTex));
|
||||||
|
|
||||||
SkelAnime_DrawFlexOpa(play, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount, NULL, NULL, this);
|
SkelAnime_DrawFlexOpa(play, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount, NULL, NULL, this);
|
||||||
|
|
||||||
|
|
|
@ -265,7 +265,6 @@ void func_8097E454(PlayState* play, Vec3f* spawnerPos, Vec3f* velocity, Vec3f* a
|
||||||
s16 phi_s0;
|
s16 phi_s0;
|
||||||
s16 dustScaleStep = 15.0f * scale;
|
s16 dustScaleStep = 15.0f * scale;
|
||||||
f32 dustScale = 300.0f * scale;
|
f32 dustScale = 300.0f * scale;
|
||||||
Vec3f pos;
|
|
||||||
|
|
||||||
if ((!FrameAdvance_IsEnabled(play)) && (arg7 > 0) && (arg6 > 0)) {
|
if ((!FrameAdvance_IsEnabled(play)) && (arg7 > 0) && (arg6 > 0)) {
|
||||||
frames = (ABS((s32)play->gameplayFrames) % arg7);
|
frames = (ABS((s32)play->gameplayFrames) % arg7);
|
||||||
|
@ -273,6 +272,7 @@ void func_8097E454(PlayState* play, Vec3f* spawnerPos, Vec3f* velocity, Vec3f* a
|
||||||
increment = 0x10000 / arg6;
|
increment = 0x10000 / arg6;
|
||||||
|
|
||||||
for (i = frames; i < arg6; i += arg7) {
|
for (i = frames; i < arg6; i += arg7) {
|
||||||
|
Vec3f pos;
|
||||||
|
|
||||||
pos.x = (Math_SinS(phi_s0) * arg4) + spawnerPos->x;
|
pos.x = (Math_SinS(phi_s0) * arg4) + spawnerPos->x;
|
||||||
pos.y = spawnerPos->y;
|
pos.y = spawnerPos->y;
|
||||||
|
@ -437,7 +437,7 @@ void func_8097ED64(DemoGt* this, PlayState* play, s32 cueChannel) {
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 DemoGt_IsCutsceneLayer(void) {
|
u8 DemoGt_IsCutsceneLayer(void) {
|
||||||
if (kREG(2) != 0) {
|
if (OOT_DEBUG && (kREG(2) != 0)) {
|
||||||
return true;
|
return true;
|
||||||
} else if (!IS_CUTSCENE_LAYER) {
|
} else if (!IS_CUTSCENE_LAYER) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -503,7 +503,7 @@ void func_8097EF40(DemoGt* this, PlayState* play) {
|
||||||
Vec3f* pos = &this->dyna.actor.world.pos;
|
Vec3f* pos = &this->dyna.actor.world.pos;
|
||||||
s32 pad;
|
s32 pad;
|
||||||
|
|
||||||
if ((kREG(1) == 20) || (csCurFrame == 220)) {
|
if ((OOT_DEBUG && (kREG(1) == 20)) || (csCurFrame == 220)) {
|
||||||
dustPos.x = pos->x + 256.0f;
|
dustPos.x = pos->x + 256.0f;
|
||||||
dustPos.y = pos->y + 679.0f;
|
dustPos.y = pos->y + 679.0f;
|
||||||
dustPos.z = pos->z + 82.0f;
|
dustPos.z = pos->z + 82.0f;
|
||||||
|
@ -526,7 +526,12 @@ void func_8097F0AC(DemoGt* this, PlayState* play) {
|
||||||
u16 csCurFrame = play->csCtx.curFrame;
|
u16 csCurFrame = play->csCtx.curFrame;
|
||||||
s32 pad2;
|
s32 pad2;
|
||||||
|
|
||||||
if ((csCurFrame == 140) || (kREG(1) == 19)) {
|
#if OOT_DEBUG
|
||||||
|
if (csCurFrame == 140 || kREG(1) == 19)
|
||||||
|
#else
|
||||||
|
if (csCurFrame == 140)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
sp38.x = this->dyna.actor.world.pos.x + 260.0f;
|
sp38.x = this->dyna.actor.world.pos.x + 260.0f;
|
||||||
sp38.y = this->dyna.actor.world.pos.y + 340.0f;
|
sp38.y = this->dyna.actor.world.pos.y + 340.0f;
|
||||||
sp38.z = this->dyna.actor.world.pos.z + 45.0f;
|
sp38.z = this->dyna.actor.world.pos.z + 45.0f;
|
||||||
|
@ -562,7 +567,6 @@ void func_8097F280(DemoGt* this, PlayState* play) {
|
||||||
s32* unk178 = this->unk_178;
|
s32* unk178 = this->unk_178;
|
||||||
s32* unk188 = this->unk_188;
|
s32* unk188 = this->unk_188;
|
||||||
s32* unk198 = this->unk_198;
|
s32* unk198 = this->unk_198;
|
||||||
f32 temp_f0;
|
|
||||||
|
|
||||||
if (play->csCtx.curFrame < 160) {
|
if (play->csCtx.curFrame < 160) {
|
||||||
unk178[0] = 100;
|
unk178[0] = 100;
|
||||||
|
@ -576,7 +580,7 @@ void func_8097F280(DemoGt* this, PlayState* play) {
|
||||||
unk198[0]++;
|
unk198[0]++;
|
||||||
unk198[1]--;
|
unk198[1]--;
|
||||||
} else if (play->csCtx.curFrame < 170) {
|
} else if (play->csCtx.curFrame < 170) {
|
||||||
temp_f0 = Environment_LerpWeightAccelDecel(170, 160, play->csCtx.curFrame, 0, 0);
|
f32 temp_f0 = Environment_LerpWeightAccelDecel(170, 160, play->csCtx.curFrame, 0, 0);
|
||||||
|
|
||||||
unk178[0] = (temp_f0 * -63.0f) + 163.0f;
|
unk178[0] = (temp_f0 * -63.0f) + 163.0f;
|
||||||
unk178[1] = (temp_f0 * -155.0f) + 255.0f;
|
unk178[1] = (temp_f0 * -155.0f) + 255.0f;
|
||||||
|
@ -700,13 +704,14 @@ void func_8097F960(DemoGt* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_8097F96C(DemoGt* this, PlayState* play) {
|
void func_8097F96C(DemoGt* this, PlayState* play) {
|
||||||
static Actor* cloudRing = NULL;
|
|
||||||
s32 pad[4];
|
s32 pad[4];
|
||||||
Vec3f pos;
|
Vec3f pos;
|
||||||
Actor* actor;
|
Actor* actor;
|
||||||
u16 csCurFrame = play->csCtx.curFrame;
|
u16 csCurFrame = play->csCtx.curFrame;
|
||||||
|
|
||||||
if (((csCurFrame > 1059) && (csCurFrame < 1062)) || kREG(1) == 17) {
|
if (((csCurFrame > 1059) && (csCurFrame < 1062)) || (OOT_DEBUG && (kREG(1) == 17))) {
|
||||||
|
static Actor* cloudRing = NULL;
|
||||||
|
|
||||||
pos.x = this->dyna.actor.world.pos.x;
|
pos.x = this->dyna.actor.world.pos.x;
|
||||||
pos.y = this->dyna.actor.world.pos.y + 612.0f;
|
pos.y = this->dyna.actor.world.pos.y + 612.0f;
|
||||||
pos.z = this->dyna.actor.world.pos.z;
|
pos.z = this->dyna.actor.world.pos.z;
|
||||||
|
@ -730,7 +735,7 @@ void func_8097FA1C(DemoGt* this, PlayState* play) {
|
||||||
Vec3f velOffset = { -12.0f, -17.0, 5.0 };
|
Vec3f velOffset = { -12.0f, -17.0, 5.0 };
|
||||||
s32 pad1[3];
|
s32 pad1[3];
|
||||||
|
|
||||||
if (((csCurFrame > 502) && !(csCurFrame >= 581)) || (kREG(1) == 5)) {
|
if (((csCurFrame > 502) && !(csCurFrame >= 581)) || (OOT_DEBUG && (kREG(1) == 5))) {
|
||||||
dustPos.x = pos->x + 300.0f;
|
dustPos.x = pos->x + 300.0f;
|
||||||
dustPos.y = pos->y + 360.0f;
|
dustPos.y = pos->y + 360.0f;
|
||||||
dustPos.z = pos->z - 377.0f;
|
dustPos.z = pos->z - 377.0f;
|
||||||
|
@ -739,6 +744,12 @@ void func_8097FA1C(DemoGt* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_8097FAFC(DemoGt* this, PlayState* play) {
|
void func_8097FAFC(DemoGt* this, PlayState* play) {
|
||||||
|
s32 pad[2];
|
||||||
|
u16 csCurFrame = play->csCtx.curFrame;
|
||||||
|
Vec3f pos;
|
||||||
|
f32 new_var = -200.0;
|
||||||
|
|
||||||
|
if (((csCurFrame > 582) && (csCurFrame < 683)) || (OOT_DEBUG && (kREG(1) == 6))) {
|
||||||
static Vec3f velocity = { 0.0f, 1.0f, 0.0f };
|
static Vec3f velocity = { 0.0f, 1.0f, 0.0f };
|
||||||
static Vec3f accel = { 0.0f, 0.0f, 0.0f };
|
static Vec3f accel = { 0.0f, 0.0f, 0.0f };
|
||||||
static f32 arg4 = 280.0f;
|
static f32 arg4 = 280.0f;
|
||||||
|
@ -746,12 +757,7 @@ void func_8097FAFC(DemoGt* this, PlayState* play) {
|
||||||
static s32 arg6 = 11;
|
static s32 arg6 = 11;
|
||||||
static s32 arg7 = 1;
|
static s32 arg7 = 1;
|
||||||
static s16 life = 3;
|
static s16 life = 3;
|
||||||
s32 pad[2];
|
|
||||||
u16 csCurFrame = play->csCtx.curFrame;
|
|
||||||
Vec3f pos;
|
|
||||||
f32 new_var = -200.0;
|
|
||||||
|
|
||||||
if (((csCurFrame > 582) && (csCurFrame < 683)) || (kREG(1) == 6)) {
|
|
||||||
pos = this->dyna.actor.world.pos;
|
pos = this->dyna.actor.world.pos;
|
||||||
pos.y += 680.0f;
|
pos.y += 680.0f;
|
||||||
|
|
||||||
|
@ -773,7 +779,7 @@ void func_8097FC1C(DemoGt* this, PlayState* play) {
|
||||||
Vec3f velOffset = { 5.0f, -16.0f, -16.0f };
|
Vec3f velOffset = { 5.0f, -16.0f, -16.0f };
|
||||||
s32 pad1[3];
|
s32 pad1[3];
|
||||||
|
|
||||||
if (csCurFrame > 682 || kREG(1) == 7) {
|
if (csCurFrame > 682 || (OOT_DEBUG && (kREG(1) == 7))) {
|
||||||
dustPos.x = pos->x + 260.0f;
|
dustPos.x = pos->x + 260.0f;
|
||||||
dustPos.y = pos->y + 360.0f;
|
dustPos.y = pos->y + 360.0f;
|
||||||
dustPos.z = pos->z + 260.0f;
|
dustPos.z = pos->z + 260.0f;
|
||||||
|
@ -786,7 +792,12 @@ void func_8097FCE4(DemoGt* this, PlayState* play) {
|
||||||
Vec3f vec;
|
Vec3f vec;
|
||||||
u16 csCurFrame = play->csCtx.curFrame;
|
u16 csCurFrame = play->csCtx.curFrame;
|
||||||
|
|
||||||
if (csCurFrame == 503 || kREG(1) == 4) {
|
#if OOT_DEBUG
|
||||||
|
if (csCurFrame == 503 || kREG(1) == 4)
|
||||||
|
#else
|
||||||
|
if (csCurFrame == 503)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
vec.x = this->dyna.actor.world.pos.x + 300.0f;
|
vec.x = this->dyna.actor.world.pos.x + 300.0f;
|
||||||
vec.y = this->dyna.actor.world.pos.y + 560.0f;
|
vec.y = this->dyna.actor.world.pos.y + 560.0f;
|
||||||
vec.z = this->dyna.actor.world.pos.z - 377.0f;
|
vec.z = this->dyna.actor.world.pos.z - 377.0f;
|
||||||
|
@ -881,12 +892,13 @@ void func_80980178(DemoGt* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80980184(DemoGt* this, PlayState* play) {
|
void func_80980184(DemoGt* this, PlayState* play) {
|
||||||
static Actor* cloudRing = NULL;
|
|
||||||
s32 pad[4];
|
s32 pad[4];
|
||||||
Vec3f pos;
|
Vec3f pos;
|
||||||
Actor* actor;
|
Actor* actor;
|
||||||
|
|
||||||
if ((play->csCtx.curFrame > 1027) && (play->csCtx.curFrame < 1031)) {
|
if ((play->csCtx.curFrame > 1027) && (play->csCtx.curFrame < 1031)) {
|
||||||
|
static Actor* cloudRing = NULL;
|
||||||
|
|
||||||
pos.x = this->dyna.actor.world.pos.x;
|
pos.x = this->dyna.actor.world.pos.x;
|
||||||
pos.y = this->dyna.actor.world.pos.y + 247.0f;
|
pos.y = this->dyna.actor.world.pos.y + 247.0f;
|
||||||
pos.z = this->dyna.actor.world.pos.z;
|
pos.z = this->dyna.actor.world.pos.z;
|
||||||
|
@ -903,12 +915,13 @@ void func_80980184(DemoGt* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80980218(DemoGt* this, PlayState* play) {
|
void func_80980218(DemoGt* this, PlayState* play) {
|
||||||
static Actor* cloudRing = NULL;
|
|
||||||
s32 pad[4];
|
s32 pad[4];
|
||||||
Vec3f pos;
|
Vec3f pos;
|
||||||
Actor* actor;
|
Actor* actor;
|
||||||
|
|
||||||
if ((play->csCtx.curFrame > 997) && (play->csCtx.curFrame < 1001)) {
|
if ((play->csCtx.curFrame > 997) && (play->csCtx.curFrame < 1001)) {
|
||||||
|
static Actor* cloudRing = NULL;
|
||||||
|
|
||||||
pos.x = this->dyna.actor.home.pos.x;
|
pos.x = this->dyna.actor.home.pos.x;
|
||||||
pos.y = this->dyna.actor.home.pos.y + 38.0f;
|
pos.y = this->dyna.actor.home.pos.y + 38.0f;
|
||||||
pos.z = this->dyna.actor.home.pos.z;
|
pos.z = this->dyna.actor.home.pos.z;
|
||||||
|
@ -964,7 +977,7 @@ void func_80980430(DemoGt* this, PlayState* play) {
|
||||||
Vec3f velOffset = { 5.0f, -3.0f, 0.0f };
|
Vec3f velOffset = { 5.0f, -3.0f, 0.0f };
|
||||||
s32 pad1[3];
|
s32 pad1[3];
|
||||||
|
|
||||||
if (csCurFrame > 709 || kREG(1) == 8) {
|
if (csCurFrame > 709 || (OOT_DEBUG && (kREG(1) == 8))) {
|
||||||
dustPos.x = pos->x + 760.0f;
|
dustPos.x = pos->x + 760.0f;
|
||||||
dustPos.y = pos->y - 40.0f;
|
dustPos.y = pos->y - 40.0f;
|
||||||
dustPos.z = pos->z - 240.0f;
|
dustPos.z = pos->z - 240.0f;
|
||||||
|
@ -980,7 +993,7 @@ void func_80980504(DemoGt* this, PlayState* play) {
|
||||||
Vec3f velOffset = { 5.0f, -16.0f, -16.0f };
|
Vec3f velOffset = { 5.0f, -16.0f, -16.0f };
|
||||||
s32 pad1[3];
|
s32 pad1[3];
|
||||||
|
|
||||||
if ((csCurFrame > 704) || kREG(1) == 9) {
|
if ((csCurFrame > 704) || (OOT_DEBUG && (kREG(1) == 9))) {
|
||||||
dustPos.x = pos->x + 830.0f;
|
dustPos.x = pos->x + 830.0f;
|
||||||
dustPos.y = pos->y + 60.0f;
|
dustPos.y = pos->y + 60.0f;
|
||||||
dustPos.z = pos->z + 390.0f;
|
dustPos.z = pos->z + 390.0f;
|
||||||
|
@ -996,7 +1009,7 @@ void func_809805D8(DemoGt* this, PlayState* play) {
|
||||||
Vec3f velOffset = { 15.0f, -26.0, 0.0f };
|
Vec3f velOffset = { 15.0f, -26.0, 0.0f };
|
||||||
s32 pad1[3];
|
s32 pad1[3];
|
||||||
|
|
||||||
if (((csCurFrame > 739) && (csCurFrame < 781)) || kREG(1) == 11) {
|
if (((csCurFrame > 739) && (csCurFrame < 781)) || (OOT_DEBUG && (kREG(1) == 11))) {
|
||||||
dustPos.x = homePos->x + 550.0f;
|
dustPos.x = homePos->x + 550.0f;
|
||||||
dustPos.y = homePos->y - 110.0f;
|
dustPos.y = homePos->y - 110.0f;
|
||||||
dustPos.z = homePos->z + 50.0f;
|
dustPos.z = homePos->z + 50.0f;
|
||||||
|
@ -1012,7 +1025,7 @@ void func_809806B8(DemoGt* this, PlayState* play) {
|
||||||
Vec3f velOffset = { 5.0f, -16.0f, -16.0f };
|
Vec3f velOffset = { 5.0f, -16.0f, -16.0f };
|
||||||
s32 pad1[3];
|
s32 pad1[3];
|
||||||
|
|
||||||
if ((csCurFrame > 964) || (kREG(1) == 12)) {
|
if ((csCurFrame > 964) || (OOT_DEBUG && (kREG(1) == 12))) {
|
||||||
dustPos.x = pos->x + 460.0f;
|
dustPos.x = pos->x + 460.0f;
|
||||||
dustPos.y = pos->y + 60.0f;
|
dustPos.y = pos->y + 60.0f;
|
||||||
dustPos.z = pos->z + 760.0f;
|
dustPos.z = pos->z + 760.0f;
|
||||||
|
@ -1028,7 +1041,7 @@ void func_8098078C(DemoGt* this, PlayState* play) {
|
||||||
Vec3f velOffset = { 5.0f, -16.0f, -16.0f };
|
Vec3f velOffset = { 5.0f, -16.0f, -16.0f };
|
||||||
s32 pad1[3];
|
s32 pad1[3];
|
||||||
|
|
||||||
if ((csCurFrame > 939) || (kREG(1) == 14)) {
|
if ((csCurFrame > 939) || (OOT_DEBUG && (kREG(1) == 14))) {
|
||||||
dustPos.x = pos->x + 360.0f;
|
dustPos.x = pos->x + 360.0f;
|
||||||
dustPos.y = pos->y + 70.0f;
|
dustPos.y = pos->y + 70.0f;
|
||||||
dustPos.z = pos->z - 640.0f;
|
dustPos.z = pos->z - 640.0f;
|
||||||
|
@ -1042,7 +1055,7 @@ void func_8098085C(DemoGt* this, PlayState* play) {
|
||||||
u16 csCurFrame = play->csCtx.curFrame;
|
u16 csCurFrame = play->csCtx.curFrame;
|
||||||
Vec3f* pos = &this->dyna.actor.world.pos;
|
Vec3f* pos = &this->dyna.actor.world.pos;
|
||||||
|
|
||||||
if ((csCurFrame == 58) || (kREG(1) == 1)) {
|
if ((csCurFrame == 58) || (OOT_DEBUG && (kREG(1) == 1))) {
|
||||||
sp28.x = pos->x + 900.0f;
|
sp28.x = pos->x + 900.0f;
|
||||||
sp28.y = pos->y - 50.0f;
|
sp28.y = pos->y - 50.0f;
|
||||||
sp28.z = pos->z + 93.0f;
|
sp28.z = pos->z + 93.0f;
|
||||||
|
@ -1068,7 +1081,7 @@ void func_809809C0(DemoGt* this, PlayState* play2) {
|
||||||
Vec3f sp54;
|
Vec3f sp54;
|
||||||
s16 pad[3];
|
s16 pad[3];
|
||||||
|
|
||||||
if (((csCurFrame > 469) && (csCurFrame < 481)) || (kREG(1) == 3)) {
|
if (((csCurFrame > 469) && (csCurFrame < 481)) || (OOT_DEBUG && (kREG(1) == 3))) {
|
||||||
Vec3f sp40 = { 20.0f, 6.0f, 0.0f };
|
Vec3f sp40 = { 20.0f, 6.0f, 0.0f };
|
||||||
Vec3f sp34 = { 0.0f, 0.0f, 0.0f };
|
Vec3f sp34 = { 0.0f, 0.0f, 0.0f };
|
||||||
s16 pad2[3];
|
s16 pad2[3];
|
||||||
|
@ -1088,7 +1101,7 @@ void func_80980AD4(DemoGt* this, PlayState* play) {
|
||||||
Vec3f pos;
|
Vec3f pos;
|
||||||
u16 csCurFrame = play->csCtx.curFrame;
|
u16 csCurFrame = play->csCtx.curFrame;
|
||||||
|
|
||||||
if ((csCurFrame == 477) || (kREG(2) == 1)) {
|
if ((csCurFrame == 477) || (OOT_DEBUG && (kREG(2) == 1))) {
|
||||||
pos.x = this->dyna.actor.world.pos.x + 790.0f;
|
pos.x = this->dyna.actor.world.pos.x + 790.0f;
|
||||||
pos.y = this->dyna.actor.world.pos.y + 60.0f;
|
pos.y = this->dyna.actor.world.pos.y + 60.0f;
|
||||||
pos.z = this->dyna.actor.world.pos.z + 23.0f;
|
pos.z = this->dyna.actor.world.pos.z + 23.0f;
|
||||||
|
@ -1103,7 +1116,7 @@ void func_80980B68(DemoGt* this, PlayState* play) {
|
||||||
Vec3f pos;
|
Vec3f pos;
|
||||||
u16 csCurFrame = play->csCtx.curFrame;
|
u16 csCurFrame = play->csCtx.curFrame;
|
||||||
|
|
||||||
if ((csCurFrame == 317) || (kREG(3) == 1)) {
|
if ((csCurFrame == 317) || (OOT_DEBUG && (kREG(3) == 1))) {
|
||||||
pos.x = this->dyna.actor.world.pos.x + 980.0f;
|
pos.x = this->dyna.actor.world.pos.x + 980.0f;
|
||||||
pos.y = this->dyna.actor.world.pos.y + 410.0f;
|
pos.y = this->dyna.actor.world.pos.y + 410.0f;
|
||||||
pos.z = this->dyna.actor.world.pos.z - 177.0f;
|
pos.z = this->dyna.actor.world.pos.z - 177.0f;
|
||||||
|
@ -1117,7 +1130,7 @@ void func_80980BFC(DemoGt* this, PlayState* play) {
|
||||||
Vec3f pos;
|
Vec3f pos;
|
||||||
u16 csCurFrame = play->csCtx.curFrame;
|
u16 csCurFrame = play->csCtx.curFrame;
|
||||||
|
|
||||||
if ((csCurFrame == 740) || (kREG(4) == 1)) {
|
if ((csCurFrame == 740) || (OOT_DEBUG && (kREG(4) == 1))) {
|
||||||
pos.x = this->dyna.actor.world.pos.x + 790.0f;
|
pos.x = this->dyna.actor.world.pos.x + 790.0f;
|
||||||
pos.y = this->dyna.actor.world.pos.y + 60.0f;
|
pos.y = this->dyna.actor.world.pos.y + 60.0f;
|
||||||
pos.z = this->dyna.actor.world.pos.z + 23.0f;
|
pos.z = this->dyna.actor.world.pos.z + 23.0f;
|
||||||
|
@ -1322,7 +1335,7 @@ void func_80981458(DemoGt* this, PlayState* play) {
|
||||||
Vec3f dustPos;
|
Vec3f dustPos;
|
||||||
u16 csCurFrame = play->csCtx.curFrame;
|
u16 csCurFrame = play->csCtx.curFrame;
|
||||||
|
|
||||||
if (((csCurFrame > 855) && (csCurFrame < 891)) || (kREG(1) == 13)) {
|
if (((csCurFrame > 855) && (csCurFrame < 891)) || (OOT_DEBUG && (kREG(1) == 13))) {
|
||||||
Vec3f velOffset = { 0.0f, -30.0f, 0.0f };
|
Vec3f velOffset = { 0.0f, -30.0f, 0.0f };
|
||||||
s32 pad1[3];
|
s32 pad1[3];
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,11 @@ s32 DemoIk_UpdateSkelAnime(DemoIk* this) {
|
||||||
|
|
||||||
CsCmdActorCue* DemoIk_GetCue(PlayState* play, s32 cueChannel) {
|
CsCmdActorCue* DemoIk_GetCue(PlayState* play, s32 cueChannel) {
|
||||||
if (play->csCtx.state != CS_STATE_IDLE) {
|
if (play->csCtx.state != CS_STATE_IDLE) {
|
||||||
return play->csCtx.actorCues[cueChannel];
|
CsCmdActorCue* cue = play->csCtx.actorCues[cueChannel];
|
||||||
|
|
||||||
|
return cue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,8 +259,8 @@ void DemoIk_Type1Action2(DemoIk* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DemoIk_Type1PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
|
void DemoIk_Type1PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
|
||||||
DemoIk* this = (DemoIk*)thisx;
|
|
||||||
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
||||||
|
DemoIk* this = (DemoIk*)thisx;
|
||||||
|
|
||||||
OPEN_DISPS(gfxCtx, "../z_demo_ik_inArmer.c", 385);
|
OPEN_DISPS(gfxCtx, "../z_demo_ik_inArmer.c", 385);
|
||||||
if (limbIndex == 1) {
|
if (limbIndex == 1) {
|
||||||
|
|
|
@ -118,6 +118,7 @@ void func_80984BE0(DemoIm* this) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
void func_80984C68(DemoIm* this) {
|
void func_80984C68(DemoIm* this) {
|
||||||
this->action = 7;
|
this->action = 7;
|
||||||
this->drawConfig = 0;
|
this->drawConfig = 0;
|
||||||
|
@ -143,6 +144,7 @@ void func_80984C8C(DemoIm* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void DemoIm_InitCollider(Actor* thisx, PlayState* play) {
|
void DemoIm_InitCollider(Actor* thisx, PlayState* play) {
|
||||||
DemoIm* this = (DemoIm*)thisx;
|
DemoIm* this = (DemoIm*)thisx;
|
||||||
|
@ -497,7 +499,9 @@ void func_80985B34(DemoIm* this, PlayState* play) {
|
||||||
|
|
||||||
void func_80985C10(DemoIm* this, PlayState* play) {
|
void func_80985C10(DemoIm* this, PlayState* play) {
|
||||||
func_80985948(this, play);
|
func_80985948(this, play);
|
||||||
|
#if OOT_DEBUG
|
||||||
func_80984C8C(this, play);
|
func_80984C8C(this, play);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80985C40(DemoIm* this, PlayState* play) {
|
void func_80985C40(DemoIm* this, PlayState* play) {
|
||||||
|
@ -505,7 +509,9 @@ void func_80985C40(DemoIm* this, PlayState* play) {
|
||||||
DemoIm_UpdateSkelAnime(this);
|
DemoIm_UpdateSkelAnime(this);
|
||||||
func_80984BE0(this);
|
func_80984BE0(this);
|
||||||
func_809859E0(this, play);
|
func_809859E0(this, play);
|
||||||
|
#if OOT_DEBUG
|
||||||
func_80984C8C(this, play);
|
func_80984C8C(this, play);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80985C94(DemoIm* this, PlayState* play) {
|
void func_80985C94(DemoIm* this, PlayState* play) {
|
||||||
|
@ -513,7 +519,9 @@ void func_80985C94(DemoIm* this, PlayState* play) {
|
||||||
DemoIm_UpdateSkelAnime(this);
|
DemoIm_UpdateSkelAnime(this);
|
||||||
func_80984BE0(this);
|
func_80984BE0(this);
|
||||||
func_80985B34(this, play);
|
func_80985B34(this, play);
|
||||||
|
#if OOT_DEBUG
|
||||||
func_80984C8C(this, play);
|
func_80984C8C(this, play);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void DemoIm_DrawTranslucent(DemoIm* this, PlayState* play) {
|
void DemoIm_DrawTranslucent(DemoIm* this, PlayState* play) {
|
||||||
|
@ -899,6 +907,8 @@ void func_80986BF8(DemoIm* this, PlayState* play) {
|
||||||
|
|
||||||
void func_80986C30(DemoIm* this, PlayState* play) {
|
void func_80986C30(DemoIm* this, PlayState* play) {
|
||||||
if (func_80986A5C(this, play)) {
|
if (func_80986A5C(this, play)) {
|
||||||
|
s32 pad;
|
||||||
|
|
||||||
play->csCtx.script = SEGMENTED_TO_VIRTUAL(gZeldasCourtyardLullabyCs);
|
play->csCtx.script = SEGMENTED_TO_VIRTUAL(gZeldasCourtyardLullabyCs);
|
||||||
gSaveContext.cutsceneTrigger = 1;
|
gSaveContext.cutsceneTrigger = 1;
|
||||||
SET_EVENTCHKINF(EVENTCHKINF_59);
|
SET_EVENTCHKINF(EVENTCHKINF_59);
|
||||||
|
@ -924,10 +934,15 @@ void func_80986CFC(DemoIm* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80986D40(DemoIm* this, PlayState* play) {
|
void func_80986D40(DemoIm* this, PlayState* play) {
|
||||||
|
#if OOT_DEBUG
|
||||||
if (gSaveContext.sceneLayer == 6) {
|
if (gSaveContext.sceneLayer == 6) {
|
||||||
this->action = 19;
|
this->action = 19;
|
||||||
this->drawConfig = 1;
|
this->drawConfig = 1;
|
||||||
} else if (GET_EVENTCHKINF(EVENTCHKINF_80)) {
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (GET_EVENTCHKINF(EVENTCHKINF_80)) {
|
||||||
Actor_Kill(&this->actor);
|
Actor_Kill(&this->actor);
|
||||||
} else if (!GET_EVENTCHKINF(EVENTCHKINF_59)) {
|
} else if (!GET_EVENTCHKINF(EVENTCHKINF_59)) {
|
||||||
this->action = 23;
|
this->action = 23;
|
||||||
|
|
|
@ -277,7 +277,6 @@ void DemoKankyo_Destroy(Actor* thisx, PlayState* play) {
|
||||||
|
|
||||||
void DemoKankyo_SetupType(DemoKankyo* this, PlayState* play) {
|
void DemoKankyo_SetupType(DemoKankyo* this, PlayState* play) {
|
||||||
Player* player = GET_PLAYER(play);
|
Player* player = GET_PLAYER(play);
|
||||||
f32 temp;
|
|
||||||
|
|
||||||
if (this->actor.objectSlot == this->requiredObjectSlot) {
|
if (this->actor.objectSlot == this->requiredObjectSlot) {
|
||||||
switch (this->actor.params) {
|
switch (this->actor.params) {
|
||||||
|
@ -302,12 +301,14 @@ void DemoKankyo_SetupType(DemoKankyo* this, PlayState* play) {
|
||||||
play->envCtx.screenFillColor[2] = 0xFF;
|
play->envCtx.screenFillColor[2] = 0xFF;
|
||||||
play->envCtx.fillScreen = false;
|
play->envCtx.fillScreen = false;
|
||||||
if (this->warpTimer < 21 && this->warpTimer >= 15) {
|
if (this->warpTimer < 21 && this->warpTimer >= 15) {
|
||||||
temp = (this->warpTimer - 15.0f) / 5.0f;
|
f32 temp = (this->warpTimer - 15.0f) / 5.0f;
|
||||||
|
|
||||||
play->envCtx.fillScreen = true;
|
play->envCtx.fillScreen = true;
|
||||||
play->envCtx.screenFillColor[3] = 255 - 255 * temp;
|
play->envCtx.screenFillColor[3] = 255 - 255 * temp;
|
||||||
}
|
}
|
||||||
if (this->warpTimer < 15 && this->warpTimer >= 4) {
|
if (this->warpTimer < 15 && this->warpTimer >= 4) {
|
||||||
temp = (this->warpTimer - 4.0f) / 10.0f;
|
f32 temp = (this->warpTimer - 4.0f) / 10.0f;
|
||||||
|
|
||||||
play->envCtx.fillScreen = true;
|
play->envCtx.fillScreen = true;
|
||||||
play->envCtx.screenFillColor[3] = 255 * temp;
|
play->envCtx.screenFillColor[3] = 255 * temp;
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,6 +126,7 @@ void DemoSa_SetMouthIndex(DemoSa* this, s16 mouthIndex) {
|
||||||
this->mouthIndex = mouthIndex;
|
this->mouthIndex = mouthIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
void func_8098E530(DemoSa* this) {
|
void func_8098E530(DemoSa* this) {
|
||||||
this->action = 7;
|
this->action = 7;
|
||||||
this->drawConfig = 0;
|
this->drawConfig = 0;
|
||||||
|
@ -149,6 +150,7 @@ void func_8098E554(DemoSa* this, PlayState* play) {
|
||||||
*something = 1;
|
*something = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void func_8098E5C8(DemoSa* this, PlayState* play) {
|
void func_8098E5C8(DemoSa* this, PlayState* play) {
|
||||||
Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 30.0f, 30.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2);
|
Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 30.0f, 30.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2);
|
||||||
|
@ -160,7 +162,9 @@ s32 DemoSa_UpdateSkelAnime(DemoSa* this) {
|
||||||
|
|
||||||
CsCmdActorCue* DemoSa_GetCue(PlayState* play, s32 cueChannel) {
|
CsCmdActorCue* DemoSa_GetCue(PlayState* play, s32 cueChannel) {
|
||||||
if (play->csCtx.state != CS_STATE_IDLE) {
|
if (play->csCtx.state != CS_STATE_IDLE) {
|
||||||
return play->csCtx.actorCues[cueChannel];
|
CsCmdActorCue* cue = play->csCtx.actorCues[cueChannel];
|
||||||
|
|
||||||
|
return cue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -438,7 +442,9 @@ void func_8098F050(DemoSa* this, PlayState* play) {
|
||||||
|
|
||||||
void func_8098F0E8(DemoSa* this, PlayState* play) {
|
void func_8098F0E8(DemoSa* this, PlayState* play) {
|
||||||
func_8098EEA8(this, play);
|
func_8098EEA8(this, play);
|
||||||
|
#if OOT_DEBUG
|
||||||
func_8098E554(this, play);
|
func_8098E554(this, play);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_8098F118(DemoSa* this, PlayState* play) {
|
void func_8098F118(DemoSa* this, PlayState* play) {
|
||||||
|
@ -446,7 +452,9 @@ void func_8098F118(DemoSa* this, PlayState* play) {
|
||||||
DemoSa_UpdateSkelAnime(this);
|
DemoSa_UpdateSkelAnime(this);
|
||||||
func_8098E480(this);
|
func_8098E480(this);
|
||||||
func_8098EEFC(this, play);
|
func_8098EEFC(this, play);
|
||||||
|
#if OOT_DEBUG
|
||||||
func_8098E554(this, play);
|
func_8098E554(this, play);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_8098F16C(DemoSa* this, PlayState* play) {
|
void func_8098F16C(DemoSa* this, PlayState* play) {
|
||||||
|
@ -454,7 +462,9 @@ void func_8098F16C(DemoSa* this, PlayState* play) {
|
||||||
DemoSa_UpdateSkelAnime(this);
|
DemoSa_UpdateSkelAnime(this);
|
||||||
func_8098EDB0(this);
|
func_8098EDB0(this);
|
||||||
func_8098F050(this, play);
|
func_8098F050(this, play);
|
||||||
|
#if OOT_DEBUG
|
||||||
func_8098E554(this, play);
|
func_8098E554(this, play);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void DemoSa_DrawXlu(DemoSa* this, PlayState* play) {
|
void DemoSa_DrawXlu(DemoSa* this, PlayState* play) {
|
||||||
|
|
|
@ -58,12 +58,10 @@ void func_80991298(DemoShd* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (play->csCtx.state != CS_STATE_IDLE) {
|
if (play->csCtx.state != CS_STATE_IDLE) {
|
||||||
CsCmdActorCue* cue = play->csCtx.actorCues[0];
|
if (play->csCtx.actorCues[0] != NULL) {
|
||||||
|
if (play->csCtx.actorCues[0]->id == 2) {
|
||||||
if (cue != NULL) {
|
|
||||||
if (cue->id == 2) {
|
|
||||||
if (!(this->unk_14C & 1)) {
|
if (!(this->unk_14C & 1)) {
|
||||||
this->unk_14E = cue->startPos.x;
|
this->unk_14E = play->csCtx.actorCues[0]->startPos.x;
|
||||||
}
|
}
|
||||||
this->unk_14C |= 1;
|
this->unk_14C |= 1;
|
||||||
} else {
|
} else {
|
||||||
|
@ -73,12 +71,10 @@ void func_80991298(DemoShd* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (play->csCtx.state != CS_STATE_IDLE) {
|
if (play->csCtx.state != CS_STATE_IDLE) {
|
||||||
CsCmdActorCue* cue = play->csCtx.actorCues[1];
|
if (play->csCtx.actorCues[1] != NULL) {
|
||||||
|
if (play->csCtx.actorCues[1]->id == 2) {
|
||||||
if (cue != NULL) {
|
|
||||||
if (cue->id == 2) {
|
|
||||||
if (!(this->unk_14C & 2)) {
|
if (!(this->unk_14C & 2)) {
|
||||||
this->unk_14E = cue->startPos.x;
|
this->unk_14E = play->csCtx.actorCues[1]->startPos.x;
|
||||||
}
|
}
|
||||||
this->unk_14C |= 2;
|
this->unk_14C |= 2;
|
||||||
} else {
|
} else {
|
||||||
|
@ -101,8 +97,6 @@ void DemoShd_Draw(Actor* thisx, PlayState* play) {
|
||||||
s32 pad;
|
s32 pad;
|
||||||
u32 unk_14E = this->unk_14E;
|
u32 unk_14E = this->unk_14E;
|
||||||
|
|
||||||
if (1) {} // Necessary to match, can be anywhere in the function
|
|
||||||
|
|
||||||
OPEN_DISPS(play->state.gfxCtx, "../z_demo_shd.c", 726);
|
OPEN_DISPS(play->state.gfxCtx, "../z_demo_shd.c", 726);
|
||||||
|
|
||||||
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
||||||
|
@ -123,5 +117,7 @@ void DemoShd_Draw(Actor* thisx, PlayState* play) {
|
||||||
gSPDisplayList(POLY_XLU_DISP++, D_809934B8);
|
gSPDisplayList(POLY_XLU_DISP++, D_809934B8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (1) {} // Necessary to match
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx, "../z_demo_shd.c", 762);
|
CLOSE_DISPS(play->state.gfxCtx, "../z_demo_shd.c", 762);
|
||||||
}
|
}
|
||||||
|
|
|
@ -456,12 +456,10 @@ s32 DoorWarp1_PlayerInRange(DoorWarp1* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoorWarp1_ChildWarpIdle(DoorWarp1* this, PlayState* play) {
|
void DoorWarp1_ChildWarpIdle(DoorWarp1* this, PlayState* play) {
|
||||||
Player* player;
|
|
||||||
|
|
||||||
Actor_PlaySfx(&this->actor, NA_SE_EV_WARP_HOLE - SFX_FLAG);
|
Actor_PlaySfx(&this->actor, NA_SE_EV_WARP_HOLE - SFX_FLAG);
|
||||||
|
|
||||||
if (DoorWarp1_PlayerInRange(this, play)) {
|
if (DoorWarp1_PlayerInRange(this, play)) {
|
||||||
player = GET_PLAYER(play);
|
Player* player = GET_PLAYER(play);
|
||||||
|
|
||||||
Audio_PlaySfxGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
|
Audio_PlaySfxGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
|
@ -830,12 +828,10 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoorWarp1_Destination(DoorWarp1* this, PlayState* play) {
|
void DoorWarp1_Destination(DoorWarp1* this, PlayState* play) {
|
||||||
f32 alphaFrac;
|
f32 alphaFrac = 1.0f;
|
||||||
|
|
||||||
this->warpTimer++;
|
|
||||||
this->unk_194 = 5.0f;
|
this->unk_194 = 5.0f;
|
||||||
|
this->warpTimer++;
|
||||||
alphaFrac = 1.0f;
|
|
||||||
if (this->warpTimer < 20) {
|
if (this->warpTimer < 20) {
|
||||||
alphaFrac = this->warpTimer / 20.f;
|
alphaFrac = this->warpTimer / 20.f;
|
||||||
} else if (this->warpTimer >= 60) {
|
} else if (this->warpTimer >= 60) {
|
||||||
|
|
|
@ -273,19 +273,16 @@ void EffDust_DrawFunc_8099E4F4(Actor* thisx, PlayState* play2) {
|
||||||
Gfx_SetupDL_25Opa(gfxCtx);
|
Gfx_SetupDL_25Opa(gfxCtx);
|
||||||
|
|
||||||
gDPPipeSync(POLY_XLU_DISP++);
|
gDPPipeSync(POLY_XLU_DISP++);
|
||||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 128, 128, 128, 255);
|
|
||||||
gDPSetEnvColor(POLY_XLU_DISP++, 128, 128, 128, 0);
|
|
||||||
|
|
||||||
initialPositions = this->initialPositions;
|
initialPositions = this->initialPositions;
|
||||||
distanceTraveled = this->distanceTraveled;
|
distanceTraveled = this->distanceTraveled;
|
||||||
|
|
||||||
|
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 128, 128, 128, 255);
|
||||||
|
gDPSetEnvColor(POLY_XLU_DISP++, 128, 128, 128, 0);
|
||||||
gSPSegment(POLY_XLU_DISP++, 0x08, sEmptyDL);
|
gSPSegment(POLY_XLU_DISP++, 0x08, sEmptyDL);
|
||||||
|
|
||||||
for (i = 0; i < 64; i++, initialPositions++, distanceTraveled++) {
|
for (i = 0; i < 64; i++) {
|
||||||
if (!(*distanceTraveled < 1.0f)) {
|
if (*distanceTraveled < 1.0f) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
aux = 1.0f - SQ(*distanceTraveled);
|
aux = 1.0f - SQ(*distanceTraveled);
|
||||||
Matrix_Translate(this->actor.world.pos.x + (initialPositions->x * ((this->dx * aux) + (1.0f - this->dx))),
|
Matrix_Translate(this->actor.world.pos.x + (initialPositions->x * ((this->dx * aux) + (1.0f - this->dx))),
|
||||||
this->actor.world.pos.y + (initialPositions->y * ((this->dy * aux) + (1.0f - this->dy))),
|
this->actor.world.pos.y + (initialPositions->y * ((this->dy * aux) + (1.0f - this->dy))),
|
||||||
|
@ -300,6 +297,10 @@ void EffDust_DrawFunc_8099E4F4(Actor* thisx, PlayState* play2) {
|
||||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL));
|
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initialPositions++;
|
||||||
|
distanceTraveled++;
|
||||||
|
}
|
||||||
|
|
||||||
CLOSE_DISPS(gfxCtx, "../z_eff_dust.c", 458);
|
CLOSE_DISPS(gfxCtx, "../z_eff_dust.c", 458);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,6 +319,10 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, PlayState* play2) {
|
||||||
Gfx_SetupDL_25Opa(gfxCtx);
|
Gfx_SetupDL_25Opa(gfxCtx);
|
||||||
|
|
||||||
gDPPipeSync(POLY_XLU_DISP++);
|
gDPPipeSync(POLY_XLU_DISP++);
|
||||||
|
|
||||||
|
initialPositions = this->initialPositions;
|
||||||
|
distanceTraveled = this->distanceTraveled;
|
||||||
|
|
||||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
|
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
|
||||||
if (player->unk_858 >= 0.85f) {
|
if (player->unk_858 >= 0.85f) {
|
||||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0);
|
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0);
|
||||||
|
@ -325,16 +330,10 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, PlayState* play2) {
|
||||||
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 0);
|
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
initialPositions = this->initialPositions;
|
|
||||||
distanceTraveled = this->distanceTraveled;
|
|
||||||
|
|
||||||
gSPSegment(POLY_XLU_DISP++, 0x08, sEmptyDL);
|
gSPSegment(POLY_XLU_DISP++, 0x08, sEmptyDL);
|
||||||
|
|
||||||
for (i = 0; i < 64; i++, initialPositions++, distanceTraveled++) {
|
for (i = 0; i < 64; i++) {
|
||||||
if (!(*distanceTraveled < 1.0f)) {
|
if (*distanceTraveled < 1.0f) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, *distanceTraveled * 255);
|
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, *distanceTraveled * 255);
|
||||||
|
|
||||||
aux = 1.0f - SQ(*distanceTraveled);
|
aux = 1.0f - SQ(*distanceTraveled);
|
||||||
|
@ -355,6 +354,10 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, PlayState* play2) {
|
||||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL));
|
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initialPositions++;
|
||||||
|
distanceTraveled++;
|
||||||
|
}
|
||||||
|
|
||||||
CLOSE_DISPS(gfxCtx, "../z_eff_dust.c", 515);
|
CLOSE_DISPS(gfxCtx, "../z_eff_dust.c", 515);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,9 @@
|
||||||
void ElfMsg_Init(Actor* thisx, PlayState* play);
|
void ElfMsg_Init(Actor* thisx, PlayState* play);
|
||||||
void ElfMsg_Destroy(Actor* thisx, PlayState* play);
|
void ElfMsg_Destroy(Actor* thisx, PlayState* play);
|
||||||
void ElfMsg_Update(Actor* thisx, PlayState* play);
|
void ElfMsg_Update(Actor* thisx, PlayState* play);
|
||||||
|
#if OOT_DEBUG
|
||||||
void ElfMsg_Draw(Actor* thisx, PlayState* play);
|
void ElfMsg_Draw(Actor* thisx, PlayState* play);
|
||||||
|
#endif
|
||||||
|
|
||||||
void ElfMsg_CallNaviCuboid(ElfMsg* this, PlayState* play);
|
void ElfMsg_CallNaviCuboid(ElfMsg* this, PlayState* play);
|
||||||
void ElfMsg_CallNaviCylinder(ElfMsg* this, PlayState* play);
|
void ElfMsg_CallNaviCylinder(ElfMsg* this, PlayState* play);
|
||||||
|
@ -27,7 +29,11 @@ ActorInit Elf_Msg_InitVars = {
|
||||||
/**/ ElfMsg_Init,
|
/**/ ElfMsg_Init,
|
||||||
/**/ ElfMsg_Destroy,
|
/**/ ElfMsg_Destroy,
|
||||||
/**/ ElfMsg_Update,
|
/**/ ElfMsg_Update,
|
||||||
|
#if OOT_DEBUG
|
||||||
/**/ ElfMsg_Draw,
|
/**/ ElfMsg_Draw,
|
||||||
|
#else
|
||||||
|
/**/ NULL,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static InitChainEntry sInitChain[] = {
|
static InitChainEntry sInitChain[] = {
|
||||||
|
@ -163,6 +169,7 @@ void ElfMsg_Update(Actor* thisx, PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
#include "assets/overlays/ovl_Elf_Msg/ovl_Elf_Msg.c"
|
#include "assets/overlays/ovl_Elf_Msg/ovl_Elf_Msg.c"
|
||||||
|
|
||||||
void ElfMsg_Draw(Actor* thisx, PlayState* play) {
|
void ElfMsg_Draw(Actor* thisx, PlayState* play) {
|
||||||
|
@ -191,3 +198,4 @@ void ElfMsg_Draw(Actor* thisx, PlayState* play) {
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx, "../z_elf_msg.c", 457);
|
CLOSE_DISPS(play->state.gfxCtx, "../z_elf_msg.c", 457);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -12,7 +12,9 @@
|
||||||
void ElfMsg2_Init(Actor* thisx, PlayState* play);
|
void ElfMsg2_Init(Actor* thisx, PlayState* play);
|
||||||
void ElfMsg2_Destroy(Actor* thisx, PlayState* play);
|
void ElfMsg2_Destroy(Actor* thisx, PlayState* play);
|
||||||
void ElfMsg2_Update(Actor* thisx, PlayState* play);
|
void ElfMsg2_Update(Actor* thisx, PlayState* play);
|
||||||
|
#if OOT_DEBUG
|
||||||
void ElfMsg2_Draw(Actor* thisx, PlayState* play);
|
void ElfMsg2_Draw(Actor* thisx, PlayState* play);
|
||||||
|
#endif
|
||||||
|
|
||||||
s32 ElfMsg2_GetMessageId(ElfMsg2* this);
|
s32 ElfMsg2_GetMessageId(ElfMsg2* this);
|
||||||
void ElfMsg2_WaitUntilActivated(ElfMsg2* this, PlayState* play);
|
void ElfMsg2_WaitUntilActivated(ElfMsg2* this, PlayState* play);
|
||||||
|
@ -27,7 +29,11 @@ ActorInit Elf_Msg2_InitVars = {
|
||||||
/**/ ElfMsg2_Init,
|
/**/ ElfMsg2_Init,
|
||||||
/**/ ElfMsg2_Destroy,
|
/**/ ElfMsg2_Destroy,
|
||||||
/**/ ElfMsg2_Update,
|
/**/ ElfMsg2_Update,
|
||||||
|
#if OOT_DEBUG
|
||||||
/**/ ElfMsg2_Draw,
|
/**/ ElfMsg2_Draw,
|
||||||
|
#else
|
||||||
|
/**/ NULL,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static InitChainEntry sInitChain[] = {
|
static InitChainEntry sInitChain[] = {
|
||||||
|
@ -147,6 +153,7 @@ void ElfMsg2_Update(Actor* thisx, PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
#include "assets/overlays/ovl_Elf_Msg2/ovl_Elf_Msg2.c"
|
#include "assets/overlays/ovl_Elf_Msg2/ovl_Elf_Msg2.c"
|
||||||
|
|
||||||
void ElfMsg2_Draw(Actor* thisx, PlayState* play) {
|
void ElfMsg2_Draw(Actor* thisx, PlayState* play) {
|
||||||
|
@ -165,3 +172,4 @@ void ElfMsg2_Draw(Actor* thisx, PlayState* play) {
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx, "../z_elf_msg2.c", 367);
|
CLOSE_DISPS(play->state.gfxCtx, "../z_elf_msg2.c", 367);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -782,7 +782,6 @@ void EnAm_TransformSwordHitbox(Actor* thisx, PlayState* play) {
|
||||||
|
|
||||||
void EnAm_UpdateDamage(EnAm* this, PlayState* play) {
|
void EnAm_UpdateDamage(EnAm* this, PlayState* play) {
|
||||||
s32 pad;
|
s32 pad;
|
||||||
Vec3f sparkPos;
|
|
||||||
|
|
||||||
if (this->deathTimer == 0) {
|
if (this->deathTimer == 0) {
|
||||||
if (this->blockCollider.base.acFlags & AC_BOUNCED) {
|
if (this->blockCollider.base.acFlags & AC_BOUNCED) {
|
||||||
|
@ -810,7 +809,8 @@ void EnAm_UpdateDamage(EnAm* this, PlayState* play) {
|
||||||
this->dyna.actor.colChkInfo.health = 0;
|
this->dyna.actor.colChkInfo.health = 0;
|
||||||
}
|
}
|
||||||
} else if (this->dyna.actor.colChkInfo.damageEffect == AM_DMGEFF_STUN) {
|
} else if (this->dyna.actor.colChkInfo.damageEffect == AM_DMGEFF_STUN) {
|
||||||
sparkPos = this->dyna.actor.world.pos;
|
Vec3f sparkPos = this->dyna.actor.world.pos;
|
||||||
|
|
||||||
sparkPos.y += 50.0f;
|
sparkPos.y += 50.0f;
|
||||||
CollisionCheck_SpawnShieldParticlesMetal(play, &sparkPos);
|
CollisionCheck_SpawnShieldParticlesMetal(play, &sparkPos);
|
||||||
}
|
}
|
||||||
|
@ -836,8 +836,6 @@ void EnAm_Update(Actor* thisx, PlayState* play) {
|
||||||
EnBom* bomb;
|
EnBom* bomb;
|
||||||
Vec3f dustPos;
|
Vec3f dustPos;
|
||||||
s32 i;
|
s32 i;
|
||||||
f32 dustPosScale;
|
|
||||||
s32 pad1;
|
|
||||||
|
|
||||||
if (this->dyna.actor.params != ARMOS_STATUE) {
|
if (this->dyna.actor.params != ARMOS_STATUE) {
|
||||||
EnAm_UpdateDamage(this, play);
|
EnAm_UpdateDamage(this, play);
|
||||||
|
@ -854,7 +852,8 @@ void EnAm_Update(Actor* thisx, PlayState* play) {
|
||||||
this->deathTimer--;
|
this->deathTimer--;
|
||||||
|
|
||||||
if (this->deathTimer == 0) {
|
if (this->deathTimer == 0) {
|
||||||
dustPosScale = play->gameplayFrames * 10;
|
f32 dustPosScale = play->gameplayFrames * 10;
|
||||||
|
s32 pad1;
|
||||||
|
|
||||||
EnAm_SpawnEffects(this, play);
|
EnAm_SpawnEffects(this, play);
|
||||||
bomb =
|
bomb =
|
||||||
|
@ -943,9 +942,9 @@ static Vec3f sIcePosOffsets[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
void EnAm_Draw(Actor* thisx, PlayState* play) {
|
void EnAm_Draw(Actor* thisx, PlayState* play) {
|
||||||
s32 pad;
|
|
||||||
Vec3f sp68;
|
|
||||||
EnAm* this = (EnAm*)thisx;
|
EnAm* this = (EnAm*)thisx;
|
||||||
|
Vec3f sp68;
|
||||||
|
s32 index;
|
||||||
|
|
||||||
OPEN_DISPS(play->state.gfxCtx, "../z_en_am.c", 1580);
|
OPEN_DISPS(play->state.gfxCtx, "../z_en_am.c", 1580);
|
||||||
|
|
||||||
|
@ -959,7 +958,6 @@ void EnAm_Draw(Actor* thisx, PlayState* play) {
|
||||||
this->iceTimer--;
|
this->iceTimer--;
|
||||||
|
|
||||||
if ((this->iceTimer % 4) == 0) {
|
if ((this->iceTimer % 4) == 0) {
|
||||||
s32 index;
|
|
||||||
|
|
||||||
index = this->iceTimer >> 2;
|
index = this->iceTimer >> 2;
|
||||||
|
|
||||||
|
|
|
@ -246,8 +246,6 @@ void EnArrow_Fly(EnArrow* this, PlayState* play) {
|
||||||
s32 atTouched;
|
s32 atTouched;
|
||||||
u16 sfxId;
|
u16 sfxId;
|
||||||
Actor* hitActor;
|
Actor* hitActor;
|
||||||
Vec3f sp60;
|
|
||||||
Vec3f sp54;
|
|
||||||
|
|
||||||
if (DECR(this->timer) == 0) {
|
if (DECR(this->timer) == 0) {
|
||||||
Actor_Kill(&this->actor);
|
Actor_Kill(&this->actor);
|
||||||
|
@ -342,6 +340,9 @@ void EnArrow_Fly(EnArrow* this, PlayState* play) {
|
||||||
|
|
||||||
if (this->hitActor != NULL) {
|
if (this->hitActor != NULL) {
|
||||||
if (this->hitActor->update != NULL) {
|
if (this->hitActor->update != NULL) {
|
||||||
|
Vec3f sp60;
|
||||||
|
Vec3f sp54;
|
||||||
|
|
||||||
Math_Vec3f_Sum(&this->unk_210, &this->unk_250, &sp60);
|
Math_Vec3f_Sum(&this->unk_210, &this->unk_250, &sp60);
|
||||||
Math_Vec3f_Sum(&this->actor.world.pos, &this->unk_250, &sp54);
|
Math_Vec3f_Sum(&this->actor.world.pos, &this->unk_250, &sp54);
|
||||||
|
|
||||||
|
|
|
@ -297,8 +297,6 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) {
|
||||||
EnAttackNiw* this = (EnAttackNiw*)thisx;
|
EnAttackNiw* this = (EnAttackNiw*)thisx;
|
||||||
EnNiw* cucco;
|
EnNiw* cucco;
|
||||||
Player* player = GET_PLAYER(play);
|
Player* player = GET_PLAYER(play);
|
||||||
s32 pad;
|
|
||||||
Vec3f sp30;
|
|
||||||
PlayState* play2 = play;
|
PlayState* play2 = play;
|
||||||
|
|
||||||
this->unk_28C++;
|
this->unk_28C++;
|
||||||
|
@ -343,6 +341,9 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actionFunc != func_809B5C18)) {
|
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actionFunc != func_809B5C18)) {
|
||||||
|
Vec3f sp30;
|
||||||
|
s32 pad;
|
||||||
|
|
||||||
Math_Vec3f_Copy(&sp30, &this->actor.world.pos);
|
Math_Vec3f_Copy(&sp30, &this->actor.world.pos);
|
||||||
sp30.y += this->actor.yDistToWater;
|
sp30.y += this->actor.yDistToWater;
|
||||||
EffectSsGSplash_Spawn(play, &sp30, NULL, NULL, 0, 0x190);
|
EffectSsGSplash_Spawn(play, &sp30, NULL, NULL, 0, 0x190);
|
||||||
|
|
|
@ -492,6 +492,7 @@ void EnBa_Draw(Actor* thisx, PlayState* play) {
|
||||||
Matrix_RotateZYX(this->unk_2A8[i].x, this->unk_2A8[i].y, this->unk_2A8[i].z, MTXMODE_APPLY);
|
Matrix_RotateZYX(this->unk_2A8[i].x, this->unk_2A8[i].y, this->unk_2A8[i].z, MTXMODE_APPLY);
|
||||||
Matrix_Scale(this->unk_200[i].x, this->unk_200[i].y, this->unk_200[i].z, MTXMODE_APPLY);
|
Matrix_Scale(this->unk_200[i].x, this->unk_200[i].y, this->unk_200[i].z, MTXMODE_APPLY);
|
||||||
if ((i == 6) || (i == 13)) {
|
if ((i == 6) || (i == 13)) {
|
||||||
|
if (mtx) {}
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 13:
|
case 13:
|
||||||
Collider_UpdateSpheres(i, &this->collider);
|
Collider_UpdateSpheres(i, &this->collider);
|
||||||
|
|
|
@ -291,9 +291,10 @@ void EnBb_SpawnFlameTrail(PlayState* play, EnBb* this, s16 startAtZero) {
|
||||||
|
|
||||||
void EnBb_KillFlameTrail(EnBb* this) {
|
void EnBb_KillFlameTrail(EnBb* this) {
|
||||||
Actor* actor = &this->actor;
|
Actor* actor = &this->actor;
|
||||||
|
Actor* nextActor;
|
||||||
|
|
||||||
while (actor->child != NULL) {
|
while (actor->child != NULL) {
|
||||||
Actor* nextActor = actor->child;
|
nextActor = actor->child;
|
||||||
|
|
||||||
if (nextActor->id == ACTOR_EN_BB) {
|
if (nextActor->id == ACTOR_EN_BB) {
|
||||||
nextActor->parent = NULL;
|
nextActor->parent = NULL;
|
||||||
|
@ -408,10 +409,10 @@ void EnBb_Destroy(Actor* thisx, PlayState* play) {
|
||||||
void EnBb_SetupFlameTrail(EnBb* this) {
|
void EnBb_SetupFlameTrail(EnBb* this) {
|
||||||
this->action = BB_FLAME_TRAIL;
|
this->action = BB_FLAME_TRAIL;
|
||||||
this->moveMode = BBMOVE_NOCLIP;
|
this->moveMode = BBMOVE_NOCLIP;
|
||||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
|
||||||
this->actor.velocity.y = 0.0f;
|
this->actor.velocity.y = 0.0f;
|
||||||
this->actor.gravity = 0.0f;
|
this->actor.gravity = 0.0f;
|
||||||
this->actor.speed = 0.0f;
|
this->actor.speed = 0.0f;
|
||||||
|
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||||
EnBb_SetupAction(this, EnBb_FlameTrail);
|
EnBb_SetupAction(this, EnBb_FlameTrail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,9 +121,7 @@ void func_809BC2A4(EnBdfire* this, PlayState* play) {
|
||||||
void func_809BC598(EnBdfire* this, PlayState* play) {
|
void func_809BC598(EnBdfire* this, PlayState* play) {
|
||||||
s16 quarterTurn;
|
s16 quarterTurn;
|
||||||
Player* player = GET_PLAYER(play);
|
Player* player = GET_PLAYER(play);
|
||||||
f32 distToBurn;
|
|
||||||
BossDodongo* bossDodongo;
|
BossDodongo* bossDodongo;
|
||||||
s16 i;
|
|
||||||
|
|
||||||
bossDodongo = ((BossDodongo*)this->actor.parent);
|
bossDodongo = ((BossDodongo*)this->actor.parent);
|
||||||
this->unk_158 = bossDodongo->unk_1A2;
|
this->unk_158 = bossDodongo->unk_1A2;
|
||||||
|
@ -164,8 +162,11 @@ void func_809BC598(EnBdfire* this, PlayState* play) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (!player->bodyIsBurning) {
|
} else if (!player->bodyIsBurning) {
|
||||||
distToBurn = (this->actor.scale.x * 130.0f) / 4.2000003f;
|
f32 distToBurn = (this->actor.scale.x * 130.0f) / 4.2000003f;
|
||||||
|
|
||||||
if (this->actor.xyzDistToPlayerSq < SQ(distToBurn)) {
|
if (this->actor.xyzDistToPlayerSq < SQ(distToBurn)) {
|
||||||
|
s16 i;
|
||||||
|
|
||||||
for (i = 0; i < 18; i++) {
|
for (i = 0; i < 18; i++) {
|
||||||
player->bodyFlameTimers[i] = Rand_S16Offset(0, 200);
|
player->bodyFlameTimers[i] = Rand_S16Offset(0, 200);
|
||||||
}
|
}
|
||||||
|
|
|
@ -837,6 +837,7 @@ s32 EnBigokuta_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
|
||||||
gDPPipeSync(POLY_OPA_DISP++);
|
gDPPipeSync(POLY_OPA_DISP++);
|
||||||
|
|
||||||
gDPSetEnvColor(POLY_OPA_DISP++, temp_f0, temp_f0, temp_f0, 255);
|
gDPSetEnvColor(POLY_OPA_DISP++, temp_f0, temp_f0, temp_f0, 255);
|
||||||
|
if (1) {}
|
||||||
CLOSE_DISPS(play->state.gfxCtx, "../z_en_bigokuta.c", 1945);
|
CLOSE_DISPS(play->state.gfxCtx, "../z_en_bigokuta.c", 1945);
|
||||||
}
|
}
|
||||||
} else if (limbIndex == 10) {
|
} else if (limbIndex == 10) {
|
||||||
|
@ -848,7 +849,7 @@ s32 EnBigokuta_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
|
||||||
}
|
}
|
||||||
gDPPipeSync(POLY_OPA_DISP++);
|
gDPPipeSync(POLY_OPA_DISP++);
|
||||||
gDPSetEnvColor(POLY_OPA_DISP++, intensity, intensity, intensity, intensity);
|
gDPSetEnvColor(POLY_OPA_DISP++, intensity, intensity, intensity, intensity);
|
||||||
|
if (1) {}
|
||||||
CLOSE_DISPS(play->state.gfxCtx, "../z_en_bigokuta.c", 1972);
|
CLOSE_DISPS(play->state.gfxCtx, "../z_en_bigokuta.c", 1972);
|
||||||
} else if (limbIndex == 17 && this->actionFunc == func_809BE26C) {
|
} else if (limbIndex == 17 && this->actionFunc == func_809BE26C) {
|
||||||
if (this->unk_198 < 5) {
|
if (this->unk_198 < 5) {
|
||||||
|
|
|
@ -143,12 +143,12 @@ void EnBili_SetupFloatIdle(EnBili* this) {
|
||||||
this->actor.speed = 0.7f;
|
this->actor.speed = 0.7f;
|
||||||
this->collider.elem.bumper.effect = 1; // Shock?
|
this->collider.elem.bumper.effect = 1; // Shock?
|
||||||
this->timer = 32;
|
this->timer = 32;
|
||||||
this->collider.base.atFlags |= AT_ON;
|
|
||||||
this->collider.base.acFlags |= AC_ON;
|
|
||||||
this->actionFunc = EnBili_FloatIdle;
|
|
||||||
this->actor.home.pos.y = this->actor.world.pos.y;
|
this->actor.home.pos.y = this->actor.world.pos.y;
|
||||||
this->actor.gravity = 0.0f;
|
this->actor.gravity = 0.0f;
|
||||||
this->actor.velocity.y = 0.0f;
|
this->actor.velocity.y = 0.0f;
|
||||||
|
this->collider.base.atFlags |= AT_ON;
|
||||||
|
this->collider.base.acFlags |= AC_ON;
|
||||||
|
this->actionFunc = EnBili_FloatIdle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -474,7 +474,7 @@ Gfx* EnBombf_NewMtxDList(GraphicsContext* gfxCtx, PlayState* play) {
|
||||||
Matrix_ReplaceRotation(&play->billboardMtxF);
|
Matrix_ReplaceRotation(&play->billboardMtxF);
|
||||||
gSPMatrix(displayListHead++, MATRIX_NEW(gfxCtx, "../z_en_bombf.c", 1021),
|
gSPMatrix(displayListHead++, MATRIX_NEW(gfxCtx, "../z_en_bombf.c", 1021),
|
||||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
gSPEndDisplayList(displayListHead);
|
gSPEndDisplayList(displayListHead++);
|
||||||
return displayList;
|
return displayList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -482,8 +482,6 @@ void EnBombf_Draw(Actor* thisx, PlayState* play) {
|
||||||
s32 pad;
|
s32 pad;
|
||||||
EnBombf* this = (EnBombf*)thisx;
|
EnBombf* this = (EnBombf*)thisx;
|
||||||
|
|
||||||
if (1) {}
|
|
||||||
|
|
||||||
OPEN_DISPS(play->state.gfxCtx, "../z_en_bombf.c", 1034);
|
OPEN_DISPS(play->state.gfxCtx, "../z_en_bombf.c", 1034);
|
||||||
|
|
||||||
if (thisx->params <= BOMBFLOWER_BODY) {
|
if (thisx->params <= BOMBFLOWER_BODY) {
|
||||||
|
@ -510,5 +508,7 @@ void EnBombf_Draw(Actor* thisx, PlayState* play) {
|
||||||
Collider_UpdateSpheres(0, &this->explosionCollider);
|
Collider_UpdateSpheres(0, &this->explosionCollider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (1) {}
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx, "../z_en_bombf.c", 1063);
|
CLOSE_DISPS(play->state.gfxCtx, "../z_en_bombf.c", 1063);
|
||||||
}
|
}
|
||||||
|
|
|
@ -272,5 +272,7 @@ void EnBoom_Draw(Actor* thisx, PlayState* play) {
|
||||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
gSPDisplayList(POLY_OPA_DISP++, gBoomerangRefDL);
|
gSPDisplayList(POLY_OPA_DISP++, gBoomerangRefDL);
|
||||||
|
|
||||||
|
if (1) {}
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx, "../z_en_boom.c", 604);
|
CLOSE_DISPS(play->state.gfxCtx, "../z_en_boom.c", 604);
|
||||||
}
|
}
|
||||||
|
|
|
@ -425,6 +425,8 @@ void EnBubble_Draw(Actor* thisx, PlayState* play) {
|
||||||
gSPDisplayList(POLY_XLU_DISP++, gBubbleDL);
|
gSPDisplayList(POLY_XLU_DISP++, gBubbleDL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (1) {}
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx, "../z_en_bubble.c", 1226);
|
CLOSE_DISPS(play->state.gfxCtx, "../z_en_bubble.c", 1226);
|
||||||
|
|
||||||
if (this->actionFunc != EnBubble_Disappear) {
|
if (this->actionFunc != EnBubble_Disappear) {
|
||||||
|
|
|
@ -859,7 +859,7 @@ void EnBw_Draw(Actor* thisx, PlayState* play2) {
|
||||||
POLY_OPA_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
POLY_OPA_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||||
EnBw_OverrideLimbDraw, NULL, this, POLY_OPA_DISP);
|
EnBw_OverrideLimbDraw, NULL, this, POLY_OPA_DISP);
|
||||||
} else {
|
} else {
|
||||||
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
Gfx_SetupDL_25Xlu(play2->state.gfxCtx);
|
||||||
gDPPipeSync(POLY_XLU_DISP++);
|
gDPPipeSync(POLY_XLU_DISP++);
|
||||||
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 0, 0, 0, this->color1.a);
|
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 0, 0, 0, this->color1.a);
|
||||||
gDPSetEnvColor(POLY_XLU_DISP++, this->color1.r, this->color1.g, this->color1.b, this->color1.a);
|
gDPSetEnvColor(POLY_XLU_DISP++, this->color1.r, this->color1.g, this->color1.b, this->color1.a);
|
||||||
|
@ -906,5 +906,8 @@ void EnBw_Draw(Actor* thisx, PlayState* play2) {
|
||||||
EffectSsEnIce_SpawnFlyingVec3f(play, thisx, &icePos, 0x96, 0x96, 0x96, 0xFA, 0xEB, 0xF5, 0xFF, 1.3f);
|
EffectSsEnIce_SpawnFlyingVec3f(play, thisx, &icePos, 0x96, 0x96, 0x96, 0xFA, 0xEB, 0xF5, 0xFF, 1.3f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (1) {}
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx, "../z_en_bw.c", 1521);
|
CLOSE_DISPS(play->state.gfxCtx, "../z_en_bw.c", 1521);
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,6 +205,7 @@ void EnBx_Draw(Actor* thisx, PlayState* play) {
|
||||||
s32 pad;
|
s32 pad;
|
||||||
Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, 4 * sizeof(Mtx));
|
Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, 4 * sizeof(Mtx));
|
||||||
s16 i;
|
s16 i;
|
||||||
|
s16 off;
|
||||||
|
|
||||||
OPEN_DISPS(play->state.gfxCtx, "../z_en_bx.c", 464);
|
OPEN_DISPS(play->state.gfxCtx, "../z_en_bx.c", 464);
|
||||||
|
|
||||||
|
@ -226,7 +227,7 @@ void EnBx_Draw(Actor* thisx, PlayState* play) {
|
||||||
thisx->scale.z = thisx->scale.x = (Math_CosS(this->unk_14E) * 0.0075f) + 0.015f;
|
thisx->scale.z = thisx->scale.x = (Math_CosS(this->unk_14E) * 0.0075f) + 0.015f;
|
||||||
|
|
||||||
for (i = 3; i >= 0; i--) {
|
for (i = 3; i >= 0; i--) {
|
||||||
s16 off = (0x2000 * i);
|
off = (0x2000 * i);
|
||||||
|
|
||||||
this->unk_184[i].z = this->unk_184[i].x = (Math_CosS(this->unk_14E + off) * 0.0075f) + 0.015f;
|
this->unk_184[i].z = this->unk_184[i].x = (Math_CosS(this->unk_14E + off) * 0.0075f) + 0.015f;
|
||||||
this->unk_1B4[i].x = thisx->shape.rot.x;
|
this->unk_1B4[i].x = thisx->shape.rot.x;
|
||||||
|
|
|
@ -283,11 +283,15 @@ void EnClearTag_Init(Actor* thisx, PlayState* play) {
|
||||||
* This is used for the ground flash display lists and Arwing shadow display lists to snap onto the floor.
|
* This is used for the ground flash display lists and Arwing shadow display lists to snap onto the floor.
|
||||||
*/
|
*/
|
||||||
void EnClearTag_CalculateFloorTangent(EnClearTag* this) {
|
void EnClearTag_CalculateFloorTangent(EnClearTag* this) {
|
||||||
|
f32 x;
|
||||||
|
f32 y;
|
||||||
|
f32 z;
|
||||||
|
|
||||||
// If there is a floor poly below the Arwing, calculate the floor tangent.
|
// If there is a floor poly below the Arwing, calculate the floor tangent.
|
||||||
if (this->actor.floorPoly != NULL) {
|
if (this->actor.floorPoly != NULL) {
|
||||||
f32 x = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.x);
|
x = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.x);
|
||||||
f32 y = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.y);
|
y = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.y);
|
||||||
f32 z = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.z);
|
z = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.z);
|
||||||
|
|
||||||
this->floorTangent.x = -Math_FAtan2F(-z * y, 1.0f);
|
this->floorTangent.x = -Math_FAtan2F(-z * y, 1.0f);
|
||||||
this->floorTangent.z = Math_FAtan2F(-x * y, 1.0f);
|
this->floorTangent.z = Math_FAtan2F(-x * y, 1.0f);
|
||||||
|
|
|
@ -285,8 +285,6 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) {
|
||||||
void EnCrow_DiveAttack(EnCrow* this, PlayState* play) {
|
void EnCrow_DiveAttack(EnCrow* this, PlayState* play) {
|
||||||
Player* player = GET_PLAYER(play);
|
Player* player = GET_PLAYER(play);
|
||||||
s32 facingPlayer;
|
s32 facingPlayer;
|
||||||
Vec3f pos;
|
|
||||||
s16 target;
|
|
||||||
|
|
||||||
SkelAnime_Update(&this->skelAnime);
|
SkelAnime_Update(&this->skelAnime);
|
||||||
if (this->timer != 0) {
|
if (this->timer != 0) {
|
||||||
|
@ -296,6 +294,9 @@ void EnCrow_DiveAttack(EnCrow* this, PlayState* play) {
|
||||||
facingPlayer = Actor_IsFacingPlayer(&this->actor, 0x2800);
|
facingPlayer = Actor_IsFacingPlayer(&this->actor, 0x2800);
|
||||||
|
|
||||||
if (facingPlayer) {
|
if (facingPlayer) {
|
||||||
|
Vec3f pos;
|
||||||
|
s16 target;
|
||||||
|
|
||||||
pos.x = player->actor.world.pos.x;
|
pos.x = player->actor.world.pos.x;
|
||||||
pos.y = player->actor.world.pos.y + 20.0f;
|
pos.y = player->actor.world.pos.y + 20.0f;
|
||||||
pos.z = player->actor.world.pos.z;
|
pos.z = player->actor.world.pos.z;
|
||||||
|
|
|
@ -296,8 +296,6 @@ void EnDh_SetupAttack(EnDh* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnDh_Attack(EnDh* this, PlayState* play) {
|
void EnDh_Attack(EnDh* this, PlayState* play) {
|
||||||
s32 pad;
|
|
||||||
|
|
||||||
if (SkelAnime_Update(&this->skelAnime)) {
|
if (SkelAnime_Update(&this->skelAnime)) {
|
||||||
this->actionState++;
|
this->actionState++;
|
||||||
} else if ((this->actor.xzDistToPlayer > 100.0f) || !Actor_IsFacingPlayer(&this->actor, 60 * 0x10000 / 360)) {
|
} else if ((this->actor.xzDistToPlayer > 100.0f) || !Actor_IsFacingPlayer(&this->actor, 60 * 0x10000 / 360)) {
|
||||||
|
@ -336,6 +334,8 @@ void EnDh_Attack(EnDh* this, PlayState* play) {
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if ((this->actor.xzDistToPlayer <= 100.0f) && (Actor_IsFacingPlayer(&this->actor, 60 * 0x10000 / 360))) {
|
if ((this->actor.xzDistToPlayer <= 100.0f) && (Actor_IsFacingPlayer(&this->actor, 60 * 0x10000 / 360))) {
|
||||||
|
s32 pad;
|
||||||
|
|
||||||
Animation_Change(&this->skelAnime, &object_dh_Anim_004658, 1.0f, 20.0f,
|
Animation_Change(&this->skelAnime, &object_dh_Anim_004658, 1.0f, 20.0f,
|
||||||
Animation_GetLastFrame(&object_dh_Anim_004658), ANIMMODE_ONCE, -6.0f);
|
Animation_GetLastFrame(&object_dh_Anim_004658), ANIMMODE_ONCE, -6.0f);
|
||||||
this->actionState = 0;
|
this->actionState = 0;
|
||||||
|
|
|
@ -125,6 +125,8 @@ void EnDivingGame_SpawnRuppy(EnDivingGame* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 EnDivingGame_HasMinigameFinished(EnDivingGame* this, PlayState* play) {
|
s32 EnDivingGame_HasMinigameFinished(EnDivingGame* this, PlayState* play) {
|
||||||
|
s32 rupeesNeeded;
|
||||||
|
|
||||||
if ((gSaveContext.timerState == TIMER_STATE_STOP) && !Play_InCsMode(play)) {
|
if ((gSaveContext.timerState == TIMER_STATE_STOP) && !Play_InCsMode(play)) {
|
||||||
// Failed.
|
// Failed.
|
||||||
gSaveContext.timerState = TIMER_STATE_OFF;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
|
@ -138,7 +140,7 @@ s32 EnDivingGame_HasMinigameFinished(EnDivingGame* this, PlayState* play) {
|
||||||
this->actionFunc = func_809EE048;
|
this->actionFunc = func_809EE048;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
s32 rupeesNeeded = 5;
|
rupeesNeeded = 5;
|
||||||
|
|
||||||
if (GET_EVENTCHKINF(EVENTCHKINF_38)) {
|
if (GET_EVENTCHKINF(EVENTCHKINF_38)) {
|
||||||
rupeesNeeded = 10;
|
rupeesNeeded = 10;
|
||||||
|
|
|
@ -77,6 +77,7 @@ static u16 sStartingTextIds[] = {
|
||||||
0x10A0, 0x10A1, 0x10A2, 0x10CA, 0x10CB, 0x10CC, 0x10CD, 0x10CE, 0x10CF, 0x10DC, 0x10DD,
|
0x10A0, 0x10A1, 0x10A2, 0x10CA, 0x10CB, 0x10CC, 0x10CD, 0x10CE, 0x10CF, 0x10DC, 0x10DD,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
static char* sItemDebugTxt[] = {
|
static char* sItemDebugTxt[] = {
|
||||||
"デクの実売り ", // "Deku Nuts"
|
"デクの実売り ", // "Deku Nuts"
|
||||||
"デクの棒売り ", // "Deku Sticks"
|
"デクの棒売り ", // "Deku Sticks"
|
||||||
|
@ -90,6 +91,7 @@ static char* sItemDebugTxt[] = {
|
||||||
"デクの棒持てる数を増やす", // "Deku Stick Upgrade"
|
"デクの棒持てる数を増やす", // "Deku Stick Upgrade"
|
||||||
"デクの実持てる数を増やす", // "Deku Nut Upgrade"
|
"デクの実持てる数を増やす", // "Deku Nut Upgrade"
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
static DnsItemEntry sItemDekuNuts = { 20, 5, GI_DEKU_NUTS_5_2, EnDns_CanBuyDekuNuts, EnDns_PayForDekuNuts };
|
static DnsItemEntry sItemDekuNuts = { 20, 5, GI_DEKU_NUTS_5_2, EnDns_CanBuyDekuNuts, EnDns_PayForDekuNuts };
|
||||||
static DnsItemEntry sItemDekuSticks = { 15, 1, GI_DEKU_STICKS_1, EnDns_CanBuyDekuSticks, EnDns_PayPrice };
|
static DnsItemEntry sItemDekuSticks = { 15, 1, GI_DEKU_STICKS_1, EnDns_CanBuyDekuSticks, EnDns_PayPrice };
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue